Search in sources :

Example 1 with TabbedParticipantPagerAdapter

use of com.waz.zclient.pages.main.participants.views.TabbedParticipantPagerAdapter in project wire-android by wireapp.

the class TabbedParticipantBodyFragment method onCreateView.

@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup viewGroup, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_participants_single_tabbed, viewGroup, false);
    TabIndicatorLayout tabIndicatorLayout = ViewUtils.getView(view, R.id.til_single_participant_tabs);
    int color;
    if (getControllerFactory().getThemeController().isDarkTheme()) {
        color = getResources().getColor(R.color.text__secondary_dark);
    } else {
        color = getResources().getColor(R.color.text__secondary_light);
    }
    if (tabIndicatorLayout != null) {
        tabIndicatorLayout.setPrimaryColor(color);
    }
    viewPager = ViewUtils.getView(view, R.id.vp_single_participant_viewpager);
    viewPager.setAdapter(new TabbedParticipantPagerAdapter(getActivity(), participantOtrDeviceAdapter, this));
    viewPager.addOnPageChangeListener(this);
    tabIndicatorLayout.setViewPager(viewPager);
    if (savedInstanceState == null) {
        if (getControllerFactory().getConversationScreenController().shouldShowDevicesTab()) {
            viewPager.setCurrentItem(1);
            getControllerFactory().getConversationScreenController().setShowDevicesTab(null);
        } else {
            int firstPage = getArguments().getInt(ARG__FIRST__PAGE);
            viewPager.setCurrentItem(firstPage);
        }
    }
    return view;
}
Also used : TabbedParticipantPagerAdapter(com.waz.zclient.pages.main.participants.views.TabbedParticipantPagerAdapter) View(android.view.View) TabIndicatorLayout(com.waz.zclient.ui.views.tab.TabIndicatorLayout) Nullable(android.support.annotation.Nullable)

Aggregations

Nullable (android.support.annotation.Nullable)1 View (android.view.View)1 TabbedParticipantPagerAdapter (com.waz.zclient.pages.main.participants.views.TabbedParticipantPagerAdapter)1 TabIndicatorLayout (com.waz.zclient.ui.views.tab.TabIndicatorLayout)1