Tweak manga info header backdrop

This commit is contained in:
arkon 2020-12-27 17:58:03 -05:00
parent 2e8791a101
commit cef1c4b8a1
3 changed files with 20 additions and 20 deletions

View file

@ -311,10 +311,14 @@ class MangaInfoHeaderAdapter(
// backgroundTint attribute doesn't work properly on Android 5 // backgroundTint attribute doesn't work properly on Android 5
if (Build.VERSION.SDK_INT == Build.VERSION_CODES.LOLLIPOP) { if (Build.VERSION.SDK_INT == Build.VERSION_CODES.LOLLIPOP) {
binding.mangaInfoToggleMoreScrim.background.setColorFilter( listOf(binding.backdropOverlay, binding.mangaInfoToggleMoreScrim)
view.context.getResourceColor(android.R.attr.colorBackground), .forEach {
PorterDuff.Mode.SRC_ATOP @Suppress("DEPRECATION")
) it.background.setColorFilter(
view.context.getResourceColor(android.R.attr.colorBackground),
PorterDuff.Mode.SRC_ATOP
)
}
} }
} }

View file

@ -4,7 +4,7 @@
<gradient <gradient
android:angle="90" android:angle="90"
android:startColor="?android:attr/colorBackground" android:startColor="#ffffffff"
android:endColor="#00ffffff"/> android:endColor="#00ffffff"/>
<corners android:radius="0dp" /> <corners android:radius="0dp" />

View file

@ -15,7 +15,7 @@
android:id="@+id/backdrop" android:id="@+id/backdrop"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="0dp" android:layout_height="0dp"
android:layout_marginBottom="?attr/actionBarSize" android:layout_marginBottom="44dp"
android:alpha="0.2" android:alpha="0.2"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
@ -24,10 +24,12 @@
tools:background="@mipmap/ic_launcher" /> tools:background="@mipmap/ic_launcher" />
<View <View
android:id="@+id/backdrop_overlay"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="88dp" android:layout_height="160dp"
android:layout_marginBottom="?attr/actionBarSize" android:layout_marginBottom="44dp"
android:background="@drawable/manga_info_gradient" android:background="@drawable/manga_info_gradient"
android:backgroundTint="?android:attr/colorBackground"
app:layout_constraintBottom_toBottomOf="parent" /> app:layout_constraintBottom_toBottomOf="parent" />
<LinearLayout <LinearLayout
@ -36,7 +38,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="horizontal" android:orientation="horizontal"
android:paddingStart="16dp" android:paddingStart="16dp"
android:paddingTop="64dp" android:paddingTop="48dp"
android:paddingEnd="16dp" android:paddingEnd="16dp"
android:paddingBottom="8dp" android:paddingBottom="8dp"
app:layout_constraintTop_toTopOf="parent"> app:layout_constraintTop_toTopOf="parent">
@ -129,24 +131,17 @@
</LinearLayout> </LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingStart="16dp"
android:paddingEnd="16dp">
<com.google.android.material.button.MaterialButton <com.google.android.material.button.MaterialButton
android:id="@+id/btn_favorite" android:id="@+id/btn_favorite"
style="@style/Theme.Widget.Button.Action" style="@style/Theme.Widget.Button.Action"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:text="@string/add_to_library" android:text="@string/add_to_library"
app:icon="@drawable/ic_favorite_border_24dp" app:icon="@drawable/ic_favorite_border_24dp"
app:layout_constraintEnd_toStartOf="@+id/btn_tracking" app:layout_constraintEnd_toStartOf="@+id/btn_tracking"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toBottomOf="@+id/manga_info" />
<com.google.android.material.button.MaterialButton <com.google.android.material.button.MaterialButton
android:id="@+id/btn_tracking" android:id="@+id/btn_tracking"
@ -158,7 +153,7 @@
app:icon="@drawable/ic_sync_24dp" app:icon="@drawable/ic_sync_24dp"
app:layout_constraintEnd_toStartOf="@+id/btn_webview" app:layout_constraintEnd_toStartOf="@+id/btn_webview"
app:layout_constraintStart_toEndOf="@+id/btn_favorite" app:layout_constraintStart_toEndOf="@+id/btn_favorite"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toBottomOf="@+id/manga_info"
tools:visibility="visible" /> tools:visibility="visible" />
<com.google.android.material.button.MaterialButton <com.google.android.material.button.MaterialButton
@ -166,12 +161,13 @@
style="@style/Theme.Widget.Button.Action" style="@style/Theme.Widget.Button.Action"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginEnd="16dp"
android:text="@string/action_web_view" android:text="@string/action_web_view"
android:visibility="gone" android:visibility="gone"
app:icon="@drawable/ic_public_24dp" app:icon="@drawable/ic_public_24dp"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/btn_tracking" app:layout_constraintStart_toEndOf="@+id/btn_tracking"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toBottomOf="@+id/manga_info"
tools:visibility="visible" /> tools:visibility="visible" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>