Skip to content

Commit 9607563

Browse files
committed
完善黑暗模式
1 parent ff5df2c commit 9607563

File tree

21 files changed

+185
-95
lines changed

21 files changed

+185
-95
lines changed

.idea/inspectionProfiles/Project_Default.xml

Lines changed: 61 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/src/main/java/com/sdwfqin/quickseed/ui/main/MainFragment.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ private void initListener() {
102102
break;
103103
case 9:
104104
HintDialog hintDialog = new HintDialog(mContext);
105+
hintDialog.setFollowSkin(true);
105106
hintDialog.show();
106107
hintDialog.setTitle("热更新测试33333");
107108
hintDialog.hideRight();

app/src/main/java/com/sdwfqin/quickseed/utils/skin/QMUISkinCustManager.java

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,17 @@ public static void install(Context context) {
1717
QMUISkinManager skinManager = QMUISkinManager.defaultInstance(context);
1818
skinManager.addSkin(SKIN_BLUE, R.style.app_skin_blue);
1919
skinManager.addSkin(SKIN_DARK, R.style.app_skin_dark);
20-
boolean isDarkMode = (context.getResources().getConfiguration().uiMode
21-
& Configuration.UI_MODE_NIGHT_MASK) == Configuration.UI_MODE_NIGHT_YES;
2220
int storeSkinIndex = QMUISkinPreferenceManager.getInstance(context).getSkinIndex();
23-
if (isDarkMode && storeSkinIndex != SKIN_DARK) {
24-
skinManager.changeSkin(SKIN_DARK);
25-
} else if (!isDarkMode && storeSkinIndex == SKIN_DARK) {
26-
skinManager.changeSkin(SKIN_BLUE);
27-
}else{
28-
skinManager.changeSkin(storeSkinIndex);
29-
}
21+
// boolean isDarkMode = (context.getResources().getConfiguration().uiMode
22+
// & Configuration.UI_MODE_NIGHT_MASK) == Configuration.UI_MODE_NIGHT_YES;
23+
// if (isDarkMode && storeSkinIndex != SKIN_DARK) {
24+
// skinManager.changeSkin(SKIN_DARK);
25+
// } else if (!isDarkMode && storeSkinIndex == SKIN_DARK) {
26+
// skinManager.changeSkin(SKIN_BLUE);
27+
// }else{
28+
// skinManager.changeSkin(storeSkinIndex);
29+
// }
30+
skinManager.changeSkin(storeSkinIndex);
3031
}
3132

3233
public static void changeSkin(int index) {

app/src/main/res/color/topbar_btn_color.xml

Lines changed: 0 additions & 22 deletions
This file was deleted.

app/src/main/res/drawable/ic_chevron_right.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
android:viewportWidth="24.0"
55
android:viewportHeight="24.0">
66
<path
7-
android:fillColor="#FF000000"
7+
android:fillColor="?attr/app_text_black_color"
88
android:pathData="M10,6L8.59,7.41 13.17,12l-4.58,4.59L10,18l6,-6z"/>
99
</vector>
Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,24 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
2+
<androidx.appcompat.widget.LinearLayoutCompat xmlns:android="http://schemas.android.com/apk/res/android"
3+
xmlns:app="http://schemas.android.com/apk/res-auto"
34
xmlns:tools="http://schemas.android.com/tools"
45
android:layout_width="match_parent"
56
android:layout_height="match_parent"
67
android:orientation="vertical"
8+
app:qmui_skin_background="?attr/app_content_bg_color"
79
tools:context=".ui.components.AutoPollRecyclerViewActivity">
810

911
<com.sdwfqin.widget.recyclerview.AutoPollRecyclerView
1012
android:id="@+id/list_v"
1113
android:layout_width="match_parent"
1214
android:layout_height="0dp"
13-
android:layout_weight="1"/>
15+
android:layout_weight="1"
16+
app:qmui_skin_background="?attr/app_content_bg_color" />
1417

1518
<com.sdwfqin.widget.recyclerview.AutoPollRecyclerView
1619
android:id="@+id/list_h"
1720
android:layout_width="match_parent"
1821
android:layout_height="0dp"
19-
android:layout_weight="1"/>
22+
android:layout_weight="1" />
2023

21-
</LinearLayout>
24+
</androidx.appcompat.widget.LinearLayoutCompat>

app/src/main/res/layout/activity_pay_pwd_input.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
2+
<androidx.appcompat.widget.LinearLayoutCompat xmlns:android="http://schemas.android.com/apk/res/android"
33
xmlns:app="http://schemas.android.com/apk/res-auto"
44
xmlns:tools="http://schemas.android.com/tools"
55
android:layout_width="match_parent"
66
android:layout_height="match_parent"
77
android:orientation="vertical"
8+
app:qmui_skin_background="?attr/app_content_bg_color"
89
tools:context=".ui.components.PayPwdInputActivity">
910

1011
<com.sdwfqin.widget.PayPwdInputView
@@ -95,4 +96,4 @@
9596
app:quick_psdType="weChat"
9697
app:quick_rectAngle="0dp" />
9798

98-
</LinearLayout>
99+
</androidx.appcompat.widget.LinearLayoutCompat>
Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<LinearLayout
3-
xmlns:android="http://schemas.android.com/apk/res/android"
2+
<androidx.appcompat.widget.LinearLayoutCompat xmlns:android="http://schemas.android.com/apk/res/android"
3+
xmlns:app="http://schemas.android.com/apk/res-auto"
44
xmlns:tools="http://schemas.android.com/tools"
55
android:layout_width="match_parent"
66
android:layout_height="match_parent"
77
android:orientation="vertical"
8+
app:qmui_skin_background="?attr/app_content_bg_color"
89
tools:context="com.sdwfqin.quickseed.ui.components.PictureUploadActivity">
910

1011
<com.sdwfqin.widget.pictureupload.PictureUploadView
1112
android:id="@+id/pic"
1213
android:layout_width="match_parent"
13-
android:layout_height="wrap_content"/>
14-
</LinearLayout>
14+
android:layout_height="wrap_content" />
15+
</androidx.appcompat.widget.LinearLayoutCompat>

app/src/main/res/layout/fragment_main.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
xmlns:app="http://schemas.android.com/apk/res-auto"
44
android:layout_width="match_parent"
55
android:layout_height="match_parent"
6-
android:orientation="vertical">
6+
android:orientation="vertical"
7+
app:qmui_skin_background="?attr/app_content_bg_color">
78

89
<com.sdwfqin.widget.StatusPlaceholderView
910
android:layout_width="match_parent"

app/src/main/res/layout/fragment_setting.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
android:layout_height="match_parent"
2626
android:orientation="vertical">
2727

28-
<!-- app:qmui_skin_text_color=""-->
2928
<androidx.appcompat.widget.AppCompatTextView
3029
android:id="@+id/ll_change_skin"
3130
android:layout_width="match_parent"
@@ -35,8 +34,9 @@
3534
android:gravity="center_vertical"
3635
android:paddingLeft="15dp"
3736
android:text="换肤"
38-
android:textSize="14sp"
39-
app:qmui_skin_background="?attr/app_content_bg_primary_color" />
37+
android:textSize="16sp"
38+
app:qmui_skin_background="?attr/app_content_bg_primary_color"
39+
app:qmui_skin_text_color="?attr/app_text_black_color" />
4040

4141
</androidx.appcompat.widget.LinearLayoutCompat>
4242
</androidx.core.widget.NestedScrollView>

0 commit comments

Comments
 (0)