Fixes for Android API <21

This commit is contained in:
Avently 2020-07-22 17:19:32 +03:00
parent 7aa8a5c368
commit 91a0257c8f
3 changed files with 11 additions and 11 deletions

View File

@ -370,7 +370,7 @@ public class VideoPlayerImpl extends VideoPlayer
getTopControlsRoot().setOrientation(LinearLayout.VERTICAL); getTopControlsRoot().setOrientation(LinearLayout.VERTICAL);
primaryControls.getLayoutParams().width = LinearLayout.LayoutParams.MATCH_PARENT; primaryControls.getLayoutParams().width = LinearLayout.LayoutParams.MATCH_PARENT;
secondaryControls.setVisibility(View.INVISIBLE); secondaryControls.setVisibility(View.INVISIBLE);
moreOptionsButton.setImageDrawable(service.getResources().getDrawable( moreOptionsButton.setImageDrawable(AppCompatResources.getDrawable(service,
R.drawable.ic_expand_more_white_24dp)); R.drawable.ic_expand_more_white_24dp));
shareButton.setVisibility(View.VISIBLE); shareButton.setVisibility(View.VISIBLE);
showHideKodiButton(); showHideKodiButton();
@ -921,9 +921,9 @@ public class VideoPlayerImpl extends VideoPlayer
final boolean showButton = videoPlayerSelected() final boolean showButton = videoPlayerSelected()
&& (orientationLocked || isVerticalVideo || tabletInLandscape); && (orientationLocked || isVerticalVideo || tabletInLandscape);
screenRotationButton.setVisibility(showButton ? View.VISIBLE : View.GONE); screenRotationButton.setVisibility(showButton ? View.VISIBLE : View.GONE);
screenRotationButton.setImageDrawable(service.getResources().getDrawable(isFullscreen() screenRotationButton.setImageDrawable(AppCompatResources.getDrawable(service, isFullscreen()
? R.drawable.ic_fullscreen_exit_white_24dp ? R.drawable.ic_fullscreen_exit_white_24dp
: R.drawable.ic_fullscreen_white_24dp)); : R.drawable.ic_fullscreen_white_24dp));
} }
private void prepareOrientation() { private void prepareOrientation() {
@ -1077,7 +1077,7 @@ public class VideoPlayerImpl extends VideoPlayer
getRootView().setKeepScreenOn(false); getRootView().setKeepScreenOn(false);
service.resetNotification(); service.resetNotification();
service.updateNotification(R.drawable.ic_play_arrow_white_24dp); service.updateNotification(R.drawable.exo_controls_play);
} }
@Override @Override
@ -1086,7 +1086,7 @@ public class VideoPlayerImpl extends VideoPlayer
getRootView().setKeepScreenOn(true); getRootView().setKeepScreenOn(true);
service.resetNotification(); service.resetNotification();
service.updateNotification(R.drawable.ic_play_arrow_white_24dp); service.updateNotification(R.drawable.exo_controls_play);
} }
@Override @Override
@ -1103,7 +1103,7 @@ public class VideoPlayerImpl extends VideoPlayer
getRootView().setKeepScreenOn(true); getRootView().setKeepScreenOn(true);
service.resetNotification(); service.resetNotification();
service.updateNotification(R.drawable.ic_pause_white_24dp); service.updateNotification(R.drawable.exo_controls_pause);
service.startForeground(NOTIFICATION_ID, service.getNotBuilder().build()); service.startForeground(NOTIFICATION_ID, service.getNotBuilder().build());
} }
@ -1120,7 +1120,7 @@ public class VideoPlayerImpl extends VideoPlayer
updateWindowFlags(IDLE_WINDOW_FLAGS); updateWindowFlags(IDLE_WINDOW_FLAGS);
service.resetNotification(); service.resetNotification();
service.updateNotification(R.drawable.ic_play_arrow_white_24dp); service.updateNotification(R.drawable.exo_controls_play);
// Remove running notification when user don't want music (or video in popup) // Remove running notification when user don't want music (or video in popup)
// to be played in background // to be played in background
@ -1138,7 +1138,7 @@ public class VideoPlayerImpl extends VideoPlayer
getRootView().setKeepScreenOn(true); getRootView().setKeepScreenOn(true);
service.resetNotification(); service.resetNotification();
service.updateNotification(R.drawable.ic_play_arrow_white_24dp); service.updateNotification(R.drawable.exo_controls_play);
} }

View File

@ -675,7 +675,7 @@
android:layout_marginRight="2dp" android:layout_marginRight="2dp"
android:padding="10dp" android:padding="10dp"
android:scaleType="center" android:scaleType="center"
android:src="?attr/ic_play_arrow" app:srcCompat="?attr/ic_play_arrow"
android:background="?attr/selectableItemBackground" android:background="?attr/selectableItemBackground"
tools:ignore="ContentDescription,RtlHardcoded"/> tools:ignore="ContentDescription,RtlHardcoded"/>

View File

@ -648,7 +648,7 @@
android:layout_marginRight="2dp" android:layout_marginRight="2dp"
android:padding="10dp" android:padding="10dp"
android:scaleType="center" android:scaleType="center"
android:src="?attr/ic_play_arrow" app:srcCompat="?attr/ic_play_arrow"
android:background="?attr/selectableItemBackground" android:background="?attr/selectableItemBackground"
tools:ignore="ContentDescription,RtlHardcoded"/> tools:ignore="ContentDescription,RtlHardcoded"/>