Minor edits

This commit is contained in:
arkon 2020-04-19 15:12:46 -04:00
parent 01dd46c5ed
commit a5d9fb518a
2 changed files with 9 additions and 16 deletions

View File

@ -284,24 +284,26 @@ class MangaInfoController(private val fromSource: Boolean = false) :
} }
private fun toggleMangaInfo(context: Context) { private fun toggleMangaInfo(context: Context) {
val isExpanded = binding.mangaInfoToggle.text == context.getString(R.string.manga_info_collapse)
binding.mangaInfoToggle.text = binding.mangaInfoToggle.text =
if (binding.mangaInfoToggle.text == context.getString(R.string.manga_info_expand)) if (isExpanded)
context.getString(R.string.manga_info_collapse)
else
context.getString(R.string.manga_info_expand) context.getString(R.string.manga_info_expand)
else
context.getString(R.string.manga_info_collapse)
with(binding.mangaSummary) { with(binding.mangaSummary) {
maxLines = maxLines =
if (maxLines == Int.MAX_VALUE) if (isExpanded)
3 3
else else
Int.MAX_VALUE Int.MAX_VALUE
ellipsize = ellipsize =
if (ellipsize == TextUtils.TruncateAt.END) if (isExpanded)
null
else
TextUtils.TruncateAt.END TextUtils.TruncateAt.END
else
null
} }
binding.mangaGenresTags.toggle() binding.mangaGenresTags.toggle()

View File

@ -206,15 +206,6 @@
android:text="@string/add_to_library" android:text="@string/add_to_library"
app:icon="@drawable/ic_add_to_library_24dp" /> app:icon="@drawable/ic_add_to_library_24dp" />
<!-- <com.google.android.material.button.MaterialButton-->
<!-- android:id="@+id/btn_tracking"-->
<!-- style="@style/Theme.Widget.Button.Icon"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_marginStart="8dp"-->
<!-- android:text="@string/manga_tracking_tab"-->
<!-- app:icon="@drawable/ic_sync_24dp" />-->
<com.google.android.material.button.MaterialButton <com.google.android.material.button.MaterialButton
android:id="@+id/btn_share" android:id="@+id/btn_share"
style="@style/Theme.Widget.Button.Icon.Textless" style="@style/Theme.Widget.Button.Icon.Textless"