本文整理汇总了Java中android.support.v7.app.ActionBarDrawerToggle.setDrawerIndicatorEnabled方法的典型用法代码示例。如果您正苦于以下问题:Java ActionBarDrawerToggle.setDrawerIndicatorEnabled方法的具体用法?Java ActionBarDrawerToggle.setDrawerIndicatorEnabled怎么用?Java ActionBarDrawerToggle.setDrawerIndicatorEnabled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.support.v7.app.ActionBarDrawerToggle
的用法示例。
在下文中一共展示了ActionBarDrawerToggle.setDrawerIndicatorEnabled方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: prepareDrawerToggle
import android.support.v7.app.ActionBarDrawerToggle; //导入方法依赖的package包/类
private void prepareDrawerToggle() {
mDrawerToggle = new ActionBarDrawerToggle(this, mDrawerLayout, R.string.drawer_open, R.string.drawer_close) {
public void onDrawerOpened(View drawerView) {
super.onDrawerOpened(drawerView);
getSupportActionBar().setTitle(mActivityTitle);
invalidateOptionsMenu();
}
public void onDrawerClosed(View view) {
super.onDrawerClosed(view);
getSupportActionBar().setTitle(mActivityTitle);
invalidateOptionsMenu();
}
};
mDrawerToggle.setDrawerIndicatorEnabled(true);
mDrawerLayout.setDrawerListener(mDrawerToggle);
}
示例2: onCreate
import android.support.v7.app.ActionBarDrawerToggle; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Toolbar toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
NavigationView navigationView = findViewById(R.id.nav_view);
navigationView.setNavigationItemSelectedListener(this);
navigationView.bringToFront();
navigationView.requestLayout();
DrawerLayout drawer = findViewById(R.id.drawer_layout);
ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(
this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close);
drawer.addDrawerListener(toggle);
toggle.setDrawerIndicatorEnabled(true);
toggle.syncState();
}
示例3: onCreate
import android.support.v7.app.ActionBarDrawerToggle; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setHomeButtonEnabled(true);
mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
mDrawerToggle = new ActionBarDrawerToggle(this, mDrawerLayout, R.string.main_drawer_open, R.string.main_drawer_close);
mDrawerToggle.setDrawerIndicatorEnabled(true);
mDrawerLayout.setDrawerListener(mDrawerToggle);
if (savedInstanceState == null) {
setMainFragmentByPreset(CropDemoPreset.RECT);
}
}
示例4: setViews
import android.support.v7.app.ActionBarDrawerToggle; //导入方法依赖的package包/类
@Override
public void setViews() {
setSupportActionBar(mToolBar);
getSupportActionBar().setDisplayShowTitleEnabled(false);
mActionBarDrawerToggle = new ActionBarDrawerToggle(
this, mDrawerLayout, mToolBar, R.string.navigation_drawer_open, R.string.navigation_drawer_close);
mDrawerLayout.addDrawerListener(mActionBarDrawerToggle);
mActionBarDrawerToggle.setHomeAsUpIndicator(R.drawable.ic_home_menu);
mActionBarDrawerToggle.setDrawerIndicatorEnabled(false);
mActionBarDrawerToggle.syncState();
size.setText(ImageCacheUtils.getCacheSize());
version_code.setText("V"+mSession.getVersionName());
//getVersionCode()
mFragmentList = new ArrayList<>();
mTitleList = new ArrayList<>();
initIndicator();
}
示例5: onCreate
import android.support.v7.app.ActionBarDrawerToggle; //导入方法依赖的package包/类
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
binding = DataBindingUtil.setContentView(this, R.layout.main_activity);
if (savedInstanceState == null) {
navigationController.navigateToInbox();
}
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(
this, drawer, R.string.navigation_drawer_open, R.string.navigation_drawer_close);
toggle.setDrawerIndicatorEnabled(true);
drawer.addDrawerListener(toggle);
binding.setSignOutCallback(() -> {
FirebaseAuth.getInstance().signOut();
startActivity(ProfileActivity.class, true);
// TODO: signout facebook/google ?
});
}
示例6: setupNavigationDrawer
import android.support.v7.app.ActionBarDrawerToggle; //导入方法依赖的package包/类
private void setupNavigationDrawer() {
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setHomeButtonEnabled(true);
drawerToggle = new ActionBarDrawerToggle(this, drawerLayout, R.string.drawer_open, R.string.drawer_close) {
public void onDrawerClosed(View view) {
super.onDrawerClosed(view);
invalidateOptionsMenu();
}
public void onDrawerOpened(View drawerView) {
super.onDrawerOpened(drawerView);
invalidateOptionsMenu();
}
};
drawerToggle.syncState();
drawerToggle.setDrawerIndicatorEnabled(true);
drawerLayout.setDrawerListener(drawerToggle);
RecyclerView recyclerView = (RecyclerView) findViewById(R.id.navigationRecyclerView);
navigationAdapter = new NavigationAdapter(this, schedules, schedules.indexOf(loadedSchedule));
recyclerView.setAdapter(navigationAdapter);
RecyclerView.LayoutManager layoutManager = new LinearLayoutManager(this);
recyclerView.setLayoutManager(layoutManager);
}
示例7: setupNavigationView
import android.support.v7.app.ActionBarDrawerToggle; //导入方法依赖的package包/类
@AfterViews
void setupNavigationView() {
mDrawerToggle = new ActionBarDrawerToggle(this, drawer, toolbar, R.string.app_name, R.string.app_name);
mDrawerToggle.setDrawerIndicatorEnabled(true);
drawer.setDrawerListener(mDrawerToggle);
navigation.setNavigationItemSelectedListener(this::navigationItemSelected);
navigation.getMenu().getItem(0).setChecked(true);
}
示例8: onCreate
import android.support.v7.app.ActionBarDrawerToggle; //导入方法依赖的package包/类
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
super.setContentView(R.layout.activity_base_drawer);
appController = (AppController) this.getApplicationContext();
mFrameLayout = (FrameLayout) findViewById(R.id.content_frame);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
mDrawerToggle = new ActionBarDrawerToggle(
this,
mDrawerLayout,
R.string.navigation_drawer_open,
R.string.navigation_drawer_close
);
mDrawerToggle.setDrawerIndicatorEnabled(true);
mDrawerLayout.addDrawerListener(mDrawerToggle);
mDrawerToggle.syncState();
mNavigationView = (NavigationView) findViewById(R.id.nav_view);
mNavigationView.setNavigationItemSelectedListener(this);
menu = mNavigationView.getMenu();
rebuildMenu();
loadTravelerId();
}
示例9: initMenu
import android.support.v7.app.ActionBarDrawerToggle; //导入方法依赖的package包/类
protected void initMenu() {
// Create the menu drawer
menuDrawerLayout = (RelativeLayout) findViewById(R.id.menu_drawer_layout);
menuDrawer = (DrawerLayout) findViewById(R.id.menu_drawer);
menuList = (ListView) findViewById(R.id.menu_drawer_list);
menuTitleArr = new String[]{"Library", "Playlists", "Albums", "Artists", "Genres", "Now Playing"};
menuIconArr = new int[]{R.drawable.ic_library, R.drawable.ic_menu_playlist, R.drawable.ic_album, R.drawable.ic_artist, R.drawable.ic_genre, R.drawable.ic_menu_play};
menuList.setAdapter(new MenuDrawerAdapter(this, menuTitleArr, menuIconArr));
menuDrawer.closeDrawers();
drawerOpen = false;
// Add hamburger icon to menu drawer
ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(this, menuDrawer, mainBar, R.string.dialog_confirm, R.string.dialog_cancel);
menuDrawer.setDrawerListener(toggle);
toggle.setDrawerIndicatorEnabled(true);
toggle.syncState();
mainBar.setTitleTextColor(Color.WHITE);
mainBar.showOverflowMenu();
// Set listener
menuList.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
selectMenuItem(i);
}
});
}
示例10: configureActionBar
import android.support.v7.app.ActionBarDrawerToggle; //导入方法依赖的package包/类
@Override
protected void configureActionBar(ActionBarDrawerToggle toggle) {
toggle.setDrawerIndicatorEnabled(false);
toggle.setToolbarNavigationClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
finish();
}
});
}
示例11: onCreate
import android.support.v7.app.ActionBarDrawerToggle; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
DrawerLayout drawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
mDrawerToggle = new ActionBarDrawerToggle(
this, drawerLayout, R.string.navigation_drawer_open, R.string.navigation_drawer_close
);
mDrawerToggle.setDrawerIndicatorEnabled(true);
drawerLayout.addDrawerListener(mDrawerToggle);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setDisplayShowHomeEnabled(true);
NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);
navigationView.setNavigationItemSelectedListener(this);
FragmentTransaction transaction = getFragmentManager().beginTransaction();
transaction.replace(R.id.fragment_container, new ColorPaletteFragment());
transaction.commit();
}