mirror of
https://github.com/Aviortheking/Neo-Store.git
synced 2025-04-23 11:22:12 +00:00
Add: DialogButtons
This commit is contained in:
parent
76b24f22b2
commit
01be74c9ba
@ -0,0 +1,54 @@
|
||||
package com.machiav3lli.fdroid.ui.compose.components
|
||||
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.material3.ButtonDefaults
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.material3.TextButton
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.text.font.FontWeight
|
||||
import androidx.compose.ui.unit.dp
|
||||
|
||||
@Composable
|
||||
fun DialogPositiveButton(
|
||||
modifier: Modifier = Modifier,
|
||||
textId: Int = android.R.string.ok,
|
||||
onClick: () -> Unit = {}
|
||||
) {
|
||||
TextButton(
|
||||
shape = MaterialTheme.shapes.large,
|
||||
onClick = onClick,
|
||||
modifier = modifier,
|
||||
colors = ButtonDefaults.buttonColors(
|
||||
containerColor = MaterialTheme.colorScheme.primary.copy(0.65f),
|
||||
contentColor = MaterialTheme.colorScheme.onPrimary
|
||||
)
|
||||
) {
|
||||
Text(
|
||||
text = stringResource(id = textId),
|
||||
fontWeight = FontWeight.ExtraBold,
|
||||
modifier = Modifier.padding(top = 5.dp, bottom = 5.dp)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
fun DialogNegativeButton(
|
||||
modifier: Modifier = Modifier,
|
||||
textId: Int = android.R.string.cancel,
|
||||
onClick: () -> Unit = {}
|
||||
) {
|
||||
TextButton(
|
||||
shape = MaterialTheme.shapes.large,
|
||||
onClick = onClick,
|
||||
modifier = modifier
|
||||
) {
|
||||
Text(
|
||||
text = stringResource(id = textId),
|
||||
fontWeight = FontWeight.ExtraBold,
|
||||
modifier = Modifier.padding(vertical = 5.dp, horizontal = 8.dp)
|
||||
)
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user