mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-28 07:50:31 +05:30
[Audio Player] Auto scroll the title and uploader
This commit is contained in:
parent
00cf7d89d5
commit
f2fce67454
@ -80,6 +80,10 @@ class AudioPlayerFragment : BaseFragment() {
|
|||||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||||
super.onViewCreated(view, savedInstanceState)
|
super.onViewCreated(view, savedInstanceState)
|
||||||
|
|
||||||
|
// select the title TV in order for it to automatically scroll
|
||||||
|
binding.title.isSelected = true
|
||||||
|
binding.uploader.isSelected = true
|
||||||
|
|
||||||
binding.prev.setOnClickListener {
|
binding.prev.setOnClickListener {
|
||||||
val currentIndex = PlayingQueue.currentIndex()
|
val currentIndex = PlayingQueue.currentIndex()
|
||||||
if (!PlayingQueue.hasPrev()) return@setOnClickListener
|
if (!PlayingQueue.hasPrev()) return@setOnClickListener
|
||||||
|
@ -39,21 +39,17 @@
|
|||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/title"
|
android:id="@+id/title"
|
||||||
|
style="@style/TextViewMarquee"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:ellipsize="marquee"
|
|
||||||
android:marqueeRepeatLimit="marquee_forever"
|
|
||||||
android:scrollHorizontally="true"
|
|
||||||
android:singleLine="true"
|
|
||||||
android:textAlignment="center"
|
|
||||||
android:textSize="24sp" />
|
android:textSize="24sp" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/uploader"
|
android:id="@+id/uploader"
|
||||||
|
style="@style/TextViewMarquee"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="10dp"
|
android:layout_marginTop="10dp"
|
||||||
android:textAlignment="center"
|
|
||||||
android:textSize="18sp" />
|
android:textSize="18sp" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
@ -239,11 +239,23 @@
|
|||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="AudioPlayerButton">
|
<style name="AudioPlayerButton">
|
||||||
|
|
||||||
<item name="android:layout_width">30dp</item>
|
<item name="android:layout_width">30dp</item>
|
||||||
<item name="android:layout_height">30dp</item>
|
<item name="android:layout_height">30dp</item>
|
||||||
<item name="android:background">?attr/selectableItemBackgroundBorderless</item>
|
<item name="android:background">?attr/selectableItemBackgroundBorderless</item>
|
||||||
<item name="android:layout_marginStart">10dp</item>
|
<item name="android:layout_marginStart">10dp</item>
|
||||||
<item name="android:layout_marginEnd">10dp</item>
|
<item name="android:layout_marginEnd">10dp</item>
|
||||||
|
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<style name="TextViewMarquee">
|
||||||
|
|
||||||
|
<item name="android:singleLine">true</item>
|
||||||
|
<item name="android:ellipsize">marquee</item>
|
||||||
|
<item name="android:marqueeRepeatLimit">marquee_forever</item>
|
||||||
|
<item name="android:scrollHorizontally">true</item>
|
||||||
|
<item name="android:textAlignment">center</item>
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
Loading…
x
Reference in New Issue
Block a user