mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-29 08:20:32 +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.View
|
||||||
import android.view.ViewTreeObserver
|
import android.view.ViewTreeObserver
|
||||||
|
import android.widget.LinearLayout
|
||||||
import com.github.libretube.preferences.PreferenceHelper
|
import com.github.libretube.preferences.PreferenceHelper
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -17,7 +18,8 @@ fun View?.setWatchProgressLength(videoId: String, duration: Long) {
|
|||||||
this@setWatchProgressLength.getViewTreeObserver().removeOnGlobalLayoutListener(this)
|
this@setWatchProgressLength.getViewTreeObserver().removeOnGlobalLayoutListener(this)
|
||||||
positions.forEach {
|
positions.forEach {
|
||||||
if (it.videoId == videoId) {
|
if (it.videoId == videoId) {
|
||||||
newWidth = (width * (it.position / (duration))) / 1000
|
val fullWidth = (parent as LinearLayout).width
|
||||||
|
newWidth = (fullWidth * (it.position / (duration))) / 1000
|
||||||
return@forEach
|
return@forEach
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -27,6 +29,7 @@ fun View?.setWatchProgressLength(videoId: String, duration: Long) {
|
|||||||
width = newWidth!!.toInt()
|
width = newWidth!!.toInt()
|
||||||
}
|
}
|
||||||
view.layoutParams = lp
|
view.layoutParams = lp
|
||||||
|
view.visibility = View.VISIBLE
|
||||||
} else {
|
} else {
|
||||||
view.visibility = View.GONE
|
view.visibility = View.GONE
|
||||||
}
|
}
|
||||||
|
@ -66,10 +66,7 @@
|
|||||||
|
|
||||||
<View
|
<View
|
||||||
android:id="@+id/watch_progress"
|
android:id="@+id/watch_progress"
|
||||||
android:layout_width="match_parent"
|
style="@style/WatchProgress" />
|
||||||
android:layout_height="4dp"
|
|
||||||
android:layout_gravity="bottom"
|
|
||||||
android:background="@android:color/holo_red_dark" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
@ -54,10 +54,8 @@
|
|||||||
|
|
||||||
<View
|
<View
|
||||||
android:id="@+id/watch_progress"
|
android:id="@+id/watch_progress"
|
||||||
android:layout_width="match_parent"
|
style="@style/WatchProgress"
|
||||||
android:layout_height="5dp"
|
android:layout_height="5dp" />
|
||||||
android:layout_gravity="bottom"
|
|
||||||
android:background="@android:color/holo_red_dark" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
@ -65,10 +65,7 @@
|
|||||||
|
|
||||||
<View
|
<View
|
||||||
android:id="@+id/watch_progress"
|
android:id="@+id/watch_progress"
|
||||||
android:layout_width="match_parent"
|
style="@style/WatchProgress" />
|
||||||
android:layout_height="4dp"
|
|
||||||
android:layout_gravity="bottom"
|
|
||||||
android:background="@android:color/holo_red_dark" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
@ -65,10 +65,7 @@
|
|||||||
|
|
||||||
<View
|
<View
|
||||||
android:id="@+id/watch_progress"
|
android:id="@+id/watch_progress"
|
||||||
android:layout_width="match_parent"
|
style="@style/WatchProgress" />
|
||||||
android:layout_height="4dp"
|
|
||||||
android:layout_gravity="bottom"
|
|
||||||
android:background="@android:color/holo_red_dark" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
@ -125,5 +125,15 @@
|
|||||||
|
|
||||||
</style>
|
</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>
|
</resources>
|
Loading…
x
Reference in New Issue
Block a user