mirror of
https://github.com/Helium314/HeliBoard.git
synced 2025-05-16 06:52:57 +00:00
base all dialogs on ThreeButtonAlertDialog
This commit is contained in:
parent
534bfb2f13
commit
443223de6a
8 changed files with 30 additions and 142 deletions
|
@ -1,15 +1,10 @@
|
|||
package helium314.keyboard.settings.dialogs
|
||||
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.Row
|
||||
import androidx.compose.foundation.layout.Spacer
|
||||
import androidx.compose.material3.AlertDialog
|
||||
import androidx.compose.material3.LocalTextStyle
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.Slider
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.material3.TextButton
|
||||
import androidx.compose.material3.contentColorFor
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.CompositionLocalProvider
|
||||
import androidx.compose.runtime.getValue
|
||||
|
@ -17,11 +12,8 @@ import androidx.compose.runtime.mutableFloatStateOf
|
|||
import androidx.compose.runtime.remember
|
||||
import androidx.compose.runtime.setValue
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.graphics.Shape
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.tooling.preview.Preview
|
||||
import androidx.compose.ui.window.DialogProperties
|
||||
import helium314.keyboard.latin.R
|
||||
|
||||
@Composable
|
||||
|
@ -37,10 +29,6 @@ fun SliderDialog(
|
|||
title: (@Composable () -> Unit)? = null,
|
||||
intermediateSteps: Int? = null,
|
||||
positionString: (@Composable (Float) -> String) = { it.toString() },
|
||||
shape: Shape = MaterialTheme.shapes.medium,
|
||||
backgroundColor: Color = MaterialTheme.colorScheme.surface,
|
||||
contentColor: Color = contentColorFor(backgroundColor),
|
||||
properties: DialogProperties = DialogProperties()
|
||||
) {
|
||||
var sliderPosition by remember { mutableFloatStateOf(initialValue) }
|
||||
|
||||
|
@ -75,10 +63,6 @@ fun SliderDialog(
|
|||
}
|
||||
}
|
||||
},
|
||||
shape = shape,
|
||||
backgroundColor = backgroundColor,
|
||||
contentColor = contentColor,
|
||||
properties = properties,
|
||||
)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue