-
+
@@ -55,6 +55,7 @@
+
@@ -68,6 +69,7 @@
+
@@ -81,6 +83,7 @@
+
@@ -162,9 +165,6 @@
-
-
-
@@ -176,35 +176,28 @@
-
-
-
-
-
-
-
-
+
@@ -227,6 +220,7 @@
+
@@ -234,7 +228,6 @@
-
@@ -245,6 +238,7 @@
+
@@ -252,13 +246,12 @@
+
-
-
@@ -276,11 +269,13 @@
+
+
diff --git a/app/build.gradle b/app/build.gradle
index ff8fe881..07c88b73 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -1,6 +1,7 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
+apply plugin: 'kotlin-kapt'
static def gitBranch() {
def branch = 'GitHub'
@@ -31,8 +32,8 @@ android {
vectorDrawables.useSupportLibrary = true
applicationId "code.name.monkey.retromusic"
- versionCode 262
- versionName '3.0.030'
+ versionCode 263
+ versionName '3.0.130'
multiDexEnabled true
@@ -144,12 +145,10 @@ dependencies {
implementation "com.afollestad.material-dialogs:core:$materialDialog"
implementation "com.afollestad.material-dialogs:commons:$materialDialog"
implementation 'com.afollestad:material-cab:0.1.12'
- implementation 'com.github.bumptech.glide:glide:3.8.0'
- implementation 'com.github.bumptech.glide:okhttp3-integration:1.5.0'
+ implementation 'com.github.bumptech.glide:glide:4.8.0'
+ implementation 'com.github.bumptech.glide:okhttp3-integration:4.8.0'
implementation 'io.reactivex.rxjava2:rxandroid:2.0.2'
implementation 'io.reactivex.rxjava2:rxjava:2.1.17'
- implementation 'com.squareup.okhttp3:logging-interceptor:3.11.0'
- implementation 'com.squareup.okhttp3:okhttp:3.11.0'
implementation('com.h6ah4i.android.widget.advrecyclerview:advrecyclerview:0.11.0@aar') {
transitive = true
}
@@ -170,6 +169,8 @@ dependencies {
implementation 'org.eclipse.mylyn.github:org.eclipse.egit.github.core:2.1.5'
implementation 'com.github.jetradarmobile:android-snowfall:1.2.0'
implementation 'com.github.javiersantos:PiracyChecker:1.2.4'
+
+ kapt 'com.github.bumptech.glide:compiler:4.8.0'
}
repositories {
mavenCentral()
diff --git a/app/src/main/assets/retro-changelog.html b/app/src/main/assets/retro-changelog.html
index 17716315..69f0c46e 100644
--- a/app/src/main/assets/retro-changelog.html
+++ b/app/src/main/assets/retro-changelog.html
@@ -1 +1 @@
-
Version 3.0.00
- Converted app to kotlin
- Now you can add plain text home screen widget
- Good old side navigation bar for options
- Bug report for better tracking with milestones
- Snow fall effect can be enable from other settings
- Click new music mix to play songs
- Gradient image option for gird list
- Clear button for playing queue
- Folder list back button
- New theme Fit
- On library click on toolbar for accessing main menu
- On home click on toolbar for accessing search
- BottomSheetDialogue is now adaptable to screens, background colour and text size
consistency.
- Removed coloured navigation bar option to making app adapt the primary colour
- Swipe up gesture for now playing removed, replaced with "tap to open", To achieve
transparent navigation bar for desired themes.
- Improved tablet UI and home screen by adding suggestions toggle banner issues.
- Improving lyrics page
FAQ's
*If you face any UI related issues you clear app data and cache, if its
not working try to
uninstall and install again.
\ No newline at end of file
+
Version 3.0.00
- Converted app to kotlin
- Now you can add plain text home screen widget
- Good old side navigation bar for options
- Bug report for better tracking with milestones
- Snow fall effect can be enable from other settings(Works only one normal theme)
- Click new music mix to play songs
- Gradient image option for gird list
- Clear button for playing queue
- Folder list back button
- New theme Fit
- On library click on toolbar for accessing main menu
- On home click on toolbar for accessing search
- BottomSheetDialogue is now adaptable to screens, background colour and text size
consistency.
- Removed coloured navigation bar option to making app adapt the primary colour
- Swipe up gesture for now playing removed, replaced with "tap to open", To achieve
transparent navigation bar for desired themes.
- Improved tablet UI and home screen by adding suggestions toggle banner issues.
- Improving lyrics page
FAQ's
*If you face any UI related issues you clear app data and cache, if its
not working try to
uninstall and install again.
\ No newline at end of file
diff --git a/app/src/main/java/code/name/monkey/retromusic/dialogs/MainOptionsBottomSheetDialogFragment.kt b/app/src/main/java/code/name/monkey/retromusic/dialogs/OptionsSheetDialogFragment.kt
similarity index 68%
rename from app/src/main/java/code/name/monkey/retromusic/dialogs/MainOptionsBottomSheetDialogFragment.kt
rename to app/src/main/java/code/name/monkey/retromusic/dialogs/OptionsSheetDialogFragment.kt
index 50f76b85..57ab22aa 100644
--- a/app/src/main/java/code/name/monkey/retromusic/dialogs/MainOptionsBottomSheetDialogFragment.kt
+++ b/app/src/main/java/code/name/monkey/retromusic/dialogs/OptionsSheetDialogFragment.kt
@@ -1,15 +1,20 @@
package code.name.monkey.retromusic.dialogs
+import android.content.Intent
import android.graphics.Bitmap
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
+import androidx.core.app.ShareCompat
import androidx.core.content.ContextCompat
import code.name.monkey.appthemehelper.ThemeStore
+import code.name.monkey.retromusic.App
import code.name.monkey.retromusic.Constants.USER_PROFILE
import code.name.monkey.retromusic.R
import code.name.monkey.retromusic.ui.activities.MainActivity
+import code.name.monkey.retromusic.ui.activities.bugreport.BugReportActivity
+import code.name.monkey.retromusic.ui.fragments.mainactivity.folders.FoldersFragment
import code.name.monkey.retromusic.util.Compressor
import code.name.monkey.retromusic.util.NavigationUtil
import code.name.monkey.retromusic.util.PreferenceUtil
@@ -21,7 +26,7 @@ import kotlinx.android.synthetic.main.fragment_main_options.*
import java.io.File
import java.util.*
-class MainOptionsBottomSheetDialogFragment : RoundedBottomSheetDialogFragment(), View.OnClickListener {
+class OptionsSheetDialogFragment : RoundedBottomSheetDialogFragment(), View.OnClickListener {
private val disposable = CompositeDisposable()
@@ -52,6 +57,7 @@ class MainOptionsBottomSheetDialogFragment : RoundedBottomSheetDialogFragment(),
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
+ actionBuyPro.visibility = if (!App.isProVersion) View.VISIBLE else View.GONE
text!!.setTextColor(ThemeStore.textColorSecondary(context!!))
titleWelcome!!.setTextColor(ThemeStore.textColorPrimary(context!!))
titleWelcome!!.text = String.format("%s %s!", timeOfTheDay, PreferenceUtil.getInstance().userName)
@@ -61,24 +67,51 @@ class MainOptionsBottomSheetDialogFragment : RoundedBottomSheetDialogFragment(),
actionAbout.setOnClickListener(this)
actionSleepTimer.setOnClickListener(this)
userInfoContainer.setOnClickListener(this)
+ actionEqualizer.setOnClickListener(this)
+ actionFolders.setOnClickListener(this)
actionRate.setOnClickListener(this)
+ actionShare.setOnClickListener(this)
+ actionBuyPro.setOnClickListener(this)
+ actionBugReport.setOnClickListener(this)
}
override fun onClick(view: View) {
val mainActivity = activity as MainActivity? ?: return
when (view.id) {
+ R.id.actionFolders -> {
+ mainActivity.setCurrentFragment(FoldersFragment.newInstance(context), true)
+ }
R.id.actionSettings -> NavigationUtil.goToSettings(mainActivity)
R.id.actionAbout -> NavigationUtil.goToAbout(mainActivity)
R.id.actionSleepTimer -> if (fragmentManager != null) {
SleepTimerDialog().show(fragmentManager!!, TAG)
}
- R.id.userInfoContainer -> NavigationUtil.goToUserInfo(activity!!)
+ R.id.userInfoContainer -> NavigationUtil.goToUserInfo(mainActivity)
R.id.actionRate -> NavigationUtil.goToPlayStore(mainActivity)
+ R.id.actionShare -> shareApp()
+ R.id.actionBugReport -> prepareBugReport()
+ R.id.actionEqualizer -> NavigationUtil.openEqualizer(mainActivity)
+ R.id.actionBuyPro -> NavigationUtil.goToProVersion(mainActivity)
}
dismiss()
}
+ private fun prepareBugReport() {
+ startActivity(Intent(activity, BugReportActivity::class.java))
+ }
+
+ private fun shareApp() {
+ val shareIntent = ShareCompat.IntentBuilder.from(activity)
+ .setType("songText/plain")
+ .setText(String.format(getString(R.string.app_share), activity!!.packageName))
+ .intent
+ if (shareIntent.resolveActivity(activity!!.packageManager) != null) {
+ startActivity(
+ Intent.createChooser(shareIntent, resources.getText(R.string.action_share)))
+ }
+ }
+
private fun loadImageFromStorage() {
disposable.add(Compressor(context!!)
@@ -102,16 +135,16 @@ class MainOptionsBottomSheetDialogFragment : RoundedBottomSheetDialogFragment(),
private const val TAG: String = "MainOptionsBottomSheetD"
- fun newInstance(selected_id: Int): MainOptionsBottomSheetDialogFragment {
+ fun newInstance(selected_id: Int): OptionsSheetDialogFragment {
val bundle = Bundle()
bundle.putInt("selected_id", selected_id)
- val fragment = MainOptionsBottomSheetDialogFragment()
+ val fragment = OptionsSheetDialogFragment()
fragment.arguments = bundle
return fragment
}
- fun newInstance(): MainOptionsBottomSheetDialogFragment {
- return MainOptionsBottomSheetDialogFragment()
+ fun newInstance(): OptionsSheetDialogFragment {
+ return OptionsSheetDialogFragment()
}
}
}
diff --git a/app/src/main/java/code/name/monkey/retromusic/loaders/HomeLoader.kt b/app/src/main/java/code/name/monkey/retromusic/loaders/HomeLoader.kt
index 273d1a81..930d72b3 100644
--- a/app/src/main/java/code/name/monkey/retromusic/loaders/HomeLoader.kt
+++ b/app/src/main/java/code/name/monkey/retromusic/loaders/HomeLoader.kt
@@ -2,9 +2,9 @@ package code.name.monkey.retromusic.loaders
import android.content.Context
-
-import java.util.ArrayList
+import code.name.monkey.retromusic.misc.DisposingObserver
import code.name.monkey.retromusic.model.Playlist
+import code.name.monkey.retromusic.model.Song
import code.name.monkey.retromusic.model.smartplaylist.AbsSmartPlaylist
import code.name.monkey.retromusic.model.smartplaylist.HistoryPlaylist
import code.name.monkey.retromusic.model.smartplaylist.LastAddedPlaylist
@@ -13,9 +13,9 @@ import io.reactivex.Observable
object HomeLoader {
- fun getRecentAndTopThings(
- context: Context): Observable> {
+ fun getRecentAndTopThings(context: Context): Observable> {
val objects = ArrayList()
+
return Observable.create { e ->
HistoryPlaylist(context).getSongs(context).subscribe { songs ->
@@ -56,6 +56,4 @@ object HomeLoader {
}
return Observable.just(playlists)
}
-
-
}
diff --git a/app/src/main/java/code/name/monkey/retromusic/loaders/LastAddedSongsLoader.kt b/app/src/main/java/code/name/monkey/retromusic/loaders/LastAddedSongsLoader.kt
index 3aa2ab06..83bcbf2e 100644
--- a/app/src/main/java/code/name/monkey/retromusic/loaders/LastAddedSongsLoader.kt
+++ b/app/src/main/java/code/name/monkey/retromusic/loaders/LastAddedSongsLoader.kt
@@ -24,7 +24,7 @@ object LastAddedSongsLoader {
return SongLoader.getSongs(makeLastAddedCursor(context))
}
- fun makeLastAddedCursor(@NonNull context: Context): Cursor? {
+ private fun makeLastAddedCursor(@NonNull context: Context): Cursor? {
val cutoff = PreferenceUtil.getInstance().lastAddedCutoff
return SongLoader.makeSongCursor(
diff --git a/app/src/main/java/code/name/monkey/retromusic/misc/DisposableManager.kt b/app/src/main/java/code/name/monkey/retromusic/misc/DisposableManager.kt
new file mode 100644
index 00000000..56035047
--- /dev/null
+++ b/app/src/main/java/code/name/monkey/retromusic/misc/DisposableManager.kt
@@ -0,0 +1,24 @@
+package code.name.monkey.retromusic.misc
+
+import io.reactivex.disposables.CompositeDisposable
+import io.reactivex.disposables.Disposable
+
+object DisposableManager {
+
+ private var compositeDisposable: CompositeDisposable? = null
+
+ fun add(disposable: Disposable) {
+ getCompositeDisposable().add(disposable)
+ }
+
+ fun dispose() {
+ getCompositeDisposable().dispose()
+ }
+
+ private fun getCompositeDisposable(): CompositeDisposable {
+ if (compositeDisposable == null || compositeDisposable!!.isDisposed) {
+ compositeDisposable = CompositeDisposable()
+ }
+ return compositeDisposable!!
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/code/name/monkey/retromusic/misc/DisposingObserver.kt b/app/src/main/java/code/name/monkey/retromusic/misc/DisposingObserver.kt
new file mode 100644
index 00000000..a54ad771
--- /dev/null
+++ b/app/src/main/java/code/name/monkey/retromusic/misc/DisposingObserver.kt
@@ -0,0 +1,18 @@
+package code.name.monkey.retromusic.misc
+
+import androidx.annotation.CallSuper
+import io.reactivex.Observer
+import io.reactivex.disposables.Disposable
+
+class DisposingObserver : Observer {
+ @CallSuper
+ override fun onSubscribe(d: Disposable) {
+ DisposableManager.add(d)
+ }
+
+ override fun onNext(next: T) {}
+
+ override fun onError(e: Throwable) {}
+
+ override fun onComplete() {}
+}
\ No newline at end of file
diff --git a/app/src/main/java/code/name/monkey/retromusic/mvp/presenter/HomePresenter.kt b/app/src/main/java/code/name/monkey/retromusic/mvp/presenter/HomePresenter.kt
index 858acc00..477e4079 100644
--- a/app/src/main/java/code/name/monkey/retromusic/mvp/presenter/HomePresenter.kt
+++ b/app/src/main/java/code/name/monkey/retromusic/mvp/presenter/HomePresenter.kt
@@ -3,6 +3,12 @@ package code.name.monkey.retromusic.mvp.presenter
import code.name.monkey.retromusic.mvp.Presenter
import code.name.monkey.retromusic.mvp.contract.HomeContract
import code.name.monkey.retromusic.util.PreferenceUtil
+import io.reactivex.disposables.CompositeDisposable
+import io.reactivex.disposables.Disposable
+
+operator fun CompositeDisposable.plusAssign(disposable: Disposable) {
+ add(disposable)
+}
class HomePresenter(private val view: HomeContract.HomeView) : Presenter(), HomeContract.HomePresenter {
@@ -19,22 +25,24 @@ class HomePresenter(private val view: HomeContract.HomeView) : Presenter(), Home
}
override fun unsubscribe() {
- disposable.clear()
+ if (!disposable.isDisposed) {
+ disposable.dispose()
+ }
}
fun loadPlaylists() {
- disposable.add(repository.allPlaylists
+ disposable += repository.allPlaylists
.observeOn(schedulerProvider.ui())
.subscribeOn(schedulerProvider.io())
.subscribe({ playlist ->
if (!playlist.isEmpty()) {
view.playlists(playlist)
}
- }, { view.showEmptyView() }, { view.completed() }))
+ }, { view.showEmptyView() }, { view.completed() })
}
override fun loadRecentAlbums() {
- disposable.add(repository.recentAlbums
+ disposable += repository.recentAlbums
.observeOn(schedulerProvider.ui())
.subscribeOn(schedulerProvider.io())
.doOnSubscribe { view.loading() }
@@ -42,11 +50,11 @@ class HomePresenter(private val view: HomeContract.HomeView) : Presenter(), Home
if (!artists.isEmpty()) {
view.recentAlbum(artists)
}
- }, { view.showEmptyView() }, { view.completed() }))
+ }, { view.showEmptyView() }, { view.completed() })
}
override fun loadTopAlbums() {
- disposable.add(repository.topAlbums
+ disposable += repository.topAlbums
.observeOn(schedulerProvider.ui())
.subscribeOn(schedulerProvider.io())
.doOnSubscribe { view.loading() }
@@ -54,11 +62,11 @@ class HomePresenter(private val view: HomeContract.HomeView) : Presenter(), Home
if (!artists.isEmpty()) {
view.topAlbums(artists)
}
- }, { view.showEmptyView() }, { view.completed() }))
+ }, { view.showEmptyView() }, { view.completed() })
}
override fun loadRecentArtists() {
- disposable.add(repository.recentArtists
+ disposable += repository.recentArtists
.observeOn(schedulerProvider.ui())
.subscribeOn(schedulerProvider.io())
.doOnSubscribe { view.loading() }
@@ -66,11 +74,11 @@ class HomePresenter(private val view: HomeContract.HomeView) : Presenter(), Home
if (!artists.isEmpty()) {
view.recentArtist(artists)
}
- }, { view.showEmptyView() }, { view.completed() }))
+ }, { view.showEmptyView() }, { view.completed() })
}
override fun loadTopArtists() {
- disposable.add(repository.topArtists
+ disposable += repository.topArtists
.observeOn(schedulerProvider.ui())
.subscribeOn(schedulerProvider.io())
.doOnSubscribe { view.loading() }
@@ -78,20 +86,21 @@ class HomePresenter(private val view: HomeContract.HomeView) : Presenter(), Home
if (!artists.isEmpty()) {
view.topArtists(artists)
}
- }, { view.showEmptyView() }, { view.completed() }))
+ }, { view.showEmptyView() }, { view.completed() })
}
override fun loadSuggestions() {
- disposable.add(repository.suggestionSongs
+ disposable += repository.suggestionSongs
.observeOn(schedulerProvider.ui())
.subscribeOn(schedulerProvider.io())
.doOnSubscribe { view.loading() }
- .subscribe({ songs -> view.suggestions(songs) }, { view.showEmptyView() }, { view.completed() }))
+ .subscribe({ songs -> view.suggestions(songs) },
+ { view.showEmptyView() }, { view.completed() })
}
override fun loadGenres() {
- disposable.add(repository.allGenres
+ disposable += repository.allGenres
.observeOn(schedulerProvider.ui())
.subscribeOn(schedulerProvider.io())
.doOnSubscribe { view.loading() }
@@ -99,7 +108,6 @@ class HomePresenter(private val view: HomeContract.HomeView) : Presenter(), Home
if (!genres.isEmpty()) {
view.geners(genres)
}
- },
- { view.showEmptyView() }, { view.completed() }))
+ }, { view.showEmptyView() }, { view.completed() })
}
}
diff --git a/app/src/main/java/code/name/monkey/retromusic/rest/KogouClient.java b/app/src/main/java/code/name/monkey/retromusic/rest/KogouClient.java
index dca902fa..906a2e1d 100644
--- a/app/src/main/java/code/name/monkey/retromusic/rest/KogouClient.java
+++ b/app/src/main/java/code/name/monkey/retromusic/rest/KogouClient.java
@@ -13,7 +13,6 @@ import okhttp3.Call;
import okhttp3.Interceptor;
import okhttp3.OkHttpClient;
import okhttp3.Request;
-import okhttp3.logging.HttpLoggingInterceptor;
import retrofit2.Retrofit;
import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory;
import retrofit2.converter.gson.GsonConverterFactory;
@@ -64,11 +63,7 @@ public class KogouClient {
}
private static OkHttpClient.Builder createDefaultOkHttpClientBuilder() {
- HttpLoggingInterceptor interceptor = new HttpLoggingInterceptor();
- interceptor.setLevel(HttpLoggingInterceptor.Level.BODY);
-
return new OkHttpClient.Builder()
- .addInterceptor(interceptor)
.cache(createDefaultCache(App.Companion.getInstance()))
.addInterceptor(createCacheControlInterceptor());
}
diff --git a/app/src/main/java/code/name/monkey/retromusic/ui/activities/base/AbsSlidingMusicPanelActivity.kt b/app/src/main/java/code/name/monkey/retromusic/ui/activities/base/AbsSlidingMusicPanelActivity.kt
index 94c9bb7a..292f2db5 100644
--- a/app/src/main/java/code/name/monkey/retromusic/ui/activities/base/AbsSlidingMusicPanelActivity.kt
+++ b/app/src/main/java/code/name/monkey/retromusic/ui/activities/base/AbsSlidingMusicPanelActivity.kt
@@ -136,7 +136,7 @@ abstract class AbsSlidingMusicPanelActivity protected constructor() : AbsMusicSe
bottomNavigationView.visibility = if (toggle) View.GONE else View.VISIBLE
}
- fun getBottomNavigationView(): BottomNavigationBarTinted? {
+ fun getBottomNavigationView(): BottomNavigationBarTinted {
return bottomNavigationView
}
diff --git a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/base/AbsMainActivityFragment.kt b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/base/AbsMainActivityFragment.kt
index f0a231f4..cb4babc4 100644
--- a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/base/AbsMainActivityFragment.kt
+++ b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/base/AbsMainActivityFragment.kt
@@ -8,10 +8,9 @@ import code.name.monkey.appthemehelper.ThemeStore
import code.name.monkey.appthemehelper.util.ColorUtil
import code.name.monkey.appthemehelper.util.VersionUtils
import code.name.monkey.retromusic.R
-import code.name.monkey.retromusic.dialogs.MainOptionsBottomSheetDialogFragment
+import code.name.monkey.retromusic.dialogs.OptionsSheetDialogFragment
import code.name.monkey.retromusic.ui.activities.MainActivity
-
abstract class AbsMainActivityFragment : AbsMusicServiceFragment() {
val mainActivity: MainActivity
@@ -51,6 +50,6 @@ abstract class AbsMainActivityFragment : AbsMusicServiceFragment() {
}
protected fun showMainMenu() {
- MainOptionsBottomSheetDialogFragment.newInstance().show(childFragmentManager, "Main Menu")
+ OptionsSheetDialogFragment.newInstance().show(childFragmentManager, "Main Menu")
}
}
diff --git a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/mainactivity/LibraryFragment.java b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/mainactivity/LibraryFragment.java
index 0e821672..eb6c8c49 100644
--- a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/mainactivity/LibraryFragment.java
+++ b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/mainactivity/LibraryFragment.java
@@ -2,6 +2,7 @@ package code.name.monkey.retromusic.ui.fragments.mainactivity;
import android.app.Activity;
import android.content.Intent;
+import android.graphics.Bitmap;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.Menu;
@@ -10,15 +11,20 @@ import android.view.MenuItem;
import android.view.SubMenu;
import android.view.View;
import android.view.ViewGroup;
+import android.widget.ImageView;
import android.widget.TextView;
import com.afollestad.materialcab.MaterialCab;
import com.google.android.material.appbar.AppBarLayout;
+import java.io.File;
+import java.util.Objects;
+
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.StringRes;
import androidx.appcompat.widget.Toolbar;
+import androidx.core.content.ContextCompat;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentTransaction;
@@ -38,9 +44,17 @@ import code.name.monkey.retromusic.loaders.SongLoader;
import code.name.monkey.retromusic.ui.activities.SettingsActivity;
import code.name.monkey.retromusic.ui.fragments.base.AbsLibraryPagerRecyclerViewCustomGridSizeFragment;
import code.name.monkey.retromusic.ui.fragments.base.AbsMainActivityFragment;
+import code.name.monkey.retromusic.ui.fragments.mainactivity.home.BannerHomeFragment;
+import code.name.monkey.retromusic.util.Compressor;
import code.name.monkey.retromusic.util.NavigationUtil;
+import code.name.monkey.retromusic.util.PreferenceUtil;
import code.name.monkey.retromusic.util.RetroColorUtil;
import code.name.monkey.retromusic.util.RetroUtil;
+import io.reactivex.android.schedulers.AndroidSchedulers;
+import io.reactivex.disposables.CompositeDisposable;
+import io.reactivex.schedulers.Schedulers;
+
+import static code.name.monkey.retromusic.Constants.USER_PROFILE;
public class LibraryFragment extends AbsMainActivityFragment implements CabHolder, MainActivityFragmentCallbacks {
@@ -54,6 +68,8 @@ public class LibraryFragment extends AbsMainActivityFragment implements CabHolde
private MaterialCab cab;
private FragmentManager fragmentManager;
+ private ImageView userImage;
+ private CompositeDisposable disposable = new CompositeDisposable();
public static Fragment newInstance(int tab) {
Bundle args = new Bundle();
@@ -76,9 +92,25 @@ public class LibraryFragment extends AbsMainActivityFragment implements CabHolde
bannerTitle = view.findViewById(R.id.bannerTitle);
appBarLayout = view.findViewById(R.id.appBarLayout);
toolbar = view.findViewById(R.id.toolbar);
+ userImage = view.findViewById(R.id.userImage);
+ userImage.setOnClickListener(v -> showMainMenu());
+ loadImageFromStorage();
return view;
}
+ private void loadImageFromStorage() {
+ disposable.add(new Compressor(Objects.requireNonNull(getContext()))
+ .setMaxHeight(300)
+ .setMaxWidth(300)
+ .setQuality(75)
+ .setCompressFormat(Bitmap.CompressFormat.WEBP)
+ .compressToBitmapAsFlowable(new File(PreferenceUtil.getInstance().getProfileImage(), USER_PROFILE))
+ .subscribeOn(Schedulers.io())
+ .observeOn(AndroidSchedulers.mainThread())
+ .subscribe(bitmap -> userImage.setImageBitmap(bitmap),
+ throwable -> userImage.setImageDrawable(ContextCompat.getDrawable(getContext(), R.drawable.ic_person_flat))));
+ }
+
public void setTitle(@StringRes int name) {
bannerTitle.setText(getString(name));
}
@@ -134,7 +166,7 @@ public class LibraryFragment extends AbsMainActivityFragment implements CabHolde
TintHelper.setTintAuto(contentContainer, primaryColor, true);
toolbar.setBackgroundColor(primaryColor);
- toolbar.setNavigationIcon(R.drawable.ic_menu_white_24dp);
+ toolbar.setNavigationIcon(R.drawable.ic_search_white_24dp);
appBarLayout.setBackgroundColor(primaryColor);
appBarLayout.addOnOffsetChangedListener((appBarLayout, verticalOffset) ->
getMainActivity().setLightStatusbar(!ATHUtil.isWindowBackgroundDark(getContext())));
@@ -169,7 +201,7 @@ public class LibraryFragment extends AbsMainActivityFragment implements CabHolde
@NonNull
@Override
- public MaterialCab openCab(int menuRes, MaterialCab.Callback callback) {
+ public MaterialCab openCab(int menuRes, @NonNull MaterialCab.Callback callback) {
if (cab != null && cab.isActive()) {
cab.finish();
}
@@ -348,9 +380,7 @@ public class LibraryFragment extends AbsMainActivityFragment implements CabHolde
MusicPlayerRemote.INSTANCE.openAndShuffleQueue(SongLoader.INSTANCE.getAllSongs(getContext())
.blockingFirst(), true);
return true;
- case R.id.action_search:
- NavigationUtil.goToSearch(getMainActivity());
- break;
+
case R.id.action_equalizer:
NavigationUtil.openEqualizer(getActivity());
return true;
diff --git a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/mainactivity/folders/FoldersFragment.java b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/mainactivity/folders/FoldersFragment.java
index 1dbd69da..f20fc07c 100644
--- a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/mainactivity/folders/FoldersFragment.java
+++ b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/mainactivity/folders/FoldersFragment.java
@@ -230,14 +230,17 @@ public class FoldersFragment extends AbsMainActivityFragment implements
//noinspection ConstantConditions
int primaryColor = ThemeStore.primaryColor(getContext());
-
- toolbar.setNavigationIcon(R.drawable.ic_menu_white_24dp);
+ toolbar.setNavigationIcon(R.drawable.ic_keyboard_backspace_black_24dp);
//noinspection ConstantConditions
+
getActivity().setTitle(null);
getMainActivity().setSupportActionBar(toolbar);
TintHelper.setTintAuto(container, primaryColor, true);
appBarLayout.setBackgroundColor(primaryColor);
toolbar.setBackgroundColor(primaryColor);
+ toolbar.setNavigationOnClickListener(v -> {
+ getActivity().onBackPressed();
+ });
breadCrumbs.setActivatedContentColor(ToolbarContentTintHelper.toolbarTitleColor(getActivity(), ColorUtil.darkenColor(primaryColor)));
breadCrumbs.setDeactivatedContentColor(ToolbarContentTintHelper.toolbarSubtitleColor(getActivity(), ColorUtil.darkenColor(primaryColor)));
diff --git a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/mainactivity/home/BannerHomeFragment.kt b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/mainactivity/home/BannerHomeFragment.kt
index 35471ea0..428e4f98 100644
--- a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/mainactivity/home/BannerHomeFragment.kt
+++ b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/mainactivity/home/BannerHomeFragment.kt
@@ -40,7 +40,6 @@ import com.bumptech.glide.load.engine.DiskCacheStrategy
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.disposables.CompositeDisposable
import io.reactivex.schedulers.Schedulers
-import kotlinx.android.synthetic.main.abs_playlists.*
import kotlinx.android.synthetic.main.fragment_banner_home.*
import kotlinx.android.synthetic.main.home_section_content.*
import java.io.File
@@ -58,11 +57,6 @@ class BannerHomeFragment : AbsMainActivityFragment(), MainActivityFragmentCallba
private lateinit var userImage: ImageView
private lateinit var toolbar: Toolbar
- override fun onActivityCreated(savedInstanceState: Bundle?) {
- super.onActivityCreated(savedInstanceState)
- mainActivity.setBottomBarVisibility(View.GONE)
- }
-
override fun onCreateView(inflater: LayoutInflater, viewGroup: ViewGroup?, savedInstanceState: Bundle?): View? {
return inflater.inflate(if (PreferenceUtil.getInstance().isHomeBanner) R.layout.fragment_banner_home else R.layout.fragment_home, viewGroup, false)
}
@@ -95,16 +89,14 @@ class BannerHomeFragment : AbsMainActivityFragment(), MainActivityFragmentCallba
private fun loadTimeImage(day: String) {
-
if (bannerImage != null) {
if (PreferenceUtil.getInstance().bannerImage.isEmpty()) {
- Glide.with(activity).load(day)
+ /*Glide.with(activity).load(day)
.asBitmap()
.placeholder(R.drawable.material_design_default)
.diskCacheStrategy(DiskCacheStrategy.SOURCE)
- .into(bannerImage!!)
+ .into(bannerImage!!)*/
} else {
-
disposable.add(Compressor(context!!)
.setQuality(100)
.setCompressFormat(Bitmap.CompressFormat.WEBP)
@@ -140,8 +132,6 @@ class BannerHomeFragment : AbsMainActivityFragment(), MainActivityFragmentCallba
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
- mainActivity.setBottomBarVisibility(View.GONE)
-
toolbar = view.findViewById(R.id.toolbar)
if (!PreferenceUtil.getInstance().isHomeBanner)
@@ -183,13 +173,10 @@ class BannerHomeFragment : AbsMainActivityFragment(), MainActivityFragmentCallba
loadImageFromStorage(userImage)
getTimeOfTheDay()
- searchView.setOnClickListener {
- NavigationUtil.goToSearch(activity!!)
- }
}
private fun setupToolbar() {
- toolbar.navigationIcon = TintHelper.createTintedDrawable(ContextCompat.getDrawable(context!!, R.drawable.ic_menu_white_24dp), ThemeStore.textColorPrimary(context!!))
+ toolbar.navigationIcon = TintHelper.createTintedDrawable(ContextCompat.getDrawable(context!!, R.drawable.ic_search_white_24dp), ThemeStore.textColorPrimary(context!!))
mainActivity.title = null
mainActivity.setSupportActionBar(toolbar)
toolbar.setBackgroundColor(Color.TRANSPARENT)
diff --git a/app/src/main/res/drawable/color_progress_seek.xml b/app/src/main/res/drawable/color_progress_seek.xml
index 8091c388..5ad5b9a6 100755
--- a/app/src/main/res/drawable/color_progress_seek.xml
+++ b/app/src/main/res/drawable/color_progress_seek.xml
@@ -1,7 +1,7 @@
-
-
+
@@ -9,7 +9,7 @@
-
-
+
@@ -17,9 +17,9 @@
-
-
+
-
+
diff --git a/app/src/main/res/layout-xlarge/abs_playlists.xml b/app/src/main/res/layout-xlarge/abs_playlists.xml
index 8cba5ffa..5ec995ee 100644
--- a/app/src/main/res/layout-xlarge/abs_playlists.xml
+++ b/app/src/main/res/layout-xlarge/abs_playlists.xml
@@ -5,28 +5,6 @@
android:layout_height="wrap_content"
android:orientation="vertical">
-
-
-
-
-
-
-
diff --git a/app/src/main/res/layout/abs_playlists.xml b/app/src/main/res/layout/abs_playlists.xml
index 7832c9fa..4bb235dc 100644
--- a/app/src/main/res/layout/abs_playlists.xml
+++ b/app/src/main/res/layout/abs_playlists.xml
@@ -5,28 +5,6 @@
android:layout_height="wrap_content"
android:orientation="vertical">
-
-
-
-
-
-
-
diff --git a/app/src/main/res/layout/activity_lyrics.xml b/app/src/main/res/layout/activity_lyrics.xml
index 308f97aa..19aa19d0 100644
--- a/app/src/main/res/layout/activity_lyrics.xml
+++ b/app/src/main/res/layout/activity_lyrics.xml
@@ -17,7 +17,7 @@
app:contentInsetLeft="0dp"
app:contentInsetStart="0dp"
app:contentInsetStartWithNavigation="0dp"
- app:layout_scrollFlags="scroll|enterAlways"
+ app:layout_scrollFlags="scroll|exitUntilCollapsed"
app:subtitleTextAppearance="@style/TextAppearance.AppCompat.Caption"
app:titleMargin="0dp"
app:titleMarginStart="0dp"
diff --git a/app/src/main/res/layout/activity_main_drawer_layout.xml b/app/src/main/res/layout/activity_main_drawer_layout.xml
index 368a024a..78578bf2 100644
--- a/app/src/main/res/layout/activity_main_drawer_layout.xml
+++ b/app/src/main/res/layout/activity_main_drawer_layout.xml
@@ -1,6 +1,5 @@
-
@@ -10,16 +9,4 @@
android:layout_width="match_parent"
android:layout_height="match_parent" />
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_playlist_detail.xml b/app/src/main/res/layout/activity_playlist_detail.xml
index 4b7e426b..6767488c 100644
--- a/app/src/main/res/layout/activity_playlist_detail.xml
+++ b/app/src/main/res/layout/activity_playlist_detail.xml
@@ -2,7 +2,6 @@
@@ -61,14 +60,13 @@
tools:background="@color/md_white_1000">
diff --git a/app/src/main/res/layout/fragment_library.xml b/app/src/main/res/layout/fragment_library.xml
index 47b315cc..e6ac016e 100644
--- a/app/src/main/res/layout/fragment_library.xml
+++ b/app/src/main/res/layout/fragment_library.xml
@@ -34,20 +34,36 @@
android:layout_height="wrap_content"
app:layout_scrollFlags="scroll|enterAlways">
-
+
-
+
-
+
+
+
+
+
+
+ android:fadingEdge="vertical"
+ app:layout_behavior="@string/appbar_scrolling_view_behavior">
+ android:textAppearance="@style/TextAppearance.MaterialComponents.Body1" />
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_main_options.xml b/app/src/main/res/layout/fragment_main_options.xml
index 31ece678..656e96f1 100644
--- a/app/src/main/res/layout/fragment_main_options.xml
+++ b/app/src/main/res/layout/fragment_main_options.xml
@@ -7,8 +7,6 @@
android:orientation="vertical"
tools:ignore="MissingPrefix">
-
-
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_mini_player.xml b/app/src/main/res/layout/fragment_mini_player.xml
index ebc5cad1..f697c263 100644
--- a/app/src/main/res/layout/fragment_mini_player.xml
+++ b/app/src/main/res/layout/fragment_mini_player.xml
@@ -89,6 +89,7 @@
android:layout_width="match_parent"
android:layout_height="3dp"
android:progress="20"
+ android:progressDrawable="@drawable/color_progress_seek"
app:mpb_progressStyle="horizontal"
app:mpb_useIntrinsicPadding="false" />
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_synced.xml b/app/src/main/res/layout/fragment_synced.xml
index 205f3683..00fae9f4 100644
--- a/app/src/main/res/layout/fragment_synced.xml
+++ b/app/src/main/res/layout/fragment_synced.xml
@@ -1,19 +1,20 @@
+ android:orientation="vertical"
+ app:layout_behavior="@string/appbar_scrolling_view_behavior">
+ app:textSize="18sp" />
\ No newline at end of file
diff --git a/app/src/main/res/menu/bottom_navigation_main.xml b/app/src/main/res/menu/bottom_navigation_main.xml
index 6f80430a..d2412258 100644
--- a/app/src/main/res/menu/bottom_navigation_main.xml
+++ b/app/src/main/res/menu/bottom_navigation_main.xml
@@ -1,6 +1,12 @@