Compare commits
4 Commits
ee8123e478
...
5c1b3cedd2
Author | SHA1 | Date |
---|---|---|
Stypox | 5c1b3cedd2 | |
Stypox | 9e4ac2eacb | |
ashutosh001 | d9d6fff48f | |
Stypox | f4fb960c62 |
|
@ -104,10 +104,10 @@ You can install NewPipe using one of the following methods:
|
||||||
We recommend method 1 for most users. APKs installed using method 1 or 2 are compatible with each other (meaning that if you installed NewPipe using either method 1 or 2, you can also update NewPipe using the other), but not with those installed using method 3. This is due to the same signing key (ours) being used for 1 and 2, but a different signing key (F-Droid's) being used for 3. Building a debug APK using method 4 excludes a key entirely. Signing keys help ensure that a user isn't tricked into installing a malicious update to an app. When using method 5, each APK is signed with a different random key supplied by GitHub Actions, so you cannot even update it. You will have to backup and restore the app data each time you wish to use a new APK.
|
We recommend method 1 for most users. APKs installed using method 1 or 2 are compatible with each other (meaning that if you installed NewPipe using either method 1 or 2, you can also update NewPipe using the other), but not with those installed using method 3. This is due to the same signing key (ours) being used for 1 and 2, but a different signing key (F-Droid's) being used for 3. Building a debug APK using method 4 excludes a key entirely. Signing keys help ensure that a user isn't tricked into installing a malicious update to an app. When using method 5, each APK is signed with a different random key supplied by GitHub Actions, so you cannot even update it. You will have to backup and restore the app data each time you wish to use a new APK.
|
||||||
|
|
||||||
In the meanwhile, if you want to switch sources for some reason (e.g. NewPipe's core functionality breaks and F-Droid doesn't have the latest update yet), we recommend following this procedure:
|
In the meanwhile, if you want to switch sources for some reason (e.g. NewPipe's core functionality breaks and F-Droid doesn't have the latest update yet), we recommend following this procedure:
|
||||||
1. Back up your data via Settings > Content > Export Database so you keep your history, subscriptions, and playlists
|
1. Back up your data via Settings > Backup and Restore > Export Database so you keep your history, subscriptions, and playlists
|
||||||
2. Uninstall NewPipe
|
2. Uninstall NewPipe
|
||||||
3. Download the APK from the new source and install it
|
3. Download the APK from the new source and install it
|
||||||
4. Import the data from step 1 via Settings > Content > Import Database
|
4. Import the data from step 1 via Settings > Backup and Restore > Import Database
|
||||||
|
|
||||||
<b>Note: when you're importing a database into the official app, always make sure that it is the one you exported _from_ the official app. If you import a database exported from an APK other than the official app, it may break things. Such an action is unsupported, and you should only do so when you're absolutely certain you know what you're doing.</b>
|
<b>Note: when you're importing a database into the official app, always make sure that it is the one you exported _from_ the official app. If you import a database exported from an APK other than the official app, it may break things. Such an action is unsupported, and you should only do so when you're absolutely certain you know what you're doing.</b>
|
||||||
|
|
||||||
|
|
|
@ -54,7 +54,7 @@ class ErrorUtil {
|
||||||
*/
|
*/
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
fun showSnackbar(context: Context, errorInfo: ErrorInfo) {
|
fun showSnackbar(context: Context, errorInfo: ErrorInfo) {
|
||||||
val rootView = if (context is Activity) context.findViewById<View>(R.id.content) else null
|
val rootView = (context as? Activity)?.findViewById<View>(android.R.id.content)
|
||||||
showSnackbar(context, rootView, errorInfo)
|
showSnackbar(context, rootView, errorInfo)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -71,7 +71,7 @@ class ErrorUtil {
|
||||||
fun showSnackbar(fragment: Fragment, errorInfo: ErrorInfo) {
|
fun showSnackbar(fragment: Fragment, errorInfo: ErrorInfo) {
|
||||||
var rootView = fragment.view
|
var rootView = fragment.view
|
||||||
if (rootView == null && fragment.activity != null) {
|
if (rootView == null && fragment.activity != null) {
|
||||||
rootView = fragment.requireActivity().findViewById(R.id.content)
|
rootView = fragment.requireActivity().findViewById(android.R.id.content)
|
||||||
}
|
}
|
||||||
showSnackbar(fragment.requireContext(), rootView, errorInfo)
|
showSnackbar(fragment.requireContext(), rootView, errorInfo)
|
||||||
}
|
}
|
||||||
|
|
|
@ -245,10 +245,10 @@ public class MainFragment extends BaseFragment implements TabLayout.OnTabSelecte
|
||||||
// change the background and icon color of the tab layout:
|
// change the background and icon color of the tab layout:
|
||||||
// service-colored at the top, app-background-colored at the bottom
|
// service-colored at the top, app-background-colored at the bottom
|
||||||
tabLayout.setBackgroundColor(ThemeHelper.resolveColorFromAttr(requireContext(),
|
tabLayout.setBackgroundColor(ThemeHelper.resolveColorFromAttr(requireContext(),
|
||||||
bottom ? R.attr.colorSecondary : R.attr.colorPrimary));
|
bottom ? android.R.attr.windowBackground : R.attr.colorPrimary));
|
||||||
|
|
||||||
@ColorInt final int iconColor = bottom
|
@ColorInt final int iconColor = bottom
|
||||||
? ThemeHelper.resolveColorFromAttr(requireContext(), R.attr.colorAccent)
|
? ThemeHelper.resolveColorFromAttr(requireContext(), android.R.attr.colorAccent)
|
||||||
: Color.WHITE;
|
: Color.WHITE;
|
||||||
tabLayout.setTabRippleColor(ColorStateList.valueOf(iconColor).withAlpha(32));
|
tabLayout.setTabRippleColor(ColorStateList.valueOf(iconColor).withAlpha(32));
|
||||||
tabLayout.setTabIconTint(ColorStateList.valueOf(iconColor));
|
tabLayout.setTabIconTint(ColorStateList.valueOf(iconColor));
|
||||||
|
|
|
@ -549,7 +549,7 @@ class FeedFragment : BaseStateFragment<FeedState>() {
|
||||||
|
|
||||||
var typeface = Typeface.DEFAULT
|
var typeface = Typeface.DEFAULT
|
||||||
var backgroundSupplier = { ctx: Context ->
|
var backgroundSupplier = { ctx: Context ->
|
||||||
resolveDrawable(ctx, R.attr.selectableItemBackground)
|
resolveDrawable(ctx, android.R.attr.selectableItemBackground)
|
||||||
}
|
}
|
||||||
if (doCheck) {
|
if (doCheck) {
|
||||||
// If the uploadDate is null or true we should highlight the item
|
// If the uploadDate is null or true we should highlight the item
|
||||||
|
@ -562,7 +562,7 @@ class FeedFragment : BaseStateFragment<FeedState>() {
|
||||||
LayerDrawable(
|
LayerDrawable(
|
||||||
arrayOf(
|
arrayOf(
|
||||||
resolveDrawable(ctx, R.attr.dashed_border),
|
resolveDrawable(ctx, R.attr.dashed_border),
|
||||||
resolveDrawable(ctx, R.attr.selectableItemBackground)
|
resolveDrawable(ctx, android.R.attr.selectableItemBackground)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -569,16 +569,16 @@ public final class PlayQueueActivity extends AppCompatActivity
|
||||||
private void onPlayModeChanged(final int repeatMode, final boolean shuffled) {
|
private void onPlayModeChanged(final int repeatMode, final boolean shuffled) {
|
||||||
switch (repeatMode) {
|
switch (repeatMode) {
|
||||||
case com.google.android.exoplayer2.Player.REPEAT_MODE_OFF:
|
case com.google.android.exoplayer2.Player.REPEAT_MODE_OFF:
|
||||||
queueControlBinding.controlRepeat
|
queueControlBinding.controlRepeat.setImageResource(
|
||||||
.setImageResource(R.drawable.exo_controls_repeat_off);
|
com.google.android.exoplayer2.ui.R.drawable.exo_controls_repeat_off);
|
||||||
break;
|
break;
|
||||||
case com.google.android.exoplayer2.Player.REPEAT_MODE_ONE:
|
case com.google.android.exoplayer2.Player.REPEAT_MODE_ONE:
|
||||||
queueControlBinding.controlRepeat
|
queueControlBinding.controlRepeat.setImageResource(
|
||||||
.setImageResource(R.drawable.exo_controls_repeat_one);
|
com.google.android.exoplayer2.ui.R.drawable.exo_controls_repeat_one);
|
||||||
break;
|
break;
|
||||||
case com.google.android.exoplayer2.Player.REPEAT_MODE_ALL:
|
case com.google.android.exoplayer2.Player.REPEAT_MODE_ALL:
|
||||||
queueControlBinding.controlRepeat
|
queueControlBinding.controlRepeat.setImageResource(
|
||||||
.setImageResource(R.drawable.exo_controls_repeat_all);
|
com.google.android.exoplayer2.ui.R.drawable.exo_controls_repeat_all);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -342,14 +342,14 @@ public class PlaybackParameterDialog extends DialogFragment {
|
||||||
final Map<Boolean, TextView> pitchCtrlModeComponentMapping =
|
final Map<Boolean, TextView> pitchCtrlModeComponentMapping =
|
||||||
getPitchControlModeComponentMappings();
|
getPitchControlModeComponentMappings();
|
||||||
pitchCtrlModeComponentMapping.forEach((v, textView) -> textView.setBackground(
|
pitchCtrlModeComponentMapping.forEach((v, textView) -> textView.setBackground(
|
||||||
resolveDrawable(requireContext(), R.attr.selectableItemBackground)));
|
resolveDrawable(requireContext(), android.R.attr.selectableItemBackground)));
|
||||||
|
|
||||||
// Mark the selected textview
|
// Mark the selected textview
|
||||||
final TextView textView = pitchCtrlModeComponentMapping.get(semitones);
|
final TextView textView = pitchCtrlModeComponentMapping.get(semitones);
|
||||||
if (textView != null) {
|
if (textView != null) {
|
||||||
textView.setBackground(new LayerDrawable(new Drawable[]{
|
textView.setBackground(new LayerDrawable(new Drawable[]{
|
||||||
resolveDrawable(requireContext(), R.attr.dashed_border),
|
resolveDrawable(requireContext(), R.attr.dashed_border),
|
||||||
resolveDrawable(requireContext(), R.attr.selectableItemBackground)
|
resolveDrawable(requireContext(), android.R.attr.selectableItemBackground)
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -415,14 +415,14 @@ public class PlaybackParameterDialog extends DialogFragment {
|
||||||
// Bring all textviews into a normal state
|
// Bring all textviews into a normal state
|
||||||
final Map<Double, TextView> stepSiteComponentMapping = getStepSizeComponentMappings();
|
final Map<Double, TextView> stepSiteComponentMapping = getStepSizeComponentMappings();
|
||||||
stepSiteComponentMapping.forEach((v, textView) -> textView.setBackground(
|
stepSiteComponentMapping.forEach((v, textView) -> textView.setBackground(
|
||||||
resolveDrawable(requireContext(), R.attr.selectableItemBackground)));
|
resolveDrawable(requireContext(), android.R.attr.selectableItemBackground)));
|
||||||
|
|
||||||
// Mark the selected textview
|
// Mark the selected textview
|
||||||
final TextView textView = stepSiteComponentMapping.get(newStepSize);
|
final TextView textView = stepSiteComponentMapping.get(newStepSize);
|
||||||
if (textView != null) {
|
if (textView != null) {
|
||||||
textView.setBackground(new LayerDrawable(new Drawable[]{
|
textView.setBackground(new LayerDrawable(new Drawable[]{
|
||||||
resolveDrawable(requireContext(), R.attr.dashed_border),
|
resolveDrawable(requireContext(), R.attr.dashed_border),
|
||||||
resolveDrawable(requireContext(), R.attr.selectableItemBackground)
|
resolveDrawable(requireContext(), android.R.attr.selectableItemBackground)
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -69,41 +69,48 @@ public final class NotificationActionData {
|
||||||
switch (selectedAction) {
|
switch (selectedAction) {
|
||||||
case NotificationConstants.PREVIOUS:
|
case NotificationConstants.PREVIOUS:
|
||||||
return new NotificationActionData(ACTION_PLAY_PREVIOUS,
|
return new NotificationActionData(ACTION_PLAY_PREVIOUS,
|
||||||
ctx.getString(R.string.exo_controls_previous_description), baseActionIcon);
|
ctx.getString(com.google.android.exoplayer2.ui.R.string
|
||||||
|
.exo_controls_previous_description), baseActionIcon);
|
||||||
|
|
||||||
case NotificationConstants.NEXT:
|
case NotificationConstants.NEXT:
|
||||||
return new NotificationActionData(ACTION_PLAY_NEXT,
|
return new NotificationActionData(ACTION_PLAY_NEXT,
|
||||||
ctx.getString(R.string.exo_controls_next_description), baseActionIcon);
|
ctx.getString(com.google.android.exoplayer2.ui.R.string
|
||||||
|
.exo_controls_next_description), baseActionIcon);
|
||||||
|
|
||||||
case NotificationConstants.REWIND:
|
case NotificationConstants.REWIND:
|
||||||
return new NotificationActionData(ACTION_FAST_REWIND,
|
return new NotificationActionData(ACTION_FAST_REWIND,
|
||||||
ctx.getString(R.string.exo_controls_rewind_description), baseActionIcon);
|
ctx.getString(com.google.android.exoplayer2.ui.R.string
|
||||||
|
.exo_controls_rewind_description), baseActionIcon);
|
||||||
|
|
||||||
case NotificationConstants.FORWARD:
|
case NotificationConstants.FORWARD:
|
||||||
return new NotificationActionData(ACTION_FAST_FORWARD,
|
return new NotificationActionData(ACTION_FAST_FORWARD,
|
||||||
ctx.getString(R.string.exo_controls_fastforward_description),
|
ctx.getString(com.google.android.exoplayer2.ui.R.string
|
||||||
baseActionIcon);
|
.exo_controls_fastforward_description), baseActionIcon);
|
||||||
|
|
||||||
case NotificationConstants.SMART_REWIND_PREVIOUS:
|
case NotificationConstants.SMART_REWIND_PREVIOUS:
|
||||||
if (player.getPlayQueue() != null && player.getPlayQueue().size() > 1) {
|
if (player.getPlayQueue() != null && player.getPlayQueue().size() > 1) {
|
||||||
return new NotificationActionData(ACTION_PLAY_PREVIOUS,
|
return new NotificationActionData(ACTION_PLAY_PREVIOUS,
|
||||||
ctx.getString(R.string.exo_controls_previous_description),
|
ctx.getString(com.google.android.exoplayer2.ui.R.string
|
||||||
R.drawable.exo_notification_previous);
|
.exo_controls_previous_description),
|
||||||
|
com.google.android.exoplayer2.ui.R.drawable.exo_notification_previous);
|
||||||
} else {
|
} else {
|
||||||
return new NotificationActionData(ACTION_FAST_REWIND,
|
return new NotificationActionData(ACTION_FAST_REWIND,
|
||||||
ctx.getString(R.string.exo_controls_rewind_description),
|
ctx.getString(com.google.android.exoplayer2.ui.R.string
|
||||||
R.drawable.exo_controls_rewind);
|
.exo_controls_rewind_description),
|
||||||
|
com.google.android.exoplayer2.ui.R.drawable.exo_controls_rewind);
|
||||||
}
|
}
|
||||||
|
|
||||||
case NotificationConstants.SMART_FORWARD_NEXT:
|
case NotificationConstants.SMART_FORWARD_NEXT:
|
||||||
if (player.getPlayQueue() != null && player.getPlayQueue().size() > 1) {
|
if (player.getPlayQueue() != null && player.getPlayQueue().size() > 1) {
|
||||||
return new NotificationActionData(ACTION_PLAY_NEXT,
|
return new NotificationActionData(ACTION_PLAY_NEXT,
|
||||||
ctx.getString(R.string.exo_controls_next_description),
|
ctx.getString(com.google.android.exoplayer2.ui.R.string
|
||||||
R.drawable.exo_notification_next);
|
.exo_controls_next_description),
|
||||||
|
com.google.android.exoplayer2.ui.R.drawable.exo_notification_next);
|
||||||
} else {
|
} else {
|
||||||
return new NotificationActionData(ACTION_FAST_FORWARD,
|
return new NotificationActionData(ACTION_FAST_FORWARD,
|
||||||
ctx.getString(R.string.exo_controls_fastforward_description),
|
ctx.getString(com.google.android.exoplayer2.ui.R.string
|
||||||
R.drawable.exo_controls_fastforward);
|
.exo_controls_fastforward_description),
|
||||||
|
com.google.android.exoplayer2.ui.R.drawable.exo_controls_fastforward);
|
||||||
}
|
}
|
||||||
|
|
||||||
case NotificationConstants.PLAY_PAUSE_BUFFERING:
|
case NotificationConstants.PLAY_PAUSE_BUFFERING:
|
||||||
|
@ -119,45 +126,56 @@ public final class NotificationActionData {
|
||||||
case NotificationConstants.PLAY_PAUSE:
|
case NotificationConstants.PLAY_PAUSE:
|
||||||
if (player.getCurrentState() == Player.STATE_COMPLETED) {
|
if (player.getCurrentState() == Player.STATE_COMPLETED) {
|
||||||
return new NotificationActionData(ACTION_PLAY_PAUSE,
|
return new NotificationActionData(ACTION_PLAY_PAUSE,
|
||||||
ctx.getString(R.string.exo_controls_pause_description),
|
ctx.getString(com.google.android.exoplayer2.ui.R.string
|
||||||
|
.exo_controls_pause_description),
|
||||||
R.drawable.ic_replay);
|
R.drawable.ic_replay);
|
||||||
} else if (player.isPlaying()
|
} else if (player.isPlaying()
|
||||||
|| player.getCurrentState() == Player.STATE_PREFLIGHT
|
|| player.getCurrentState() == Player.STATE_PREFLIGHT
|
||||||
|| player.getCurrentState() == Player.STATE_BLOCKED
|
|| player.getCurrentState() == Player.STATE_BLOCKED
|
||||||
|| player.getCurrentState() == Player.STATE_BUFFERING) {
|
|| player.getCurrentState() == Player.STATE_BUFFERING) {
|
||||||
return new NotificationActionData(ACTION_PLAY_PAUSE,
|
return new NotificationActionData(ACTION_PLAY_PAUSE,
|
||||||
ctx.getString(R.string.exo_controls_pause_description),
|
ctx.getString(com.google.android.exoplayer2.ui.R.string
|
||||||
R.drawable.exo_notification_pause);
|
.exo_controls_pause_description),
|
||||||
|
com.google.android.exoplayer2.ui.R.drawable.exo_notification_pause);
|
||||||
} else {
|
} else {
|
||||||
return new NotificationActionData(ACTION_PLAY_PAUSE,
|
return new NotificationActionData(ACTION_PLAY_PAUSE,
|
||||||
ctx.getString(R.string.exo_controls_play_description),
|
ctx.getString(com.google.android.exoplayer2.ui.R.string
|
||||||
R.drawable.exo_notification_play);
|
.exo_controls_play_description),
|
||||||
|
com.google.android.exoplayer2.ui.R.drawable.exo_notification_play);
|
||||||
}
|
}
|
||||||
|
|
||||||
case NotificationConstants.REPEAT:
|
case NotificationConstants.REPEAT:
|
||||||
if (player.getRepeatMode() == REPEAT_MODE_ALL) {
|
if (player.getRepeatMode() == REPEAT_MODE_ALL) {
|
||||||
return new NotificationActionData(ACTION_REPEAT,
|
return new NotificationActionData(ACTION_REPEAT,
|
||||||
ctx.getString(R.string.exo_controls_repeat_all_description),
|
ctx.getString(com.google.android.exoplayer2.ui.R.string
|
||||||
R.drawable.exo_media_action_repeat_all);
|
.exo_controls_repeat_all_description),
|
||||||
|
com.google.android.exoplayer2.ext.mediasession.R.drawable
|
||||||
|
.exo_media_action_repeat_all);
|
||||||
} else if (player.getRepeatMode() == REPEAT_MODE_ONE) {
|
} else if (player.getRepeatMode() == REPEAT_MODE_ONE) {
|
||||||
return new NotificationActionData(ACTION_REPEAT,
|
return new NotificationActionData(ACTION_REPEAT,
|
||||||
ctx.getString(R.string.exo_controls_repeat_one_description),
|
ctx.getString(com.google.android.exoplayer2.ui.R.string
|
||||||
R.drawable.exo_media_action_repeat_one);
|
.exo_controls_repeat_one_description),
|
||||||
|
com.google.android.exoplayer2.ext.mediasession.R.drawable
|
||||||
|
.exo_media_action_repeat_one);
|
||||||
} else /* player.getRepeatMode() == REPEAT_MODE_OFF */ {
|
} else /* player.getRepeatMode() == REPEAT_MODE_OFF */ {
|
||||||
return new NotificationActionData(ACTION_REPEAT,
|
return new NotificationActionData(ACTION_REPEAT,
|
||||||
ctx.getString(R.string.exo_controls_repeat_off_description),
|
ctx.getString(com.google.android.exoplayer2.ui.R.string
|
||||||
R.drawable.exo_media_action_repeat_off);
|
.exo_controls_repeat_off_description),
|
||||||
|
com.google.android.exoplayer2.ext.mediasession.R.drawable
|
||||||
|
.exo_media_action_repeat_off);
|
||||||
}
|
}
|
||||||
|
|
||||||
case NotificationConstants.SHUFFLE:
|
case NotificationConstants.SHUFFLE:
|
||||||
if (player.getPlayQueue() != null && player.getPlayQueue().isShuffled()) {
|
if (player.getPlayQueue() != null && player.getPlayQueue().isShuffled()) {
|
||||||
return new NotificationActionData(ACTION_SHUFFLE,
|
return new NotificationActionData(ACTION_SHUFFLE,
|
||||||
ctx.getString(R.string.exo_controls_shuffle_on_description),
|
ctx.getString(com.google.android.exoplayer2.ui.R.string
|
||||||
R.drawable.exo_controls_shuffle_on);
|
.exo_controls_shuffle_on_description),
|
||||||
|
com.google.android.exoplayer2.ui.R.drawable.exo_controls_shuffle_on);
|
||||||
} else {
|
} else {
|
||||||
return new NotificationActionData(ACTION_SHUFFLE,
|
return new NotificationActionData(ACTION_SHUFFLE,
|
||||||
ctx.getString(R.string.exo_controls_shuffle_off_description),
|
ctx.getString(com.google.android.exoplayer2.ui.R.string
|
||||||
R.drawable.exo_controls_shuffle_off);
|
.exo_controls_shuffle_off_description),
|
||||||
|
com.google.android.exoplayer2.ui.R.drawable.exo_controls_shuffle_off);
|
||||||
}
|
}
|
||||||
|
|
||||||
case NotificationConstants.CLOSE:
|
case NotificationConstants.CLOSE:
|
||||||
|
|
|
@ -78,16 +78,16 @@ public final class NotificationConstants {
|
||||||
@DrawableRes
|
@DrawableRes
|
||||||
public static final int[] ACTION_ICONS = {
|
public static final int[] ACTION_ICONS = {
|
||||||
0,
|
0,
|
||||||
R.drawable.exo_icon_previous,
|
com.google.android.exoplayer2.ui.R.drawable.exo_icon_previous,
|
||||||
R.drawable.exo_icon_next,
|
com.google.android.exoplayer2.ui.R.drawable.exo_icon_next,
|
||||||
R.drawable.exo_icon_rewind,
|
com.google.android.exoplayer2.ui.R.drawable.exo_icon_rewind,
|
||||||
R.drawable.exo_icon_fastforward,
|
com.google.android.exoplayer2.ui.R.drawable.exo_icon_fastforward,
|
||||||
R.drawable.exo_icon_previous,
|
com.google.android.exoplayer2.ui.R.drawable.exo_icon_previous,
|
||||||
R.drawable.exo_icon_next,
|
com.google.android.exoplayer2.ui.R.drawable.exo_icon_next,
|
||||||
R.drawable.ic_pause,
|
R.drawable.ic_pause,
|
||||||
R.drawable.ic_hourglass_top,
|
R.drawable.ic_hourglass_top,
|
||||||
R.drawable.exo_icon_repeat_all,
|
com.google.android.exoplayer2.ui.R.drawable.exo_icon_repeat_all,
|
||||||
R.drawable.exo_icon_shuffle_on,
|
com.google.android.exoplayer2.ui.R.drawable.exo_icon_shuffle_on,
|
||||||
R.drawable.ic_close,
|
R.drawable.ic_close,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -122,29 +122,41 @@ public final class NotificationConstants {
|
||||||
public static String getActionName(@NonNull final Context context, @Action final int action) {
|
public static String getActionName(@NonNull final Context context, @Action final int action) {
|
||||||
switch (action) {
|
switch (action) {
|
||||||
case PREVIOUS:
|
case PREVIOUS:
|
||||||
return context.getString(R.string.exo_controls_previous_description);
|
return context.getString(com.google.android.exoplayer2.ui.R.string
|
||||||
|
.exo_controls_previous_description);
|
||||||
case NEXT:
|
case NEXT:
|
||||||
return context.getString(R.string.exo_controls_next_description);
|
return context.getString(com.google.android.exoplayer2.ui.R.string
|
||||||
|
.exo_controls_next_description);
|
||||||
case REWIND:
|
case REWIND:
|
||||||
return context.getString(R.string.exo_controls_rewind_description);
|
return context.getString(com.google.android.exoplayer2.ui.R.string
|
||||||
|
.exo_controls_rewind_description);
|
||||||
case FORWARD:
|
case FORWARD:
|
||||||
return context.getString(R.string.exo_controls_fastforward_description);
|
return context.getString(com.google.android.exoplayer2.ui.R.string
|
||||||
|
.exo_controls_fastforward_description);
|
||||||
case SMART_REWIND_PREVIOUS:
|
case SMART_REWIND_PREVIOUS:
|
||||||
return Localization.concatenateStrings(
|
return Localization.concatenateStrings(
|
||||||
context.getString(R.string.exo_controls_rewind_description),
|
context.getString(com.google.android.exoplayer2.ui.R.string
|
||||||
context.getString(R.string.exo_controls_previous_description));
|
.exo_controls_rewind_description),
|
||||||
|
context.getString(com.google.android.exoplayer2.ui.R.string
|
||||||
|
.exo_controls_previous_description));
|
||||||
case SMART_FORWARD_NEXT:
|
case SMART_FORWARD_NEXT:
|
||||||
return Localization.concatenateStrings(
|
return Localization.concatenateStrings(
|
||||||
context.getString(R.string.exo_controls_fastforward_description),
|
context.getString(com.google.android.exoplayer2.ui.R.string
|
||||||
context.getString(R.string.exo_controls_next_description));
|
.exo_controls_fastforward_description),
|
||||||
|
context.getString(com.google.android.exoplayer2.ui.R.string
|
||||||
|
.exo_controls_next_description));
|
||||||
case PLAY_PAUSE:
|
case PLAY_PAUSE:
|
||||||
return Localization.concatenateStrings(
|
return Localization.concatenateStrings(
|
||||||
context.getString(R.string.exo_controls_play_description),
|
context.getString(com.google.android.exoplayer2.ui.R.string
|
||||||
context.getString(R.string.exo_controls_pause_description));
|
.exo_controls_play_description),
|
||||||
|
context.getString(com.google.android.exoplayer2.ui.R.string
|
||||||
|
.exo_controls_pause_description));
|
||||||
case PLAY_PAUSE_BUFFERING:
|
case PLAY_PAUSE_BUFFERING:
|
||||||
return Localization.concatenateStrings(
|
return Localization.concatenateStrings(
|
||||||
context.getString(R.string.exo_controls_play_description),
|
context.getString(com.google.android.exoplayer2.ui.R.string
|
||||||
context.getString(R.string.exo_controls_pause_description),
|
.exo_controls_play_description),
|
||||||
|
context.getString(com.google.android.exoplayer2.ui.R.string
|
||||||
|
.exo_controls_pause_description),
|
||||||
context.getString(R.string.notification_action_buffering));
|
context.getString(R.string.notification_action_buffering));
|
||||||
case REPEAT:
|
case REPEAT:
|
||||||
return context.getString(R.string.notification_action_repeat);
|
return context.getString(R.string.notification_action_repeat);
|
||||||
|
|
|
@ -952,11 +952,14 @@ public abstract class VideoPlayerUi extends PlayerUi implements SeekBar.OnSeekBa
|
||||||
super.onRepeatModeChanged(repeatMode);
|
super.onRepeatModeChanged(repeatMode);
|
||||||
|
|
||||||
if (repeatMode == REPEAT_MODE_ALL) {
|
if (repeatMode == REPEAT_MODE_ALL) {
|
||||||
binding.repeatButton.setImageResource(R.drawable.exo_controls_repeat_all);
|
binding.repeatButton.setImageResource(
|
||||||
|
com.google.android.exoplayer2.ui.R.drawable.exo_controls_repeat_all);
|
||||||
} else if (repeatMode == REPEAT_MODE_ONE) {
|
} else if (repeatMode == REPEAT_MODE_ONE) {
|
||||||
binding.repeatButton.setImageResource(R.drawable.exo_controls_repeat_one);
|
binding.repeatButton.setImageResource(
|
||||||
|
com.google.android.exoplayer2.ui.R.drawable.exo_controls_repeat_one);
|
||||||
} else /* repeatMode == REPEAT_MODE_OFF */ {
|
} else /* repeatMode == REPEAT_MODE_OFF */ {
|
||||||
binding.repeatButton.setImageResource(R.drawable.exo_controls_repeat_off);
|
binding.repeatButton.setImageResource(
|
||||||
|
com.google.android.exoplayer2.ui.R.drawable.exo_controls_repeat_off);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
android.defaults.buildfeatures.buildconfig=true
|
android.defaults.buildfeatures.buildconfig=true
|
||||||
android.enableJetifier=false
|
android.enableJetifier=false
|
||||||
android.nonFinalResIds=false
|
android.nonFinalResIds=false
|
||||||
android.nonTransitiveRClass=false
|
android.nonTransitiveRClass=true
|
||||||
android.useAndroidX=true
|
android.useAndroidX=true
|
||||||
org.gradle.jvmargs=-Xmx2048M --add-opens jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED
|
org.gradle.jvmargs=-Xmx2048M --add-opens jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED
|
||||||
systemProp.file.encoding=utf-8
|
systemProp.file.encoding=utf-8
|
||||||
|
|
Loading…
Reference in New Issue