Search in sources :

Example 1 with SlidingTabLayout

use of com.android.settings.widget.SlidingTabLayout in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class DashboardContainerFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) {
    final View content = inflater.inflate(R.layout.dashboard_container, parent, false);
    mViewPager = (RtlCompatibleViewPager) content.findViewById(R.id.pager);
    mPagerAdapter = new DashboardViewPagerAdapter(getContext(), getChildFragmentManager(), mViewPager);
    mViewPager.setAdapter(mPagerAdapter);
    mViewPager.addOnPageChangeListener(new TabChangeListener((SettingsActivity) getActivity()));
    // check if support tab needs to be selected
    final String selectedTab = getArguments().getString(EXTRA_SELECT_SETTINGS_TAB, ARG_SUMMARY_TAB);
    if (TextUtils.equals(selectedTab, ARG_SUPPORT_TAB)) {
        mViewPager.setCurrentItem(INDEX_SUPPORT_FRAGMENT);
    } else {
        mViewPager.setCurrentItem(INDEX_SUMMARY_FRAGMENT);
    }
    mHeaderView = inflater.inflate(R.layout.dashboard_container_header, parent, false);
    ((SlidingTabLayout) mHeaderView).setViewPager(mViewPager);
    return content;
}
Also used : SlidingTabLayout(com.android.settings.widget.SlidingTabLayout) View(android.view.View) SettingsActivity(com.android.settings.SettingsActivity)

Aggregations

View (android.view.View)1 SettingsActivity (com.android.settings.SettingsActivity)1 SlidingTabLayout (com.android.settings.widget.SlidingTabLayout)1