diff --git a/.github/workflows/android-lint.yml b/.github/workflows/android-lint.yml index 6e938caa..607eff1f 100644 --- a/.github/workflows/android-lint.yml +++ b/.github/workflows/android-lint.yml @@ -11,14 +11,12 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - with: - fetch-depth: 1 - - name: set up JDK + - name: Set up JDK 17 uses: actions/setup-java@v3 with: - distribution: zulu - java-version: 11 - cache: gradle + java-version: '17' + distribution: 'adopt' + - run: chmod +x gradlew - run: ./gradlew lint - uses: yutailang0119/action-android-lint@v3 diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index c4484e3e..3929fa3d 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -13,12 +13,11 @@ jobs: steps: - uses: actions/checkout@v3 - - name: set up JDK 11 + - name: Set up JDK 17 uses: actions/setup-java@v3 with: - java-version: '11' + java-version: '17' distribution: 'adopt' - cache: gradle - name: Grant execute permission for gradlew run: chmod +x gradlew diff --git a/app/build.gradle b/app/build.gradle index 875ad5ea..b5c5e0fc 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -9,7 +9,6 @@ def keystorePropertiesFile = rootProject.file("keystore.properties") android { namespace 'org.metabrainz.android' - compileSdk 33 signingConfigs { release { @@ -28,7 +27,7 @@ android { minSdk 21 targetSdk 33 versionCode 55 - versionName "6.1.1" + versionName "7.0.0" multiDexEnabled true testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" @@ -72,26 +71,33 @@ android { disable 'MissingTranslation' } composeOptions { - kotlinCompilerExtensionVersion '1.3.0' + kotlinCompilerExtensionVersion '1.4.6' + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_17 + targetCompatibility JavaVersion.VERSION_17 + } + kotlinOptions { + jvmTarget = '17' } } dependencies { //AndroidX - implementation 'androidx.appcompat:appcompat:1.5.1' - implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.5.1' - implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.5.1' + implementation 'androidx.appcompat:appcompat:1.6.1' + implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.6.1' + implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.1' implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0' - implementation 'androidx.core:core-ktx:1.9.0' + implementation 'androidx.core:core-ktx:1.10.0' implementation 'androidx.gridlayout:gridlayout:1.0.0' - implementation 'androidx.browser:browser:1.4.0' - implementation 'androidx.recyclerview:recyclerview:1.2.1' + implementation 'androidx.browser:browser:1.5.0' + implementation 'androidx.recyclerview:recyclerview:1.3.0' implementation 'androidx.constraintlayout:constraintlayout:2.1.4' implementation 'androidx.preference:preference-ktx:1.2.0' - implementation 'androidx.core:core-splashscreen:1.0.0' + implementation 'androidx.core:core-splashscreen:1.0.1' //Web Service Setup - implementation 'com.google.code.gson:gson:2.10' + implementation 'com.google.code.gson:gson:2.10.1' implementation 'com.squareup.retrofit2:retrofit:2.9.0' implementation 'com.squareup.okhttp3:okhttp:5.0.0-alpha.11' implementation 'com.squareup.retrofit2:converter-gson:2.9.0' @@ -99,22 +105,22 @@ dependencies { implementation 'androidx.paging:paging-runtime-ktx:3.1.1' //Image downloading and Caching library - implementation 'com.github.bumptech.glide:glide:4.14.2' - kapt 'com.github.bumptech.glide:compiler:4.14.2' + implementation 'com.github.bumptech.glide:glide:4.15.1' + kapt 'com.github.bumptech.glide:compiler:4.15.1' //Fragment Setup For Kotlin implementation "androidx.navigation:navigation-fragment-ktx:$navigationVersion" implementation "androidx.navigation:navigation-ui-ktx:$navigationVersion" implementation 'androidx.coordinatorlayout:coordinatorlayout:1.2.0' - implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.5.1' + implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.6.1' //Tagger & Metadata Setup implementation 'info.debatty:java-string-similarity:2.0.0' //Design Setup - implementation 'com.google.android.material:material:1.8.0-beta01' - implementation 'com.airbnb.android:lottie:5.2.0' - implementation 'com.github.akshaaatt:Onboarding:1.0.4' + implementation 'com.google.android.material:material:1.8.0' + implementation 'com.airbnb.android:lottie:6.0.0' + implementation 'com.github.akshaaatt:Onboarding:1.0.5' implementation 'com.github.akshaaatt:Share-Android:1.0.0' //Barcode Scan @@ -123,47 +129,47 @@ dependencies { //Dagger-Hilt implementation("com.google.dagger:hilt-android:$hilt_version") kapt("com.google.dagger:hilt-android-compiler:$hilt_version") - implementation group: 'androidx.lifecycle', name: 'lifecycle-viewmodel-ktx', version: '2.5.1' + implementation group: 'androidx.lifecycle', name: 'lifecycle-viewmodel-ktx', version: '2.6.1' kapt("androidx.hilt:hilt-compiler:1.0.0") //Jetpack Compose implementation "androidx.compose.ui:ui:$compose_version" implementation "androidx.compose.ui:ui-tooling:$compose_version" implementation "androidx.compose.ui:ui-util:$compose_version" - implementation "androidx.compose.material:material:1.3.1" - implementation "androidx.compose.material:material-icons-extended:1.3.1" - implementation 'androidx.compose.material3:material3:1.1.0-alpha03' - implementation 'androidx.compose.material3:material3-window-size-class:1.1.0-alpha03' + implementation 'androidx.compose.material:material:1.4.2' + implementation 'androidx.compose.material:material-icons-extended:1.4.2' + implementation 'androidx.compose.material3:material3:1.1.0-rc01' + implementation 'androidx.compose.material3:material3-window-size-class:1.1.0-rc01' implementation "androidx.compose.animation:animation:$compose_version" implementation "androidx.compose.ui:ui-tooling-preview:$compose_version" implementation 'androidx.constraintlayout:constraintlayout-compose:1.0.1' - implementation 'androidx.navigation:navigation-compose:2.6.0-alpha04' - implementation 'androidx.lifecycle:lifecycle-viewmodel-compose:2.5.1' + implementation 'androidx.navigation:navigation-compose:2.6.0-beta01' + implementation 'androidx.lifecycle:lifecycle-viewmodel-compose:2.6.1' implementation 'androidx.hilt:hilt-navigation-compose:1.0.0' - implementation 'io.coil-kt:coil-compose:2.2.2' - implementation 'com.airbnb.android:lottie-compose:5.2.0' - implementation 'androidx.navigation:navigation-compose:2.6.0-alpha04' + implementation 'io.coil-kt:coil-compose:2.3.0' + implementation 'com.airbnb.android:lottie-compose:6.0.0' + implementation 'androidx.navigation:navigation-compose:2.6.0-beta01' //Test Setup testImplementation 'junit:junit:4.13.2' testImplementation 'com.squareup.okhttp3:mockwebserver:5.0.0-alpha.7' - testImplementation 'androidx.arch.core:core-testing:2.1.0' + testImplementation 'androidx.arch.core:core-testing:2.2.0' testImplementation 'org.hamcrest:hamcrest-all:1.3' testImplementation 'org.jetbrains.kotlinx:kotlinx-coroutines-test:1.6.4' - testImplementation "androidx.room:room-testing:2.4.3" + testImplementation 'androidx.room:room-testing:2.5.1' - androidTestImplementation 'androidx.test:runner:1.5.1' - androidTestImplementation 'androidx.test.ext:junit:1.1.4' - androidTestImplementation 'androidx.arch.core:core-testing:2.1.0' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.0' - androidTestImplementation 'androidx.test.espresso:espresso-intents:3.5.0' + androidTestImplementation 'androidx.test:runner:1.5.2' + androidTestImplementation 'androidx.test.ext:junit:1.1.5' + androidTestImplementation 'androidx.arch.core:core-testing:2.2.0' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' + androidTestImplementation 'androidx.test.espresso:espresso-intents:3.5.1' androidTestImplementation "androidx.compose.ui:ui-test-junit4:$compose_version" //Room db - implementation "androidx.room:room-runtime:2.4.3" - kapt "androidx.room:room-compiler:2.4.3" - implementation "androidx.room:room-ktx:2.4.3" + implementation 'androidx.room:room-runtime:2.5.1' + kapt 'androidx.room:room-compiler:2.5.1' + implementation 'androidx.room:room-ktx:2.5.1' // Jetpack Compose accompanists (https://github.com/google/accompanist) - implementation 'com.google.accompanist:accompanist-systemuicontroller:0.28.0' + implementation 'com.google.accompanist:accompanist-systemuicontroller:0.30.0' } \ No newline at end of file diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 957ce2e0..496e882c 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -6,7 +6,6 @@ android:name="android.hardware.camera" android:required="false" /> - diff --git a/app/src/main/java/org/metabrainz/android/application/App.kt b/app/src/main/java/org/metabrainz/android/application/App.kt index 771ba807..95fde25d 100644 --- a/app/src/main/java/org/metabrainz/android/application/App.kt +++ b/app/src/main/java/org/metabrainz/android/application/App.kt @@ -7,7 +7,6 @@ import android.graphics.Typeface import android.net.ConnectivityManager import android.net.NetworkCapabilities import android.os.Build -import android.provider.Settings import dagger.hilt.android.HiltAndroidApp import org.metabrainz.android.util.Configuration @@ -24,11 +23,6 @@ class App : Application() { robotoLight = Typeface.createFromAsset(context!!.assets, "Roboto-Light.ttf") } - val isNotificationServiceAllowed: Boolean - get() { - val listeners = Settings.Secure.getString(contentResolver, "enabled_notification_listeners") - return listeners != null && listeners.contains(packageName) - } val isOnline: Boolean get() { val connectivityManager = applicationContext.getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager diff --git a/app/src/main/java/org/metabrainz/android/ui/screens/onboarding/FeaturesActivity.kt b/app/src/main/java/org/metabrainz/android/ui/screens/onboarding/FeaturesActivity.kt index aeec1608..75538301 100644 --- a/app/src/main/java/org/metabrainz/android/ui/screens/onboarding/FeaturesActivity.kt +++ b/app/src/main/java/org/metabrainz/android/ui/screens/onboarding/FeaturesActivity.kt @@ -6,10 +6,10 @@ import android.os.Bundle import androidx.appcompat.app.AlertDialog import androidx.core.content.ContextCompat import androidx.fragment.app.Fragment -import com.aemerse.onboard.OnboardAdvanced -import com.aemerse.onboard.OnboardFragment -import com.aemerse.onboard.OnboardPageTransformerType -import com.aemerse.onboard.model.SliderPage +import com.limurse.onboard.OnboardAdvanced +import com.limurse.onboard.OnboardFragment +import com.limurse.onboard.OnboardPageTransformerType +import com.limurse.onboard.model.SliderPage import org.metabrainz.android.R import org.metabrainz.android.ui.screens.dashboard.DashboardActivity import org.metabrainz.android.util.UserPreferences @@ -19,7 +19,8 @@ class FeaturesActivity : OnboardAdvanced() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) - addSlide(OnboardFragment.newInstance( + addSlide( + OnboardFragment.newInstance( SliderPage( "Search", "Explore MusicBrainz Data", diff --git a/app/src/main/java/org/metabrainz/android/ui/screens/settings/SettingsActivity.kt b/app/src/main/java/org/metabrainz/android/ui/screens/settings/SettingsActivity.kt index 69e66ef3..977b3ff6 100644 --- a/app/src/main/java/org/metabrainz/android/ui/screens/settings/SettingsActivity.kt +++ b/app/src/main/java/org/metabrainz/android/ui/screens/settings/SettingsActivity.kt @@ -1,24 +1,17 @@ package org.metabrainz.android.ui.screens.settings -import android.content.DialogInterface -import android.content.Intent import android.graphics.drawable.ColorDrawable import android.os.Build import android.os.Bundle import android.provider.Settings import android.view.MenuItem -import androidx.appcompat.app.AlertDialog import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatDelegate import androidx.preference.Preference -import androidx.preference.SwitchPreference -import org.metabrainz.android.application.App import org.metabrainz.android.R import org.metabrainz.android.databinding.ActivityPreferencesBinding -import org.metabrainz.android.util.UserPreferences.PREFERENCE_LISTENING_ENABLED -import org.metabrainz.android.util.UserPreferences.PREFERENCE_SYSTEM_THEME -import org.metabrainz.android.util.UserPreferences.preferenceListeningEnabled import org.metabrainz.android.ui.theme.isUiModeIsDark +import org.metabrainz.android.util.UserPreferences.PREFERENCE_SYSTEM_THEME class SettingsActivity : AppCompatActivity() { @@ -48,24 +41,6 @@ class SettingsActivity : AppCompatActivity() { } preferenceChangeListener = Preference.OnPreferenceChangeListener { preference: Preference, newValue: Any -> - if (preference.key == PREFERENCE_LISTENING_ENABLED) { - val enabled = newValue as Boolean - if (enabled && !App.context!!.isNotificationServiceAllowed) { - val builder = AlertDialog.Builder(this) - builder.setTitle("Grant Media Control Permissions") - builder.setMessage("The listen service requires the special Notification " + - "Listener Service Permission to run. Please grant this permission to" + - " MusicBrainz for Android if you want to use the service.") - builder.setPositiveButton("Proceed") { dialog: DialogInterface?, which: Int -> startActivity(Intent(ACTION_NOTIFICATION_LISTENER_SETTINGS)) } - builder.setNegativeButton("Cancel") { dialog: DialogInterface?, which: Int -> - preferenceListeningEnabled = false - (preference as SwitchPreference).isChecked = false - } - builder.create().show() - } - return@OnPreferenceChangeListener true - } - // Explicit Ui Mode functionality. if (preference.key == PREFERENCE_SYSTEM_THEME){ when (newValue) { diff --git a/app/src/main/java/org/metabrainz/android/ui/screens/settings/SettingsFragment.kt b/app/src/main/java/org/metabrainz/android/ui/screens/settings/SettingsFragment.kt index 91713e3e..13c037e4 100644 --- a/app/src/main/java/org/metabrainz/android/ui/screens/settings/SettingsFragment.kt +++ b/app/src/main/java/org/metabrainz/android/ui/screens/settings/SettingsFragment.kt @@ -7,15 +7,11 @@ import android.view.MenuItem import android.widget.Toast import androidx.preference.Preference import androidx.preference.PreferenceFragmentCompat -import androidx.preference.SwitchPreference -import org.metabrainz.android.application.App import org.metabrainz.android.R +import org.metabrainz.android.ui.screens.dashboard.DashboardActivity +import org.metabrainz.android.ui.screens.suggestion.SuggestionProvider import org.metabrainz.android.util.UserPreferences.PREFERENCE_CLEAR_SUGGESTIONS -import org.metabrainz.android.util.UserPreferences.PREFERENCE_LISTENING_ENABLED import org.metabrainz.android.util.UserPreferences.PREFERENCE_SYSTEM_THEME -import org.metabrainz.android.util.UserPreferences.preferenceListeningEnabled -import org.metabrainz.android.ui.screens.suggestion.SuggestionProvider -import org.metabrainz.android.ui.screens.dashboard.DashboardActivity class SettingsFragment : PreferenceFragmentCompat(), Preference.OnPreferenceClickListener { private var preferenceChangeListener: Preference.OnPreferenceChangeListener? = null @@ -28,19 +24,6 @@ class SettingsFragment : PreferenceFragmentCompat(), Preference.OnPreferenceClic setPreferencesFromResource(R.xml.preferences, rootKey) findPreference(PREFERENCE_CLEAR_SUGGESTIONS)!!.onPreferenceClickListener = this findPreference(PREFERENCE_SYSTEM_THEME)!!.onPreferenceChangeListener = preferenceChangeListener - if (!App.context!!.isNotificationServiceAllowed) { - (findPreference(PREFERENCE_LISTENING_ENABLED) as SwitchPreference?)!!.isChecked = false - preferenceListeningEnabled = false - } - findPreference(PREFERENCE_LISTENING_ENABLED)!!.onPreferenceChangeListener = preferenceChangeListener - } - - override fun onResume() { - super.onResume() - if (!App.context!!.isNotificationServiceAllowed) { - (findPreference(PREFERENCE_LISTENING_ENABLED) as SwitchPreference?)!!.isChecked = false - preferenceListeningEnabled = false - } } override fun onPreferenceClick(preference: Preference): Boolean { diff --git a/app/src/main/java/org/metabrainz/android/util/UserPreferences.kt b/app/src/main/java/org/metabrainz/android/util/UserPreferences.kt index 47895331..fb142c8e 100644 --- a/app/src/main/java/org/metabrainz/android/util/UserPreferences.kt +++ b/app/src/main/java/org/metabrainz/android/util/UserPreferences.kt @@ -6,11 +6,8 @@ import org.metabrainz.android.application.App object UserPreferences { const val PREFERENCE_CLEAR_SUGGESTIONS = "clear_suggestions" - const val PREFERENCE_LISTENBRAINZ_TOKEN = "listenbrainz_user_token" const val PREFERENCE_PICARD_PORT = "picard_port" const val PREFERENCE_IP_ADDRESS = "ip_address" - const val PREFERENCE_LISTENING_ENABLED = "listening_enabled" - private const val PREFERENCE_LISTENING_SPOTIFY = "listening_spotify_enabled" private const val PREFERENCE_GET_PRIVATE_COLLECTIONS = "private_collections" private const val PREFERENCE_RATINGS_TAGS = "ratings_tags" private const val PREFERENCE_SYSTEM_LANGUAGE = "use_english" @@ -33,14 +30,4 @@ object UserPreferences { get() = preferences.getString(PREFERENCE_PICARD_PORT, "8000")!! val preferenceIpAddress: String? get() = preferences.getString(PREFERENCE_IP_ADDRESS, null) - - val preferenceListenBrainzToken = preferences.getString(PREFERENCE_LISTENBRAINZ_TOKEN, null) - var preferenceListeningEnabled: Boolean - get() = preferences.getBoolean(PREFERENCE_LISTENING_ENABLED, false) - set(value) { - val editor = preferences.edit() - editor.putBoolean(PREFERENCE_LISTENING_ENABLED, value) - editor.apply() - } - val preferenceListeningSpotifyEnabled = preferences.getBoolean(PREFERENCE_LISTENING_SPOTIFY, false) } \ No newline at end of file diff --git a/app/src/main/res/xml/preferences.xml b/app/src/main/res/xml/preferences.xml index 1246069d..1fdbfdd9 100644 --- a/app/src/main/res/xml/preferences.xml +++ b/app/src/main/res/xml/preferences.xml @@ -44,29 +44,6 @@ android:title="@string/settings_use_language" /> - - - - - - - - - diff --git a/build.gradle b/build.gradle index 718286b5..6384047e 100644 --- a/build.gradle +++ b/build.gradle @@ -1,17 +1,17 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { ext { - kotlin_version = '1.7.10' + kotlin_version = '1.8.20' navigationVersion = '2.5.3' - hilt_version = '2.44.2' - compose_version = '1.3.2' + hilt_version = '2.45' + compose_version = '1.4.2' } repositories { google() mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:7.4.2' + classpath 'com.android.tools.build:gradle:8.0.0' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath "com.google.dagger:hilt-android-gradle-plugin:$hilt_version" // NOTE: Do not place your application dependencies here; they belong diff --git a/fastlane/metadata/android/en-US/changelogs/55.txt b/fastlane/metadata/android/en-US/changelogs/55.txt new file mode 100644 index 00000000..5ba043ad --- /dev/null +++ b/fastlane/metadata/android/en-US/changelogs/55.txt @@ -0,0 +1 @@ +Refactored codebase and removed Listens service. \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 2938796e..b7bbc366 100644 --- a/gradle.properties +++ b/gradle.properties @@ -17,3 +17,6 @@ org.gradle.jvmargs=-Xmx4096m android.useAndroidX=true # Automatically convert third-party libraries to use AndroidX android.enableJetifier=true +android.defaults.buildfeatures.buildconfig=true +android.nonTransitiveRClass=false +android.nonFinalResIds=false diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 1405747d..803dcc2b 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Sun Jul 12 20:03:45 IST 2020 +#Fri Apr 28 01:14:54 IST 2023 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip