Example usage for android.widget TabWidget getChildTabViewAt

List of usage examples for android.widget TabWidget getChildTabViewAt

Introduction

In this page you can find the example usage for android.widget TabWidget getChildTabViewAt.

Prototype

public View getChildTabViewAt(int index) 

Source Link

Document

Returns the tab indicator view at the given index.

Usage

From source file:com.custom.music.MusicBrowserActivity.java

@Override
public void onConfigurationChanged(Configuration newConfig) {
    super.onConfigurationChanged(newConfig);
    Log.i(TAG, "<onConfigurationChanged>", Log.APP);
    TabWidget tabWidgetTemp = mTabHost.getTabWidget();
    View tabView;//  ww  w.j a  va 2  s . co m
    Activity activity;
    int viewStatusForTab = View.GONE;

    mOrientaiton = newConfig.orientation;
    if (mOrientaiton == Configuration.ORIENTATION_LANDSCAPE) {
        Log.i(TAG, "onConfigurationChanged--LandScape", Log.APP);
        viewStatusForTab = View.VISIBLE;
    }
    if (mService != null) {
        MusicUtils.updateNowPlaying(MusicBrowserActivity.this, mOrientaiton);
        updatePlaybackTab();
    }
    /// M: load tab which is alive only for Landscape;
    for (int i = PLAYBACK_INDEX; i < mTabCount; i++) {
        tabView = tabWidgetTemp.getChildTabViewAt(i);
        if (tabView != null) {
            tabView.setVisibility(viewStatusForTab);
        }
    }
    /// M: notify sub Activity for configuration changed;
    for (int i = 0; i < PLAYBACK_INDEX; i++) {
        activity = mActivityManager.getActivity(getStringId(i));
        if (activity != null) {
            activity.onConfigurationChanged(newConfig);
        }
    }

    if (!mHasMenukey) {
        boolean popupMenuShowing = mPopupMenuShowing;
        if (popupMenuShowing && mPopupMenu != null) {
            mPopupMenu.dismiss();
            Log.i(TAG, "changeFakeMenu:mPopupMenu.dismiss()", Log.APP);
        }
        Log.i(TAG, "changeFakeMenu:popupMenuShowing=" + popupMenuShowing, Log.APP);
        createFakeMenu();
        if (popupMenuShowing && mOverflowMenuButton != null) {
            mOverflowMenuButton.performClick();
            Log.i(TAG, "changeFakeMenu:performClick()", Log.APP);
        }
    }
    Log.i(TAG, "onConfigurationChanged >>>", Log.APP);
}