Skip to content

Commit 9f4aa6c

Browse files
committed
#1675 feat: option to make floating buttons movable and not locked in position
1 parent 7d7ddc0 commit 9f4aa6c

File tree

8 files changed

+499
-2
lines changed

8 files changed

+499
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
- [#1982](https://github.com/keymapperorg/KeyMapper/issues/1982) Text action does not need Key Mapper input method on Android 13+.
2222
- [#1989](https://github.com/keymapperorg/KeyMapper/issues/1989) center the "Trigger and actions" and "Constraint and more" tabs.
2323
- [#1392](https://github.com/keymapperorg/KeyMapper/issues/1392) Add action to enable/disable/toggle night shift.
24-
- Bugs with expert mode auto starting time.
24+
- [#1675](https://github.com/keymapperorg/KeyMapper/issues/1675) Option to make floating buttons movable
2525

2626
## [4.0.0 Beta 6](https://github.com/sds100/KeyMapper/releases/tag/v4.0.0-beta.06)
2727

base/src/main/java/io/github/sds100/keymapper/base/floating/FloatingButtonData.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ data class FloatingButtonData(
1818
val location: Location,
1919
val showOverStatusBar: Boolean,
2020
val showOverInputMethod: Boolean,
21+
val isPositionLocked: Boolean,
2122
) {
2223
/**
2324
* This stores data about where a draggable overlay is located. It needs extra information
@@ -83,6 +84,8 @@ object FloatingButtonEntityMapper {
8384
),
8485
showOverStatusBar = entity.showOverStatusBar ?: false,
8586
showOverInputMethod = entity.showOverInputMethod ?: false,
87+
// Should be locked by default.
88+
isPositionLocked = entity.isPositionLocked ?: true,
8689
)
8790
}
8891

@@ -101,6 +104,7 @@ object FloatingButtonEntityMapper {
101104
displayHeight = button.location.displaySize.height,
102105
showOverStatusBar = button.showOverStatusBar,
103106
showOverInputMethod = button.showOverInputMethod,
107+
isPositionLocked = button.isPositionLocked,
104108
)
105109
}
106110
}

base/src/main/res/values/strings.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1437,6 +1437,7 @@
14371437
<string name="floating_button_config_empty_text_error">The button must have text!</string>
14381438
<string name="floating_button_config_show_over_status_bar">Show over notification panel</string>
14391439
<string name="floating_button_config_show_over_input_method">Show over keyboard</string>
1440+
<string name="floating_button_config_lock_position">Lock in position</string>
14401441
<string name="floating_buttons_product_title">Floating buttons</string>
14411442
<string name="floating_buttons_product_description">Floating buttons display over the apps you want. They work just like real buttons, and you can place, style, and map them however you like.</string>
14421443
<string name="floating_button_text_key_map_list_item">Floating button %s (%s)</string>

0 commit comments

Comments
 (0)