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