diff --git a/app/src/main/java/com/finnmglas/launcher/Functions.kt b/app/src/main/java/com/finnmglas/launcher/Functions.kt
index f071af9..24a7b74 100644
--- a/app/src/main/java/com/finnmglas/launcher/Functions.kt
+++ b/app/src/main/java/com/finnmglas/launcher/Functions.kt
@@ -78,6 +78,8 @@ const val PREF_DATE_FORMAT = "dateFormat"
const val PREF_DOUBLE_ACTIONS_ENABLED = "enableDoubleActions"
const val PREF_SEARCH_AUTO_LAUNCH = "searchAutoLaunch"
+const val PREF_SLIDE_SENSITIVITY = "slideSensitivity"
+
const val PREF_STARTED = "startedBefore"
const val PREF_STARTED_TIME = "firstStartup"
@@ -462,6 +464,7 @@ fun resetSettings(context: Context) {
.putInt(PREF_DATE_FORMAT, 0)
.putBoolean(PREF_SCREEN_FULLSCREEN, true)
.putBoolean(PREF_DOUBLE_ACTIONS_ENABLED, false)
+ .putInt(PREF_SLIDE_SENSITIVITY, 50)
// load action defaults
for (actionKey in ACTIONS)
diff --git a/app/src/main/java/com/finnmglas/launcher/HomeActivity.kt b/app/src/main/java/com/finnmglas/launcher/HomeActivity.kt
index 1171658..e922b85 100644
--- a/app/src/main/java/com/finnmglas/launcher/HomeActivity.kt
+++ b/app/src/main/java/com/finnmglas/launcher/HomeActivity.kt
@@ -153,7 +153,8 @@ class HomeActivity: UIObject, AppCompatActivity(),
val doubleActions = launcherPreferences.getBoolean(PREF_DOUBLE_ACTIONS_ENABLED, false)
// how distinguished the swipe has to be to launch something
- val strictness = (4 / bufferedPointerCount)
+ // strictness = opposite of sensitivity. TODO - May have to be adjusted
+ val strictness = (4 / bufferedPointerCount) * ((100 - launcherPreferences.getInt(PREF_SLIDE_SENSITIVITY, 50)) / 50)
// Only open if the swipe was not from the phones top edge
if (diffY < -height / 8 && abs(diffY) > strictness * abs(diffX) && e1.y > 100) {
diff --git a/app/src/main/java/com/finnmglas/launcher/settings/launcher/SettingsFragmentLauncher.kt b/app/src/main/java/com/finnmglas/launcher/settings/launcher/SettingsFragmentLauncher.kt
index 31d9404..82b0956 100644
--- a/app/src/main/java/com/finnmglas/launcher/settings/launcher/SettingsFragmentLauncher.kt
+++ b/app/src/main/java/com/finnmglas/launcher/settings/launcher/SettingsFragmentLauncher.kt
@@ -4,6 +4,7 @@ import android.Manifest
import android.app.Activity
import android.content.Intent
import android.content.pm.PackageManager
+import android.graphics.PorterDuff
import android.os.Build
import android.os.Bundle
import android.provider.MediaStore
@@ -13,6 +14,8 @@ import android.view.View
import android.view.ViewGroup
import android.widget.AdapterView
import android.widget.ArrayAdapter
+import android.widget.SeekBar
+import android.widget.Toast
import androidx.appcompat.app.AppCompatActivity
import androidx.core.content.ContextCompat
import androidx.fragment.app.Fragment
@@ -116,6 +119,7 @@ class SettingsFragmentLauncher : Fragment(), UIObject {
settings_launcher_container.setBackgroundColor(dominantColor)
setButtonColor(settings_theme_custom_button_select, vibrantColor)
+ settings_seekbar_sensitivity.progressDrawable.setColorFilter(vibrantColor, PorterDuff.Mode.SRC_IN);
}
override fun setOnClicks() {
@@ -155,6 +159,18 @@ class SettingsFragmentLauncher : Fragment(), UIObject {
intendedSettingsPause = true
activity!!.recreate()
}
+
+ settings_seekbar_sensitivity.setOnSeekBarChangeListener(
+ object : SeekBar.OnSeekBarChangeListener {
+ override fun onProgressChanged(p0: SeekBar?, p1: Int, p2: Boolean) {}
+ override fun onStartTrackingTouch(p0: SeekBar?) {}
+ override fun onStopTrackingTouch(p0: SeekBar?) {
+ launcherPreferences.edit()
+ .putInt(PREF_SLIDE_SENSITIVITY, p0!!.progress)
+ .apply()
+ }
+ }
+ )
}
fun resetToCustomTheme(context: Activity) {
@@ -213,7 +229,7 @@ class SettingsFragmentLauncher : Fragment(), UIObject {
staticThemeAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item)
settings_launcher_theme_spinner.adapter = staticThemeAdapter
- var themeInt = when (getSavedTheme(activity!!)) {
+ val themeInt = when (getSavedTheme(activity!!)) {
"finn" -> 0
"dark" -> 1
"custom" -> 2
@@ -235,5 +251,7 @@ class SettingsFragmentLauncher : Fragment(), UIObject {
}
}
+
+ settings_seekbar_sensitivity.progress = launcherPreferences.getInt(PREF_SLIDE_SENSITIVITY, 50)
}
}
\ No newline at end of file
diff --git a/app/src/main/res/layout/settings_launcher.xml b/app/src/main/res/layout/settings_launcher.xml
index 5e7b07d..c357ef9 100644
--- a/app/src/main/res/layout/settings_launcher.xml
+++ b/app/src/main/res/layout/settings_launcher.xml
@@ -201,6 +201,29 @@
android:orientation="horizontal"
android:paddingLeft="8sp">
+
+
+
+
+
+
+
+
Doppelte Wischaktionen
Suchergebisse launchen
+ Empfindlichkeit
+