diff --git a/.travis.yml b/.travis.yml
index 7a5ab488a..178f7e79e 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -57,13 +57,13 @@ deploy:
condition: $TRAVIS_TAG =~ beta || $TRAVIS_TAG =~ alpha || $TRAVIS_TAG =~ release
# Play Store beta release
-- provider: script
- script: ./gradlew publishApkFreeRelease publishApkPaidRelease
- skip_cleanup: true
- on:
- repo: timusus/Shuttle
- tags: true
- condition: $TRAVIS_TAG =~ beta
+#- provider: script
+# script: ./gradlew publishApkFreeRelease publishApkPaidRelease
+# skip_cleanup: true
+# on:
+# repo: timusus/Shuttle
+# tags: true
+# condition: $TRAVIS_TAG =~ beta
# Slack build notifications
notifications:
diff --git a/app/src/main/assets/web/info.html b/app/src/main/assets/web/info.html
index cf6b8c11b..a748bda46 100644
--- a/app/src/main/assets/web/info.html
+++ b/app/src/main/assets/web/info.html
@@ -8,6 +8,12 @@
+2.0.0-beta21
+
+ - Fixed a crash when adding to whitelist/blacklist
+ - Reinstated the 'upgrade to Shuttle+' dialog in various places in the free version
+ - Added some logging to track down some pesky crashes
+
2.0.0-beta20
- Fixed a crash when pressing ChromeCast button (finally!)
diff --git a/app/src/main/assets/web/info_dark.html b/app/src/main/assets/web/info_dark.html
index b9d34f9a7..98c25e761 100644
--- a/app/src/main/assets/web/info_dark.html
+++ b/app/src/main/assets/web/info_dark.html
@@ -8,6 +8,12 @@
+2.0.0-beta21
+
+ - Fixed a crash when adding to whitelist/blacklist
+ - Reinstated the 'upgrade to Shuttle+' dialog in various places in the free version
+ - Added some logging to track down some pesky crashes
+
2.0.0-beta20
- Fixed a crash when pressing ChromeCast button (finally!)
diff --git a/app/src/main/java/com/simplecity/amp_library/model/CategoryItem.java b/app/src/main/java/com/simplecity/amp_library/model/CategoryItem.java
index 1e841ff0d..61ed616cb 100644
--- a/app/src/main/java/com/simplecity/amp_library/model/CategoryItem.java
+++ b/app/src/main/java/com/simplecity/amp_library/model/CategoryItem.java
@@ -35,11 +35,11 @@ public class CategoryItem {
public int sortOrder;
- public boolean isEnabled;
+ public boolean isChecked;
private CategoryItem(@Type int type, SharedPreferences sharedPreferences) {
this.type = type;
- isEnabled = sharedPreferences.getBoolean(getEnabledKey(), isEnabledByDefault());
+ isChecked = sharedPreferences.getBoolean(getEnabledKey(), isEnabledByDefault());
sortOrder = sharedPreferences.getInt(getSortKey(), 0);
}
@@ -57,7 +57,7 @@ public static List getCategoryItems(SharedPreferences sharedPrefer
}
public void savePrefs(SharedPreferences.Editor editor) {
- editor.putBoolean(getEnabledKey(), isEnabled);
+ editor.putBoolean(getEnabledKey(), isChecked);
editor.putInt(getSortKey(), sortOrder);
editor.apply();
}
diff --git a/app/src/main/java/com/simplecity/amp_library/search/SearchFragment.java b/app/src/main/java/com/simplecity/amp_library/search/SearchFragment.java
index ae4511792..69fba0121 100644
--- a/app/src/main/java/com/simplecity/amp_library/search/SearchFragment.java
+++ b/app/src/main/java/com/simplecity/amp_library/search/SearchFragment.java
@@ -27,9 +27,11 @@
import com.simplecity.amp_library.model.Album;
import com.simplecity.amp_library.model.AlbumArtist;
import com.simplecity.amp_library.tagger.TaggerDialog;
+import com.simplecity.amp_library.ui.adapters.LoggingViewModelAdapter;
import com.simplecity.amp_library.ui.detail.AlbumDetailFragment;
import com.simplecity.amp_library.ui.detail.ArtistDetailFragment;
import com.simplecity.amp_library.ui.detail.BaseDetailFragment;
+import com.simplecity.amp_library.ui.dialog.UpgradeDialog;
import com.simplecity.amp_library.ui.fragments.BaseFragment;
import com.simplecity.amp_library.ui.modelviews.EmptyView;
import com.simplecity.amp_library.ui.modelviews.LoadingView;
@@ -105,7 +107,7 @@ public void onCreate(Bundle savedInstanceState) {
emptyView = new EmptyView(R.string.empty_search);
emptyView.setHeight(ResourceUtils.toPixels(96));
- adapter = new ViewModelAdapter();
+ adapter = new LoggingViewModelAdapter("SearchFragment");
}
@Nullable
@@ -254,6 +256,11 @@ public void goToAlbum(Album album, View transitionView) {
searchView.getHandler().postDelayed(() -> pushDetailFragment(AlbumDetailFragment.newInstance(album, transitionName), transitionView), 50);
}
+ @Override
+ public void showUpgradeDialog() {
+ UpgradeDialog.getUpgradeDialog(getActivity()).show();
+ }
+
void pushDetailFragment(BaseDetailFragment detailFragment, @Nullable View transitionView) {
List> transitions = new ArrayList<>();
diff --git a/app/src/main/java/com/simplecity/amp_library/search/SearchPresenter.java b/app/src/main/java/com/simplecity/amp_library/search/SearchPresenter.java
index 13150374c..53a96accb 100644
--- a/app/src/main/java/com/simplecity/amp_library/search/SearchPresenter.java
+++ b/app/src/main/java/com/simplecity/amp_library/search/SearchPresenter.java
@@ -28,6 +28,7 @@
import com.simplecity.amp_library.utils.MusicUtils;
import com.simplecity.amp_library.utils.Operators;
import com.simplecity.amp_library.utils.SettingsManager;
+import com.simplecity.amp_library.utils.ShuttleUtils;
import com.simplecity.amp_library.utils.StringUtils;
import com.simplecityapps.recycler_adapter.model.ViewModel;
@@ -184,12 +185,21 @@ public boolean onAlbumArtistLongClick(int position, AlbumArtistView albumArtistV
public void onAlbumArtistOverflowClicked(View v, AlbumArtist albumArtist) {
PopupMenu menu = new PopupMenu(v.getContext(), v);
menu.inflate(R.menu.menu_artist);
- menu.setOnMenuItemClickListener(MenuUtils.getAlbumArtistClickListener(v.getContext(), albumArtist, taggerDialog -> {
- SearchView searchView = getView();
- if (searchView != null) {
- searchView.showTaggerDialog(taggerDialog);
- }
- }));
+ menu.setOnMenuItemClickListener(MenuUtils.getAlbumArtistClickListener(
+ v.getContext(),
+ albumArtist,
+ taggerDialog -> {
+ SearchView searchView = getView();
+ if (searchView != null) {
+ searchView.showTaggerDialog(taggerDialog);
+ }
+ },
+ () -> {
+ SearchView searchView = getView();
+ if (searchView != null) {
+ searchView.showUpgradeDialog();
+ }
+ }));
menu.show();
}
@@ -210,12 +220,22 @@ public boolean onAlbumLongClick(int position, AlbumView albumView) {
public void onAlbumOverflowClicked(View v, Album album) {
PopupMenu menu = new PopupMenu(v.getContext(), v);
MenuUtils.setupAlbumMenu(menu);
- menu.setOnMenuItemClickListener(MenuUtils.getAlbumMenuClickListener(v.getContext(), album, taggerDialog -> {
- SearchView searchView = getView();
- if (searchView != null) {
- searchView.showTaggerDialog(taggerDialog);
- }
- }));
+ menu.setOnMenuItemClickListener(MenuUtils.getAlbumMenuClickListener(
+ v.getContext(),
+ album,
+ taggerDialog -> {
+ SearchView searchView = getView();
+ if (searchView != null) {
+ searchView.showTaggerDialog(taggerDialog);
+ }
+ },
+ () -> {
+ SearchView searchView = getView();
+ if (searchView != null) {
+ searchView.showUpgradeDialog();
+ }
+ }
+ ));
menu.show();
}
@@ -471,13 +491,20 @@ public boolean onSongLongClick(int position, SongView songView) {
public void onSongOverflowClick(int position, View v, Song song) {
PopupMenu menu = new PopupMenu(v.getContext(), v);
MenuUtils.setupSongMenu(menu, false);
- menu.setOnMenuItemClickListener(MenuUtils.getSongMenuClickListener(v.getContext(), song,
+ menu.setOnMenuItemClickListener(MenuUtils.getSongMenuClickListener(
+ v.getContext(),
+ song,
taggerDialog -> {
SearchView searchView = getView();
if (searchView != null) {
- searchView.showTaggerDialog(taggerDialog);
+ if (!ShuttleUtils.isUpgraded()) {
+ searchView.showUpgradeDialog();
+ } else {
+ searchView.showTaggerDialog(taggerDialog);
+ }
}
- }, null, null));
+ },
+ null, null));
menu.show();
}
diff --git a/app/src/main/java/com/simplecity/amp_library/search/SearchView.java b/app/src/main/java/com/simplecity/amp_library/search/SearchView.java
index 3832fd487..b3aa968bc 100644
--- a/app/src/main/java/com/simplecity/amp_library/search/SearchView.java
+++ b/app/src/main/java/com/simplecity/amp_library/search/SearchView.java
@@ -36,4 +36,6 @@ public interface SearchView {
void goToArtist(AlbumArtist albumArtist, View transitionView);
void goToAlbum(Album album, View transitionView);
+
+ void showUpgradeDialog();
}
\ No newline at end of file
diff --git a/app/src/main/java/com/simplecity/amp_library/ui/activities/BaseCastActivity.java b/app/src/main/java/com/simplecity/amp_library/ui/activities/BaseCastActivity.java
index fd4522a91..60732c16b 100644
--- a/app/src/main/java/com/simplecity/amp_library/ui/activities/BaseCastActivity.java
+++ b/app/src/main/java/com/simplecity/amp_library/ui/activities/BaseCastActivity.java
@@ -9,47 +9,39 @@
import com.google.android.libraries.cast.companionlibrary.cast.callbacks.VideoCastConsumer;
import com.google.android.libraries.cast.companionlibrary.cast.callbacks.VideoCastConsumerImpl;
import com.simplecity.amp_library.ShuttleApplication;
-import com.simplecity.amp_library.utils.ShuttleUtils;
public abstract class BaseCastActivity extends BaseActivity {
private static final String TAG = "BaseCastActivity";
- public VideoCastManager castManager;
- private VideoCastConsumer castConsumer;
+ @NonNull
+ public VideoCastManager castManager = VideoCastManager.getInstance();
+
+ @NonNull
+ private VideoCastConsumer castConsumer = new VideoCastConsumerImpl() {
+ @Override
+ public void onConnectionSuspended(int cause) {
+ Log.d(TAG, "onConnectionSuspended() was called with cause: " + cause);
+ //Todo: Show toast
+ }
+
+ @Override
+ public void onConnectivityRecovered() {
+ //Todo: Show toast
+ }
+ };
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
- if (ShuttleUtils.isUpgraded()) {
- castManager = VideoCastManager.getInstance();
- }
-
- castConsumer = new VideoCastConsumerImpl() {
- @Override
- public void onConnectionSuspended(int cause) {
- Log.d(TAG, "onConnectionSuspended() was called with cause: " + cause);
- //Todo: Show toast
- }
-
- @Override
- public void onConnectivityRecovered() {
- //Todo: Show toast
- }
- };
-
- if (castManager != null) {
- castManager.reconnectSessionIfPossible();
- }
+ castManager.reconnectSessionIfPossible();
}
@Override
protected void onPause() {
- if (castManager != null) {
- castManager.removeVideoCastConsumer(castConsumer);
- }
+ castManager.removeVideoCastConsumer(castConsumer);
super.onPause();
}
@@ -58,19 +50,14 @@ protected void onPause() {
public void onResume() {
super.onResume();
- if (ShuttleUtils.isUpgraded()) {
- castManager = VideoCastManager.getInstance();
- castManager.addVideoCastConsumer(castConsumer);
- }
+ castManager = VideoCastManager.getInstance();
+ castManager.addVideoCastConsumer(castConsumer);
}
@Override
public boolean dispatchKeyEvent(@NonNull KeyEvent event) {
- if (castManager != null) {
- return castManager.onDispatchVolumeKeyEvent(event, ShuttleApplication.VOLUME_INCREMENT)
- || super.dispatchKeyEvent(event);
- }
- return super.dispatchKeyEvent(event);
+ return castManager.onDispatchVolumeKeyEvent(event, ShuttleApplication.VOLUME_INCREMENT)
+ || super.dispatchKeyEvent(event);
}
}
diff --git a/app/src/main/java/com/simplecity/amp_library/ui/adapters/LoggingViewModelAdapter.java b/app/src/main/java/com/simplecity/amp_library/ui/adapters/LoggingViewModelAdapter.java
new file mode 100644
index 000000000..8aa7446f8
--- /dev/null
+++ b/app/src/main/java/com/simplecity/amp_library/ui/adapters/LoggingViewModelAdapter.java
@@ -0,0 +1,72 @@
+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;
+
+import java.util.List;
+
+import io.reactivex.disposables.Disposable;
+
+public class LoggingViewModelAdapter extends ViewModelAdapter {
+
+ private static final String TAG = "LoggingVMAdapter";
+
+ private String tag;
+
+ public LoggingViewModelAdapter(String tag) {
+ this.tag = tag;
+ }
+
+ @Nullable
+ @Override
+ public synchronized Disposable setItems(List items, @Nullable CompletionListUpdateCallback callback) {
+
+ 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));
+
+ if (callback != null) {
+ callback.onComplete();
+ }
+ }
+
+ @Override
+ public void onInserted(int position, int count) {
+ if (callback != null) {
+ callback.onInserted(position, count);
+ }
+ }
+
+ @Override
+ public void onRemoved(int position, int count) {
+ if (callback != null) {
+ callback.onRemoved(position, count);
+ }
+ }
+
+ @Override
+ public void onMoved(int fromPosition, int toPosition) {
+ if (callback != null) {
+ callback.onMoved(fromPosition, toPosition);
+ }
+ }
+
+ @Override
+ public void onChanged(int position, int count, Object payload) {
+ if (callback != null) {
+ callback.onChanged(position, count, payload);
+ }
+ }
+ });
+ }
+}
diff --git a/app/src/main/java/com/simplecity/amp_library/ui/adapters/SectionedAdapter.java b/app/src/main/java/com/simplecity/amp_library/ui/adapters/SectionedAdapter.java
index 5743f96b6..8c80e3c72 100644
--- a/app/src/main/java/com/simplecity/amp_library/ui/adapters/SectionedAdapter.java
+++ b/app/src/main/java/com/simplecity/amp_library/ui/adapters/SectionedAdapter.java
@@ -3,12 +3,15 @@
import android.support.annotation.NonNull;
import com.simplecity.amp_library.ui.modelviews.SectionedView;
-import com.simplecityapps.recycler_adapter.adapter.ViewModelAdapter;
import com.simplecityapps.recycler_adapter.model.ViewModel;
import com.simplecityapps.recyclerview_fastscroll.views.FastScrollRecyclerView;
-public class SectionedAdapter extends ViewModelAdapter implements FastScrollRecyclerView.SectionedAdapter {
+public class SectionedAdapter extends LoggingViewModelAdapter implements FastScrollRecyclerView.SectionedAdapter {
+
+ public SectionedAdapter(String tag) {
+ super(tag);
+ }
@NonNull
@Override
diff --git a/app/src/main/java/com/simplecity/amp_library/ui/detail/AlbumDetailFragment.java b/app/src/main/java/com/simplecity/amp_library/ui/detail/AlbumDetailFragment.java
index edf9e8003..213937347 100644
--- a/app/src/main/java/com/simplecity/amp_library/ui/detail/AlbumDetailFragment.java
+++ b/app/src/main/java/com/simplecity/amp_library/ui/detail/AlbumDetailFragment.java
@@ -165,4 +165,9 @@ protected void setupToolbarMenu(Toolbar toolbar) {
protected String screenName() {
return "AlbumDetailFragment";
}
+
+ @Override
+ public void showUpgradeDialog(MaterialDialog upgradeDialog) {
+ upgradeDialog.show();
+ }
}
\ No newline at end of file
diff --git a/app/src/main/java/com/simplecity/amp_library/ui/detail/ArtistDetailFragment.java b/app/src/main/java/com/simplecity/amp_library/ui/detail/ArtistDetailFragment.java
index d292904f4..2b6642f09 100644
--- a/app/src/main/java/com/simplecity/amp_library/ui/detail/ArtistDetailFragment.java
+++ b/app/src/main/java/com/simplecity/amp_library/ui/detail/ArtistDetailFragment.java
@@ -165,4 +165,8 @@ protected String screenName() {
return "ArtistDetailFragment";
}
+ @Override
+ public void showUpgradeDialog(MaterialDialog upgradeDialog) {
+ upgradeDialog.show();
+ }
}
\ No newline at end of file
diff --git a/app/src/main/java/com/simplecity/amp_library/ui/detail/BaseDetailFragment.java b/app/src/main/java/com/simplecity/amp_library/ui/detail/BaseDetailFragment.java
index 1018a625b..b7ebc4df1 100644
--- a/app/src/main/java/com/simplecity/amp_library/ui/detail/BaseDetailFragment.java
+++ b/app/src/main/java/com/simplecity/amp_library/ui/detail/BaseDetailFragment.java
@@ -41,6 +41,8 @@
import com.simplecity.amp_library.model.ArtworkProvider;
import com.simplecity.amp_library.model.Song;
import com.simplecity.amp_library.tagger.TaggerDialog;
+import com.simplecity.amp_library.ui.adapters.LoggingViewModelAdapter;
+import com.simplecity.amp_library.ui.dialog.UpgradeDialog;
import com.simplecity.amp_library.ui.drawer.DrawerLockManager;
import com.simplecity.amp_library.ui.fragments.BaseFragment;
import com.simplecity.amp_library.ui.fragments.TransitionListenerAdapter;
@@ -130,7 +132,8 @@ public abstract class BaseDetailFragment extends BaseFragment implements
private HorizontalRecyclerView horizontalRecyclerView;
- @Nullable Album currentSlideShowAlbum;
+ @Nullable
+ Album currentSlideShowAlbum;
private boolean isFirstLoad = true;
@@ -141,9 +144,9 @@ public BaseDetailFragment() {
public void onCreate(final Bundle icicle) {
super.onCreate(icicle);
- adapter = new ViewModelAdapter();
+ adapter = new LoggingViewModelAdapter("BaseDetailFragment");
- horizontalRecyclerView = new HorizontalRecyclerView();
+ horizontalRecyclerView = new HorizontalRecyclerView("BaseDetail - horizontal");
detailPresenter = new DetailPresenter(this, this);
@@ -567,7 +570,7 @@ public boolean onMenuItemClick(MenuItem item) {
detailPresenter.playlistSelected(getContext(), item);
return true;
case R.id.editTags:
- detailPresenter.editTags(getTaggerDialog());
+ detailPresenter.editTags(getTaggerDialog(), UpgradeDialog.getUpgradeDialog(getActivity()));
return true;
case R.id.info:
detailPresenter.infoClicked(getInfoDialog());
@@ -771,8 +774,16 @@ public boolean onSongLongClick(int position, SongView songView) {
public void onSongOverflowClick(int position, View v, Song song) {
PopupMenu popupMenu = new PopupMenu(getContext(), v);
MenuUtils.setupSongMenu(popupMenu, showSongOverflowRemoveButton());
- popupMenu.setOnMenuItemClickListener(MenuUtils.getSongMenuClickListener(getContext(), song,
- taggerDialog -> taggerDialog.show(getFragmentManager()),
+ popupMenu.setOnMenuItemClickListener(MenuUtils.getSongMenuClickListener(
+ getContext(),
+ song,
+ taggerDialog -> {
+ if (!ShuttleUtils.isUpgraded()) {
+ UpgradeDialog.getUpgradeDialog(getActivity()).show();
+ } else {
+ taggerDialog.show(getFragmentManager());
+ }
+ },
() -> songRemoved(position, song), null));
popupMenu.show();
}
@@ -791,8 +802,11 @@ public boolean onAlbumLongClick(int position, AlbumView albumView) {
public void onAlbumOverflowClicked(View v, Album album) {
PopupMenu popupMenu = new PopupMenu(getContext(), v);
MenuUtils.setupAlbumMenu(popupMenu);
- popupMenu.setOnMenuItemClickListener(MenuUtils.getAlbumMenuClickListener(getContext(), album, taggerDialog
- -> taggerDialog.show(getFragmentManager())));
+ popupMenu.setOnMenuItemClickListener(
+ MenuUtils.getAlbumMenuClickListener(getContext(),
+ album,
+ taggerDialog -> taggerDialog.show(getFragmentManager()),
+ () -> UpgradeDialog.getUpgradeDialog(getActivity()).show()));
popupMenu.show();
}
diff --git a/app/src/main/java/com/simplecity/amp_library/ui/detail/DetailPresenter.java b/app/src/main/java/com/simplecity/amp_library/ui/detail/DetailPresenter.java
index 65faa4eb2..4eba5b8b1 100644
--- a/app/src/main/java/com/simplecity/amp_library/ui/detail/DetailPresenter.java
+++ b/app/src/main/java/com/simplecity/amp_library/ui/detail/DetailPresenter.java
@@ -7,10 +7,12 @@
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;
import com.simplecity.amp_library.utils.PlaylistUtils;
+import com.simplecity.amp_library.utils.ShuttleUtils;
import com.simplecityapps.recycler_adapter.model.ViewModel;
import java.util.ArrayList;
@@ -81,10 +83,14 @@ void addToQueue() {
}));
}
- void editTags(TaggerDialog taggerDialog) {
+ void editTags(TaggerDialog taggerDialog, MaterialDialog upgradeDialog) {
DetailView detailView = getView();
if (detailView != null) {
- detailView.showTaggerDialog(taggerDialog);
+ if (!ShuttleUtils.isUpgraded()) {
+ detailView.showUpgradeDialog(upgradeDialog);
+ } else {
+ detailView.showTaggerDialog(taggerDialog);
+ }
}
}
diff --git a/app/src/main/java/com/simplecity/amp_library/ui/detail/DetailView.java b/app/src/main/java/com/simplecity/amp_library/ui/detail/DetailView.java
index db153ea28..2ef1f7bb3 100644
--- a/app/src/main/java/com/simplecity/amp_library/ui/detail/DetailView.java
+++ b/app/src/main/java/com/simplecity/amp_library/ui/detail/DetailView.java
@@ -19,4 +19,6 @@ interface DetailView {
void showArtworkDialog(MaterialDialog artworkDialog);
void showInfoDialog(MaterialDialog infoDialog);
+
+ void showUpgradeDialog(MaterialDialog upgradeDialog);
}
diff --git a/app/src/main/java/com/simplecity/amp_library/ui/detail/GenreDetailFragment.java b/app/src/main/java/com/simplecity/amp_library/ui/detail/GenreDetailFragment.java
index 6fb45a94a..530e7f22c 100644
--- a/app/src/main/java/com/simplecity/amp_library/ui/detail/GenreDetailFragment.java
+++ b/app/src/main/java/com/simplecity/amp_library/ui/detail/GenreDetailFragment.java
@@ -5,6 +5,7 @@
import android.os.Bundle;
import android.support.annotation.NonNull;
+import com.afollestad.materialdialogs.MaterialDialog;
import com.simplecity.amp_library.model.Album;
import com.simplecity.amp_library.model.Genre;
import com.simplecity.amp_library.model.Song;
@@ -116,4 +117,9 @@ Drawable getPlaceHolderDrawable() {
protected String screenName() {
return "GenreDetailFragment";
}
+
+ @Override
+ public void showUpgradeDialog(MaterialDialog upgradeDialog) {
+ upgradeDialog.show();
+ }
}
diff --git a/app/src/main/java/com/simplecity/amp_library/ui/detail/PlaylistDetailFragment.java b/app/src/main/java/com/simplecity/amp_library/ui/detail/PlaylistDetailFragment.java
index 253319670..e3acf2fca 100644
--- a/app/src/main/java/com/simplecity/amp_library/ui/detail/PlaylistDetailFragment.java
+++ b/app/src/main/java/com/simplecity/amp_library/ui/detail/PlaylistDetailFragment.java
@@ -12,13 +12,13 @@
import android.view.View;
import android.view.ViewGroup;
+import com.afollestad.materialdialogs.MaterialDialog;
import com.annimon.stream.IntStream;
import com.annimon.stream.Stream;
import com.simplecity.amp_library.R;
import com.simplecity.amp_library.model.Album;
import com.simplecity.amp_library.model.Playlist;
import com.simplecity.amp_library.model.Song;
-import com.simplecity.amp_library.rx.UnsafeAction;
import com.simplecity.amp_library.ui.modelviews.SongView;
import com.simplecity.amp_library.ui.recyclerview.ItemTouchHelperCallback;
import com.simplecity.amp_library.utils.ComparisonUtils;
@@ -241,4 +241,9 @@ public void onStartDrag(SongView.ViewHolder holder) {
protected String screenName() {
return "PlaylistDetailFragment";
}
+
+ @Override
+ public void showUpgradeDialog(MaterialDialog upgradeDialog) {
+ upgradeDialog.show();
+ }
}
\ No newline at end of file
diff --git a/app/src/main/java/com/simplecity/amp_library/ui/dialog/InclExclDialog.java b/app/src/main/java/com/simplecity/amp_library/ui/dialog/InclExclDialog.java
index 347979c1b..7315143b3 100644
--- a/app/src/main/java/com/simplecity/amp_library/ui/dialog/InclExclDialog.java
+++ b/app/src/main/java/com/simplecity/amp_library/ui/dialog/InclExclDialog.java
@@ -13,6 +13,7 @@
import com.simplecity.amp_library.R;
import com.simplecity.amp_library.model.InclExclItem;
import com.simplecity.amp_library.sql.databases.InclExclHelper;
+import com.simplecity.amp_library.ui.adapters.LoggingViewModelAdapter;
import com.simplecity.amp_library.ui.modelviews.EmptyView;
import com.simplecity.amp_library.ui.modelviews.InclExclView;
import com.simplecity.amp_library.utils.DataManager;
@@ -53,7 +54,7 @@ public static MaterialDialog getDialog(Context context, @InclExclItem.Type int t
RecyclerView recyclerView = view.findViewById(R.id.recyclerView);
recyclerView.setLayoutManager(new LinearLayoutManager(context));
- final ViewModelAdapter inclExclAdapter = new ViewModelAdapter();
+ final ViewModelAdapter inclExclAdapter = new LoggingViewModelAdapter("InclExclDialog");
recyclerView.setAdapter(inclExclAdapter);
diff --git a/app/src/main/java/com/simplecity/amp_library/ui/dialog/TabChooserDialog.java b/app/src/main/java/com/simplecity/amp_library/ui/dialog/TabChooserDialog.java
index 1d8acca45..980034282 100644
--- a/app/src/main/java/com/simplecity/amp_library/ui/dialog/TabChooserDialog.java
+++ b/app/src/main/java/com/simplecity/amp_library/ui/dialog/TabChooserDialog.java
@@ -1,6 +1,6 @@
package com.simplecity.amp_library.ui.dialog;
-import android.content.Context;
+import android.app.Activity;
import android.content.Intent;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;
@@ -14,9 +14,11 @@
import com.annimon.stream.Stream;
import com.simplecity.amp_library.R;
import com.simplecity.amp_library.model.CategoryItem;
+import com.simplecity.amp_library.ui.adapters.LoggingViewModelAdapter;
import com.simplecity.amp_library.ui.fragments.LibraryController;
import com.simplecity.amp_library.ui.modelviews.TabViewModel;
import com.simplecity.amp_library.ui.recyclerview.ItemTouchHelperCallback;
+import com.simplecity.amp_library.utils.ShuttleUtils;
import com.simplecityapps.recycler_adapter.adapter.ViewModelAdapter;
import com.simplecityapps.recycler_adapter.model.ViewModel;
@@ -28,11 +30,11 @@ private TabChooserDialog() {
//no instance
}
- public static MaterialDialog getDialog(Context context) {
+ public static MaterialDialog getDialog(Activity activity) {
- SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context);
+ SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(activity);
- ViewModelAdapter adapter = new ViewModelAdapter();
+ ViewModelAdapter adapter = new LoggingViewModelAdapter("TabChooserDialog");
ItemTouchHelper itemTouchHelper = new ItemTouchHelper(
new ItemTouchHelperCallback(
@@ -43,7 +45,21 @@ public static MaterialDialog getDialog(Context context) {
}
));
- TabViewModel.Listener listener = itemTouchHelper::startDrag;
+ TabViewModel.Listener listener = new TabViewModel.Listener() {
+ @Override
+ public void onStartDrag(TabViewModel.ViewHolder holder) {
+ itemTouchHelper.startDrag(holder);
+ }
+
+ @Override
+ public void onFolderChecked(TabViewModel tabViewModel, TabViewModel.ViewHolder viewHolder) {
+ if (!ShuttleUtils.isUpgraded()) {
+ viewHolder.checkBox.setChecked(false);
+ tabViewModel.categoryItem.isChecked = false;
+ UpgradeDialog.getUpgradeDialog(activity).show();
+ }
+ }
+ };
List items = Stream.of(CategoryItem.getCategoryItems(sharedPreferences))
.map(categoryItem -> {
@@ -54,13 +70,13 @@ public static MaterialDialog getDialog(Context context) {
.collect(Collectors.toList());
adapter.setItems(items);
- RecyclerView recyclerView = new RecyclerView(context);
- recyclerView.setLayoutManager(new LinearLayoutManager(context));
+ RecyclerView recyclerView = new RecyclerView(activity);
+ recyclerView.setLayoutManager(new LinearLayoutManager(activity));
recyclerView.setAdapter(adapter);
itemTouchHelper.attachToRecyclerView(recyclerView);
- return new MaterialDialog.Builder(context)
+ return new MaterialDialog.Builder(activity)
.title(R.string.pref_title_choose_tabs)
.customView(recyclerView, false)
.positiveText(R.string.button_done)
@@ -72,7 +88,7 @@ public static MaterialDialog getDialog(Context context) {
((TabViewModel) viewModelIntPair.getSecond()).categoryItem.sortOrder = viewModelIntPair.getFirst();
((TabViewModel) viewModelIntPair.getSecond()).categoryItem.savePrefs(editor);
});
- LocalBroadcastManager.getInstance(context).sendBroadcast(new Intent(LibraryController.EVENT_TABS_CHANGED));
+ LocalBroadcastManager.getInstance(activity).sendBroadcast(new Intent(LibraryController.EVENT_TABS_CHANGED));
})
.negativeText(R.string.close)
.build();
diff --git a/app/src/main/java/com/simplecity/amp_library/ui/dialog/UpgradeDialog.java b/app/src/main/java/com/simplecity/amp_library/ui/dialog/UpgradeDialog.java
index e51a5d865..6d9304541 100644
--- a/app/src/main/java/com/simplecity/amp_library/ui/dialog/UpgradeDialog.java
+++ b/app/src/main/java/com/simplecity/amp_library/ui/dialog/UpgradeDialog.java
@@ -3,6 +3,7 @@
import android.app.Activity;
import android.content.ComponentName;
import android.content.Intent;
+import android.support.annotation.NonNull;
import android.widget.Toast;
import com.afollestad.materialdialogs.MaterialDialog;
@@ -17,7 +18,7 @@ private UpgradeDialog() {
//no instance
}
- public static MaterialDialog getUpgradeDialog(Activity activity) {
+ public static MaterialDialog getUpgradeDialog(@NonNull Activity activity) {
return new MaterialDialog.Builder(activity)
.title(activity.getResources().getString(R.string.get_pro_title))
.content(activity.getResources().getString(R.string.upgrade_dialog_message))
@@ -33,7 +34,7 @@ public static MaterialDialog getUpgradeDialog(Activity activity) {
.build();
}
- private static void purchaseUpgrade(Activity activity) {
+ private static void purchaseUpgrade(@NonNull Activity activity) {
IabManager.getInstance().purchaseUpgrade(activity, success -> {
if (success) {
getUpgradeSuccessDialog(activity).show();
@@ -43,7 +44,7 @@ private static void purchaseUpgrade(Activity activity) {
});
}
- private static MaterialDialog getUpgradeSuccessDialog(Activity activity) {
+ private static MaterialDialog getUpgradeSuccessDialog(@NonNull Activity activity) {
return new MaterialDialog.Builder(activity)
.title(activity.getResources().getString(R.string.upgraded_title))
.content(activity.getResources().getString(R.string.upgraded_message))
diff --git a/app/src/main/java/com/simplecity/amp_library/ui/drawer/DrawerFragment.java b/app/src/main/java/com/simplecity/amp_library/ui/drawer/DrawerFragment.java
index b6c0eea8f..0622418a2 100644
--- a/app/src/main/java/com/simplecity/amp_library/ui/drawer/DrawerFragment.java
+++ b/app/src/main/java/com/simplecity/amp_library/ui/drawer/DrawerFragment.java
@@ -318,6 +318,11 @@ public void trackInfoChanged(@Nullable Song song) {
artistNameView.setVisibility(View.VISIBLE);
}
}
+
+ @Override
+ public void showUpgradeDialog(MaterialDialog dialog) {
+ dialog.show();
+ }
};
@Nullable
diff --git a/app/src/main/java/com/simplecity/amp_library/ui/fragments/AlbumArtistFragment.java b/app/src/main/java/com/simplecity/amp_library/ui/fragments/AlbumArtistFragment.java
index a84a43f16..5cd355be0 100644
--- a/app/src/main/java/com/simplecity/amp_library/ui/fragments/AlbumArtistFragment.java
+++ b/app/src/main/java/com/simplecity/amp_library/ui/fragments/AlbumArtistFragment.java
@@ -22,6 +22,7 @@
import com.simplecity.amp_library.model.AlbumArtist;
import com.simplecity.amp_library.ui.adapters.SectionedAdapter;
import com.simplecity.amp_library.ui.adapters.ViewType;
+import com.simplecity.amp_library.ui.dialog.UpgradeDialog;
import com.simplecity.amp_library.ui.modelviews.AlbumArtistView;
import com.simplecity.amp_library.ui.modelviews.EmptyView;
import com.simplecity.amp_library.ui.modelviews.SelectableViewModel;
@@ -115,7 +116,7 @@ public void onCreate(Bundle savedInstanceState) {
setHasOptionsMenu(true);
- adapter = new SectionedAdapter();
+ adapter = new SectionedAdapter("AlbumArtistFragment");
}
@Nullable
@@ -400,7 +401,11 @@ public void onAlbumArtistOverflowClicked(View v, AlbumArtist albumArtist) {
menu.inflate(R.menu.menu_artist);
SubMenu sub = menu.getMenu().findItem(R.id.addToPlaylist).getSubMenu();
PlaylistUtils.createPlaylistMenu(sub);
- menu.setOnMenuItemClickListener(MenuUtils.getAlbumArtistClickListener(getContext(), albumArtist, taggerDialog -> taggerDialog.show(getFragmentManager())));
+ menu.setOnMenuItemClickListener(MenuUtils.getAlbumArtistClickListener(
+ getContext(),
+ albumArtist,
+ taggerDialog -> taggerDialog.show(getFragmentManager()),
+ () -> UpgradeDialog.getUpgradeDialog(getActivity()).show()));
menu.show();
}
diff --git a/app/src/main/java/com/simplecity/amp_library/ui/fragments/AlbumFragment.java b/app/src/main/java/com/simplecity/amp_library/ui/fragments/AlbumFragment.java
index 0a7cefb10..d17c74ace 100644
--- a/app/src/main/java/com/simplecity/amp_library/ui/fragments/AlbumFragment.java
+++ b/app/src/main/java/com/simplecity/amp_library/ui/fragments/AlbumFragment.java
@@ -24,6 +24,7 @@
import com.simplecity.amp_library.model.Album;
import com.simplecity.amp_library.ui.adapters.SectionedAdapter;
import com.simplecity.amp_library.ui.adapters.ViewType;
+import com.simplecity.amp_library.ui.dialog.UpgradeDialog;
import com.simplecity.amp_library.ui.modelviews.AlbumView;
import com.simplecity.amp_library.ui.modelviews.EmptyView;
import com.simplecity.amp_library.ui.modelviews.SelectableViewModel;
@@ -127,7 +128,7 @@ public void onCreate(Bundle savedInstanceState) {
setHasOptionsMenu(true);
- adapter = new SectionedAdapter();
+ adapter = new SectionedAdapter("AlbumFragment");
}
@SuppressLint("NewApi")
@@ -411,7 +412,11 @@ public void onAlbumOverflowClicked(View v, Album album) {
menu.inflate(R.menu.menu_album);
SubMenu sub = menu.getMenu().findItem(R.id.addToPlaylist).getSubMenu();
PlaylistUtils.createPlaylistMenu(sub);
- menu.setOnMenuItemClickListener(MenuUtils.getAlbumMenuClickListener(getContext(), album, taggerDialog -> taggerDialog.show(getFragmentManager())));
+ menu.setOnMenuItemClickListener(MenuUtils.getAlbumMenuClickListener(
+ getContext(),
+ album,
+ taggerDialog -> taggerDialog.show(getFragmentManager()),
+ () -> UpgradeDialog.getUpgradeDialog(getActivity()).show()));
menu.show();
}
diff --git a/app/src/main/java/com/simplecity/amp_library/ui/fragments/BaseFragment.java b/app/src/main/java/com/simplecity/amp_library/ui/fragments/BaseFragment.java
index 04077d6ce..a7bcd2b86 100644
--- a/app/src/main/java/com/simplecity/amp_library/ui/fragments/BaseFragment.java
+++ b/app/src/main/java/com/simplecity/amp_library/ui/fragments/BaseFragment.java
@@ -4,7 +4,9 @@
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
+import android.support.v4.view.MenuItemCompat;
import android.view.Menu;
+import android.view.MenuItem;
import android.view.animation.AlphaAnimation;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
@@ -14,6 +16,7 @@
import com.simplecity.amp_library.ShuttleApplication;
import com.simplecity.amp_library.dagger.module.FragmentModule;
import com.simplecity.amp_library.ui.activities.BaseCastActivity;
+import com.simplecity.amp_library.ui.views.CustomMediaRouteActionProvider;
import com.simplecity.amp_library.ui.views.multisheet.MultiSheetEventRelay;
import com.simplecity.amp_library.utils.AnalyticsManager;
import com.squareup.leakcanary.RefWatcher;
@@ -111,9 +114,10 @@ public void onDestroy() {
protected void setupCastMenu(Menu menu) {
if (getActivity() instanceof BaseCastActivity) {
BaseCastManager castManager = ((BaseCastActivity) getActivity()).castManager;
- if (castManager != null) {
- castManager.addMediaRouterButton(menu, R.id.media_route_menu_item);
- }
+ castManager.addMediaRouterButton(menu, R.id.media_route_menu_item);
+
+ MenuItem mediaRouteMenuItem = menu.findItem(R.id.media_route_menu_item);
+ ((CustomMediaRouteActionProvider) MenuItemCompat.getActionProvider(mediaRouteMenuItem)).setActivity(getActivity());
}
}
diff --git a/app/src/main/java/com/simplecity/amp_library/ui/fragments/FolderFragment.java b/app/src/main/java/com/simplecity/amp_library/ui/fragments/FolderFragment.java
index 5968e31c0..e472004b3 100644
--- a/app/src/main/java/com/simplecity/amp_library/ui/fragments/FolderFragment.java
+++ b/app/src/main/java/com/simplecity/amp_library/ui/fragments/FolderFragment.java
@@ -28,6 +28,8 @@
import com.simplecity.amp_library.model.BaseFileObject;
import com.simplecity.amp_library.model.InclExclItem;
import com.simplecity.amp_library.model.Song;
+import com.simplecity.amp_library.ui.adapters.LoggingViewModelAdapter;
+import com.simplecity.amp_library.ui.dialog.UpgradeDialog;
import com.simplecity.amp_library.ui.drawer.DrawerLockManager;
import com.simplecity.amp_library.ui.modelviews.BreadcrumbsView;
import com.simplecity.amp_library.ui.modelviews.FolderView;
@@ -42,6 +44,7 @@
import com.simplecity.amp_library.utils.MenuUtils;
import com.simplecity.amp_library.utils.MusicUtils;
import com.simplecity.amp_library.utils.SettingsManager;
+import com.simplecity.amp_library.utils.ShuttleUtils;
import com.simplecity.amp_library.utils.SortManager;
import com.simplecityapps.recycler_adapter.adapter.ViewModelAdapter;
import com.simplecityapps.recycler_adapter.model.ViewModel;
@@ -142,7 +145,7 @@ public void onCreate(final Bundle savedInstanceState) {
disposables = new CompositeDisposable();
- adapter = new ViewModelAdapter();
+ adapter = new LoggingViewModelAdapter("FolderFragment");
fileBrowser = new FileBrowser();
@@ -433,7 +436,13 @@ public void onFileObjectOverflowClick(View v, FolderView folderView) {
MenuUtils.setupFolderMenu(menu, folderView.baseFileObject);
menu.setOnMenuItemClickListener(MenuUtils.getFolderMenuClickListener(
getContext(),
- folderView.baseFileObject, taggerDialog -> taggerDialog.show(getFragmentManager()),
+ folderView.baseFileObject, taggerDialog -> {
+ if (!ShuttleUtils.isUpgraded()) {
+ UpgradeDialog.getUpgradeDialog(getActivity()).show();
+ } else {
+ taggerDialog.show(getFragmentManager());
+ }
+ },
() -> IntStream.range(0, adapter.getItemCount())
.filter(i -> adapter.items.get(i) == folderView)
.findFirst()
diff --git a/app/src/main/java/com/simplecity/amp_library/ui/fragments/GenreFragment.java b/app/src/main/java/com/simplecity/amp_library/ui/fragments/GenreFragment.java
index 5623c1649..4959eca4c 100644
--- a/app/src/main/java/com/simplecity/amp_library/ui/fragments/GenreFragment.java
+++ b/app/src/main/java/com/simplecity/amp_library/ui/fragments/GenreFragment.java
@@ -15,7 +15,6 @@
import com.simplecity.amp_library.ui.adapters.SectionedAdapter;
import com.simplecity.amp_library.ui.modelviews.EmptyView;
import com.simplecity.amp_library.ui.modelviews.GenreView;
-import com.simplecity.amp_library.ui.recyclerview.GridDividerDecoration;
import com.simplecity.amp_library.utils.ComparisonUtils;
import com.simplecity.amp_library.utils.DataManager;
import com.simplecity.amp_library.utils.LogUtils;
@@ -76,7 +75,7 @@ public void onAttach(Context context) {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
- adapter = new SectionedAdapter();
+ adapter = new SectionedAdapter("GenreFragment");
}
@Override
diff --git a/app/src/main/java/com/simplecity/amp_library/ui/fragments/LibraryController.java b/app/src/main/java/com/simplecity/amp_library/ui/fragments/LibraryController.java
index 8ea3ab134..6016f12c9 100644
--- a/app/src/main/java/com/simplecity/amp_library/ui/fragments/LibraryController.java
+++ b/app/src/main/java/com/simplecity/amp_library/ui/fragments/LibraryController.java
@@ -214,7 +214,7 @@ private void setupViewPager() {
if (pagerAdapter == null) {
pagerAdapter = new PagerAdapter(getChildFragmentManager());
List categoryItems = Stream.of(CategoryItem.getCategoryItems(sharedPreferences))
- .filter(categoryItem -> categoryItem.isEnabled)
+ .filter(categoryItem -> categoryItem.isChecked)
.toList();
int defaultPageType = SettingsManager.getInstance().getDefaultPageType();
diff --git a/app/src/main/java/com/simplecity/amp_library/ui/fragments/MiniPlayerFragment.java b/app/src/main/java/com/simplecity/amp_library/ui/fragments/MiniPlayerFragment.java
index 4ccb411f0..05183e432 100644
--- a/app/src/main/java/com/simplecity/amp_library/ui/fragments/MiniPlayerFragment.java
+++ b/app/src/main/java/com/simplecity/amp_library/ui/fragments/MiniPlayerFragment.java
@@ -16,6 +16,7 @@
import com.afollestad.aesthetic.Aesthetic;
import com.afollestad.aesthetic.Util;
import com.afollestad.aesthetic.ViewBackgroundAction;
+import com.afollestad.materialdialogs.MaterialDialog;
import com.bumptech.glide.Glide;
import com.bumptech.glide.Priority;
import com.bumptech.glide.load.engine.DiskCacheStrategy;
@@ -254,5 +255,10 @@ public void trackInfoChanged(@Nullable Song song) {
rootView.setContentDescription(getString(R.string.btn_now_playing, song.name, song.artistName));
}
+
+ @Override
+ public void showUpgradeDialog(MaterialDialog dialog) {
+ dialog.show();
+ }
};
}
\ No newline at end of file
diff --git a/app/src/main/java/com/simplecity/amp_library/ui/fragments/PlayerFragment.java b/app/src/main/java/com/simplecity/amp_library/ui/fragments/PlayerFragment.java
index 0b7c1f54a..55d3998de 100644
--- a/app/src/main/java/com/simplecity/amp_library/ui/fragments/PlayerFragment.java
+++ b/app/src/main/java/com/simplecity/amp_library/ui/fragments/PlayerFragment.java
@@ -86,47 +86,60 @@ public class PlayerFragment extends BaseFragment implements
@BindView(R.id.toolbar)
Toolbar toolbar;
- @Nullable @BindView(R.id.play)
+ @Nullable
+ @BindView(R.id.play)
PlayPauseView playPauseView;
- @Nullable @BindView(R.id.shuffle)
+ @Nullable
+ @BindView(R.id.shuffle)
ShuffleButton shuffleButton;
- @Nullable @BindView(R.id.repeat)
+ @Nullable
+ @BindView(R.id.repeat)
RepeatButton repeatButton;
- @Nullable @BindView(R.id.next)
+ @Nullable
+ @BindView(R.id.next)
RepeatingImageButton nextButton;
- @Nullable @BindView(R.id.prev)
+ @Nullable
+ @BindView(R.id.prev)
RepeatingImageButton prevButton;
- @Nullable @BindView(R.id.current_time)
+ @Nullable
+ @BindView(R.id.current_time)
TextView currentTime;
- @Nullable @BindView(R.id.total_time)
+ @Nullable
+ @BindView(R.id.total_time)
TextView totalTime;
- @Nullable @BindView(R.id.text1)
+ @Nullable
+ @BindView(R.id.text1)
TextView track;
- @Nullable @BindView(R.id.text2)
+ @Nullable
+ @BindView(R.id.text2)
TextView album;
- @Nullable @BindView(R.id.text3)
+ @Nullable
+ @BindView(R.id.text3)
TextView artist;
@BindView(R.id.backgroundView)
ImageView backgroundView;
- @Nullable @BindView(R.id.seekbar)
+ @Nullable
+ @BindView(R.id.seekbar)
SizableSeekBar seekBar;
private CompositeDisposable disposables = new CompositeDisposable();
- @Inject PlayerPresenter presenter;
+ @Inject
+ PlayerPresenter presenter;
- @Inject NavigationEventRelay navigationEventRelay;
+ @Inject
+ NavigationEventRelay navigationEventRelay;
private Unbinder unbinder;
@@ -500,6 +513,11 @@ public void showSongInfoDialog(MaterialDialog dialog) {
dialog.show();
}
+ @Override
+ public void showUpgradeDialog(MaterialDialog dialog) {
+ dialog.show();
+ }
+
@Override
public boolean onMenuItemClick(MenuItem item) {
switch (item.getItemId()) {
@@ -520,7 +538,7 @@ public boolean onMenuItemClick(MenuItem item) {
goToGenre();
return true;
case R.id.editTags:
- presenter.editTagsClicked();
+ presenter.editTagsClicked(getActivity());
return true;
case R.id.songInfo:
presenter.songInfoClicked(getContext());
diff --git a/app/src/main/java/com/simplecity/amp_library/ui/fragments/PlaylistFragment.java b/app/src/main/java/com/simplecity/amp_library/ui/fragments/PlaylistFragment.java
index b749727ad..201095ccd 100644
--- a/app/src/main/java/com/simplecity/amp_library/ui/fragments/PlaylistFragment.java
+++ b/app/src/main/java/com/simplecity/amp_library/ui/fragments/PlaylistFragment.java
@@ -12,6 +12,7 @@
import com.annimon.stream.Stream;
import com.simplecity.amp_library.R;
import com.simplecity.amp_library.model.Playlist;
+import com.simplecity.amp_library.ui.adapters.LoggingViewModelAdapter;
import com.simplecity.amp_library.ui.modelviews.EmptyView;
import com.simplecity.amp_library.ui.modelviews.PlaylistView;
import com.simplecity.amp_library.utils.ComparisonUtils;
@@ -82,7 +83,7 @@ public void onDetach() {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
- adapter = new ViewModelAdapter();
+ adapter = new LoggingViewModelAdapter("PlaylistFragment");
}
@Override
diff --git a/app/src/main/java/com/simplecity/amp_library/ui/fragments/QueueFragment.java b/app/src/main/java/com/simplecity/amp_library/ui/fragments/QueueFragment.java
index 8aed3ead8..741bb2817 100644
--- a/app/src/main/java/com/simplecity/amp_library/ui/fragments/QueueFragment.java
+++ b/app/src/main/java/com/simplecity/amp_library/ui/fragments/QueueFragment.java
@@ -16,12 +16,15 @@
import com.afollestad.aesthetic.Aesthetic;
import com.afollestad.aesthetic.Util;
+import com.afollestad.materialdialogs.MaterialDialog;
import com.bumptech.glide.RequestManager;
import com.simplecity.amp_library.R;
import com.simplecity.amp_library.ShuttleApplication;
import com.simplecity.amp_library.dagger.module.FragmentModule;
import com.simplecity.amp_library.model.Song;
import com.simplecity.amp_library.tagger.TaggerDialog;
+import com.simplecity.amp_library.ui.adapters.LoggingViewModelAdapter;
+import com.simplecity.amp_library.ui.dialog.UpgradeDialog;
import com.simplecity.amp_library.ui.modelviews.SongView;
import com.simplecity.amp_library.ui.presenters.PlayerPresenter;
import com.simplecity.amp_library.ui.presenters.QueuePresenter;
@@ -85,11 +88,13 @@ public class QueueFragment extends BaseFragment implements
@Inject
RequestManager requestManager;
- @Inject MultiSheetSlideEventRelay multiSheetSlideEventRelay;
+ @Inject
+ MultiSheetSlideEventRelay multiSheetSlideEventRelay;
QueuePresenter queuePresenter;
- @Inject PlayerPresenter playerPresenter;
+ @Inject
+ PlayerPresenter playerPresenter;
private CompositeDisposable disposables = new CompositeDisposable();
@@ -120,7 +125,7 @@ public void onCreate(final Bundle savedInstanceState) {
setHasOptionsMenu(true);
- adapter = new ViewModelAdapter();
+ adapter = new LoggingViewModelAdapter("QueueFragment");
}
@Override
@@ -305,6 +310,11 @@ public void moveQueueItem(int from, int to) {
adapter.moveItem(from, to);
}
+ @Override
+ public void showUpgradeDialog() {
+ UpgradeDialog.getUpgradeDialog(getActivity()).show();
+ }
+
private PlayerViewAdapter playerViewAdapter = new PlayerViewAdapter() {
@Override
public void trackInfoChanged(@Nullable Song song) {
@@ -315,6 +325,11 @@ public void trackInfoChanged(@Nullable Song song) {
}
}
}
+
+ @Override
+ public void showUpgradeDialog(MaterialDialog dialog) {
+ dialog.show();
+ }
};
Toolbar.OnMenuItemClickListener toolbarListener = new Toolbar.OnMenuItemClickListener() {
diff --git a/app/src/main/java/com/simplecity/amp_library/ui/fragments/QueuePagerFragment.java b/app/src/main/java/com/simplecity/amp_library/ui/fragments/QueuePagerFragment.java
index 34ff452e3..df2168d8a 100644
--- a/app/src/main/java/com/simplecity/amp_library/ui/fragments/QueuePagerFragment.java
+++ b/app/src/main/java/com/simplecity/amp_library/ui/fragments/QueuePagerFragment.java
@@ -18,6 +18,7 @@
import com.simplecity.amp_library.ShuttleApplication;
import com.simplecity.amp_library.dagger.module.FragmentModule;
import com.simplecity.amp_library.glide.preloader.RecyclerViewPreloader;
+import com.simplecity.amp_library.ui.adapters.LoggingViewModelAdapter;
import com.simplecity.amp_library.ui.modelviews.QueuePagerItemView;
import com.simplecity.amp_library.ui.presenters.QueuePagerPresenter;
import com.simplecity.amp_library.ui.views.QueuePagerView;
@@ -77,7 +78,7 @@ public QueuePagerFragment() {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
- viewModelAdapter = new ViewModelAdapter();
+ viewModelAdapter = new LoggingViewModelAdapter("QueuePagerFragment");
ShuttleApplication.getInstance().getAppComponent()
.plus(new FragmentModule(this))
diff --git a/app/src/main/java/com/simplecity/amp_library/ui/fragments/SongFragment.java b/app/src/main/java/com/simplecity/amp_library/ui/fragments/SongFragment.java
index 5a19a1b9d..dcd5fd4c6 100644
--- a/app/src/main/java/com/simplecity/amp_library/ui/fragments/SongFragment.java
+++ b/app/src/main/java/com/simplecity/amp_library/ui/fragments/SongFragment.java
@@ -18,6 +18,7 @@
import com.simplecity.amp_library.R;
import com.simplecity.amp_library.model.Song;
import com.simplecity.amp_library.ui.adapters.SectionedAdapter;
+import com.simplecity.amp_library.ui.dialog.UpgradeDialog;
import com.simplecity.amp_library.ui.modelviews.EmptyView;
import com.simplecity.amp_library.ui.modelviews.SelectableViewModel;
import com.simplecity.amp_library.ui.modelviews.ShuffleView;
@@ -30,6 +31,7 @@
import com.simplecity.amp_library.utils.MusicUtils;
import com.simplecity.amp_library.utils.PermissionUtils;
import com.simplecity.amp_library.utils.PlaylistUtils;
+import com.simplecity.amp_library.utils.ShuttleUtils;
import com.simplecity.amp_library.utils.SortManager;
import com.simplecityapps.recycler_adapter.model.ViewModel;
import com.simplecityapps.recycler_adapter.recyclerview.RecyclerListener;
@@ -85,7 +87,7 @@ public void onCreate(final Bundle icicle) {
setHasOptionsMenu(true);
- adapter = new SectionedAdapter();
+ adapter = new SectionedAdapter("SongFragment");
shuffleView = new ShuffleView();
shuffleView.setClickListener(this);
@@ -293,9 +295,18 @@ public void onSongClick(int position, SongView songView) {
public void onSongOverflowClick(int position, View v, Song song) {
PopupMenu menu = new PopupMenu(SongFragment.this.getActivity(), v);
MenuUtils.setupSongMenu(menu, false);
- menu.setOnMenuItemClickListener(MenuUtils.getSongMenuClickListener(getContext(), song,
- taggerDialog -> taggerDialog.show(getFragmentManager()),
- null, null));
+ menu.setOnMenuItemClickListener(MenuUtils.getSongMenuClickListener(
+ getContext(),
+ song,
+ taggerDialog -> {
+ if (!ShuttleUtils.isUpgraded()) {
+ UpgradeDialog.getUpgradeDialog(getActivity()).show();
+ } else {
+ taggerDialog.show(getFragmentManager());
+ }
+ },
+ null,
+ null));
menu.show();
}
diff --git a/app/src/main/java/com/simplecity/amp_library/ui/fragments/SuggestedFragment.java b/app/src/main/java/com/simplecity/amp_library/ui/fragments/SuggestedFragment.java
index e50e26500..d4955962e 100644
--- a/app/src/main/java/com/simplecity/amp_library/ui/fragments/SuggestedFragment.java
+++ b/app/src/main/java/com/simplecity/amp_library/ui/fragments/SuggestedFragment.java
@@ -21,8 +21,10 @@
import com.simplecity.amp_library.model.Playlist;
import com.simplecity.amp_library.model.Song;
import com.simplecity.amp_library.model.SuggestedHeader;
+import com.simplecity.amp_library.ui.adapters.LoggingViewModelAdapter;
import com.simplecity.amp_library.ui.adapters.ViewType;
import com.simplecity.amp_library.ui.detail.PlaylistDetailFragment;
+import com.simplecity.amp_library.ui.dialog.UpgradeDialog;
import com.simplecity.amp_library.ui.modelviews.AlbumView;
import com.simplecity.amp_library.ui.modelviews.EmptyView;
import com.simplecity.amp_library.ui.modelviews.HorizontalRecyclerView;
@@ -35,6 +37,7 @@
import com.simplecity.amp_library.utils.MusicUtils;
import com.simplecity.amp_library.utils.Operators;
import com.simplecity.amp_library.utils.PermissionUtils;
+import com.simplecity.amp_library.utils.ShuttleUtils;
import com.simplecityapps.recycler_adapter.adapter.ViewModelAdapter;
import com.simplecityapps.recycler_adapter.model.ViewModel;
import com.simplecityapps.recycler_adapter.recyclerview.RecyclerListener;
@@ -82,7 +85,18 @@ public boolean onSongLongClick(Song song) {
public void onSongOverflowClicked(View v, Song song) {
PopupMenu popupMenu = new PopupMenu(getContext(), v);
MenuUtils.setupSongMenu(popupMenu, false);
- popupMenu.setOnMenuItemClickListener(MenuUtils.getSongMenuClickListener(getContext(), song, taggerDialog -> taggerDialog.show(getFragmentManager()), null, null));
+ popupMenu.setOnMenuItemClickListener(MenuUtils.getSongMenuClickListener(
+ getContext(),
+ song,
+ taggerDialog -> {
+ if (!ShuttleUtils.isUpgraded()) {
+ UpgradeDialog.getUpgradeDialog(getActivity()).show();
+ } else {
+ taggerDialog.show(getFragmentManager());
+ }
+ },
+ null,
+ null));
popupMenu.show();
}
}
@@ -141,9 +155,9 @@ public void onCreate(Bundle savedInstanceState) {
.plus(new FragmentModule(this))
.inject(this);
- adapter = new ViewModelAdapter();
- mostPlayedRecyclerView = new HorizontalRecyclerView();
- favoriteRecyclerView = new HorizontalRecyclerView();
+ adapter = new LoggingViewModelAdapter("SuggestedFragment");
+ mostPlayedRecyclerView = new HorizontalRecyclerView("SuggestedFragment - mostPlayed");
+ favoriteRecyclerView = new HorizontalRecyclerView("SuggestedFragment - favorite");
}
@Override
@@ -333,7 +347,7 @@ Observable> getRecentlyAddedViewModels() {
void refreshAdapterItems() {
- refreshDisposables.clear();
+ refreshDisposables.clear();
PermissionUtils.RequestStoragePermissions(() -> {
if (getActivity() != null && isAdded()) {
@@ -389,7 +403,7 @@ public boolean onAlbumLongClick(int position, AlbumView albumView) {
public void onAlbumOverflowClicked(View v, Album album) {
PopupMenu menu = new PopupMenu(getContext(), v);
MenuUtils.setupAlbumMenu(menu);
- menu.setOnMenuItemClickListener(MenuUtils.getAlbumMenuClickListener(getContext(), album, taggerDialog -> taggerDialog.show(getFragmentManager())));
+ menu.setOnMenuItemClickListener(MenuUtils.getAlbumMenuClickListener(getContext(), album, taggerDialog -> taggerDialog.show(getFragmentManager()), () -> UpgradeDialog.getUpgradeDialog(getActivity()).show()));
menu.show();
}
diff --git a/app/src/main/java/com/simplecity/amp_library/ui/modelviews/HorizontalRecyclerView.java b/app/src/main/java/com/simplecity/amp_library/ui/modelviews/HorizontalRecyclerView.java
index f1e42ff80..fa015d82e 100644
--- a/app/src/main/java/com/simplecity/amp_library/ui/modelviews/HorizontalRecyclerView.java
+++ b/app/src/main/java/com/simplecity/amp_library/ui/modelviews/HorizontalRecyclerView.java
@@ -5,6 +5,7 @@
import android.view.View;
import android.view.ViewGroup;
+import com.simplecity.amp_library.ui.adapters.LoggingViewModelAdapter;
import com.simplecityapps.recycler_adapter.adapter.ViewModelAdapter;
import com.simplecityapps.recycler_adapter.model.BaseViewModel;
import com.simplecityapps.recycler_adapter.model.ViewModel;
@@ -20,8 +21,8 @@ public class HorizontalRecyclerView extends BaseViewModel items) {
diff --git a/app/src/main/java/com/simplecity/amp_library/ui/modelviews/TabViewModel.java b/app/src/main/java/com/simplecity/amp_library/ui/modelviews/TabViewModel.java
index 56ebde31d..c371c9f08 100644
--- a/app/src/main/java/com/simplecity/amp_library/ui/modelviews/TabViewModel.java
+++ b/app/src/main/java/com/simplecity/amp_library/ui/modelviews/TabViewModel.java
@@ -10,6 +10,7 @@
import com.simplecity.amp_library.R;
import com.simplecity.amp_library.model.CategoryItem;
import com.simplecity.amp_library.ui.adapters.ViewType;
+import com.simplecity.amp_library.utils.ShuttleUtils;
import com.simplecityapps.recycler_adapter.model.BaseViewModel;
import com.simplecityapps.recycler_adapter.recyclerview.BaseViewHolder;
@@ -17,6 +18,8 @@ public class TabViewModel extends BaseViewModel {
public interface Listener {
void onStartDrag(ViewHolder holder);
+
+ void onFolderChecked(TabViewModel tabViewModel, ViewHolder viewHolder);
}
public CategoryItem categoryItem;
@@ -42,8 +45,13 @@ public int getLayoutResId() {
return R.layout.list_item_reorder_tabs;
}
- void onCheckboxClicked(boolean checked) {
- categoryItem.isEnabled = checked;
+ void onCheckboxClicked(ViewHolder viewHolder, boolean checked) {
+ if (categoryItem.type == CategoryItem.Type.FOLDERS) {
+ if (listener != null) {
+ listener.onFolderChecked(this, viewHolder);
+ }
+ }
+ categoryItem.isChecked = checked;
}
void onStartDrag(ViewHolder viewHolder) {
@@ -57,7 +65,13 @@ public void bindView(ViewHolder holder) {
super.bindView(holder);
holder.textView.setText(holder.itemView.getContext().getString(categoryItem.getTitleResId()));
- holder.checkBox.setChecked(categoryItem.isEnabled);
+ holder.checkBox.setChecked(categoryItem.isChecked);
+
+ if (categoryItem.type == CategoryItem.Type.FOLDERS && !ShuttleUtils.isUpgraded()) {
+ holder.checkBox.setAlpha(0.4f);
+ } else {
+ holder.checkBox.setAlpha(1.0f);
+ }
}
@Override
@@ -78,7 +92,7 @@ public static class ViewHolder extends BaseViewHolder {
checkBox = itemView.findViewById(R.id.checkBox1);
dragHandle = itemView.findViewById(R.id.drag_handle);
- checkBox.setOnClickListener(view -> viewModel.onCheckboxClicked(((CheckBox) view).isChecked()));
+ checkBox.setOnClickListener(view -> viewModel.onCheckboxClicked(this, ((CheckBox) view).isChecked()));
dragHandle.setOnTouchListener((v, event) -> {
if (event.getActionMasked() == MotionEvent.ACTION_DOWN) {
diff --git a/app/src/main/java/com/simplecity/amp_library/ui/presenters/PlayerPresenter.java b/app/src/main/java/com/simplecity/amp_library/ui/presenters/PlayerPresenter.java
index 66262c60a..0f3c96f12 100644
--- a/app/src/main/java/com/simplecity/amp_library/ui/presenters/PlayerPresenter.java
+++ b/app/src/main/java/com/simplecity/amp_library/ui/presenters/PlayerPresenter.java
@@ -1,5 +1,6 @@
package com.simplecity.amp_library.ui.presenters;
+import android.app.Activity;
import android.content.Context;
import android.content.IntentFilter;
import android.support.annotation.NonNull;
@@ -13,11 +14,13 @@
import com.simplecity.amp_library.tagger.TaggerDialog;
import com.simplecity.amp_library.ui.dialog.BiographyDialog;
import com.simplecity.amp_library.ui.dialog.ShareDialog;
+import com.simplecity.amp_library.ui.dialog.UpgradeDialog;
import com.simplecity.amp_library.ui.views.PlayerView;
import com.simplecity.amp_library.utils.LogUtils;
import com.simplecity.amp_library.utils.MusicUtils;
import com.simplecity.amp_library.utils.PlaylistUtils;
import com.simplecity.amp_library.utils.SettingsManager;
+import com.simplecity.amp_library.utils.ShuttleUtils;
import java.util.concurrent.TimeUnit;
@@ -283,10 +286,14 @@ public void showLyrics(Context context) {
}
}
- public void editTagsClicked() {
+ public void editTagsClicked(Activity activity) {
PlayerView playerView = getView();
if (playerView != null) {
- playerView.showTaggerDialog(TaggerDialog.newInstance(MusicUtils.getSong()));
+ if (!ShuttleUtils.isUpgraded()) {
+ playerView.showUpgradeDialog(UpgradeDialog.getUpgradeDialog(activity));
+ } else {
+ playerView.showTaggerDialog(TaggerDialog.newInstance(MusicUtils.getSong()));
+ }
}
}
diff --git a/app/src/main/java/com/simplecity/amp_library/ui/presenters/QueuePresenter.java b/app/src/main/java/com/simplecity/amp_library/ui/presenters/QueuePresenter.java
index 9dae03a3b..dc930b0e0 100644
--- a/app/src/main/java/com/simplecity/amp_library/ui/presenters/QueuePresenter.java
+++ b/app/src/main/java/com/simplecity/amp_library/ui/presenters/QueuePresenter.java
@@ -22,6 +22,7 @@
import com.simplecity.amp_library.utils.MenuUtils;
import com.simplecity.amp_library.utils.MusicUtils;
import com.simplecity.amp_library.utils.PlaylistUtils;
+import com.simplecity.amp_library.utils.ShuttleUtils;
import com.simplecityapps.recycler_adapter.model.ViewModel;
import java.util.ArrayList;
@@ -170,7 +171,11 @@ public void onSongOverflowClick(int position, View v, Song song) {
taggerDialog -> {
QueueView queueView = getView();
if (queueView != null) {
- queueView.showTaggerDialog(taggerDialog);
+ if (!ShuttleUtils.isUpgraded()) {
+ queueView.showUpgradeDialog();
+ } else {
+ queueView.showTaggerDialog(taggerDialog);
+ }
}
},
() -> removeFromQueue(position, song),
diff --git a/app/src/main/java/com/simplecity/amp_library/ui/settings/SettingsParentFragment.java b/app/src/main/java/com/simplecity/amp_library/ui/settings/SettingsParentFragment.java
index 2c676b375..7b2b99838 100644
--- a/app/src/main/java/com/simplecity/amp_library/ui/settings/SettingsParentFragment.java
+++ b/app/src/main/java/com/simplecity/amp_library/ui/settings/SettingsParentFragment.java
@@ -225,7 +225,7 @@ public void onCreate(Bundle savedInstanceState) {
Preference chooseTabsPreference = findPreference(SettingsManager.KEY_PREF_TAB_CHOOSER);
if (chooseTabsPreference != null) {
chooseTabsPreference.setOnPreferenceClickListener(preference -> {
- settingsPresenter.chooseTabsClicked(getContext());
+ settingsPresenter.chooseTabsClicked(getActivity());
return true;
});
}
diff --git a/app/src/main/java/com/simplecity/amp_library/ui/settings/SettingsPresenter.java b/app/src/main/java/com/simplecity/amp_library/ui/settings/SettingsPresenter.java
index 849085188..f27d9d1c5 100644
--- a/app/src/main/java/com/simplecity/amp_library/ui/settings/SettingsPresenter.java
+++ b/app/src/main/java/com/simplecity/amp_library/ui/settings/SettingsPresenter.java
@@ -20,13 +20,14 @@
import com.simplecity.amp_library.model.CategoryItem;
import com.simplecity.amp_library.model.InclExclItem;
import com.simplecity.amp_library.services.ArtworkDownloadService;
-import com.simplecity.amp_library.ui.activities.MainActivity;
import com.simplecity.amp_library.ui.dialog.ChangelogDialog;
import com.simplecity.amp_library.ui.dialog.InclExclDialog;
import com.simplecity.amp_library.ui.dialog.TabChooserDialog;
import com.simplecity.amp_library.ui.presenters.PurchasePresenter;
import com.simplecity.amp_library.utils.AnalyticsManager;
+import com.simplecity.amp_library.utils.ColorPalette;
import com.simplecity.amp_library.utils.SettingsManager;
+import com.simplecity.amp_library.utils.ShuttleUtils;
import java.util.List;
@@ -64,10 +65,10 @@ public void restorePurchasesClicked() {
// Display
- public void chooseTabsClicked(Context context) {
+ public void chooseTabsClicked(Activity activity) {
SettingsView settingsView = getView();
if (settingsView != null) {
- settingsView.showTabChooserDialog(TabChooserDialog.getDialog(context));
+ settingsView.showTabChooserDialog(TabChooserDialog.getDialog(activity));
}
}
@@ -76,7 +77,7 @@ public void chooseDefaultPageClicked(Context context) {
if (settingsView != null) {
SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context);
List categoryItems = Stream.of(CategoryItem.getCategoryItems(sharedPreferences))
- .filter(categoryItem -> categoryItem.isEnabled)
+ .filter(categoryItem -> categoryItem.isChecked)
.toList();
int defaultPageType = SettingsManager.getInstance().getDefaultPageType();
@@ -146,7 +147,8 @@ public void primaryColorClicked(Context context) {
if (settingsView != null) {
settingsView.showPrimaryColorDialog(
new ColorChooserDialog.Builder(context, R.string.pref_title_theme_pick_color)
- .allowUserColorInput(true)
+ .customColors(ColorPalette.getPrimaryColors(), ColorPalette.getPrimaryColorsSub())
+ .allowUserColorInput(ShuttleUtils.isUpgraded())
.allowUserColorInputAlpha(false)
.dynamicButtonColor(false)
.preselect(Aesthetic.get(context).colorPrimary().blockingFirst())
diff --git a/app/src/main/java/com/simplecity/amp_library/ui/views/CustomMediaRouteActionProvider.java b/app/src/main/java/com/simplecity/amp_library/ui/views/CustomMediaRouteActionProvider.java
index cd495bd6c..d1bcd3d8b 100644
--- a/app/src/main/java/com/simplecity/amp_library/ui/views/CustomMediaRouteActionProvider.java
+++ b/app/src/main/java/com/simplecity/amp_library/ui/views/CustomMediaRouteActionProvider.java
@@ -1,39 +1,62 @@
package com.simplecity.amp_library.ui.views;
+import android.app.Activity;
import android.content.Context;
+import android.support.annotation.NonNull;
+import android.support.annotation.Nullable;
import android.support.v7.app.MediaRouteActionProvider;
+import android.support.v7.app.MediaRouteButton;
import android.support.v7.media.MediaRouteSelector;
import android.util.Log;
import android.view.ViewGroup;
+import com.simplecity.amp_library.utils.ShuttleUtils;
+
public class CustomMediaRouteActionProvider extends MediaRouteActionProvider {
private static final String TAG = "MediaRteActProvider";
+ private Activity activity;
+
private MediaRouteSelector selector = MediaRouteSelector.EMPTY;
- private CustomMediaRouteButton button;
+ private CustomMediaRouteButton customMediaRouteButton;
public CustomMediaRouteActionProvider(Context context) {
super(context);
}
+ public void setActivity(@NonNull Activity activity) {
+ this.activity = activity;
+ if (customMediaRouteButton != null) {
+ customMediaRouteButton.setActivity(activity);
+ }
+ }
+
+ @Nullable
+ @Override
+ public MediaRouteButton getMediaRouteButton() {
+ return customMediaRouteButton;
+ }
+
/**
* Called when the media route button is being created.
*/
@SuppressWarnings("deprecation")
@Override
public CustomMediaRouteButton onCreateMediaRouteButton() {
- if (button != null) {
+ if (customMediaRouteButton != null) {
Log.e(TAG, "onCreateMediaRouteButton: This ActionProvider is already associated "
+ "with a menu item. Don't reuse MediaRouteActionProvider instances! "
+ "Abandoning the old button...");
}
- button = new CustomMediaRouteButton(getContext());
- button.setRouteSelector(selector);
- button.setLayoutParams(new ViewGroup.LayoutParams(
+ customMediaRouteButton = new CustomMediaRouteButton(getContext());
+ customMediaRouteButton.setActivity(activity);
+ customMediaRouteButton.setAlpha(ShuttleUtils.isUpgraded() ? 1.0f : 0.5f);
+ customMediaRouteButton.setRouteSelector(selector);
+ customMediaRouteButton.setLayoutParams(new ViewGroup.LayoutParams(
ViewGroup.LayoutParams.WRAP_CONTENT,
ViewGroup.LayoutParams.FILL_PARENT));
- return button;
+ return customMediaRouteButton;
}
}
\ No newline at end of file
diff --git a/app/src/main/java/com/simplecity/amp_library/ui/views/CustomMediaRouteButton.java b/app/src/main/java/com/simplecity/amp_library/ui/views/CustomMediaRouteButton.java
index f252b33ca..458f52123 100644
--- a/app/src/main/java/com/simplecity/amp_library/ui/views/CustomMediaRouteButton.java
+++ b/app/src/main/java/com/simplecity/amp_library/ui/views/CustomMediaRouteButton.java
@@ -1,15 +1,23 @@
package com.simplecity.amp_library.ui.views;
+import android.app.Activity;
import android.content.Context;
+import android.support.annotation.NonNull;
+import android.support.annotation.Nullable;
import android.support.v7.app.MediaRouteButton;
import android.util.AttributeSet;
import android.view.ContextThemeWrapper;
import com.afollestad.aesthetic.Aesthetic;
import com.simplecity.amp_library.R;
+import com.simplecity.amp_library.ui.dialog.UpgradeDialog;
+import com.simplecity.amp_library.utils.ShuttleUtils;
public class CustomMediaRouteButton extends MediaRouteButton {
+ @Nullable
+ private Activity activity;
+
public CustomMediaRouteButton(Context context) {
this(context, null);
}
@@ -27,4 +35,21 @@ private static Context getThemedContext(Context context) {
new ContextThemeWrapper(new ContextThemeWrapper(context, R.style.Theme_AppCompat), R.style.Theme_MediaRouter) :
new ContextThemeWrapper(new ContextThemeWrapper(context, R.style.Theme_AppCompat_Light), R.style.Theme_MediaRouter);
}
+
+ public void setActivity(@NonNull Activity activity) {
+ this.activity = activity;
+ }
+
+ @Override
+ public boolean showDialog() {
+
+ if (!ShuttleUtils.isUpgraded()) {
+ if (activity != null) {
+ UpgradeDialog.getUpgradeDialog(activity).show();
+ }
+ return false;
+ }
+
+ return super.showDialog();
+ }
}
\ No newline at end of file
diff --git a/app/src/main/java/com/simplecity/amp_library/ui/views/PlayerView.java b/app/src/main/java/com/simplecity/amp_library/ui/views/PlayerView.java
index 013d8506f..51577e5c9 100644
--- a/app/src/main/java/com/simplecity/amp_library/ui/views/PlayerView.java
+++ b/app/src/main/java/com/simplecity/amp_library/ui/views/PlayerView.java
@@ -37,4 +37,6 @@ public interface PlayerView {
void showTaggerDialog(TaggerDialog taggerDialog);
void showSongInfoDialog(MaterialDialog dialog);
+
+ void showUpgradeDialog(MaterialDialog dialog);
}
\ No newline at end of file
diff --git a/app/src/main/java/com/simplecity/amp_library/ui/views/QueueView.java b/app/src/main/java/com/simplecity/amp_library/ui/views/QueueView.java
index f09cc104f..e350e03c0 100644
--- a/app/src/main/java/com/simplecity/amp_library/ui/views/QueueView.java
+++ b/app/src/main/java/com/simplecity/amp_library/ui/views/QueueView.java
@@ -21,4 +21,6 @@ public interface QueueView {
void removeFromQueue(int position);
void moveQueueItem(int from, int to);
+
+ void showUpgradeDialog();
}
\ No newline at end of file
diff --git a/app/src/main/java/com/simplecity/amp_library/ui/views/UpNextView.java b/app/src/main/java/com/simplecity/amp_library/ui/views/UpNextView.java
index 15265eb51..1f5815f2c 100644
--- a/app/src/main/java/com/simplecity/amp_library/ui/views/UpNextView.java
+++ b/app/src/main/java/com/simplecity/amp_library/ui/views/UpNextView.java
@@ -12,6 +12,7 @@
import com.afollestad.aesthetic.Aesthetic;
import com.afollestad.aesthetic.LightDarkColorState;
+import com.afollestad.materialdialogs.MaterialDialog;
import com.jakewharton.rxbinding2.widget.RxSeekBar;
import com.jakewharton.rxbinding2.widget.SeekBarChangeEvent;
import com.jakewharton.rxbinding2.widget.SeekBarProgressChangeEvent;
@@ -51,28 +52,36 @@ public class UpNextView extends LinearLayout {
@BindView(R.id.queuePosition)
TextView queuePositionTextView;
- @Nullable @BindView(R.id.play)
+ @Nullable
+ @BindView(R.id.play)
PlayPauseView playPauseView;
- @Nullable @BindView(R.id.shuffle)
+ @Nullable
+ @BindView(R.id.shuffle)
ShuffleButton shuffleButton;
- @Nullable @BindView(R.id.repeat)
+ @Nullable
+ @BindView(R.id.repeat)
RepeatButton repeatButton;
- @Nullable @BindView(R.id.next)
+ @Nullable
+ @BindView(R.id.next)
RepeatingImageButton nextButton;
- @Nullable @BindView(R.id.prev)
+ @Nullable
+ @BindView(R.id.prev)
RepeatingImageButton prevButton;
- @Nullable @BindView(R.id.seekbar)
+ @Nullable
+ @BindView(R.id.seekbar)
SizableSeekBar seekBar;
- @Nullable @BindView(R.id.buttonContainer)
+ @Nullable
+ @BindView(R.id.buttonContainer)
View buttonContainer;
- @Nullable @BindView(R.id.textContainer)
+ @Nullable
+ @BindView(R.id.textContainer)
View textcontainer;
private boolean isSeeking;
@@ -232,6 +241,11 @@ public void repeatChanged(int repeatMode) {
}
}
+ @Override
+ public void showUpgradeDialog(MaterialDialog dialog) {
+ dialog.show();
+ }
+
@Override
public void setSeekProgress(int progress) {
if (!isSeeking && seekBar != null) {
diff --git a/app/src/main/java/com/simplecity/amp_library/utils/ArtworkDialog.java b/app/src/main/java/com/simplecity/amp_library/utils/ArtworkDialog.java
index 27ab3d02f..0ad897122 100644
--- a/app/src/main/java/com/simplecity/amp_library/utils/ArtworkDialog.java
+++ b/app/src/main/java/com/simplecity/amp_library/utils/ArtworkDialog.java
@@ -20,6 +20,7 @@
import com.simplecity.amp_library.model.ArtworkProvider;
import com.simplecity.amp_library.model.UserSelectedArtwork;
import com.simplecity.amp_library.sql.databases.CustomArtworkTable;
+import com.simplecity.amp_library.ui.adapters.LoggingViewModelAdapter;
import com.simplecity.amp_library.ui.modelviews.ArtworkLoadingView;
import com.simplecity.amp_library.ui.modelviews.ArtworkView;
import com.simplecity.amp_library.ui.recyclerview.SpacesItemDecoration;
@@ -49,7 +50,7 @@ public static MaterialDialog build(Context context, ArtworkProvider artworkProvi
@SuppressLint("InflateParams")
View customView = LayoutInflater.from(context).inflate(R.layout.dialog_artwork, null);
- ViewModelAdapter adapter = new ViewModelAdapter();
+ ViewModelAdapter adapter = new LoggingViewModelAdapter("ArtworkDialog");
RecyclerView.LayoutManager layoutManager = new LinearLayoutManager(context, LinearLayoutManager.HORIZONTAL, false);
RecyclerView recyclerView = customView.findViewById(R.id.recyclerView);
diff --git a/app/src/main/java/com/simplecity/amp_library/utils/ColorPalette.java b/app/src/main/java/com/simplecity/amp_library/utils/ColorPalette.java
index aa2d1e858..cd9bd9095 100644
--- a/app/src/main/java/com/simplecity/amp_library/utils/ColorPalette.java
+++ b/app/src/main/java/com/simplecity/amp_library/utils/ColorPalette.java
@@ -1,5 +1,7 @@
package com.simplecity.amp_library.utils;
+import android.graphics.Color;
+
public class ColorPalette {
public static int[] getPrimaryColors() {
@@ -10,753 +12,353 @@ public static int[][] getPrimaryColorsSub() {
return ShuttleUtils.isUpgraded() ? PRIMARY_COLORS_SUB : PRIMARY_COLORS_SUB_FREE;
}
- public static int[] getAccentColors() {
- return ShuttleUtils.isUpgraded() ? ACCENT_COLORS : ACCENT_COLORS_FREE;
- }
-
- public static int[][] getAccentColorsSub() {
- return ShuttleUtils.isUpgraded() ? ACCENT_COLORS_SUB : ACCENT_COLORS_SUB_FREE;
- }
-
private final static int[] PRIMARY_COLORS = new int[]{
- 0xFFF44336,
- 0xFFE91E63,
- 0xFF9C27B0,
- 0xFF673AB7,
- 0xFF3F51B5,
- 0xFF2196F3,
- 0xFF03A9F4,
- 0xFF00BCD4,
- 0xFF009688,
- 0xFF4CAF50,
- 0xFF8BC34A,
- 0xFFCDDC39,
- 0xFFFFEB3B,
- 0xFFFFC107,
- 0xFFFF9800,
- 0xFFFF5722,
- 0xFF795548,
- 0xFF9E9E9E,
- 0xFF607D8B
+ Color.parseColor("#F44336"),
+ Color.parseColor("#E91E63"),
+ Color.parseColor("#9C27B0"),
+ Color.parseColor("#673AB7"),
+ Color.parseColor("#3F51B5"),
+ Color.parseColor("#2196F3"),
+ Color.parseColor("#03A9F4"),
+ Color.parseColor("#00BCD4"),
+ Color.parseColor("#009688"),
+ Color.parseColor("#4CAF50"),
+ Color.parseColor("#8BC34A"),
+ Color.parseColor("#CDDC39"),
+ Color.parseColor("#FFEB3B"),
+ Color.parseColor("#FFC107"),
+ Color.parseColor("#FF9800"),
+ Color.parseColor("#FF5722"),
+ Color.parseColor("#795548"),
+ Color.parseColor("#9E9E9E"),
+ Color.parseColor("#607D8B")
};
private final static int[][] PRIMARY_COLORS_SUB = new int[][]{
new int[]{
- 0xFFFFEBEE,
- 0xFFFFCDD2,
- 0xFFEF9A9A,
- 0xFFE57373,
- 0xFFEF5350,
- 0xFFF44336,
- 0xFFE53935,
- 0xFFD32F2F,
- 0xFFC62828,
- 0xFFB71C1C
- },
- new int[]{
- 0xFFFCE4EC,
- 0xFFF8BBD0,
- 0xFFF48FB1,
- 0xFFF06292,
- 0xFFEC407A,
- 0xFFE91E63,
- 0xFFD81B60,
- 0xFFC2185B,
- 0xFFAD1457,
- 0xFF880E4F
- },
- new int[]{
- 0xFFF3E5F5,
- 0xFFE1BEE7,
- 0xFFCE93D8,
- 0xFFBA68C8,
- 0xFFAB47BC,
- 0xFF9C27B0,
- 0xFF8E24AA,
- 0xFF7B1FA2,
- 0xFF6A1B9A,
- 0xFF4A148C
- },
- new int[]{
- 0xFFEDE7F6,
- 0xFFD1C4E9,
- 0xFFB39DDB,
- 0xFF9575CD,
- 0xFF7E57C2,
- 0xFF673AB7,
- 0xFF5E35B1,
- 0xFF512DA8,
- 0xFF4527A0,
- 0xFF311B92
- },
- new int[]{
- 0xFFE8EAF6,
- 0xFFC5CAE9,
- 0xFF9FA8DA,
- 0xFF7986CB,
- 0xFF5C6BC0,
- 0xFF3F51B5,
- 0xFF3949AB,
- 0xFF303F9F,
- 0xFF283593,
- 0xFF1A237E
- },
- new int[]{
- 0xFFE3F2FD,
- 0xFFBBDEFB,
- 0xFF90CAF9,
- 0xFF64B5F6,
- 0xFF42A5F5,
- 0xFF2196F3,
- 0xFF1E88E5,
- 0xFF1976D2,
- 0xFF1565C0,
- 0xFF0D47A1
- },
- new int[]{
- 0xFFE1F5FE,
- 0xFFB3E5FC,
- 0xFF81D4FA,
- 0xFF4FC3F7,
- 0xFF29B6F6,
- 0xFF03A9F4,
- 0xFF039BE5,
- 0xFF0288D1,
- 0xFF0277BD,
- 0xFF01579B
- },
- new int[]{
- 0xFFE0F7FA,
- 0xFFB2EBF2,
- 0xFF80DEEA,
- 0xFF4DD0E1,
- 0xFF26C6DA,
- 0xFF00BCD4,
- 0xFF00ACC1,
- 0xFF0097A7,
- 0xFF00838F,
- 0xFF006064
- },
- new int[]{
- 0xFFE0F2F1,
- 0xFFB2DFDB,
- 0xFF80CBC4,
- 0xFF4DB6AC,
- 0xFF26A69A,
- 0xFF009688,
- 0xFF00897B,
- 0xFF00796B,
- 0xFF00695C,
- 0xFF004D40
- },
- new int[]{
- 0xFFE8F5E9,
- 0xFFC8E6C9,
- 0xFFA5D6A7,
- 0xFF81C784,
- 0xFF66BB6A,
- 0xFF4CAF50,
- 0xFF43A047,
- 0xFF388E3C,
- 0xFF2E7D32,
- 0xFF1B5E20
- },
- new int[]{
- 0xFFF1F8E9,
- 0xFFDCEDC8,
- 0xFFC5E1A5,
- 0xFFAED581,
- 0xFF9CCC65,
- 0xFF8BC34A,
- 0xFF7CB342,
- 0xFF689F38,
- 0xFF558B2F,
- 0xFF33691E
- },
- new int[]{
- 0xFFF9FBE7,
- 0xFFF0F4C3,
- 0xFFE6EE9C,
- 0xFFDCE775,
- 0xFFD4E157,
- 0xFFCDDC39,
- 0xFFC0CA33,
- 0xFFAFB42B,
- 0xFF9E9D24,
- 0xFF827717
- },
- new int[]{
- 0xFFFFFDE7,
- 0xFFFFF9C4,
- 0xFFFFF59D,
- 0xFFFFF176,
- 0xFFFFEE58,
- 0xFFFFEB3B,
- 0xFFFDD835,
- 0xFFFBC02D,
- 0xFFF9A825,
- 0xFFF57F17
- },
- new int[]{
- 0xFFFFF8E1,
- 0xFFFFECB3,
- 0xFFFFE082,
- 0xFFFFD54F,
- 0xFFFFCA28,
- 0xFFFFC107,
- 0xFFFFB300,
- 0xFFFFA000,
- 0xFFFF8F00,
- 0xFFFF6F00
- },
- new int[]{
- 0xFFFFF3E0,
- 0xFFFFE0B2,
- 0xFFFFCC80,
- 0xFFFFB74D,
- 0xFFFFA726,
- 0xFFFF9800,
- 0xFFFB8C00,
- 0xFFF57C00,
- 0xFFEF6C00,
- 0xFFE65100
- },
- new int[]{
- 0xFFFBE9E7,
- 0xFFFFCCBC,
- 0xFFFFAB91,
- 0xFFFF8A65,
- 0xFFFF7043,
- 0xFFFF5722,
- 0xFFF4511E,
- 0xFFE64A19,
- 0xFFD84315,
- 0xFFBF360C
- },
- new int[]{
- 0xFFEFEBE9,
- 0xFFD7CCC8,
- 0xFFBCAAA4,
- 0xFFA1887F,
- 0xFF8D6E63,
- 0xFF795548,
- 0xFF6D4C41,
- 0xFF5D4037,
- 0xFF4E342E,
- 0xFF3E2723
- },
- new int[]{
- 0xFFFAFAFA,
- 0xFFF5F5F5,
- 0xFFEEEEEE,
- 0xFFE0E0E0,
- 0xFFBDBDBD,
- 0xFF9E9E9E,
- 0xFF757575,
- 0xFF616161,
- 0xFF424242,
- 0xFF212121
- },
- new int[]{
- 0xFFECEFF1,
- 0xFFCFD8DC,
- 0xFFB0BEC5,
- 0xFF90A4AE,
- 0xFF78909C,
- 0xFF607D8B,
- 0xFF546E7A,
- 0xFF455A64,
- 0xFF37474F,
- 0xFF263238
+ Color.parseColor("#FFEBEE"),
+ Color.parseColor("#FFCDD2"),
+ Color.parseColor("#EF9A9A"),
+ Color.parseColor("#E57373"),
+ Color.parseColor("#EF5350"),
+ Color.parseColor("#F44336"),
+ Color.parseColor("#E53935"),
+ Color.parseColor("#D32F2F"),
+ Color.parseColor("#C62828"),
+ Color.parseColor("#B71C1C")
+ },
+ new int[]{
+ Color.parseColor("#FCE4EC"),
+ Color.parseColor("#F8BBD0"),
+ Color.parseColor("#F48FB1"),
+ Color.parseColor("#F06292"),
+ Color.parseColor("#EC407A"),
+ Color.parseColor("#E91E63"),
+ Color.parseColor("#D81B60"),
+ Color.parseColor("#C2185B"),
+ Color.parseColor("#AD1457"),
+ Color.parseColor("#880E4F")
+ },
+ new int[]{
+ Color.parseColor("#F3E5F5"),
+ Color.parseColor("#E1BEE7"),
+ Color.parseColor("#CE93D8"),
+ Color.parseColor("#BA68C8"),
+ Color.parseColor("#AB47BC"),
+ Color.parseColor("#9C27B0"),
+ Color.parseColor("#8E24AA"),
+ Color.parseColor("#7B1FA2"),
+ Color.parseColor("#6A1B9A"),
+ Color.parseColor("#4A148C")
+ },
+ new int[]{
+ Color.parseColor("#EDE7F6"),
+ Color.parseColor("#D1C4E9"),
+ Color.parseColor("#B39DDB"),
+ Color.parseColor("#9575CD"),
+ Color.parseColor("#7E57C2"),
+ Color.parseColor("#673AB7"),
+ Color.parseColor("#5E35B1"),
+ Color.parseColor("#512DA8"),
+ Color.parseColor("#4527A0"),
+ Color.parseColor("#311B92")
+ },
+ new int[]{
+ Color.parseColor("#E8EAF6"),
+ Color.parseColor("#C5CAE9"),
+ Color.parseColor("#9FA8DA"),
+ Color.parseColor("#7986CB"),
+ Color.parseColor("#5C6BC0"),
+ Color.parseColor("#3F51B5"),
+ Color.parseColor("#3949AB"),
+ Color.parseColor("#303F9F"),
+ Color.parseColor("#283593"),
+ Color.parseColor("#1A237E")
+ },
+ new int[]{
+ Color.parseColor("#E3F2FD"),
+ Color.parseColor("#BBDEFB"),
+ Color.parseColor("#90CAF9"),
+ Color.parseColor("#64B5F6"),
+ Color.parseColor("#42A5F5"),
+ Color.parseColor("#2196F3"),
+ Color.parseColor("#1E88E5"),
+ Color.parseColor("#1976D2"),
+ Color.parseColor("#1565C0"),
+ Color.parseColor("#0D47A1")
+ },
+ new int[]{
+ Color.parseColor("#E1F5FE"),
+ Color.parseColor("#B3E5FC"),
+ Color.parseColor("#81D4FA"),
+ Color.parseColor("#4FC3F7"),
+ Color.parseColor("#29B6F6"),
+ Color.parseColor("#03A9F4"),
+ Color.parseColor("#039BE5"),
+ Color.parseColor("#0288D1"),
+ Color.parseColor("#0277BD"),
+ Color.parseColor("#01579B")
+ },
+ new int[]{
+ Color.parseColor("#E0F7FA"),
+ Color.parseColor("#B2EBF2"),
+ Color.parseColor("#80DEEA"),
+ Color.parseColor("#4DD0E1"),
+ Color.parseColor("#26C6DA"),
+ Color.parseColor("#00BCD4"),
+ Color.parseColor("#00ACC1"),
+ Color.parseColor("#0097A7"),
+ Color.parseColor("#00838F"),
+ Color.parseColor("#006064")
+ },
+ new int[]{
+ Color.parseColor("#E0F2F1"),
+ Color.parseColor("#B2DFDB"),
+ Color.parseColor("#80CBC4"),
+ Color.parseColor("#4DB6AC"),
+ Color.parseColor("#26A69A"),
+ Color.parseColor("#009688"),
+ Color.parseColor("#00897B"),
+ Color.parseColor("#00796B"),
+ Color.parseColor("#00695C"),
+ Color.parseColor("#004D40")
+ },
+ new int[]{
+ Color.parseColor("#E8F5E9"),
+ Color.parseColor("#C8E6C9"),
+ Color.parseColor("#A5D6A7"),
+ Color.parseColor("#81C784"),
+ Color.parseColor("#66BB6A"),
+ Color.parseColor("#4CAF50"),
+ Color.parseColor("#43A047"),
+ Color.parseColor("#388E3C"),
+ Color.parseColor("#2E7D32"),
+ Color.parseColor("#1B5E20")
+ },
+ new int[]{
+ Color.parseColor("#F1F8E9"),
+ Color.parseColor("#DCEDC8"),
+ Color.parseColor("#C5E1A5"),
+ Color.parseColor("#AED581"),
+ Color.parseColor("#9CCC65"),
+ Color.parseColor("#8BC34A"),
+ Color.parseColor("#7CB342"),
+ Color.parseColor("#689F38"),
+ Color.parseColor("#558B2F"),
+ Color.parseColor("#33691E")
+ },
+ new int[]{
+ Color.parseColor("#F9FBE7"),
+ Color.parseColor("#F0F4C3"),
+ Color.parseColor("#E6EE9C"),
+ Color.parseColor("#DCE775"),
+ Color.parseColor("#D4E157"),
+ Color.parseColor("#CDDC39"),
+ Color.parseColor("#C0CA33"),
+ Color.parseColor("#AFB42B"),
+ Color.parseColor("#9E9D24"),
+ Color.parseColor("#827717")
+ },
+ new int[]{
+ Color.parseColor("#FFFDE7"),
+ Color.parseColor("#FFF9C4"),
+ Color.parseColor("#FFF59D"),
+ Color.parseColor("#FFF176"),
+ Color.parseColor("#FFEE58"),
+ Color.parseColor("#FFEB3B"),
+ Color.parseColor("#FDD835"),
+ Color.parseColor("#FBC02D"),
+ Color.parseColor("#F9A825"),
+ Color.parseColor("#F57F17")
+ },
+ new int[]{
+ Color.parseColor("#FFF8E1"),
+ Color.parseColor("#FFECB3"),
+ Color.parseColor("#FFE082"),
+ Color.parseColor("#FFD54F"),
+ Color.parseColor("#FFCA28"),
+ Color.parseColor("#FFC107"),
+ Color.parseColor("#FFB300"),
+ Color.parseColor("#FFA000"),
+ Color.parseColor("#FF8F00"),
+ Color.parseColor("#FF6F00")
+ },
+ new int[]{
+ Color.parseColor("#FFF3E0"),
+ Color.parseColor("#FFE0B2"),
+ Color.parseColor("#FFCC80"),
+ Color.parseColor("#FFB74D"),
+ Color.parseColor("#FFA726"),
+ Color.parseColor("#FF9800"),
+ Color.parseColor("#FB8C00"),
+ Color.parseColor("#F57C00"),
+ Color.parseColor("#EF6C00"),
+ Color.parseColor("#E65100")
+ },
+ new int[]{
+ Color.parseColor("#FBE9E7"),
+ Color.parseColor("#FFCCBC"),
+ Color.parseColor("#FFAB91"),
+ Color.parseColor("#FF8A65"),
+ Color.parseColor("#FF7043"),
+ Color.parseColor("#FF5722"),
+ Color.parseColor("#F4511E"),
+ Color.parseColor("#E64A19"),
+ Color.parseColor("#D84315"),
+ Color.parseColor("#BF360C")
+ },
+ new int[]{
+ Color.parseColor("#EFEBE9"),
+ Color.parseColor("#D7CCC8"),
+ Color.parseColor("#BCAAA4"),
+ Color.parseColor("#A1887F"),
+ Color.parseColor("#8D6E63"),
+ Color.parseColor("#795548"),
+ Color.parseColor("#6D4C41"),
+ Color.parseColor("#5D4037"),
+ Color.parseColor("#4E342E"),
+ Color.parseColor("#3E2723")
+ },
+ new int[]{
+ Color.parseColor("#FAFAFA"),
+ Color.parseColor("#F5F5F5"),
+ Color.parseColor("#EEEEEE"),
+ Color.parseColor("#E0E0E0"),
+ Color.parseColor("#BDBDBD"),
+ Color.parseColor("#9E9E9E"),
+ Color.parseColor("#757575"),
+ Color.parseColor("#616161"),
+ Color.parseColor("#424242"),
+ Color.parseColor("#212121")
+ },
+ new int[]{
+ Color.parseColor("#ECEFF1"),
+ Color.parseColor("#CFD8DC"),
+ Color.parseColor("#B0BEC5"),
+ Color.parseColor("#90A4AE"),
+ Color.parseColor("#78909C"),
+ Color.parseColor("#607D8B"),
+ Color.parseColor("#546E7A"),
+ Color.parseColor("#455A64"),
+ Color.parseColor("#37474F"),
+ Color.parseColor("#263238")
}
};
private final static int[] PRIMARY_COLORS_FREE = new int[]{
- 0xFFF44336,
-// 0xFFE91E63,
- 0xFF9C27B0,
-// 0xFF673AB7,
-// 0xFF3F51B5,
-// 0xFF2196F3,
- 0xFF03A9F4,
-// 0xFF00BCD4,
- 0xFF009688,
- 0xFF4CAF50,
-// 0xFF8BC34A,
-// 0xFFCDDC39,
-// 0xFFFFEB3B,
- 0xFFFFC107,
-// 0xFFFF9800,
-// 0xFFFF5722,
-// 0xFF795548,
- 0xFF9E9E9E,
-// 0xFF607D8B
+ Color.parseColor("#F44336"),
+ Color.parseColor("#9C27B0"),
+ Color.parseColor("#03A9F4"),
+ Color.parseColor("#009688"),
+ Color.parseColor("#4CAF50"),
+ Color.parseColor("#FFC107"),
+ Color.parseColor("#9E9E9E")
};
private final static int[][] PRIMARY_COLORS_SUB_FREE = new int[][]{
new int[]{
- 0xFFFFEBEE,
- 0xFFFFCDD2,
- 0xFFEF9A9A,
- 0xFFE57373,
- 0xFFEF5350,
- 0xFFF44336,
- 0xFFE53935,
- 0xFFD32F2F,
- 0xFFC62828,
- 0xFFB71C1C
- },
-// new int[]{
-// 0xFFFCE4EC,
-// 0xFFF8BBD0,
-// 0xFFF48FB1,
-// 0xFFF06292,
-// 0xFFEC407A,
-// 0xFFE91E63,
-// 0xFFD81B60,
-// 0xFFC2185B,
-// 0xFFAD1457,
-// 0xFF880E4F
-// },
- new int[]{
- 0xFFF3E5F5,
- 0xFFE1BEE7,
- 0xFFCE93D8,
- 0xFFBA68C8,
- 0xFFAB47BC,
- 0xFF9C27B0,
- 0xFF8E24AA,
- 0xFF7B1FA2,
- 0xFF6A1B9A,
- 0xFF4A148C
- },
-// new int[]{
-// 0xFFEDE7F6,
-// 0xFFD1C4E9,
-// 0xFFB39DDB,
-// 0xFF9575CD,
-// 0xFF7E57C2,
-// 0xFF673AB7,
-// 0xFF5E35B1,
-// 0xFF512DA8,
-// 0xFF4527A0,
-// 0xFF311B92
-// },
-// new int[]{
-// 0xFFE8EAF6,
-// 0xFFC5CAE9,
-// 0xFF9FA8DA,
-// 0xFF7986CB,
-// 0xFF5C6BC0,
-// 0xFF3F51B5,
-// 0xFF3949AB,
-// 0xFF303F9F,
-// 0xFF283593,
-// 0xFF1A237E
-// },
-// new int[]{
-// 0xFFE3F2FD,
-// 0xFFBBDEFB,
-// 0xFF90CAF9,
-// 0xFF64B5F6,
-// 0xFF42A5F5,
-// 0xFF2196F3,
-// 0xFF1E88E5,
-// 0xFF1976D2,
-// 0xFF1565C0,
-// 0xFF0D47A1
-// },
- new int[]{
- 0xFFE1F5FE,
- 0xFFB3E5FC,
- 0xFF81D4FA,
- 0xFF4FC3F7,
- 0xFF29B6F6,
- 0xFF03A9F4,
- 0xFF039BE5,
- 0xFF0288D1,
- 0xFF0277BD,
- 0xFF01579B
- },
-// new int[]{
-// 0xFFE0F7FA,
-// 0xFFB2EBF2,
-// 0xFF80DEEA,
-// 0xFF4DD0E1,
-// 0xFF26C6DA,
-// 0xFF00BCD4,
-// 0xFF00ACC1,
-// 0xFF0097A7,
-// 0xFF00838F,
-// 0xFF006064
-// },
- new int[]{
- 0xFFE0F2F1,
- 0xFFB2DFDB,
- 0xFF80CBC4,
- 0xFF4DB6AC,
- 0xFF26A69A,
- 0xFF009688,
- 0xFF00897B,
- 0xFF00796B,
- 0xFF00695C,
- 0xFF004D40
- },
- new int[]{
- 0xFFE8F5E9,
- 0xFFC8E6C9,
- 0xFFA5D6A7,
- 0xFF81C784,
- 0xFF66BB6A,
- 0xFF4CAF50,
- 0xFF43A047,
- 0xFF388E3C,
- 0xFF2E7D32,
- 0xFF1B5E20
- },
-// new int[]{
-// 0xFFF1F8E9,
-// 0xFFDCEDC8,
-// 0xFFC5E1A5,
-// 0xFFAED581,
-// 0xFF9CCC65,
-// 0xFF8BC34A,
-// 0xFF7CB342,
-// 0xFF689F38,
-// 0xFF558B2F,
-// 0xFF33691E
-// },
-// new int[]{
-// 0xFFF9FBE7,
-// 0xFFF0F4C3,
-// 0xFFE6EE9C,
-// 0xFFDCE775,
-// 0xFFD4E157,
-// 0xFFCDDC39,
-// 0xFFC0CA33,
-// 0xFFAFB42B,
-// 0xFF9E9D24,
-// 0xFF827717
-// },
-// new int[]{
-// 0xFFFFFDE7,
-// 0xFFFFF9C4,
-// 0xFFFFF59D,
-// 0xFFFFF176,
-// 0xFFFFEE58,
-// 0xFFFFEB3B,
-// 0xFFFDD835,
-// 0xFFFBC02D,
-// 0xFFF9A825,
-// 0xFFF57F17
-// },
- new int[]{
- 0xFFFFF8E1,
- 0xFFFFECB3,
- 0xFFFFE082,
- 0xFFFFD54F,
- 0xFFFFCA28,
- 0xFFFFC107,
- 0xFFFFB300,
- 0xFFFFA000,
- 0xFFFF8F00,
- 0xFFFF6F00
- },
-// new int[]{
-// 0xFFFFF3E0,
-// 0xFFFFE0B2,
-// 0xFFFFCC80,
-// 0xFFFFB74D,
-// 0xFFFFA726,
-// 0xFFFF9800,
-// 0xFFFB8C00,
-// 0xFFF57C00,
-// 0xFFEF6C00,
-// 0xFFE65100
-// },
-// new int[]{
-// 0xFFFBE9E7,
-// 0xFFFFCCBC,
-// 0xFFFFAB91,
-// 0xFFFF8A65,
-// 0xFFFF7043,
-// 0xFFFF5722,
-// 0xFFF4511E,
-// 0xFFE64A19,
-// 0xFFD84315,
-// 0xFFBF360C
-// },
-// new int[]{
-// 0xFFEFEBE9,
-// 0xFFD7CCC8,
-// 0xFFBCAAA4,
-// 0xFFA1887F,
-// 0xFF8D6E63,
-// 0xFF795548,
-// 0xFF6D4C41,
-// 0xFF5D4037,
-// 0xFF4E342E,
-// 0xFF3E2723
-// },
- new int[]{
- 0xFFFAFAFA,
- 0xFFF5F5F5,
- 0xFFEEEEEE,
- 0xFFE0E0E0,
- 0xFFBDBDBD,
- 0xFF9E9E9E,
- 0xFF757575,
- 0xFF616161,
- 0xFF424242,
- 0xFF212121
+ Color.parseColor("#FFEBEE"),
+ Color.parseColor("#FFCDD2"),
+ Color.parseColor("#EF9A9A"),
+ Color.parseColor("#E57373"),
+ Color.parseColor("#EF5350"),
+ Color.parseColor("#F44336"),
+ Color.parseColor("#E53935"),
+ Color.parseColor("#D32F2F"),
+ Color.parseColor("#C62828"),
+ Color.parseColor("#B71C1C")
+ },
+ new int[]{
+ Color.parseColor("#F3E5F5"),
+ Color.parseColor("#E1BEE7"),
+ Color.parseColor("#CE93D8"),
+ Color.parseColor("#BA68C8"),
+ Color.parseColor("#AB47BC"),
+ Color.parseColor("#9C27B0"),
+ Color.parseColor("#8E24AA"),
+ Color.parseColor("#7B1FA2"),
+ Color.parseColor("#6A1B9A"),
+ Color.parseColor("#4A148C")
+ },
+ new int[]{
+ Color.parseColor("#E1F5FE"),
+ Color.parseColor("#B3E5FC"),
+ Color.parseColor("#81D4FA"),
+ Color.parseColor("#4FC3F7"),
+ Color.parseColor("#29B6F6"),
+ Color.parseColor("#03A9F4"),
+ Color.parseColor("#039BE5"),
+ Color.parseColor("#0288D1"),
+ Color.parseColor("#0277BD"),
+ Color.parseColor("#01579B")
+ },
+ new int[]{
+ Color.parseColor("#E0F2F1"),
+ Color.parseColor("#B2DFDB"),
+ Color.parseColor("#80CBC4"),
+ Color.parseColor("#4DB6AC"),
+ Color.parseColor("#26A69A"),
+ Color.parseColor("#009688"),
+ Color.parseColor("#00897B"),
+ Color.parseColor("#00796B"),
+ Color.parseColor("#00695C"),
+ Color.parseColor("#004D40")
+ },
+ new int[]{
+ Color.parseColor("#E8F5E9"),
+ Color.parseColor("#C8E6C9"),
+ Color.parseColor("#A5D6A7"),
+ Color.parseColor("#81C784"),
+ Color.parseColor("#66BB6A"),
+ Color.parseColor("#4CAF50"),
+ Color.parseColor("#43A047"),
+ Color.parseColor("#388E3C"),
+ Color.parseColor("#2E7D32"),
+ Color.parseColor("#1B5E20")
+ },
+ new int[]{
+ Color.parseColor("#FFF8E1"),
+ Color.parseColor("#FFECB3"),
+ Color.parseColor("#FFE082"),
+ Color.parseColor("#FFD54F"),
+ Color.parseColor("#FFCA28"),
+ Color.parseColor("#FFC107"),
+ Color.parseColor("#FFB300"),
+ Color.parseColor("#FFA000"),
+ Color.parseColor("#FF8F00"),
+ Color.parseColor("#FF6F00")
+ },
+ new int[]{
+ Color.parseColor("#FAFAFA"),
+ Color.parseColor("#F5F5F5"),
+ Color.parseColor("#EEEEEE"),
+ Color.parseColor("#E0E0E0"),
+ Color.parseColor("#BDBDBD"),
+ Color.parseColor("#9E9E9E"),
+ Color.parseColor("#757575"),
+ Color.parseColor("#616161"),
+ Color.parseColor("#424242"),
+ Color.parseColor("#212121")
},
-// new int[]{
-// 0xFFECEFF1,
-// 0xFFCFD8DC,
-// 0xFFB0BEC5,
-// 0xFF90A4AE,
-// 0xFF78909C,
-// 0xFF607D8B,
-// 0xFF546E7A,
-// 0xFF455A64,
-// 0xFF37474F,
-// 0xFF263238
-// }
- };
-
- private final static int[] ACCENT_COLORS = new int[]{
- 0xFFFF1744,
- 0xFFF50057,
- 0xFFD500F9,
- 0xFF651FFF,
- 0xFF3D5AFE,
- 0xFF2979FF,
- 0xFF00B0FF,
- 0xFF00E5FF,
- 0xFF1DE9B6,
- 0xFF00E676,
- 0xFF76FF03,
- 0xFFC6FF00,
- 0xFFFFEA00,
- 0xFFFFC400,
- 0xFFFF9100,
- 0xFFFF3D00
- };
-
- private final static int[][] ACCENT_COLORS_SUB = new int[][]{
- new int[]{
- 0xFFFF8A80,
- 0xFFFF5252,
- 0xFFFF1744,
- 0xFFD50000
- },
- new int[]{
- 0xFFFF80AB,
- 0xFFFF4081,
- 0xFFF50057,
- 0xFFC51162
- },
- new int[]{
- 0xFFEA80FC,
- 0xFFE040FB,
- 0xFFD500F9,
- 0xFFAA00FF
- },
- new int[]{
- 0xFFB388FF,
- 0xFF7C4DFF,
- 0xFF651FFF,
- 0xFF6200EA
- },
- new int[]{
- 0xFF8C9EFF,
- 0xFF536DFE,
- 0xFF3D5AFE,
- 0xFF304FFE
- },
- new int[]{
- 0xFF82B1FF,
- 0xFF448AFF,
- 0xFF2979FF,
- 0xFF2962FF
- },
- new int[]{
- 0xFF80D8FF,
- 0xFF40C4FF,
- 0xFF00B0FF,
- 0xFF0091EA
- },
- new int[]{
- 0xFF84FFFF,
- 0xFF18FFFF,
- 0xFF00E5FF,
- 0xFF00B8D4
- },
- new int[]{
- 0xFFA7FFEB,
- 0xFF64FFDA,
- 0xFF1DE9B6,
- 0xFF00BFA5
- },
- new int[]{
- 0xFFB9F6CA,
- 0xFF69F0AE,
- 0xFF00E676,
- 0xFF00C853
- },
- new int[]{
- 0xFFCCFF90,
- 0xFFB2FF59,
- 0xFF76FF03,
- 0xFF64DD17
- },
- new int[]{
- 0xFFF4FF81,
- 0xFFEEFF41,
- 0xFFC6FF00,
- 0xFFAEEA00
- },
- new int[]{
- 0xFFFFFF8D,
- 0xFFFFFF00,
- 0xFFFFEA00,
- 0xFFFFD600
- },
- new int[]{
- 0xFFFFE57F,
- 0xFFFFD740,
- 0xFFFFC400,
- 0xFFFFAB00
- },
- new int[]{
- 0xFFFFD180,
- 0xFFFFAB40,
- 0xFFFF9100,
- 0xFFFF6D00
- },
- new int[]{
- 0xFFFF9E80,
- 0xFFFF6E40,
- 0xFFFF3D00,
- 0xFFDD2C00
- }
- };
-
- private final static int[] ACCENT_COLORS_FREE = new int[]{
- 0xFFFF1744,
-// 0xFFF50057,
-// 0xFFD500F9,
-// 0xFF651FFF,
- 0xFF3D5AFE,
-// 0xFF2979FF,
- 0xFF00B0FF,
-// 0xFF00E5FF,
-// 0xFF1DE9B6,
- 0xFF00E676,
-// 0xFF76FF03,
-// 0xFFC6FF00,
-// 0xFFFFEA00,
- 0xFFFFC400,
-// 0xFFFF9100,
- 0xFFFF3D00
- };
-
- private final static int[][] ACCENT_COLORS_SUB_FREE = new int[][]{
- new int[]{
- 0xFFFF8A80,
- 0xFFFF5252,
- 0xFFFF1744,
- 0xFFD50000
- },
-// new int[]{
-// 0xFFFF80AB,
-// 0xFFFF4081,
-// 0xFFF50057,
-// 0xFFC51162
-// },
-// new int[]{
-// 0xFFEA80FC,
-// 0xFFE040FB,
-// 0xFFD500F9,
-// 0xFFAA00FF
-// },
-// new int[]{
-// 0xFFB388FF,
-// 0xFF7C4DFF,
-// 0xFF651FFF,
-// 0xFF6200EA
-// },
- new int[]{
- 0xFF8C9EFF,
- 0xFF536DFE,
- 0xFF3D5AFE,
- 0xFF304FFE
- },
-// new int[]{
-// 0xFF82B1FF,
-// 0xFF448AFF,
-// 0xFF2979FF,
-// 0xFF2962FF
-// },
- new int[]{
- 0xFF80D8FF,
- 0xFF40C4FF,
- 0xFF00B0FF,
- 0xFF0091EA
- },
-// new int[]{
-// 0xFF84FFFF,
-// 0xFF18FFFF,
-// 0xFF00E5FF,
-// 0xFF00B8D4
-// },
-// new int[]{
-// 0xFFA7FFEB,
-// 0xFF64FFDA,
-// 0xFF1DE9B6,
-// 0xFF00BFA5
-// },
- new int[]{
- 0xFFB9F6CA,
- 0xFF69F0AE,
- 0xFF00E676,
- 0xFF00C853
- },
-// new int[]{
-// 0xFFCCFF90,
-// 0xFFB2FF59,
-// 0xFF76FF03,
-// 0xFF64DD17
-// },
-// new int[]{
-// 0xFFF4FF81,
-// 0xFFEEFF41,
-// 0xFFC6FF00,
-// 0xFFAEEA00
-// },
-// new int[]{
-// 0xFFFFFF8D,
-// 0xFFFFFF00,
-// 0xFFFFEA00,
-// 0xFFFFD600
-// },
- new int[]{
- 0xFFFFE57F,
- 0xFFFFD740,
- 0xFFFFC400,
- 0xFFFFAB00
- },
-// new int[]{
-// 0xFFFFD180,
-// 0xFFFFAB40,
-// 0xFFFF9100,
-// 0xFFFF6D00
-// },
- new int[]{
- 0xFFFF9E80,
- 0xFFFF6E40,
- 0xFFFF3D00,
- 0xFFDD2C00
- }
};
}
\ No newline at end of file
diff --git a/app/src/main/java/com/simplecity/amp_library/utils/FileHelper.java b/app/src/main/java/com/simplecity/amp_library/utils/FileHelper.java
index 5adf96941..1d09ae186 100644
--- a/app/src/main/java/com/simplecity/amp_library/utils/FileHelper.java
+++ b/app/src/main/java/com/simplecity/amp_library/utils/FileHelper.java
@@ -8,7 +8,6 @@
import android.support.annotation.WorkerThread;
import android.text.TextUtils;
-import com.annimon.stream.Optional;
import com.annimon.stream.Stream;
import com.simplecity.amp_library.model.BaseFileObject;
import com.simplecity.amp_library.model.FileObject;
@@ -21,6 +20,7 @@
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
+import java.util.NoSuchElementException;
import io.reactivex.Observable;
import io.reactivex.Single;
@@ -230,11 +230,17 @@ public static Single> getSongList(final File file, final boolean recu
/**
* Gets the song for a given file
*/
- public static Single> getSong(File file) {
+ public static Single getSong(File file) {
return DataManager.getInstance()
.getSongsObservable(song -> song.path.contains(FileHelper.getPath(file)))
- .first(Collections.emptyList())
- .map(songs -> Stream.of(songs).findFirst())
+ .firstOrError()
+ .flatMap(songs -> {
+ try {
+ return Single.just(Stream.of(songs).findFirst().get());
+ } catch (NoSuchElementException e) {
+ return Single.error(e);
+ }
+ })
.subscribeOn(Schedulers.io());
}
diff --git a/app/src/main/java/com/simplecity/amp_library/utils/MenuUtils.java b/app/src/main/java/com/simplecity/amp_library/utils/MenuUtils.java
index b9f7e4459..79927a479 100644
--- a/app/src/main/java/com/simplecity/amp_library/utils/MenuUtils.java
+++ b/app/src/main/java/com/simplecity/amp_library/utils/MenuUtils.java
@@ -13,7 +13,6 @@
import android.widget.Toast;
import com.afollestad.materialdialogs.MaterialDialog;
-import com.annimon.stream.Optional;
import com.annimon.stream.Stream;
import com.simplecity.amp_library.R;
import com.simplecity.amp_library.interfaces.FileType;
@@ -305,7 +304,7 @@ public static Toolbar.OnMenuItemClickListener getAlbumMenuClickListener(Context
};
}
- public static PopupMenu.OnMenuItemClickListener getAlbumMenuClickListener(Context context, Album album, UnsafeConsumer tagEditorCallback) {
+ public static PopupMenu.OnMenuItemClickListener getAlbumMenuClickListener(Context context, Album album, UnsafeConsumer tagEditorCallback, UnsafeAction showUpgradeDialog) {
return item -> {
switch (item.getItemId()) {
case R.id.play:
@@ -321,7 +320,11 @@ public static PopupMenu.OnMenuItemClickListener getAlbumMenuClickListener(Contex
addToQueue(context, getSongsForAlbum(album));
return true;
case R.id.editTags:
- tagEditorCallback.accept(editTags(album));
+ if (!ShuttleUtils.isUpgraded()) {
+ showUpgradeDialog.run();
+ } else {
+ tagEditorCallback.accept(editTags(album));
+ }
return true;
case R.id.info:
showAlbumInfo(context, album);
@@ -412,7 +415,7 @@ public static Toolbar.OnMenuItemClickListener getAlbumArtistMenuClickListener(Co
};
}
- public static PopupMenu.OnMenuItemClickListener getAlbumArtistClickListener(Context context, AlbumArtist albumArtist, UnsafeConsumer tagEditorCallback) {
+ public static PopupMenu.OnMenuItemClickListener getAlbumArtistClickListener(Context context, AlbumArtist albumArtist, UnsafeConsumer tagEditorCallback, UnsafeAction showUpgradeDialog) {
return item -> {
switch (item.getItemId()) {
case R.id.play:
@@ -431,7 +434,11 @@ public static PopupMenu.OnMenuItemClickListener getAlbumArtistClickListener(Cont
addToQueue(context, getSongsForAlbumArtist(albumArtist));
return true;
case R.id.editTags:
- tagEditorCallback.accept(editTags(albumArtist));
+ if (!ShuttleUtils.isUpgraded()) {
+ showUpgradeDialog.run();
+ } else {
+ tagEditorCallback.accept(editTags(albumArtist));
+ }
return true;
case R.id.info:
showArtistInfo(context, albumArtist);
@@ -592,7 +599,6 @@ public static PopupMenu.OnMenuItemClickListener getGenreClickListener(final Cont
static Single getSongForFile(FileObject fileObject) {
return FileHelper.getSong(new File(fileObject.path))
- .map(Optional::get)
.observeOn(AndroidSchedulers.mainThread());
}
@@ -733,7 +739,9 @@ private static PopupMenu.OnMenuItemClickListener getFileMenuClickListener(Contex
scanFile(context, fileObject);
return true;
case R.id.editTags:
- getSongForFile(fileObject).subscribe(song -> tagEditorCallback.accept(editTags(song)), errorHandler);
+ getSongForFile(fileObject).subscribe(song -> {
+ tagEditorCallback.accept(editTags(song));
+ }, errorHandler);
return true;
case R.id.share:
getSongForFile(fileObject).subscribe(song -> song.share(context), errorHandler);
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index dc80a9cef..70e9c1fda 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -104,12 +104,12 @@
You have successfully upgraded to Shuttle+. I appreciate the support.
\n\nPlease restart the app to ensure all features are enabled
- Upgrading will unlock additional features in Shuttle, including:
- \n\n• Tons of extra themes
+
+ • ChromeCast support
+ \n• Extra themes
\n• Tag editing
\n• Folder browsing
- \n• ChromeCast Support
- \n\nIt also helps to promote further development.\n\nYou do not need to upgrade if you already have Shuttle+
+ \n• Support development ❤️
Upgrade to Shuttle+
diff --git a/dependencies.gradle b/dependencies.gradle
index 20a6b5ef2..cc11a030b 100644
--- a/dependencies.gradle
+++ b/dependencies.gradle
@@ -4,7 +4,7 @@ ext.versions = [
// App versions
// /////////////////////////////////////////////////////////////////////////
- name : "2.0.0-beta20",
+ name : "2.0.0-beta21",
// //////////////////////////////////////////////////////////////////////////
// Compile versions