use of com.nightonke.saver.adapter.ReportViewFragmentAdapter in project CoCoin by Nightonke.
the class AccountBookReportViewActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mContext = this;
setContentView(R.layout.activity_account_book_report_view);
mViewPager = (MaterialViewPager) findViewById(R.id.materialViewPager);
View view = mViewPager.getRootView();
TextView title = (TextView) view.findViewById(R.id.logo_white);
title.setTypeface(CoCoinUtil.typefaceLatoLight);
title.setText(SettingManager.getInstance().getAccountBookName());
mViewPager.getPagerTitleStrip().setTypeface(CoCoinUtil.getInstance().typefaceLatoLight, Typeface.NORMAL);
mViewPager.getPagerTitleStrip().setTextSize(45);
mViewPager.getPagerTitleStrip().setUnderlineColor(Color.parseColor("#00000000"));
mViewPager.getPagerTitleStrip().setIndicatorColor(Color.parseColor("#00000000"));
mViewPager.getPagerTitleStrip().setUnderlineHeight(0);
mViewPager.getPagerTitleStrip().setIndicatorHeight(0);
mViewPager.getPagerTitleStrip().setOnTabReselectedListener(new PagerSlidingTabStrip.OnTabReselectedListener() {
@Override
public void onTabReselected(int position) {
// if (CoCoinFragmentManager.reportViewFragment != null)
// CoCoinFragmentManager.reportViewFragment.showDataDialog();
}
});
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();
}
});
}
reportViewFragmentAdapter = new ReportViewFragmentAdapter(getSupportFragmentManager());
mViewPager.getViewPager().setOffscreenPageLimit(1);
mViewPager.getViewPager().setAdapter(reportViewFragmentAdapter);
mViewPager.getPagerTitleStrip().setViewPager(mViewPager.getViewPager());
mViewPager.getPagerTitleStrip().invalidate();
mViewPager.setMaterialViewPagerListener(new MaterialViewPager.Listener() {
@Override
public HeaderDesign getHeaderDesign(int page) {
return HeaderDesign.fromColorAndDrawable(CoCoinUtil.GetTagColor(-3), CoCoinUtil.GetTagDrawable(-3));
}
});
}
Aggregations