refactor code

This commit is contained in:
h4h13 2018-12-13 02:32:14 +05:30
parent f4c56c8484
commit d6a99f99e4
29 changed files with 299 additions and 178 deletions

File diff suppressed because one or more lines are too long

View file

@ -1,6 +1,7 @@
apply plugin: 'com.android.application' apply plugin: 'com.android.application'
apply plugin: 'kotlin-android' apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions' apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
static def gitBranch() { static def gitBranch() {
def branch = 'GitHub' def branch = 'GitHub'
@ -31,8 +32,8 @@ android {
vectorDrawables.useSupportLibrary = true vectorDrawables.useSupportLibrary = true
applicationId "code.name.monkey.retromusic" applicationId "code.name.monkey.retromusic"
versionCode 262 versionCode 263
versionName '3.0.030' versionName '3.0.130'
multiDexEnabled true multiDexEnabled true
@ -144,12 +145,10 @@ dependencies {
implementation "com.afollestad.material-dialogs:core:$materialDialog" implementation "com.afollestad.material-dialogs:core:$materialDialog"
implementation "com.afollestad.material-dialogs:commons:$materialDialog" implementation "com.afollestad.material-dialogs:commons:$materialDialog"
implementation 'com.afollestad:material-cab:0.1.12' implementation 'com.afollestad:material-cab:0.1.12'
implementation 'com.github.bumptech.glide:glide:3.8.0' implementation 'com.github.bumptech.glide:glide:4.8.0'
implementation 'com.github.bumptech.glide:okhttp3-integration:1.5.0' implementation 'com.github.bumptech.glide:okhttp3-integration:4.8.0'
implementation 'io.reactivex.rxjava2:rxandroid:2.0.2' implementation 'io.reactivex.rxjava2:rxandroid:2.0.2'
implementation 'io.reactivex.rxjava2:rxjava:2.1.17' 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') { implementation('com.h6ah4i.android.widget.advrecyclerview:advrecyclerview:0.11.0@aar') {
transitive = true transitive = true
} }
@ -170,6 +169,8 @@ dependencies {
implementation 'org.eclipse.mylyn.github:org.eclipse.egit.github.core:2.1.5' 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.jetradarmobile:android-snowfall:1.2.0'
implementation 'com.github.javiersantos:PiracyChecker:1.2.4' implementation 'com.github.javiersantos:PiracyChecker:1.2.4'
kapt 'com.github.bumptech.glide:compiler:4.8.0'
} }
repositories { repositories {
mavenCentral() mavenCentral()

View file

@ -1 +1 @@
<html> <head> <style type="text/css"> * { word-wrap: break-word; } {style-placeholder} a { color: #{link-color}; } a:active { color: #{link-color-active}; } ul { list-style-position: outside; padding-left: 0; padding-right: 0; margin-left: 1em; } li { padding-top: 8px; } </style> </head> <body> <h3>Version 3.0.00</h3> <ul style="line-height:150%"> <li>Converted app to kotlin</li> <li>Now you can add plain text home screen widget</li> <li>Good old side navigation bar for options</li> <li>Bug report for better tracking with milestones</li> <li>Snow fall effect can be enable from other settings</li> <li>Click new music mix to play songs</li> <li>Gradient image option for gird list</li> <li>Clear button for playing queue</li> <li>Folder list back button</li> <li>New theme Fit</li> <li>On library click on toolbar for accessing main menu </li> <li>On home click on toolbar for accessing search </li> <li>BottomSheetDialogue is now adaptable to screens, background colour and text size consistency. </li> <li>Removed coloured navigation bar option to making app adapt the primary colour</li> <li>Swipe up gesture for now playing removed, replaced with "tap to open", To achieve transparent navigation bar for desired themes. </li> <li>Improved tablet UI and home screen by adding suggestions toggle banner issues.</li> <li>Improving lyrics page</li> </ul> <p style="line-height:150%"><a href="https://github.com/h4h13/RetroMusicPlayer/wiki/FAQ">FAQ's</a> </p> <p style="line-height:150%">*If you face any UI related issues you clear app data and cache, if its not working try to uninstall and install again. </p> </body> <html> <head> <style type="text/css"> * { word-wrap: break-word; } {style-placeholder} a { color: #{link-color}; } a:active { color: #{link-color-active}; } ul { list-style-position: outside; padding-left: 0; padding-right: 0; margin-left: 1em; } li { padding-top: 8px; } </style> </head> <body> <h3>Version 3.0.00</h3> <ul style="line-height:150%"> <li>Converted app to kotlin</li> <li>Now you can add plain text home screen widget</li> <li>Good old side navigation bar for options</li> <li>Bug report for better tracking with milestones</li> <li>Snow fall effect can be enable from other settings(Works only one normal theme)</li> <li>Click new music mix to play songs</li> <li>Gradient image option for gird list</li> <li>Clear button for playing queue</li> <li>Folder list back button</li> <li>New theme Fit</li> <li>On library click on toolbar for accessing main menu </li> <li>On home click on toolbar for accessing search </li> <li>BottomSheetDialogue is now adaptable to screens, background colour and text size consistency. </li> <li>Removed coloured navigation bar option to making app adapt the primary colour</li> <li>Swipe up gesture for now playing removed, replaced with "tap to open", To achieve transparent navigation bar for desired themes. </li> <li>Improved tablet UI and home screen by adding suggestions toggle banner issues.</li> <li>Improving lyrics page</li> </ul> <p style="line-height:150%"><a href="https://github.com/h4h13/RetroMusicPlayer/wiki/FAQ">FAQ's</a> </p> <p style="line-height:150%">*If you face any UI related issues you clear app data and cache, if its not working try to uninstall and install again. </p> </body>

View file

@ -1,15 +1,20 @@
package code.name.monkey.retromusic.dialogs package code.name.monkey.retromusic.dialogs
import android.content.Intent
import android.graphics.Bitmap import android.graphics.Bitmap
import android.os.Bundle import android.os.Bundle
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import androidx.core.app.ShareCompat
import androidx.core.content.ContextCompat import androidx.core.content.ContextCompat
import code.name.monkey.appthemehelper.ThemeStore 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.Constants.USER_PROFILE
import code.name.monkey.retromusic.R import code.name.monkey.retromusic.R
import code.name.monkey.retromusic.ui.activities.MainActivity 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.Compressor
import code.name.monkey.retromusic.util.NavigationUtil import code.name.monkey.retromusic.util.NavigationUtil
import code.name.monkey.retromusic.util.PreferenceUtil 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.io.File
import java.util.* import java.util.*
class MainOptionsBottomSheetDialogFragment : RoundedBottomSheetDialogFragment(), View.OnClickListener { class OptionsSheetDialogFragment : RoundedBottomSheetDialogFragment(), View.OnClickListener {
private val disposable = CompositeDisposable() private val disposable = CompositeDisposable()
@ -52,6 +57,7 @@ class MainOptionsBottomSheetDialogFragment : RoundedBottomSheetDialogFragment(),
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState) super.onViewCreated(view, savedInstanceState)
actionBuyPro.visibility = if (!App.isProVersion) View.VISIBLE else View.GONE
text!!.setTextColor(ThemeStore.textColorSecondary(context!!)) text!!.setTextColor(ThemeStore.textColorSecondary(context!!))
titleWelcome!!.setTextColor(ThemeStore.textColorPrimary(context!!)) titleWelcome!!.setTextColor(ThemeStore.textColorPrimary(context!!))
titleWelcome!!.text = String.format("%s %s!", timeOfTheDay, PreferenceUtil.getInstance().userName) titleWelcome!!.text = String.format("%s %s!", timeOfTheDay, PreferenceUtil.getInstance().userName)
@ -61,24 +67,51 @@ class MainOptionsBottomSheetDialogFragment : RoundedBottomSheetDialogFragment(),
actionAbout.setOnClickListener(this) actionAbout.setOnClickListener(this)
actionSleepTimer.setOnClickListener(this) actionSleepTimer.setOnClickListener(this)
userInfoContainer.setOnClickListener(this) userInfoContainer.setOnClickListener(this)
actionEqualizer.setOnClickListener(this)
actionFolders.setOnClickListener(this)
actionRate.setOnClickListener(this) actionRate.setOnClickListener(this)
actionShare.setOnClickListener(this)
actionBuyPro.setOnClickListener(this)
actionBugReport.setOnClickListener(this)
} }
override fun onClick(view: View) { override fun onClick(view: View) {
val mainActivity = activity as MainActivity? ?: return val mainActivity = activity as MainActivity? ?: return
when (view.id) { when (view.id) {
R.id.actionFolders -> {
mainActivity.setCurrentFragment(FoldersFragment.newInstance(context), true)
}
R.id.actionSettings -> NavigationUtil.goToSettings(mainActivity) R.id.actionSettings -> NavigationUtil.goToSettings(mainActivity)
R.id.actionAbout -> NavigationUtil.goToAbout(mainActivity) R.id.actionAbout -> NavigationUtil.goToAbout(mainActivity)
R.id.actionSleepTimer -> if (fragmentManager != null) { R.id.actionSleepTimer -> if (fragmentManager != null) {
SleepTimerDialog().show(fragmentManager!!, TAG) SleepTimerDialog().show(fragmentManager!!, TAG)
} }
R.id.userInfoContainer -> NavigationUtil.goToUserInfo(activity!!) R.id.userInfoContainer -> NavigationUtil.goToUserInfo(mainActivity)
R.id.actionRate -> NavigationUtil.goToPlayStore(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() 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() { private fun loadImageFromStorage() {
disposable.add(Compressor(context!!) disposable.add(Compressor(context!!)
@ -102,16 +135,16 @@ class MainOptionsBottomSheetDialogFragment : RoundedBottomSheetDialogFragment(),
private const val TAG: String = "MainOptionsBottomSheetD" private const val TAG: String = "MainOptionsBottomSheetD"
fun newInstance(selected_id: Int): MainOptionsBottomSheetDialogFragment { fun newInstance(selected_id: Int): OptionsSheetDialogFragment {
val bundle = Bundle() val bundle = Bundle()
bundle.putInt("selected_id", selected_id) bundle.putInt("selected_id", selected_id)
val fragment = MainOptionsBottomSheetDialogFragment() val fragment = OptionsSheetDialogFragment()
fragment.arguments = bundle fragment.arguments = bundle
return fragment return fragment
} }
fun newInstance(): MainOptionsBottomSheetDialogFragment { fun newInstance(): OptionsSheetDialogFragment {
return MainOptionsBottomSheetDialogFragment() return OptionsSheetDialogFragment()
} }
} }
} }

View file

@ -2,9 +2,9 @@ package code.name.monkey.retromusic.loaders
import android.content.Context import android.content.Context
import code.name.monkey.retromusic.misc.DisposingObserver
import java.util.ArrayList
import code.name.monkey.retromusic.model.Playlist 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.AbsSmartPlaylist
import code.name.monkey.retromusic.model.smartplaylist.HistoryPlaylist import code.name.monkey.retromusic.model.smartplaylist.HistoryPlaylist
import code.name.monkey.retromusic.model.smartplaylist.LastAddedPlaylist import code.name.monkey.retromusic.model.smartplaylist.LastAddedPlaylist
@ -13,9 +13,9 @@ import io.reactivex.Observable
object HomeLoader { object HomeLoader {
fun getRecentAndTopThings( fun getRecentAndTopThings(context: Context): Observable<ArrayList<AbsSmartPlaylist>> {
context: Context): Observable<ArrayList<AbsSmartPlaylist>> {
val objects = ArrayList<AbsSmartPlaylist>() val objects = ArrayList<AbsSmartPlaylist>()
return Observable.create { e -> return Observable.create { e ->
HistoryPlaylist(context).getSongs(context).subscribe { songs -> HistoryPlaylist(context).getSongs(context).subscribe { songs ->
@ -56,6 +56,4 @@ object HomeLoader {
} }
return Observable.just(playlists) return Observable.just(playlists)
} }
} }

View file

@ -24,7 +24,7 @@ object LastAddedSongsLoader {
return SongLoader.getSongs(makeLastAddedCursor(context)) return SongLoader.getSongs(makeLastAddedCursor(context))
} }
fun makeLastAddedCursor(@NonNull context: Context): Cursor? { private fun makeLastAddedCursor(@NonNull context: Context): Cursor? {
val cutoff = PreferenceUtil.getInstance().lastAddedCutoff val cutoff = PreferenceUtil.getInstance().lastAddedCutoff
return SongLoader.makeSongCursor( return SongLoader.makeSongCursor(

View file

@ -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!!
}
}

View file

@ -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<T> : Observer<T> {
@CallSuper
override fun onSubscribe(d: Disposable) {
DisposableManager.add(d)
}
override fun onNext(next: T) {}
override fun onError(e: Throwable) {}
override fun onComplete() {}
}

View file

@ -3,6 +3,12 @@ package code.name.monkey.retromusic.mvp.presenter
import 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.mvp.contract.HomeContract
import code.name.monkey.retromusic.util.PreferenceUtil 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 { 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() { override fun unsubscribe() {
disposable.clear() if (!disposable.isDisposed) {
disposable.dispose()
}
} }
fun loadPlaylists() { fun loadPlaylists() {
disposable.add(repository.allPlaylists disposable += repository.allPlaylists
.observeOn(schedulerProvider.ui()) .observeOn(schedulerProvider.ui())
.subscribeOn(schedulerProvider.io()) .subscribeOn(schedulerProvider.io())
.subscribe({ playlist -> .subscribe({ playlist ->
if (!playlist.isEmpty()) { if (!playlist.isEmpty()) {
view.playlists(playlist) view.playlists(playlist)
} }
}, { view.showEmptyView() }, { view.completed() })) }, { view.showEmptyView() }, { view.completed() })
} }
override fun loadRecentAlbums() { override fun loadRecentAlbums() {
disposable.add(repository.recentAlbums disposable += repository.recentAlbums
.observeOn(schedulerProvider.ui()) .observeOn(schedulerProvider.ui())
.subscribeOn(schedulerProvider.io()) .subscribeOn(schedulerProvider.io())
.doOnSubscribe { view.loading() } .doOnSubscribe { view.loading() }
@ -42,11 +50,11 @@ class HomePresenter(private val view: HomeContract.HomeView) : Presenter(), Home
if (!artists.isEmpty()) { if (!artists.isEmpty()) {
view.recentAlbum(artists) view.recentAlbum(artists)
} }
}, { view.showEmptyView() }, { view.completed() })) }, { view.showEmptyView() }, { view.completed() })
} }
override fun loadTopAlbums() { override fun loadTopAlbums() {
disposable.add(repository.topAlbums disposable += repository.topAlbums
.observeOn(schedulerProvider.ui()) .observeOn(schedulerProvider.ui())
.subscribeOn(schedulerProvider.io()) .subscribeOn(schedulerProvider.io())
.doOnSubscribe { view.loading() } .doOnSubscribe { view.loading() }
@ -54,11 +62,11 @@ class HomePresenter(private val view: HomeContract.HomeView) : Presenter(), Home
if (!artists.isEmpty()) { if (!artists.isEmpty()) {
view.topAlbums(artists) view.topAlbums(artists)
} }
}, { view.showEmptyView() }, { view.completed() })) }, { view.showEmptyView() }, { view.completed() })
} }
override fun loadRecentArtists() { override fun loadRecentArtists() {
disposable.add(repository.recentArtists disposable += repository.recentArtists
.observeOn(schedulerProvider.ui()) .observeOn(schedulerProvider.ui())
.subscribeOn(schedulerProvider.io()) .subscribeOn(schedulerProvider.io())
.doOnSubscribe { view.loading() } .doOnSubscribe { view.loading() }
@ -66,11 +74,11 @@ class HomePresenter(private val view: HomeContract.HomeView) : Presenter(), Home
if (!artists.isEmpty()) { if (!artists.isEmpty()) {
view.recentArtist(artists) view.recentArtist(artists)
} }
}, { view.showEmptyView() }, { view.completed() })) }, { view.showEmptyView() }, { view.completed() })
} }
override fun loadTopArtists() { override fun loadTopArtists() {
disposable.add(repository.topArtists disposable += repository.topArtists
.observeOn(schedulerProvider.ui()) .observeOn(schedulerProvider.ui())
.subscribeOn(schedulerProvider.io()) .subscribeOn(schedulerProvider.io())
.doOnSubscribe { view.loading() } .doOnSubscribe { view.loading() }
@ -78,20 +86,21 @@ class HomePresenter(private val view: HomeContract.HomeView) : Presenter(), Home
if (!artists.isEmpty()) { if (!artists.isEmpty()) {
view.topArtists(artists) view.topArtists(artists)
} }
}, { view.showEmptyView() }, { view.completed() })) }, { view.showEmptyView() }, { view.completed() })
} }
override fun loadSuggestions() { override fun loadSuggestions() {
disposable.add(repository.suggestionSongs disposable += repository.suggestionSongs
.observeOn(schedulerProvider.ui()) .observeOn(schedulerProvider.ui())
.subscribeOn(schedulerProvider.io()) .subscribeOn(schedulerProvider.io())
.doOnSubscribe { view.loading() } .doOnSubscribe { view.loading() }
.subscribe({ songs -> view.suggestions(songs) }, { view.showEmptyView() }, { view.completed() })) .subscribe({ songs -> view.suggestions(songs) },
{ view.showEmptyView() }, { view.completed() })
} }
override fun loadGenres() { override fun loadGenres() {
disposable.add(repository.allGenres disposable += repository.allGenres
.observeOn(schedulerProvider.ui()) .observeOn(schedulerProvider.ui())
.subscribeOn(schedulerProvider.io()) .subscribeOn(schedulerProvider.io())
.doOnSubscribe { view.loading() } .doOnSubscribe { view.loading() }
@ -99,7 +108,6 @@ class HomePresenter(private val view: HomeContract.HomeView) : Presenter(), Home
if (!genres.isEmpty()) { if (!genres.isEmpty()) {
view.geners(genres) view.geners(genres)
} }
}, }, { view.showEmptyView() }, { view.completed() })
{ view.showEmptyView() }, { view.completed() }))
} }
} }

View file

@ -13,7 +13,6 @@ import okhttp3.Call;
import okhttp3.Interceptor; import okhttp3.Interceptor;
import okhttp3.OkHttpClient; import okhttp3.OkHttpClient;
import okhttp3.Request; import okhttp3.Request;
import okhttp3.logging.HttpLoggingInterceptor;
import retrofit2.Retrofit; import retrofit2.Retrofit;
import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory; import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory;
import retrofit2.converter.gson.GsonConverterFactory; import retrofit2.converter.gson.GsonConverterFactory;
@ -64,11 +63,7 @@ public class KogouClient {
} }
private static OkHttpClient.Builder createDefaultOkHttpClientBuilder() { private static OkHttpClient.Builder createDefaultOkHttpClientBuilder() {
HttpLoggingInterceptor interceptor = new HttpLoggingInterceptor();
interceptor.setLevel(HttpLoggingInterceptor.Level.BODY);
return new OkHttpClient.Builder() return new OkHttpClient.Builder()
.addInterceptor(interceptor)
.cache(createDefaultCache(App.Companion.getInstance())) .cache(createDefaultCache(App.Companion.getInstance()))
.addInterceptor(createCacheControlInterceptor()); .addInterceptor(createCacheControlInterceptor());
} }

View file

@ -136,7 +136,7 @@ abstract class AbsSlidingMusicPanelActivity protected constructor() : AbsMusicSe
bottomNavigationView.visibility = if (toggle) View.GONE else View.VISIBLE bottomNavigationView.visibility = if (toggle) View.GONE else View.VISIBLE
} }
fun getBottomNavigationView(): BottomNavigationBarTinted? { fun getBottomNavigationView(): BottomNavigationBarTinted {
return bottomNavigationView return bottomNavigationView
} }

View file

@ -8,10 +8,9 @@ import code.name.monkey.appthemehelper.ThemeStore
import code.name.monkey.appthemehelper.util.ColorUtil import code.name.monkey.appthemehelper.util.ColorUtil
import code.name.monkey.appthemehelper.util.VersionUtils import code.name.monkey.appthemehelper.util.VersionUtils
import code.name.monkey.retromusic.R 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 import code.name.monkey.retromusic.ui.activities.MainActivity
abstract class AbsMainActivityFragment : AbsMusicServiceFragment() { abstract class AbsMainActivityFragment : AbsMusicServiceFragment() {
val mainActivity: MainActivity val mainActivity: MainActivity
@ -51,6 +50,6 @@ abstract class AbsMainActivityFragment : AbsMusicServiceFragment() {
} }
protected fun showMainMenu() { protected fun showMainMenu() {
MainOptionsBottomSheetDialogFragment.newInstance().show(childFragmentManager, "Main Menu") OptionsSheetDialogFragment.newInstance().show(childFragmentManager, "Main Menu")
} }
} }

View file

@ -2,6 +2,7 @@ package code.name.monkey.retromusic.ui.fragments.mainactivity;
import android.app.Activity; import android.app.Activity;
import android.content.Intent; import android.content.Intent;
import android.graphics.Bitmap;
import android.os.Bundle; import android.os.Bundle;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.Menu; import android.view.Menu;
@ -10,15 +11,20 @@ import android.view.MenuItem;
import android.view.SubMenu; 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.TextView; import android.widget.TextView;
import com.afollestad.materialcab.MaterialCab; import com.afollestad.materialcab.MaterialCab;
import com.google.android.material.appbar.AppBarLayout; import com.google.android.material.appbar.AppBarLayout;
import java.io.File;
import java.util.Objects;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.annotation.StringRes; import androidx.annotation.StringRes;
import androidx.appcompat.widget.Toolbar; import androidx.appcompat.widget.Toolbar;
import androidx.core.content.ContextCompat;
import androidx.fragment.app.Fragment; import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager; import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentTransaction; 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.activities.SettingsActivity;
import code.name.monkey.retromusic.ui.fragments.base.AbsLibraryPagerRecyclerViewCustomGridSizeFragment; 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.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.NavigationUtil;
import code.name.monkey.retromusic.util.PreferenceUtil;
import code.name.monkey.retromusic.util.RetroColorUtil; import code.name.monkey.retromusic.util.RetroColorUtil;
import code.name.monkey.retromusic.util.RetroUtil; 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 { public class LibraryFragment extends AbsMainActivityFragment implements CabHolder, MainActivityFragmentCallbacks {
@ -54,6 +68,8 @@ public class LibraryFragment extends AbsMainActivityFragment implements CabHolde
private MaterialCab cab; private MaterialCab cab;
private FragmentManager fragmentManager; private FragmentManager fragmentManager;
private ImageView userImage;
private CompositeDisposable disposable = new CompositeDisposable();
public static Fragment newInstance(int tab) { public static Fragment newInstance(int tab) {
Bundle args = new Bundle(); Bundle args = new Bundle();
@ -76,9 +92,25 @@ public class LibraryFragment extends AbsMainActivityFragment implements CabHolde
bannerTitle = view.findViewById(R.id.bannerTitle); 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.setOnClickListener(v -> showMainMenu());
loadImageFromStorage();
return view; 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) { public void setTitle(@StringRes int name) {
bannerTitle.setText(getString(name)); bannerTitle.setText(getString(name));
} }
@ -134,7 +166,7 @@ public class LibraryFragment extends AbsMainActivityFragment implements CabHolde
TintHelper.setTintAuto(contentContainer, primaryColor, true); TintHelper.setTintAuto(contentContainer, primaryColor, true);
toolbar.setBackgroundColor(primaryColor); toolbar.setBackgroundColor(primaryColor);
toolbar.setNavigationIcon(R.drawable.ic_menu_white_24dp); toolbar.setNavigationIcon(R.drawable.ic_search_white_24dp);
appBarLayout.setBackgroundColor(primaryColor); appBarLayout.setBackgroundColor(primaryColor);
appBarLayout.addOnOffsetChangedListener((appBarLayout, verticalOffset) -> appBarLayout.addOnOffsetChangedListener((appBarLayout, verticalOffset) ->
getMainActivity().setLightStatusbar(!ATHUtil.isWindowBackgroundDark(getContext()))); getMainActivity().setLightStatusbar(!ATHUtil.isWindowBackgroundDark(getContext())));
@ -169,7 +201,7 @@ public class LibraryFragment extends AbsMainActivityFragment implements CabHolde
@NonNull @NonNull
@Override @Override
public MaterialCab openCab(int menuRes, MaterialCab.Callback callback) { public MaterialCab openCab(int menuRes, @NonNull MaterialCab.Callback callback) {
if (cab != null && cab.isActive()) { if (cab != null && cab.isActive()) {
cab.finish(); cab.finish();
} }
@ -348,9 +380,7 @@ public class LibraryFragment extends AbsMainActivityFragment implements CabHolde
MusicPlayerRemote.INSTANCE.openAndShuffleQueue(SongLoader.INSTANCE.getAllSongs(getContext()) MusicPlayerRemote.INSTANCE.openAndShuffleQueue(SongLoader.INSTANCE.getAllSongs(getContext())
.blockingFirst(), true); .blockingFirst(), true);
return true; return true;
case R.id.action_search:
NavigationUtil.goToSearch(getMainActivity());
break;
case R.id.action_equalizer: case R.id.action_equalizer:
NavigationUtil.openEqualizer(getActivity()); NavigationUtil.openEqualizer(getActivity());
return true; return true;

View file

@ -230,14 +230,17 @@ public class FoldersFragment extends AbsMainActivityFragment implements
//noinspection ConstantConditions //noinspection ConstantConditions
int primaryColor = ThemeStore.primaryColor(getContext()); int primaryColor = ThemeStore.primaryColor(getContext());
toolbar.setNavigationIcon(R.drawable.ic_keyboard_backspace_black_24dp);
toolbar.setNavigationIcon(R.drawable.ic_menu_white_24dp);
//noinspection ConstantConditions //noinspection ConstantConditions
getActivity().setTitle(null); getActivity().setTitle(null);
getMainActivity().setSupportActionBar(toolbar); getMainActivity().setSupportActionBar(toolbar);
TintHelper.setTintAuto(container, primaryColor, true); TintHelper.setTintAuto(container, primaryColor, true);
appBarLayout.setBackgroundColor(primaryColor); appBarLayout.setBackgroundColor(primaryColor);
toolbar.setBackgroundColor(primaryColor); toolbar.setBackgroundColor(primaryColor);
toolbar.setNavigationOnClickListener(v -> {
getActivity().onBackPressed();
});
breadCrumbs.setActivatedContentColor(ToolbarContentTintHelper.toolbarTitleColor(getActivity(), ColorUtil.darkenColor(primaryColor))); breadCrumbs.setActivatedContentColor(ToolbarContentTintHelper.toolbarTitleColor(getActivity(), ColorUtil.darkenColor(primaryColor)));
breadCrumbs.setDeactivatedContentColor(ToolbarContentTintHelper.toolbarSubtitleColor(getActivity(), ColorUtil.darkenColor(primaryColor))); breadCrumbs.setDeactivatedContentColor(ToolbarContentTintHelper.toolbarSubtitleColor(getActivity(), ColorUtil.darkenColor(primaryColor)));

View file

@ -40,7 +40,6 @@ import com.bumptech.glide.load.engine.DiskCacheStrategy
import io.reactivex.android.schedulers.AndroidSchedulers import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.disposables.CompositeDisposable import io.reactivex.disposables.CompositeDisposable
import io.reactivex.schedulers.Schedulers 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.fragment_banner_home.*
import kotlinx.android.synthetic.main.home_section_content.* import kotlinx.android.synthetic.main.home_section_content.*
import java.io.File import java.io.File
@ -58,11 +57,6 @@ class BannerHomeFragment : AbsMainActivityFragment(), MainActivityFragmentCallba
private lateinit var userImage: ImageView private lateinit var userImage: ImageView
private lateinit var toolbar: Toolbar 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? { 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) 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) { private fun loadTimeImage(day: String) {
if (bannerImage != null) { if (bannerImage != null) {
if (PreferenceUtil.getInstance().bannerImage.isEmpty()) { if (PreferenceUtil.getInstance().bannerImage.isEmpty()) {
Glide.with(activity).load(day) /*Glide.with(activity).load(day)
.asBitmap() .asBitmap()
.placeholder(R.drawable.material_design_default) .placeholder(R.drawable.material_design_default)
.diskCacheStrategy(DiskCacheStrategy.SOURCE) .diskCacheStrategy(DiskCacheStrategy.SOURCE)
.into(bannerImage!!) .into(bannerImage!!)*/
} else { } else {
disposable.add(Compressor(context!!) disposable.add(Compressor(context!!)
.setQuality(100) .setQuality(100)
.setCompressFormat(Bitmap.CompressFormat.WEBP) .setCompressFormat(Bitmap.CompressFormat.WEBP)
@ -140,8 +132,6 @@ class BannerHomeFragment : AbsMainActivityFragment(), MainActivityFragmentCallba
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState) super.onViewCreated(view, savedInstanceState)
mainActivity.setBottomBarVisibility(View.GONE)
toolbar = view.findViewById(R.id.toolbar) toolbar = view.findViewById(R.id.toolbar)
if (!PreferenceUtil.getInstance().isHomeBanner) if (!PreferenceUtil.getInstance().isHomeBanner)
@ -183,13 +173,10 @@ class BannerHomeFragment : AbsMainActivityFragment(), MainActivityFragmentCallba
loadImageFromStorage(userImage) loadImageFromStorage(userImage)
getTimeOfTheDay() getTimeOfTheDay()
searchView.setOnClickListener {
NavigationUtil.goToSearch(activity!!)
}
} }
private fun setupToolbar() { 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.title = null
mainActivity.setSupportActionBar(toolbar) mainActivity.setSupportActionBar(toolbar)
toolbar.setBackgroundColor(Color.TRANSPARENT) toolbar.setBackgroundColor(Color.TRANSPARENT)

View file

@ -1,7 +1,7 @@
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@android:id/background"> <item android:id="@android:id/background">
<shape android:shape="rectangle"> <shape android:shape="rectangle">
<corners android:radius="5dp" /> <corners android:radius="8dp" />
<solid android:color="@color/md_grey_200" /> <solid android:color="@color/md_grey_200" />
</shape> </shape>
</item> </item>
@ -9,7 +9,7 @@
<item android:id="@android:id/secondaryProgress"> <item android:id="@android:id/secondaryProgress">
<clip> <clip>
<shape android:shape="rectangle"> <shape android:shape="rectangle">
<corners android:radius="5dp" /> <corners android:radius="8dp" />
<solid android:color="@color/md_grey_200" /> <solid android:color="@color/md_grey_200" />
</shape> </shape>
</clip> </clip>
@ -17,9 +17,9 @@
<item android:id="@android:id/progress"> <item android:id="@android:id/progress">
<clip> <clip>
<shape> <shape android:shape="rectangle">
<solid android:color="@color/md_green_A700" /> <solid android:color="@color/md_green_A700" />
<corners android:radius="5dp" /> <corners android:radius="8dp" />
</shape> </shape>
</clip> </clip>
</item> </item>

View file

@ -5,28 +5,6 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical"> android:orientation="vertical">
<com.google.android.material.card.MaterialCardView
android:id="@+id/searchView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:cardCornerRadius="12dp"
app:cardUseCompatPadding="true">
<code.name.monkey.retromusic.views.IconImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:padding="14dp"
app:srcCompat="@drawable/ic_search_white_24dp" />
<code.name.monkey.appthemehelper.common.views.ATEPrimaryTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:padding="12dp"
android:text="@string/search_hint" />
</com.google.android.material.card.MaterialCardView>
<androidx.appcompat.widget.AppCompatTextView <androidx.appcompat.widget.AppCompatTextView
style="@style/SubTitleTextAppearance" style="@style/SubTitleTextAppearance"
android:text="@string/for_you" /> android:text="@string/for_you" />

View file

@ -5,28 +5,6 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical"> android:orientation="vertical">
<com.google.android.material.card.MaterialCardView
android:id="@+id/searchView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:cardCornerRadius="12dp"
app:cardUseCompatPadding="true">
<code.name.monkey.retromusic.views.IconImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:padding="14dp"
app:srcCompat="@drawable/ic_search_white_24dp" />
<code.name.monkey.appthemehelper.common.views.ATEPrimaryTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:padding="12dp"
android:text="@string/search_hint" />
</com.google.android.material.card.MaterialCardView>
<code.name.monkey.appthemehelper.common.views.ATEPrimaryTextView <code.name.monkey.appthemehelper.common.views.ATEPrimaryTextView
style="@style/SubTitleTextAppearance" style="@style/SubTitleTextAppearance"
android:text="@string/for_you" /> android:text="@string/for_you" />

View file

@ -17,7 +17,7 @@
app:contentInsetLeft="0dp" app:contentInsetLeft="0dp"
app:contentInsetStart="0dp" app:contentInsetStart="0dp"
app:contentInsetStartWithNavigation="0dp" app:contentInsetStartWithNavigation="0dp"
app:layout_scrollFlags="scroll|enterAlways" app:layout_scrollFlags="scroll|exitUntilCollapsed"
app:subtitleTextAppearance="@style/TextAppearance.AppCompat.Caption" app:subtitleTextAppearance="@style/TextAppearance.AppCompat.Caption"
app:titleMargin="0dp" app:titleMargin="0dp"
app:titleMarginStart="0dp" app:titleMarginStart="0dp"

View file

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<androidx.drawerlayout.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/drawerLayout" android:id="@+id/drawerLayout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
@ -10,16 +9,4 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" /> android:layout_height="match_parent" />
<com.google.android.material.navigation.NavigationView </FrameLayout>
android:id="@+id/navigationView"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
android:fitsSystemWindows="true"
android:paddingStart="0dp"
android:paddingEnd="8dp"
app:headerLayout="@layout/navigation_drawer_header"
app:itemBackground="@drawable/navigation_item"
app:itemTextAppearance="@style/NavigationViewTitleTextAppearance"
app:menu="@menu/menu_drawer" />
</androidx.drawerlayout.widget.DrawerLayout>

View file

@ -2,7 +2,6 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/root"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical" android:orientation="vertical"

View file

@ -42,13 +42,12 @@
<code.name.monkey.retromusic.views.WidthFitSquareLayout <code.name.monkey.retromusic.views.WidthFitSquareLayout
android:id="@+id/album_cover_container"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"> android:layout_gravity="center_horizontal">
<fragment <fragment
android:id="@+id/player_album_cover_fragment" android:id="@+id/playerAlbumCoverFragment"
android:name="code.name.monkey.retromusic.ui.fragments.player.PlayerAlbumCoverFragment" android:name="code.name.monkey.retromusic.ui.fragments.player.PlayerAlbumCoverFragment"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" /> android:layout_height="wrap_content" />
@ -61,14 +60,13 @@
tools:background="@color/md_white_1000"> tools:background="@color/md_white_1000">
<fragment <fragment
android:id="@+id/playback_controls_fragment" android:id="@+id/playbackControlsFragment"
android:name="code.name.monkey.retromusic.ui.fragments.player.blur.BlurPlaybackControlsFragment" android:name="code.name.monkey.retromusic.ui.fragments.player.blur.BlurPlaybackControlsFragment"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" /> android:layout_height="match_parent" />
</FrameLayout> </FrameLayout>
<FrameLayout <FrameLayout
android:id="@+id/toolbar_container"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="0"> android:layout_weight="0">

View file

@ -34,10 +34,16 @@
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_gravity="center_vertical"
android:layout_weight="1"
app:layout_collapseMode="pin" app:layout_collapseMode="pin"
tools:ignore="UnusedAttribute"> tools:ignore="UnusedAttribute">
@ -47,8 +53,18 @@
android:text="@string/app_name" android:text="@string/app_name"
tools:ignore="MissingPrefix" /> tools:ignore="MissingPrefix" />
<code.name.monkey.retromusic.views.CircularImageView
android:id="@+id/userImage"
android:layout_width="32dp"
android:layout_height="32dp"
android:layout_gravity="end|center_vertical"
android:layout_marginEnd="8dp"
android:layout_weight="0"
app:civ_border="false" />
</androidx.appcompat.widget.Toolbar> </androidx.appcompat.widget.Toolbar>
</LinearLayout>
<ViewStub <ViewStub
android:id="@+id/cab_stub" android:id="@+id/cab_stub"
android:layout_width="match_parent" android:layout_width="match_parent"

View file

@ -1,8 +1,10 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" <ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:fadingEdge="vertical"> android:fadingEdge="vertical"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<TextView <TextView
android:id="@+id/offlineLyrics" android:id="@+id/offlineLyrics"
@ -12,5 +14,5 @@
android:lineSpacingExtra="3dp" android:lineSpacingExtra="3dp"
android:padding="16dp" android:padding="16dp"
android:text="@string/no_lyrics_found" android:text="@string/no_lyrics_found"
android:textAppearance="@style/TextAppearance.MaterialComponents.Headline6" /> android:textAppearance="@style/TextAppearance.MaterialComponents.Body1" />
</ScrollView> </ScrollView>

View file

@ -7,8 +7,6 @@
android:orientation="vertical" android:orientation="vertical"
tools:ignore="MissingPrefix"> tools:ignore="MissingPrefix">
<LinearLayout <LinearLayout
android:id="@+id/userInfoContainer" android:id="@+id/userInfoContainer"
android:layout_width="match_parent" android:layout_width="match_parent"
@ -61,6 +59,35 @@
android:textAllCaps="false" android:textAllCaps="false"
app:srcCompat="@drawable/ic_settings_white_24dp" /> app:srcCompat="@drawable/ic_settings_white_24dp" />
</LinearLayout> </LinearLayout>
<code.name.monkey.retromusic.views.MaterialButtonTextColor
android:id="@+id/actionFolders"
style="@style/Widget.MaterialComponents.Button.TextButton.Icon"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:text="@string/folders"
android:textAllCaps="false"
android:textColor="?android:attr/textColorPrimary"
app:icon="@drawable/ic_folder_white_24dp"
app:iconPadding="12dp"
app:iconTint="?iconColor"
app:rippleColor="?iconColor" />
<code.name.monkey.retromusic.views.MaterialButtonTextColor
android:id="@+id/actionEqualizer"
style="@style/Widget.MaterialComponents.Button.TextButton.Icon"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:text="@string/equalizer"
android:textAllCaps="false"
android:textColor="?android:attr/textColorPrimary"
app:icon="@drawable/ic_equalizer_white_24dp"
app:iconPadding="12dp"
app:iconTint="?iconColor"
app:rippleColor="?iconColor" />
<code.name.monkey.retromusic.views.MaterialButtonTextColor <code.name.monkey.retromusic.views.MaterialButtonTextColor
android:id="@+id/actionSleepTimer" android:id="@+id/actionSleepTimer"
style="@style/Widget.MaterialComponents.Button.TextButton.Icon" style="@style/Widget.MaterialComponents.Button.TextButton.Icon"
@ -75,6 +102,34 @@
app:iconTint="?iconColor" app:iconTint="?iconColor"
app:rippleColor="?iconColor" /> app:rippleColor="?iconColor" />
<code.name.monkey.retromusic.views.MaterialButtonTextColor
android:id="@+id/actionShare"
style="@style/Widget.MaterialComponents.Button.TextButton.Icon"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:text="@string/action_share"
android:textAllCaps="false"
android:textColor="?android:attr/textColorPrimary"
app:icon="@drawable/ic_share_white_24dp"
app:iconPadding="12dp"
app:iconTint="?iconColor"
app:rippleColor="?iconColor" />
<code.name.monkey.retromusic.views.MaterialButtonTextColor
android:id="@+id/actionBugReport"
style="@style/Widget.MaterialComponents.Button.TextButton.Icon"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:text="@string/report_bug"
android:textAllCaps="false"
android:textColor="?android:attr/textColorPrimary"
app:icon="@drawable/ic_bug_report_white_24dp"
app:iconPadding="12dp"
app:iconTint="?iconColor"
app:rippleColor="?iconColor" />
<code.name.monkey.retromusic.views.MaterialButtonTextColor <code.name.monkey.retromusic.views.MaterialButtonTextColor
android:id="@+id/actionAbout" android:id="@+id/actionAbout"
style="@style/Widget.MaterialComponents.Button.TextButton.Icon" style="@style/Widget.MaterialComponents.Button.TextButton.Icon"
@ -103,5 +158,18 @@
app:iconTint="?iconColor" app:iconTint="?iconColor"
app:rippleColor="?iconColor" /> app:rippleColor="?iconColor" />
<code.name.monkey.retromusic.views.MaterialButtonTextColor
android:id="@+id/actionBuyPro"
style="@style/Widget.MaterialComponents.Button.TextButton.Icon"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:text="@string/buy_pro"
android:textAllCaps="false"
android:textColor="?android:attr/textColorPrimary"
app:icon="@drawable/ic_card_giftcard_white_24dp"
app:iconPadding="12dp"
app:iconTint="?iconColor"
app:rippleColor="?iconColor" />
</LinearLayout> </LinearLayout>

View file

@ -89,6 +89,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="3dp" android:layout_height="3dp"
android:progress="20" android:progress="20"
android:progressDrawable="@drawable/color_progress_seek"
app:mpb_progressStyle="horizontal" app:mpb_progressStyle="horizontal"
app:mpb_useIntrinsicPadding="false" /> app:mpb_useIntrinsicPadding="false" />
</code.name.monkey.retromusic.views.FitSystemWindowsLayout> </code.name.monkey.retromusic.views.FitSystemWindowsLayout>

View file

@ -1,19 +1,20 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto" android:orientation="vertical"
android:orientation="vertical"> app:layout_behavior="@string/appbar_scrolling_view_behavior">
<code.name.monkey.retromusic.views.LyricView <code.name.monkey.retromusic.views.LyricView
android:id="@+id/lyricsView" android:id="@+id/lyricsView"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:fadeInFadeOut="true" app:fadeInFadeOut="true"
app:highlightColor="@color/md_white_1000" app:highlightColor="@color/md_white_1000"
app:hint="No Lyrics" app:hint="No Lyrics"
app:hintColor="@color/md_grey_400" app:hintColor="@color/md_grey_400"
app:lineSpace="15dp" app:lineSpace="15dp"
app:textAlign="left" app:textAlign="left"
app:textSize="18sp" app:textSize="18sp" />
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout> </LinearLayout>

View file

@ -1,6 +1,12 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"> <menu xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/action_home"
android:enabled="true"
android:icon="@drawable/ic_home_white_24dp"
android:title="@string/home" />
<item <item
android:id="@+id/action_song" android:id="@+id/action_song"
android:enabled="true" android:enabled="true"

View file

@ -2,11 +2,7 @@
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
tools:context=".DrawerActivity"> tools:context=".DrawerActivity">
<item
android:id="@+id/action_search"
android:icon="@drawable/ic_search_white_24dp"
android:title="@string/action_search"
app:showAsAction="ifRoom" />
<item <item
android:id="@+id/action_shuffle_all" android:id="@+id/action_shuffle_all"
android:icon="@drawable/ic_shuffle_white_24dp" android:icon="@drawable/ic_shuffle_white_24dp"