diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index f03f09679..3ee2b591b 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -13,7 +13,7 @@ assignees: '' [ ] Yes --> -**Have you read the [FAQ](https://www.github.com/h4h13/RetroMusicPlayer/tree/dev/FAQ.md)?** +**Have you read the [FAQ](https://github.com/RetroMusicPlayer/RetroMusicPlayer/blob/master/FAQ.md)?** [Yes/No] **Has the bug already been reported? Please search in GitHub issue tab before creating an issue.** diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml new file mode 100644 index 000000000..ac72f0bef --- /dev/null +++ b/.github/workflows/android.yml @@ -0,0 +1,34 @@ +name: Android CI + +on: + push: + branches: [ dev ] + pull_request: + branches: [ dev ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: set up JDK 11 + uses: actions/setup-java@v2 + with: + java-version: '11' + distribution: 'temurin' + cache: gradle + + - name: Generate temporary keystore + run: keytool -genkey -v -storetype pkcs12 -keystore store.p12 -storepass android -alias android -keyalg RSA -keysize 2048 -validity 10000 -dname CN=CI + - name: Write retro.properties + run: | + cat >retro.properties < - .lrc or for better matching copy the and the from the tag editor and then rename the file. -##### STEP 4: -Now paste the LRC files to the following path : /sdcard/Retromusic/lyrics/ +### STEP 4: +Now paste the LRC files to the following path: /sdcard/Retromusic/lyrics/ Here sdcard is your internal storage. -> If you want to skip to particular time stamp, simply scroll to the time stamp from where you want to start from and a 'Play' icon will appear left to the particular stamp. Tap on play button to play from there. +### ***Method 3:- (Requires third-party app)*** +#### STEP 1: +Download automatag or autotagger from Play Store. +#### STEP 2: +Find the time-stamped lyrics for your songs that don't have lyrics already. You can find ".lrc" files for popular songs at either of the websites given below. A time-stamped lyric looks like this, "[00:04:02] Some lyrics text" for example. +#### STEP 3: +Find your song to edit and paste the synced lyrics. +> These apps add those synced lyrics in the music file itself instead of creating a ".lrc file for it." +**Lyrics Website Links:** +- https://www.lyricsify.com/ +- https://www.syair.info -#### Q: Why isn't the artist's image downloading? -Last.fm has disabled the download of artist's images for the time being, whether functionality for this will be restored in future is uncertain. So we have moved to deezer API for artist images which have very less artists in their database and you might not able to see covers on every artist profiles. +**Some Important Notes:** +- If you want to skip to a particular timestamp, simply scroll to the time stamp from where you want to start and a 'Play' icon will appear left to the particular stamp. Tap on the play button to play from there. +- When you save lyrics by pasting lyrics in lyrics editor, close the lyrics and open again for lyrics to show. +- For those who are having difficulty in making the synced lyrics work, we have a short tutorial video on it. Hope this helps you. {[Link in the note or here](https://youtu.be/1oIOTGWhNMY)} +___ -#### Q: How do I change the theme? +## **Q: How do I change the theme?** Settings -> Look and feel -> Select your theme. +___ +## **Q: Equalizer is very laggy and unstable or I am getting a "No equalizer found" error. Why?** +- The Retro music in-built equalizer was removed updates ago so the only equalizer you will have by your OEM or Android native equalizer which isn't made by us and have no control over them. So you can report those issues to your OEM so that they can provide a fix in the next updates. -#### Q: Equailizer is very laggy and unstable or I am getting "No equalizer found" error. why? -The Retro music in-built equalizer was removed updates ago so the only equalizer you will have by your OEM or android which aren't made by us and have no control over them. So you can report those issues to your OEM so that they can provide a fix in next updates. +- If you are seeing "No Equalizer Found" in your device, this means your device doesn't have a stock equalizer "MusicFx" Equalizer. You can try using this one. It's made by AEX ROM developers. -If you are seeing "No Equalizer Found" in your device, this means your device doesn't have stock equalizer MusicFx Equalizer. You can try using this one. Its made by AEX ROM developers. +https://drive.google.com/file/d/1_1bpsn6roeEyElGKikbU39lVKUH8O3xp/view?**usp=drivesdk -https://drive.google.com/file/d/1_1bpsn6roeEyElGKikbU39lVKUH8O3xp/view?usp=drivesdk +___ - -#### Q: Why aren't last added songs showing? +## **Q: Why aren't last added songs showing?** Settings -> Other -> Last added playlist interval -> Select an option from the list. +___ - -#### Q: How do I enable fullscreen lockscreen controls? +## **Q: How do I enable fullscreen lock screen controls?** Settings -> Personalize -> Fullscreen controls -> Enable (this will only be visible when songs are playing from Retro Music). +___ - -#### Q: Why are gallery or random pictures showing up as album art? +## **Q: Why are my gallery or random pictures showing up as album art?** Settings -> Images -> Ignore media store covers -> Enable +___ - -#### Q: Which file types are supported? +## **Q: Which file types are supported?** Retro Music uses the native media player that comes with your Android phone, so as long as a file type is supported by your phone, it's supported by Retro Music. +___ - -#### Q: Why is my device slowing down when I'm using the app? +## **Q: Why is my device slowing down when I'm using the app?** Retro Music is image intensive, it keeps images in the cache for quick loading. +___ - -#### Q: The title "Retro Music" is showing on the top of the app, how can i fix this? +## **Q: The title "Retro Music" is showing on the top of the app, how can I fix this?** Clear the app's cache and data. +___ +## **Q: My app is crashing, how do I fix this?** (Sorry, settings have changed internally) +Please try to clear the data of the app. If it doesn't work, reinstalling fresh from the play store should help. +___ -#### Q: My app is crashing, how do i fix this? (Sorry, settings have changed internally) -Please try clear data of the app. If it doesn't work, reinstalling fresh from play store should help. - - -#### Q: Why has all the text gone white/dissapeared? +## **Q: Why has all the text gone white/disappeared?** Change the theme to Black or Dark and change it back to what you had before. +___ +## **Q: Why some of my songs are not showing in my library?** +- Try checking up if those songs are not less than 30 seconds, if so head to settings -> other -> filter song duration. Put this to zero and see the songs that should start appearing in the library. -#### Q: Why some of my songs are not showing in my library? -Try checking up if those songs are not less than 30 seconds, if so head to settings -> other -> filter song duration. Put this to zero and see the songs should start appearimg in the library. +- If this doesn't work out for you, re-scanning the media folder should help and subsequently rebooting the device to refresh the media store. -If this doesn't work out for you, re-scanning the media folder should help and subsquently rebooting the device to refresh media store. +- At last, resort, If nothing worked and your audio files are stored in SD card. Try moving them to internal memory then back to SD card. -At last resort, If nothing worked and your audio files are stored in SD card. Try moving them to internal memory then back to SD card. +___ +## **Q: Why does my library shows song files twice or no song at all?** +If you are seeing duplication of songs in the library or no songs at all, then it's because of the Media Store issue which got affected by some other app. -#### Q: Why some of my songs are not showing in my library? -1. Try checking up if those songs are not less than 30 seconds, if so head to settings -> other -> filter song duration. Put this to zero and see the songs should start appearimg in the library. +***To fix this:*** +1. Head to your device settings -2. If this doesn't work out for you, re-scanning the media folder should help and subsquently rebooting the device to refresh media store. +1. Open up "Apps & notifications" (This name depends from ROM to ROM) -3. At last resort, If nothing worked and your audio files are stored in SD card. Try moving them to internal memory then back to SD card. +1. Find the 'Media storage' app and clear storage (both data and cache) of it. +1. Then open the Retro Music app and manually scan your music from your storage. -#### Q: Why my playlist/playlist songs keep disappearing? -Playlist/Playlist songs disappearing is based on android media store system. Save those playlist as file(Tap on three dot menu next to available playlist and save as file) and it should get fixed. +1. Reboot the device to refresh the media store (Not sure if this is necessary) +**NOTE:** Don't panic when you will open Retro Music and see "Zero" songs there in the library. It's because you cleared Media Store which is responsible for recognising files on your device. +___ -#### Q: Why does my library shows song files twice or no song at all? -If you are seeing duplication of songs in the library or no songs at all, then it's because of Media Store issue which got affected by some other app. +## **Q: I can't find the folder menu anymore after the latest update?** +Head to settings -> personalise. And select folders from "library categories". If there is no option of folders, tap on reset and select folders. +___ -To fix this: +## **Q: After updating the app to the latest version, the font got removed. Why?** +- Retro Music's font has now been replaced with system font, which means the default font your system uses will be used by Retro Music too. It fixes all font-related issues you used to face/are facing in the app. -• Head to your device settings +- With the recent Retro Music v5 release, we have a built-in optional font "Manrope font" which you can toggle from Settings > Look & Feel > Toggle "Use manrope font". -• Open up "Apps & notifications" (This name depends from ROM to ROM) +- If you think the font looks ugly, then you just need to change the default font from your Android settings (or use any Magisk module). If you can't, there's nothing we can do about it. +___ -• Find 'Media storage' app and clear storage (both data and cache) of it. +## **Q: How to export playlist?** +- ***From Retro Music:*** -• Then open Retro Music app and manually scan your music from your storage. +Head to the playlists tab > tap on the three-dot menu on the playlist you want to export > save as a file. -• Reboot the device to refresh media store (Not sure if this is necessary) +- ***From Other Music Players:*** -NOTE: Don't panic when you will open Retro Music and see "Zero" songs there in the library. It's because you cleared Media Store which is responsible for recognising files on your device. +In your built-in music player, there should be an option to save that playlist as a file. Save them and import them from the file manager by opening it into retro music. +> Note that such playlist must be of your offline music only since retro music is an offline music player, not an online music player. So if your playlist is of online music, it can't be opened on other offline players nor can be exported +___ -#### Q: I can't find folder menu anymore after latest update? -Head to settings -> personalise. And select folders from "library categories". If there is option of folders, tap on reset and select folders. +## **Q: How to restore/import playlist?** +Retro Music will automatically detect any playlist file when that playlist file is stored in internal storage/Playlist. However, if it doesn't, just open any "File manager" and open that playlist file with Retro Music. - -#### Q: After updating the app to latest version, font got removed. Why? -Retro Music's font have now been replaced with system font now, which means the default font your system uses will be used by Retro too. It fixes all font related issues you used to face/are facing in the app. - -If you think the font looks ugly, then you just need to change the default font from your Android settings (or use any Magisk module). If you can't, there's nothing we can do about it. - - -#### Q: How to export playlist: -In your built-in music player, there should be an option to save those playlist as file. Save them and import from file manager by opening it into retro music. - -Note that those playlist must be of your offline music only since retro music is offline music player not an online music player. So if your playlist are of online music, it can't be opened on other offline players nor can be exported - - -#### Q: How to restore/import playlist: -Retro Music will automatically detect any playlist file when that playlist file is stored in InternalStorage/Playlist. However, if it doesn't, just open "file manager" and open that playlist file with Retro Music. - -For restoring playlists, the location of songs must be same in both Playlist file and in your storage. For example, your music is in "Internalstorage/Music" and playlist file has songs location "Internalstorage/Songs". Then it will not going to work since both these location are different. - - -#### Q: Adding songs to playlist or marking them as favourite are making app crash. Why? -It's a known issue with only android 10 with its media store API when songs are in SD card due to introduction of Scoped Storage by Google. The issue have been created on Google Issue Tracker by many users. Many other players which doesn't have this issue are using a custom database for storing playlist. We will soon be implementing a custom database for playlist to fix this issue! - -Workaround: You can move all songs to internal storage to fix the issue. - -ISSUE link: https://issuetracker.google.com/issues/147619577 +For restoring playlists successfully, the location of songs must be the same in both the "Playlist" file and in your storage. For example, If your music is in "Internal storage/Music" and the playlist file has songs location "Internal storage/Songs". Then it will not be going to work since both these locations are different. \ No newline at end of file diff --git a/README.md b/README.md index c5c1edddf..f9cf2184a 100644 --- a/README.md +++ b/README.md @@ -2,19 +2,6 @@ Material Design music player for Android music lovers -## Table of contents -- [Downloads](#downloads) -- [Differences between Metro and RetroMusicPlayer](#differences-between-metro-and-retromusicplayer) -- [Screenshots](#screenshots) - - [App Themes](#app-themes) - - [Player screen](#player-screen) - - [9+ Now playing themes](#9-now-playing-themes) -- [Navigation never made easier](#-navigation-never-made-easier) -- [Colorful](#-colorful) -- [Home](#-home) -- [Included Features](#-included-features) -- [License](#%EF%B8%8F-license) - ## Downloads [ | | | +| | | | |:---:|:---:|:---:| |Clearly white| Kinda dark | Just black| ### Player screen -| | | | | -|:---:|:---:|:---:|:---:| -| Home | Songs | Albums | Settings | +| | | | | | +|:---:|:---:|:---:|:---:|:---:| +| Home | Songs | Albums | Artists | Settings | -### 9+ Now playing themes - -| || | | | +### Synced lyrics screen (Over Cover) +| | | | +|:---:|:---:|:---:| +| Synced Over Cover light | Synced Over Cover dark | Synced Over Cover black | + +### Synced lyrics screen (Replace Cover) +| | | | +|:---:|:---:|:---:| +| Synced Replace Cover light | Synced Replace Cover dark | Synced Replace Cover black | + +### 10+ Now playing themes +| || | | | |:-----: |:-----: |:-----: |:-----: |:-----: | | Normal | Fit | Flat | Color | Material | -| || | | | +| || | | | |:-----: |:-----: |:-----: |:-----: |:-----: | -| Classic | Adaptive | Blur | Tiny | Peak | +| Classic | Adaptive | Blur | Tiny | Peek | ## 🧭 Navigation never made easier Self-explanatory interface without overloaded menus. @@ -66,10 +62,15 @@ favorite songs. No other music player has this feature. ## 📦 Included Features - Base 3 themes (Clearly White, Kinda Dark and Just Black) +- Chromecast support - Choose from 10+ now playing themes - Driving Mode - Headset/Bluetooth support - Music duration filter +- Android auto support +- Wallpaper accent picker on Android 8.1+ +- Material You support on Android 12+ +- Monet themed icon support on Android 13+ - Folder support - Play songs by folder - Gapless playback - Volume controls @@ -89,7 +90,6 @@ favorite songs. No other music player has this feature. - Smart Auto Playlists - Recently played, most played and history - Build your playlist on the go - We are trying our best to bring you the best user experience. The app is regularly being updated for bug fixes and new features. ## 🗂️ License diff --git a/app/build.gradle b/app/build.gradle index ee577a846..1f75de518 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,23 +1,22 @@ apply plugin: 'com.android.application' apply plugin: 'kotlin-android' -apply plugin: 'kotlin-android-extensions' apply plugin: 'kotlin-kapt' apply plugin: "androidx.navigation.safeargs.kotlin" +apply plugin: 'kotlin-parcelize' android { - compileSdkVersion 29 - buildToolsVersion = '30.0.3' + compileSdk 32 + buildTools = '30.0.3' defaultConfig { - minSdkVersion 21 - targetSdkVersion 29 + minSdk 21 + targetSdk 32 - renderscriptTargetApi 29 //must match target sdk and build tools vectorDrawables.useSupportLibrary = true applicationId 'io.github.muntashirakon.Music' - versionCode 10503 - versionName '4.0.010' + versionCode 10579 + versionName '5.8.4' multiDexEnabled true } @@ -32,15 +31,17 @@ android { } } - packagingOptions { - exclude 'META-INF/LICENSE' - exclude 'META-INF/NOTICE' - exclude 'META-INF/java.properties' + buildFeatures{ + viewBinding true } - lintOptions { - disable 'MissingTranslation' - disable 'InvalidPackage' + packagingOptions { + resources { + excludes += ['META-INF/LICENSE', 'META-INF/NOTICE', 'META-INF/java.properties'] + } + } + lint { abortOnError false + disable 'MissingTranslation', 'InvalidPackage' } compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 @@ -53,86 +54,82 @@ android { configurations.all { resolutionStrategy.force 'com.google.code.findbugs:jsr305:1.3.9' } - androidExtensions { - experimental = true - } - kapt { - generateStubs = true - } } dependencies { implementation project(':appthemehelper') - implementation 'androidx.multidex:multidex:2.0.1' implementation "androidx.gridlayout:gridlayout:1.0.0" implementation "androidx.cardview:cardview:1.0.0" - implementation 'androidx.appcompat:appcompat:1.2.0' - implementation 'androidx.annotation:annotation:1.1.0' - implementation 'androidx.constraintlayout:constraintlayout:2.0.4' - implementation 'androidx.recyclerview:recyclerview:1.1.0' - implementation 'androidx.preference:preference-ktx:1.1.1' - implementation 'androidx.core:core-ktx:1.3.2' - implementation 'androidx.fragment:fragment-ktx:1.2.5' + implementation "androidx.appcompat:appcompat:$appcompat_version" + implementation 'androidx.annotation:annotation:1.3.0' + implementation 'androidx.constraintlayout:constraintlayout:2.1.3' + implementation 'androidx.recyclerview:recyclerview:1.2.1' + implementation "androidx.preference:preference-ktx:$preference_version" + implementation 'androidx.core:core-ktx:1.7.0' implementation 'androidx.palette:palette-ktx:1.0.0' - def nav_version = "2.3.2" - implementation "androidx.navigation:navigation-runtime-ktx:$nav_version" - implementation "androidx.navigation:navigation-fragment-ktx:$nav_version" - implementation "androidx.navigation:navigation-ui-ktx:$nav_version" + implementation "androidx.navigation:navigation-runtime-ktx:$navigation_version" + implementation "androidx.navigation:navigation-fragment-ktx:$navigation_version" + implementation "androidx.navigation:navigation-ui-ktx:$navigation_version" - def room_version = "2.2.6" + def room_version = '2.4.2' implementation "androidx.room:room-runtime:$room_version" implementation "androidx.room:room-ktx:$room_version" kapt "androidx.room:room-compiler:$room_version" - def lifecycle_version = "2.2.0" + def lifecycle_version = "2.5.0-rc01" implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycle_version" implementation "androidx.lifecycle:lifecycle-livedata-ktx:$lifecycle_version" implementation "androidx.lifecycle:lifecycle-common-java8:$lifecycle_version" - implementation 'com.google.android.material:material:1.3.0-alpha04' + implementation "androidx.core:core-splashscreen:1.0.0-beta02" + + implementation "com.google.android.material:material:$mdc_version" def retrofit_version = '2.9.0' implementation "com.squareup.retrofit2:retrofit:$retrofit_version" implementation "com.squareup.retrofit2:converter-gson:$retrofit_version" - implementation 'com.squareup.okhttp3:logging-interceptor:3.6.0' + implementation 'com.squareup.okhttp3:logging-interceptor:5.0.0-alpha.7' - def material_dialog_version = "0.9.6.0" + def material_dialog_version = "3.3.0" implementation "com.afollestad.material-dialogs:core:$material_dialog_version" - implementation "com.afollestad.material-dialogs:commons:$material_dialog_version" - implementation 'com.afollestad:material-cab:0.1.12' + implementation "com.afollestad.material-dialogs:input:$material_dialog_version" + implementation "com.afollestad.material-dialogs:color:$material_dialog_version" - def kotlin_coroutines_version = "1.3.8" - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.4.10" + implementation 'com.afollestad:material-cab:2.0.1' + + implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" + + def kotlin_coroutines_version = '1.6.1' implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlin_coroutines_version" implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$kotlin_coroutines_version" - def koin_version = "2.1.5" - implementation "org.koin:koin-core:$koin_version" - implementation "org.koin:koin-core-ext:$koin_version" - implementation "org.koin:koin-androidx-scope:$koin_version" - implementation "org.koin:koin-androidx-viewmodel:$koin_version" - implementation "org.koin:koin-androidx-fragment:$koin_version" - implementation "org.koin:koin-androidx-ext:$koin_version" + def koin_version = '3.2.0' + implementation "io.insert-koin:koin-core:$koin_version" + implementation "io.insert-koin:koin-android:$koin_version" - implementation 'com.github.bumptech.glide:glide:3.8.0' - implementation 'com.github.bumptech.glide:okhttp3-integration:1.5.0' + def glide_version = '4.13.2' + implementation "com.github.bumptech.glide:glide:$glide_version" + kapt "com.github.bumptech.glide:compiler:$glide_version" + implementation "com.github.bumptech.glide:okhttp3-integration:$glide_version" implementation 'com.h6ah4i.android.widget.advrecyclerview:advrecyclerview:1.0.0' - implementation 'org.eclipse.mylyn.github:org.eclipse.egit.github.core:3.4.0.201406110918-r' - implementation 'com.github.ksoichiro:android-observablescrollview:1.6.0' - implementation 'com.github.kabouzeid:recyclerview-fastscroll:1.9-kmod' - implementation 'com.github.AdrienPoupa:jaudiotagger:2.2.3' - implementation 'com.r0adkll:slidableactivity:2.1.0' - implementation 'com.heinrichreimersoftware:material-intro:1.6' - implementation 'com.github.dhaval2404:imagepicker:1.7.1' - implementation 'org.jsoup:jsoup:1.11.1' - implementation 'me.zhanghai.android.fastscroll:library:1.1.0' - implementation 'me.jorgecastillo:androidcolorx:0.2.0' - implementation 'org.jsoup:jsoup:1.11.1' - debugImplementation 'com.amitshekhar.android:debug-db:1.0.6' -} + implementation 'com.github.bosphere.android-fadingedgelayout:fadingedgelayout:1.0.0' -apply from: '../spotless.gradle' + implementation 'net.yslibrary.keyboardvisibilityevent:keyboardvisibilityevent:3.0.0-RC3' + implementation 'com.github.jetradarmobile:android-snowfall:1.2.1' + + implementation "dev.chrisbanes.insetter:insetter:0.6.1" + + implementation 'org.eclipse.mylyn.github:org.eclipse.egit.github.core:2.1.5' + implementation 'com.github.Adonai:jaudiotagger:2.3.15' + implementation 'com.r0adkll:slidableactivity:2.1.0' + implementation 'com.heinrichreimersoftware:material-intro:2.0.0' + implementation 'com.github.dhaval2404:imagepicker:2.1' + implementation 'me.zhanghai.android.fastscroll:library:1.1.8' + implementation 'cat.ereza:customactivityoncrash:2.3.0' + implementation 'me.tankery.lib:circularSeekBar:1.3.2' + debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.9.1' +} \ No newline at end of file diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro index c48afcd1b..c9f1d0067 100644 --- a/app/proguard-rules.pro +++ b/app/proguard-rules.pro @@ -16,9 +16,9 @@ # public *; #} -# Uncomment this to preserve the line number information for +# Preserve the line number information for # debugging stack traces. -#-keepattributes SourceFile,LineNumberTable +-keepattributes SourceFile,LineNumberTable # If you keep the line number information, uncomment this to # hide the original source file name. @@ -34,9 +34,15 @@ # Glide -keep public class * implements com.bumptech.glide.module.GlideModule --keep public enum com.bumptech.glide.load.resource.bitmap.ImageHeaderParser$** { - **[] $VALUES; - public *; +-keep class * extends com.bumptech.glide.module.AppGlideModule { + (...); +} +-keep public enum com.bumptech.glide.load.ImageHeaderParser$** { + **[] $VALUES; + public *; +} +-keep class com.bumptech.glide.load.data.ParcelFileDescriptorRewinder$InternalRewinder { + *** rewind(); } # OkHttp @@ -47,16 +53,19 @@ #-dontwarn #-ignorewarnings --dontshrink --dontobfuscate +#Jaudiotagger -dontwarn org.jaudiotagger.** +-dontwarn org.jcodec.** -keep class org.jaudiotagger.** { *; } +-keep class org.jcodec.** { *; } -keepclassmembers enum * { *; } -keepattributes *Annotation*, Signature, Exception -keepnames class androidx.navigation.fragment.NavHostFragment --keepnames class code.name.monkey.retromusic.model.Home -keep class * extends androidx.fragment.app.Fragment{} -keepnames class * extends android.os.Parcelable --keepnames class * extends java.io.Serializable \ No newline at end of file +-keepnames class * extends java.io.Serializable +-keep class code.name.monkey.retromusic.network.model.** { *; } +-keep class code.name.monkey.retromusic.model.** { *; } +-keep class com.google.android.material.bottomsheet.** { *; } \ No newline at end of file diff --git a/app/src/debug/res/values/bools.xml b/app/src/debug/res/values/bools.xml new file mode 100644 index 000000000..7d3f0ee62 --- /dev/null +++ b/app/src/debug/res/values/bools.xml @@ -0,0 +1,5 @@ + + + true + false + \ No newline at end of file diff --git a/app/src/debug/res/values/donottranslate.xml b/app/src/debug/res/values/donottranslate.xml new file mode 100644 index 000000000..d9798fa6f --- /dev/null +++ b/app/src/debug/res/values/donottranslate.xml @@ -0,0 +1,4 @@ + + + Retro Music-Debug + \ No newline at end of file diff --git a/app/src/debug/res/values/styles.xml b/app/src/debug/res/values/styles.xml index dcee15a66..f3761b219 100644 --- a/app/src/debug/res/values/styles.xml +++ b/app/src/debug/res/values/styles.xml @@ -6,6 +6,11 @@ @font/sans + + @@ -89,8 +94,12 @@ ?android:attr/textColorPrimary - + + \ No newline at end of file diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 67a3a3079..3a6e3bc8b 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -4,11 +4,17 @@ package="code.name.monkey.retromusic" android:installLocation="auto"> - + + + - + @@ -17,23 +23,25 @@ android:name="android.permission.WRITE_SETTINGS" tools:ignore="ProtectedPermissions" /> + @@ -105,32 +113,86 @@ - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -139,7 +201,6 @@ android:resource="@xml/provider_paths" /> - - + - + @@ -164,8 +229,8 @@ @@ -177,8 +242,8 @@ @@ -189,8 +254,8 @@ android:resource="@xml/app_widget_classic_info" /> @@ -201,8 +266,8 @@ android:resource="@xml/app_widget_small_info" /> @@ -213,8 +278,8 @@ android:resource="@xml/app_widget_text" /> @@ -224,16 +289,43 @@ android:name="android.appwidget.provider" android:resource="@xml/app_widget_card_info" /> + + + + + + + + + + + + + + + android:foregroundServiceType="mediaPlayback" + android:label="@string/app_name"> + + + + - + android:name="com.google.android.gms.car.application" + android:resource="@xml/automotive_app_desc" /> + android:name="com.google.android.gms.car.application.theme" + android:resource="@style/CarTheme" /> + + + + + + diff --git a/app/src/main/assets/contributors.json b/app/src/main/assets/contributors.json index e085d3797..56450087b 100644 --- a/app/src/main/assets/contributors.json +++ b/app/src/main/assets/contributors.json @@ -6,26 +6,32 @@ "image": "https://i.imgur.com/AoVs9oj.jpg" }, { - "name": "Lennart Glamann", - "summary": "Play Store Banner & Images", - "link": "https://t.me/FlixbusLennart", - "image": "https://i.imgur.com/Q5Nsx1R.jpg" + "name": "Prathamesh More", + "summary": "Developer", + "link": "https://prathameshmm02.github.io", + "image": "https://i.imgur.com/ZHoOrHx.jpg" }, { "name": "Daksh P. Jain", - "summary": "Support Representative & Moderator", + "summary": "Website & GitHub Maintainer", "link": "https://daksh.eu.org", "image": "https://i.imgur.com/fnYpg65.jpg" }, { "name": "Milind Goel", "summary": "Support Representative & Moderator", - "link": "https://t.me/MilindGoel15", - "image": "https://i.imgur.com/Bz4De21_d.jpg" + "link": "https://milindgoel15.github.io", + "image": "https://i.imgur.com/hWL8t48.jpg" }, -{ + { + "name": "Lennart Glamann", + "summary": "Play Store Banner & Images", + "link": "https://telegram.me/FlixbusLennart", + "image": "https://i.imgur.com/Q5Nsx1R.jpg" + }, + { "name": "Haythem Gataa", - "summary": "App Logo Designer", + "summary": "App Logo & Banners", "link": "https://dribbble.com/haythemgataa", "image": "https://i.imgur.com/g5RuIZq.jpg" } diff --git a/app/src/main/assets/oldindex.html b/app/src/main/assets/license.html similarity index 50% rename from app/src/main/assets/oldindex.html rename to app/src/main/assets/license.html index 367da632a..ff5e78bd2 100644 --- a/app/src/main/assets/oldindex.html +++ b/app/src/main/assets/license.html @@ -24,40 +24,56 @@ padding-top: 8px; } - - -

Phonograph by Karim Abou Zeid

-

Material Dialogs and Cab - by Aidan Michael Follestad

AOSP Support Librariesby AOSP contributors

+ title="AOSP Support Libraries">AOSP Support Libraries by AOSP contributors

Glide by Sam Judd

Retrofit by Square team

+

OkHttp by Square team

+

Koin by Arnaud Giuliani

+

Material Dialogs and Cab + by Aidan Michael Follestad

Material Contextual Action Bar by Aidan Michael Follestad

-

OkHttp by Square team

-

- CircleImageView by Henning Dodenhof

-

- MaterialProgressBar by Zhang Hai

Android In-App Billing v3 Library by Henning Dodenhof

Advanced RecyclerView by Haruki Hasegawa

-

Android-ObservableScrollView by Soichiro - Kashima

+

Custom Activity on Crash by Eduard Ereza Martínez +

+

NanoHttpd by NanoHttpd Team

+

Circular Seekbar by Tankery

+

jAudioTagger by Kanedias

+

Android Fast Scroll by Zhang Hai

+

Image Picker by Dhaval Patel

+

Material Intro by Jan Heinrich Reimer

+

Slidr by Drew Heavner

+

FadingEdgeLayout by bosphere

+

KeyboardVisibilityEvent by Yasuhiro SHIMIZU

+

android-snowfall by Jetradar Mobile

+

Insetter by Chris Banes

Icons by Austin Andrews

Material Design City Wallpaper

- diff --git a/app/src/main/assets/retro-changelog.html b/app/src/main/assets/retro-changelog.html index aa3c01e7f..2ff0871b6 100644 --- a/app/src/main/assets/retro-changelog.html +++ b/app/src/main/assets/retro-changelog.html @@ -6,22 +6,23 @@ word-wrap: break-word; } - body { - padding-left: 1rem; - padding-right: 1rem; + div { + margin: 20px 10px; + padding: 10px; + border-radius: 10px; + box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.2); } h2 { margin-block-end: 0rem; margin-block-start: 0rem; + display: inline-block; + vertical-align: center; } li { font-size: 0.85rem; - padding-top: 0.5rem; - padding-left: 0; - padding-right: 0; - color: rgba(0, 0, 0, 0.8); + padding: 0.5rem 0; } ul { @@ -36,7 +37,6 @@ span { font-size: 0.7rem; - line-height: 0.7rem; } h5 { @@ -44,39 +44,335 @@ margin-block-end: 0.5rem; } - h3 span { - border-radius: 0.2rem; - padding-left: 0.5rem; - padding-right: 0.5rem; - padding-top: 0.3rem; - padding-bottom: 0.3rem; + h3 { + margin: 10px 0px; font-size: 1rem; } + + .tag { + border-radius: 5px; + margin-left: 10px; + padding: 5px; + display: inline-block; + vertical-align: top; + } + {style-placeholder} - - -
April 30, 2020
-

v3.5.110

-Beta version -

What's New

-
    -
  • Changed profile form image to icon
  • -
  • New what's new screen
  • -
  • Added In-App language changer, where you can select language
  • -
-

Improved

-
    -
  • Improved loading of Songs, Albums, Artists, Genres, Playlists
  • -
- -

*If you face any UI related issues you clear app data and cache, if itsnot working try to - uninstall and install - again.

+
+
May 13, 2022
+

v5.8.4

+

What's New

+
    +
  • Added a toggle to enable/disable swipe down to dismiss mini player
  • +
+

Fixed

+
    +
  • Fixed Playback speed and pitch not working when CrossFade is enabled
  • +
  • Fixed crash when adding folders to blacklist
  • +
  • Fix bugs in MD3 theme
  • +
+
+
+
May 07, 2022
+

v5.8.3

+

What's New

+
    +
  • Added a new MD3 now playing theme
  • +
  • Swipe down to dismiss Mini player
  • +
  • Add support for Just Black with Material You
  • +
+

Fixed

+
    +
  • Fixed sharing of files from SD Card
  • +
  • Fix ChromeCast crash and bugs
  • +
  • Fix Audio Crossfade
  • +
  • Tried to fix incorrect song data in notification
  • +
+
+
+
April 8, 2022
+

v5.8.0

+

What's New

+
    +
  • Updated translations
  • +
+

Fixed

+
    +
  • Fixed Classic Notification crash
  • +
  • Fixed crash when clicking on Playlist in the Search Tab
  • +
  • Fixed settings change not reflecting immediately
  • +
  • Fixed shuffle
  • +
  • Fixed Song duration not visible in Card & Blur card themes
  • +
  • Fixed some Album skip styles
  • +
  • Minor bug fixes & UI improvements
  • +
+
+
+
March 13, 2022
+

v5.7.3

+

What's New

+
    +
  • Added adaptive color in Material now playing theme
  • +
  • Added an option to share crash report
  • +
  • Added options to clear, pause history
  • +
+

Fixed

+
    +
  • Adapt Wallpaper accent for better readability
  • +
  • Optimized search
  • +
  • Made sleep timer precise
  • +
+
+
+
February 13, 2022
+

v5.7.2Beta

+

What's New

+
    +
  • Animated splash screen on Android 12 devices
  • +
+

Fixed

+
    +
  • Fixed crash when removing song from Playing queue
  • +
  • Fixed lyrics editing crash
  • +
  • Fixed shuffle button not working
  • +
  • Fixed crash on song deletion
  • +
+
+
+
February 1, 2022
+

v5.7.1Beta

+

What's New

+
    +
  • Added option to disable changing song by swiping anywhere on the now playing screen
  • +
+

Fixed

+
    +
  • Fixed Playlist save on A11+
  • +
  • Fixed Just Black theme
  • +
  • Fixed some UI issues
  • +
+

Improved

+
    +
  • Improvements to search
  • +
+
+
+
January 25, 2022
+

v5.7.0Beta

+

What's New

+
    +
  • Added Android Auto
  • +
  • Added accent color extraction on Android 8.1+ devices
  • +
  • Added new Circle widget
  • +
  • Added Collapsing appbar to library tabs with an option to switch back to simple appbar +
  • +
  • Added Search tab
  • +
  • Added option to use circular play button
  • +
  • Added lyrics editing on A11+ devices again
  • +
  • Added Long Press to forward, rewind current song
  • +
  • Added ability to set Playback speed and pitch
  • +
  • Added option to show lyrics over Cover
  • +
  • Added option to keep screen on when showing lyrics
  • +
  • Added option to switch to Manrope font
  • +
+

Fixed

+
    +
  • Fixed Gapless Playback
  • +
  • Fixed Shuffle FAB going behind Mini Player
  • +
  • Fixed crashes on Pre-marshmallow devices
  • +
  • Blacklisted songs can't be played after opening from outside the app
  • +
  • Fixed various small bugs and some minor improvements
  • +
+
+
+
January 1, 2021
+

v5.6.1

+

Fixed

+
    +
  • Fixed artist covers not updating and showing album cover images.
  • +
  • Fixed FAB's not visible (Shuffle, Save, etc.)
  • +
  • Fixed a crash when a Song is deleted in Artist Details
  • +
  • Fixed Snowfall effect
  • +
  • Fixed empty notification when queue is cleared
  • +
+
+
+
December 25, 2021
+

v5.6.0Beta

+

What's New

+
    +
  • Added Artwork editing for songs
  • +
  • Circle theme has album art now
  • +
  • Upgraded tag editor library, we should support reading tags of more formats now e.g. + opus. +
  • +
  • Added Snowfall effect
  • +
  • Crossfade effect for background when Song is changed for Blur, Blur card themes
  • +
  • Album art is hidden when Show lyrics is enabled
  • +
  • Added fastscroll in Playlists tab
  • +
  • Added Chooser to choose what to restore
  • +
  • Hide BottomNavigation when only one tab is selected in Library Categories(This was + already there but when changing screens it was getting visible) +
  • +
+

Fixed

+
    +
  • Fixed Ringtone crash
  • +
  • Fixed blank album cover bug
  • +
  • Fixed bottom navigation visible in Playing Queue
  • +
  • Fixed lockscreen dragging glitch
  • +
  • Fixed incorrect colors when no cover art is available
  • +
  • Fixed favorite not updating when song is changed
  • +
  • Fixed playlist not getting created & playlist creation crash with same name
  • +
  • Fixed a bug in "Plain" Now playing theme where onClick event is consumed by the views + behind the bottom sheet +
  • +
+
+
+
December 6, 2021
+

v5.4.2Beta

+

Fixed

+
    +
  • Bug Fixes
  • +
+
+
+
December 1, 2021
+

v5.4.1Beta

+

What's New

+
    +
  • Added file selection from system file picker for restore
  • +
  • Added Grid size selection for Playlists
  • +
+

Improved

+
    +
  • Enable Material You by default on Android 12
  • +
  • Reworked Grid Style saving
  • +
  • Improved Playlist preview images
  • +
  • UI improvements
  • +
+

Improved

+
    +
  • Fixed File deletion on Android 10
  • +
  • Fixed Sleep Timer crash
  • +
  • Fixed Bottom Toolbar not clickable in now playing when Shuffle is clicked
  • +
  • Fixed Album Artist sort order
  • +
  • Fixed a crash when clicking the "Clear All" button in the Blacklist folder selection +
  • +
  • Fixed Continuous crashes on A12 when the song ends
  • +
  • Fixed New Music Mix multiple clicks crash
  • +
+
+
+
November 22, 2021
+

v5.4.0Beta

+

What's New

+
    +
  • Material You
  • +
  • Going Edge-to-Edge
  • +
  • Added Backup & restore
  • +
+

Improved

+
    +
  • Improved Animations
  • +
  • Improved Crossfade
  • +
+
+
+
September 06, 2021
+

v5.0.0

+

What's New

+
    +
  • Added ability to Remember last tab
  • +
  • Added Whitelisting songs
  • +
  • You can now browse SDCard from Folders Tab
  • +
+
+
+
August 22, 2021
+

v4.4.0Beta

+

What's New

+
    +
  • Added Crossfade
  • +
  • Multi-select in Album and Artist Details
  • +
  • Albums now show Album Artists instead of artist of first song
  • +
+

Fixed

+
    +
  • Fixed Playlist Preview Images
  • +
+
+
+
August 11, 2021
+

v4.2.30Beta

+

What's New

+
    +
  • Revamped Playlist Tab
  • +
  • Revamped Genres Tab
  • +
  • Added support for embedded Synced Lyrics
  • +
  • Added animated icons
  • +
+

Fixed

+
    +
  • Fixed Language Switching
  • +
  • Fixed some reported bugs
  • +
+
+
+
July 18, 2021
+

v4.2.020Beta

+

What's New

+
    +
  • Added ChromeCast Support
  • +
  • Added Lyrics Editor for Normal and Synced Lyrics
  • +
  • Added Ripple Animation for Color Theme
  • +
  • Added Drag to seek in Tiny Theme
  • +
  • Added Playlist Order
  • +
  • Added Search Filters
  • +
  • Added Audio Fade
  • +
  • Synced Lyrics in all Themes
  • +
  • Swipe anywhere to change song
  • +
+

Improved

+
    +
  • Fixed Navigate by Album Artist
  • +
  • Changed New Music Mix Actions
  • +
  • Improved Animations
  • +
  • And some minor bug fixes and improvements
  • +
+
+
+
October 12, 2020
+

v4.0.10

+

What's New

+
    +
  • Re-built from scratch using MVVM Architecture and JetPack Components
  • +
  • New Material Design icon
  • +
  • Implemented a custom database for playlists
  • +
  • Added new Material Design motions
  • +
  • Bug fixes & performance improvements
  • +
  • Revamped Home tab UI
  • +
  • Android 11 support
  • +
  • And more!
  • +
+
+
+
April 30, 2020
+

v3.5.110Beta

+

What's New

+
    +
  • Changed profile form image to icon
  • +
  • New what's new screen
  • +
  • Added In-App language changer, where you can select language
  • +
+

Improved

+
    +
  • Improved loading of Songs, Albums, Artists, Genres, Playlists
  • +
+
\ No newline at end of file diff --git a/app/src/main/ic_launcher-playstore.png b/app/src/main/ic_launcher-playstore.png index c632d3782..aa6e4ae9a 100644 Binary files a/app/src/main/ic_launcher-playstore.png and b/app/src/main/ic_launcher-playstore.png differ diff --git a/app/src/main/ic_launcher-web.png b/app/src/main/ic_launcher-web.png index ff0f8b9ff..7e7647db5 100644 Binary files a/app/src/main/ic_launcher-web.png and b/app/src/main/ic_launcher-web.png differ diff --git a/app/src/main/java/code/name/monkey/retromusic/App.kt b/app/src/main/java/code/name/monkey/retromusic/App.kt index dbfa6aeaa..598580e1a 100644 --- a/app/src/main/java/code/name/monkey/retromusic/App.kt +++ b/app/src/main/java/code/name/monkey/retromusic/App.kt @@ -13,14 +13,19 @@ */ package code.name.monkey.retromusic -import androidx.multidex.MultiDexApplication +import android.app.Application +import cat.ereza.customactivityoncrash.config.CaocConfig import code.name.monkey.appthemehelper.ThemeStore import code.name.monkey.appthemehelper.util.VersionUtils +import code.name.monkey.retromusic.activities.ErrorActivity import code.name.monkey.retromusic.appshortcuts.DynamicShortcutManager +import code.name.monkey.retromusic.helper.WallpaperAccentManager import org.koin.android.ext.koin.androidContext import org.koin.core.context.startKoin -class App : MultiDexApplication() { +class App : Application() { + + private val wallpaperAccentManager = WallpaperAccentManager(this) override fun onCreate() { super.onCreate() @@ -37,9 +42,18 @@ class App : MultiDexApplication() { .coloredNavigationBar(true) .commit() } + wallpaperAccentManager.init() if (VersionUtils.hasNougatMR()) DynamicShortcutManager(this).initDynamicShortcuts() + + // setting Error activity + CaocConfig.Builder.create().errorActivity(ErrorActivity::class.java).apply() + } + + override fun onTerminate() { + super.onTerminate() + wallpaperAccentManager.release() } companion object { diff --git a/app/src/main/java/code/name/monkey/retromusic/Constants.kt b/app/src/main/java/code/name/monkey/retromusic/Constants.kt index 793c324d4..f5a9b47fa 100644 --- a/app/src/main/java/code/name/monkey/retromusic/Constants.kt +++ b/app/src/main/java/code/name/monkey/retromusic/Constants.kt @@ -20,7 +20,8 @@ import android.provider.MediaStore object Constants { const val RATE_ON_GOOGLE_PLAY = "https://play.google.com/store/apps/details?id=code.name.monkey.retromusic" - const val TRANSLATE = "https://github.com/h4h13/RetroMusicPlayer" + const val TRANSLATE = "https://crowdin.com/project/retromusicplayer" + const val WEBSITE = "https://retromusic.app" const val GITHUB_PROJECT = "https://github.com/MuntashirAkon/Metro" const val TELEGRAM_CHANGE_LOG = "https://t.me/retromusiclog" const val USER_PROFILE = "profile.jpg" @@ -28,30 +29,34 @@ object Constants { const val APP_INSTAGRAM_LINK = "https://www.instagram.com/retromusicapp/" const val APP_TELEGRAM_LINK = "https://t.me/retromusicapp/" const val APP_TWITTER_LINK = "https://twitter.com/retromusicapp" - const val FAQ_LINK = "https://github.com/h4h13/RetroMusicPlayer/blob/master/FAQ.md" + const val FAQ_LINK = "https://github.com/RetroMusicPlayer/RetroMusicPlayer/blob/master/FAQ.md" const val PINTEREST = "https://in.pinterest.com/retromusicapp/" const val AUDIO_SCROBBLER_URL = "https://ws.audioscrobbler.com/2.0/" const val IS_MUSIC = MediaStore.Audio.AudioColumns.IS_MUSIC + "=1" + " AND " + MediaStore.Audio.AudioColumns.TITLE + " != ''" + const val DATA = "_data" + + @Suppress("Deprecation") val baseProjection = arrayOf( BaseColumns._ID, // 0 MediaStore.Audio.AudioColumns.TITLE, // 1 MediaStore.Audio.AudioColumns.TRACK, // 2 MediaStore.Audio.AudioColumns.YEAR, // 3 MediaStore.Audio.AudioColumns.DURATION, // 4 - MediaStore.Audio.AudioColumns.DATA, // 5 + DATA, // 5 MediaStore.Audio.AudioColumns.DATE_MODIFIED, // 6 MediaStore.Audio.AudioColumns.ALBUM_ID, // 7 MediaStore.Audio.AudioColumns.ALBUM, // 8 MediaStore.Audio.AudioColumns.ARTIST_ID, // 9 MediaStore.Audio.AudioColumns.ARTIST, // 10 MediaStore.Audio.AudioColumns.COMPOSER, // 11 - "album_artist" // 12 + ALBUM_ARTIST // 12 ) const val NUMBER_OF_TOP_TRACKS = 99 } + const val EXTRA_PLAYLIST_TYPE = "type" const val EXTRA_GENRE = "extra_genre" const val EXTRA_PLAYLIST = "extra_playlist" @@ -70,7 +75,7 @@ const val NOW_PLAYING_SCREEN_ID = "now_playing_screen_id" const val CAROUSEL_EFFECT = "carousel_effect" const val COLORED_NOTIFICATION = "colored_notification" const val CLASSIC_NOTIFICATION = "classic_notification" -const val GAP_LESS_PLAYBACK = "gap_less_playback" +const val GAP_LESS_PLAYBACK = "gapless_playback" const val ALBUM_ART_ON_LOCK_SCREEN = "album_art_on_lock_screen" const val BLURRED_ALBUM_ART = "blurred_album_art" const val NEW_BLUR_AMOUNT = "new_blur_amount" @@ -116,6 +121,8 @@ const val ALBUM_GRID_SIZE_LAND = "album_grid_size_land" const val SONG_GRID_SIZE_LAND = "song_grid_size_land" const val ARTIST_GRID_SIZE = "artist_grid_size" const val ARTIST_GRID_SIZE_LAND = "artist_grid_size_land" +const val PLAYLIST_GRID_SIZE = "playlist_grid_size" +const val PLAYLIST_GRID_SIZE_LAND = "playlist_grid_size_land" const val COLORED_APP_SHORTCUTS = "colored_app_shortcuts" const val AUDIO_DUCKING = "audio_ducking" const val LAST_ADDED_CUTOFF = "last_added_interval" @@ -128,7 +135,9 @@ const val START_DIRECTORY = "start_directory" const val RECENTLY_PLAYED_CUTOFF = "recently_played_interval" const val LOCK_SCREEN = "lock_screen" const val ALBUM_ARTISTS_ONLY = "album_artists_only" +const val ALBUM_ARTIST = "album_artist" const val ALBUM_DETAIL_SONG_SORT_ORDER = "album_detail_song_sort_order" +const val ARTIST_DETAIL_SONG_SORT_ORDER = "artist_detail_song_sort_order" const val LYRICS_OPTIONS = "lyrics_tab_position" const val CHOOSE_EQUALIZER = "choose_equalizer" const val EQUALIZER = "equalizer" @@ -137,3 +146,25 @@ const val SONG_GRID_STYLE = "song_grid_style" const val PAUSE_ON_ZERO_VOLUME = "pause_on_zero_volume" const val FILTER_SONG = "filter_song" const val EXPAND_NOW_PLAYING_PANEL = "expand_now_playing_panel" +const val EXTRA_ARTIST_NAME = "extra_artist_name" +const val TOGGLE_SUGGESTIONS = "toggle_suggestions" +const val AUDIO_FADE_DURATION = "audio_fade_duration" +const val CROSS_FADE_DURATION = "cross_fade_duration" +const val SHOW_LYRICS = "show_lyrics" +const val REMEMBER_LAST_TAB = "remember_last_tab" +const val LAST_USED_TAB = "last_used_tab" +const val WHITELIST_MUSIC = "whitelist_music" +const val MATERIAL_YOU = "material_you" +const val SNOWFALL = "snowfall" +const val LYRICS_TYPE = "lyrics_type" +const val PLAYBACK_SPEED = "playback_speed" +const val PLAYBACK_PITCH = "playback_pitch" +const val CUSTOM_FONT = "custom_font" +const val APPBAR_MODE = "appbar_mode" +const val WALLPAPER_ACCENT = "wallpaper_accent" +const val SCREEN_ON_LYRICS = "screen_on_lyrics" +const val CIRCLE_PLAY_BUTTON = "circle_play_button" +const val SWIPE_ANYWHERE_NOW_PLAYING = "swipe_anywhere_now_playing" +const val PAUSE_HISTORY = "pause_history" +const val MANAGE_AUDIO_FOCUS = "manage_audio_focus" +const val SWIPE_DOWN_DISMISS = "swipe_to_dismiss" \ No newline at end of file diff --git a/app/src/main/java/code/name/monkey/retromusic/LanguageContextWrapper.java b/app/src/main/java/code/name/monkey/retromusic/LanguageContextWrapper.java deleted file mode 100644 index cbd9204e5..000000000 --- a/app/src/main/java/code/name/monkey/retromusic/LanguageContextWrapper.java +++ /dev/null @@ -1,41 +0,0 @@ -package code.name.monkey.retromusic; - -import android.content.Context; -import android.content.ContextWrapper; -import android.content.res.Configuration; -import android.content.res.Resources; -import android.os.LocaleList; -import code.name.monkey.appthemehelper.util.VersionUtils; -import java.util.Locale; - -public class LanguageContextWrapper extends ContextWrapper { - - public LanguageContextWrapper(Context base) { - super(base); - } - - public static LanguageContextWrapper wrap(Context context, Locale newLocale) { - Resources res = context.getResources(); - Configuration configuration = res.getConfiguration(); - - if (VersionUtils.INSTANCE.hasNougatMR()) { - configuration.setLocale(newLocale); - - LocaleList localeList = new LocaleList(newLocale); - LocaleList.setDefault(localeList); - configuration.setLocales(localeList); - - context = context.createConfigurationContext(configuration); - - } else if (VersionUtils.INSTANCE.hasLollipop()) { - configuration.setLocale(newLocale); - context = context.createConfigurationContext(configuration); - - } else { - configuration.locale = newLocale; - res.updateConfiguration(configuration, res.getDisplayMetrics()); - } - - return new LanguageContextWrapper(context); - } -} diff --git a/app/src/main/java/code/name/monkey/retromusic/LanguageContextWrapper.kt b/app/src/main/java/code/name/monkey/retromusic/LanguageContextWrapper.kt new file mode 100644 index 000000000..a14c8fdd5 --- /dev/null +++ b/app/src/main/java/code/name/monkey/retromusic/LanguageContextWrapper.kt @@ -0,0 +1,27 @@ +package code.name.monkey.retromusic + +import android.content.Context +import android.content.ContextWrapper +import android.os.LocaleList +import code.name.monkey.appthemehelper.util.VersionUtils.hasNougatMR +import com.google.android.gms.common.annotation.KeepName +import java.util.* + +class LanguageContextWrapper(base: Context?) : ContextWrapper(base) { + companion object { + @KeepName + fun wrap(context: Context?, newLocale: Locale?): LanguageContextWrapper { + if (context == null) return LanguageContextWrapper(context) + val configuration = context.resources.configuration + if (hasNougatMR()) { + configuration.setLocale(newLocale) + val localeList = LocaleList(newLocale) + LocaleList.setDefault(localeList) + configuration.setLocales(localeList) + } else { + configuration.setLocale(newLocale) + } + return LanguageContextWrapper(context.createConfigurationContext(configuration)) + } + } +} \ No newline at end of file diff --git a/app/src/main/java/code/name/monkey/retromusic/MainModule.kt b/app/src/main/java/code/name/monkey/retromusic/MainModule.kt index c701a47ec..c1c58f3de 100644 --- a/app/src/main/java/code/name/monkey/retromusic/MainModule.kt +++ b/app/src/main/java/code/name/monkey/retromusic/MainModule.kt @@ -3,6 +3,8 @@ package code.name.monkey.retromusic import androidx.room.Room import androidx.room.RoomDatabase import androidx.sqlite.db.SupportSQLiteDatabase +import code.name.monkey.retromusic.auto.AutoMusicProvider +import code.name.monkey.retromusic.cast.RetroWebServer import code.name.monkey.retromusic.db.BlackListStoreDao import code.name.monkey.retromusic.db.BlackListStoreEntity import code.name.monkey.retromusic.db.PlaylistWithSongs @@ -85,10 +87,26 @@ private val roomModule = module { RealRoomRepository(get(), get(), get(), get(), get()) } bind RoomRepository::class } +private val autoModule = module { + single { + AutoMusicProvider( + androidContext(), + get(), + get(), + get(), + get(), + get(), + get() + ) + } +} private val mainModule = module { single { androidContext().contentResolver } + single { + RetroWebServer(get()) + } } private val dataModule = module { single { @@ -167,10 +185,11 @@ private val viewModules = module { ) } - viewModel { (artistId: Long) -> + viewModel { (artistId: Long?, artistName: String?) -> ArtistDetailsViewModel( get(), - artistId + artistId, + artistName ) } @@ -189,4 +208,4 @@ private val viewModules = module { } } -val appModules = listOf(mainModule, dataModule, viewModules, networkModule, roomModule) \ No newline at end of file +val appModules = listOf(mainModule, dataModule, autoModule, viewModules, networkModule, roomModule) \ No newline at end of file diff --git a/app/src/main/java/code/name/monkey/retromusic/PeekingLinearLayoutManager.kt b/app/src/main/java/code/name/monkey/retromusic/PeekingLinearLayoutManager.kt deleted file mode 100644 index a7961ffd3..000000000 --- a/app/src/main/java/code/name/monkey/retromusic/PeekingLinearLayoutManager.kt +++ /dev/null @@ -1,46 +0,0 @@ -package code.name.monkey.retromusic - -import android.content.Context -import android.util.AttributeSet -import android.view.ViewGroup -import androidx.recyclerview.widget.LinearLayoutManager -import androidx.recyclerview.widget.RecyclerView - -class PeekingLinearLayoutManager : LinearLayoutManager { - @JvmOverloads - constructor( - context: Context?, - @RecyclerView.Orientation orientation: Int = RecyclerView.VERTICAL, - reverseLayout: Boolean = false - ) : super(context, orientation, reverseLayout) - - constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int, defStyleRes: Int) : super( - context, - attrs, - defStyleAttr, - defStyleRes - ) - - override fun generateDefaultLayoutParams() = - scaledLayoutParams(super.generateDefaultLayoutParams()) - - override fun generateLayoutParams(lp: ViewGroup.LayoutParams?) = - scaledLayoutParams(super.generateLayoutParams(lp)) - - override fun generateLayoutParams(c: Context?, attrs: AttributeSet?) = - scaledLayoutParams(super.generateLayoutParams(c, attrs)) - - private fun scaledLayoutParams(layoutParams: RecyclerView.LayoutParams) = - layoutParams.apply { - when (orientation) { - HORIZONTAL -> width = (horizontalSpace * ratio).toInt() - VERTICAL -> height = (verticalSpace * ratio).toInt() - } - } - - private val horizontalSpace get() = width - paddingStart - paddingEnd - - private val verticalSpace get() = height - paddingTop - paddingBottom - - private val ratio = 0.8f // change to 0.7f for 70% -} \ No newline at end of file diff --git a/app/src/main/java/code/name/monkey/retromusic/RetroBottomSheetBehavior.java b/app/src/main/java/code/name/monkey/retromusic/RetroBottomSheetBehavior.java deleted file mode 100644 index 345cda937..000000000 --- a/app/src/main/java/code/name/monkey/retromusic/RetroBottomSheetBehavior.java +++ /dev/null @@ -1,35 +0,0 @@ -package code.name.monkey.retromusic; - -import android.content.Context; -import android.util.AttributeSet; -import android.view.MotionEvent; -import android.view.View; -import androidx.coordinatorlayout.widget.CoordinatorLayout; -import com.google.android.material.bottomsheet.BottomSheetBehavior; -import org.jetbrains.annotations.NotNull; - -public class RetroBottomSheetBehavior extends BottomSheetBehavior { - - private static final String TAG = "RetroBottomSheetBehavior"; - - private boolean allowDragging = true; - - public RetroBottomSheetBehavior() {} - - public RetroBottomSheetBehavior(Context context, AttributeSet attrs) { - super(context, attrs); - } - - public void setAllowDragging(boolean allowDragging) { - this.allowDragging = allowDragging; - } - - @Override - public boolean onInterceptTouchEvent( - @NotNull CoordinatorLayout parent, @NotNull V child, @NotNull MotionEvent event) { - if (!allowDragging) { - return false; - } - return super.onInterceptTouchEvent(parent, child, event); - } -} diff --git a/app/src/main/java/code/name/monkey/retromusic/activities/DriveModeActivity.kt b/app/src/main/java/code/name/monkey/retromusic/activities/DriveModeActivity.kt index 3f5e7fbc0..81f880ace 100644 --- a/app/src/main/java/code/name/monkey/retromusic/activities/DriveModeActivity.kt +++ b/app/src/main/java/code/name/monkey/retromusic/activities/DriveModeActivity.kt @@ -15,32 +15,37 @@ package code.name.monkey.retromusic.activities import android.animation.ObjectAnimator +import android.content.Intent import android.graphics.Color import android.graphics.PorterDuff import android.os.Bundle import android.view.animation.LinearInterpolator import android.widget.SeekBar -import code.name.monkey.appthemehelper.ThemeStore +import androidx.lifecycle.lifecycleScope import code.name.monkey.retromusic.R import code.name.monkey.retromusic.activities.base.AbsMusicServiceActivity +import code.name.monkey.retromusic.databinding.ActivityDriveModeBinding +import code.name.monkey.retromusic.db.toSongEntity +import code.name.monkey.retromusic.extensions.accentColor +import code.name.monkey.retromusic.extensions.drawAboveSystemBars import code.name.monkey.retromusic.fragments.base.AbsPlayerControlsFragment import code.name.monkey.retromusic.glide.BlurTransformation -import code.name.monkey.retromusic.glide.RetroMusicColoredTarget -import code.name.monkey.retromusic.glide.SongGlideRequest +import code.name.monkey.retromusic.glide.GlideApp +import code.name.monkey.retromusic.glide.RetroGlideExtension import code.name.monkey.retromusic.helper.MusicPlayerRemote import code.name.monkey.retromusic.helper.MusicProgressViewUpdateHelper import code.name.monkey.retromusic.helper.MusicProgressViewUpdateHelper.Callback import code.name.monkey.retromusic.helper.PlayPauseButtonOnClickHandler import code.name.monkey.retromusic.misc.SimpleOnSeekbarChangeListener +import code.name.monkey.retromusic.model.Song +import code.name.monkey.retromusic.repository.RealRepository import code.name.monkey.retromusic.service.MusicService import code.name.monkey.retromusic.util.MusicUtil -import code.name.monkey.retromusic.util.color.MediaNotificationProcessor -import com.bumptech.glide.Glide -import kotlinx.android.synthetic.main.activity_drive_mode.* -import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch import kotlinx.coroutines.withContext +import org.koin.android.ext.android.inject + /** * Created by hemanths on 2020-02-02. @@ -48,21 +53,24 @@ import kotlinx.coroutines.withContext class DriveModeActivity : AbsMusicServiceActivity(), Callback { + private lateinit var binding: ActivityDriveModeBinding private var lastPlaybackControlsColor: Int = Color.GRAY private var lastDisabledPlaybackControlsColor: Int = Color.GRAY private lateinit var progressViewUpdateHelper: MusicProgressViewUpdateHelper + private val repository: RealRepository by inject() override fun onCreate(savedInstanceState: Bundle?) { - setDrawUnderStatusBar() super.onCreate(savedInstanceState) - setContentView(R.layout.activity_drive_mode) + binding = ActivityDriveModeBinding.inflate(layoutInflater) + setContentView(binding.root) setUpMusicControllers() progressViewUpdateHelper = MusicProgressViewUpdateHelper(this) - lastPlaybackControlsColor = ThemeStore.accentColor(this) - close.setOnClickListener { + lastPlaybackControlsColor = accentColor() + binding.close.setOnClickListener { onBackPressed() } + binding.repeatButton.drawAboveSystemBars() } private fun setUpMusicControllers() { @@ -75,26 +83,37 @@ class DriveModeActivity : AbsMusicServiceActivity(), Callback { } private fun setupFavouriteToggle() { - songFavourite.setOnClickListener { - MusicUtil.toggleFavorite( - this@DriveModeActivity, - MusicPlayerRemote.currentSong - ) + binding.songFavourite.setOnClickListener { + toggleFavorite(MusicPlayerRemote.currentSong) } } - private fun toggleFavourite() { - CoroutineScope(Dispatchers.IO).launch { - val isFavourite = - MusicUtil.isFavorite(this@DriveModeActivity, MusicPlayerRemote.currentSong) + private fun toggleFavorite(song: Song) { + lifecycleScope.launch(Dispatchers.IO) { + val playlist = repository.favoritePlaylist() + val songEntity = song.toSongEntity(playlist.playListId) + val isFavorite = repository.isSongFavorite(song.id) + if (isFavorite) { + repository.removeSongFromPlaylist(songEntity) + } else { + repository.insertSongs(listOf(song.toSongEntity(playlist.playListId))) + } + sendBroadcast(Intent(MusicService.FAVORITE_STATE_CHANGED)) + } + } + + private fun updateFavorite() { + lifecycleScope.launch(Dispatchers.IO) { + val isFavorite: Boolean = + repository.isSongFavorite(MusicPlayerRemote.currentSong.id) withContext(Dispatchers.Main) { - songFavourite.setImageResource(if (isFavourite) R.drawable.ic_favorite else R.drawable.ic_favorite_border) + binding.songFavourite.setImageResource(if (isFavorite) R.drawable.ic_favorite else R.drawable.ic_favorite_border) } } } private fun setUpProgressSlider() { - progressSlider.setOnSeekBarChangeListener(object : SimpleOnSeekbarChangeListener() { + binding.progressSlider.setOnSeekBarChangeListener(object : SimpleOnSeekbarChangeListener() { override fun onProgressChanged(seekBar: SeekBar, progress: Int, fromUser: Boolean) { if (fromUser) { MusicPlayerRemote.seekTo(progress) @@ -118,21 +137,20 @@ class DriveModeActivity : AbsMusicServiceActivity(), Callback { } private fun setUpPrevNext() { - - nextButton.setOnClickListener { MusicPlayerRemote.playNextSong() } - previousButton.setOnClickListener { MusicPlayerRemote.back() } + binding.nextButton.setOnClickListener { MusicPlayerRemote.playNextSong() } + binding.previousButton.setOnClickListener { MusicPlayerRemote.back() } } private fun setUpShuffleButton() { - shuffleButton.setOnClickListener { MusicPlayerRemote.toggleShuffleMode() } + binding.shuffleButton.setOnClickListener { MusicPlayerRemote.toggleShuffleMode() } } private fun setUpRepeatButton() { - repeatButton.setOnClickListener { MusicPlayerRemote.cycleRepeatMode() } + binding.repeatButton.setOnClickListener { MusicPlayerRemote.cycleRepeatMode() } } private fun setUpPlayPauseFab() { - playPauseButton.setOnClickListener(PlayPauseButtonOnClickHandler()) + binding.playPauseButton.setOnClickListener(PlayPauseButtonOnClickHandler()) } override fun onRepeatModeChanged() { @@ -156,24 +174,24 @@ class DriveModeActivity : AbsMusicServiceActivity(), Callback { updateSong() updateRepeatState() updateShuffleState() - toggleFavourite() + updateFavorite() } private fun updatePlayPauseDrawableState() { if (MusicPlayerRemote.isPlaying) { - playPauseButton.setImageResource(R.drawable.ic_pause) + binding.playPauseButton.setImageResource(R.drawable.ic_pause) } else { - playPauseButton.setImageResource(R.drawable.ic_play_arrow) + binding.playPauseButton.setImageResource(R.drawable.ic_play_arrow) } } fun updateShuffleState() { when (MusicPlayerRemote.shuffleMode) { - MusicService.SHUFFLE_MODE_SHUFFLE -> shuffleButton.setColorFilter( + MusicService.SHUFFLE_MODE_SHUFFLE -> binding.shuffleButton.setColorFilter( lastPlaybackControlsColor, PorterDuff.Mode.SRC_IN ) - else -> shuffleButton.setColorFilter( + else -> binding.shuffleButton.setColorFilter( lastDisabledPlaybackControlsColor, PorterDuff.Mode.SRC_IN ) @@ -183,19 +201,25 @@ class DriveModeActivity : AbsMusicServiceActivity(), Callback { private fun updateRepeatState() { when (MusicPlayerRemote.repeatMode) { MusicService.REPEAT_MODE_NONE -> { - repeatButton.setImageResource(R.drawable.ic_repeat) - repeatButton.setColorFilter( + binding.repeatButton.setImageResource(R.drawable.ic_repeat) + binding.repeatButton.setColorFilter( lastDisabledPlaybackControlsColor, PorterDuff.Mode.SRC_IN ) } MusicService.REPEAT_MODE_ALL -> { - repeatButton.setImageResource(R.drawable.ic_repeat) - repeatButton.setColorFilter(lastPlaybackControlsColor, PorterDuff.Mode.SRC_IN) + binding.repeatButton.setImageResource(R.drawable.ic_repeat) + binding.repeatButton.setColorFilter( + lastPlaybackControlsColor, + PorterDuff.Mode.SRC_IN + ) } MusicService.REPEAT_MODE_THIS -> { - repeatButton.setImageResource(R.drawable.ic_repeat_one) - repeatButton.setColorFilter(lastPlaybackControlsColor, PorterDuff.Mode.SRC_IN) + binding.repeatButton.setImageResource(R.drawable.ic_repeat_one) + binding.repeatButton.setColorFilter( + lastPlaybackControlsColor, + PorterDuff.Mode.SRC_IN + ) } } } @@ -203,35 +227,36 @@ class DriveModeActivity : AbsMusicServiceActivity(), Callback { override fun onPlayingMetaChanged() { super.onPlayingMetaChanged() updateSong() - toggleFavourite() + updateFavorite() + } + + override fun onFavoriteStateChanged() { + super.onFavoriteStateChanged() + updateFavorite() } private fun updateSong() { val song = MusicPlayerRemote.currentSong - songTitle.text = song.title - songText.text = song.artistName + binding.songTitle.text = song.title + binding.songText.text = song.artistName - SongGlideRequest.Builder.from(Glide.with(this), song) - .checkIgnoreMediaStore(this) - .generatePalette(this) - .build() + GlideApp.with(this) + .load(RetroGlideExtension.getSongModel(song)) + .songCoverOptions(song) .transform(BlurTransformation.Builder(this).build()) - .into(object : RetroMusicColoredTarget(image) { - override fun onColorReady(colors: MediaNotificationProcessor) { - } - }) + .into(binding.image) } override fun onUpdateProgressViews(progress: Int, total: Int) { - progressSlider.max = total + binding.progressSlider.max = total - val animator = ObjectAnimator.ofInt(progressSlider, "progress", progress) + val animator = ObjectAnimator.ofInt(binding.progressSlider, "progress", progress) animator.duration = AbsPlayerControlsFragment.SLIDER_ANIMATION_TIME animator.interpolator = LinearInterpolator() animator.start() - songTotalTime.text = MusicUtil.getReadableDurationString(total.toLong()) - songCurrentProgress.text = MusicUtil.getReadableDurationString(progress.toLong()) + binding.songTotalTime.text = MusicUtil.getReadableDurationString(total.toLong()) + binding.songCurrentProgress.text = MusicUtil.getReadableDurationString(progress.toLong()) } } diff --git a/app/src/main/java/code/name/monkey/retromusic/activities/ErrorActivity.kt b/app/src/main/java/code/name/monkey/retromusic/activities/ErrorActivity.kt new file mode 100644 index 000000000..3b3377bb1 --- /dev/null +++ b/app/src/main/java/code/name/monkey/retromusic/activities/ErrorActivity.kt @@ -0,0 +1,80 @@ +package code.name.monkey.retromusic.activities + +import android.os.Bundle +import android.widget.Button +import android.widget.ImageView +import androidx.appcompat.app.AlertDialog +import androidx.appcompat.app.AppCompatActivity +import cat.ereza.customactivityoncrash.CustomActivityOnCrash +import code.name.monkey.retromusic.R +import code.name.monkey.retromusic.util.FileUtils.createFile +import code.name.monkey.retromusic.util.Share.shareFile +import java.text.DateFormat +import java.text.SimpleDateFormat +import java.util.* + +class ErrorActivity : AppCompatActivity() { + private val dayFormat: DateFormat = SimpleDateFormat("yyyy-MM-dd", Locale.getDefault()) + private val ReportPrefix = "bug_report-" + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.customactivityoncrash_default_error_activity) + + val restartButton = + findViewById