當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。