Search in sources :

Example 1 with TranslucentFragment

use of qiu.statusbarcompat.fragment.TranslucentFragment in project StatusBarCompat by niorgai.

the class MainActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(null);
    setContentView(R.layout.activity_main);
    fragments.put(PAGE_COMMON, new CommonFragment());
    fragments.put(PAGE_TRANSLUCENT, new TranslucentFragment());
    fragments.put(PAGE_COORDINATOR, new DrawerFragment());
    fragments.put(PAGE_COLLAPSING_TOOLBAR, new CollapsingToolbarFragment());
    mCommon = (RadioButton) findViewById(R.id.common);
    mCommon.setOnCheckedChangeListener(this);
    mTranslucent = (RadioButton) findViewById(R.id.translucent);
    mTranslucent.setOnCheckedChangeListener(this);
    mCoordinator = (RadioButton) findViewById(R.id.coordinator);
    mCoordinator.setOnCheckedChangeListener(this);
    mCollapsingToolbar = (RadioButton) findViewById(R.id.collapsing_toolbar);
    mCollapsingToolbar.setOnCheckedChangeListener(this);
    FragmentTransaction ft = MainActivity.this.getSupportFragmentManager().beginTransaction();
    ft.add(fragmentContentId, fragments.get(PAGE_COMMON));
    currentTab = PAGE_COMMON;
    mCommon.setTextColor(getResources().getColor(R.color.colorAccent));
    ft.commit();
}
Also used : DrawerFragment(qiu.statusbarcompat.fragment.DrawerFragment) TranslucentFragment(qiu.statusbarcompat.fragment.TranslucentFragment) FragmentTransaction(androidx.fragment.app.FragmentTransaction) CommonFragment(qiu.statusbarcompat.fragment.CommonFragment) CollapsingToolbarFragment(qiu.statusbarcompat.fragment.CollapsingToolbarFragment)

Aggregations

FragmentTransaction (androidx.fragment.app.FragmentTransaction)1 CollapsingToolbarFragment (qiu.statusbarcompat.fragment.CollapsingToolbarFragment)1 CommonFragment (qiu.statusbarcompat.fragment.CommonFragment)1 DrawerFragment (qiu.statusbarcompat.fragment.DrawerFragment)1 TranslucentFragment (qiu.statusbarcompat.fragment.TranslucentFragment)1