[mobile] update to Material3 - part 1

pull/123/head
FongMi 3 years ago
parent d8dfda0563
commit 043245cdc4
  1. 4
      app/build.gradle
  2. 5
      app/src/main/res/color/nav.xml
  3. 8
      app/src/main/res/values/styles.xml
  4. 15
      app/src/mobile/res/drawable/shape_item_round.xml
  5. 6
      app/src/mobile/res/drawable/shape_item_round_activated.xml
  6. 6
      app/src/mobile/res/drawable/shape_item_round_normal.xml
  7. 15
      app/src/mobile/res/drawable/shape_text_round.xml
  8. 4
      app/src/mobile/res/drawable/shape_widget.xml
  9. 7
      app/src/mobile/res/layout/activity_main.xml
  10. 4
      app/src/mobile/res/layout/adapter_config.xml
  11. 6
      app/src/mobile/res/layout/adapter_site.xml
  12. 7
      app/src/mobile/res/values/styles.xml

@ -73,7 +73,7 @@ dependencies {
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.5.1'
implementation 'androidx.lifecycle:lifecycle-viewmodel:2.5.1'
implementation 'androidx.preference:preference:1.2.0'
implementation 'androidx.room:room-runtime:2.5.0'
implementation 'androidx.room:room-runtime:2.5.1'
implementation 'cat.ereza:customactivityoncrash:2.4.0'
implementation 'com.github.bassaer:materialdesigncolors:1.0.0'
implementation 'com.github.bumptech.glide:glide:4.14.2'
@ -92,6 +92,6 @@ dependencies {
leanbackImplementation 'androidx.leanback:leanback:1.2.0-alpha02'
leanbackImplementation 'me.jessyan:autosize:1.2.1'
mobileImplementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
annotationProcessor 'androidx.room:room-compiler:2.5.0'
annotationProcessor 'androidx.room:room-compiler:2.5.1'
annotationProcessor 'com.github.bumptech.glide:compiler:4.14.2'
}

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:color="@color/accent" android:state_checked="true" />
<item android:color="@color/white" android:state_checked="false" />
</selector>

@ -30,16 +30,14 @@
<item name="keep_content_on_player_reset">true</item>
</style>
<style name="BottomSheetModal" parent="Widget.Design.BottomSheet.Modal">
<style name="ModalBottomSheetDialog" parent="Widget.Design.BottomSheet.Modal">
<item name="android:background">@drawable/shape_bottom_sheet</item>
</style>
<style name="BottomSheetDialog.Base" parent="Theme.MaterialComponents.Light.BottomSheetDialog">
<item name="bottomSheetStyle">@style/BottomSheetModal</item>
<style name="ThemeOverlay.App.BottomSheetDialog" parent="Theme.MaterialComponents.Light.BottomSheetDialog">
<item name="bottomSheetStyle">@style/ModalBottomSheetDialog</item>
<item name="android:backgroundDimEnabled">false</item>
<item name="android:windowIsFloating">false</item>
</style>
<style name="BottomSheetDialog" parent="BottomSheetDialog.Base" />
</resources>

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
android:color="@color/ripple_material_light">
<item android:id="@android:id/background">
<shape android:shape="rectangle">
<solid android:color="@color/black_20" />
<corners android:radius="28dp" />
<padding
android:bottom="8dp"
android:left="16dp"
android:right="16dp"
android:top="8dp" />
</shape>
</item>
</ripple>

@ -4,12 +4,12 @@
<solid android:color="@color/black_40" />
<corners android:radius="20dp" />
<corners android:radius="28dp" />
<padding
android:bottom="6dp"
android:left="12dp"
android:right="12dp"
android:left="16dp"
android:right="16dp"
android:top="6dp" />
</shape>

@ -4,12 +4,12 @@
<solid android:color="@color/black_20" />
<corners android:radius="20dp" />
<corners android:radius="28dp" />
<padding
android:bottom="6dp"
android:left="12dp"
android:right="12dp"
android:left="16dp"
android:right="16dp"
android:top="6dp" />
</shape>

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
android:color="@color/ripple_material_light">
<item android:id="@android:id/background">
<shape android:shape="rectangle">
<solid android:color="@color/black_50" />
<corners android:radius="28dp" />
<padding
android:bottom="8dp"
android:left="16dp"
android:right="16dp"
android:top="8dp" />
</shape>
</item>
</ripple>

@ -4,11 +4,11 @@
<solid android:color="@color/black_50" />
<corners android:radius="40dp" />
<corners android:radius="28dp" />
<padding
android:bottom="6dp"
android:left="12dp"
android:left="16dp"
android:right="16dp"
android:top="6dp" />

@ -14,10 +14,13 @@
<com.google.android.material.bottomnavigation.BottomNavigationView
android:id="@+id/navigation"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="56dp"
android:layout_alignParentBottom="true"
android:background="@color/white_80"
android:background="@color/transparent"
app:elevation="0dp"
app:itemIconTint="@color/nav"
app:itemTextColor="@color/white"
app:labelVisibilityMode="unlabeled"
app:menu="@menu/menu_nav" />
</RelativeLayout>

@ -10,7 +10,7 @@
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/shape_text"
android:background="@drawable/shape_text_round"
android:ellipsize="middle"
android:gravity="center"
android:singleLine="true"
@ -23,7 +23,7 @@
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginStart="12dp"
android:background="@drawable/shape_text"
android:background="@drawable/shape_text_round"
android:padding="8dp"
android:scaleType="fitCenter"
android:src="@drawable/ic_setting_delete" />

@ -11,7 +11,7 @@
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/shape_text"
android:background="@drawable/shape_text_round"
android:gravity="center"
android:singleLine="true"
android:textColor="@color/text"
@ -23,7 +23,7 @@
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginStart="12dp"
android:background="@drawable/shape_text"
android:background="@drawable/shape_text_round"
android:padding="8dp"
android:scaleType="fitCenter"
android:src="@drawable/ic_site_search_on"
@ -34,7 +34,7 @@
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginStart="12dp"
android:background="@drawable/shape_text"
android:background="@drawable/shape_text_round"
android:padding="8dp"
android:scaleType="fitCenter"
android:src="@drawable/ic_site_change_on"

@ -9,13 +9,14 @@
<item name="android:windowTranslucentStatus">false</item>
</style>
<style name="BaseTheme" parent="Theme.MaterialComponents.Light.NoActionBar">
<style name="BaseTheme" parent="Theme.Material3.DayNight.NoActionBar">
<item name="colorPrimary">@color/primary</item>
<item name="colorPrimaryDark">@color/primaryDark</item>
<item name="colorAccent">@color/accent</item>
<item name="android:windowAnimationStyle">@null</item>
<item name="android:windowBackground">@null</item>
<item name="bottomSheetDialogTheme">@style/BottomSheetDialog</item>
<item name="android:windowAnimationStyle">@null</item>
<item name="android:navigationBarColor">@color/transparent</item>
<item name="bottomSheetDialogTheme">@style/ThemeOverlay.App.BottomSheetDialog</item>
</style>
<style name="Control" />

Loading…
Cancel
Save