本文整理汇总了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()));
}
示例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();
}