diff --git a/app/build.gradle b/app/build.gradle index 331a49a..bf11048 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -16,8 +16,12 @@ android { } buildTypes { release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + minifyEnabled true + shrinkResources true + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + ndk { + debugSymbolLevel 'SYMBOL_TABLE' + } } } compileOptions { @@ -29,25 +33,28 @@ android { jvmTarget = "11" } namespace 'de.moekadu.metronome' + buildFeatures { + buildConfig true + } } dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation 'androidx.appcompat:appcompat:1.6.1' - implementation 'androidx.activity:activity-ktx:1.8.0' - implementation 'androidx.fragment:fragment-ktx:1.6.1' - implementation 'com.google.android.material:material:1.11.0-alpha03' + implementation 'androidx.activity:activity-ktx:1.9.0' + implementation 'androidx.fragment:fragment-ktx:1.6.2' + implementation 'com.google.android.material:material:1.11.0' implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.1' implementation 'androidx.constraintlayout:constraintlayout:2.1.4' - implementation 'androidx.media:media:1.6.0' + implementation 'androidx.media:media:1.7.0' implementation 'androidx.dynamicanimation:dynamicanimation:1.1.0-alpha03' implementation 'androidx.preference:preference-ktx:1.2.1' - implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.6.2' - implementation 'androidx.lifecycle:lifecycle-service:2.6.2' - implementation "androidx.recyclerview:recyclerview:1.3.1" + implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.7.0' + implementation 'androidx.lifecycle:lifecycle-service:2.7.0' + implementation "androidx.recyclerview:recyclerview:1.3.2" implementation "androidx.viewpager2:viewpager2:1.1.0-beta02" testImplementation 'junit:junit:4.13.2' androidTestImplementation 'androidx.test:runner:1.5.2' androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' - implementation 'androidx.core:core-ktx:1.12.0' + implementation 'androidx.core:core-ktx:1.13.0' } diff --git a/app/src/main/java/de/moekadu/metronome/MainActivity.kt b/app/src/main/java/de/moekadu/metronome/MainActivity.kt index 37977d2..81bce34 100644 --- a/app/src/main/java/de/moekadu/metronome/MainActivity.kt +++ b/app/src/main/java/de/moekadu/metronome/MainActivity.kt @@ -145,7 +145,7 @@ class MainActivity : AppCompatActivity() { } } - override fun onNewIntent(intent: Intent?) { + override fun onNewIntent(intent: Intent) { super.onNewIntent(intent) // Log.v("Metronome", "MainActivity.onNewIntent: intent=$intent") handleFileLoadingIntent(intent) diff --git a/app/src/main/java/de/moekadu/metronome/audio/AudioMixer.kt b/app/src/main/java/de/moekadu/metronome/audio/AudioMixer.kt index c838a83..a19b91d 100644 --- a/app/src/main/java/de/moekadu/metronome/audio/AudioMixer.kt +++ b/app/src/main/java/de/moekadu/metronome/audio/AudioMixer.kt @@ -990,7 +990,7 @@ class AudioMixer (val context: Context, private val scope: CoroutineScope) { } /** Set metronome speed. - * @param bpmQuarter Beates per minute of a quarter note. + * @param bpmQuarter Beats per minute of a quarter note. */ fun setBpmQuarter(bpmQuarter: Float) { mixer.bpmQuarter = bpmQuarter diff --git a/app/src/main/java/de/moekadu/metronome/fragments/ScenesFragment.kt b/app/src/main/java/de/moekadu/metronome/fragments/ScenesFragment.kt index b869779..70730bd 100644 --- a/app/src/main/java/de/moekadu/metronome/fragments/ScenesFragment.kt +++ b/app/src/main/java/de/moekadu/metronome/fragments/ScenesFragment.kt @@ -322,6 +322,21 @@ class ScenesFragment : Fragment() { } super.onChildDraw(c, recyclerView, viewHolder, dX, dY, actionState, isCurrentlyActive) } + + override fun interpolateOutOfBoundsScroll( + recyclerView: RecyclerView, + viewSize: Int, + viewSizeOutOfBounds: Int, + totalSize: Int, + msSinceStartScroll: Long + ): Int { + val sign = when { + viewSizeOutOfBounds > 0 -> 1 + viewSizeOutOfBounds < 0 -> -1 + else -> 0 + } + return 10 * sign //(20 * viewSizeOutOfBounds) / viewSize + } } val touchHelper = ItemTouchHelper(simpleTouchHelper) diff --git a/build.gradle b/build.gradle index 3830bb7..5cf6c0b 100644 --- a/build.gradle +++ b/build.gradle @@ -8,7 +8,7 @@ buildscript { mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:8.1.2' + classpath 'com.android.tools.build:gradle:8.3.2' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" @@ -24,8 +24,10 @@ allprojects { } gradle.projectsEvaluated { - tasks.withType(JavaCompile) { - options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation" + tasks.withType(JavaCompile).tap { + configureEach { + options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation" + } } } } diff --git a/gradle.properties b/gradle.properties index 960d308..22f3242 100644 --- a/gradle.properties +++ b/gradle.properties @@ -13,6 +13,5 @@ #Sat Nov 02 09:23:09 CET 2019 org.gradle.jvmargs=-Xmx1024M -Dkotlin.daemon.jvm.options\="-Xmx1024M" android.useAndroidX=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 9d206ca..f7d3f5e 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-all.zip