diff --git a/app/src/main/java/com/github/libretube/extensions/SetWatchProgressLength.kt b/app/src/main/java/com/github/libretube/extensions/SetWatchProgressLength.kt
index 0fd79d838..419bec336 100644
--- a/app/src/main/java/com/github/libretube/extensions/SetWatchProgressLength.kt
+++ b/app/src/main/java/com/github/libretube/extensions/SetWatchProgressLength.kt
@@ -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
}
diff --git a/app/src/main/res/layout/playlist_row.xml b/app/src/main/res/layout/playlist_row.xml
index a0193c730..1846bb9d7 100644
--- a/app/src/main/res/layout/playlist_row.xml
+++ b/app/src/main/res/layout/playlist_row.xml
@@ -66,10 +66,7 @@
+ style="@style/WatchProgress" />
diff --git a/app/src/main/res/layout/trending_row.xml b/app/src/main/res/layout/trending_row.xml
index 7566664ec..0de870ce4 100644
--- a/app/src/main/res/layout/trending_row.xml
+++ b/app/src/main/res/layout/trending_row.xml
@@ -54,10 +54,8 @@
+ style="@style/WatchProgress"
+ android:layout_height="5dp" />
diff --git a/app/src/main/res/layout/video_row.xml b/app/src/main/res/layout/video_row.xml
index b1756ea61..c94c725c5 100644
--- a/app/src/main/res/layout/video_row.xml
+++ b/app/src/main/res/layout/video_row.xml
@@ -65,10 +65,7 @@
+ style="@style/WatchProgress" />
diff --git a/app/src/main/res/layout/watch_history_row.xml b/app/src/main/res/layout/watch_history_row.xml
index a15034ebd..935836a85 100644
--- a/app/src/main/res/layout/watch_history_row.xml
+++ b/app/src/main/res/layout/watch_history_row.xml
@@ -65,10 +65,7 @@
+ style="@style/WatchProgress" />
diff --git a/app/src/main/res/values/style.xml b/app/src/main/res/values/style.xml
index d65465f39..c7209624d 100644
--- a/app/src/main/res/values/style.xml
+++ b/app/src/main/res/values/style.xml
@@ -125,5 +125,15 @@
+
+
\ No newline at end of file