mirror of
https://github.com/SimpleMobileTools/Simple-Flashlight.git
synced 2025-02-17 04:10:46 +01:00
Replace MaterialTheme
references with SimpleTheme
This commit is contained in:
parent
af6691c06a
commit
28ab74caa1
@ -44,8 +44,8 @@ fun SleepTimerCustomAlertDialog(
|
|||||||
Text(
|
Text(
|
||||||
modifier = Modifier.padding(bottom = SimpleTheme.dimens.margin.extraLarge),
|
modifier = Modifier.padding(bottom = SimpleTheme.dimens.margin.extraLarge),
|
||||||
text = stringResource(id = R.string.sleep_timer),
|
text = stringResource(id = R.string.sleep_timer),
|
||||||
style = MaterialTheme.typography.headlineSmall,
|
style = SimpleTheme.typography.headlineSmall,
|
||||||
color = MaterialTheme.colorScheme.onSurface
|
color = SimpleTheme.colorScheme.onSurface
|
||||||
)
|
)
|
||||||
|
|
||||||
Column(
|
Column(
|
||||||
|
@ -6,7 +6,6 @@ import androidx.compose.foundation.layout.Box
|
|||||||
import androidx.compose.foundation.layout.fillMaxSize
|
import androidx.compose.foundation.layout.fillMaxSize
|
||||||
import androidx.compose.foundation.layout.navigationBarsPadding
|
import androidx.compose.foundation.layout.navigationBarsPadding
|
||||||
import androidx.compose.foundation.layout.wrapContentSize
|
import androidx.compose.foundation.layout.wrapContentSize
|
||||||
import androidx.compose.material3.MaterialTheme
|
|
||||||
import androidx.compose.material3.Text
|
import androidx.compose.material3.Text
|
||||||
import androidx.compose.material3.TextButton
|
import androidx.compose.material3.TextButton
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
@ -18,6 +17,7 @@ import androidx.compose.ui.res.stringResource
|
|||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import com.simplemobiletools.commons.compose.extensions.MyDevices
|
import com.simplemobiletools.commons.compose.extensions.MyDevices
|
||||||
import com.simplemobiletools.commons.compose.theme.AppThemeSurface
|
import com.simplemobiletools.commons.compose.theme.AppThemeSurface
|
||||||
|
import com.simplemobiletools.commons.compose.theme.SimpleTheme
|
||||||
import com.simplemobiletools.commons.extensions.getContrastColor
|
import com.simplemobiletools.commons.extensions.getContrastColor
|
||||||
import com.simplemobiletools.flashlight.R
|
import com.simplemobiletools.flashlight.R
|
||||||
import com.simplemobiletools.flashlight.views.AnimatedSleepTimer
|
import com.simplemobiletools.flashlight.views.AnimatedSleepTimer
|
||||||
@ -41,7 +41,7 @@ internal fun BrightDisplayScreen(
|
|||||||
.border(
|
.border(
|
||||||
width = 1.dp,
|
width = 1.dp,
|
||||||
color = Color(contrastColor),
|
color = Color(contrastColor),
|
||||||
shape = MaterialTheme.shapes.extraLarge
|
shape = SimpleTheme.shapes.extraLarge
|
||||||
),
|
),
|
||||||
onClick = onChangeColorPress
|
onClick = onChangeColorPress
|
||||||
) {
|
) {
|
||||||
@ -66,8 +66,8 @@ internal fun BrightDisplayScreen(
|
|||||||
private fun BrightDisplayScreenPreview() {
|
private fun BrightDisplayScreenPreview() {
|
||||||
AppThemeSurface {
|
AppThemeSurface {
|
||||||
BrightDisplayScreen(
|
BrightDisplayScreen(
|
||||||
backgroundColor = MaterialTheme.colorScheme.background.toArgb(),
|
backgroundColor = SimpleTheme.colorScheme.background.toArgb(),
|
||||||
contrastColor = MaterialTheme.colorScheme.background.toArgb().getContrastColor(),
|
contrastColor = SimpleTheme.colorScheme.background.toArgb().getContrastColor(),
|
||||||
sleepTimer = {
|
sleepTimer = {
|
||||||
AnimatedSleepTimer(timerText = "00:00", timerVisible = true, onTimerClosePress = {})
|
AnimatedSleepTimer(timerText = "00:00", timerVisible = true, onTimerClosePress = {})
|
||||||
},
|
},
|
||||||
|
@ -104,7 +104,7 @@ internal fun FlashlightButton(
|
|||||||
),
|
),
|
||||||
painter = painterResource(id = R.drawable.ic_flashlight_vector),
|
painter = painterResource(id = R.drawable.ic_flashlight_vector),
|
||||||
contentDescription = stringResource(id = R.string.flashlight_short),
|
contentDescription = stringResource(id = R.string.flashlight_short),
|
||||||
tint = if (flashlightActive) MaterialTheme.colorScheme.primary else MaterialTheme.colorScheme.onSurface
|
tint = if (flashlightActive) SimpleTheme.colorScheme.primary else SimpleTheme.colorScheme.onSurface
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -123,7 +123,7 @@ internal fun BrightDisplayButton(
|
|||||||
),
|
),
|
||||||
painter = painterResource(id = R.drawable.ic_bright_display_vector),
|
painter = painterResource(id = R.drawable.ic_bright_display_vector),
|
||||||
contentDescription = stringResource(id = R.string.bright_display),
|
contentDescription = stringResource(id = R.string.bright_display),
|
||||||
tint = MaterialTheme.colorScheme.onSurface
|
tint = SimpleTheme.colorScheme.onSurface
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -143,7 +143,7 @@ internal fun SosButton(
|
|||||||
text = stringResource(id = R.string.sos),
|
text = stringResource(id = R.string.sos),
|
||||||
fontSize = AppDimensions.sosTextSize,
|
fontSize = AppDimensions.sosTextSize,
|
||||||
fontWeight = FontWeight.Bold,
|
fontWeight = FontWeight.Bold,
|
||||||
color = if (sosActive) MaterialTheme.colorScheme.primary else MaterialTheme.colorScheme.onSurface
|
color = if (sosActive) SimpleTheme.colorScheme.primary else SimpleTheme.colorScheme.onSurface
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -163,7 +163,7 @@ internal fun StroboscopeButton(
|
|||||||
),
|
),
|
||||||
painter = painterResource(id = R.drawable.ic_stroboscope_vector),
|
painter = painterResource(id = R.drawable.ic_stroboscope_vector),
|
||||||
contentDescription = stringResource(id = R.string.stroboscope),
|
contentDescription = stringResource(id = R.string.stroboscope),
|
||||||
tint = if (stroboscopeActive) MaterialTheme.colorScheme.primary else MaterialTheme.colorScheme.onSurface
|
tint = if (stroboscopeActive) SimpleTheme.colorScheme.primary else SimpleTheme.colorScheme.onSurface
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
package com.simplemobiletools.flashlight.screens
|
package com.simplemobiletools.flashlight.screens
|
||||||
|
|
||||||
import androidx.compose.material3.HorizontalDivider
|
import androidx.compose.material3.HorizontalDivider
|
||||||
import androidx.compose.material3.MaterialTheme
|
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.ui.res.stringResource
|
import androidx.compose.ui.res.stringResource
|
||||||
import com.simplemobiletools.commons.compose.extensions.MyDevices
|
import com.simplemobiletools.commons.compose.extensions.MyDevices
|
||||||
@ -11,6 +10,7 @@ import com.simplemobiletools.commons.compose.settings.SettingsPreferenceComponen
|
|||||||
import com.simplemobiletools.commons.compose.settings.SettingsTitleTextComponent
|
import com.simplemobiletools.commons.compose.settings.SettingsTitleTextComponent
|
||||||
import com.simplemobiletools.commons.compose.settings.scaffold.SettingsScaffold
|
import com.simplemobiletools.commons.compose.settings.scaffold.SettingsScaffold
|
||||||
import com.simplemobiletools.commons.compose.theme.AppThemeSurface
|
import com.simplemobiletools.commons.compose.theme.AppThemeSurface
|
||||||
|
import com.simplemobiletools.commons.compose.theme.SimpleTheme
|
||||||
import com.simplemobiletools.commons.compose.theme.divider_grey
|
import com.simplemobiletools.commons.compose.theme.divider_grey
|
||||||
import com.simplemobiletools.commons.helpers.isTiramisuPlus
|
import com.simplemobiletools.commons.helpers.isTiramisuPlus
|
||||||
import com.simplemobiletools.flashlight.R
|
import com.simplemobiletools.flashlight.R
|
||||||
@ -71,7 +71,7 @@ internal fun GeneralSettingsSection(
|
|||||||
label = stringResource(id = R.string.language),
|
label = stringResource(id = R.string.language),
|
||||||
value = displayLanguage,
|
value = displayLanguage,
|
||||||
doOnPreferenceClick = onSetupLanguagePress,
|
doOnPreferenceClick = onSetupLanguagePress,
|
||||||
preferenceValueColor = MaterialTheme.colorScheme.onSurface,
|
preferenceValueColor = SimpleTheme.colorScheme.onSurface,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
SettingsCheckBoxComponent(
|
SettingsCheckBoxComponent(
|
||||||
|
@ -76,7 +76,7 @@ internal fun WidgetConfigureScreen(
|
|||||||
.padding(start = SimpleTheme.dimens.margin.medium)
|
.padding(start = SimpleTheme.dimens.margin.medium)
|
||||||
.background(
|
.background(
|
||||||
color = colorResource(id = R.color.md_grey_white),
|
color = colorResource(id = R.color.md_grey_white),
|
||||||
shape = MaterialTheme.shapes.extraLarge
|
shape = SimpleTheme.shapes.extraLarge
|
||||||
)
|
)
|
||||||
.padding(horizontal = SimpleTheme.dimens.margin.extraLarge)
|
.padding(horizontal = SimpleTheme.dimens.margin.extraLarge)
|
||||||
)
|
)
|
||||||
@ -97,7 +97,7 @@ private fun WidgetBrightDisplayConfigureScreenPreview() {
|
|||||||
AppThemeSurface {
|
AppThemeSurface {
|
||||||
WidgetConfigureScreen(
|
WidgetConfigureScreen(
|
||||||
widgetDrawable = R.drawable.ic_bright_display_vector,
|
widgetDrawable = R.drawable.ic_bright_display_vector,
|
||||||
widgetColor = MaterialTheme.colorScheme.primary.toArgb(),
|
widgetColor = SimpleTheme.colorScheme.primary.toArgb(),
|
||||||
widgetAlpha = 1f,
|
widgetAlpha = 1f,
|
||||||
onSliderChanged = {},
|
onSliderChanged = {},
|
||||||
onColorPressed = {},
|
onColorPressed = {},
|
||||||
|
@ -8,7 +8,6 @@ import androidx.compose.foundation.layout.Row
|
|||||||
import androidx.compose.foundation.layout.padding
|
import androidx.compose.foundation.layout.padding
|
||||||
import androidx.compose.material3.Icon
|
import androidx.compose.material3.Icon
|
||||||
import androidx.compose.material3.IconButton
|
import androidx.compose.material3.IconButton
|
||||||
import androidx.compose.material3.MaterialTheme
|
|
||||||
import androidx.compose.material3.Text
|
import androidx.compose.material3.Text
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.ui.Alignment
|
import androidx.compose.ui.Alignment
|
||||||
@ -42,12 +41,12 @@ internal fun SleepTimer(
|
|||||||
.align(Alignment.CenterVertically)
|
.align(Alignment.CenterVertically)
|
||||||
.padding(horizontal = SimpleTheme.dimens.margin.large),
|
.padding(horizontal = SimpleTheme.dimens.margin.large),
|
||||||
text = stringResource(id = R.string.sleep_timer),
|
text = stringResource(id = R.string.sleep_timer),
|
||||||
color = MaterialTheme.colorScheme.onSurface
|
color = SimpleTheme.colorScheme.onSurface
|
||||||
)
|
)
|
||||||
Text(
|
Text(
|
||||||
modifier = Modifier.align(Alignment.CenterVertically),
|
modifier = Modifier.align(Alignment.CenterVertically),
|
||||||
text = timerText,
|
text = timerText,
|
||||||
color = MaterialTheme.colorScheme.onSurface
|
color = SimpleTheme.colorScheme.onSurface
|
||||||
)
|
)
|
||||||
IconButton(
|
IconButton(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
@ -58,7 +57,7 @@ internal fun SleepTimer(
|
|||||||
Icon(
|
Icon(
|
||||||
painter = painterResource(id = R.drawable.ic_cross_vector),
|
painter = painterResource(id = R.drawable.ic_cross_vector),
|
||||||
contentDescription = stringResource(id = R.string.close),
|
contentDescription = stringResource(id = R.string.close),
|
||||||
tint = MaterialTheme.colorScheme.onSurface
|
tint = SimpleTheme.colorScheme.onSurface
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user