diff --git a/java/res/drawable/move.xml b/java/res/drawable/move.xml
new file mode 100644
index 000000000..5d4369fc8
--- /dev/null
+++ b/java/res/drawable/move.xml
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
+
diff --git a/java/res/values/strings-uix.xml b/java/res/values/strings-uix.xml
index 23a0491c0..488830f65 100644
--- a/java/res/values/strings-uix.xml
+++ b/java/res/values/strings-uix.xml
@@ -15,6 +15,12 @@
Debug Info
More Actions
+ Action Key
+ Pinned Action(s)
+ Favorite Actions
+ More Actions
+ Hidden Actions
+
AMOLED Dark Purple
AOSP Material Dark
AOSP Material Light
diff --git a/java/src/org/futo/inputmethod/latin/uix/actions/MoreActions.kt b/java/src/org/futo/inputmethod/latin/uix/actions/MoreActions.kt
index bb8bff482..b0758b687 100644
--- a/java/src/org/futo/inputmethod/latin/uix/actions/MoreActions.kt
+++ b/java/src/org/futo/inputmethod/latin/uix/actions/MoreActions.kt
@@ -14,6 +14,7 @@ import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
+import androidx.compose.foundation.layout.size
import androidx.compose.foundation.lazy.grid.GridCells
import androidx.compose.foundation.lazy.grid.GridItemSpan
import androidx.compose.foundation.lazy.grid.LazyVerticalGrid
@@ -21,6 +22,7 @@ import androidx.compose.foundation.lazy.grid.items
import androidx.compose.foundation.lazy.grid.rememberLazyGridState
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.Icon
+import androidx.compose.material3.LocalContentColor
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.OutlinedButton
import androidx.compose.material3.Surface
@@ -38,6 +40,7 @@ import androidx.compose.ui.platform.LocalInspectionMode
import androidx.compose.ui.platform.LocalView
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
+import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
@@ -54,15 +57,24 @@ import sh.calvin.reorderable.rememberReorderableLazyGridState
@Composable
-fun ActionItem(action: Action, modifier: Modifier = Modifier) {
- Surface(color = MaterialTheme.colorScheme.primaryContainer, modifier = modifier
+fun ActionItem(action: Action, modifier: Modifier = Modifier, dragIcon: Boolean = false, dragIconModifier: Modifier = Modifier) {
+ Surface(color = MaterialTheme.colorScheme.surfaceVariant.copy(alpha = 0.5f), modifier = modifier
.fillMaxWidth()
.height(92.dp)
- , shape = RoundedCornerShape(8.dp)) {
+ , shape = RoundedCornerShape(16.dp)) {
Box(modifier = Modifier
.fillMaxSize()
.padding(8.dp)) {
+ if(dragIcon) {
+ Icon(
+ painterResource(id = R.drawable.move),
+ contentDescription = null,
+ modifier = dragIconModifier.size(16.dp).align(Alignment.TopEnd),
+ tint = LocalContentColor.current.copy(alpha = 0.6f)
+ )
+ }
+
Column(modifier = Modifier
.align(Center)
.padding(8.dp)) {
@@ -114,6 +126,8 @@ fun MoreActionsView() {
}
}
+val CategoryTitleStyle = Typography.titleMedium.copy(fontWeight = FontWeight.W500)
+
@OptIn(ExperimentalFoundationApi::class)
@Composable
@@ -171,7 +185,7 @@ fun ActionsEditor() {
onDragStopped = {
view.performHapticFeedback(HapticFeedbackConstants.GESTURE_END)
},
- ))
+ ), dragIcon = true, dragIconModifier = Modifier.draggableHandle())
}
}
is ActionEditorItem.Separator -> {
@@ -186,7 +200,7 @@ fun ActionsEditor() {
}
}
}
- Text(it.category.name)
+ Text(it.category.name(context), modifier = Modifier.padding(top = 24.dp), style = CategoryTitleStyle, color = LocalContentColor.current.copy(alpha = 0.6f))
}
}
}
diff --git a/java/src/org/futo/inputmethod/latin/uix/actions/Registry.kt b/java/src/org/futo/inputmethod/latin/uix/actions/Registry.kt
index bc77ab76e..8689d1272 100644
--- a/java/src/org/futo/inputmethod/latin/uix/actions/Registry.kt
+++ b/java/src/org/futo/inputmethod/latin/uix/actions/Registry.kt
@@ -4,6 +4,7 @@ import android.content.Context
import androidx.core.content.edit
import androidx.datastore.preferences.core.stringPreferencesKey
import org.futo.inputmethod.keyboard.internal.KeyboardCodesSet
+import org.futo.inputmethod.latin.R
import org.futo.inputmethod.latin.settings.Settings
import org.futo.inputmethod.latin.uix.Action
import org.futo.inputmethod.latin.uix.PreferenceUtils
@@ -84,6 +85,16 @@ enum class ActionCategory {
Disabled
}
+fun ActionCategory.name(context: Context): String {
+ return context.getString(when(this) {
+ ActionCategory.ActionKey -> R.string.action_kind_action_key
+ ActionCategory.PinnedKey -> R.string.action_kind_pinned_key
+ ActionCategory.Favorites -> R.string.action_kind_favorites
+ ActionCategory.More -> R.string.action_kind_more
+ ActionCategory.Disabled -> R.string.action_kind_disabled
+ })
+}
+
fun ActionCategory.toSepName(): String {
return "_SEP_${name}"
}