use of androidx.appcompat.app.ActionBarDrawerToggle in project FlexibleAdapter by davideas.
the class MainActivity method initializeDrawer.
private void initializeDrawer() {
mDrawer = (DrawerLayout) findViewById(R.id.drawer_layout);
ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(this, mDrawer, mToolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close);
mDrawer.addDrawerListener(toggle);
toggle.syncState();
mNavigationView = (NavigationView) findViewById(R.id.nav_view);
mNavigationView.setNavigationItemSelectedListener(this);
// Version
TextView appVersion = mNavigationView.getHeaderView(0).findViewById(R.id.app_version);
appVersion.setText(getString(R.string.about_version, Utils.getVersionName(this)));
}
use of androidx.appcompat.app.ActionBarDrawerToggle in project LiYuJapanese by 54wall.
the class MainActivity method initDrawerLayout.
private void initDrawerLayout() {
mDrawerLayout = findViewById(R.id.drawer_layout);
ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(this, mDrawerLayout, mToolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close);
mDrawerLayout.addDrawerListener(toggle);
toggle.syncState();
Log.i(TAG, "initDrawerLayout: OK");
}
use of androidx.appcompat.app.ActionBarDrawerToggle in project android by nextcloud.
the class DrawerActivity method setupDrawerToggle.
/**
* initializes and sets up the drawer toggle.
*/
private void setupDrawerToggle() {
mDrawerToggle = new ActionBarDrawerToggle(this, mDrawerLayout, R.string.drawer_open, R.string.drawer_close) {
/**
* Called when a drawer has settled in a completely closed state.
*/
public void onDrawerClosed(View view) {
super.onDrawerClosed(view);
supportInvalidateOptionsMenu();
mDrawerToggle.setDrawerIndicatorEnabled(isDrawerIndicatorAvailable());
if (pendingRunnable != null) {
new Handler().post(pendingRunnable);
pendingRunnable = null;
}
closeDrawer();
}
/**
* Called when a drawer has settled in a completely open state.
*/
public void onDrawerOpened(View drawerView) {
super.onDrawerOpened(drawerView);
mDrawerToggle.setDrawerIndicatorEnabled(true);
supportInvalidateOptionsMenu();
}
};
// Set the drawer toggle as the DrawerListener
mDrawerLayout.addDrawerListener(mDrawerToggle);
mDrawerToggle.setDrawerIndicatorEnabled(true);
mDrawerToggle.setDrawerSlideAnimationEnabled(true);
Drawable backArrow = ResourcesCompat.getDrawable(getResources(), R.drawable.ic_arrow_back, null);
mDrawerToggle.setHomeAsUpIndicator(ThemeDrawableUtils.tintDrawable(backArrow, ThemeColorUtils.appBarPrimaryFontColor(this)));
mDrawerToggle.getDrawerArrowDrawable().setColor(ThemeColorUtils.appBarPrimaryFontColor(this));
}
Aggregations