mirror of
https://github.com/jrpie/Launcher.git
synced 2025-06-08 10:20:15 +02:00
Compare commits
3 commits
3d49ec16a7
...
22633bdac3
Author | SHA1 | Date | |
---|---|---|---|
22633bdac3 | |||
4f795289d5 | |||
2774b74d9d |
4 changed files with 40 additions and 26 deletions
|
@ -23,8 +23,8 @@ android {
|
|||
minSdkVersion 21
|
||||
targetSdkVersion 35
|
||||
compileSdk 35
|
||||
versionCode 43
|
||||
versionName "0.1.3"
|
||||
versionCode 44
|
||||
versionName "0.1.4"
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
|
|
@ -37,7 +37,7 @@ import java.util.Locale
|
|||
class HomeActivity : UIObject, AppCompatActivity() {
|
||||
|
||||
private lateinit var binding: HomeBinding
|
||||
private lateinit var touchGestureDetector: TouchGestureDetector
|
||||
private var touchGestureDetector: TouchGestureDetector? = null
|
||||
|
||||
private var sharedPreferencesListener =
|
||||
SharedPreferences.OnSharedPreferenceChangeListener { _, prefKey ->
|
||||
|
@ -56,29 +56,12 @@ class HomeActivity : UIObject, AppCompatActivity() {
|
|||
super<AppCompatActivity>.onCreate(savedInstanceState)
|
||||
super<UIObject>.onCreate()
|
||||
|
||||
touchGestureDetector = TouchGestureDetector(
|
||||
this, 0, 0,
|
||||
LauncherPreferences.enabled_gestures().edgeSwipeEdgeWidth() / 100f
|
||||
)
|
||||
touchGestureDetector.updateScreenSize(windowManager)
|
||||
|
||||
// Initialise layout
|
||||
binding = HomeBinding.inflate(layoutInflater)
|
||||
|
||||
setContentView(binding.root)
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
|
||||
binding.root.setOnApplyWindowInsetsListener { _, windowInsets ->
|
||||
@Suppress("deprecation") // required to support API 29
|
||||
val insets = windowInsets.systemGestureInsets
|
||||
touchGestureDetector.setSystemGestureInsets(insets)
|
||||
|
||||
windowInsets
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Handle back key / gesture on Android 13+, cf. onKeyDown()
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
|
||||
onBackInvokedDispatcher.registerOnBackInvokedCallback(
|
||||
|
@ -94,7 +77,7 @@ class HomeActivity : UIObject, AppCompatActivity() {
|
|||
|
||||
override fun onConfigurationChanged(newConfig: Configuration) {
|
||||
super.onConfigurationChanged(newConfig)
|
||||
touchGestureDetector.updateScreenSize(windowManager)
|
||||
touchGestureDetector?.updateScreenSize(windowManager)
|
||||
}
|
||||
|
||||
override fun onStart() {
|
||||
|
@ -188,8 +171,28 @@ class HomeActivity : UIObject, AppCompatActivity() {
|
|||
override fun onResume() {
|
||||
super.onResume()
|
||||
|
||||
touchGestureDetector.edgeWidth =
|
||||
/* This should be initialized in onCreate()
|
||||
However on some devices there seems to be a bug where the touchGestureDetector
|
||||
is not working properly after resuming the app.
|
||||
Reinitializing the touchGestureDetector every time the app is resumed might help to fix that.
|
||||
(see issue #138)
|
||||
*/
|
||||
touchGestureDetector = TouchGestureDetector(
|
||||
this, 0, 0,
|
||||
LauncherPreferences.enabled_gestures().edgeSwipeEdgeWidth() / 100f
|
||||
).also {
|
||||
it.updateScreenSize(windowManager)
|
||||
}
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
|
||||
binding.root.setOnApplyWindowInsetsListener { _, windowInsets ->
|
||||
@Suppress("deprecation") // required to support API 29
|
||||
val insets = windowInsets.systemGestureInsets
|
||||
touchGestureDetector?.setSystemGestureInsets(insets)
|
||||
|
||||
windowInsets
|
||||
}
|
||||
}
|
||||
|
||||
initClock()
|
||||
updateSettingsFallbackButtonVisibility()
|
||||
|
@ -230,7 +233,7 @@ class HomeActivity : UIObject, AppCompatActivity() {
|
|||
}
|
||||
|
||||
override fun onTouchEvent(event: MotionEvent): Boolean {
|
||||
touchGestureDetector.onTouchEvent(event)
|
||||
touchGestureDetector?.onTouchEvent(event)
|
||||
return true
|
||||
}
|
||||
|
||||
|
|
|
@ -251,12 +251,12 @@
|
|||
<string name="list_other_track_next">Music: Next</string>
|
||||
<string name="list_other_track_previous">Music: Previous</string>
|
||||
<string name="list_other_track_play_pause">Music: Play / Pause</string>
|
||||
<string name="list_other_expand_notifications_panel">Expand notifications panel</string>
|
||||
<string name="list_other_expand_notifications_panel">Expand Notifications Panel</string>
|
||||
<string name="list_other_recent_apps">Recent Apps</string>
|
||||
<string name="list_other_nop">Do nothing</string>
|
||||
<string name="list_other_nop">Do Nothing</string>
|
||||
<string name="list_other_lock_screen">Lock Screen</string>
|
||||
<string name="list_other_torch">Toggle Torch</string>
|
||||
<string name="list_other_launch_other_launcher">Launch other Home Screen</string>
|
||||
<string name="list_other_launch_other_launcher">Launch Other Home Screen</string>
|
||||
|
||||
<!-- Pin shortcuts -->
|
||||
<string name="pin_shortcut_title">Add Shortcut</string>
|
||||
|
|
11
fastlane/metadata/android/en-US/changelogs/44.txt
Normal file
11
fastlane/metadata/android/en-US/changelogs/44.txt
Normal file
|
@ -0,0 +1,11 @@
|
|||
* New action: Launch other launchers
|
||||
* New action: Show recent apps (workaround for an Android bug)
|
||||
* Fixed "Set µLauncher as home screen" button
|
||||
* Size of "choose app" button was limited
|
||||
|
||||
* Added Arabic translation (thank you, letterhaven!)
|
||||
* Started Lithuanian translation (thank you, IdeallyGrey!)
|
||||
* Improved Chinese translation (thank you, monkeyotg!)
|
||||
* Improved Portuguese translation (thank you, "Vossa Excelencia"!)
|
||||
* Improved Spanish translation (thank you, T!)
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue