Tweak manga info header backdrop
(cherry picked from commit cef1c4b8a15246959e4e8a6708bec3c5d9bcaea8) # Conflicts: # app/src/main/java/eu/kanade/tachiyomi/ui/manga/info/MangaInfoHeaderAdapter.kt
This commit is contained in:
parent
aef21dabd5
commit
d2e594be0c
@ -1,5 +1,7 @@
|
|||||||
package eu.kanade.tachiyomi.ui.manga.info
|
package eu.kanade.tachiyomi.ui.manga.info
|
||||||
|
|
||||||
|
import android.graphics.PorterDuff
|
||||||
|
import android.os.Build
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
@ -21,6 +23,7 @@ import eu.kanade.tachiyomi.source.online.HttpSource
|
|||||||
import eu.kanade.tachiyomi.source.online.all.MangaDex
|
import eu.kanade.tachiyomi.source.online.all.MangaDex
|
||||||
import eu.kanade.tachiyomi.ui.manga.MangaController
|
import eu.kanade.tachiyomi.ui.manga.MangaController
|
||||||
import eu.kanade.tachiyomi.util.system.copyToClipboard
|
import eu.kanade.tachiyomi.util.system.copyToClipboard
|
||||||
|
import eu.kanade.tachiyomi.util.system.getResourceColor
|
||||||
import exh.MERGED_SOURCE_ID
|
import exh.MERGED_SOURCE_ID
|
||||||
import exh.source.getMainSource
|
import exh.source.getMainSource
|
||||||
import exh.util.SourceTagsUtil
|
import exh.util.SourceTagsUtil
|
||||||
@ -296,6 +299,14 @@ class MangaInfoHeaderAdapter(
|
|||||||
.into(it)
|
.into(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (Build.VERSION.SDK_INT == Build.VERSION_CODES.LOLLIPOP) {
|
||||||
|
@Suppress("DEPRECATION")
|
||||||
|
binding.backdropOverlay.background.setColorFilter(
|
||||||
|
view.context.getResourceColor(android.R.attr.colorBackground),
|
||||||
|
PorterDuff.Mode.SRC_ATOP
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -185,6 +185,7 @@ class MangaInfoItemAdapter(
|
|||||||
|
|
||||||
// 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) {
|
||||||
|
@Suppress("DEPRECATION")
|
||||||
binding.mangaInfoToggleMoreScrim.background.setColorFilter(
|
binding.mangaInfoToggleMoreScrim.background.setColorFilter(
|
||||||
view.context.getResourceColor(android.R.attr.colorBackground),
|
view.context.getResourceColor(android.R.attr.colorBackground),
|
||||||
PorterDuff.Mode.SRC_ATOP
|
PorterDuff.Mode.SRC_ATOP
|
||||||
|
@ -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" />
|
||||||
|
@ -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_toStartOf="@+id/btn_merge"
|
app:layout_constraintEnd_toStartOf="@+id/btn_merge"
|
||||||
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" />
|
||||||
|
|
||||||
|
|
||||||
@ -185,7 +181,7 @@
|
|||||||
app:icon="@drawable/eh_ic_find_replace_white_24dp"
|
app:icon="@drawable/eh_ic_find_replace_white_24dp"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toEndOf="@+id/btn_webview"
|
app:layout_constraintStart_toEndOf="@+id/btn_webview"
|
||||||
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>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user