Merge pull request #4362 from Stypox/fix-queue

Random fixes and improvements
This commit is contained in:
Tobias Groza 2020-10-02 16:48:04 +02:00 committed by GitHub
commit 83ea91586b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 23 additions and 29 deletions

View File

@ -1550,22 +1550,16 @@ public class VideoDetailFragment
0); 0);
} }
switch (info.getStreamType()) { detailControlsDownload.setVisibility(info.getStreamType() == StreamType.LIVE_STREAM
case LIVE_STREAM: || info.getStreamType() == StreamType.AUDIO_LIVE_STREAM ? View.GONE : View.VISIBLE);
case AUDIO_LIVE_STREAM: detailControlsBackground.setVisibility(info.getAudioStreams().isEmpty()
detailControlsDownload.setVisibility(View.GONE); ? View.GONE : View.VISIBLE);
break;
default: final boolean noVideoStreams =
if (info.getAudioStreams().isEmpty()) { info.getVideoStreams().isEmpty() && info.getVideoOnlyStreams().isEmpty();
detailControlsBackground.setVisibility(View.GONE); detailControlsPopup.setVisibility(noVideoStreams ? View.GONE : View.VISIBLE);
} thumbnailPlayButton.setImageResource(
if (!info.getVideoStreams().isEmpty() || !info.getVideoOnlyStreams().isEmpty()) { noVideoStreams ? R.drawable.ic_headset_shadow : R.drawable.ic_play_arrow_shadow);
break;
}
detailControlsPopup.setVisibility(View.GONE);
thumbnailPlayButton.setImageResource(R.drawable.ic_headset_shadow);
break;
}
} }
private void hideAgeRestrictedContent() { private void hideAgeRestrictedContent() {

View File

@ -103,6 +103,8 @@ public final class MainPlayer extends Service {
playerImpl = new VideoPlayerImpl(this); playerImpl = new VideoPlayerImpl(this);
playerImpl.setup(layout); playerImpl.setup(layout);
playerImpl.shouldUpdateOnProgress = true; playerImpl.shouldUpdateOnProgress = true;
NotificationUtil.getInstance().createNotificationAndStartForeground(playerImpl, this);
} }
@Override @Override

View File

@ -600,16 +600,16 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:alpha="0.9" android:alpha="0.9"
android:paddingLeft="@dimen/video_item_search_padding"
android:paddingRight="@dimen/video_item_search_padding"
android:descendantFocusability="blocksDescendants" android:descendantFocusability="blocksDescendants"
android:background="?attr/windowBackground" > android:background="?attr/windowBackground" >
<ImageButton <ImageButton
android:id="@+id/overlay_thumbnail" android:id="@+id/overlay_thumbnail"
android:layout_width="50dp" android:layout_width="85dp"
android:layout_height="60dp" android:layout_height="60dp"
android:layout_alignParentStart="true" android:layout_alignParentStart="true"
android:paddingLeft="@dimen/video_item_search_padding"
android:paddingRight="@dimen/video_item_search_padding"
android:scaleType="fitCenter" android:scaleType="fitCenter"
android:gravity="center_vertical" android:gravity="center_vertical"
android:contentDescription="@string/list_thumbnail_view_description" android:contentDescription="@string/list_thumbnail_view_description"
@ -622,8 +622,6 @@
android:layout_height="60dp" android:layout_height="60dp"
android:gravity="center_vertical" android:gravity="center_vertical"
android:orientation="vertical" android:orientation="vertical"
android:paddingLeft="@dimen/video_item_search_padding"
android:paddingRight="@dimen/video_item_search_padding"
android:clickable="true" android:clickable="true"
android:focusable="true" android:focusable="true"
android:layout_toEndOf="@+id/overlay_thumbnail" android:layout_toEndOf="@+id/overlay_thumbnail"
@ -665,6 +663,7 @@
android:layout_height="60dp" android:layout_height="60dp"
android:gravity="center_vertical" android:gravity="center_vertical"
android:paddingLeft="@dimen/video_item_search_padding" android:paddingLeft="@dimen/video_item_search_padding"
android:paddingRight="@dimen/video_item_search_padding"
android:layout_alignParentEnd="true" android:layout_alignParentEnd="true"
tools:ignore="RtlHardcoded"> tools:ignore="RtlHardcoded">

View File

@ -101,7 +101,7 @@
android:clickable="true" android:clickable="true"
android:focusable="true" android:focusable="true"
android:scaleType="fitXY" android:scaleType="fitXY"
app:srcCompat="?attr/ic_close" app:srcCompat="@drawable/ic_close_white_24dp"
android:background="?attr/selectableItemBackgroundBorderless" android:background="?attr/selectableItemBackgroundBorderless"
tools:ignore="ContentDescription,RtlHardcoded" tools:ignore="ContentDescription,RtlHardcoded"
android:visibility="gone" /> android:visibility="gone" />
@ -483,7 +483,7 @@
android:focusable="true" android:focusable="true"
android:padding="10dp" android:padding="10dp"
android:scaleType="fitXY" android:scaleType="fitXY"
app:srcCompat="@drawable/ic_close_white_24dp" /> app:srcCompat="?attr/ic_close" />
<ImageButton <ImageButton
android:id="@+id/repeatButton" android:id="@+id/repeatButton"

View File

@ -574,11 +574,12 @@
android:background="?attr/windowBackground" > android:background="?attr/windowBackground" >
<ImageButton <ImageButton
android:paddingLeft="@dimen/video_item_search_padding"
android:id="@+id/overlay_thumbnail" android:id="@+id/overlay_thumbnail"
android:layout_width="50dp" android:layout_width="62dp"
android:layout_height="60dp" android:layout_height="60dp"
android:layout_alignParentStart="true" android:layout_alignParentStart="true"
android:paddingLeft="@dimen/video_item_search_padding"
android:paddingRight="@dimen/video_item_search_padding"
android:scaleType="fitCenter" android:scaleType="fitCenter"
android:gravity="center_vertical" android:gravity="center_vertical"
android:contentDescription="@string/list_thumbnail_view_description" android:contentDescription="@string/list_thumbnail_view_description"
@ -591,8 +592,6 @@
android:layout_height="60dp" android:layout_height="60dp"
android:gravity="center_vertical" android:gravity="center_vertical"
android:orientation="vertical" android:orientation="vertical"
android:paddingLeft="@dimen/video_item_search_padding"
android:paddingRight="@dimen/video_item_search_padding"
android:clickable="true" android:clickable="true"
android:focusable="true" android:focusable="true"
android:layout_toEndOf="@+id/overlay_thumbnail" android:layout_toEndOf="@+id/overlay_thumbnail"

View File

@ -99,7 +99,7 @@
android:clickable="true" android:clickable="true"
android:focusable="true" android:focusable="true"
android:scaleType="fitXY" android:scaleType="fitXY"
app:srcCompat="?attr/ic_close" app:srcCompat="@drawable/ic_close_white_24dp"
android:background="?attr/selectableItemBackgroundBorderless" android:background="?attr/selectableItemBackgroundBorderless"
tools:ignore="ContentDescription,RtlHardcoded" tools:ignore="ContentDescription,RtlHardcoded"
android:visibility="gone" /> android:visibility="gone" />
@ -479,7 +479,7 @@
android:focusable="true" android:focusable="true"
android:padding="10dp" android:padding="10dp"
android:scaleType="fitXY" android:scaleType="fitXY"
app:srcCompat="@drawable/ic_close_white_24dp" /> app:srcCompat="?attr/ic_close" />
<ImageButton <ImageButton
android:id="@+id/repeatButton" android:id="@+id/repeatButton"