Skip to content

Commit

Permalink
- Slower scroll during scene reordering
Browse files Browse the repository at this point in the history
- Update dependencies
- Enable minify
  • Loading branch information
thetwom committed Apr 23, 2024
1 parent 22d26e7 commit 3bc6d85
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 17 deletions.
27 changes: 17 additions & 10 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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'
}
2 changes: 1 addition & 1 deletion app/src/main/java/de/moekadu/metronome/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/de/moekadu/metronome/audio/AudioMixer.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 15 additions & 0 deletions app/src/main/java/de/moekadu/metronome/fragments/ScenesFragment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 5 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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"


Expand All @@ -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"
}
}
}
}
Expand Down
1 change: 0 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 3bc6d85

Please sign in to comment.