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