use of com.amaze.filemanager.ui.views.drawer.Drawer in project AmazeFileManager by TeamAmaze.
the class MainActivity method initialiseViews.
void initialiseViews() {
appBarLayout = getAppbar().getAppbarLayout();
// buttonBarFrame.setBackgroundColor(Color.parseColor(currentTab==1 ? skinTwo : skin));
setSupportActionBar(getAppbar().getToolbar());
drawer = new Drawer(this);
indicator_layout = findViewById(R.id.indicator_layout);
getSupportActionBar().setDisplayShowTitleEnabled(false);
fabBgView = findViewById(R.id.fab_bg);
if (getAppTheme().equals(AppTheme.DARK) || getAppTheme().equals(AppTheme.BLACK)) {
fabBgView.setBackgroundResource(R.drawable.fab_shadow_dark);
}
fabBgView.setOnClickListener(view -> {
if (getAppbar().getSearchView().isEnabled())
getAppbar().getSearchView().hideSearchView();
});
drawer.setDrawerHeaderBackground();
// status bar0
if (SDK_INT == Build.VERSION_CODES.KITKAT_WATCH || SDK_INT == Build.VERSION_CODES.KITKAT) {
SystemBarTintManager tintManager = new SystemBarTintManager(this);
tintManager.setStatusBarTintEnabled(true);
// tintManager.setStatusBarTintColor(Color.parseColor((currentTab==1 ? skinTwo : skin)));
FrameLayout.MarginLayoutParams p = (ViewGroup.MarginLayoutParams) findViewById(R.id.drawer_layout).getLayoutParams();
SystemBarTintManager.SystemBarConfig config = tintManager.getConfig();
if (!drawer.isLocked())
p.setMargins(0, config.getStatusBarHeight(), 0, 0);
} else if (SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
Window window = getWindow();
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
// window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
if (drawer.isLocked()) {
window.setStatusBarColor((skinStatusBar));
} else
window.addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
if (getBoolean(PREFERENCE_COLORED_NAVIGATION))
window.setNavigationBarColor(skinStatusBar);
}
}
Aggregations