当前位置: 首页>>代码示例>>Java>>正文


Java ActionBarDrawerToggle.setDrawerIndicatorEnabled方法代码示例

本文整理汇总了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);
}
 
开发者ID:dandanes7,项目名称:lurkerhn,代码行数:19,代码来源:MainActivity.java

示例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();
}
 
开发者ID:barnhill,项目名称:SimpleBible,代码行数:20,代码来源:MainActivity.java

示例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);
    }
}
 
开发者ID:chuch0805,项目名称:Android-Demo_ImageCroper,代码行数:19,代码来源:MainActivity.java

示例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();
}
 
开发者ID:SavorGit,项目名称:Hotspot-master-devp,代码行数:19,代码来源:HotspotMainActivity.java

示例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 ?
    });
}
 
开发者ID:hbmartin,项目名称:firebase-chat-android-architecture-components,代码行数:21,代码来源:InboxActivity.java

示例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);
}
 
开发者ID:chickendude,项目名称:GlossikaSchedule,代码行数:24,代码来源:MainActivity.java

示例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);
}
 
开发者ID:shivamsingh,项目名称:lockit,代码行数:9,代码来源:HomeActivity.java

示例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();
}
 
开发者ID:trvlrch,项目名称:trvlr-android,代码行数:29,代码来源:BaseDrawerActivity.java

示例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);
            }
        });
    }
 
开发者ID:Davarco,项目名称:Divertio,代码行数:29,代码来源:BaseListActivity.java

示例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();
        }
    });
}
 
开发者ID:BloomBooks,项目名称:BloomReader,代码行数:11,代码来源:ShelfActivity.java

示例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();


}
 
开发者ID:bassaer,项目名称:MaterialDesignColors,代码行数:29,代码来源:MainActivity.java


注:本文中的android.support.v7.app.ActionBarDrawerToggle.setDrawerIndicatorEnabled方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。