Merge branch 'master' into feature/duck-on-notification
This commit is contained in:
commit
eca9d4a00a
25 files changed
+70
-114
No files matched your search
@@ -175,7 +175,7 @@ public class CoverCache {
|
||||
* Creates a new in-memory LRU cache
|
||||
*
|
||||
* @param context the application context
|
||||
* @param int the lru cache size in bytes
|
||||
* @param size the lru cache size in bytes
|
||||
*/
|
||||
public BitmapLruCache(Context context, int size) {
|
||||
super(size);
|
||||
|
||||
@@ -644,7 +644,7 @@ public class FullPlaybackActivity extends PlaybackActivity
|
||||
*/
|
||||
private static final int MSG_UPDATE_POSITION = 17;
|
||||
/**
|
||||
* Calls {@link #seekToProgress()}.
|
||||
* Calls {@link PlaybackService#seekToProgress(int)}.
|
||||
*/
|
||||
private static final int MSG_SEEK_TO_PROGRESS = 18;
|
||||
|
||||
@@ -710,13 +710,14 @@ public class FullPlaybackActivity extends PlaybackActivity
|
||||
mSeekBarTracking = false;
|
||||
}
|
||||
|
||||
public void performAction(Action action)
|
||||
@Override
|
||||
protected void performAction(Action action)
|
||||
{
|
||||
if (action == Action.ToggleControls) {
|
||||
setControlsVisible(!mControlsVisible);
|
||||
mHandler.sendEmptyMessage(MSG_SAVE_CONTROLS);
|
||||
} else {
|
||||
PlaybackService.get(this).performAction(action, this);
|
||||
super.performAction(action);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -191,7 +191,7 @@ public class LazyCoverView extends ImageView
|
||||
* Updates the view with a cached bitmap
|
||||
* A fallback image will be used on cache miss
|
||||
*
|
||||
* @param payload The cover message containing the cache key and view to use
|
||||
* @param key The cover message containing the cache key and view to use
|
||||
*/
|
||||
public boolean drawFromCache(CoverCache.CoverKey key, boolean fadeIn) {
|
||||
boolean cacheHit = true;
|
||||
|
||||
@@ -77,7 +77,6 @@ public class NewPlaylistDialog extends Dialog implements TextWatcher, View.OnCli
|
||||
* disabled when the EditText contains this text.
|
||||
* @param actionText A string resource describing the default positive
|
||||
* action (e.g. "Create").
|
||||
* @param intent An optional intent to store with the dialog.
|
||||
*/
|
||||
public NewPlaylistDialog(Context context, String initialText, int actionText, PlaylistTask playlistTask)
|
||||
{
|
||||
|
||||
@@ -540,13 +540,18 @@ public abstract class PlaybackActivity extends Activity
|
||||
@Override
|
||||
public void upSwipe()
|
||||
{
|
||||
PlaybackService.get(this).performAction(mUpAction, this);
|
||||
performAction(mUpAction);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void downSwipe()
|
||||
{
|
||||
PlaybackService.get(this).performAction(mDownAction, this);
|
||||
performAction(mDownAction);
|
||||
}
|
||||
|
||||
protected void performAction(Action action)
|
||||
{
|
||||
PlaybackService.get(this).performAction(action, this);
|
||||
}
|
||||
|
||||
private static final int GROUP_SHUFFLE = 100;
|
||||
|
||||
@@ -200,7 +200,7 @@ public class Playlist {
|
||||
* Copy content from one playlist to another
|
||||
*
|
||||
* @param resolver A ContentResolver to use.
|
||||
* @param sourceid The Media.Audio.Playlists id of the source playlist
|
||||
* @param sourceId The Media.Audio.Playlists id of the source playlist
|
||||
* @param destinationId The Media.Audio.Playlists id of the destination playlist
|
||||
*/
|
||||
private static void _copyToPlaylist(ContentResolver resolver, long sourceId, long destinationId) {
|
||||
|
||||
@@ -19,8 +19,9 @@ package ch.blinkenlights.android.vanilla;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.DialogInterface;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Message;
|
||||
import android.view.View;
|
||||
@@ -29,7 +30,6 @@ import android.view.MenuItem;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.AdapterView.OnItemClickListener;
|
||||
import android.widget.AdapterView.OnItemLongClickListener;
|
||||
import android.widget.ListView;
|
||||
import com.mobeta.android.dslv.DragSortListView;
|
||||
|
||||
public class ShowQueueActivity extends PlaybackActivity
|
||||
@@ -41,7 +41,7 @@ public class ShowQueueActivity extends PlaybackActivity
|
||||
private ShowQueueAdapter listAdapter;
|
||||
private PlaybackService mService;
|
||||
|
||||
@Override
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
ThemeHelper.setTheme(this, R.style.BackActionBar);
|
||||
super.onCreate(savedInstanceState);
|
||||
@@ -84,7 +84,7 @@ public class ShowQueueActivity extends PlaybackActivity
|
||||
|
||||
/**
|
||||
* Called after the user selected an action from the ActionBar
|
||||
*
|
||||
*
|
||||
* @param item The selected menu item
|
||||
*/
|
||||
@Override
|
||||
@@ -208,12 +208,25 @@ public class ShowQueueActivity extends PlaybackActivity
|
||||
listAdapter.add(mService.getSongByQueuePosition(i));
|
||||
}
|
||||
|
||||
if (scroll == true)
|
||||
mListView.setSelectionFromTop(spos, 0); /* scroll to currently playing song */
|
||||
if(scroll)
|
||||
scrollToCurrentSong(spos);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Scrolls to the current song<br/>
|
||||
* We suppress the new api lint check as lint thinks
|
||||
* {@link android.widget.AbsListView#setSelectionFromTop(int, int)} was only added in
|
||||
* {@link Build.VERSION_CODES#JELLY_BEAN}, but it was actually added in API
|
||||
* level 1<br/>
|
||||
* <a href="https://developer.android.com/reference/android/widget/AbsListView.html#setSelectionFromTop%28int,%20int%29">
|
||||
* Android reference: AbsListView.setSelectionFromTop()</a>
|
||||
* @param currentSongPosition The position in {@link #mListView} of the current song
|
||||
*/
|
||||
@SuppressLint("NewApi")
|
||||
private void scrollToCurrentSong(int currentSongPosition){
|
||||
mListView.setSelectionFromTop(currentSongPosition, 0); /* scroll to currently playing song */
|
||||
}
|
||||
|
||||
}
|
||||
@@ -18,10 +18,13 @@
|
||||
|
||||
package ch.blinkenlights.android.vanilla;
|
||||
|
||||
import android.annotation.TargetApi;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.media.MediaPlayer;
|
||||
import android.media.audiofx.AudioEffect;
|
||||
import android.os.Build;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class VanillaMediaPlayer extends MediaPlayer {
|
||||
@@ -77,6 +80,7 @@ public class VanillaMediaPlayer extends MediaPlayer {
|
||||
/**
|
||||
* Sets the next media player data source
|
||||
*/
|
||||
@TargetApi(Build.VERSION_CODES.JELLY_BEAN)
|
||||
public void setNextMediaPlayer(VanillaMediaPlayer next) {
|
||||
super.setNextMediaPlayer(next);
|
||||
mHasNextMediaPlayer = (next != null);
|
||||
|
||||
Reference in new issue
Block a user