use of com.nightonke.saver.adapter.CustomViewFragmentAdapter in project CoCoin by Nightonke.
the class AccountBookCustomViewActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mContext = this;
setContentView(R.layout.activity_account_book_custom_view);
mViewPager = (MaterialViewPager) findViewById(R.id.materialViewPager);
View view = mViewPager.getRootView();
TextView title = (TextView) view.findViewById(R.id.logo_white);
title.setTypeface(CoCoinUtil.getInstance().typefaceLatoLight);
title.setText(SettingManager.getInstance().getAccountBookName());
mViewPager.getPagerTitleStrip().setTypeface(CoCoinUtil.GetTypeface(), Typeface.NORMAL);
mViewPager.getPagerTitleStrip().setVisibility(View.INVISIBLE);
setTitle("");
toolbar = mViewPager.getToolbar();
if (toolbar != null) {
setSupportActionBar(toolbar);
final ActionBar actionBar = getSupportActionBar();
if (actionBar != null) {
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setDisplayShowHomeEnabled(true);
actionBar.setDisplayShowTitleEnabled(true);
actionBar.setDisplayUseLogoEnabled(false);
actionBar.setHomeButtonEnabled(true);
}
}
View logo = findViewById(R.id.logo_white);
if (logo != null) {
logo.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mViewPager.notifyHeaderChanged();
}
});
}
customViewFragmentAdapter = new CustomViewFragmentAdapter(getSupportFragmentManager());
mViewPager.getViewPager().setOffscreenPageLimit(1);
mViewPager.getViewPager().setAdapter(customViewFragmentAdapter);
mViewPager.getPagerTitleStrip().setViewPager(mViewPager.getViewPager());
mViewPager.setMaterialViewPagerListener(new MaterialViewPager.Listener() {
@Override
public HeaderDesign getHeaderDesign(int page) {
return HeaderDesign.fromColorAndDrawable(CoCoinUtil.GetTagColor(-3), CoCoinUtil.GetTagDrawable(-3));
}
});
}
Aggregations