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;
}
Aggregations