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


Java DrawerLayout.setStatusBarBackground方法代码示例

本文整理汇总了Java中android.support.v4.widget.DrawerLayout.setStatusBarBackground方法的典型用法代码示例。如果您正苦于以下问题:Java DrawerLayout.setStatusBarBackground方法的具体用法?Java DrawerLayout.setStatusBarBackground怎么用?Java DrawerLayout.setStatusBarBackground使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.support.v4.widget.DrawerLayout的用法示例。


在下文中一共展示了DrawerLayout.setStatusBarBackground方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onCreate

import android.support.v4.widget.DrawerLayout; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setContentView(R.layout.statistics_act);

    // Set up the toolbar.
    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);
    ActionBar ab = getSupportActionBar();
    ab.setTitle(R.string.statistics_title);
    ab.setHomeAsUpIndicator(R.drawable.ic_menu);
    ab.setDisplayHomeAsUpEnabled(true);

    // Set up the navigation drawer.
    mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
    mDrawerLayout.setStatusBarBackground(R.color.colorPrimaryDark);
    NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);
    if (navigationView != null) {
        setupDrawerContent(navigationView);
    }

    StatisticsFragment statisticsFragment = (StatisticsFragment) getSupportFragmentManager()
            .findFragmentById(R.id.contentFrame);
    if (statisticsFragment == null) {
        statisticsFragment = StatisticsFragment.newInstance();
        ActivityUtils.addFragmentToActivity(getSupportFragmentManager(),
                statisticsFragment, R.id.contentFrame);
    }

    new StatisticsPresenter(Injection.provideUseCaseHandler(),
            statisticsFragment,
            Injection.provideGetStatistics(getApplicationContext()));
}
 
开发者ID:Captwalloper,项目名称:NUI_Project,代码行数:35,代码来源:StatisticsActivity.java

示例2: onCreate

import android.support.v4.widget.DrawerLayout; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.playlist_act);

    // Set up the toolbar.
    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);
    ActionBar ab = getSupportActionBar();
    ab.setHomeAsUpIndicator(R.drawable.ic_menu);
    ab.setDisplayHomeAsUpEnabled(true);

    // Set up the navigation drawer.
    mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
    mDrawerLayout.setStatusBarBackground(R.color.colorPrimaryDark);
    NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);
    if (navigationView != null) {
        setupDrawerContent(navigationView);
    }

    PlaylistFragment playlistFragment =
            (PlaylistFragment) getSupportFragmentManager().findFragmentById(R.id.contentFrame);
    if (playlistFragment == null) {
        // Create the fragment
        playlistFragment = PlaylistFragment.newInstance();
        ActivityUtils.addFragmentToActivity(
                getSupportFragmentManager(), playlistFragment, R.id.contentFrame);
    }

    // Create the presenter
    mPlaylistPresenter = new PlaylistPresenter(
            Injection.provideUseCaseHandler(),
            playlistFragment,
            Injection.provideGetTasks(getApplicationContext())
            );

    // Load previously saved state, if available.
    if (savedInstanceState != null) {
        PlaylistFilterType currentFiltering =
                (PlaylistFilterType) savedInstanceState.getSerializable(CURRENT_FILTERING_KEY);
        mPlaylistPresenter.setFiltering(currentFiltering);
    }

    askForPermission();
}
 
开发者ID:Captwalloper,项目名称:NUI_Project,代码行数:46,代码来源:PlaylistActivity.java


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