Search in sources :

Example 51 with TabHost

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);
}
Also used : TabHost(android.widget.TabHost) Intent(android.content.Intent)

Example 52 with TabHost

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);
}
Also used : TabHost(android.widget.TabHost) Intent(android.content.Intent)

Example 53 with TabHost

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);
}
Also used : TabHost(android.widget.TabHost) Intent(android.content.Intent)

Example 54 with TabHost

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);
}
Also used : ListView(android.widget.ListView) TabHost(android.widget.TabHost) TextView(android.widget.TextView)

Example 55 with TabHost

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;
}
Also used : TabHost(android.widget.TabHost) ViewGroup(android.view.ViewGroup) View(android.view.View)

Aggregations

TabHost (android.widget.TabHost)74 View (android.view.View)29 Intent (android.content.Intent)21 ViewGroup (android.view.ViewGroup)19 ListView (android.widget.ListView)18 Test (org.junit.Test)17 TabWidget (android.widget.TabWidget)15 AdapterView (android.widget.AdapterView)13 AbsListView (android.widget.AbsListView)12 ExpandableListView (android.widget.ExpandableListView)12 TextView (android.widget.TextView)12 ActionMenuView (android.widget.ActionMenuView)10 ActionMenuItemView (com.android.internal.view.menu.ActionMenuItemView)10 IconMenuItemView (com.android.internal.view.menu.IconMenuItemView)10 ListMenuItemView (com.android.internal.view.menu.ListMenuItemView)10 MenuView (com.android.internal.view.menu.MenuView)10 FrameLayout (android.widget.FrameLayout)7 LinearLayout (android.widget.LinearLayout)7 AbsSpinner (android.widget.AbsSpinner)6 QuickContactBadge (android.widget.QuickContactBadge)6