diff --git a/proguard.config b/proguard.config index 88b63ba4..abebcdb9 100644 --- a/proguard.config +++ b/proguard.config @@ -9,36 +9,36 @@ -dontpreverify -verbose --keep public class * extends android.app.Activity --keep public class * extends android.app.Application --keep public class * extends android.app.Service --keep public class * extends android.content.BroadcastReceiver --keep public class * extends android.content.ContentProvider --keep public class * extends android.app.backup.BackupAgentHelper --keep public class * extends android.preference.Preference +-keep public class org.kreed.vanilla.* extends android.app.Activity +-keep public class org.kreed.vanilla.* extends android.app.Application +-keep public class org.kreed.vanilla.* extends android.app.Service +-keep public class org.kreed.vanilla.* extends android.content.BroadcastReceiver +-keep public class org.kreed.vanilla.* extends android.content.ContentProvider +-keep public class org.kreed.vanilla.* extends android.app.backup.BackupAgentHelper +-keep public class org.kreed.vanilla.* extends android.preference.Preference --keepclassmembers enum * { +-keepclassmembers enum org.kreed.vanilla.* { public static **[] values(); public static ** valueOf(java.lang.String); } --keepclasseswithmembernames class * { +-keepclasseswithmembernames class org.kreed.vanilla.* { native ; } --keepclasseswithmembers class * { +-keepclasseswithmembers class org.kreed.vanilla.*,com.viewpagerindicator.*,android.support.v4.view.ViewPager { public (android.content.Context, android.util.AttributeSet); } --keepclasseswithmembers class * { +-keepclasseswithmembers class org.kreed.vanilla.* { public (android.content.Context, android.util.AttributeSet, int); } --keepclassmembers class * extends android.app.Activity { +-keepclassmembers class org.kreed.vanilla.* extends android.app.Activity { public void *(android.view.View); } --keep class * implements android.os.Parcelable { +-keep class org.kreed.vanilla.* implements android.os.Parcelable { public static final android.os.Parcelable$Creator *; } diff --git a/res/values/translatable.xml b/res/values/translatable.xml index 0c714bc8..371386db 100644 --- a/res/values/translatable.xml +++ b/res/values/translatable.xml @@ -160,17 +160,17 @@ THE SOFTWARE. Accelerometer Shake Enable Accelerometer Shake Only active when music is playing. Does not work when screen is off on some devices. - Accelerometer Shake Action + Shake Action Shake Force Threshold Miscellaneous Features Disable Lockscreen - Do not show the lockscreen with the library screen or playback screen open. + Prevent the lockscreen from activating when in the library or playback screen Enable Idle Timeout When active, playback will be stopped after the given period of inactivity Idle Timeout Disable Cover Art - Do not show cover art anywhere in the application + Avoid loading cover art anywhere in the application Double Tap Widget Double-tapping the 1x1 widget will open the player. Incurs a 400ms delay before the widget responds to actions. Use ScrobbleDroid API diff --git a/src/org/kreed/vanilla/LibraryActivity.java b/src/org/kreed/vanilla/LibraryActivity.java index 91c8716d..74b90dc2 100644 --- a/src/org/kreed/vanilla/LibraryActivity.java +++ b/src/org/kreed/vanilla/LibraryActivity.java @@ -92,7 +92,7 @@ public class LibraryActivity public ViewPager mViewPager; private View mSearchBox; private boolean mSearchBoxVisible; - private TextView mTextFilter; + TextView mTextFilter; private View mClearButton; private View mActionControls; @@ -451,7 +451,7 @@ public class LibraryActivity * Returns either "Play All" or "Enqueue All", depending on the current * default action. */ - private String getHeaderText() + public String getHeaderText() { int action = mDefaultAction; if (action == ACTION_LAST_USED) @@ -691,7 +691,10 @@ public class LibraryActivity } } - private void updateLimiterViews() + /** + * Create or recreate the limiter breadcrumbs. + */ + public void updateLimiterViews() { mLimiterViews.removeAllViews(); @@ -1311,7 +1314,7 @@ public class LibraryActivity * * @param adapter The adapter to load for. */ - private void loadSortOrder(MediaAdapter adapter) + public void loadSortOrder(MediaAdapter adapter) { String key = String.format("sort_%d_%d", adapter.getMediaType(), adapter.getLimiterType()); int def = adapter.getDefaultSortMode(); diff --git a/src/org/kreed/vanilla/MusicAlphabetIndexer.java b/src/org/kreed/vanilla/MusicAlphabetIndexer.java index 76786b41..2eaec3e8 100644 --- a/src/org/kreed/vanilla/MusicAlphabetIndexer.java +++ b/src/org/kreed/vanilla/MusicAlphabetIndexer.java @@ -32,14 +32,14 @@ public class MusicAlphabetIndexer { { " ", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z" }; /** - * The result of {@link MediaStore.Audio.keyFor(String)} called on each + * The result of {@link android.provider.MediaStore.Audio#keyFor(String)} called on each * letter of the alphabet. */ private static String[] ALPHABET_KEYS = null; /** * Cached section postions. */ - private int mAlphaMap[]; + private final int mAlphaMap[]; /** * Cursor that is used by the adapter of the list view. */ @@ -47,7 +47,7 @@ public class MusicAlphabetIndexer { /** * The index of the cursor column that this list is sorted on. */ - private int mColumnIndex; + private final int mColumnIndex; /** * Constructs the indexer. diff --git a/src/org/kreed/vanilla/PlaybackService.java b/src/org/kreed/vanilla/PlaybackService.java index 94854dfe..9e71e023 100644 --- a/src/org/kreed/vanilla/PlaybackService.java +++ b/src/org/kreed/vanilla/PlaybackService.java @@ -155,6 +155,34 @@ public final class PlaybackService extends Service */ public static final String ACTION_CYCLE_REPEAT = "org.kreed.vanilla.CYCLE_REPEAT"; + public static final int NEVER = 0; + public static final int WHEN_PLAYING = 1; + public static final int ALWAYS = 2; + + /** + * Notification click action: open LaunchActivity. + */ + private static final int NOT_ACTION_MAIN_ACTIVITY = 0; + /** + * Notification click action: open MiniPlaybackActivity. + */ + private static final int NOT_ACTION_MINI_ACTIVITY = 1; + /** + * Notification click action: skip to next song. + */ + private static final int NOT_ACTION_NEXT_SONG = 2; + + /** + * If a user action is triggered within this time (in ms) after the + * idle time fade-out occurs, playback will be resumed. + */ + private static final long IDLE_GRACE_PERIOD = 60000; + /** + * Minimum time in milliseconds between shake actions. + */ + private static final int MIN_SHAKE_PERIOD = 500; + + /** * If set, music will play. */ @@ -196,32 +224,14 @@ public final class PlaybackService extends Service * ff: {@link PlaybackService#MASK_SHUFFLE} */ int mState; - private final Object mStateLock = new Object[0]; - - public static final int NEVER = 0; - public static final int WHEN_PLAYING = 1; - public static final int ALWAYS = 2; - /** - * Notification click action: open LaunchActivity. + * Object used for state-related locking. */ - private static final int NOT_ACTION_MAIN_ACTIVITY = 0; + final Object[] mStateLock = new Object[0]; /** - * Notification click action: open MiniPlaybackActivity. + * Object used for PlaybackService startup waiting. */ - private static final int NOT_ACTION_MINI_ACTIVITY = 1; - /** - * Notification click action: skip to next song. - */ - private static final int NOT_ACTION_NEXT_SONG = 2; - - /** - * If a user action is triggered within this time (in ms) after the - * idle time fade-out occurs, playback will be resumed. - */ - private static final long IDLE_GRACE_PERIOD = 60000; - - private static final Object sWait = new Object[0]; + private static final Object[] sWait = new Object[0]; /** * The appplication-wide instance of the PlaybackService. */ @@ -247,12 +257,12 @@ public final class PlaybackService extends Service /** * If true, start playing when the headset is plugged in. */ - private boolean mHeadsetPlay; + boolean mHeadsetPlay; /** * True if the initial broadcast sent when registering HEADSET_PLUG has * been receieved. */ - private boolean mPlugInitialized; + boolean mPlugInitialized; /** * The time to wait before considering the player idle. */ @@ -323,12 +333,6 @@ public final class PlaybackService extends Service * True if the last audio focus loss can be ducked. */ private boolean mDuckedLoss; - - /** - * Minimum time in milliseconds between shake actions. - */ - private static final int MIN_SHAKE_PERIOD = 500; - /** * Magnitude of last sensed acceleration. */