Increase trigger distance of swipe to refresh

This commit is contained in:
Willi Ye 2021-03-29 20:40:48 +02:00 committed by ◱ Mark
parent 88b05f45d5
commit 61c489dc68
3 changed files with 11 additions and 11 deletions

View File

@ -28,6 +28,10 @@ android {
sourceCompatibility = javaVersion sourceCompatibility = javaVersion
targetCompatibility = javaVersion targetCompatibility = javaVersion
} }
kotlinOptions {
jvmTarget = javaVersion.toString()
}
buildTypes { buildTypes {
release { release {
debuggable true debuggable true
@ -48,6 +52,10 @@ android {
shrinkResources false shrinkResources false
} }
} }
buildFeatures {
prefab true
viewBinding true
}
/* Linting */ /* Linting */
lintOptions { lintOptions {
@ -56,7 +64,6 @@ android {
/* NDK */ /* NDK */
ndkVersion '22.0.7026061' ndkVersion '22.0.7026061'
externalNativeBuild { externalNativeBuild {
cmake { cmake {
version '3.18.1+' version '3.18.1+'
@ -67,14 +74,6 @@ android {
aaptOptions { aaptOptions {
ignoreAssetsPattern "*.md" ignoreAssetsPattern "*.md"
} }
kotlinOptions {
jvmTarget = javaVersion.toString()
}
buildFeatures {
viewBinding true
prefab true
}
} }
dependencies { dependencies {

View File

@ -41,6 +41,7 @@ import emu.skyline.loader.RomFormat
import emu.skyline.utils.Settings import emu.skyline.utils.Settings
import javax.inject.Inject import javax.inject.Inject
import kotlin.math.ceil import kotlin.math.ceil
import kotlin.math.roundToInt
@AndroidEntryPoint @AndroidEntryPoint
class MainActivity : AppCompatActivity() { class MainActivity : AppCompatActivity() {
@ -111,7 +112,7 @@ class MainActivity : AppCompatActivity() {
binding.swipeRefreshLayout.apply { binding.swipeRefreshLayout.apply {
setProgressBackgroundColorSchemeColor(obtainStyledAttributes(intArrayOf(R.attr.colorPrimary)).use { it.getColor(0, Color.BLACK) }) setProgressBackgroundColorSchemeColor(obtainStyledAttributes(intArrayOf(R.attr.colorPrimary)).use { it.getColor(0, Color.BLACK) })
setColorSchemeColors(obtainStyledAttributes(intArrayOf(R.attr.colorAccent)).use { it.getColor(0, Color.BLACK) }) setColorSchemeColors(obtainStyledAttributes(intArrayOf(R.attr.colorAccent)).use { it.getColor(0, Color.BLACK) })
post { setDistanceToTriggerSync(binding.swipeRefreshLayout.height / 3) } post { setDistanceToTriggerSync((binding.swipeRefreshLayout.height / 2.5f).roundToInt()) }
setOnRefreshListener { loadRoms(false) } setOnRefreshListener { loadRoms(false) }
} }

View File

@ -10,8 +10,8 @@ buildscript {
repositories { repositories {
google() google()
jcenter()
mavenCentral() mavenCentral()
jcenter()
} }
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:4.1.2' classpath 'com.android.tools.build:gradle:4.1.2'