Replace `MaterialTheme` references with `SimpleTheme`

This commit is contained in:
Ensar Sarajčić 2023-10-05 13:19:31 +02:00
parent af6691c06a
commit 28ab74caa1
6 changed files with 17 additions and 18 deletions

View File

@ -44,8 +44,8 @@ fun SleepTimerCustomAlertDialog(
Text(
modifier = Modifier.padding(bottom = SimpleTheme.dimens.margin.extraLarge),
text = stringResource(id = R.string.sleep_timer),
style = MaterialTheme.typography.headlineSmall,
color = MaterialTheme.colorScheme.onSurface
style = SimpleTheme.typography.headlineSmall,
color = SimpleTheme.colorScheme.onSurface
)
Column(

View File

@ -6,7 +6,6 @@ import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.navigationBarsPadding
import androidx.compose.foundation.layout.wrapContentSize
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.material3.TextButton
import androidx.compose.runtime.Composable
@ -18,6 +17,7 @@ import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import com.simplemobiletools.commons.compose.extensions.MyDevices
import com.simplemobiletools.commons.compose.theme.AppThemeSurface
import com.simplemobiletools.commons.compose.theme.SimpleTheme
import com.simplemobiletools.commons.extensions.getContrastColor
import com.simplemobiletools.flashlight.R
import com.simplemobiletools.flashlight.views.AnimatedSleepTimer
@ -41,7 +41,7 @@ internal fun BrightDisplayScreen(
.border(
width = 1.dp,
color = Color(contrastColor),
shape = MaterialTheme.shapes.extraLarge
shape = SimpleTheme.shapes.extraLarge
),
onClick = onChangeColorPress
) {
@ -66,8 +66,8 @@ internal fun BrightDisplayScreen(
private fun BrightDisplayScreenPreview() {
AppThemeSurface {
BrightDisplayScreen(
backgroundColor = MaterialTheme.colorScheme.background.toArgb(),
contrastColor = MaterialTheme.colorScheme.background.toArgb().getContrastColor(),
backgroundColor = SimpleTheme.colorScheme.background.toArgb(),
contrastColor = SimpleTheme.colorScheme.background.toArgb().getContrastColor(),
sleepTimer = {
AnimatedSleepTimer(timerText = "00:00", timerVisible = true, onTimerClosePress = {})
},

View File

@ -104,7 +104,7 @@ internal fun FlashlightButton(
),
painter = painterResource(id = R.drawable.ic_flashlight_vector),
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),
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),
fontSize = AppDimensions.sosTextSize,
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),
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
)
}

View File

@ -1,7 +1,6 @@
package com.simplemobiletools.flashlight.screens
import androidx.compose.material3.HorizontalDivider
import androidx.compose.material3.MaterialTheme
import androidx.compose.runtime.Composable
import androidx.compose.ui.res.stringResource
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.scaffold.SettingsScaffold
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.helpers.isTiramisuPlus
import com.simplemobiletools.flashlight.R
@ -71,7 +71,7 @@ internal fun GeneralSettingsSection(
label = stringResource(id = R.string.language),
value = displayLanguage,
doOnPreferenceClick = onSetupLanguagePress,
preferenceValueColor = MaterialTheme.colorScheme.onSurface,
preferenceValueColor = SimpleTheme.colorScheme.onSurface,
)
}
SettingsCheckBoxComponent(

View File

@ -76,7 +76,7 @@ internal fun WidgetConfigureScreen(
.padding(start = SimpleTheme.dimens.margin.medium)
.background(
color = colorResource(id = R.color.md_grey_white),
shape = MaterialTheme.shapes.extraLarge
shape = SimpleTheme.shapes.extraLarge
)
.padding(horizontal = SimpleTheme.dimens.margin.extraLarge)
)
@ -97,7 +97,7 @@ private fun WidgetBrightDisplayConfigureScreenPreview() {
AppThemeSurface {
WidgetConfigureScreen(
widgetDrawable = R.drawable.ic_bright_display_vector,
widgetColor = MaterialTheme.colorScheme.primary.toArgb(),
widgetColor = SimpleTheme.colorScheme.primary.toArgb(),
widgetAlpha = 1f,
onSliderChanged = {},
onColorPressed = {},

View File

@ -8,7 +8,6 @@ import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
@ -42,12 +41,12 @@ internal fun SleepTimer(
.align(Alignment.CenterVertically)
.padding(horizontal = SimpleTheme.dimens.margin.large),
text = stringResource(id = R.string.sleep_timer),
color = MaterialTheme.colorScheme.onSurface
color = SimpleTheme.colorScheme.onSurface
)
Text(
modifier = Modifier.align(Alignment.CenterVertically),
text = timerText,
color = MaterialTheme.colorScheme.onSurface
color = SimpleTheme.colorScheme.onSurface
)
IconButton(
modifier = Modifier
@ -58,7 +57,7 @@ internal fun SleepTimer(
Icon(
painter = painterResource(id = R.drawable.ic_cross_vector),
contentDescription = stringResource(id = R.string.close),
tint = MaterialTheme.colorScheme.onSurface
tint = SimpleTheme.colorScheme.onSurface
)
}
}