Fix tap region for manga summary

This commit is contained in:
arkon 2020-07-31 12:58:13 -04:00
parent 98a4d1e763
commit e990ad25eb
2 changed files with 8 additions and 10 deletions

View File

@ -181,11 +181,11 @@ class MangaInfoHeaderAdapter(
}
.launchIn(scope)
binding.mangaSummary.longClicks()
binding.mangaSummaryText.longClicks()
.onEach {
controller.activity?.copyToClipboard(
view.context.getString(R.string.description),
binding.mangaSummary.text.toString()
binding.mangaSummaryText.text.toString()
)
}
.launchIn(scope)
@ -277,7 +277,7 @@ class MangaInfoHeaderAdapter(
showMangaInfo(hasInfoContent)
if (hasInfoContent) {
// Update description TextView.
binding.mangaSummary.text = if (manga.description.isNullOrBlank()) {
binding.mangaSummaryText.text = if (manga.description.isNullOrBlank()) {
view.context.getString(R.string.unknown)
} else {
manga.description
@ -292,7 +292,7 @@ class MangaInfoHeaderAdapter(
}
// 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) }
.launchIn(scope)
@ -305,10 +305,7 @@ class MangaInfoHeaderAdapter(
}
private fun showMangaInfo(visible: Boolean) {
binding.mangaSummaryLabel.isVisible = visible
binding.mangaSummary.isVisible = visible
binding.mangaGenresTagsWrapper.isVisible = visible
binding.mangaInfoToggle.isVisible = visible
binding.mangaSummarySection.isVisible = visible
}
private fun toggleMangaInfo(context: Context) {
@ -329,7 +326,7 @@ class MangaInfoHeaderAdapter(
}
}
with(binding.mangaSummary) {
with(binding.mangaSummaryText) {
maxLines =
if (isExpanded) {
2

View File

@ -173,6 +173,7 @@
</androidx.constraintlayout.widget.ConstraintLayout>
<LinearLayout
android:id="@+id/manga_summary_section"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/selectableItemBackground"
@ -213,7 +214,7 @@
</androidx.constraintlayout.widget.ConstraintLayout>
<TextView
android:id="@+id/manga_summary"
android:id="@+id/manga_summary_text"
style="@style/TextAppearance.Regular.Body1.Secondary"
android:layout_width="match_parent"
android:layout_height="wrap_content"