mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-28 07:50:31 +05:30
hide watch progress by default
This commit is contained in:
parent
46acb3bda2
commit
07a9418570
@ -2,6 +2,7 @@ package com.github.libretube.util
|
||||
|
||||
import android.view.View
|
||||
import android.view.ViewTreeObserver
|
||||
import android.widget.LinearLayout
|
||||
import com.github.libretube.preferences.PreferenceHelper
|
||||
|
||||
/**
|
||||
@ -17,7 +18,8 @@ fun View?.setWatchProgressLength(videoId: String, duration: Long) {
|
||||
this@setWatchProgressLength.getViewTreeObserver().removeOnGlobalLayoutListener(this)
|
||||
positions.forEach {
|
||||
if (it.videoId == videoId) {
|
||||
newWidth = (width * (it.position / (duration))) / 1000
|
||||
val fullWidth = (parent as LinearLayout).width
|
||||
newWidth = (fullWidth * (it.position / (duration))) / 1000
|
||||
return@forEach
|
||||
}
|
||||
}
|
||||
@ -27,6 +29,7 @@ fun View?.setWatchProgressLength(videoId: String, duration: Long) {
|
||||
width = newWidth!!.toInt()
|
||||
}
|
||||
view.layoutParams = lp
|
||||
view.visibility = View.VISIBLE
|
||||
} else {
|
||||
view.visibility = View.GONE
|
||||
}
|
||||
|
@ -66,10 +66,7 @@
|
||||
|
||||
<View
|
||||
android:id="@+id/watch_progress"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="4dp"
|
||||
android:layout_gravity="bottom"
|
||||
android:background="@android:color/holo_red_dark" />
|
||||
style="@style/WatchProgress" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
@ -54,10 +54,8 @@
|
||||
|
||||
<View
|
||||
android:id="@+id/watch_progress"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="5dp"
|
||||
android:layout_gravity="bottom"
|
||||
android:background="@android:color/holo_red_dark" />
|
||||
style="@style/WatchProgress"
|
||||
android:layout_height="5dp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
@ -65,10 +65,7 @@
|
||||
|
||||
<View
|
||||
android:id="@+id/watch_progress"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="4dp"
|
||||
android:layout_gravity="bottom"
|
||||
android:background="@android:color/holo_red_dark" />
|
||||
style="@style/WatchProgress" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
@ -65,10 +65,7 @@
|
||||
|
||||
<View
|
||||
android:id="@+id/watch_progress"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="4dp"
|
||||
android:layout_gravity="bottom"
|
||||
android:background="@android:color/holo_red_dark" />
|
||||
style="@style/WatchProgress" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
@ -125,5 +125,15 @@
|
||||
|
||||
</style>
|
||||
|
||||
<style name="WatchProgress">
|
||||
|
||||
<item name="android:layout_width">match_parent</item>
|
||||
<item name="android:layout_height">4dp</item>
|
||||
<item name="android:layout_gravity">bottom</item>
|
||||
<item name="android:background">@android:color/holo_red_dark</item>
|
||||
<item name="android:visibility">gone</item>
|
||||
|
||||
</style>
|
||||
|
||||
|
||||
</resources>
|
Loading…
x
Reference in New Issue
Block a user