mirror of
https://github.com/mihonapp/mihon.git
synced 2024-11-14 14:32:49 +01:00
Fix tap region for manga summary
This commit is contained in:
parent
98a4d1e763
commit
e990ad25eb
@ -181,11 +181,11 @@ class MangaInfoHeaderAdapter(
|
|||||||
}
|
}
|
||||||
.launchIn(scope)
|
.launchIn(scope)
|
||||||
|
|
||||||
binding.mangaSummary.longClicks()
|
binding.mangaSummaryText.longClicks()
|
||||||
.onEach {
|
.onEach {
|
||||||
controller.activity?.copyToClipboard(
|
controller.activity?.copyToClipboard(
|
||||||
view.context.getString(R.string.description),
|
view.context.getString(R.string.description),
|
||||||
binding.mangaSummary.text.toString()
|
binding.mangaSummaryText.text.toString()
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
.launchIn(scope)
|
.launchIn(scope)
|
||||||
@ -277,7 +277,7 @@ class MangaInfoHeaderAdapter(
|
|||||||
showMangaInfo(hasInfoContent)
|
showMangaInfo(hasInfoContent)
|
||||||
if (hasInfoContent) {
|
if (hasInfoContent) {
|
||||||
// Update description TextView.
|
// Update description TextView.
|
||||||
binding.mangaSummary.text = if (manga.description.isNullOrBlank()) {
|
binding.mangaSummaryText.text = if (manga.description.isNullOrBlank()) {
|
||||||
view.context.getString(R.string.unknown)
|
view.context.getString(R.string.unknown)
|
||||||
} else {
|
} else {
|
||||||
manga.description
|
manga.description
|
||||||
@ -292,7 +292,7 @@ class MangaInfoHeaderAdapter(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Handle showing more or less info
|
// Handle showing more or less info
|
||||||
merge(view.clicks(), binding.mangaSummary.clicks(), binding.mangaInfoToggle.clicks())
|
merge(binding.mangaSummarySection.clicks(), binding.mangaSummaryText.clicks(), binding.mangaInfoToggle.clicks())
|
||||||
.onEach { toggleMangaInfo(view.context) }
|
.onEach { toggleMangaInfo(view.context) }
|
||||||
.launchIn(scope)
|
.launchIn(scope)
|
||||||
|
|
||||||
@ -305,10 +305,7 @@ class MangaInfoHeaderAdapter(
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun showMangaInfo(visible: Boolean) {
|
private fun showMangaInfo(visible: Boolean) {
|
||||||
binding.mangaSummaryLabel.isVisible = visible
|
binding.mangaSummarySection.isVisible = visible
|
||||||
binding.mangaSummary.isVisible = visible
|
|
||||||
binding.mangaGenresTagsWrapper.isVisible = visible
|
|
||||||
binding.mangaInfoToggle.isVisible = visible
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun toggleMangaInfo(context: Context) {
|
private fun toggleMangaInfo(context: Context) {
|
||||||
@ -329,7 +326,7 @@ class MangaInfoHeaderAdapter(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
with(binding.mangaSummary) {
|
with(binding.mangaSummaryText) {
|
||||||
maxLines =
|
maxLines =
|
||||||
if (isExpanded) {
|
if (isExpanded) {
|
||||||
2
|
2
|
||||||
|
@ -173,6 +173,7 @@
|
|||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
android:id="@+id/manga_summary_section"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="?attr/selectableItemBackground"
|
android:background="?attr/selectableItemBackground"
|
||||||
@ -213,7 +214,7 @@
|
|||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/manga_summary"
|
android:id="@+id/manga_summary_text"
|
||||||
style="@style/TextAppearance.Regular.Body1.Secondary"
|
style="@style/TextAppearance.Regular.Body1.Secondary"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
Loading…
Reference in New Issue
Block a user