From 433ae89e5320577e9016a60a70fded9dc7278e43 Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Wed, 15 Jan 2020 00:05:44 +0800 Subject: [PATCH] Make things run on API 17 --- app/build.gradle | 4 ++- .../magisk/ui/base/BaseUIActivity.kt | 2 +- .../magisk/ui/base/BaseUIFragment.kt | 2 +- app/src/main/res/drawable-v21/bg_appbar.xml | 15 +++++++++++ app/src/main/res/drawable-v21/bg_card.xml | 8 ++++++ .../bg_divider_rounded_on_primary.xml | 7 +++++ app/src/main/res/drawable-v21/bg_shadow.xml | 8 ++++++ .../res/drawable-v21/fast_scroll_thumb.xml | 19 ++++++++++++++ .../res/drawable-v21/progress_determinate.xml | 26 +++++++++++++++++++ app/src/main/res/drawable/bg_appbar.xml | 4 +-- app/src/main/res/drawable/bg_card.xml | 6 ++--- .../bg_divider_rounded_on_primary.xml | 4 +-- app/src/main/res/drawable/bg_selectable.xml | 4 +-- .../res/drawable/bg_selectable_borderless.xml | 4 +-- app/src/main/res/drawable/bg_shadow.xml | 4 +-- .../main/res/drawable/fast_scroll_thumb.xml | 4 +-- .../res/drawable/progress_determinate.xml | 6 ++--- app/src/main/res/values/default_color.xml | 24 +++++++++++++++++ 18 files changed, 130 insertions(+), 21 deletions(-) create mode 100644 app/src/main/res/drawable-v21/bg_appbar.xml create mode 100644 app/src/main/res/drawable-v21/bg_card.xml create mode 100644 app/src/main/res/drawable-v21/bg_divider_rounded_on_primary.xml create mode 100644 app/src/main/res/drawable-v21/bg_shadow.xml create mode 100644 app/src/main/res/drawable-v21/fast_scroll_thumb.xml create mode 100644 app/src/main/res/drawable-v21/progress_determinate.xml create mode 100644 app/src/main/res/values/default_color.xml diff --git a/app/build.gradle b/app/build.gradle index 7faeaddf3..aecd21ea7 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -102,7 +102,9 @@ dependencies { implementation "com.squareup.retrofit2:adapter-rxjava2:${vRetrofit}" def vOkHttp = '3.12.7' - implementation "com.squareup.okhttp3:okhttp:${vOkHttp}" + implementation("com.squareup.okhttp3:okhttp:${vOkHttp}") { + force = true + } implementation "com.squareup.okhttp3:logging-interceptor:${vOkHttp}" def vMoshi = '1.9.2' diff --git a/app/src/main/java/com/topjohnwu/magisk/ui/base/BaseUIActivity.kt b/app/src/main/java/com/topjohnwu/magisk/ui/base/BaseUIActivity.kt index 45a251626..a5a2e877d 100644 --- a/app/src/main/java/com/topjohnwu/magisk/ui/base/BaseUIActivity.kt +++ b/app/src/main/java/com/topjohnwu/magisk/ui/base/BaseUIActivity.kt @@ -15,7 +15,7 @@ abstract class BaseUIActivity protected lateinit var binding: Binding protected abstract val layoutRes: Int - protected abstract val viewModel: ViewModel + abstract val viewModel: ViewModel override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) diff --git a/app/src/main/res/drawable-v21/bg_appbar.xml b/app/src/main/res/drawable-v21/bg_appbar.xml new file mode 100644 index 000000000..264dc253c --- /dev/null +++ b/app/src/main/res/drawable-v21/bg_appbar.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/app/src/main/res/drawable-v21/bg_card.xml b/app/src/main/res/drawable-v21/bg_card.xml new file mode 100644 index 000000000..57de59736 --- /dev/null +++ b/app/src/main/res/drawable-v21/bg_card.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable-v21/bg_divider_rounded_on_primary.xml b/app/src/main/res/drawable-v21/bg_divider_rounded_on_primary.xml new file mode 100644 index 000000000..783719e7d --- /dev/null +++ b/app/src/main/res/drawable-v21/bg_divider_rounded_on_primary.xml @@ -0,0 +1,7 @@ + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable-v21/bg_shadow.xml b/app/src/main/res/drawable-v21/bg_shadow.xml new file mode 100644 index 000000000..4f7bd989b --- /dev/null +++ b/app/src/main/res/drawable-v21/bg_shadow.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable-v21/fast_scroll_thumb.xml b/app/src/main/res/drawable-v21/fast_scroll_thumb.xml new file mode 100644 index 000000000..19c3590fa --- /dev/null +++ b/app/src/main/res/drawable-v21/fast_scroll_thumb.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/drawable-v21/progress_determinate.xml b/app/src/main/res/drawable-v21/progress_determinate.xml new file mode 100644 index 000000000..95b275b5d --- /dev/null +++ b/app/src/main/res/drawable-v21/progress_determinate.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/bg_appbar.xml b/app/src/main/res/drawable/bg_appbar.xml index 264dc253c..9e8232951 100644 --- a/app/src/main/res/drawable/bg_appbar.xml +++ b/app/src/main/res/drawable/bg_appbar.xml @@ -2,13 +2,13 @@ - + - + diff --git a/app/src/main/res/drawable/bg_card.xml b/app/src/main/res/drawable/bg_card.xml index 57de59736..66b0213d7 100644 --- a/app/src/main/res/drawable/bg_card.xml +++ b/app/src/main/res/drawable/bg_card.xml @@ -3,6 +3,6 @@ android:shape="rectangle"> - \ No newline at end of file + android:endColor="@color/defColorSurface" + android:startColor="@color/defColorSurfaceVariant" /> + diff --git a/app/src/main/res/drawable/bg_divider_rounded_on_primary.xml b/app/src/main/res/drawable/bg_divider_rounded_on_primary.xml index 783719e7d..a33cc5fee 100644 --- a/app/src/main/res/drawable/bg_divider_rounded_on_primary.xml +++ b/app/src/main/res/drawable/bg_divider_rounded_on_primary.xml @@ -3,5 +3,5 @@ android:shape="rectangle"> - - \ No newline at end of file + + diff --git a/app/src/main/res/drawable/bg_selectable.xml b/app/src/main/res/drawable/bg_selectable.xml index c7bb35a7f..b626ec142 100644 --- a/app/src/main/res/drawable/bg_selectable.xml +++ b/app/src/main/res/drawable/bg_selectable.xml @@ -3,7 +3,7 @@ - + @@ -11,4 +11,4 @@ - \ No newline at end of file + diff --git a/app/src/main/res/drawable/bg_selectable_borderless.xml b/app/src/main/res/drawable/bg_selectable_borderless.xml index c7bb35a7f..b626ec142 100644 --- a/app/src/main/res/drawable/bg_selectable_borderless.xml +++ b/app/src/main/res/drawable/bg_selectable_borderless.xml @@ -3,7 +3,7 @@ - + @@ -11,4 +11,4 @@ - \ No newline at end of file + diff --git a/app/src/main/res/drawable/bg_shadow.xml b/app/src/main/res/drawable/bg_shadow.xml index 4f7bd989b..5d6c86bcf 100644 --- a/app/src/main/res/drawable/bg_shadow.xml +++ b/app/src/main/res/drawable/bg_shadow.xml @@ -3,6 +3,6 @@ android:shape="rectangle"> - \ No newline at end of file + diff --git a/app/src/main/res/drawable/fast_scroll_thumb.xml b/app/src/main/res/drawable/fast_scroll_thumb.xml index 19c3590fa..f0ae9cd31 100644 --- a/app/src/main/res/drawable/fast_scroll_thumb.xml +++ b/app/src/main/res/drawable/fast_scroll_thumb.xml @@ -4,14 +4,14 @@ - + - + diff --git a/app/src/main/res/drawable/progress_determinate.xml b/app/src/main/res/drawable/progress_determinate.xml index 95b275b5d..c50466498 100644 --- a/app/src/main/res/drawable/progress_determinate.xml +++ b/app/src/main/res/drawable/progress_determinate.xml @@ -10,7 +10,7 @@ - + @@ -18,9 +18,9 @@ - + - \ No newline at end of file + diff --git a/app/src/main/res/values/default_color.xml b/app/src/main/res/values/default_color.xml new file mode 100644 index 000000000..93203ddd0 --- /dev/null +++ b/app/src/main/res/values/default_color.xml @@ -0,0 +1,24 @@ + + + + #4EAFF5 + #804EAFF5 + #3E78AF + #803E78AF + #F9F9F9 + #E8E8E8 + @color/defColorOnSurface + #F9F9F9 + #D9E6E6E6 + #F9F9F9 + @color/defColorOnSurface + #CC0047 + #F9F9F9 + #444444 + #80444444 + #808080 + #66808080 +