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