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

Commit

Permalink
Project: Fix a lot bug
Browse files Browse the repository at this point in the history
Signed-off-by: Fung Gwo <[email protected]>
  • Loading branch information
fython committed Feb 18, 2019
1 parent dfbd462 commit 189bc51
Show file tree
Hide file tree
Showing 12 changed files with 42 additions and 21 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ext {
minSdkVersion = 23
targetSdkVersion = 28
versionCode = 67
versionCode = 68
versionName = '5.0.1'
kotlinyanVersion = '0.3.0'
ankoVersion = '0.10.8'
Expand Down
12 changes: 6 additions & 6 deletions mobile/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@

<activity
android:name=".ui.HomeActivity"
android:theme="@style/AppTheme.Home">
android:theme="@style/AppTheme.BottomAppBar">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
</intent-filter>
Expand All @@ -81,7 +81,7 @@
<activity
android:name=".ui.DetailsActivity"
android:label="@string/activity_details"
android:theme="@style/AppTheme.Home">
android:theme="@style/AppTheme.BottomAppBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
Expand All @@ -90,7 +90,7 @@
<activity
android:name=".ui.SettingsActivity"
android:label="@string/activity_settings"
android:theme="@style/AppTheme.Home">
android:theme="@style/AppTheme.BottomAppBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
Expand All @@ -117,7 +117,7 @@
<activity
android:name=".ui.ScannerActivity"
android:label="@string/activity_scanner"
android:theme="@style/AppTheme.Home">
android:theme="@style/AppTheme.BottomAppBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
Expand All @@ -126,7 +126,7 @@
<activity
android:name=".ui.ImportExportActivity"
android:label="@string/activity_import_export"
android:theme="@style/AppTheme.Grey">
android:theme="@style/AppTheme.BottomBar.Grey">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
Expand All @@ -145,7 +145,7 @@
<activity
android:name=".ui.ManageCategoriesActivity"
android:label="@string/activity_manage_categories"
android:theme="@style/AppTheme.Home">
android:theme="@style/AppTheme.BottomAppBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,15 @@ class HomeActivity : AbsActivity(), OnRefreshListener {
}, action = ChooseCategoryDialog.ACTION_CHOOSE_CATEGORY)
}

override fun onStop() {
super.onStop()
try {
packageDatabase.save()
} catch (e: Exception) {
e.printStackTrace()
}
}

private fun showBottomSheetBackground() {
bottomSheetBackground.makeVisible()
}
Expand Down
2 changes: 1 addition & 1 deletion mobile/src/main/res/layout/activity_details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/bottomBarColor"
android:background="?android:attr/colorPrimary"
android:elevation="8dp"
app:popupTheme="@style/Toolbar.Popup"
app:theme="@style/ThemeOverlay.AppCompat.Dark" />
Expand Down
5 changes: 3 additions & 2 deletions mobile/src/main/res/layout/activity_home.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/ThemeOverlay.AppCompat.ActionBar"
android:background="?android:colorPrimary">
android:background="?android:windowBackground">

<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
Expand Down Expand Up @@ -53,6 +53,7 @@
android:id="@android:id/list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:overScrollMode="never"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"/>

</com.scwang.smartrefresh.layout.SmartRefreshLayout>
Expand Down Expand Up @@ -81,7 +82,7 @@
android:id="@+id/bottom_bar"
android:layout_width="match_parent"
android:layout_height="?android:attr/actionBarSize"
android:background="?attr/bottomBarColor"
android:background="?android:attr/colorPrimary"
android:orientation="horizontal"
android:layout_gravity="bottom"
android:elevation="10dp"
Expand Down
2 changes: 1 addition & 1 deletion mobile/src/main/res/layout/activity_manage_categories.xml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/bottomBarColor"
android:background="?android:attr/colorPrimary"
android:elevation="@dimen/app_bar_elevation"
app:theme="@style/Toolbar.Dark"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light" />
Expand Down
2 changes: 1 addition & 1 deletion mobile/src/main/res/layout/activity_scanner.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/bottomBarColor"
android:background="?android:attr/colorPrimary"
android:elevation="@dimen/app_bar_elevation"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" />

Expand Down
2 changes: 1 addition & 1 deletion mobile/src/main/res/layout/activity_settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/bottomBarColor"
android:background="?android:attr/colorPrimary"
android:elevation="@dimen/app_bar_elevation"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" />
Expand Down
5 changes: 2 additions & 3 deletions mobile/src/main/res/values-night/styles.xml
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>

<style name="AppTheme.Home" parent="AppTheme">
<item name="colorPrimary">@color/grey_850</item>
<style name="AppTheme.BottomAppBar" parent="AppTheme">
<item name="colorPrimary">@color/blue_grey_500</item>
<item name="colorPrimaryDark">@color/grey_900</item>
<item name="android:windowLightStatusBar">false</item>
<item name="android:windowBackground">?attr/rootViewBackgroundColor</item>
<item name="android:navigationBarColor">@color/blue_grey_700</item>
<item name="rootViewBackgroundColor">@color/grey_850</item>
<item name="bottomBarColor">@color/blue_grey_500</item>
<item name="bottomSheetColor">@color/grey_800</item>
</style>

Expand Down
14 changes: 14 additions & 0 deletions mobile/src/main/res/values-v27/styles.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>

<style name="AppTheme" parent="Theme.AppCompat.DayNight.NoActionBar">
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="preferenceTheme">@style/PreferenceThemeOverlay</item>
<item name="snackbarStyle">@style/Widget.MaterialComponents.Snackbar</item>
<item name="android:windowLightNavigationBar">false</item>
<item name="android:navigationBarDividerColor">@android:color/transparent</item>
</style>

</resources>
1 change: 0 additions & 1 deletion mobile/src/main/res/values/attrs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
<attr name="rightEnabled" format="boolean"/>
</declare-styleable>

<attr name="bottomBarColor" format="reference"/>
<attr name="bottomSheetColor" format="reference"/>
<attr name="rootViewBackgroundColor" format="reference"/>

Expand Down
7 changes: 3 additions & 4 deletions mobile/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,17 @@
<item name="android:windowEnterAnimation">@null</item>
</style>

<style name="AppTheme.Home" parent="AppTheme">
<item name="colorPrimary">@color/grey_100</item>
<style name="AppTheme.BottomAppBar" parent="AppTheme">
<item name="colorPrimary">@color/pink_500</item>
<item name="colorPrimaryDark">@color/grey_300</item>
<item name="android:windowLightStatusBar">true</item>
<item name="android:windowBackground">?attr/rootViewBackgroundColor</item>
<item name="android:navigationBarColor">@color/pink_700</item>
<item name="rootViewBackgroundColor">@color/grey_100</item>
<item name="bottomBarColor">@color/pink_500</item>
<item name="bottomSheetColor">@android:color/white</item>
</style>

<style name="AppTheme.Grey" parent="AppTheme.Home">
<style name="AppTheme.BottomBar.Grey" parent="AppTheme.BottomAppBar">
<item name="colorPrimary">@color/grey_theme_app_bar</item>
<item name="android:navigationBarColor">@color/grey_theme_status_bar</item>
</style>
Expand Down

0 comments on commit 189bc51

Please sign in to comment.