[Android] Set correct icons for A-B repeat option
Geoffrey Métais
git at videolan.org
Fri Nov 2 14:56:52 CET 2018
vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Fri Nov 2 14:56:24 2018 +0100| [f2291f53372aaa796a5a74dfa8c17da2a068847f] | committer: Geoffrey Métais
Set correct icons for A-B repeat option
> https://code.videolan.org/videolan/vlc-android/commit/f2291f53372aaa796a5a74dfa8c17da2a068847f
---
vlc-android/res/values/styles.xml | 6 +++++-
.../videolan/vlc/gui/dialogs/AdvOptionsDialog.java | 19 ++++++++++---------
2 files changed, 15 insertions(+), 10 deletions(-)
diff --git a/vlc-android/res/values/styles.xml b/vlc-android/res/values/styles.xml
index f96c52912..c7b91b687 100644
--- a/vlc-android/res/values/styles.xml
+++ b/vlc-android/res/values/styles.xml
@@ -269,7 +269,6 @@
<item name="ic_audiodelay">@drawable/ic_audiodelay_w</item>
<item name="ic_subtitledelay">@drawable/ic_subtitledelay_w</item>
<item name="ic_passthrough">@drawable/ic_passthrough_w</item>
- <item name="ic_abrepeat">@drawable/ic_abrepeat_w</item>
<item name="ic_repeat">@drawable/ic_repeat_w</item>
<item name="ic_repeat_all">@drawable/ic_repeat_all</item>
<item name="ic_repeat_one">@drawable/ic_repeat_one</item>
@@ -284,6 +283,11 @@
<item name="list_title_last">@color/list_title_last</item>
<item name="list_title">@color/bt_list_title</item>
<item name="progress_background">@color/grey400transparent</item>
+ <item name="ic_abrepeat">@drawable/ic_abrepeat_w</item>
+ <item name="ic_abrepeat_seta">@drawable/ic_abrepeat_seta_w</item>
+ <item name="ic_abrepeat_setb">@drawable/ic_abrepeat_setb_w</item>
+ <item name="ic_abrepeat_reset">@drawable/ic_abrepeat_reset_w</item>
+ <item name="ic_dial">@drawable/ic_dial_w</item>
</style>
<style name="VLCTransparentTheme" parent="Theme.VLC">
diff --git a/vlc-android/src/org/videolan/vlc/gui/dialogs/AdvOptionsDialog.java b/vlc-android/src/org/videolan/vlc/gui/dialogs/AdvOptionsDialog.java
index bdfd6aa28..5e57a8154 100644
--- a/vlc-android/src/org/videolan/vlc/gui/dialogs/AdvOptionsDialog.java
+++ b/vlc-android/src/org/videolan/vlc/gui/dialogs/AdvOptionsDialog.java
@@ -27,7 +27,6 @@ import android.app.Activity;
import android.app.AlarmManager;
import android.app.Dialog;
import android.app.PendingIntent;
-import androidx.lifecycle.Observer;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
@@ -36,10 +35,6 @@ import android.content.res.TypedArray;
import android.graphics.Color;
import android.os.Build;
import android.os.Bundle;
-import androidx.annotation.Nullable;
-import androidx.fragment.app.DialogFragment;
-import androidx.recyclerview.widget.GridLayoutManager;
-import androidx.recyclerview.widget.RecyclerView;
import android.text.format.DateFormat;
import android.view.Gravity;
import android.view.KeyEvent;
@@ -70,6 +65,12 @@ import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;
+import androidx.annotation.Nullable;
+import androidx.fragment.app.DialogFragment;
+import androidx.lifecycle.Observer;
+import androidx.recyclerview.widget.GridLayoutManager;
+import androidx.recyclerview.widget.RecyclerView;
+
public class AdvOptionsDialog extends DismissDialogFragment implements View.OnClickListener, PlaybackService.Client.Callback, View.OnFocusChangeListener, DialogInterface.OnKeyListener {
public final static String TAG = "VLC/AdvOptionsDialog";
@@ -394,9 +395,9 @@ public class AdvOptionsDialog extends DismissDialogFragment implements View.OnCl
public void onChanged(@Nullable ABRepeat abr) {
if (abr == null) return;
int resid;
- if (abr.getStart() == -1L) resid = R.attr.ic_repeat;
- else if (abr.getStop() == -1L) resid = R.attr.ic_repeat_one;
- else resid = R.attr.ic_repeat_all;
+ if (abr.getStart() == -1L) resid = R.attr.ic_abrepeat_seta;
+ else if (abr.getStop() == -1L) resid = R.attr.ic_abrepeat_setb;
+ else resid = R.attr.ic_abrepeat_reset;
final int icon = UiTools.getResourceFromAttribute(mABRepeat.getContext(), resid);
mABRepeat.setCompoundDrawablesWithIntrinsicBounds(0, icon, 0, 0);
}
@@ -578,7 +579,7 @@ public class AdvOptionsDialog extends DismissDialogFragment implements View.OnCl
mAdapter.addOption(new Option(ID_REPEAT, R.attr.ic_repeat, getString(R.string.repeat_title)));
if (mService.canShuffle())
mAdapter.addOption(new Option(ID_SHUFFLE, R.attr.ic_shuffle, getString(R.string.shuffle_title)));
- mAdapter.addOption(new Option(ID_ABREPEAT, R.attr.ic_repeat, getString(R.string.ab_repeat)));
+ mAdapter.addOption(new Option(ID_ABREPEAT, R.attr.ic_abrepeat, getString(R.string.ab_repeat)));
final MediaPlayer.Chapter[] chapters = mService.getChapters(-1);
final int chaptersCount = chapters != null ? chapters.length : 0;
More information about the Android
mailing list