本文整理了Java中androidx.appcompat.app.AppCompatActivity.onConfigurationChanged()
方法的一些代码示例,展示了AppCompatActivity.onConfigurationChanged()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。AppCompatActivity.onConfigurationChanged()
方法的具体详情如下:
包路径:androidx.appcompat.app.AppCompatActivity
类名称:AppCompatActivity
方法名:onConfigurationChanged
暂无
代码示例来源:origin: westnordost/StreetComplete
@Override public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
findViewById(R.id.main).requestLayout();
updateMapQuestOffsets();
}
代码示例来源:origin: nguyenhoanglam/ImagePicker
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
recyclerViewManager.changeOrientation(newConfig.orientation);
}
代码示例来源:origin: sschueller/peertube-android
@Override
public void onConfigurationChanged(Configuration newConfig) {
Log.v(TAG, "onConfigurationChanged()...");
super.onConfigurationChanged(newConfig);
// Checking the orientation changes of the screen
if (newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE) {
setOrientation(true);
} else if (newConfig.orientation == Configuration.ORIENTATION_PORTRAIT) {
setOrientation(false);
}
}
代码示例来源:origin: trello/navi
@Override @CallSuper public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
base.onConfigurationChanged(newConfig);
}
代码示例来源:origin: contentful/gallery-app-android
@Override public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
int index = viewPager.getCurrentItem();
setViewPagerAdapter();
viewPager.setCurrentItem(index);
}
代码示例来源:origin: googlecast/CastVideos-android
@SuppressLint("NewApi")
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
getSupportActionBar().show();
if (newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE) {
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE);
}
updateMetadata(false);
mContainer.setBackgroundColor(getResources().getColor(R.color.black));
} else {
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
getWindow().clearFlags(
WindowManager.LayoutParams.FLAG_FULLSCREEN);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_VISIBLE);
}
updateMetadata(true);
mContainer.setBackgroundColor(getResources().getColor(R.color.white));
}
}
代码示例来源:origin: MCMrARM/revolution-irc
@Override
public void onConfigurationChanged(Configuration newConfig) {
if (AppCompatDelegate.getDefaultNightMode() == mDarkMode) {
if (AppCompatDelegate.getDefaultNightMode() == AppCompatDelegate.MODE_NIGHT_YES) {
newConfig.uiMode &= ~(Configuration.UI_MODE_NIGHT_MASK);
newConfig.uiMode |= Configuration.UI_MODE_NIGHT_YES;
getResources().updateConfiguration(newConfig, getResources().getDisplayMetrics());
}
}
ThemeManager helper = ThemeManager.getInstance(this);
helper.applyThemeToActivity(this);
super.onConfigurationChanged(newConfig);
}
内容来源于网络,如有侵权,请联系作者删除!