mirror of
https://github.com/SimpleMobileTools/Simple-Flashlight.git
synced 2025-04-13 09:52:19 +02:00
Leave android.nonTransitiveRClass
at default value
This commit is contained in:
parent
d2473cfb1f
commit
410f2759fc
@ -63,7 +63,7 @@ class MainActivity : ComponentActivity() {
|
||||
enableEdgeToEdgeSimple()
|
||||
setContent {
|
||||
AppThemeSurface {
|
||||
val showMoreApps = onEventValue { !resources.getBoolean(R.bool.hide_google_relations) }
|
||||
val showMoreApps = onEventValue { !resources.getBoolean(com.simplemobiletools.commons.R.bool.hide_google_relations) }
|
||||
val sosPermissionLauncher = getCameraPermissionLauncher(onResult = getPermissionResultHandler(true))
|
||||
val stroboscopePermissionLauncher = getCameraPermissionLauncher(onResult = getPermissionResultHandler(false))
|
||||
|
||||
@ -181,7 +181,7 @@ class MainActivity : ComponentActivity() {
|
||||
}
|
||||
|
||||
finalItems.sortBy { it.id }
|
||||
finalItems.add(RadioItem(-1, getString(R.string.custom)))
|
||||
finalItems.add(RadioItem(-1, getString(com.simplemobiletools.commons.R.string.custom)))
|
||||
finalItems.toImmutableList()
|
||||
}
|
||||
}
|
||||
@ -271,7 +271,7 @@ class MainActivity : ComponentActivity() {
|
||||
DialogMember {
|
||||
PermissionRequiredAlertDialog(
|
||||
alertDialogState = this,
|
||||
text = stringResource(id = R.string.allow_alarm_sleep_timer),
|
||||
text = stringResource(id = com.simplemobiletools.commons.R.string.allow_alarm_sleep_timer),
|
||||
positiveActionCallback = {
|
||||
openRequestExactAlarmSettings(baseConfig.appId)
|
||||
},
|
||||
@ -306,13 +306,13 @@ class MainActivity : ComponentActivity() {
|
||||
|
||||
private fun launchAbout() {
|
||||
val faqItems = arrayListOf(
|
||||
FAQItem(R.string.faq_1_title_commons, R.string.faq_1_text_commons),
|
||||
FAQItem(R.string.faq_4_title_commons, R.string.faq_4_text_commons)
|
||||
FAQItem(com.simplemobiletools.commons.R.string.faq_1_title_commons, com.simplemobiletools.commons.R.string.faq_1_text_commons),
|
||||
FAQItem(com.simplemobiletools.commons.R.string.faq_4_title_commons, com.simplemobiletools.commons.R.string.faq_4_text_commons)
|
||||
)
|
||||
|
||||
if (!resources.getBoolean(R.bool.hide_google_relations)) {
|
||||
faqItems.add(FAQItem(R.string.faq_2_title_commons, R.string.faq_2_text_commons))
|
||||
faqItems.add(FAQItem(R.string.faq_6_title_commons, R.string.faq_6_text_commons))
|
||||
if (!resources.getBoolean(com.simplemobiletools.commons.R.bool.hide_google_relations)) {
|
||||
faqItems.add(FAQItem(com.simplemobiletools.commons.R.string.faq_2_title_commons, com.simplemobiletools.commons.R.string.faq_2_text_commons))
|
||||
faqItems.add(FAQItem(com.simplemobiletools.commons.R.string.faq_6_title_commons, com.simplemobiletools.commons.R.string.faq_6_text_commons))
|
||||
}
|
||||
|
||||
startAboutActivity(R.string.app_name, 0, BuildConfig.VERSION_NAME, faqItems, true)
|
||||
@ -370,13 +370,13 @@ class MainActivity : ComponentActivity() {
|
||||
val finalSeconds = seconds % 60
|
||||
val parts = mutableListOf<String>()
|
||||
if (finalHours != 0) {
|
||||
parts.add(resources.getQuantityString(R.plurals.hours, finalHours, finalHours))
|
||||
parts.add(resources.getQuantityString(com.simplemobiletools.commons.R.plurals.hours, finalHours, finalHours))
|
||||
}
|
||||
if (finalMinutes != 0) {
|
||||
parts.add(resources.getQuantityString(R.plurals.minutes, finalMinutes, finalMinutes))
|
||||
parts.add(resources.getQuantityString(com.simplemobiletools.commons.R.plurals.minutes, finalMinutes, finalMinutes))
|
||||
}
|
||||
if (finalSeconds != 0) {
|
||||
parts.add(resources.getQuantityString(R.plurals.seconds, finalSeconds, finalSeconds))
|
||||
parts.add(resources.getQuantityString(com.simplemobiletools.commons.R.plurals.seconds, finalSeconds, finalSeconds))
|
||||
}
|
||||
return parts.joinToString(separator = " ")
|
||||
}
|
||||
|
@ -37,7 +37,7 @@ internal class WidgetConfigureViewModel(
|
||||
init {
|
||||
_widgetColor.value = application.config.widgetBgColor
|
||||
if (_widgetColor.value == application.resources.getColor(R.color.default_widget_bg_color, null) && application.config.isUsingSystemTheme) {
|
||||
_widgetColor.value = application.resources.getColor(R.color.you_primary_color, application.theme)
|
||||
_widgetColor.value = application.resources.getColor(com.simplemobiletools.commons.R.color.you_primary_color, application.theme)
|
||||
}
|
||||
|
||||
_widgetAlpha.value = Color.alpha(_widgetColor.value) / 255f
|
||||
|
@ -46,7 +46,7 @@ internal fun BrightDisplayScreen(
|
||||
onClick = onChangeColorPress
|
||||
) {
|
||||
Text(
|
||||
text = stringResource(id = R.string.change_color),
|
||||
text = stringResource(id = com.simplemobiletools.commons.R.string.change_color),
|
||||
color = Color(contrastColor)
|
||||
)
|
||||
}
|
||||
|
@ -110,7 +110,7 @@ internal fun FlashlightButton(
|
||||
onClick = onFlashlightPress
|
||||
),
|
||||
painter = painterResource(id = R.drawable.ic_flashlight_vector),
|
||||
contentDescription = stringResource(id = R.string.flashlight_short),
|
||||
contentDescription = stringResource(id = com.simplemobiletools.commons.R.string.flashlight_short),
|
||||
tint = if (flashlightActive) SimpleTheme.colorScheme.primary else SimpleTheme.colorScheme.onSurface
|
||||
)
|
||||
}
|
||||
@ -230,12 +230,12 @@ private fun buildActionMenu(
|
||||
moreAppsFromUs: () -> Unit,
|
||||
): ImmutableList<ActionItem> {
|
||||
val settings =
|
||||
ActionItem(R.string.settings, icon = Icons.Filled.Settings, doAction = openSettings, overflowMode = OverflowMode.NEVER_OVERFLOW)
|
||||
val about = ActionItem(R.string.about, icon = Icons.Outlined.Info, doAction = openAbout, overflowMode = OverflowMode.NEVER_OVERFLOW)
|
||||
val sleepTimer = ActionItem(R.string.sleep_timer, doAction = openSleepTimer, overflowMode = OverflowMode.ALWAYS_OVERFLOW)
|
||||
ActionItem(com.simplemobiletools.commons.R.string.settings, icon = Icons.Filled.Settings, doAction = openSettings, overflowMode = OverflowMode.NEVER_OVERFLOW)
|
||||
val about = ActionItem(com.simplemobiletools.commons.R.string.about, icon = Icons.Outlined.Info, doAction = openAbout, overflowMode = OverflowMode.NEVER_OVERFLOW)
|
||||
val sleepTimer = ActionItem(com.simplemobiletools.commons.R.string.sleep_timer, doAction = openSleepTimer, overflowMode = OverflowMode.ALWAYS_OVERFLOW)
|
||||
val list = mutableListOf(settings, about, sleepTimer)
|
||||
if (showMoreApps) {
|
||||
list += ActionItem(R.string.more_apps_from_us, doAction = moreAppsFromUs, overflowMode = OverflowMode.ALWAYS_OVERFLOW)
|
||||
list += ActionItem(com.simplemobiletools.commons.R.string.more_apps_from_us, doAction = moreAppsFromUs, overflowMode = OverflowMode.ALWAYS_OVERFLOW)
|
||||
}
|
||||
return list.toImmutableList()
|
||||
}
|
||||
|
@ -16,15 +16,15 @@ internal fun SettingsScreen(
|
||||
generalSection: @Composable () -> Unit,
|
||||
goBack: () -> Unit,
|
||||
) {
|
||||
SettingsScaffold(title = stringResource(id = R.string.settings), goBack = goBack) {
|
||||
SettingsScaffold(title = stringResource(id = com.simplemobiletools.commons.R.string.settings), goBack = goBack) {
|
||||
SettingsGroup(title = {
|
||||
SettingsTitleTextComponent(text = stringResource(id = R.string.color_customization))
|
||||
SettingsTitleTextComponent(text = stringResource(id = com.simplemobiletools.commons.R.string.color_customization))
|
||||
}) {
|
||||
colorCustomizationSection()
|
||||
}
|
||||
SettingsHorizontalDivider()
|
||||
SettingsGroup(title = {
|
||||
SettingsTitleTextComponent(text = stringResource(id = R.string.general_settings))
|
||||
SettingsTitleTextComponent(text = stringResource(id = com.simplemobiletools.commons.R.string.general_settings))
|
||||
}) {
|
||||
generalSection()
|
||||
}
|
||||
@ -37,11 +37,11 @@ internal fun ColorCustomizationSettingsSection(
|
||||
customizeWidgetColors: () -> Unit,
|
||||
) {
|
||||
SettingsPreferenceComponent(
|
||||
label = stringResource(id = R.string.customize_colors),
|
||||
label = stringResource(id = com.simplemobiletools.commons.R.string.customize_colors),
|
||||
doOnPreferenceClick = customizeColors,
|
||||
)
|
||||
SettingsPreferenceComponent(
|
||||
label = stringResource(id = R.string.customize_widget_colors),
|
||||
label = stringResource(id = com.simplemobiletools.commons.R.string.customize_widget_colors),
|
||||
doOnPreferenceClick = customizeWidgetColors
|
||||
)
|
||||
}
|
||||
@ -63,7 +63,7 @@ internal fun GeneralSettingsSection(
|
||||
) {
|
||||
if (isTiramisuPlus()) {
|
||||
SettingsPreferenceComponent(
|
||||
label = stringResource(id = R.string.language),
|
||||
label = stringResource(id = com.simplemobiletools.commons.R.string.language),
|
||||
value = displayLanguage,
|
||||
doOnPreferenceClick = onSetupLanguagePress,
|
||||
preferenceValueColor = SimpleTheme.colorScheme.onSurface,
|
||||
@ -75,7 +75,7 @@ internal fun GeneralSettingsSection(
|
||||
onChange = onTurnFlashlightOnStartupPress
|
||||
)
|
||||
SettingsCheckBoxComponent(
|
||||
label = stringResource(id = R.string.force_portrait_mode),
|
||||
label = stringResource(id = com.simplemobiletools.commons.R.string.force_portrait_mode),
|
||||
initialValue = forcePortraitModeChecked,
|
||||
onChange = onForcePortraitModePress
|
||||
)
|
||||
|
@ -75,7 +75,7 @@ internal fun WidgetConfigureScreen(
|
||||
modifier = Modifier
|
||||
.padding(start = SimpleTheme.dimens.margin.medium)
|
||||
.background(
|
||||
color = colorResource(id = R.color.md_grey_white),
|
||||
color = colorResource(id = com.simplemobiletools.commons.R.color.md_grey_white),
|
||||
shape = SimpleTheme.shapes.extraLarge
|
||||
)
|
||||
.padding(horizontal = SimpleTheme.dimens.margin.extraLarge)
|
||||
@ -86,7 +86,7 @@ internal fun WidgetConfigureScreen(
|
||||
modifier = Modifier.align(Alignment.End),
|
||||
onClick = onSavePressed
|
||||
) {
|
||||
Text(text = stringResource(id = R.string.ok))
|
||||
Text(text = stringResource(id = com.simplemobiletools.commons.R.string.ok))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -12,7 +12,6 @@ import androidx.compose.material3.Text
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.graphics.RectangleShape
|
||||
import androidx.compose.ui.res.painterResource
|
||||
import androidx.compose.ui.res.stringResource
|
||||
@ -21,7 +20,6 @@ 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.compose.theme.divider_grey
|
||||
import com.simplemobiletools.flashlight.R
|
||||
|
||||
@Composable
|
||||
internal fun SleepTimer(
|
||||
@ -41,7 +39,7 @@ internal fun SleepTimer(
|
||||
modifier = Modifier
|
||||
.align(Alignment.CenterVertically)
|
||||
.padding(horizontal = SimpleTheme.dimens.margin.large),
|
||||
text = stringResource(id = R.string.sleep_timer),
|
||||
text = stringResource(id = com.simplemobiletools.commons.R.string.sleep_timer),
|
||||
color = SimpleTheme.colorScheme.onSurface
|
||||
)
|
||||
Text(
|
||||
@ -56,8 +54,8 @@ internal fun SleepTimer(
|
||||
onClick = onCloseClick
|
||||
) {
|
||||
Icon(
|
||||
painter = painterResource(id = R.drawable.ic_cross_vector),
|
||||
contentDescription = stringResource(id = R.string.close),
|
||||
painter = painterResource(id = com.simplemobiletools.commons.R.drawable.ic_cross_vector),
|
||||
contentDescription = stringResource(id = com.simplemobiletools.commons.R.string.close),
|
||||
tint = SimpleTheme.colorScheme.onSurface
|
||||
)
|
||||
}
|
||||
|
@ -1,4 +1,3 @@
|
||||
android.enableJetifier=true
|
||||
android.useAndroidX=true
|
||||
android.nonTransitiveRClass=false
|
||||
org.gradle.jvmargs=-Xmx4g
|
||||
|
Loading…
x
Reference in New Issue
Block a user