Skip to content
This repository has been archived by the owner on Dec 28, 2022. It is now read-only.

Commit

Permalink
Merge branch 'dev' into beta
Browse files Browse the repository at this point in the history
  • Loading branch information
timusus committed Dec 17, 2017
2 parents 9a7d581 + 6481276 commit 804e4b6
Show file tree
Hide file tree
Showing 56 changed files with 1,248 additions and 279 deletions.
13 changes: 6 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,12 @@ android:
components:
- tools
- platform-tools
- build-tools-27.0.1
- android-26
- build-tools-27.0.2
- android-27
- extra-android-support
- extra-android-m2repository
- extra-google-m2repository
licenses:
- android-sdk-preview-license-.+
- android-sdk-license-.+
- google-gdk-license-.+
- ".+"

# Increase travis 'git depth' from default of 50, to 10000. Potential fix for commit count issue.
Expand Down Expand Up @@ -48,7 +45,7 @@ deploy:
- provider: releases
api_key:
secure: y/DY5he0HhCR1M4B4eKuhjvcpNYDAKCg89g3Bw7YAla10sYS5EJch3QQorLzTdSSFZuuufaue5524ap4mNAyB1RClw5waDwSbmhk96xdVFGak6u1Hzc3yTb7YaFmLtmWY93kCcpXOHkqqf/M7QwG4FlilwKhTiEa6YcB+U78JA3pVx1TLTezW+E79wJkB6yGY0nlzRUYZG2z1IqpIE8Cgj56T2gpBHLfJCcPkcM56d4hhxrs+pWqkF0Y2pFtNI8CxzqQlGXYoakW/QEZ5GDCkuvwNro5RhJZx6Vr7uMBmh2Rq+xwIvnwA4ljXrl8pwJVwua/g7NvQGdWaEsWJkVaEOqARbDWs3OJlBvmGBMldkwnbBDHMzHD6BTDwum+qIllr1V5skIqib6xwPw8qPk40QpjldaHRvRwqqpjNrHJ4jc44LoUTrCS9HT0pXiUT2HBQPWGZ+fg7rMIS1x7psRFQ7bjz9T/AHYkAqTZC5BqfezHh19RZdco2p+1rHCWEOZnLUJi9IJtXdpNeCPdllwPIEra4+2RdCPV6ASXf7GhQX5e/NmdCMAAaABxgRH8wiycYeEYTySBeeNWAB7u3ctY+CKUHm77P21myJi7+oolW4LaZw4J/RcjFny26AYKVtPYXVJ8AwV/epdpxiiEciiCf2nujmVFpLqKXMIV7La9LCc=
file: app/build/outputs/apk/shuttle-free-*.apk
file: app/build/outputs/apk/free/release/app-free-release.apk
file_glob: 'true'
skip_cleanup: true
on:
Expand All @@ -67,4 +64,6 @@ deploy:

# Slack build notifications
notifications:
slack: shuttlemusicplayer:g90QK9lL6Hg5jfzegqjjNqqN
slack: shuttlemusicplayer:g90QK9lL6Hg5jfzegqjjNqqN
template:
- "Build <%{build_url}|#%{build_number}> (<%{compare_url}|%{commit}: '%{commit_subject}'>) by %{author} %{result} in %{duration}."
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ android {
versionCode gitCommitCount() + 3200
// Add 3200 to account for moving to github and resetting commit count.

resConfigs "en", "zh-rCN", "fr", "de", "ko", "it", "ru", "nl", "tr", "pl", "hu", "uk", "bg-rBG", "en-rGB", "vi", "pt-rBR", "es", "en-rNZ", "zh-rTW", "es-rES", "hr", "en-rAU", "eu-rES"
resConfigs "en", "zh-rCN", "fr", "de", "ko", "it", "ru", "nl", "tr", "pl", "hu", "uk", "bg-rBG", "en-rGB", "vi", "pt-rBR", "es", "en-rNZ", "zh-rTW", "es-rES", "hr", "en-rAU", "eu-rES", "th"

renderscriptTargetApi 23

Expand Down
10 changes: 10 additions & 0 deletions app/src/main/assets/web/info.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@
</head>

<body>
<h4>2.0.0-beta23</h4>
<ul>
<li>Removed incompatible (very-bright) colours from colour presets</li>
<li>Fixed an issue where blurred artwork showed when changing songs while in landscape, when Shuttle is in the background in portrait</li>
<li>Fixed an issue where Equalizer didn't update in real time</li>
<li>Added a settings option to remember Shuffle mode (playback settings)</li>
<li>Added Thai translations</li>
<li>Fixed an issue where favourite icon is out of sync in notification</li>
<li>Various crash fixes</li>
</ul>
<h4>2.0.0-beta22</h4>
<ul>
<li>Added multi-select to artist/album/playlist/genre detail screens & search screen</li>
Expand Down
10 changes: 10 additions & 0 deletions app/src/main/assets/web/info_dark.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@
</head>

<body>
<h4>2.0.0-beta23</h4>
<ul>
<li>Removed incompatible (very-bright) colours from colour presets</li>
<li>Fixed an issue where blurred artwork showed when changing songs while in landscape, when Shuttle is in the background in portrait</li>
<li>Fixed an issue where Equalizer didn't update in real time</li>
<li>Added a settings option to remember Shuffle mode (playback settings)</li>
<li>Added Thai translations</li>
<li>Fixed an issue where favourite icon is out of sync in notification</li>
<li>Various crash fixes</li>
</ul>
<h4>2.0.0-beta22</h4>
<ul>
<li>Added multi-select to artist/album/playlist/genre detail screens & search screen</li>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.simplecity.amp_library.notifications;

import android.annotation.SuppressLint;
import android.app.Notification;
import android.app.PendingIntent;
import android.app.Service;
Expand Down Expand Up @@ -42,6 +43,7 @@ public class MusicNotificationHelper extends NotificationHelper {
private Notification notification;

private boolean isFavorite = false;

private Bitmap bitmap;

private Handler handler;
Expand Down Expand Up @@ -98,11 +100,13 @@ public NotificationCompat.Builder getBuilder(Context context, @NonNull Song song
return builder;
}

@SuppressLint("CheckResult")
public void notify(Context context, @NonNull Song song, boolean isPlaying, @NonNull MediaSessionCompat mediaSessionCompat) {
notification = getBuilder(context, song, mediaSessionCompat, bitmap, isPlaying, isFavorite).build();
notify(NOTIFICATION_ID, notification);

PlaylistUtils.isFavorite(song)
.first(false)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(isFavorite -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1467,11 +1467,10 @@ public void enqueue(List<Song> songs, final int action) {
/**
* Opens a list for playback
*
* @param songs The list of tracks to open
* @param shuffleMode The shuffle mode
* @param position The position to start playback at
* @param songs The list of tracks to open
* @param position The position to start playback at
*/
public void open(List<Song> songs, final int position, final int shuffleMode) {
public void open(List<Song> songs, final int position) {
synchronized (this) {

boolean notifyQueueChange = false;
Expand All @@ -1491,11 +1490,7 @@ public void open(List<Song> songs, final int position, final int shuffleMode) {
notifyQueueChange = true;
}

if (shuffleMode == ShuffleMode.OFF) {
playPos = position;
} else {
playPos = shuffler.nextInt(playlist.size());
}
playPos = position;

if (shuffleMode == ShuffleMode.ON) {
makeShuffleList();
Expand All @@ -1518,17 +1513,6 @@ public void open(List<Song> songs, final int position, final int shuffleMode) {
}
}

/**
* Opens a list for playback
*
* @param songs The list of tracks to open
* @param position The position to start playback at
*/
public void open(List<Song> songs, final int position) {
// position less than one previously has indicated track shuffle mode
open(songs, position < 0 ? ShuffleMode.ON : ShuffleMode.OFF, position);
}

/**
* Moves the item at index1 to index2.
*
Expand Down Expand Up @@ -1963,8 +1947,6 @@ public void onLoadFailed(Exception e, Drawable errorDrawable) {

void updateNotification() {

Log.i(TAG, "updateNotification called");

final int notifyMode;

if (isPlaying()) {
Expand Down Expand Up @@ -2301,10 +2283,16 @@ public void playAutoShuffleList() {
public void clearQueue() {
playlist.clear();
shuffleList.clear();
setShuffleMode(ShuffleMode.OFF);

stop(true);

playPos = -1;
nextPlayPos = -1;

if (!SettingsManager.getInstance().getRememberShuffle()) {
setShuffleMode(ShuffleMode.OFF);
}

notifyChange(InternalIntents.QUEUE_CHANGED);
}

Expand Down Expand Up @@ -2663,7 +2651,7 @@ public int getAudioSessionId() {
}

public Single<Boolean> isFavorite() {
return PlaylistUtils.isFavorite(currentSong);
return PlaylistUtils.isFavorite(currentSong).first(false);
}

public void toggleShuffleMode() {
Expand Down Expand Up @@ -2714,6 +2702,10 @@ public void openEqualizerSession(boolean internal, int audioSessionId) {
equalizer.openEqualizerSession(internal, audioSessionId);
}

public void updateEqualizer() {
equalizer.update();
}

private void showToast(int resId) {
Toast.makeText(getBaseContext(), resId, Toast.LENGTH_SHORT).show();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import android.media.audiofx.AudioEffect;
import android.media.audiofx.BassBoost;
import android.media.audiofx.Virtualizer;
import android.os.Binder;
import android.preference.PreferenceManager;
import android.util.Log;

Expand Down Expand Up @@ -199,14 +198,6 @@ public void release() {

protected static final String TAG = Equalizer.class.getSimpleName();

public class LocalBinder extends Binder {
public Equalizer getService() {
return Equalizer.this;
}
}

private final LocalBinder mBinder = new LocalBinder();

/**
* Known audio sessions and their associated audioeffect suites.
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package com.simplecity.amp_library.ui.adapters;

import android.support.annotation.Nullable;
import android.util.Log;

import com.crashlytics.android.Crashlytics;
import com.simplecityapps.recycler_adapter.adapter.CompletionListUpdateCallback;
import com.simplecityapps.recycler_adapter.adapter.ViewModelAdapter;
import com.simplecityapps.recycler_adapter.model.ViewModel;
Expand All @@ -24,14 +26,14 @@ public LoggingViewModelAdapter(String tag) {
@Override
public synchronized Disposable setItems(List<ViewModel> items, @Nullable CompletionListUpdateCallback callback) {

// Crashlytics.log(Log.DEBUG, TAG, String.format("setItems called for: '%s'", tag));
Crashlytics.log(Log.DEBUG, TAG, String.format("setItems called for: '%s'", tag));

return super.setItems(items, new CompletionListUpdateCallback() {

@Override
public void onComplete() {

// Crashlytics.log(Log.DEBUG, TAG, String.format("setItems complete for: '%s'. Dispatching updates.", tag));
Crashlytics.log(Log.DEBUG, TAG, String.format("setItems complete for: '%s'. Dispatching updates.", tag));

if (callback != null) {
callback.onComplete();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import com.afollestad.materialdialogs.MaterialDialog;
import com.simplecity.amp_library.model.Playlist;
import com.simplecity.amp_library.tagger.TaggerDialog;
import com.simplecity.amp_library.ui.dialog.UpgradeDialog;
import com.simplecity.amp_library.ui.presenters.Presenter;
import com.simplecity.amp_library.utils.MusicUtils;
import com.simplecity.amp_library.utils.PermissionUtils;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.simplecity.amp_library.ui.dialog;

import android.annotation.SuppressLint;
import android.content.ContentProviderOperation;
import android.content.Context;
import android.content.OperationApplicationException;
Expand Down Expand Up @@ -43,6 +44,7 @@ public static class DeleteDialogBuilder {
private int deleteMultipleMessageId;

private List<String> itemNames;

private Single<List<Song>> songsSingle;

public DeleteDialogBuilder context(Context context) {
Expand Down Expand Up @@ -70,6 +72,7 @@ public DeleteDialogBuilder songsToDelete(Single<List<Song>> songsObservable) {
return this;
}

@SuppressLint("CheckResult")
void deleteSongs() {
songsSingle
.map(lists -> Stream.of(lists)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import com.simplecity.amp_library.ShuttleApplication;
import com.simplecity.amp_library.dagger.module.FragmentModule;
import com.simplecity.amp_library.model.Album;
import com.simplecity.amp_library.playback.MusicService;
import com.simplecity.amp_library.ui.adapters.SectionedAdapter;
import com.simplecity.amp_library.ui.adapters.ViewType;
import com.simplecity.amp_library.ui.dialog.UpgradeDialog;
Expand Down Expand Up @@ -422,8 +423,8 @@ public void onAlbumOverflowClicked(View v, Album album) {

@Override
public void onShuffleItemClick() {
// Note: We don't call 'shuffleAll()', because for album-shuffle mode, we don't actually turn
// 'shuffle' on.
// Note: For album-shuffle mode, we don't actually turn shuffle on.
MusicUtils.setShuffleMode(MusicService.ShuffleMode.OFF);
MusicUtils.playAll(DataManager.getInstance()
.getSongsRelay()
.firstOrError()
Expand Down
Loading

0 comments on commit 804e4b6

Please sign in to comment.