зеркало из https://github.com/mozilla/gecko-dev.git
Bug 845511: Accessibility strings for tabs ui. [r=mfinkle]
--HG-- extra : rebase_source : d98af982cea4c526070f03f647dc668013a0b1d5
This commit is contained in:
Родитель
851ff52806
Коммит
037fe6c066
|
@ -10,6 +10,7 @@ import org.mozilla.gecko.widget.IconTabWidget;
|
|||
import org.mozilla.gecko.widget.TwoWayView;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.Resources;
|
||||
import android.content.res.TypedArray;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.Rect;
|
||||
|
@ -106,10 +107,20 @@ public class TabsPanel extends LinearLayout
|
|||
}
|
||||
});
|
||||
|
||||
ImageButton button;
|
||||
Resources resources = getContext().getResources();
|
||||
|
||||
mTabWidget = (IconTabWidget) findViewById(R.id.tab_widget);
|
||||
mTabWidget.addTab(R.drawable.tabs_normal);
|
||||
mTabWidget.addTab(R.drawable.tabs_private);
|
||||
mTabWidget.addTab(R.drawable.tabs_synced);
|
||||
|
||||
button = mTabWidget.addTab(R.drawable.tabs_normal);
|
||||
button.setContentDescription(resources.getString(R.string.tabs_normal));
|
||||
|
||||
button = mTabWidget.addTab(R.drawable.tabs_private);
|
||||
button.setContentDescription(resources.getString(R.string.tabs_private));
|
||||
|
||||
button = mTabWidget.addTab(R.drawable.tabs_synced);
|
||||
button.setContentDescription(resources.getString(R.string.tabs_synced));
|
||||
|
||||
mTabWidget.setTabSelectionListener(this);
|
||||
}
|
||||
|
||||
|
|
|
@ -26,13 +26,14 @@ public class IconTabWidget extends TabWidget {
|
|||
mContext = context;
|
||||
}
|
||||
|
||||
public void addTab(int resId) {
|
||||
public ImageButton addTab(int resId) {
|
||||
ImageButton button = (ImageButton) LayoutInflater.from(mContext).inflate(R.layout.tabs_panel_indicator, null);
|
||||
button.setImageResource(resId);
|
||||
|
||||
addView(button);
|
||||
button.setOnClickListener(new TabClickListener(getTabCount() - 1));
|
||||
button.setOnFocusChangeListener(this);
|
||||
return button;
|
||||
}
|
||||
|
||||
public void setTabSelectionListener(OnTabChangedListener listener) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче