feat(IconOptions): add confirm button

This commit is contained in:
rushiiMachine 2025-06-28 23:49:13 -07:00
parent 7c63e253d2
commit 306d7b3c87
No known key found for this signature in database
GPG key ID: DCBE5952BB3B6420
3 changed files with 15 additions and 1 deletions

View file

@ -6,5 +6,4 @@
- Auto-rename package names when adding new installs...?
- `IconOptionsScreen`
- https://discord.com/channels/811255666990907402/1373756392892272691/1380726498725593220
- Save/Back button at the bottom
- Reset button on PatchOptionsScreen?

View file

@ -46,6 +46,7 @@ private fun IconOptionsScreenPreview(
setSelectedColor = { color = it },
selectedImage = { image },
setSelectedImage = {},
onBackPressed = {},
)
}
}

View file

@ -41,6 +41,7 @@ import com.aliucord.manager.ui.screens.patchopts.PatchOptions
import com.aliucord.manager.ui.screens.patchopts.PatchOptionsScreen
import com.aliucord.manager.ui.util.ColorSaver
import com.aliucord.manager.ui.util.throttledState
import com.aliucord.manager.util.back
import dev.zt64.compose.pipette.CircularColorPicker
import dev.zt64.compose.pipette.HsvColor
import kotlinx.parcelize.IgnoredOnParcel
@ -70,6 +71,7 @@ class IconOptionsScreen : Screen, Parcelable {
setSelectedColor = model::changeSelectedColor,
selectedImage = { model.selectedImage },
setSelectedImage = model::changeSelectedImageUri,
onBackPressed = { navigator.back(currentActivity = null) },
)
}
}
@ -82,6 +84,7 @@ fun IconOptionsScreenContent(
setSelectedColor: (HsvColor) -> Unit,
selectedImage: () -> ByteArray?,
setSelectedImage: (Uri) -> Unit,
onBackPressed: () -> Unit,
) {
val isAdaptiveIconsAvailable = Build.VERSION.SDK_INT >= 26
@ -160,6 +163,17 @@ fun IconOptionsScreenContent(
setSelectedImage = setSelectedImage,
)
}
Row(
horizontalArrangement = Arrangement.End,
modifier = Modifier.fillMaxWidth(),
) {
FilledTonalButton(
onClick = onBackPressed,
) {
Text(stringResource(R.string.action_confirm))
}
}
}
}
}