Skip to content

Commit

Permalink
Increase trigger distance of swipe to refresh
Browse files Browse the repository at this point in the history
  • Loading branch information
Grarak authored and PixelyIon committed Jun 17, 2021
1 parent 88b05f4 commit 61c489d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
17 changes: 8 additions & 9 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ android {
sourceCompatibility = javaVersion
targetCompatibility = javaVersion
}
kotlinOptions {
jvmTarget = javaVersion.toString()
}

buildTypes {
release {
debuggable true
Expand All @@ -48,6 +52,10 @@ android {
shrinkResources false
}
}
buildFeatures {
prefab true
viewBinding true
}

/* Linting */
lintOptions {
Expand All @@ -56,7 +64,6 @@ android {

/* NDK */
ndkVersion '22.0.7026061'

externalNativeBuild {
cmake {
version '3.18.1+'
Expand All @@ -67,14 +74,6 @@ android {
aaptOptions {
ignoreAssetsPattern "*.md"
}

kotlinOptions {
jvmTarget = javaVersion.toString()
}
buildFeatures {
viewBinding true
prefab true
}
}

dependencies {
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/java/emu/skyline/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ import emu.skyline.loader.RomFormat
import emu.skyline.utils.Settings
import javax.inject.Inject
import kotlin.math.ceil
import kotlin.math.roundToInt

@AndroidEntryPoint
class MainActivity : AppCompatActivity() {
Expand Down Expand Up @@ -111,7 +112,7 @@ class MainActivity : AppCompatActivity() {
binding.swipeRefreshLayout.apply {
setProgressBackgroundColorSchemeColor(obtainStyledAttributes(intArrayOf(R.attr.colorPrimary)).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) }
}

Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ buildscript {

repositories {
google()
jcenter()
mavenCentral()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.2'
Expand Down

0 comments on commit 61c489d

Please sign in to comment.