Use maxLines for description

Looks nicer in UI and is more reliable
This commit is contained in:
Luna712 2024-03-07 15:24:45 -07:00 committed by GitHub
parent 8c2f4b7e17
commit 0d38b4b601
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 8 additions and 19 deletions

View file

@ -253,12 +253,9 @@ class EpisodeAdapter(
clickCallback.invoke(EpisodeClickEvent(ACTION_SHOW_DESCRIPTION, card))
} else {
isExpanded = !isExpanded
maxLines = if (isExpanded) {
Integer.MAX_VALUE
} else {
4
}
} else 4
}
}
}

View file

@ -11,7 +11,6 @@ import android.graphics.Rect
import android.os.Build
import android.os.Bundle
import android.text.Editable
import android.text.InputFilter
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
@ -63,14 +62,12 @@ import com.lagradost.cloudstream3.ui.result.ResultFragment.updateUIEvent
import com.lagradost.cloudstream3.ui.search.SearchAdapter
import com.lagradost.cloudstream3.ui.search.SearchHelper
import com.lagradost.cloudstream3.utils.AppUtils.getNameFull
import com.lagradost.cloudstream3.utils.AppUtils.html
import com.lagradost.cloudstream3.utils.AppUtils.isCastApiAvailable
import com.lagradost.cloudstream3.utils.AppUtils.loadCache
import com.lagradost.cloudstream3.utils.AppUtils.openBrowser
import com.lagradost.cloudstream3.utils.ExtractorLink
import com.lagradost.cloudstream3.utils.SingleSelectionHelper.showBottomDialog
import com.lagradost.cloudstream3.utils.SingleSelectionHelper.showBottomDialogInstant
import com.lagradost.cloudstream3.utils.SingleSelectionHelper.showBottomDialogText
import com.lagradost.cloudstream3.utils.SingleSelectionHelper.showDialog
import com.lagradost.cloudstream3.utils.UIHelper
import com.lagradost.cloudstream3.utils.UIHelper.colorFromAttribute
@ -695,11 +692,9 @@ open class ResultFragmentPhone : FullScreenPlayer() {
setTextHtml(d.plotText)
setOnClickListener {
isExpanded = !isExpanded
filters = if (isExpanded) {
arrayOf(InputFilter.LengthFilter(Integer.MAX_VALUE))
} else {
arrayOf(InputFilter.LengthFilter(1000))
}
maxLines = if (isExpanded) {
Integer.MAX_VALUE
} else 10
}
}

View file

@ -4,7 +4,6 @@ import android.animation.Animator
import android.annotation.SuppressLint
import android.app.Dialog
import android.os.Bundle
import android.text.InputFilter
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
@ -843,11 +842,9 @@ class ResultFragmentTv : Fragment() {
setOnClickListener {
if (context.isEmulatorSettings()) {
isExpanded = !isExpanded
filters = if (isExpanded) {
arrayOf(InputFilter.LengthFilter(Integer.MAX_VALUE))
} else {
arrayOf(InputFilter.LengthFilter(1000))
}
maxLines = if (isExpanded) {
Integer.MAX_VALUE
} else 10
} else {
view.context?.let { ctx ->
val builder: AlertDialog.Builder =

View file

@ -409,8 +409,8 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="end"
android:maxLines="10"
android:foreground="@drawable/outline_drawable"
android:maxLength="1000"
android:nextFocusUp="@id/result_back"
android:nextFocusDown="@id/result_bookmark_button"
android:paddingTop="5dp"