use of android.widget.TabHost in project android_frameworks_base by DirtyUnicorns.
the class MediaDump method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// TODO: Read/Write the settings.
setContentView(R.layout.main);
TabHost tab = getTabHost();
// Setup video dumping tab
TabHost.TabSpec videoDumpTab = tab.newTabSpec("VideoDump");
videoDumpTab.setIndicator("VideoDump");
Intent videoDumpIntent = new Intent(this, VideoDumpActivity.class);
videoDumpTab.setContent(videoDumpIntent);
tab.addTab(videoDumpTab);
// Setup rgb player tab
TabHost.TabSpec rgbPlayerTab = tab.newTabSpec("RgbPlayer");
rgbPlayerTab.setIndicator("RgbPlayer");
Intent rgbPlayerIntent = new Intent(this, RgbPlayerActivity.class);
rgbPlayerTab.setContent(rgbPlayerIntent);
tab.addTab(rgbPlayerTab);
}
use of android.widget.TabHost in project android_frameworks_base by crdroidandroid.
the class MediaDump method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// TODO: Read/Write the settings.
setContentView(R.layout.main);
TabHost tab = getTabHost();
// Setup video dumping tab
TabHost.TabSpec videoDumpTab = tab.newTabSpec("VideoDump");
videoDumpTab.setIndicator("VideoDump");
Intent videoDumpIntent = new Intent(this, VideoDumpActivity.class);
videoDumpTab.setContent(videoDumpIntent);
tab.addTab(videoDumpTab);
// Setup rgb player tab
TabHost.TabSpec rgbPlayerTab = tab.newTabSpec("RgbPlayer");
rgbPlayerTab.setIndicator("RgbPlayer");
Intent rgbPlayerIntent = new Intent(this, RgbPlayerActivity.class);
rgbPlayerTab.setContent(rgbPlayerIntent);
tab.addTab(rgbPlayerTab);
}
use of android.widget.TabHost in project android_frameworks_base by crdroidandroid.
the class LaunchpadTabActivity method onCreate.
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
Intent tabIntent = new Intent(getIntent());
tabIntent.setComponent((ComponentName) tabIntent.getParcelableExtra("tab"));
TabHost th = getTabHost();
TabHost.TabSpec ts = th.newTabSpec("1");
ts.setIndicator("One");
ts.setContent(tabIntent);
th.addTab(ts);
}
use of android.widget.TabHost in project zype-android by zype.
the class TracksChooserDialog method setUpView.
private void setUpView(View view) {
ListView listView1 = (ListView) view.findViewById(R.id.listview1);
ListView listView2 = (ListView) view.findViewById(R.id.listview2);
TextView textEmptyMessageView = (TextView) view.findViewById(R.id.text_empty_message);
TextView audioEmptyMessageView = (TextView) view.findViewById(R.id.audio_empty_message);
partitionTracks();
mTextAdapter = new TracksListAdapter(getActivity(), R.layout.tracks_row_layout, mTextTracks, mSelectedTextPosition);
mAudioVideoAdapter = new TracksListAdapter(getActivity(), R.layout.tracks_row_layout, mAudioTracks, mSelectedAudioPosition);
listView1.setAdapter(mTextAdapter);
listView2.setAdapter(mAudioVideoAdapter);
TabHost tabs = (TabHost) view.findViewById(R.id.tabhost);
tabs.setup();
// create tab 1
TabHost.TabSpec tab1 = tabs.newTabSpec("tab1");
if (mTextTracks == null || mTextTracks.isEmpty()) {
listView1.setVisibility(View.INVISIBLE);
tab1.setContent(R.id.text_empty_message);
} else {
textEmptyMessageView.setVisibility(View.INVISIBLE);
tab1.setContent(R.id.listview1);
}
tab1.setIndicator(getString(R.string.ccl_caption_subtitles));
tabs.addTab(tab1);
// create tab 2
TabHost.TabSpec tab2 = tabs.newTabSpec("tab2");
if (mAudioTracks == null || mAudioTracks.isEmpty()) {
listView2.setVisibility(View.INVISIBLE);
tab2.setContent(R.id.audio_empty_message);
} else {
audioEmptyMessageView.setVisibility(View.INVISIBLE);
tab2.setContent(R.id.listview2);
}
tab2.setIndicator(getString(R.string.ccl_caption_audio));
tabs.addTab(tab2);
}
use of android.widget.TabHost in project android_packages_apps_Launcher2 by CyanogenMod.
the class FocusHelper method handleAppsCustomizeTabKeyEvent.
/**
* Handles key events in a AppsCustomize tab between the last tab view and the shop button.
*/
static boolean handleAppsCustomizeTabKeyEvent(View v, int keyCode, KeyEvent e) {
final TabHost tabHost = findTabHostParent(v);
final ViewGroup contents = tabHost.getTabContentView();
final View shop = tabHost.findViewById(R.id.market_button);
final int action = e.getAction();
final boolean handleKeyEvent = (action != KeyEvent.ACTION_UP);
boolean wasHandled = false;
switch(keyCode) {
case KeyEvent.KEYCODE_DPAD_RIGHT:
if (handleKeyEvent) {
// Select the shop button if we aren't on it
if (v != shop) {
shop.requestFocus();
}
}
wasHandled = true;
break;
case KeyEvent.KEYCODE_DPAD_DOWN:
if (handleKeyEvent) {
// Select the content view (down is handled by the tab key handler otherwise)
if (v == shop) {
contents.requestFocus();
wasHandled = true;
}
}
break;
default:
break;
}
return wasHandled;
}
Aggregations