1
0
mirror of https://github.com/TeamNewPipe/NewPipe synced 2024-12-24 09:00:31 +00:00

Remove IN HISTORY label on stream info items

This commit is contained in:
Stypox 2021-03-26 11:35:54 +01:00
parent 360f5ac6f7
commit e58feadba9
No known key found for this signature in database
GPG Key ID: 4BDF1B40A49FDD23
8 changed files with 5 additions and 142 deletions

View File

@ -21,7 +21,7 @@ abstract class FeedDAO {
@Query( @Query(
""" """
SELECT s.*, sst.progress_time, (sh.stream_id IS NOT NULL) AS is_stream_in_history SELECT s.*, sst.progress_time
FROM streams s FROM streams s
LEFT JOIN stream_state sst LEFT JOIN stream_state sst
@ -41,7 +41,7 @@ abstract class FeedDAO {
@Query( @Query(
""" """
SELECT s.*, sst.progress_time, (sh.stream_id IS NOT NULL) AS is_stream_in_history SELECT s.*, sst.progress_time
FROM streams s FROM streams s
LEFT JOIN stream_state sst LEFT JOIN stream_state sst
@ -66,7 +66,7 @@ abstract class FeedDAO {
@Query( @Query(
""" """
SELECT s.*, sst.progress_time, (sh.stream_id IS NOT NULL) AS is_stream_in_history SELECT s.*, sst.progress_time
FROM streams s FROM streams s
LEFT JOIN stream_state sst LEFT JOIN stream_state sst
@ -95,7 +95,7 @@ abstract class FeedDAO {
@Query( @Query(
""" """
SELECT s.*, sst.progress_time, (sh.stream_id IS NOT NULL) AS is_stream_in_history SELECT s.*, sst.progress_time
FROM streams s FROM streams s
LEFT JOIN stream_state sst LEFT JOIN stream_state sst

View File

@ -10,8 +10,5 @@ data class StreamWithState(
val stream: StreamEntity, val stream: StreamEntity,
@ColumnInfo(name = StreamStateEntity.STREAM_PROGRESS_TIME) @ColumnInfo(name = StreamStateEntity.STREAM_PROGRESS_TIME)
val stateProgressTime: Long?, val stateProgressTime: Long?
@ColumnInfo(name = "is_stream_in_history")
val isInHistory: Boolean = false
) )

View File

@ -30,7 +30,6 @@ data class StreamItem(
private val stream: StreamEntity = streamWithState.stream private val stream: StreamEntity = streamWithState.stream
private val stateProgressTime: Long? = streamWithState.stateProgressTime private val stateProgressTime: Long? = streamWithState.stateProgressTime
private val isInHistory: Boolean = streamWithState.isInHistory
override fun getId(): Long = stream.uid override fun getId(): Long = stream.uid
@ -94,9 +93,6 @@ data class StreamItem(
viewBinding.itemProgressView.visibility = View.GONE viewBinding.itemProgressView.visibility = View.GONE
} }
viewBinding.itemInHistoryIndicatorView.visibility =
if (isInHistory && !isLiveStream) View.VISIBLE else View.GONE
ImageLoader.getInstance().displayImage( ImageLoader.getInstance().displayImage(
stream.thumbnailUrl, viewBinding.itemThumbnailView, stream.thumbnailUrl, viewBinding.itemThumbnailView,
ImageDisplayConstants.DISPLAY_THUMBNAIL_OPTIONS ImageDisplayConstants.DISPLAY_THUMBNAIL_OPTIONS

View File

@ -20,32 +20,6 @@
android:src="@drawable/dummy_thumbnail" android:src="@drawable/dummy_thumbnail"
tools:ignore="RtlHardcoded" /> tools:ignore="RtlHardcoded" />
<TextView
android:id="@+id/itemInHistoryIndicatorView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignStart="@id/itemThumbnailView"
android:layout_alignTop="@id/itemThumbnailView"
android:layout_alignEnd="@id/itemThumbnailView"
android:layout_alignBottom="@id/itemThumbnailView"
android:layout_gravity="top|left"
android:background="@drawable/item_in_history_indicator_background"
android:ellipsize="end"
android:maxLines="1"
android:paddingLeft="@dimen/item_in_history_indicator_horizontal_margin"
android:paddingTop="@dimen/item_in_history_indicator_vertical_margin"
android:paddingRight="@dimen/item_in_history_indicator_horizontal_margin"
android:paddingBottom="@dimen/item_in_history_indicator_vertical_margin"
android:text="@string/item_in_history"
android:textAllCaps="true"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/item_in_history_indicator_text_color"
android:textSize="@dimen/item_in_history_indicator_text_size"
android:textStyle="bold"
android:visibility="gone"
tools:ignore="RtlHardcoded"
tools:visibility="visible" />
<TextView <TextView
android:id="@+id/itemDurationView" android:id="@+id/itemDurationView"
android:layout_width="wrap_content" android:layout_width="wrap_content"

View File

@ -25,32 +25,6 @@
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
tools:ignore="RtlHardcoded" /> tools:ignore="RtlHardcoded" />
<TextView
android:id="@+id/itemInHistoryIndicatorView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignStart="@id/itemThumbnailView"
android:layout_alignTop="@id/itemThumbnailView"
android:layout_alignEnd="@id/itemThumbnailView"
android:layout_alignBottom="@id/itemThumbnailView"
android:layout_gravity="top|left"
android:background="@drawable/item_in_history_indicator_background"
android:ellipsize="end"
android:maxLines="1"
android:paddingLeft="@dimen/item_in_history_indicator_horizontal_margin"
android:paddingTop="@dimen/item_in_history_indicator_vertical_margin"
android:paddingRight="@dimen/item_in_history_indicator_horizontal_margin"
android:paddingBottom="@dimen/item_in_history_indicator_vertical_margin"
android:text="@string/item_in_history"
android:textAllCaps="true"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/item_in_history_indicator_text_color"
android:textSize="@dimen/item_in_history_indicator_text_size"
android:textStyle="bold"
android:visibility="gone"
tools:ignore="RtlHardcoded"
tools:visibility="visible" />
<TextView <TextView
android:id="@+id/itemDurationView" android:id="@+id/itemDurationView"
android:layout_width="wrap_content" android:layout_width="wrap_content"

View File

@ -22,32 +22,6 @@
android:src="@drawable/dummy_thumbnail" android:src="@drawable/dummy_thumbnail"
tools:ignore="RtlHardcoded" /> tools:ignore="RtlHardcoded" />
<TextView
android:id="@+id/itemInHistoryIndicatorView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignStart="@id/itemThumbnailView"
android:layout_alignTop="@id/itemThumbnailView"
android:layout_alignEnd="@id/itemThumbnailView"
android:layout_alignBottom="@id/itemThumbnailView"
android:layout_gravity="top|left"
android:background="@drawable/item_in_history_indicator_background"
android:ellipsize="end"
android:maxLines="1"
android:paddingLeft="@dimen/item_in_history_indicator_horizontal_margin"
android:paddingTop="@dimen/item_in_history_indicator_vertical_margin"
android:paddingRight="@dimen/item_in_history_indicator_horizontal_margin"
android:paddingBottom="@dimen/item_in_history_indicator_vertical_margin"
android:text="@string/item_in_history"
android:textAllCaps="true"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/item_in_history_indicator_text_color"
android:textSize="@dimen/item_in_history_indicator_text_size"
android:textStyle="bold"
android:visibility="gone"
tools:ignore="RtlHardcoded"
tools:visibility="visible" />
<TextView <TextView
android:id="@+id/itemDurationView" android:id="@+id/itemDurationView"
android:layout_width="wrap_content" android:layout_width="wrap_content"

View File

@ -22,32 +22,6 @@
android:src="@drawable/dummy_thumbnail" android:src="@drawable/dummy_thumbnail"
tools:ignore="RtlHardcoded" /> tools:ignore="RtlHardcoded" />
<TextView
android:id="@+id/itemInHistoryIndicatorView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignStart="@id/itemThumbnailView"
android:layout_alignTop="@id/itemThumbnailView"
android:layout_alignEnd="@id/itemThumbnailView"
android:layout_alignBottom="@id/itemThumbnailView"
android:layout_gravity="top|left"
android:background="@drawable/item_in_history_indicator_background"
android:ellipsize="end"
android:maxLines="1"
android:paddingLeft="@dimen/item_in_history_indicator_horizontal_margin"
android:paddingTop="@dimen/item_in_history_indicator_vertical_margin"
android:paddingRight="@dimen/item_in_history_indicator_horizontal_margin"
android:paddingBottom="@dimen/item_in_history_indicator_vertical_margin"
android:text="@string/item_in_history"
android:textAllCaps="true"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/item_in_history_indicator_text_color"
android:textSize="@dimen/item_in_history_indicator_text_size"
android:textStyle="bold"
android:visibility="gone"
tools:ignore="RtlHardcoded"
tools:visibility="visible" />
<TextView <TextView
android:id="@+id/itemDurationView" android:id="@+id/itemDurationView"
android:layout_width="wrap_content" android:layout_width="wrap_content"

View File

@ -23,32 +23,6 @@
android:src="@drawable/dummy_thumbnail" android:src="@drawable/dummy_thumbnail"
tools:ignore="RtlHardcoded" /> tools:ignore="RtlHardcoded" />
<TextView
android:id="@+id/itemInHistoryIndicatorView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignStart="@id/itemThumbnailView"
android:layout_alignTop="@id/itemThumbnailView"
android:layout_alignEnd="@id/itemThumbnailView"
android:layout_alignBottom="@id/itemThumbnailView"
android:layout_gravity="top|left"
android:background="@drawable/item_in_history_indicator_background"
android:ellipsize="end"
android:maxLines="1"
android:paddingLeft="@dimen/item_in_history_indicator_horizontal_margin"
android:paddingTop="@dimen/item_in_history_indicator_vertical_margin"
android:paddingRight="@dimen/item_in_history_indicator_horizontal_margin"
android:paddingBottom="@dimen/item_in_history_indicator_vertical_margin"
android:text="@string/item_in_history"
android:textAllCaps="true"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/item_in_history_indicator_text_color"
android:textSize="@dimen/item_in_history_indicator_text_size"
android:textStyle="bold"
android:visibility="gone"
tools:ignore="RtlHardcoded"
tools:visibility="visible" />
<TextView <TextView
android:id="@+id/itemDurationView" android:id="@+id/itemDurationView"
android:layout_width="wrap_content" android:layout_width="wrap_content"