Fix things broken
This commit is contained in:
commit
38e2dfdfb9
28 changed files with 240 additions and 107 deletions
|
@ -23,7 +23,6 @@ static def gitBranch() {
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion 28
|
compileSdkVersion 28
|
||||||
buildToolsVersion '29.0.0 rc2'
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
minSdkVersion 21
|
minSdkVersion 21
|
||||||
targetSdkVersion 28
|
targetSdkVersion 28
|
||||||
|
@ -120,14 +119,14 @@ static def getDate() {
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
||||||
implementation 'androidx.multidex:multidex:2.0.1'
|
implementation 'androidx.multidex:multidex:2.0.1'
|
||||||
implementation 'androidx.fragment:fragment:1.1.0-alpha06'
|
implementation 'androidx.fragment:fragment:1.1.0-alpha08'
|
||||||
implementation 'androidx.appcompat:appcompat:1.1.0-alpha04'
|
implementation 'androidx.appcompat:appcompat:1.1.0-alpha05'
|
||||||
implementation 'androidx.recyclerview:recyclerview:1.1.0-alpha04'
|
implementation 'androidx.recyclerview:recyclerview:1.1.0-alpha04'
|
||||||
implementation "androidx.gridlayout:gridlayout:1.0.0"
|
implementation "androidx.gridlayout:gridlayout:1.0.0"
|
||||||
implementation "androidx.cardview:cardview:1.0.0"
|
implementation "androidx.cardview:cardview:1.0.0"
|
||||||
implementation "androidx.palette:palette:1.0.0"
|
implementation "androidx.palette:palette:1.0.0"
|
||||||
implementation 'androidx.annotation:annotation:1.1.0-beta01'
|
implementation 'androidx.annotation:annotation:1.1.0-beta01'
|
||||||
implementation 'androidx.preference:preference:1.1.0-alpha04'
|
implementation 'androidx.preference:preference:1.1.0-alpha05'
|
||||||
implementation "androidx.legacy:legacy-support-v13:1.0.0"
|
implementation "androidx.legacy:legacy-support-v13:1.0.0"
|
||||||
implementation "androidx.legacy:legacy-preference-v14:1.0.0"
|
implementation "androidx.legacy:legacy-preference-v14:1.0.0"
|
||||||
implementation 'com.google.android.material:material:1.1.0-alpha05'
|
implementation 'com.google.android.material:material:1.1.0-alpha05'
|
||||||
|
@ -135,10 +134,10 @@ dependencies {
|
||||||
implementation 'com.squareup.retrofit2:retrofit:2.5.0'
|
implementation 'com.squareup.retrofit2:retrofit:2.5.0'
|
||||||
implementation 'com.squareup.retrofit2:converter-gson:2.5.0'
|
implementation 'com.squareup.retrofit2:converter-gson:2.5.0'
|
||||||
implementation 'com.squareup.retrofit2:adapter-rxjava2:2.5.0'
|
implementation 'com.squareup.retrofit2:adapter-rxjava2:2.5.0'
|
||||||
implementation "com.afollestad.material-dialogs:core:$materialDialog"
|
implementation 'com.afollestad.material-dialogs:core:3.0.0-alpha1'
|
||||||
implementation "com.afollestad.material-dialogs:core:$materialDialog"
|
implementation 'com.afollestad.material-dialogs:input:3.0.0-alpha1'
|
||||||
implementation 'com.afollestad.material-dialogs:input:2.0.0'
|
implementation 'com.afollestad.material-dialogs:color:3.0.0-alpha1'
|
||||||
implementation 'com.afollestad.material-dialogs:color:2.0.0'
|
implementation 'com.afollestad.material-dialogs:bottomsheets:3.0.0-alpha1'
|
||||||
implementation 'com.afollestad:material-cab:0.1.12'
|
implementation 'com.afollestad:material-cab:0.1.12'
|
||||||
implementation 'com.github.bumptech.glide:glide:4.8.0'
|
implementation 'com.github.bumptech.glide:glide:4.8.0'
|
||||||
kapt 'com.github.bumptech.glide:compiler:4.8.0'
|
kapt 'com.github.bumptech.glide:compiler:4.8.0'
|
||||||
|
|
|
@ -20,6 +20,7 @@ import code.name.monkey.retromusic.fragments.player.adaptive.AdaptiveFragment
|
||||||
import code.name.monkey.retromusic.fragments.player.blur.BlurPlayerFragment
|
import code.name.monkey.retromusic.fragments.player.blur.BlurPlayerFragment
|
||||||
import code.name.monkey.retromusic.fragments.player.card.CardFragment
|
import code.name.monkey.retromusic.fragments.player.card.CardFragment
|
||||||
import code.name.monkey.retromusic.fragments.player.cardblur.CardBlurFragment
|
import code.name.monkey.retromusic.fragments.player.cardblur.CardBlurFragment
|
||||||
|
import code.name.monkey.retromusic.fragments.player.classic.ClassicPlayerFragment
|
||||||
import code.name.monkey.retromusic.fragments.player.color.ColorFragment
|
import code.name.monkey.retromusic.fragments.player.color.ColorFragment
|
||||||
import code.name.monkey.retromusic.fragments.player.fit.FitFragment
|
import code.name.monkey.retromusic.fragments.player.fit.FitFragment
|
||||||
import code.name.monkey.retromusic.fragments.player.flat.FlatPlayerFragment
|
import code.name.monkey.retromusic.fragments.player.flat.FlatPlayerFragment
|
||||||
|
@ -28,6 +29,7 @@ import code.name.monkey.retromusic.fragments.player.material.MaterialFragment
|
||||||
import code.name.monkey.retromusic.fragments.player.normal.PlayerFragment
|
import code.name.monkey.retromusic.fragments.player.normal.PlayerFragment
|
||||||
import code.name.monkey.retromusic.fragments.player.plain.PlainPlayerFragment
|
import code.name.monkey.retromusic.fragments.player.plain.PlainPlayerFragment
|
||||||
import code.name.monkey.retromusic.fragments.player.simple.SimplePlayerFragment
|
import code.name.monkey.retromusic.fragments.player.simple.SimplePlayerFragment
|
||||||
|
import code.name.monkey.retromusic.fragments.player.slide.SlidePlayerFragment
|
||||||
import code.name.monkey.retromusic.fragments.player.tiny.TinyPlayerFragment
|
import code.name.monkey.retromusic.fragments.player.tiny.TinyPlayerFragment
|
||||||
import code.name.monkey.retromusic.util.PreferenceUtil
|
import code.name.monkey.retromusic.util.PreferenceUtil
|
||||||
import code.name.monkey.retromusic.views.BottomNavigationBarTinted
|
import code.name.monkey.retromusic.views.BottomNavigationBarTinted
|
||||||
|
@ -194,7 +196,7 @@ abstract class AbsSlidingMusicPanelActivity : AbsMusicServiceActivity(), Sliding
|
||||||
MATERIAL -> MaterialFragment()
|
MATERIAL -> MaterialFragment()
|
||||||
COLOR -> ColorFragment()
|
COLOR -> ColorFragment()
|
||||||
TINY -> TinyPlayerFragment()
|
TINY -> TinyPlayerFragment()
|
||||||
//SLIDE -> SlidePlayerFragment()
|
CLASSIC -> ClassicPlayerFragment()
|
||||||
else -> PlayerFragment()
|
else -> PlayerFragment()
|
||||||
} // must implement AbsPlayerFragment
|
} // must implement AbsPlayerFragment
|
||||||
supportFragmentManager.beginTransaction().replace(R.id.playerFragmentContainer, fragment).commit()
|
supportFragmentManager.beginTransaction().replace(R.id.playerFragmentContainer, fragment).commit()
|
||||||
|
|
|
@ -7,6 +7,7 @@ import android.graphics.Bitmap;
|
||||||
import android.media.MediaScannerConnection;
|
import android.media.MediaScannerConnection;
|
||||||
|
|
||||||
import com.afollestad.materialdialogs.MaterialDialog;
|
import com.afollestad.materialdialogs.MaterialDialog;
|
||||||
|
import com.afollestad.materialdialogs.bottomsheets.BottomSheet;
|
||||||
|
|
||||||
import org.jaudiotagger.audio.AudioFile;
|
import org.jaudiotagger.audio.AudioFile;
|
||||||
import org.jaudiotagger.audio.AudioFileIO;
|
import org.jaudiotagger.audio.AudioFileIO;
|
||||||
|
@ -134,7 +135,7 @@ public class WriteTagsAsyncTask extends
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Dialog createDialog(@NonNull Context context) {
|
protected Dialog createDialog(@NonNull Context context) {
|
||||||
return new MaterialDialog(context)
|
return new MaterialDialog(context, new BottomSheet())
|
||||||
.title(R.string.saving_changes, "")
|
.title(R.string.saving_changes, "")
|
||||||
.cancelable(false);
|
.cancelable(false);
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,13 +10,14 @@ import android.widget.ImageView
|
||||||
import androidx.fragment.app.Fragment
|
import androidx.fragment.app.Fragment
|
||||||
import androidx.fragment.app.FragmentManager
|
import androidx.fragment.app.FragmentManager
|
||||||
import code.name.monkey.retromusic.R
|
import code.name.monkey.retromusic.R
|
||||||
|
import code.name.monkey.retromusic.activities.LyricsActivity
|
||||||
|
import code.name.monkey.retromusic.fragments.AlbumCoverStyle
|
||||||
|
import code.name.monkey.retromusic.fragments.NowPlayingScreen
|
||||||
import code.name.monkey.retromusic.glide.GlideApp
|
import code.name.monkey.retromusic.glide.GlideApp
|
||||||
import code.name.monkey.retromusic.glide.RetroGlideExtension
|
import code.name.monkey.retromusic.glide.RetroGlideExtension
|
||||||
import code.name.monkey.retromusic.glide.RetroMusicColoredTarget
|
import code.name.monkey.retromusic.glide.RetroMusicColoredTarget
|
||||||
import code.name.monkey.retromusic.misc.CustomFragmentStatePagerAdapter
|
import code.name.monkey.retromusic.misc.CustomFragmentStatePagerAdapter
|
||||||
import code.name.monkey.retromusic.model.Song
|
import code.name.monkey.retromusic.model.Song
|
||||||
import code.name.monkey.retromusic.activities.LyricsActivity
|
|
||||||
import code.name.monkey.retromusic.fragments.AlbumCoverStyle
|
|
||||||
import code.name.monkey.retromusic.util.PreferenceUtil
|
import code.name.monkey.retromusic.util.PreferenceUtil
|
||||||
import java.util.*
|
import java.util.*
|
||||||
|
|
||||||
|
@ -90,8 +91,11 @@ class AlbumCoverPagerAdapter(fm: FragmentManager, private val dataSet: ArrayList
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
|
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
|
||||||
val layout = layout
|
var finalLayout = layout
|
||||||
val view = inflater.inflate(layout, container, false)
|
if (PreferenceUtil.getInstance().nowPlayingScreen == NowPlayingScreen.CLASSIC) {
|
||||||
|
finalLayout = R.layout.fragment_album_full_cover
|
||||||
|
}
|
||||||
|
val view = inflater.inflate(finalLayout, container, false)
|
||||||
albumCover = view.findViewById(R.id.player_image)
|
albumCover = view.findViewById(R.id.player_image)
|
||||||
albumCover.setOnClickListener { startActivity(Intent(context, LyricsActivity::class.java)) }
|
albumCover.setOnClickListener { startActivity(Intent(context, LyricsActivity::class.java)) }
|
||||||
return view
|
return view
|
||||||
|
|
|
@ -22,6 +22,7 @@ enum class NowPlayingScreen constructor(@param:StringRes @field:StringRes
|
||||||
PLAIN(R.string.plain, R.drawable.np_plain, 3),
|
PLAIN(R.string.plain, R.drawable.np_plain, 3),
|
||||||
TINY(R.string.tiny, R.drawable.np_tiny, 7),
|
TINY(R.string.tiny, R.drawable.np_tiny, 7),
|
||||||
SIMPLE(R.string.simple, R.drawable.np_simple, 8),
|
SIMPLE(R.string.simple, R.drawable.np_simple, 8),
|
||||||
|
CLASSIC(R.string.classic, R.drawable.np_normal, 13);
|
||||||
//SLIDE(R.string.slide, R.drawable.np_slide, 13)
|
//SLIDE(R.string.slide, R.drawable.np_slide, 13)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,6 @@ import android.view.SubMenu;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.TextView;
|
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
|
@ -37,11 +36,11 @@ import code.name.monkey.appthemehelper.util.TintHelper;
|
||||||
import code.name.monkey.appthemehelper.util.ToolbarContentTintHelper;
|
import code.name.monkey.appthemehelper.util.ToolbarContentTintHelper;
|
||||||
import code.name.monkey.retromusic.R;
|
import code.name.monkey.retromusic.R;
|
||||||
import code.name.monkey.retromusic.dialogs.CreatePlaylistDialog;
|
import code.name.monkey.retromusic.dialogs.CreatePlaylistDialog;
|
||||||
|
import code.name.monkey.retromusic.fragments.base.AbsLibraryPagerRecyclerViewCustomGridSizeFragment;
|
||||||
|
import code.name.monkey.retromusic.fragments.base.AbsMainActivityFragment;
|
||||||
import code.name.monkey.retromusic.helper.SortOrder;
|
import code.name.monkey.retromusic.helper.SortOrder;
|
||||||
import code.name.monkey.retromusic.interfaces.CabHolder;
|
import code.name.monkey.retromusic.interfaces.CabHolder;
|
||||||
import code.name.monkey.retromusic.interfaces.MainActivityFragmentCallbacks;
|
import code.name.monkey.retromusic.interfaces.MainActivityFragmentCallbacks;
|
||||||
import code.name.monkey.retromusic.fragments.base.AbsLibraryPagerRecyclerViewCustomGridSizeFragment;
|
|
||||||
import code.name.monkey.retromusic.fragments.base.AbsMainActivityFragment;
|
|
||||||
import code.name.monkey.retromusic.util.Compressor;
|
import code.name.monkey.retromusic.util.Compressor;
|
||||||
import code.name.monkey.retromusic.util.PreferenceUtil;
|
import code.name.monkey.retromusic.util.PreferenceUtil;
|
||||||
import code.name.monkey.retromusic.util.RetroColorUtil;
|
import code.name.monkey.retromusic.util.RetroColorUtil;
|
||||||
|
@ -59,7 +58,6 @@ public class LibraryFragment extends AbsMainActivityFragment implements CabHolde
|
||||||
|
|
||||||
private Toolbar toolbar;
|
private Toolbar toolbar;
|
||||||
private AppBarLayout appBarLayout;
|
private AppBarLayout appBarLayout;
|
||||||
private TextView bannerTitle;
|
|
||||||
private View contentContainer;
|
private View contentContainer;
|
||||||
|
|
||||||
private MaterialCab cab;
|
private MaterialCab cab;
|
||||||
|
@ -94,7 +92,6 @@ public class LibraryFragment extends AbsMainActivityFragment implements CabHolde
|
||||||
View view = inflater.inflate(R.layout.fragment_library, container, false);
|
View view = inflater.inflate(R.layout.fragment_library, container, false);
|
||||||
disposable = new CompositeDisposable();
|
disposable = new CompositeDisposable();
|
||||||
contentContainer = view.findViewById(R.id.fragmentContainer);
|
contentContainer = view.findViewById(R.id.fragmentContainer);
|
||||||
bannerTitle = view.findViewById(R.id.bannerTitle);
|
|
||||||
appBarLayout = view.findViewById(R.id.appBarLayout);
|
appBarLayout = view.findViewById(R.id.appBarLayout);
|
||||||
toolbar = view.findViewById(R.id.toolbar);
|
toolbar = view.findViewById(R.id.toolbar);
|
||||||
userImage = view.findViewById(R.id.userImage);
|
userImage = view.findViewById(R.id.userImage);
|
||||||
|
@ -118,14 +115,14 @@ public class LibraryFragment extends AbsMainActivityFragment implements CabHolde
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setTitle(@StringRes int name) {
|
public void setTitle(@StringRes int name) {
|
||||||
bannerTitle.setText(getString(name));
|
toolbar.setTitle(getString(name));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addOnAppBarOffsetChangedListener(AppBarLayout.OnOffsetChangedListener onOffsetChangedListener) {
|
public void addOnAppBarOffsetChangedListener(@NonNull AppBarLayout.OnOffsetChangedListener onOffsetChangedListener) {
|
||||||
appBarLayout.addOnOffsetChangedListener(onOffsetChangedListener);
|
appBarLayout.addOnOffsetChangedListener(onOffsetChangedListener);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void removeOnAppBarOffsetChangedListener(AppBarLayout.OnOffsetChangedListener onOffsetChangedListener) {
|
public void removeOnAppBarOffsetChangedListener(@NonNull AppBarLayout.OnOffsetChangedListener onOffsetChangedListener) {
|
||||||
appBarLayout.removeOnOffsetChangedListener(onOffsetChangedListener);
|
appBarLayout.removeOnOffsetChangedListener(onOffsetChangedListener);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -166,18 +163,19 @@ public class LibraryFragment extends AbsMainActivityFragment implements CabHolde
|
||||||
|
|
||||||
@SuppressWarnings("ConstantConditions")
|
@SuppressWarnings("ConstantConditions")
|
||||||
private void setupToolbar() {
|
private void setupToolbar() {
|
||||||
bannerTitle.setTextColor(ThemeStore.Companion.textColorPrimary(getContext()));
|
|
||||||
|
|
||||||
int primaryColor = ThemeStore.Companion.primaryColor(getContext());
|
int primaryColor = ThemeStore.Companion.primaryColor(getContext());
|
||||||
TintHelper.setTintAuto(contentContainer, primaryColor, true);
|
TintHelper.setTintAuto(contentContainer, primaryColor, true);
|
||||||
|
|
||||||
toolbar.setBackgroundColor(primaryColor);
|
toolbar.setBackgroundColor(primaryColor);
|
||||||
toolbar.setNavigationIcon(R.drawable.ic_search_white_24dp);
|
|
||||||
|
toolbar.setNavigationIcon(null);
|
||||||
appBarLayout.setBackgroundColor(primaryColor);
|
appBarLayout.setBackgroundColor(primaryColor);
|
||||||
appBarLayout.addOnOffsetChangedListener((appBarLayout, verticalOffset) ->
|
appBarLayout.addOnOffsetChangedListener((appBarLayout, verticalOffset) ->
|
||||||
getMainActivity().setLightStatusbar(!ATHUtil.INSTANCE.isWindowBackgroundDark(getContext())));
|
getMainActivity().setLightStatusbar(!ATHUtil.INSTANCE.isWindowBackgroundDark(getContext())));
|
||||||
getMainActivity().setTitle(null);
|
getMainActivity().setTitle(null);
|
||||||
getMainActivity().setSupportActionBar(toolbar);
|
getMainActivity().setSupportActionBar(toolbar);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private Fragment getCurrentFragment() {
|
private Fragment getCurrentFragment() {
|
||||||
|
|
|
@ -20,6 +20,7 @@ import android.widget.Toast;
|
||||||
|
|
||||||
import com.afollestad.materialcab.MaterialCab;
|
import com.afollestad.materialcab.MaterialCab;
|
||||||
import com.afollestad.materialdialogs.MaterialDialog;
|
import com.afollestad.materialdialogs.MaterialDialog;
|
||||||
|
import com.afollestad.materialdialogs.bottomsheets.BottomSheet;
|
||||||
import com.google.android.material.appbar.AppBarLayout;
|
import com.google.android.material.appbar.AppBarLayout;
|
||||||
import com.google.android.material.snackbar.Snackbar;
|
import com.google.android.material.snackbar.Snackbar;
|
||||||
import com.simplecityapps.recyclerview_fastscroll.views.FastScrollRecyclerView;
|
import com.simplecityapps.recyclerview_fastscroll.views.FastScrollRecyclerView;
|
||||||
|
@ -48,8 +49,9 @@ import code.name.monkey.appthemehelper.util.ATHUtil;
|
||||||
import code.name.monkey.appthemehelper.util.ColorUtil;
|
import code.name.monkey.appthemehelper.util.ColorUtil;
|
||||||
import code.name.monkey.appthemehelper.util.TintHelper;
|
import code.name.monkey.appthemehelper.util.TintHelper;
|
||||||
import code.name.monkey.appthemehelper.util.ToolbarContentTintHelper;
|
import code.name.monkey.appthemehelper.util.ToolbarContentTintHelper;
|
||||||
|
|
||||||
import code.name.monkey.retromusic.R;
|
import code.name.monkey.retromusic.R;
|
||||||
|
import code.name.monkey.retromusic.adapter.SongFileAdapter;
|
||||||
|
import code.name.monkey.retromusic.fragments.base.AbsMainActivityFragment;
|
||||||
import code.name.monkey.retromusic.helper.MusicPlayerRemote;
|
import code.name.monkey.retromusic.helper.MusicPlayerRemote;
|
||||||
import code.name.monkey.retromusic.helper.menu.SongMenuHelper;
|
import code.name.monkey.retromusic.helper.menu.SongMenuHelper;
|
||||||
import code.name.monkey.retromusic.helper.menu.SongsMenuHelper;
|
import code.name.monkey.retromusic.helper.menu.SongsMenuHelper;
|
||||||
|
@ -60,8 +62,6 @@ import code.name.monkey.retromusic.misc.DialogAsyncTask;
|
||||||
import code.name.monkey.retromusic.misc.UpdateToastMediaScannerCompletionListener;
|
import code.name.monkey.retromusic.misc.UpdateToastMediaScannerCompletionListener;
|
||||||
import code.name.monkey.retromusic.misc.WrappedAsyncTaskLoader;
|
import code.name.monkey.retromusic.misc.WrappedAsyncTaskLoader;
|
||||||
import code.name.monkey.retromusic.model.Song;
|
import code.name.monkey.retromusic.model.Song;
|
||||||
import code.name.monkey.retromusic.adapter.SongFileAdapter;
|
|
||||||
import code.name.monkey.retromusic.fragments.base.AbsMainActivityFragment;
|
|
||||||
import code.name.monkey.retromusic.util.FileUtil;
|
import code.name.monkey.retromusic.util.FileUtil;
|
||||||
import code.name.monkey.retromusic.util.PreferenceUtil;
|
import code.name.monkey.retromusic.util.PreferenceUtil;
|
||||||
import code.name.monkey.retromusic.util.RetroColorUtil;
|
import code.name.monkey.retromusic.util.RetroColorUtil;
|
||||||
|
@ -245,7 +245,8 @@ public class FoldersFragment extends AbsMainActivityFragment implements
|
||||||
});
|
});
|
||||||
|
|
||||||
breadCrumbs.setActivatedContentColor(ToolbarContentTintHelper.toolbarTitleColor(getActivity(), ColorUtil.INSTANCE.darkenColor(primaryColor)));
|
breadCrumbs.setActivatedContentColor(ToolbarContentTintHelper.toolbarTitleColor(getActivity(), ColorUtil.INSTANCE.darkenColor(primaryColor)));
|
||||||
breadCrumbs.setDeactivatedContentColor(ToolbarContentTintHelper.toolbarSubtitleColor(getActivity(), ColorUtil.INSTANCE.darkenColor(primaryColor)));
|
breadCrumbs.setDeactivatedContentColor(ToolbarContentTintHelper.toolbarSubtitleColor(getActivity(),
|
||||||
|
ColorUtil.INSTANCE.darkenColor(primaryColor)));
|
||||||
appBarLayout.addOnOffsetChangedListener((appBarLayout, verticalOffset) -> getMainActivity().setLightStatusbar(!ATHUtil.INSTANCE.isWindowBackgroundDark(getContext())));
|
appBarLayout.addOnOffsetChangedListener((appBarLayout, verticalOffset) -> getMainActivity().setLightStatusbar(!ATHUtil.INSTANCE.isWindowBackgroundDark(getContext())));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -347,7 +348,8 @@ public class FoldersFragment extends AbsMainActivityFragment implements
|
||||||
BreadCrumbLayout.Crumb crumb = getActiveCrumb();
|
BreadCrumbLayout.Crumb crumb = getActiveCrumb();
|
||||||
if (crumb != null) {
|
if (crumb != null) {
|
||||||
//noinspection Convert2MethodRef
|
//noinspection Convert2MethodRef
|
||||||
new ListPathsAsyncTask(getActivity(), paths -> scanPaths(paths)).execute(new ListPathsAsyncTask.LoadingInfo(crumb.getFile(), AUDIO_FILE_FILTER));
|
new ListPathsAsyncTask(getActivity(), paths -> scanPaths(paths)).execute(new ListPathsAsyncTask.LoadingInfo(crumb.getFile(),
|
||||||
|
AUDIO_FILE_FILTER));
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -454,7 +456,9 @@ public class FoldersFragment extends AbsMainActivityFragment implements
|
||||||
case R.id.action_details:
|
case R.id.action_details:
|
||||||
case R.id.action_set_as_ringtone:
|
case R.id.action_set_as_ringtone:
|
||||||
case R.id.action_delete_from_device:
|
case R.id.action_delete_from_device:
|
||||||
new ListSongsAsyncTask(getActivity(), null, (songs, extra) -> SongMenuHelper.INSTANCE.handleMenuClick(getActivity(), songs.get(0), itemId)).execute(new ListSongsAsyncTask.LoadingInfo(toList(file), AUDIO_FILE_FILTER, getFileComparator()));
|
new ListSongsAsyncTask(getActivity(), null, (songs, extra) -> SongMenuHelper.INSTANCE.handleMenuClick(getActivity(),
|
||||||
|
songs.get(0), itemId)).execute(new ListSongsAsyncTask.LoadingInfo(toList(file), AUDIO_FILE_FILTER,
|
||||||
|
getFileComparator()));
|
||||||
return true;
|
return true;
|
||||||
case R.id.action_scan:
|
case R.id.action_scan:
|
||||||
new ListPathsAsyncTask(getActivity(), this::scanPaths).execute(new ListPathsAsyncTask.LoadingInfo(file, AUDIO_FILE_FILTER));
|
new ListPathsAsyncTask(getActivity(), this::scanPaths).execute(new ListPathsAsyncTask.LoadingInfo(file, AUDIO_FILE_FILTER));
|
||||||
|
@ -739,13 +743,13 @@ public class FoldersFragment extends AbsMainActivityFragment implements
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Dialog createDialog(@NonNull Context context) {
|
protected Dialog createDialog(@NonNull Context context) {
|
||||||
View view= LayoutInflater.from(context).inflate(R.layout.progress_bar,null);
|
View view = LayoutInflater.from(context).inflate(R.layout.progress_bar, null);
|
||||||
ProgressBar progressBar= view.findViewById(R.id.progressBar);
|
ProgressBar progressBar = view.findViewById(R.id.progressBar);
|
||||||
ViewUtil.INSTANCE.setProgressDrawable(progressBar,ThemeStore.Companion.accentColor(context));
|
ViewUtil.INSTANCE.setProgressDrawable(progressBar, ThemeStore.Companion.accentColor(context));
|
||||||
|
|
||||||
MaterialDialog materialDialog= new MaterialDialog(context);
|
MaterialDialog materialDialog = new MaterialDialog(context, new BottomSheet());
|
||||||
materialDialog.setContentView(R.layout.progress_bar);
|
materialDialog.setContentView(view);
|
||||||
materialDialog.title(R.string.listing_files,"");
|
materialDialog.title(R.string.listing_files, "");
|
||||||
return materialDialog;
|
return materialDialog;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,7 +30,6 @@ class ClassicPlayerPlaybackControlsFragment : AbsPlayerControlsFragment() {
|
||||||
playerPlayPauseFab.animate()
|
playerPlayPauseFab.animate()
|
||||||
.scaleX(1f)
|
.scaleX(1f)
|
||||||
.scaleY(1f)
|
.scaleY(1f)
|
||||||
.rotation(360f)
|
|
||||||
.setInterpolator(DecelerateInterpolator())
|
.setInterpolator(DecelerateInterpolator())
|
||||||
.start()
|
.start()
|
||||||
}
|
}
|
||||||
|
@ -50,19 +49,19 @@ class ClassicPlayerPlaybackControlsFragment : AbsPlayerControlsFragment() {
|
||||||
|
|
||||||
fun setDark(dark: Boolean) {
|
fun setDark(dark: Boolean) {
|
||||||
if (dark) {
|
if (dark) {
|
||||||
lastPlaybackControlsColor = MaterialValueHelper.getSecondaryTextColor(getActivity(), true);
|
lastPlaybackControlsColor = MaterialValueHelper.getSecondaryTextColor(activity, true)
|
||||||
lastDisabledPlaybackControlsColor = MaterialValueHelper.getSecondaryDisabledTextColor(getActivity(), true);
|
lastDisabledPlaybackControlsColor = MaterialValueHelper.getSecondaryDisabledTextColor(activity, true)
|
||||||
} else {
|
} else {
|
||||||
lastPlaybackControlsColor = MaterialValueHelper.getPrimaryTextColor(getActivity(), false);
|
lastPlaybackControlsColor = MaterialValueHelper.getPrimaryTextColor(activity, false)
|
||||||
lastDisabledPlaybackControlsColor = MaterialValueHelper.getPrimaryDisabledTextColor(getActivity(), false);
|
lastDisabledPlaybackControlsColor = MaterialValueHelper.getPrimaryDisabledTextColor(activity, false)
|
||||||
}
|
}
|
||||||
|
|
||||||
//volumeFragment?.setTintableColor(lastPlaybackControlsColor)
|
//volumeFragment?.setTintableColor(lastPlaybackControlsColor)
|
||||||
|
|
||||||
updateRepeatState();
|
updateRepeatState()
|
||||||
updateShuffleState();
|
updateShuffleState()
|
||||||
updatePrevNextColor();
|
updatePrevNextColor()
|
||||||
updateProgressTextColor();
|
updateProgressTextColor()
|
||||||
}
|
}
|
||||||
|
|
||||||
private var playerFabPlayPauseDrawable: PlayPauseDrawable? = null
|
private var playerFabPlayPauseDrawable: PlayPauseDrawable? = null
|
||||||
|
|
|
@ -1,3 +1,17 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2019 Hemanth Savarala.
|
||||||
|
*
|
||||||
|
* Licensed under the GNU General Public License v3
|
||||||
|
*
|
||||||
|
* This is free software: you can redistribute it and/or modify it under
|
||||||
|
* the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation either version 3 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||||
|
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
* See the GNU General Public License for more details.
|
||||||
|
*/
|
||||||
|
|
||||||
package code.name.monkey.retromusic.fragments.settings
|
package code.name.monkey.retromusic.fragments.settings
|
||||||
|
|
||||||
import android.graphics.Color
|
import android.graphics.Color
|
||||||
|
|
|
@ -1,3 +1,17 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2019 Hemanth Savarala.
|
||||||
|
*
|
||||||
|
* Licensed under the GNU General Public License v3
|
||||||
|
*
|
||||||
|
* This is free software: you can redistribute it and/or modify it under
|
||||||
|
* the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation either version 3 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||||
|
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
* See the GNU General Public License for more details.
|
||||||
|
*/
|
||||||
|
|
||||||
package code.name.monkey.retromusic.fragments.settings
|
package code.name.monkey.retromusic.fragments.settings
|
||||||
|
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
|
|
|
@ -1,3 +1,17 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2019 Hemanth Savarala.
|
||||||
|
*
|
||||||
|
* Licensed under the GNU General Public License v3
|
||||||
|
*
|
||||||
|
* This is free software: you can redistribute it and/or modify it under
|
||||||
|
* the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation either version 3 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||||
|
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
* See the GNU General Public License for more details.
|
||||||
|
*/
|
||||||
|
|
||||||
package code.name.monkey.retromusic.fragments.settings
|
package code.name.monkey.retromusic.fragments.settings
|
||||||
|
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
|
|
|
@ -1,3 +1,17 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2019 Hemanth Savarala.
|
||||||
|
*
|
||||||
|
* Licensed under the GNU General Public License v3
|
||||||
|
*
|
||||||
|
* This is free software: you can redistribute it and/or modify it under
|
||||||
|
* the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation either version 3 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||||
|
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
* See the GNU General Public License for more details.
|
||||||
|
*/
|
||||||
|
|
||||||
package code.name.monkey.retromusic.fragments.settings
|
package code.name.monkey.retromusic.fragments.settings
|
||||||
|
|
||||||
import android.graphics.Bitmap
|
import android.graphics.Bitmap
|
||||||
|
|
|
@ -1,3 +1,17 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2019 Hemanth Savarala.
|
||||||
|
*
|
||||||
|
* Licensed under the GNU General Public License v3
|
||||||
|
*
|
||||||
|
* This is free software: you can redistribute it and/or modify it under
|
||||||
|
* the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation either version 3 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||||
|
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
* See the GNU General Public License for more details.
|
||||||
|
*/
|
||||||
|
|
||||||
package code.name.monkey.retromusic.fragments.settings
|
package code.name.monkey.retromusic.fragments.settings
|
||||||
|
|
||||||
import android.os.Build
|
import android.os.Build
|
||||||
|
|
|
@ -1,3 +1,17 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2019 Hemanth Savarala.
|
||||||
|
*
|
||||||
|
* Licensed under the GNU General Public License v3
|
||||||
|
*
|
||||||
|
* This is free software: you can redistribute it and/or modify it under
|
||||||
|
* the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation either version 3 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||||
|
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
* See the GNU General Public License for more details.
|
||||||
|
*/
|
||||||
|
|
||||||
package code.name.monkey.retromusic.fragments.settings
|
package code.name.monkey.retromusic.fragments.settings
|
||||||
|
|
||||||
import android.content.SharedPreferences
|
import android.content.SharedPreferences
|
||||||
|
|
|
@ -1,3 +1,17 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2019 Hemanth Savarala.
|
||||||
|
*
|
||||||
|
* Licensed under the GNU General Public License v3
|
||||||
|
*
|
||||||
|
* This is free software: you can redistribute it and/or modify it under
|
||||||
|
* the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation either version 3 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||||
|
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
* See the GNU General Public License for more details.
|
||||||
|
*/
|
||||||
|
|
||||||
package code.name.monkey.retromusic.fragments.settings
|
package code.name.monkey.retromusic.fragments.settings
|
||||||
|
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
|
|
|
@ -1,3 +1,17 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2019 Hemanth Savarala.
|
||||||
|
*
|
||||||
|
* Licensed under the GNU General Public License v3
|
||||||
|
*
|
||||||
|
* This is free software: you can redistribute it and/or modify it under
|
||||||
|
* the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation either version 3 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||||
|
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
* See the GNU General Public License for more details.
|
||||||
|
*/
|
||||||
|
|
||||||
package code.name.monkey.retromusic.fragments.settings
|
package code.name.monkey.retromusic.fragments.settings
|
||||||
|
|
||||||
import android.content.SharedPreferences
|
import android.content.SharedPreferences
|
||||||
|
|
|
@ -1,3 +1,17 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2019 Hemanth Savarala.
|
||||||
|
*
|
||||||
|
* Licensed under the GNU General Public License v3
|
||||||
|
*
|
||||||
|
* This is free software: you can redistribute it and/or modify it under
|
||||||
|
* the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation either version 3 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||||
|
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
* See the GNU General Public License for more details.
|
||||||
|
*/
|
||||||
|
|
||||||
package code.name.monkey.retromusic.fragments.settings
|
package code.name.monkey.retromusic.fragments.settings
|
||||||
|
|
||||||
import android.graphics.Color
|
import android.graphics.Color
|
||||||
|
@ -16,6 +30,7 @@ import code.name.monkey.retromusic.R
|
||||||
import code.name.monkey.retromusic.appshortcuts.DynamicShortcutManager
|
import code.name.monkey.retromusic.appshortcuts.DynamicShortcutManager
|
||||||
import code.name.monkey.retromusic.util.PreferenceUtil
|
import code.name.monkey.retromusic.util.PreferenceUtil
|
||||||
import com.afollestad.materialdialogs.MaterialDialog
|
import com.afollestad.materialdialogs.MaterialDialog
|
||||||
|
import com.afollestad.materialdialogs.bottomsheets.BottomSheet
|
||||||
import com.afollestad.materialdialogs.color.colorChooser
|
import com.afollestad.materialdialogs.color.colorChooser
|
||||||
|
|
||||||
|
|
||||||
|
@ -27,11 +42,11 @@ class ThemeSettingsFragment : AbsSettingsFragment() {
|
||||||
|
|
||||||
override fun invalidateSettings() {
|
override fun invalidateSettings() {
|
||||||
val primaryColorPref: ATEColorPreference = findPreference("primary_color")!!
|
val primaryColorPref: ATEColorPreference = findPreference("primary_color")!!
|
||||||
primaryColorPref.isVisible = PreferenceUtil.getInstance().generalTheme == code.name.monkey.retromusic.R.style.Theme_RetroMusic_Color
|
primaryColorPref.isVisible = PreferenceUtil.getInstance().generalTheme == R.style.Theme_RetroMusic_Color
|
||||||
val primaryColor = ThemeStore.primaryColor(activity!!)
|
val primaryColor = ThemeStore.primaryColor(activity!!)
|
||||||
primaryColorPref.setColor(primaryColor, ColorUtil.darkenColor(primaryColor))
|
primaryColorPref.setColor(primaryColor, ColorUtil.darkenColor(primaryColor))
|
||||||
primaryColorPref.setOnPreferenceClickListener {
|
primaryColorPref.setOnPreferenceClickListener {
|
||||||
MaterialDialog(activity!!).show {
|
MaterialDialog(activity!!, BottomSheet()).show {
|
||||||
title(code.name.monkey.retromusic.R.string.primary_color)
|
title(code.name.monkey.retromusic.R.string.primary_color)
|
||||||
positiveButton(R.string.set)
|
positiveButton(R.string.set)
|
||||||
colorChooser(initialSelection = BLUE, allowCustomArgb = true, colors = PRIMARY_COLORS, subColors = PRIMARY_COLORS_SUB) { _, color ->
|
colorChooser(initialSelection = BLUE, allowCustomArgb = true, colors = PRIMARY_COLORS, subColors = PRIMARY_COLORS_SUB) { _, color ->
|
||||||
|
@ -69,8 +84,8 @@ class ThemeSettingsFragment : AbsSettingsFragment() {
|
||||||
when (theme) {
|
when (theme) {
|
||||||
"light" -> ThemeStore.editTheme(context!!).primaryColor(Color.WHITE).commit()
|
"light" -> ThemeStore.editTheme(context!!).primaryColor(Color.WHITE).commit()
|
||||||
"black" -> ThemeStore.editTheme(context!!).primaryColor(Color.BLACK).commit()
|
"black" -> ThemeStore.editTheme(context!!).primaryColor(Color.BLACK).commit()
|
||||||
"dark" -> ThemeStore.editTheme(context!!).primaryColor(ContextCompat.getColor(context!!, code.name.monkey.retromusic.R.color.md_grey_900)).commit()
|
"dark" -> ThemeStore.editTheme(context!!).primaryColor(ContextCompat.getColor(context!!, R.color.md_grey_900)).commit()
|
||||||
"color" -> ThemeStore.editTheme(context!!).primaryColor(ContextCompat.getColor(context!!, code.name.monkey.retromusic.R.color.md_blue_grey_800)).commit()
|
"color" -> ThemeStore.editTheme(context!!).primaryColor(ContextCompat.getColor(context!!, R.color.md_blue_grey_800)).commit()
|
||||||
}
|
}
|
||||||
|
|
||||||
ThemeStore.editTheme(activity!!)
|
ThemeStore.editTheme(activity!!)
|
||||||
|
@ -91,7 +106,7 @@ class ThemeSettingsFragment : AbsSettingsFragment() {
|
||||||
accentColorPref.setColor(accentColor, ColorUtil.darkenColor(accentColor))
|
accentColorPref.setColor(accentColor, ColorUtil.darkenColor(accentColor))
|
||||||
|
|
||||||
accentColorPref.setOnPreferenceClickListener {
|
accentColorPref.setOnPreferenceClickListener {
|
||||||
MaterialDialog(activity!!).show {
|
MaterialDialog(activity!!, BottomSheet()).show {
|
||||||
title(R.string.accent_color)
|
title(R.string.accent_color)
|
||||||
positiveButton(R.string.set)
|
positiveButton(R.string.set)
|
||||||
colorChooser(colors = ACCENT_COLORS, allowCustomArgb = true, subColors = ACCENT_COLORS_SUB) { _, color ->
|
colorChooser(colors = ACCENT_COLORS, allowCustomArgb = true, subColors = ACCENT_COLORS_SUB) { _, color ->
|
||||||
|
|
|
@ -33,6 +33,7 @@ import code.name.monkey.retromusic.fragments.AlbumCoverStyle
|
||||||
import code.name.monkey.retromusic.util.PreferenceUtil
|
import code.name.monkey.retromusic.util.PreferenceUtil
|
||||||
import code.name.monkey.retromusic.util.ViewUtil
|
import code.name.monkey.retromusic.util.ViewUtil
|
||||||
import com.afollestad.materialdialogs.MaterialDialog
|
import com.afollestad.materialdialogs.MaterialDialog
|
||||||
|
import com.afollestad.materialdialogs.bottomsheets.BottomSheet
|
||||||
import com.afollestad.materialdialogs.customview.customView
|
import com.afollestad.materialdialogs.customview.customView
|
||||||
import com.bumptech.glide.Glide
|
import com.bumptech.glide.Glide
|
||||||
|
|
||||||
|
@ -68,7 +69,7 @@ class AlbumCoverStylePreferenceDialog : PreferenceDialogFragmentCompat(), ViewPa
|
||||||
viewPager.pageMargin = ViewUtil.convertDpToPixel(32f, resources).toInt()
|
viewPager.pageMargin = ViewUtil.convertDpToPixel(32f, resources).toInt()
|
||||||
viewPager.currentItem = PreferenceUtil.getInstance().albumCoverStyle.ordinal
|
viewPager.currentItem = PreferenceUtil.getInstance().albumCoverStyle.ordinal
|
||||||
|
|
||||||
return MaterialDialog(activity!!).show {
|
return MaterialDialog(activity!!, BottomSheet()).show {
|
||||||
title(R.string.pref_title_album_cover_style)
|
title(R.string.pref_title_album_cover_style)
|
||||||
positiveButton(R.string.set) {
|
positiveButton(R.string.set) {
|
||||||
val nowPlayingScreen = AlbumCoverStyle.values()[viewPagerPosition]
|
val nowPlayingScreen = AlbumCoverStyle.values()[viewPagerPosition]
|
||||||
|
|
|
@ -23,6 +23,7 @@ import androidx.preference.ListPreference
|
||||||
import androidx.preference.PreferenceDialogFragmentCompat
|
import androidx.preference.PreferenceDialogFragmentCompat
|
||||||
import code.name.monkey.retromusic.R
|
import code.name.monkey.retromusic.R
|
||||||
import com.afollestad.materialdialogs.MaterialDialog
|
import com.afollestad.materialdialogs.MaterialDialog
|
||||||
|
import com.afollestad.materialdialogs.bottomsheets.BottomSheet
|
||||||
import com.afollestad.materialdialogs.list.listItemsSingleChoice
|
import com.afollestad.materialdialogs.list.listItemsSingleChoice
|
||||||
|
|
||||||
|
|
||||||
|
@ -63,7 +64,8 @@ class MaterialListPreferenceDialog : PreferenceDialogFragmentCompat() {
|
||||||
|
|
||||||
val entries = arguments?.getStringArrayList(EXTRA_ENTRIES)
|
val entries = arguments?.getStringArrayList(EXTRA_ENTRIES)
|
||||||
val entriesValues = arguments?.getStringArrayList(EXTRA_ENTRIES_VALUES)
|
val entriesValues = arguments?.getStringArrayList(EXTRA_ENTRIES_VALUES)
|
||||||
return MaterialDialog(activity!!).show {
|
return MaterialDialog(activity!!, BottomSheet())
|
||||||
|
.show {
|
||||||
title(text = materialListPreference.title.toString())
|
title(text = materialListPreference.title.toString())
|
||||||
positiveButton(R.string.set)
|
positiveButton(R.string.set)
|
||||||
listItemsSingleChoice(items = entries, initialSelection = position, waitForPositiveButton = true) { _, index, _ ->
|
listItemsSingleChoice(items = entries, initialSelection = position, waitForPositiveButton = true) { _, index, _ ->
|
||||||
|
|
|
@ -35,6 +35,7 @@ import code.name.monkey.retromusic.util.NavigationUtil
|
||||||
import code.name.monkey.retromusic.util.PreferenceUtil
|
import code.name.monkey.retromusic.util.PreferenceUtil
|
||||||
import code.name.monkey.retromusic.util.ViewUtil
|
import code.name.monkey.retromusic.util.ViewUtil
|
||||||
import com.afollestad.materialdialogs.MaterialDialog
|
import com.afollestad.materialdialogs.MaterialDialog
|
||||||
|
import com.afollestad.materialdialogs.bottomsheets.BottomSheet
|
||||||
import com.afollestad.materialdialogs.customview.customView
|
import com.afollestad.materialdialogs.customview.customView
|
||||||
import com.bumptech.glide.Glide
|
import com.bumptech.glide.Glide
|
||||||
|
|
||||||
|
@ -83,9 +84,10 @@ class NowPlayingScreenPreferenceDialog : PreferenceDialogFragmentCompat(), ViewP
|
||||||
viewPager.currentItem = PreferenceUtil.getInstance().nowPlayingScreen.ordinal
|
viewPager.currentItem = PreferenceUtil.getInstance().nowPlayingScreen.ordinal
|
||||||
|
|
||||||
|
|
||||||
return MaterialDialog(activity!!).show {
|
return MaterialDialog(activity!!, BottomSheet()).show {
|
||||||
title(R.string.pref_title_album_cover_style)
|
title(R.string.pref_title_album_cover_style)
|
||||||
positiveButton(R.string.set) {
|
positiveButton(R.string.set) {
|
||||||
|
|
||||||
val nowPlayingScreen = NowPlayingScreen.values()[viewPagerPosition]
|
val nowPlayingScreen = NowPlayingScreen.values()[viewPagerPosition]
|
||||||
if (isNowPlayingThemes(nowPlayingScreen)) {
|
if (isNowPlayingThemes(nowPlayingScreen)) {
|
||||||
val result = getString(nowPlayingScreen.titleRes) + " theme is Pro version feature."
|
val result = getString(nowPlayingScreen.titleRes) + " theme is Pro version feature."
|
||||||
|
|
|
@ -19,14 +19,13 @@ import android.annotation.SuppressLint
|
||||||
import android.content.BroadcastReceiver
|
import android.content.BroadcastReceiver
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.os.Build
|
|
||||||
import android.os.Handler
|
import android.os.Handler
|
||||||
import android.os.Message
|
import android.os.Message
|
||||||
import android.os.PowerManager
|
import android.os.PowerManager
|
||||||
import android.os.PowerManager.WakeLock
|
import android.os.PowerManager.WakeLock
|
||||||
import android.util.Log
|
import android.util.Log
|
||||||
import android.view.KeyEvent
|
import android.view.KeyEvent
|
||||||
|
import androidx.core.content.ContextCompat
|
||||||
import code.name.monkey.retromusic.BuildConfig
|
import code.name.monkey.retromusic.BuildConfig
|
||||||
import code.name.monkey.retromusic.Constants.ACTION_PAUSE
|
import code.name.monkey.retromusic.Constants.ACTION_PAUSE
|
||||||
import code.name.monkey.retromusic.Constants.ACTION_PLAY
|
import code.name.monkey.retromusic.Constants.ACTION_PLAY
|
||||||
|
@ -35,6 +34,7 @@ import code.name.monkey.retromusic.Constants.ACTION_SKIP
|
||||||
import code.name.monkey.retromusic.Constants.ACTION_STOP
|
import code.name.monkey.retromusic.Constants.ACTION_STOP
|
||||||
import code.name.monkey.retromusic.Constants.ACTION_TOGGLE_PAUSE
|
import code.name.monkey.retromusic.Constants.ACTION_TOGGLE_PAUSE
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Used to control headset playback.
|
* Used to control headset playback.
|
||||||
* Single press: pause/resume
|
* Single press: pause/resume
|
||||||
|
@ -152,10 +152,16 @@ class MediaButtonIntentReceiver : BroadcastReceiver() {
|
||||||
private fun startService(context: Context, command: String?) {
|
private fun startService(context: Context, command: String?) {
|
||||||
val intent = Intent(context, MusicService::class.java)
|
val intent = Intent(context, MusicService::class.java)
|
||||||
intent.action = command
|
intent.action = command
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
try {
|
||||||
context.startForegroundService(intent)
|
// IMPORTANT NOTE: (kind of a hack)
|
||||||
} else {
|
// on Android O and above the following crashes when the app is not running
|
||||||
|
// there is no good way to check whether the app is running so we catch the exception
|
||||||
|
// we do not always want to use startForegroundService() because then one gets an ANR
|
||||||
|
// if no notification is displayed via startForeground()
|
||||||
|
// according to Play analytics this happens a lot, I suppose for example if command = PAUSE
|
||||||
context.startService(intent)
|
context.startService(intent)
|
||||||
|
} catch (ignored: IllegalStateException) {
|
||||||
|
ContextCompat.startForegroundService(context, intent)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -29,10 +29,6 @@ import android.text.TextUtils;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
|
||||||
import androidx.annotation.Nullable;
|
|
||||||
import androidx.core.content.FileProvider;
|
|
||||||
|
|
||||||
import org.jaudiotagger.audio.AudioFileIO;
|
import org.jaudiotagger.audio.AudioFileIO;
|
||||||
import org.jaudiotagger.tag.FieldKey;
|
import org.jaudiotagger.tag.FieldKey;
|
||||||
|
|
||||||
|
@ -43,6 +39,9 @@ import java.util.List;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
|
import androidx.core.content.FileProvider;
|
||||||
import code.name.monkey.retromusic.R;
|
import code.name.monkey.retromusic.R;
|
||||||
import code.name.monkey.retromusic.helper.MusicPlayerRemote;
|
import code.name.monkey.retromusic.helper.MusicPlayerRemote;
|
||||||
import code.name.monkey.retromusic.loaders.PlaylistLoader;
|
import code.name.monkey.retromusic.loaders.PlaylistLoader;
|
||||||
|
@ -99,22 +98,15 @@ public class MusicUtil {
|
||||||
* Ex: for a given album --> buildInfoString(album.artist, album.songCount)
|
* Ex: for a given album --> buildInfoString(album.artist, album.songCount)
|
||||||
*/
|
*/
|
||||||
public static String buildInfoString(@NonNull final String string1, @NonNull final String string2) {
|
public static String buildInfoString(@NonNull final String string1, @NonNull final String string2) {
|
||||||
// Skip empty strings
|
if (TextUtils.isEmpty(string1)) {
|
||||||
if (string1.isEmpty()) {
|
//noinspection ConstantConditions
|
||||||
return string2;
|
return TextUtils.isEmpty(string2) ? "" : string2;
|
||||||
}
|
}
|
||||||
if (string2.isEmpty()) {
|
if (TextUtils.isEmpty(string2)) {
|
||||||
return string1;
|
//noinspection ConstantConditions
|
||||||
|
return TextUtils.isEmpty(string1) ? "" : string1;
|
||||||
}
|
}
|
||||||
|
return string1 + " • " + string2;
|
||||||
final String separator = " • ";
|
|
||||||
|
|
||||||
final StringBuilder builder = new StringBuilder();
|
|
||||||
builder.append(string1);
|
|
||||||
builder.append(separator);
|
|
||||||
builder.append(string2);
|
|
||||||
|
|
||||||
return builder.toString();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@NonNull
|
@NonNull
|
||||||
|
|
|
@ -34,34 +34,23 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
app:layout_scrollFlags="scroll|enterAlways">
|
app:layout_scrollFlags="scroll|enterAlways">
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.Toolbar
|
<androidx.appcompat.widget.Toolbar
|
||||||
android:id="@+id/toolbar"
|
android:id="@+id/toolbar"
|
||||||
style="@style/Toolbar"
|
style="@style/Toolbar"
|
||||||
android:layout_gravity="center_vertical"
|
|
||||||
android:layout_weight="1"
|
|
||||||
app:layout_collapseMode="pin"
|
app:layout_collapseMode="pin"
|
||||||
tools:ignore="UnusedAttribute" />
|
tools:ignore="UnusedAttribute">
|
||||||
|
|
||||||
<code.name.monkey.retromusic.views.CircularImageView
|
<code.name.monkey.retromusic.views.CircularImageView
|
||||||
android:id="@+id/userImage"
|
android:id="@+id/userImage"
|
||||||
android:layout_width="32dp"
|
android:layout_width="32dp"
|
||||||
android:layout_height="32dp"
|
android:layout_height="32dp"
|
||||||
android:layout_gravity="end|center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
android:layout_marginEnd="8dp"
|
android:layout_marginStart="14dp"
|
||||||
android:layout_weight="0"
|
android:layout_weight="0"
|
||||||
app:civ_border="false" />
|
app:civ_border="false" />
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<TextView
|
</androidx.appcompat.widget.Toolbar>
|
||||||
android:id="@+id/bannerTitle"
|
|
||||||
style="@style/BigTitleTextAppearanceToolbar"
|
|
||||||
android:text="@string/app_name"
|
|
||||||
tools:ignore="MissingPrefix" />
|
|
||||||
|
|
||||||
<ViewStub
|
<ViewStub
|
||||||
android:id="@+id/cab_stub"
|
android:id="@+id/cab_stub"
|
||||||
|
@ -76,7 +65,7 @@
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:background="@color/md_white_1000"
|
android:background="@color/md_white_1000"
|
||||||
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
|
app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior" />
|
||||||
|
|
||||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
tools:context=".DrawerActivity">
|
tools:context=".DrawerActivity">
|
||||||
|
|
||||||
|
|
||||||
<item
|
<item
|
||||||
android:id="@+id/action_grid_size"
|
android:id="@+id/action_grid_size"
|
||||||
android:icon="@drawable/ic_grid_size_white_24dp"
|
android:icon="@drawable/ic_grid_size_white_24dp"
|
||||||
|
@ -48,4 +49,9 @@
|
||||||
app:showAsAction="ifRoom">
|
app:showAsAction="ifRoom">
|
||||||
<menu></menu>
|
<menu></menu>
|
||||||
</item>
|
</item>
|
||||||
|
<item
|
||||||
|
android:id="@+id/action_search"
|
||||||
|
android:icon="@drawable/ic_search_white_24dp"
|
||||||
|
android:title="@string/action_search"
|
||||||
|
app:showAsAction="always" />
|
||||||
</menu>
|
</menu>
|
|
@ -614,5 +614,6 @@
|
||||||
<string name="on">On</string>
|
<string name="on">On</string>
|
||||||
<string name="select_preset">Select preset</string>
|
<string name="select_preset">Select preset</string>
|
||||||
<string name="upgrade_to_premium">Upgrade to premium</string>
|
<string name="upgrade_to_premium">Upgrade to premium</string>
|
||||||
|
<string name="action_new_playlist">New playlist</string>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
@ -44,6 +44,7 @@
|
||||||
<item name="android:windowSharedElementEnterTransition">@transition/grid_exit</item>
|
<item name="android:windowSharedElementEnterTransition">@transition/grid_exit</item>
|
||||||
<item name="android:windowSharedElementExitTransition">@transition/grid_exit</item>
|
<item name="android:windowSharedElementExitTransition">@transition/grid_exit</item>
|
||||||
<item name="android:fontFamily">@font/circular</item>
|
<item name="android:fontFamily">@font/circular</item>
|
||||||
|
<item name="android:textColorPrimary">@color/md_white_1000</item>
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
@ -125,6 +126,7 @@
|
||||||
<item name="android:windowSharedElementExitTransition">@transition/grid_exit</item>
|
<item name="android:windowSharedElementExitTransition">@transition/grid_exit</item>
|
||||||
<item name="android:fontFamily">@font/circular</item>
|
<item name="android:fontFamily">@font/circular</item>
|
||||||
|
|
||||||
|
<item name="android:textColorPrimary">@color/md_grey_900</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -22,20 +22,17 @@ android {
|
||||||
sourceCompatibility JavaVersion.VERSION_1_8
|
sourceCompatibility JavaVersion.VERSION_1_8
|
||||||
targetCompatibility JavaVersion.VERSION_1_8
|
targetCompatibility JavaVersion.VERSION_1_8
|
||||||
}
|
}
|
||||||
productFlavors {
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
||||||
implementation 'androidx.appcompat:appcompat:1.1.0-alpha04'
|
implementation 'androidx.appcompat:appcompat:1.1.0-alpha05'
|
||||||
implementation 'com.google.android.material:material:1.1.0-alpha05'
|
implementation 'com.google.android.material:material:1.1.0-alpha05'
|
||||||
implementation 'androidx.preference:preference:1.1.0-alpha04'
|
implementation 'androidx.preference:preference:1.1.0-alpha05'
|
||||||
implementation 'androidx.cardview:cardview:1.0.0'
|
implementation 'androidx.cardview:cardview:1.0.0'
|
||||||
// Used for the list preference classes
|
// Used for the list preference classes
|
||||||
implementation "com.afollestad.material-dialogs:core:$materialDialog"
|
implementation 'com.afollestad.material-dialogs:core:3.0.0-alpha1'
|
||||||
implementation "com.afollestad.material-dialogs:core:$materialDialog"
|
implementation 'com.afollestad.material-dialogs:input:3.0.0-alpha1'
|
||||||
implementation 'com.afollestad.material-dialogs:input:2.0.0'
|
implementation 'com.afollestad.material-dialogs:color:3.0.0-alpha1'
|
||||||
implementation 'com.afollestad.material-dialogs:color:2.0.0'
|
|
||||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||||
|
|
||||||
buildscript {
|
buildscript {
|
||||||
ext.kotlin_version = '1.3.21'
|
ext.kotlin_version = '1.3.31'
|
||||||
ext {
|
ext {
|
||||||
supportLibVersion = '1.1.0-alpha05'
|
supportLibVersion = '1.1.0-alpha05'
|
||||||
firebase = "11.8.0"
|
firebase = "11.8.0"
|
||||||
|
|
Loading…
Reference in a new issue