mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-28 16:00:31 +05:30
fix: issues with expandable text views
This commit is contained in:
parent
8b0e6ce68f
commit
a88329504c
@ -34,6 +34,7 @@ import com.github.libretube.extensions.togglePlayPauseState
|
|||||||
import com.github.libretube.extensions.updateIfChanged
|
import com.github.libretube.extensions.updateIfChanged
|
||||||
import com.github.libretube.helpers.AudioHelper
|
import com.github.libretube.helpers.AudioHelper
|
||||||
import com.github.libretube.helpers.BackgroundHelper
|
import com.github.libretube.helpers.BackgroundHelper
|
||||||
|
import com.github.libretube.helpers.ClipboardHelper
|
||||||
import com.github.libretube.helpers.ImageHelper
|
import com.github.libretube.helpers.ImageHelper
|
||||||
import com.github.libretube.helpers.NavBarHelper
|
import com.github.libretube.helpers.NavBarHelper
|
||||||
import com.github.libretube.helpers.NavigationHelper
|
import com.github.libretube.helpers.NavigationHelper
|
||||||
@ -117,6 +118,11 @@ class AudioPlayerFragment : Fragment(), AudioPlayerOptions {
|
|||||||
binding.title.isSelected = true
|
binding.title.isSelected = true
|
||||||
binding.uploader.isSelected = true
|
binding.uploader.isSelected = true
|
||||||
|
|
||||||
|
binding.title.setOnLongClickListener {
|
||||||
|
ClipboardHelper.save(requireContext(), text = binding.title.text.toString())
|
||||||
|
true
|
||||||
|
}
|
||||||
|
|
||||||
binding.minimizePlayer.setOnClickListener {
|
binding.minimizePlayer.setOnClickListener {
|
||||||
val mainMotionLayout = mainActivity.binding.mainMotionLayout
|
val mainMotionLayout = mainActivity.binding.mainMotionLayout
|
||||||
mainMotionLayout.transitionToStart()
|
mainMotionLayout.transitionToStart()
|
||||||
|
@ -2,9 +2,11 @@ package com.github.libretube.ui.views
|
|||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.text.TextUtils
|
import android.text.TextUtils
|
||||||
|
import android.text.util.Linkify
|
||||||
import android.util.AttributeSet
|
import android.util.AttributeSet
|
||||||
import androidx.appcompat.widget.AppCompatTextView
|
import androidx.appcompat.widget.AppCompatTextView
|
||||||
import com.github.libretube.R
|
import com.github.libretube.R
|
||||||
|
import com.github.libretube.helpers.ClipboardHelper
|
||||||
|
|
||||||
class ExpandableTextView(context: Context, attributeSet: AttributeSet? = null) :
|
class ExpandableTextView(context: Context, attributeSet: AttributeSet? = null) :
|
||||||
AppCompatTextView(context, attributeSet) {
|
AppCompatTextView(context, attributeSet) {
|
||||||
@ -13,10 +15,15 @@ class ExpandableTextView(context: Context, attributeSet: AttributeSet? = null) :
|
|||||||
maxLines = DEFAULT_MAX_LINES
|
maxLines = DEFAULT_MAX_LINES
|
||||||
ellipsize = TextUtils.TruncateAt.END
|
ellipsize = TextUtils.TruncateAt.END
|
||||||
setBackgroundResource(R.drawable.rounded_ripple)
|
setBackgroundResource(R.drawable.rounded_ripple)
|
||||||
|
autoLinkMask = Linkify.WEB_URLS
|
||||||
|
|
||||||
setOnClickListener {
|
setOnClickListener {
|
||||||
maxLines = if (maxLines == DEFAULT_MAX_LINES) Int.MAX_VALUE else DEFAULT_MAX_LINES
|
maxLines = if (maxLines == DEFAULT_MAX_LINES) Int.MAX_VALUE else DEFAULT_MAX_LINES
|
||||||
}
|
}
|
||||||
|
setOnLongClickListener {
|
||||||
|
ClipboardHelper.save(context, text = text.toString())
|
||||||
|
true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
|
@ -137,7 +137,6 @@
|
|||||||
style="@style/TextViewMarquee"
|
style="@style/TextViewMarquee"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textIsSelectable="true"
|
|
||||||
android:textSize="24sp" />
|
android:textSize="24sp" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
@ -150,9 +150,7 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginHorizontal="5dp"
|
android:layout_marginHorizontal="5dp"
|
||||||
android:autoLink="web"
|
android:padding="10dp" />
|
||||||
android:padding="10dp"
|
|
||||||
android:textIsSelectable="true" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
@ -93,7 +93,6 @@
|
|||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:paddingHorizontal="5dp"
|
android:paddingHorizontal="5dp"
|
||||||
android:paddingVertical="2dp"
|
android:paddingVertical="2dp"
|
||||||
android:textIsSelectable="true"
|
|
||||||
android:textSize="20sp"
|
android:textSize="20sp"
|
||||||
android:textStyle="bold" />
|
android:textStyle="bold" />
|
||||||
|
|
||||||
@ -147,11 +146,9 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginHorizontal="5dp"
|
android:layout_marginHorizontal="5dp"
|
||||||
android:autoLink="web"
|
|
||||||
android:paddingHorizontal="10dp"
|
android:paddingHorizontal="10dp"
|
||||||
android:paddingTop="5dp"
|
android:paddingTop="5dp"
|
||||||
android:paddingBottom="10dp"
|
android:paddingBottom="10dp" />
|
||||||
android:textIsSelectable="true" />
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user