夜间模式
huangwei 10 months ago
parent 64b273250e
commit 4341935fc8
  1. 7
      app/src/main/java/com/bingce/controlnetwork/App.java
  2. 2
      app/src/main/java/com/bingce/controlnetwork/newui/mefragment/MeFragment.kt
  3. 7
      app/src/main/res/layout/fragment_project_detail_list_layout.xml
  4. 1
      app/src/main/res/layout/fragment_project_list.xml
  5. 1
      app/src/main/res/layout/new_fragment_me.xml
  6. 10
      app/src/main/res/values-night/colors.xml
  7. 3
      app/src/main/res/values/color.xml
  8. 2
      app/src/main/res/values/styles.xml

@ -9,6 +9,7 @@ import android.text.TextUtils;
import android.util.Log;
import android.widget.ImageView;
import androidx.appcompat.app.AppCompatDelegate;
import androidx.preference.PreferenceManager;
import com.bingce.AppChannel;
@ -143,6 +144,12 @@ public class App extends RepositoryBaseApp {
.translucent(false)
.dark(SettingValueUtil.isThemeDark());
Colorful.init(this);
if (SettingValueUtil.isThemeDark()) {
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES);
} else {
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO);
}
}
private void restorePrefs() {

@ -84,8 +84,6 @@ class MeFragment : BaseFragmentBinding<NewFragmentMeBinding>() {
}
mBinding.llAbout.setOnClickListener {
//关于
Log.d("hwhw", "ss" + 5 / 0)
startActivity(Intent(requireContext(), AboutActivity::class.java))
}
mBinding.llUser.setOnClickListener {

@ -16,6 +16,7 @@
android:elevation="@dimen/default_elevation"
app:dividerVisible="invisible"
app:text="@string/control_point"
app:text_color="@color/text_color_1"
app:text_size="@dimen/middle_text" />
<com.bingce.controlnetwork.ui.widget.TextItemWithMore
@ -27,6 +28,7 @@
android:elevation="@dimen/default_elevation"
app:dividerVisible="invisible"
app:text="@string/unknown_point"
app:text_color="@color/text_color_1"
app:text_size="@dimen/middle_text" />
<LinearLayout
@ -44,7 +46,8 @@
android:layout_height="wrap_content"
android:layout_marginStart="30dp"
android:text="@string/surveyor_station_list"
android:textSize="@dimen/middle_text" />
android:textSize="@dimen/middle_text"
app:text_color="@color/text_color_1" />
<LinearLayout
android:id="@+id/cycle_layout"
@ -64,6 +67,7 @@
android:ellipsize="end"
android:gravity="center_vertical|end"
android:maxLines="1"
app:text_color="@color/text_color_1"
tools:text="" />
<ImageView
@ -73,6 +77,7 @@
android:layout_margin="15dp"
android:layout_marginStart="10dp"
android:src="@drawable/ic_arrow_to_right_dark" />
</LinearLayout>
</LinearLayout>

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?><!-- A RecyclerView with some commonly used attributes -->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:fab="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">

@ -2,6 +2,7 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/bg_content_new"
android:orientation="vertical"
android:padding="12dp">

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="bg_content_new">#444444</color>
<color name="black">#ffffff</color>
<color name="white">#303030</color>
<color name="text_color_1">#fff</color>
<color name="c_33333333">#33ffffff</color>
</resources>

@ -10,4 +10,7 @@
<color name="text_color_disable">#AAA</color>
<color name="green_gnss">#00B050</color>
<color name="yellow_gnss">#FFFF00</color>
<color name="c_33333333">#33333333</color>
</resources>

@ -37,7 +37,7 @@
@color/material_drawer_dark_header_selection_text
</item>
<!-- 窗口状态栏颜色可以设置为和背景色一致 -->
<item name="colorPrimaryDark">@color/white</item>
<!-- <item name="colorPrimaryDark">@color/white</item>-->
<!-- 窗口的背景,替代启动时候出现的白屏 -->
<item name="android:windowBackground">@drawable/bg_splash</item>
</style>

Loading…
Cancel
Save