Skip to content
This repository was archived by the owner on Jun 8, 2024. It is now read-only.

Commit 189bc51

Browse files
committed
Project: Fix a lot bug
Signed-off-by: Fung Gwo <fython@163.com>
1 parent dfbd462 commit 189bc51

12 files changed

Lines changed: 42 additions & 21 deletions

File tree

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
ext {
22
minSdkVersion = 23
33
targetSdkVersion = 28
4-
versionCode = 67
4+
versionCode = 68
55
versionName = '5.0.1'
66
kotlinyanVersion = '0.3.0'
77
ankoVersion = '0.10.8'

mobile/src/main/AndroidManifest.xml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262

6363
<activity
6464
android:name=".ui.HomeActivity"
65-
android:theme="@style/AppTheme.Home">
65+
android:theme="@style/AppTheme.BottomAppBar">
6666
<intent-filter>
6767
<action android:name="android.intent.action.MAIN"/>
6868
</intent-filter>
@@ -81,7 +81,7 @@
8181
<activity
8282
android:name=".ui.DetailsActivity"
8383
android:label="@string/activity_details"
84-
android:theme="@style/AppTheme.Home">
84+
android:theme="@style/AppTheme.BottomAppBar">
8585
<intent-filter>
8686
<action android:name="android.intent.action.MAIN" />
8787
</intent-filter>
@@ -90,7 +90,7 @@
9090
<activity
9191
android:name=".ui.SettingsActivity"
9292
android:label="@string/activity_settings"
93-
android:theme="@style/AppTheme.Home">
93+
android:theme="@style/AppTheme.BottomAppBar">
9494
<intent-filter>
9595
<action android:name="android.intent.action.MAIN" />
9696
</intent-filter>
@@ -117,7 +117,7 @@
117117
<activity
118118
android:name=".ui.ScannerActivity"
119119
android:label="@string/activity_scanner"
120-
android:theme="@style/AppTheme.Home">
120+
android:theme="@style/AppTheme.BottomAppBar">
121121
<intent-filter>
122122
<action android:name="android.intent.action.MAIN" />
123123
</intent-filter>
@@ -126,7 +126,7 @@
126126
<activity
127127
android:name=".ui.ImportExportActivity"
128128
android:label="@string/activity_import_export"
129-
android:theme="@style/AppTheme.Grey">
129+
android:theme="@style/AppTheme.BottomBar.Grey">
130130
<intent-filter>
131131
<action android:name="android.intent.action.MAIN" />
132132
</intent-filter>
@@ -145,7 +145,7 @@
145145
<activity
146146
android:name=".ui.ManageCategoriesActivity"
147147
android:label="@string/activity_manage_categories"
148-
android:theme="@style/AppTheme.Home">
148+
android:theme="@style/AppTheme.BottomAppBar">
149149
<intent-filter>
150150
<action android:name="android.intent.action.MAIN" />
151151
</intent-filter>

mobile/src/main/kotlin/info/papdt/express/helper/ui/HomeActivity.kt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,15 @@ class HomeActivity : AbsActivity(), OnRefreshListener {
193193
}, action = ChooseCategoryDialog.ACTION_CHOOSE_CATEGORY)
194194
}
195195

196+
override fun onStop() {
197+
super.onStop()
198+
try {
199+
packageDatabase.save()
200+
} catch (e: Exception) {
201+
e.printStackTrace()
202+
}
203+
}
204+
196205
private fun showBottomSheetBackground() {
197206
bottomSheetBackground.makeVisible()
198207
}

mobile/src/main/res/layout/activity_details.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
android:id="@+id/toolbar"
5959
android:layout_width="match_parent"
6060
android:layout_height="?attr/actionBarSize"
61-
android:background="?attr/bottomBarColor"
61+
android:background="?android:attr/colorPrimary"
6262
android:elevation="8dp"
6363
app:popupTheme="@style/Toolbar.Popup"
6464
app:theme="@style/ThemeOverlay.AppCompat.Dark" />

mobile/src/main/res/layout/activity_home.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
android:layout_width="match_parent"
2323
android:layout_height="wrap_content"
2424
android:theme="@style/ThemeOverlay.AppCompat.ActionBar"
25-
android:background="?android:colorPrimary">
25+
android:background="?android:windowBackground">
2626

2727
<androidx.appcompat.widget.Toolbar
2828
android:id="@+id/toolbar"
@@ -53,6 +53,7 @@
5353
android:id="@android:id/list"
5454
android:layout_width="match_parent"
5555
android:layout_height="match_parent"
56+
android:overScrollMode="never"
5657
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"/>
5758

5859
</com.scwang.smartrefresh.layout.SmartRefreshLayout>
@@ -81,7 +82,7 @@
8182
android:id="@+id/bottom_bar"
8283
android:layout_width="match_parent"
8384
android:layout_height="?android:attr/actionBarSize"
84-
android:background="?attr/bottomBarColor"
85+
android:background="?android:attr/colorPrimary"
8586
android:orientation="horizontal"
8687
android:layout_gravity="bottom"
8788
android:elevation="10dp"

mobile/src/main/res/layout/activity_manage_categories.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
android:id="@+id/toolbar"
6767
android:layout_width="match_parent"
6868
android:layout_height="?attr/actionBarSize"
69-
android:background="?attr/bottomBarColor"
69+
android:background="?android:attr/colorPrimary"
7070
android:elevation="@dimen/app_bar_elevation"
7171
app:theme="@style/Toolbar.Dark"
7272
app:popupTheme="@style/ThemeOverlay.AppCompat.Light" />

mobile/src/main/res/layout/activity_scanner.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
android:id="@+id/toolbar"
2424
android:layout_width="match_parent"
2525
android:layout_height="?attr/actionBarSize"
26-
android:background="?attr/bottomBarColor"
26+
android:background="?android:attr/colorPrimary"
2727
android:elevation="@dimen/app_bar_elevation"
2828
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" />
2929

mobile/src/main/res/layout/activity_settings.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
android:id="@+id/toolbar"
2626
android:layout_width="match_parent"
2727
android:layout_height="?attr/actionBarSize"
28-
android:background="?attr/bottomBarColor"
28+
android:background="?android:attr/colorPrimary"
2929
android:elevation="@dimen/app_bar_elevation"
3030
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
3131
app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" />

mobile/src/main/res/values-night/styles.xml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<resources>
33

4-
<style name="AppTheme.Home" parent="AppTheme">
5-
<item name="colorPrimary">@color/grey_850</item>
4+
<style name="AppTheme.BottomAppBar" parent="AppTheme">
5+
<item name="colorPrimary">@color/blue_grey_500</item>
66
<item name="colorPrimaryDark">@color/grey_900</item>
77
<item name="android:windowLightStatusBar">false</item>
88
<item name="android:windowBackground">?attr/rootViewBackgroundColor</item>
99
<item name="android:navigationBarColor">@color/blue_grey_700</item>
1010
<item name="rootViewBackgroundColor">@color/grey_850</item>
11-
<item name="bottomBarColor">@color/blue_grey_500</item>
1211
<item name="bottomSheetColor">@color/grey_800</item>
1312
</style>
1413

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
4+
<style name="AppTheme" parent="Theme.AppCompat.DayNight.NoActionBar">
5+
<item name="colorPrimary">@color/colorPrimary</item>
6+
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
7+
<item name="colorAccent">@color/colorAccent</item>
8+
<item name="preferenceTheme">@style/PreferenceThemeOverlay</item>
9+
<item name="snackbarStyle">@style/Widget.MaterialComponents.Snackbar</item>
10+
<item name="android:windowLightNavigationBar">false</item>
11+
<item name="android:navigationBarDividerColor">@android:color/transparent</item>
12+
</style>
13+
14+
</resources>

0 commit comments

Comments
 (0)