语言选择调整
This commit is contained in:
@@ -79,8 +79,8 @@ public class MainActivity extends BaseActivity<MainActivityLayoutBinding, MainPr
|
||||
super.onCreate(savedInstanceState);
|
||||
ImmersionBar.with(this)
|
||||
.transparentStatusBar() // 透明状态栏
|
||||
.statusBarDarkFont(false) // 白色状态栏图标
|
||||
.navigationBarColor(R.color.white)
|
||||
.statusBarDarkFont(ThemeManager.isAppThemeLight(mContext)) // 白色状态栏图标
|
||||
.navigationBarColor(R.color.mainBackgroundColor)
|
||||
.keyboardEnable(false)
|
||||
.init();
|
||||
}
|
||||
@@ -147,12 +147,16 @@ public class MainActivity extends BaseActivity<MainActivityLayoutBinding, MainPr
|
||||
// IndexFragment 需要透明状态栏
|
||||
ImmersionBar.with(MainActivity.this)
|
||||
.transparentStatusBar()
|
||||
.statusBarDarkFont(false)
|
||||
.statusBarDarkFont(ThemeManager.isAppThemeLight(mContext))
|
||||
.init();
|
||||
break;
|
||||
case 1:
|
||||
viewBinding.navView.getMenu().getItem(position).setChecked(true);
|
||||
viewBinding.navView.setSelectedItemId(R.id.navigation_plan);
|
||||
ImmersionBar.with(MainActivity.this)
|
||||
.statusBarColor(R.color.mainBackgroundColor)
|
||||
.statusBarDarkFont(ThemeManager.isAppThemeLight(mContext))
|
||||
.init();
|
||||
break;
|
||||
case 2:
|
||||
viewBinding.navView.getMenu().getItem(position).setChecked(true);
|
||||
@@ -182,19 +186,23 @@ public class MainActivity extends BaseActivity<MainActivityLayoutBinding, MainPr
|
||||
viewBinding.navViewpage2.setCurrentItem(0);
|
||||
ImmersionBar.with(MainActivity.this)
|
||||
.transparentStatusBar()
|
||||
.statusBarDarkFont(false)
|
||||
.statusBarDarkFont(ThemeManager.isAppThemeLight(mContext))
|
||||
.init();
|
||||
return true;
|
||||
|
||||
case R.id.navigation_plan:
|
||||
viewBinding.navViewpage2.setCurrentItem(1);
|
||||
ImmersionBar.with(MainActivity.this)
|
||||
.statusBarColor(R.color.mainBackgroundColor)
|
||||
.statusBarDarkFont(ThemeManager.isAppThemeLight(mContext))
|
||||
.init();
|
||||
return true;
|
||||
|
||||
case R.id.navigation_history:
|
||||
viewBinding.navViewpage2.setCurrentItem(2);
|
||||
ImmersionBar.with(MainActivity.this)
|
||||
.statusBarColor(R.color.mainBackgroundColor)
|
||||
.statusBarDarkFont(true)
|
||||
.statusBarDarkFont(ThemeManager.isAppThemeLight(mContext))
|
||||
.init();
|
||||
return true;
|
||||
|
||||
@@ -202,7 +210,7 @@ public class MainActivity extends BaseActivity<MainActivityLayoutBinding, MainPr
|
||||
viewBinding.navViewpage2.setCurrentItem(3);
|
||||
ImmersionBar.with(MainActivity.this)
|
||||
.statusBarColor(R.color.mainBackgroundColor)
|
||||
.statusBarDarkFont(true)
|
||||
.statusBarDarkFont(ThemeManager.isAppThemeLight(mContext))
|
||||
.init();
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -46,6 +46,8 @@ public class AppThemActivity extends BaseActivity<AppThemeChangeLayoutBinding, M
|
||||
setClick(viewBinding.includedTitle.imgBack);
|
||||
setClick(viewBinding.linearLight);
|
||||
setClick(viewBinding.linearNight);
|
||||
setClick(viewBinding.imgLight);
|
||||
setClick(viewBinding.imgNight);
|
||||
}
|
||||
|
||||
private void setClick(View view) {
|
||||
@@ -55,11 +57,13 @@ public class AppThemActivity extends BaseActivity<AppThemeChangeLayoutBinding, M
|
||||
public void onClick(View v){
|
||||
switch (v.getId()){
|
||||
case R.id.linear_light:
|
||||
case R.id.img_light:
|
||||
switchTheme(ThemeManager.MODE_LIGHT);
|
||||
viewBinding.checkNight.setChecked(false);
|
||||
viewBinding.checkLight.setChecked(true);
|
||||
break;
|
||||
case R.id.linear_night:
|
||||
case R.id.img_night:
|
||||
switchTheme(ThemeManager.MODE_DARK);
|
||||
viewBinding.checkNight.setChecked(true);
|
||||
viewBinding.checkLight.setChecked(false);
|
||||
|
||||
@@ -65,7 +65,11 @@ public class MineCenterFragment extends BaseFragment<MineFragmentLayoutBinding,
|
||||
break;
|
||||
|
||||
case R.id.linear_language:
|
||||
new XPopup.Builder(mContext).asBottomList(
|
||||
new XPopup.Builder(mContext)
|
||||
.isDestroyOnDismiss(true)
|
||||
.dismissOnBackPressed(true)
|
||||
.dismissOnTouchOutside(true)
|
||||
.asBottomList(
|
||||
"选择语言",
|
||||
new String[]{"中文", "English"},
|
||||
new int[]{R.mipmap.ic_launcher, R.mipmap.ic_launcher},
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
android:orientation="vertical"
|
||||
android:gravity="center_horizontal">
|
||||
<ImageView
|
||||
android:id="@+id/img_light"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@mipmap/img_theme_light"/>
|
||||
@@ -33,7 +34,6 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:layout_marginTop="@dimen/dp_15"
|
||||
android:gravity="center_vertical"
|
||||
android:padding="@dimen/dp_5">
|
||||
<CheckBox
|
||||
@@ -63,6 +63,7 @@
|
||||
android:orientation="vertical"
|
||||
android:gravity="center_horizontal">
|
||||
<ImageView
|
||||
android:id="@+id/img_night"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@mipmap/img_theme_night"/>
|
||||
@@ -71,7 +72,6 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:layout_marginTop="@dimen/dp_15"
|
||||
android:gravity="center_vertical"
|
||||
android:padding="@dimen/dp_5">
|
||||
<CheckBox
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
android:layout_height="wrap_content">
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recyclerView"
|
||||
android:layout_width="match_parent"
|
||||
|
||||
Reference in New Issue
Block a user