Start migrating to Material Design 3. Try optimizing image loading in PostRecyclerViewAdapter.

This commit is contained in:
Alex Ning
2021-10-30 21:20:48 +08:00
parent efd5f61889
commit 4ab8f037f2
17 changed files with 268 additions and 199 deletions

View File

@@ -140,7 +140,7 @@
</RelativeLayout>
<androidx.appcompat.widget.Toolbar
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"

View File

@@ -107,7 +107,7 @@
</RelativeLayout>
<androidx.appcompat.widget.Toolbar
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar_view_user_detail_activity"
android:layout_width="match_parent"
android:layout_height="wrap_content"

View File

@@ -6,6 +6,7 @@
android:id="@+id/hauler_view_view_video_activity"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#000000"
android:keepScreenOn="true"
app:dragUpEnabled="true"
tools:application="ml.docilealligator.infinityforreddit.activities.ViewVideoActivity">

View File

@@ -21,7 +21,7 @@
app:titleEnabled="false"
app:toolbarId="@+id/toolbar">
<androidx.appcompat.widget.Toolbar
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"

View File

@@ -206,7 +206,7 @@
android:fontFamily="?attr/font_family"
android:visibility="gone" />
<RelativeLayout
<FrameLayout
android:id="@+id/image_wrapper_relative_layout_item_post_with_preview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@@ -224,7 +224,6 @@
android:layout_width="36dp"
android:layout_height="36dp"
android:layout_margin="16dp"
android:layout_gravity="start"
android:scaleType="center"
android:background="@drawable/play_button_round_background"
android:visibility="gone" />
@@ -233,29 +232,20 @@
android:id="@+id/progress_bar_item_post_with_preview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true" />
android:layout_gravity="center" />
<RelativeLayout
android:id="@+id/load_image_error_relative_layout_item_post_with_preview"
<TextView
android:id="@+id/load_image_error_text_view_item_post_with_preview"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerInParent="true"
android:visibility="gone">
android:layout_height="wrap_content"
android:drawableTop="@drawable/ic_error_outline_black_24dp"
android:layout_gravity="center"
android:gravity="center"
android:text="@string/error_loading_image_tap_to_retry"
android:textSize="?attr/font_default"
android:fontFamily="?attr/font_family" />
<TextView
android:id="@+id/load_image_error_text_view_item_post_with_preview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawableTop="@drawable/ic_error_outline_black_24dp"
android:layout_gravity="center"
android:gravity="center"
android:text="@string/error_loading_image_tap_to_retry"
android:textSize="?attr/font_default"
android:fontFamily="?attr/font_family" />
</RelativeLayout>
</RelativeLayout>
</FrameLayout>
<ImageView
android:id="@+id/image_view_no_preview_gallery_item_post_with_preview"

View File

@@ -1,6 +1,6 @@
<resources>
<style name="AppTheme" parent="Theme.MaterialComponents.DayNight">
<style name="AppTheme" parent="Theme.Material3.DayNight">
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>

View File

@@ -1,7 +1,7 @@
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.MaterialComponents.DayNight">
<style name="AppTheme" parent="Theme.Material3.DayNight">
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>

View File

@@ -1,7 +1,7 @@
<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.MaterialComponents.DayNight">
<style name="AppTheme" parent="Theme.Material3.DayNight">
<item name="colorPrimary">?attr/colorPrimary</item>
<item name="colorPrimaryDark">?attr/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
@@ -58,7 +58,7 @@
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.DayNight" />
<style name="MaterialAlertDialogTheme" parent="ThemeOverlay.MaterialComponents.MaterialAlertDialog">
<style name="MaterialAlertDialogTheme" parent="ThemeOverlay.Material3.MaterialAlertDialog">
<item name="android:textSize">?attr/font_default</item>
<item name="android:background">?attr/cardViewBackgroundColor</item>
<item name="materialAlertDialogTitleTextStyle">@style/MaterialAlertDialogTitleTextStyle
@@ -78,15 +78,15 @@
</item>
</style>
<style name="MaterialAlertDialogPositiveButtonStyle" parent="Widget.MaterialComponents.Button.TextButton.Dialog">
<style name="MaterialAlertDialogPositiveButtonStyle" parent="Widget.Material3.Button.TextButton.Dialog">
<item name="android:textColor">@color/colorAccent</item>
</style>
<style name="MaterialAlertDialogNegativeButtonStyle" parent="Widget.MaterialComponents.Button.TextButton.Dialog">
<style name="MaterialAlertDialogNegativeButtonStyle" parent="Widget.Material3.Button.TextButton.Dialog">
<item name="android:textColor">?attr/primaryTextColor</item>
</style>
<style name="MaterialAlertDialogTitleTextStyle" parent="MaterialAlertDialog.MaterialComponents.Title.Text">
<style name="MaterialAlertDialogTitleTextStyle" parent="MaterialAlertDialog.Material3.Title.Text">
<item name="android:textSize">?attr/font_20</item>
</style>