Skip to content

Commit

Permalink
fix crash on android 11, set minSdk to 28.修复了安卓11上闪退的问题,设置最小安卓支持版本为安卓9
Browse files Browse the repository at this point in the history
  • Loading branch information
TenzinJamyangZHS committed Jul 1, 2023
1 parent 3b1455a commit 20e4ea6
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 27 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ android {

defaultConfig {
applicationId "com.ttt.calculator"
minSdk 31
minSdk 28
targetSdk 34
versionCode 1
versionName "1.2"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-night/themes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<!-- Status bar color. -->
<item name="android:statusBarColor">?attr/background_edit</item>
<item name="android:windowLightStatusBar">false</item>
<item name="android:windowLightNavigationBar" tools:targetApi="o_mr1">false</item>
<item name="android:windowLightNavigationBar">false</item>
<item name="android:navigationBarColor">?attr/background_calculator</item>
<!-- Customize your theme here. -->
<item name="background_calculator">@color/background_calculator_night</item>
Expand Down
27 changes: 27 additions & 0 deletions app/src/main/res/values-v31/colors.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="textcolor_calculator">@android:color/system_accent3_800</color>
<color name="background_calculator">@android:color/system_accent2_10</color>
<color name="textcolor_calculator_night">@android:color/system_accent3_50</color>
<color name="background_edit">@android:color/system_accent2_100</color>
<color name="background_number">@android:color/system_accent2_50</color>
<color name="background_number_pressed">@android:color/system_accent2_200</color>
<color name="background_clear">@android:color/system_accent3_200</color>
<color name="background_clear_pressed">@android:color/system_accent3_400</color>
<color name="background_equals">@android:color/system_accent1_200</color>
<color name="background_equals_pressed">@android:color/system_accent1_400</color>
<color name="background_operator">@android:color/system_accent1_100</color>
<color name="background_operator_pressed">@android:color/system_accent1_300</color>
<color name="background_operator_small_pressed">@android:color/system_accent1_300</color>
<color name="background_calculator_night">@android:color/system_accent2_1000</color>
<color name="background_edit_night">@android:color/system_accent2_900</color>
<color name="background_number_night">@android:color/system_accent2_900</color>
<color name="background_number_pressed_night">@android:color/system_accent2_700</color>
<color name="background_clear_night">@android:color/system_accent3_700</color>
<color name="background_clear_pressed_night">@android:color/system_accent3_500</color>
<color name="background_equals_night">@android:color/system_accent1_700</color>
<color name="background_equals_pressed_night">@android:color/system_accent1_500</color>
<color name="background_operator_night">@android:color/system_accent1_800</color>
<color name="background_operator_pressed_night">@android:color/system_accent1_600</color>
<color name="background_operator_small_pressed_night">@android:color/system_accent1_700</color>
</resources>
48 changes: 24 additions & 24 deletions app/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,31 +7,31 @@
<color name="teal_700">#FF018786</color>
<color name="black">#FF000000</color>
<color name="white">#FFFFFFFF</color>
<color name="textcolor_calculator" tools:targetApi="s">@android:color/system_accent3_800</color>
<color name="textcolor_calculator_night" tools:targetApi="s">@android:color/system_accent3_50</color>
<color name="background_calculator" tools:targetApi="s">@android:color/system_accent2_10</color>
<color name="background_edit" tools:targetApi="s">@android:color/system_accent2_100</color>
<color name="background_number" tools:targetApi="s">@android:color/system_accent2_50</color>
<color name="background_number_pressed" tools:targetApi="s">@android:color/system_accent2_200</color>
<color name="background_clear" tools:targetApi="s">@android:color/system_accent3_200</color>
<color name="background_clear_pressed" tools:targetApi="s">@android:color/system_accent3_400</color>
<color name="background_equals" tools:targetApi="s">@android:color/system_accent1_200</color>
<color name="background_equals_pressed" tools:targetApi="s">@android:color/system_accent1_400</color>
<color name="background_operator" tools:targetApi="s">@android:color/system_accent1_100</color>
<color name="background_operator_pressed" tools:targetApi="s">@android:color/system_accent1_300</color>
<color name="background_operator_small_pressed" tools:targetApi="s">@android:color/system_accent1_300</color>
<color name="textcolor_calculator">#212121</color>
<color name="textcolor_calculator_night">#FAFAFA</color>
<color name="background_calculator">#E1F5FE</color>
<color name="background_edit">#B2DFDB</color>
<color name="background_number">#689F38</color>
<color name="background_number_pressed">#004D40</color>
<color name="background_clear">#D32F2F</color>
<color name="background_clear_pressed">#B71C1C</color>
<color name="background_equals">#C2185B</color>
<color name="background_equals_pressed">#880E4F</color>
<color name="background_operator">#0097A7</color>
<color name="background_operator_pressed">#006064</color>
<color name="background_operator_small_pressed">#455A64</color>

<color name="background_calculator_night" tools:targetApi="s">@android:color/system_accent2_1000</color>
<color name="background_edit_night" tools:targetApi="s">@android:color/system_accent2_900</color>
<color name="background_number_night" tools:targetApi="s">@android:color/system_accent2_900</color>
<color name="background_number_pressed_night" tools:targetApi="s">@android:color/system_accent2_700</color>
<color name="background_clear_night" tools:targetApi="s">@android:color/system_accent3_700</color>
<color name="background_clear_pressed_night" tools:targetApi="s">@android:color/system_accent3_500</color>
<color name="background_equals_night" tools:targetApi="s">@android:color/system_accent1_700</color>
<color name="background_equals_pressed_night" tools:targetApi="s">@android:color/system_accent1_500</color>
<color name="background_operator_night" tools:targetApi="s">@android:color/system_accent1_800</color>
<color name="background_operator_pressed_night" tools:targetApi="s">@android:color/system_accent1_600</color>
<color name="background_operator_small_pressed_night" tools:targetApi="s">@android:color/system_accent1_700</color>
<color name="background_calculator_night">#212121</color>
<color name="background_edit_night">#263238</color>
<color name="background_number_night">#1B5E20</color>
<color name="background_number_pressed_night">#388E3C</color>
<color name="background_clear_night">#B71C1C</color>
<color name="background_clear_pressed_night">#D32F2F</color>
<color name="background_equals_night">#880E4F</color>
<color name="background_equals_pressed_night">#C2185B</color>
<color name="background_operator_night">#006064</color>
<color name="background_operator_pressed_night">#689F38</color>
<color name="background_operator_small_pressed_night">#00796B</color>

<color name="warning_color">#F44336</color>
</resources>
2 changes: 1 addition & 1 deletion app/src/main/res/values/themes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<!-- Status bar color. -->
<item name="android:statusBarColor">?attr/background_edit</item>
<item name="android:windowLightStatusBar">true</item>
<item name="android:windowLightNavigationBar" tools:targetApi="o_mr1">true</item>
<item name="android:windowLightNavigationBar">true</item>
<item name="android:navigationBarColor">?attr/background_calculator</item>
<!-- Customize your theme here. -->
<item name="background_calculator">@color/background_calculator</item>
Expand Down

0 comments on commit 20e4ea6

Please sign in to comment.