diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 93a0ed2f9..d6eda84d8 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -1211,8 +1211,8 @@ + diff --git a/app/src/main/java/com/sameerasw/essentials/EssentialsApp.kt b/app/src/main/java/com/sameerasw/essentials/EssentialsApp.kt index 7396759e2..fe9585f07 100644 --- a/app/src/main/java/com/sameerasw/essentials/EssentialsApp.kt +++ b/app/src/main/java/com/sameerasw/essentials/EssentialsApp.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Core Application Entrypoint + * File: EssentialsApp.kt + * Description: Main application entrypoint for EssentialsApp.kt. + */ + package com.sameerasw.essentials import android.app.Application diff --git a/app/src/main/java/com/sameerasw/essentials/MainActivity.kt b/app/src/main/java/com/sameerasw/essentials/MainActivity.kt index 786cf6c1f..24183ce38 100644 --- a/app/src/main/java/com/sameerasw/essentials/MainActivity.kt +++ b/app/src/main/java/com/sameerasw/essentials/MainActivity.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Core Application Entrypoint + * File: MainActivity.kt + * Description: Main application entrypoint for MainActivity.kt. + */ + package com.sameerasw.essentials import android.animation.ObjectAnimator @@ -77,15 +86,15 @@ import com.sameerasw.essentials.ui.components.EssentialsFloatingToolbar import com.sameerasw.essentials.ui.components.ToolbarItem import com.sameerasw.essentials.ui.components.menus.SegmentedDropdownMenu import com.sameerasw.essentials.ui.components.menus.SegmentedDropdownMenuItem -import com.sameerasw.essentials.ui.components.sheets.AddRepoBottomSheet -import com.sameerasw.essentials.ui.components.sheets.GitHubAuthSheet -import com.sameerasw.essentials.ui.components.sheets.InstructionsBottomSheet -import com.sameerasw.essentials.ui.components.sheets.PrankBottomSheet -import com.sameerasw.essentials.ui.components.sheets.UpdateBottomSheet import com.sameerasw.essentials.ui.composables.DIYScreen import com.sameerasw.essentials.ui.composables.FreezeGridUI import com.sameerasw.essentials.ui.composables.SetupFeatures import com.sameerasw.essentials.ui.composables.WelcomeScreen +import com.sameerasw.essentials.ui.core.sheets.AddRepoBottomSheet +import com.sameerasw.essentials.ui.core.sheets.GitHubAuthSheet +import com.sameerasw.essentials.ui.core.sheets.InstructionsBottomSheet +import com.sameerasw.essentials.ui.core.sheets.PrankBottomSheet +import com.sameerasw.essentials.ui.core.sheets.UpdateBottomSheet import com.sameerasw.essentials.ui.modifiers.BlurDirection import com.sameerasw.essentials.ui.modifiers.progressiveBlur import com.sameerasw.essentials.ui.theme.EssentialsTheme @@ -516,255 +525,259 @@ class MainActivity : AppCompatActivity() { ?: DIYTabs.ESSENTIALS } - EssentialsFloatingToolbar( - modifier = Modifier - .align(Alignment.BottomCenter) - .zIndex(1f), - selectedIndex = pagerState.currentPage, - items = tabs.mapIndexed { index, tab -> - ToolbarItem( - iconRes = tab.iconRes, - labelRes = tab.title, - onClick = { - HapticUtil.performUIHaptic(view) - scope.launch { - pagerState.animateScrollToPage(index) - } - }, - hasBadge = false - ) - }, - floatingActionButton = { - var isFreezeMenuExpanded by remember { mutableStateOf(false) } - - Box { // Menu anchor - FloatingActionButton( - onClick = { - HapticUtil.performVirtualKeyHaptic(view) - when (currentTab) { - DIYTabs.ESSENTIALS -> { - startActivity( - Intent( - context, - SettingsActivity::class.java - ) - ) - } - - DIYTabs.FREEZE -> { - isFreezeMenuExpanded = !isFreezeMenuExpanded - } - - DIYTabs.DIY -> { - showNewAutomationSheet = true - } - } - }, - containerColor = MaterialTheme.colorScheme.primaryContainer, - contentColor = MaterialTheme.colorScheme.onPrimaryContainer, - shape = MaterialTheme.shapes.large, - elevation = androidx.compose.material3.FloatingActionButtonDefaults.elevation( - 0.dp, - 0.dp, - 0.dp, - 0.dp - ) - ) { - when (currentTab) { - DIYTabs.ESSENTIALS -> { - Icon( - painter = painterResource(id = R.drawable.rounded_settings_heart_24), - contentDescription = stringResource(R.string.content_desc_settings) - ) - } - - DIYTabs.FREEZE -> { - Icon( - painter = painterResource(id = if (isFreezeMenuExpanded) R.drawable.rounded_close_24 else R.drawable.rounded_more_vert_24), - contentDescription = stringResource(R.string.content_desc_more_options) - ) - } - - DIYTabs.DIY -> { - Icon( - painter = painterResource(id = R.drawable.rounded_add_24), - contentDescription = stringResource(R.string.diy_editor_new_title) - ) - } - - } - } - - if (currentTab == DIYTabs.FREEZE) { - SegmentedDropdownMenu( - expanded = isFreezeMenuExpanded, - onDismissRequest = { isFreezeMenuExpanded = false }, - offset = DpOffset(0.dp, (-8).dp) - ) { - val fabColors = MenuDefaults.itemColors( - textColor = MaterialTheme.colorScheme.onPrimaryContainer, - leadingIconColor = MaterialTheme.colorScheme.onPrimaryContainer, - trailingIconColor = MaterialTheme.colorScheme.onPrimaryContainer - ) - val itemBg = MaterialTheme.colorScheme.primaryContainer - - SegmentedDropdownMenuItem( - text = { Text(stringResource(R.string.action_freeze)) }, - onClick = { - HapticUtil.performVirtualKeyHaptic(view) - isFreezeMenuExpanded = false - viewModel.freezeAllAuto(context) - }, - itemContainerColor = itemBg, - colors = fabColors, - leadingIcon = { - Icon( - painter = painterResource(id = R.drawable.rounded_mode_cool_24), - contentDescription = null, - modifier = Modifier.size(18.dp) - ) - } - ) - SegmentedDropdownMenuItem( - text = { Text(stringResource(R.string.action_unfreeze)) }, - onClick = { - HapticUtil.performVirtualKeyHaptic(view) - isFreezeMenuExpanded = false - viewModel.unfreezeAllAuto(context) - }, - itemContainerColor = itemBg, - colors = fabColors, - leadingIcon = { - Icon( - painter = painterResource(id = R.drawable.rounded_mode_cool_off_24), - contentDescription = null, - modifier = Modifier.size(18.dp) - ) - } - ) - SegmentedDropdownMenuItem( - text = { Text(stringResource(R.string.action_freeze_all)) }, - onClick = { - HapticUtil.performVirtualKeyHaptic(view) - isFreezeMenuExpanded = false - viewModel.freezeAllManual(context) - }, - itemContainerColor = itemBg, - colors = fabColors, - leadingIcon = { - Icon( - painter = painterResource(id = R.drawable.rounded_mode_cool_24), - contentDescription = null, - modifier = Modifier.size(18.dp) - ) - } - ) - SegmentedDropdownMenuItem( - text = { Text(stringResource(R.string.action_unfreeze_all)) }, - onClick = { - HapticUtil.performVirtualKeyHaptic(view) - isFreezeMenuExpanded = false - viewModel.unfreezeAllManual(context) - }, - itemContainerColor = itemBg, - colors = fabColors, - leadingIcon = { - Icon( - painter = painterResource(id = R.drawable.rounded_mode_cool_off_24), - contentDescription = null, - modifier = Modifier.size(18.dp) - ) - } - ) - SegmentedDropdownMenuItem( - text = { Text(stringResource(R.string.label_settings)) }, - onClick = { - HapticUtil.performVirtualKeyHaptic(view) - isFreezeMenuExpanded = false - startActivity( - Intent( - context, - FeatureSettingsActivity::class.java - ).apply { - putExtra("feature", "Freeze") - } - ) - }, - itemContainerColor = itemBg, - colors = fabColors, - leadingIcon = { - Icon( - painter = painterResource(id = R.drawable.rounded_settings_24), - contentDescription = null, - modifier = Modifier.size(18.dp) - ) - } - ) - } - } - - val isTranslationModeActive by com.sameerasw.essentials.translation.TranslationManager.isTranslationModeEnabled - - if (isTranslationModeActive && (currentTab == DIYTabs.ESSENTIALS || currentTab == DIYTabs.FREEZE)) { - Badge( - modifier = Modifier - .align(Alignment.TopEnd) - .offset(x = 6.dp, y = (-6).dp) - .size(28.dp), - containerColor = MaterialTheme.colorScheme.tertiary, - contentColor = MaterialTheme.colorScheme.onTertiary - ) { - Icon( - painter = painterResource(id = R.drawable.rounded_translate_24), - contentDescription = "Translation Mode Active", - modifier = Modifier - .fillMaxSize() - .padding(4.dp) - ) - } - } else if (isUpdateAvailable && (currentTab == DIYTabs.ESSENTIALS || currentTab == DIYTabs.FREEZE)) { - Badge( - modifier = Modifier - .align(Alignment.TopEnd) - .offset(x = 6.dp, y = (-6).dp) - .size(28.dp), - containerColor = MaterialTheme.colorScheme.error, - contentColor = MaterialTheme.colorScheme.onError - ) { - val composition by rememberLottieComposition( - LottieCompositionSpec.RawRes(R.raw.update_motion) - ) - val progress by animateLottieCompositionAsState( - composition = composition, - iterations = LottieConstants.IterateForever - ) - val onErrorColor = - MaterialTheme.colorScheme.onError - val dynamicProperties = - rememberLottieDynamicProperties( - rememberLottieDynamicProperty( - property = LottieProperty.COLOR_FILTER, - value = PorterDuffColorFilter( - onErrorColor.toArgb(), - PorterDuff.Mode.SRC_ATOP - ), - keyPath = arrayOf("**") - ) - ) - - LottieAnimation( - composition = composition, - progress = { progress }, - dynamicProperties = dynamicProperties, - modifier = Modifier - .fillMaxSize() - .padding(2.dp) - ) - } - } - } - } - ) + EssentialsFloatingToolbar( + modifier = Modifier + .align(Alignment.BottomCenter) + .zIndex(1f), + selectedIndex = pagerState.currentPage, + items = tabs.mapIndexed { index, tab -> + ToolbarItem( + iconRes = tab.iconRes, + labelRes = tab.title, + onClick = { + HapticUtil.performUIHaptic(view) + scope.launch { + pagerState.animateScrollToPage(index) + } + }, + hasBadge = false + ) + }, + floatingActionButton = { + var isFreezeMenuExpanded by remember { mutableStateOf(false) } + + Box { // Menu anchor + FloatingActionButton( + onClick = { + HapticUtil.performVirtualKeyHaptic(view) + when (currentTab) { + DIYTabs.ESSENTIALS -> { + startActivity( + Intent( + context, + SettingsActivity::class.java + ) + ) + } + + DIYTabs.FREEZE -> { + isFreezeMenuExpanded = + !isFreezeMenuExpanded + } + + DIYTabs.DIY -> { + showNewAutomationSheet = true + } + } + }, + containerColor = MaterialTheme.colorScheme.primaryContainer, + contentColor = MaterialTheme.colorScheme.onPrimaryContainer, + shape = MaterialTheme.shapes.large, + elevation = androidx.compose.material3.FloatingActionButtonDefaults.elevation( + 0.dp, + 0.dp, + 0.dp, + 0.dp + ) + ) { + when (currentTab) { + DIYTabs.ESSENTIALS -> { + Icon( + painter = painterResource(id = R.drawable.rounded_settings_heart_24), + contentDescription = stringResource(R.string.content_desc_settings) + ) + } + + DIYTabs.FREEZE -> { + Icon( + painter = painterResource(id = if (isFreezeMenuExpanded) R.drawable.rounded_close_24 else R.drawable.rounded_more_vert_24), + contentDescription = stringResource(R.string.content_desc_more_options) + ) + } + + DIYTabs.DIY -> { + Icon( + painter = painterResource(id = R.drawable.rounded_add_24), + contentDescription = stringResource(R.string.diy_editor_new_title) + ) + } + + } + } + + if (currentTab == DIYTabs.FREEZE) { + SegmentedDropdownMenu( + expanded = isFreezeMenuExpanded, + onDismissRequest = { + isFreezeMenuExpanded = false + }, + offset = DpOffset(0.dp, (-8).dp) + ) { + val fabColors = MenuDefaults.itemColors( + textColor = MaterialTheme.colorScheme.onPrimaryContainer, + leadingIconColor = MaterialTheme.colorScheme.onPrimaryContainer, + trailingIconColor = MaterialTheme.colorScheme.onPrimaryContainer + ) + val itemBg = + MaterialTheme.colorScheme.primaryContainer + + SegmentedDropdownMenuItem( + text = { Text(stringResource(R.string.action_freeze)) }, + onClick = { + HapticUtil.performVirtualKeyHaptic(view) + isFreezeMenuExpanded = false + viewModel.freezeAllAuto(context) + }, + itemContainerColor = itemBg, + colors = fabColors, + leadingIcon = { + Icon( + painter = painterResource(id = R.drawable.rounded_mode_cool_24), + contentDescription = null, + modifier = Modifier.size(18.dp) + ) + } + ) + SegmentedDropdownMenuItem( + text = { Text(stringResource(R.string.action_unfreeze)) }, + onClick = { + HapticUtil.performVirtualKeyHaptic(view) + isFreezeMenuExpanded = false + viewModel.unfreezeAllAuto(context) + }, + itemContainerColor = itemBg, + colors = fabColors, + leadingIcon = { + Icon( + painter = painterResource(id = R.drawable.rounded_mode_cool_off_24), + contentDescription = null, + modifier = Modifier.size(18.dp) + ) + } + ) + SegmentedDropdownMenuItem( + text = { Text(stringResource(R.string.action_freeze_all)) }, + onClick = { + HapticUtil.performVirtualKeyHaptic(view) + isFreezeMenuExpanded = false + viewModel.freezeAllManual(context) + }, + itemContainerColor = itemBg, + colors = fabColors, + leadingIcon = { + Icon( + painter = painterResource(id = R.drawable.rounded_mode_cool_24), + contentDescription = null, + modifier = Modifier.size(18.dp) + ) + } + ) + SegmentedDropdownMenuItem( + text = { Text(stringResource(R.string.action_unfreeze_all)) }, + onClick = { + HapticUtil.performVirtualKeyHaptic(view) + isFreezeMenuExpanded = false + viewModel.unfreezeAllManual(context) + }, + itemContainerColor = itemBg, + colors = fabColors, + leadingIcon = { + Icon( + painter = painterResource(id = R.drawable.rounded_mode_cool_off_24), + contentDescription = null, + modifier = Modifier.size(18.dp) + ) + } + ) + SegmentedDropdownMenuItem( + text = { Text(stringResource(R.string.label_settings)) }, + onClick = { + HapticUtil.performVirtualKeyHaptic(view) + isFreezeMenuExpanded = false + startActivity( + Intent( + context, + FeatureSettingsActivity::class.java + ).apply { + putExtra("feature", "Freeze") + } + ) + }, + itemContainerColor = itemBg, + colors = fabColors, + leadingIcon = { + Icon( + painter = painterResource(id = R.drawable.rounded_settings_24), + contentDescription = null, + modifier = Modifier.size(18.dp) + ) + } + ) + } + } + + val isTranslationModeActive by com.sameerasw.essentials.translation.TranslationManager.isTranslationModeEnabled + + if (isTranslationModeActive && (currentTab == DIYTabs.ESSENTIALS || currentTab == DIYTabs.FREEZE)) { + Badge( + modifier = Modifier + .align(Alignment.TopEnd) + .offset(x = 6.dp, y = (-6).dp) + .size(28.dp), + containerColor = MaterialTheme.colorScheme.tertiary, + contentColor = MaterialTheme.colorScheme.onTertiary + ) { + Icon( + painter = painterResource(id = R.drawable.rounded_translate_24), + contentDescription = "Translation Mode Active", + modifier = Modifier + .fillMaxSize() + .padding(4.dp) + ) + } + } else if (isUpdateAvailable && (currentTab == DIYTabs.ESSENTIALS || currentTab == DIYTabs.FREEZE)) { + Badge( + modifier = Modifier + .align(Alignment.TopEnd) + .offset(x = 6.dp, y = (-6).dp) + .size(28.dp), + containerColor = MaterialTheme.colorScheme.error, + contentColor = MaterialTheme.colorScheme.onError + ) { + val composition by rememberLottieComposition( + LottieCompositionSpec.RawRes(R.raw.update_motion) + ) + val progress by animateLottieCompositionAsState( + composition = composition, + iterations = LottieConstants.IterateForever + ) + val onErrorColor = + MaterialTheme.colorScheme.onError + val dynamicProperties = + rememberLottieDynamicProperties( + rememberLottieDynamicProperty( + property = LottieProperty.COLOR_FILTER, + value = PorterDuffColorFilter( + onErrorColor.toArgb(), + PorterDuff.Mode.SRC_ATOP + ), + keyPath = arrayOf("**") + ) + ) + + LottieAnimation( + composition = composition, + progress = { progress }, + dynamicProperties = dynamicProperties, + modifier = Modifier + .fillMaxSize() + .padding(2.dp) + ) + } + } + } + } + ) HorizontalPager( state = pagerState, diff --git a/app/src/main/java/com/sameerasw/essentials/appfunctions/AppFunctionAvailabilityManager.kt b/app/src/main/java/com/sameerasw/essentials/appfunctions/AppFunctionAvailabilityManager.kt index 13ed3c386..c50bbcea8 100644 --- a/app/src/main/java/com/sameerasw/essentials/appfunctions/AppFunctionAvailabilityManager.kt +++ b/app/src/main/java/com/sameerasw/essentials/appfunctions/AppFunctionAvailabilityManager.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Appfunctions + * File: AppFunctionAvailabilityManager.kt + * Description: Component file for AppFunctionAvailabilityManager.kt. + */ + package com.sameerasw.essentials.appfunctions import android.content.Context diff --git a/app/src/main/java/com/sameerasw/essentials/appfunctions/BaseEssentialsAppFunctionService.kt b/app/src/main/java/com/sameerasw/essentials/appfunctions/BaseEssentialsAppFunctionService.kt index da61479e1..bbd7a05fc 100644 --- a/app/src/main/java/com/sameerasw/essentials/appfunctions/BaseEssentialsAppFunctionService.kt +++ b/app/src/main/java/com/sameerasw/essentials/appfunctions/BaseEssentialsAppFunctionService.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Appfunctions + * File: BaseEssentialsAppFunctionService.kt + * Description: Component file for BaseEssentialsAppFunctionService.kt. + */ + package com.sameerasw.essentials.appfunctions import android.content.Context @@ -6,7 +15,9 @@ import android.content.IntentFilter import android.media.AudioManager import android.os.BatteryManager import androidx.annotation.RequiresApi -import androidx.appfunctions.* +import androidx.appfunctions.AppFunction +import androidx.appfunctions.AppFunctionService +import androidx.appfunctions.AppFunctionServiceEntryPoint import com.sameerasw.essentials.appfunctions.dto.AppFunctionResult import com.sameerasw.essentials.appfunctions.dto.AutomationSummary import com.sameerasw.essentials.appfunctions.dto.CreateAutomationParams @@ -41,11 +52,12 @@ abstract class BaseEssentialsAppFunctionService : AppFunctionService() { * @return Result indicating whether the operation succeeded. */ @AppFunction(isDescribedByKDoc = true) - suspend fun toggleFlashlight(enabled: Boolean): AppFunctionResult = withContext(Dispatchers.IO) { - val action = if (enabled) Action.TurnOnFlashlight else Action.TurnOffFlashlight - CombinedActionExecutor.execute(applicationContext, action) - AppFunctionResult(true, "Flashlight set to ${if (enabled) "ON" else "OFF"}") - } + suspend fun toggleFlashlight(enabled: Boolean): AppFunctionResult = + withContext(Dispatchers.IO) { + val action = if (enabled) Action.TurnOnFlashlight else Action.TurnOffFlashlight + CombinedActionExecutor.execute(applicationContext, action) + AppFunctionResult(true, "Flashlight set to ${if (enabled) "ON" else "OFF"}") + } /** * Toggles Caffeinate mode to keep the device screen awake. @@ -54,14 +66,15 @@ abstract class BaseEssentialsAppFunctionService : AppFunctionService() { * @return Result indicating whether Caffeinate state changed. */ @AppFunction(isDescribedByKDoc = true) - suspend fun toggleCaffeinate(enabled: Boolean): AppFunctionResult = withContext(Dispatchers.IO) { - if (enabled) { - CaffeinateController.toggle(applicationContext) - } else { - CaffeinateController.cancelAll(applicationContext) + suspend fun toggleCaffeinate(enabled: Boolean): AppFunctionResult = + withContext(Dispatchers.IO) { + if (enabled) { + CaffeinateController.toggle(applicationContext) + } else { + CaffeinateController.cancelAll(applicationContext) + } + AppFunctionResult(true, "Caffeinate ${if (enabled) "activated" else "deactivated"}") } - AppFunctionResult(true, "Caffeinate ${if (enabled) "activated" else "deactivated"}") - } /** * Sets the device ringer or sound mode. @@ -90,12 +103,14 @@ abstract class BaseEssentialsAppFunctionService : AppFunctionService() { val context = applicationContext val repo = SettingsRepository(context) - val batteryIntent = context.registerReceiver(null, IntentFilter(Intent.ACTION_BATTERY_CHANGED)) + val batteryIntent = + context.registerReceiver(null, IntentFilter(Intent.ACTION_BATTERY_CHANGED)) val level = batteryIntent?.getIntExtra(BatteryManager.EXTRA_LEVEL, -1) ?: -1 val scale = batteryIntent?.getIntExtra(BatteryManager.EXTRA_SCALE, -1) ?: -1 val batteryPct = if (level >= 0 && scale > 0) (level * 100 / scale.toFloat()).toInt() else 0 val status = batteryIntent?.getIntExtra(BatteryManager.EXTRA_STATUS, -1) ?: -1 - val isCharging = status == BatteryManager.BATTERY_STATUS_CHARGING || status == BatteryManager.BATTERY_STATUS_FULL + val isCharging = + status == BatteryManager.BATTERY_STATUS_CHARGING || status == BatteryManager.BATTERY_STATUS_FULL val audioManager = context.getSystemService(Context.AUDIO_SERVICE) as AudioManager val soundModeStr = when (audioManager.ringerMode) { @@ -104,7 +119,8 @@ abstract class BaseEssentialsAppFunctionService : AppFunctionService() { else -> "SOUND" } - val isTorchOn = ScreenOffAccessibilityService.instance?.flashlightHandler?.isTorchOn ?: false + val isTorchOn = + ScreenOffAccessibilityService.instance?.flashlightHandler?.isTorchOn ?: false DeviceStatusResponse( batteryLevel = batteryPct, @@ -113,7 +129,10 @@ abstract class BaseEssentialsAppFunctionService : AppFunctionService() { isCaffeinateActive = CaffeinateController.isActive.value, isFlashlightOn = isTorchOn, isAodEnabled = repo.isAodEnabled(), - isNotificationLightingEnabled = repo.getBoolean(SettingsRepository.KEY_EDGE_LIGHTING_ENABLED, false) + isNotificationLightingEnabled = repo.getBoolean( + SettingsRepository.KEY_EDGE_LIGHTING_ENABLED, + false + ) ) } @@ -151,11 +170,12 @@ abstract class BaseEssentialsAppFunctionService : AppFunctionService() { * @return Result of applying clock style. */ @AppFunction(isDescribedByKDoc = true) - suspend fun setLockScreenClockStyle(style: String): AppFunctionResult = withContext(Dispatchers.IO) { - val repo = SettingsRepository(applicationContext) - repo.putString("lock_screen_clock_style", style.uppercase()) - AppFunctionResult(true, "Lock screen clock style set to ${style.uppercase()}") - } + suspend fun setLockScreenClockStyle(style: String): AppFunctionResult = + withContext(Dispatchers.IO) { + val repo = SettingsRepository(applicationContext) + repo.putString("lock_screen_clock_style", style.uppercase()) + AppFunctionResult(true, "Lock screen clock style set to ${style.uppercase()}") + } /** * Toggles Notification Edge Lighting effect for incoming notifications. @@ -164,11 +184,15 @@ abstract class BaseEssentialsAppFunctionService : AppFunctionService() { * @return Result of toggling notification lighting. */ @AppFunction(isDescribedByKDoc = true) - suspend fun toggleNotificationLighting(enabled: Boolean): AppFunctionResult = withContext(Dispatchers.IO) { - val repo = SettingsRepository(applicationContext) - repo.putBoolean(SettingsRepository.KEY_EDGE_LIGHTING_ENABLED, enabled) - AppFunctionResult(true, "Notification lighting ${if (enabled) "enabled" else "disabled"}") - } + suspend fun toggleNotificationLighting(enabled: Boolean): AppFunctionResult = + withContext(Dispatchers.IO) { + val repo = SettingsRepository(applicationContext) + repo.putBoolean(SettingsRepository.KEY_EDGE_LIGHTING_ENABLED, enabled) + AppFunctionResult( + true, + "Notification lighting ${if (enabled) "enabled" else "disabled"}" + ) + } /** * Toggles Flashlight Pulse notification alerts. @@ -177,11 +201,12 @@ abstract class BaseEssentialsAppFunctionService : AppFunctionService() { * @return Result of toggling flashlight pulse. */ @AppFunction(isDescribedByKDoc = true) - suspend fun toggleFlashlightPulse(enabled: Boolean): AppFunctionResult = withContext(Dispatchers.IO) { - val repo = SettingsRepository(applicationContext) - repo.putBoolean(SettingsRepository.KEY_FLASHLIGHT_PULSE_ENABLED, enabled) - AppFunctionResult(true, "Flashlight pulse ${if (enabled) "enabled" else "disabled"}") - } + suspend fun toggleFlashlightPulse(enabled: Boolean): AppFunctionResult = + withContext(Dispatchers.IO) { + val repo = SettingsRepository(applicationContext) + repo.putBoolean(SettingsRepository.KEY_FLASHLIGHT_PULSE_ENABLED, enabled) + AppFunctionResult(true, "Flashlight pulse ${if (enabled) "enabled" else "disabled"}") + } /** * Turns off the device screen immediately. @@ -236,10 +261,18 @@ abstract class BaseEssentialsAppFunctionService : AppFunctionService() { suspend fun freezeTagApps(tagId: String): AppFunctionResult = withContext(Dispatchers.IO) { val repo = SettingsRepository(applicationContext) val tags = repo.getFreezeTags() - val targetTag = tags.find { it.id.equals(tagId, ignoreCase = true) || it.name.equals(tagId, ignoreCase = true) } + val targetTag = tags.find { + it.id.equals(tagId, ignoreCase = true) || it.name.equals( + tagId, + ignoreCase = true + ) + } ?: return@withContext AppFunctionResult(false, "Freeze tag '$tagId' not found") - CombinedActionExecutor.execute(applicationContext, Action.FreezeTag("Freeze", listOf(targetTag.id))) + CombinedActionExecutor.execute( + applicationContext, + Action.FreezeTag("Freeze", listOf(targetTag.id)) + ) AppFunctionResult(true, "Apps in tag '${targetTag.name}' frozen successfully") } @@ -253,10 +286,18 @@ abstract class BaseEssentialsAppFunctionService : AppFunctionService() { suspend fun unfreezeTagApps(tagId: String): AppFunctionResult = withContext(Dispatchers.IO) { val repo = SettingsRepository(applicationContext) val tags = repo.getFreezeTags() - val targetTag = tags.find { it.id.equals(tagId, ignoreCase = true) || it.name.equals(tagId, ignoreCase = true) } + val targetTag = tags.find { + it.id.equals(tagId, ignoreCase = true) || it.name.equals( + tagId, + ignoreCase = true + ) + } ?: return@withContext AppFunctionResult(false, "Freeze tag '$tagId' not found") - CombinedActionExecutor.execute(applicationContext, Action.FreezeTag("Unfreeze", listOf(targetTag.id))) + CombinedActionExecutor.execute( + applicationContext, + Action.FreezeTag("Unfreeze", listOf(targetTag.id)) + ) AppFunctionResult(true, "Apps in tag '${targetTag.name}' unfrozen successfully") } @@ -294,14 +335,21 @@ abstract class BaseEssentialsAppFunctionService : AppFunctionService() { * @return Result of toggling the automation. */ @AppFunction(isDescribedByKDoc = true) - suspend fun toggleAutomation(automationId: String, enabled: Boolean): AppFunctionResult = withContext(Dispatchers.IO) { - val automations = DIYRepository.automations.value - val target = automations.find { it.id.equals(automationId, ignoreCase = true) } - ?: return@withContext AppFunctionResult(false, "Automation '$automationId' not found") - - DIYRepository.updateAutomation(target.copy(isEnabled = enabled)) - AppFunctionResult(true, "Automation '${target.id}' ${if (enabled) "enabled" else "disabled"}") - } + suspend fun toggleAutomation(automationId: String, enabled: Boolean): AppFunctionResult = + withContext(Dispatchers.IO) { + val automations = DIYRepository.automations.value + val target = automations.find { it.id.equals(automationId, ignoreCase = true) } + ?: return@withContext AppFunctionResult( + false, + "Automation '$automationId' not found" + ) + + DIYRepository.updateAutomation(target.copy(isEnabled = enabled)) + AppFunctionResult( + true, + "Automation '${target.id}' ${if (enabled) "enabled" else "disabled"}" + ) + } /** * Deletes a DIY automation by its ID. @@ -310,14 +358,18 @@ abstract class BaseEssentialsAppFunctionService : AppFunctionService() { * @return Result of deleting the automation. */ @AppFunction(isDescribedByKDoc = true) - suspend fun deleteAutomation(automationId: String): AppFunctionResult = withContext(Dispatchers.IO) { - val automations = DIYRepository.automations.value - val target = automations.find { it.id.equals(automationId, ignoreCase = true) } - ?: return@withContext AppFunctionResult(false, "Automation '$automationId' not found") - - DIYRepository.removeAutomation(target.id) - AppFunctionResult(true, "Automation '${target.id}' deleted successfully") - } + suspend fun deleteAutomation(automationId: String): AppFunctionResult = + withContext(Dispatchers.IO) { + val automations = DIYRepository.automations.value + val target = automations.find { it.id.equals(automationId, ignoreCase = true) } + ?: return@withContext AppFunctionResult( + false, + "Automation '$automationId' not found" + ) + + DIYRepository.removeAutomation(target.id) + AppFunctionResult(true, "Automation '${target.id}' deleted successfully") + } /** * Creates a new DIY automation in Essentials directly from parameters parsed by AI. @@ -326,65 +378,73 @@ abstract class BaseEssentialsAppFunctionService : AppFunctionService() { * @return Result of creating the automation. */ @AppFunction(isDescribedByKDoc = true) - suspend fun createAutomation(params: CreateAutomationParams): AppFunctionResult = withContext(Dispatchers.IO) { - val autoType = when (params.type.uppercase()) { - "STATE" -> Automation.Type.STATE - "APP" -> Automation.Type.APP - else -> Automation.Type.TRIGGER - } - - val trigger: Trigger? = if (autoType == Automation.Type.TRIGGER) { - when (params.triggerType) { - "ScreenOff" -> Trigger.ScreenOff - "ScreenOn" -> Trigger.ScreenOn - "DeviceUnlock" -> Trigger.DeviceUnlock - "ChargerConnected" -> Trigger.ChargerConnected - "ChargerDisconnected" -> Trigger.ChargerDisconnected - "Schedule" -> Trigger.Schedule(params.hour, params.minute) - else -> Trigger.ChargerConnected - } - } else null - - val state: State? = if (autoType == Automation.Type.STATE) { - when (params.stateType) { - "Charging" -> State.Charging - "ScreenOn" -> State.ScreenOn - "TimePeriod" -> State.TimePeriod(params.hour, params.minute, params.endHour, params.endMinute) - else -> State.Charging + suspend fun createAutomation(params: CreateAutomationParams): AppFunctionResult = + withContext(Dispatchers.IO) { + val autoType = when (params.type.uppercase()) { + "STATE" -> Automation.Type.STATE + "APP" -> Automation.Type.APP + else -> Automation.Type.TRIGGER } - } else null - - val action: Action = when (params.actionType) { - "TurnOnFlashlight" -> Action.TurnOnFlashlight - "TurnOffFlashlight" -> Action.TurnOffFlashlight - "ToggleFlashlight" -> Action.ToggleFlashlight - "DimWallpaper" -> Action.DimWallpaper(params.dimWallpaperAmount) - "SoundMode" -> Action.SoundMode( - when (params.soundMode.uppercase()) { - "VIBRATE" -> Action.SoundModeType.VIBRATE - "SILENT" -> Action.SoundModeType.SILENT - else -> Action.SoundModeType.SOUND + + val trigger: Trigger? = if (autoType == Automation.Type.TRIGGER) { + when (params.triggerType) { + "ScreenOff" -> Trigger.ScreenOff + "ScreenOn" -> Trigger.ScreenOn + "DeviceUnlock" -> Trigger.DeviceUnlock + "ChargerConnected" -> Trigger.ChargerConnected + "ChargerDisconnected" -> Trigger.ChargerDisconnected + "Schedule" -> Trigger.Schedule(params.hour, params.minute) + else -> Trigger.ChargerConnected } - ) - "TurnOnLowPower" -> Action.TurnOnLowPower - "TurnOffLowPower" -> Action.TurnOffLowPower - "ScreenOff" -> Action.ScreenOff() - "MediaPlayPause" -> Action.MediaPlayPause - "TakeScreenshot" -> Action.TakeScreenshot - "FreezeTag" -> Action.FreezeTag(params.freezeMode, listOf(params.freezeTagId)) - else -> Action.HapticVibration - } + } else null + + val state: State? = if (autoType == Automation.Type.STATE) { + when (params.stateType) { + "Charging" -> State.Charging + "ScreenOn" -> State.ScreenOn + "TimePeriod" -> State.TimePeriod( + params.hour, + params.minute, + params.endHour, + params.endMinute + ) + + else -> State.Charging + } + } else null + + val action: Action = when (params.actionType) { + "TurnOnFlashlight" -> Action.TurnOnFlashlight + "TurnOffFlashlight" -> Action.TurnOffFlashlight + "ToggleFlashlight" -> Action.ToggleFlashlight + "DimWallpaper" -> Action.DimWallpaper(params.dimWallpaperAmount) + "SoundMode" -> Action.SoundMode( + when (params.soundMode.uppercase()) { + "VIBRATE" -> Action.SoundModeType.VIBRATE + "SILENT" -> Action.SoundModeType.SILENT + else -> Action.SoundModeType.SOUND + } + ) + + "TurnOnLowPower" -> Action.TurnOnLowPower + "TurnOffLowPower" -> Action.TurnOffLowPower + "ScreenOff" -> Action.ScreenOff() + "MediaPlayPause" -> Action.MediaPlayPause + "TakeScreenshot" -> Action.TakeScreenshot + "FreezeTag" -> Action.FreezeTag(params.freezeMode, listOf(params.freezeTagId)) + else -> Action.HapticVibration + } - val newAutomation = Automation( - id = UUID.randomUUID().toString(), - type = autoType, - trigger = trigger, - state = state, - actions = listOf(action), - isEnabled = true - ) + val newAutomation = Automation( + id = UUID.randomUUID().toString(), + type = autoType, + trigger = trigger, + state = state, + actions = listOf(action), + isEnabled = true + ) - DIYRepository.addAutomation(newAutomation) - AppFunctionResult(true, "Created automation '${params.title}' successfully") - } + DIYRepository.addAutomation(newAutomation) + AppFunctionResult(true, "Created automation '${params.title}' successfully") + } } diff --git a/app/src/main/java/com/sameerasw/essentials/appfunctions/dto/AppFunctionResult.kt b/app/src/main/java/com/sameerasw/essentials/appfunctions/dto/AppFunctionResult.kt index 4f703967e..48ec661b9 100644 --- a/app/src/main/java/com/sameerasw/essentials/appfunctions/dto/AppFunctionResult.kt +++ b/app/src/main/java/com/sameerasw/essentials/appfunctions/dto/AppFunctionResult.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Appfunctions + * File: AppFunctionResult.kt + * Description: Component file for AppFunctionResult.kt. + */ + package com.sameerasw.essentials.appfunctions.dto import androidx.annotation.Keep diff --git a/app/src/main/java/com/sameerasw/essentials/appfunctions/dto/AutomationSummary.kt b/app/src/main/java/com/sameerasw/essentials/appfunctions/dto/AutomationSummary.kt index b7beb78d2..7edb5d22c 100644 --- a/app/src/main/java/com/sameerasw/essentials/appfunctions/dto/AutomationSummary.kt +++ b/app/src/main/java/com/sameerasw/essentials/appfunctions/dto/AutomationSummary.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Appfunctions + * File: AutomationSummary.kt + * Description: Component file for AutomationSummary.kt. + */ + package com.sameerasw.essentials.appfunctions.dto import androidx.annotation.Keep diff --git a/app/src/main/java/com/sameerasw/essentials/appfunctions/dto/CreateAutomationParams.kt b/app/src/main/java/com/sameerasw/essentials/appfunctions/dto/CreateAutomationParams.kt index 824993799..8afeda83b 100644 --- a/app/src/main/java/com/sameerasw/essentials/appfunctions/dto/CreateAutomationParams.kt +++ b/app/src/main/java/com/sameerasw/essentials/appfunctions/dto/CreateAutomationParams.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Appfunctions + * File: CreateAutomationParams.kt + * Description: Component file for CreateAutomationParams.kt. + */ + package com.sameerasw.essentials.appfunctions.dto import androidx.annotation.Keep diff --git a/app/src/main/java/com/sameerasw/essentials/appfunctions/dto/DeviceStatusResponse.kt b/app/src/main/java/com/sameerasw/essentials/appfunctions/dto/DeviceStatusResponse.kt index ea7fdc1e2..60298caf5 100644 --- a/app/src/main/java/com/sameerasw/essentials/appfunctions/dto/DeviceStatusResponse.kt +++ b/app/src/main/java/com/sameerasw/essentials/appfunctions/dto/DeviceStatusResponse.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Appfunctions + * File: DeviceStatusResponse.kt + * Description: Component file for DeviceStatusResponse.kt. + */ + package com.sameerasw.essentials.appfunctions.dto import androidx.annotation.Keep diff --git a/app/src/main/java/com/sameerasw/essentials/appfunctions/dto/FreezeTagSummary.kt b/app/src/main/java/com/sameerasw/essentials/appfunctions/dto/FreezeTagSummary.kt index 67c0938d8..bd38c58fa 100644 --- a/app/src/main/java/com/sameerasw/essentials/appfunctions/dto/FreezeTagSummary.kt +++ b/app/src/main/java/com/sameerasw/essentials/appfunctions/dto/FreezeTagSummary.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Appfunctions + * File: FreezeTagSummary.kt + * Description: Component file for FreezeTagSummary.kt. + */ + package com.sameerasw.essentials.appfunctions.dto import androidx.annotation.Keep diff --git a/app/src/main/java/com/sameerasw/essentials/data/repository/GitHubAuthRepository.kt b/app/src/main/java/com/sameerasw/essentials/data/repository/GitHubAuthRepository.kt index dcbbabb5d..07e6f069e 100644 --- a/app/src/main/java/com/sameerasw/essentials/data/repository/GitHubAuthRepository.kt +++ b/app/src/main/java/com/sameerasw/essentials/data/repository/GitHubAuthRepository.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Data & Repository Layer + * File: GitHubAuthRepository.kt + * Description: Data repository and storage component for GitHubAuthRepository.kt. + */ + package com.sameerasw.essentials.data.repository import com.google.gson.Gson diff --git a/app/src/main/java/com/sameerasw/essentials/data/repository/GitHubRepository.kt b/app/src/main/java/com/sameerasw/essentials/data/repository/GitHubRepository.kt index 2afd7e1ad..556c0a491 100644 --- a/app/src/main/java/com/sameerasw/essentials/data/repository/GitHubRepository.kt +++ b/app/src/main/java/com/sameerasw/essentials/data/repository/GitHubRepository.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Data & Repository Layer + * File: GitHubRepository.kt + * Description: Data repository and storage component for GitHubRepository.kt. + */ + package com.sameerasw.essentials.data.repository import android.util.Log diff --git a/app/src/main/java/com/sameerasw/essentials/data/repository/LocationReachedRepository.kt b/app/src/main/java/com/sameerasw/essentials/data/repository/LocationReachedRepository.kt index 524eac83f..e2bf879ef 100644 --- a/app/src/main/java/com/sameerasw/essentials/data/repository/LocationReachedRepository.kt +++ b/app/src/main/java/com/sameerasw/essentials/data/repository/LocationReachedRepository.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Data & Repository Layer + * File: LocationReachedRepository.kt + * Description: Data repository and storage component for LocationReachedRepository.kt. + */ + package com.sameerasw.essentials.data.repository import android.content.Context diff --git a/app/src/main/java/com/sameerasw/essentials/data/repository/SettingsRepository.kt b/app/src/main/java/com/sameerasw/essentials/data/repository/SettingsRepository.kt index 9508acf70..44586a3ba 100644 --- a/app/src/main/java/com/sameerasw/essentials/data/repository/SettingsRepository.kt +++ b/app/src/main/java/com/sameerasw/essentials/data/repository/SettingsRepository.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Data & Repository Layer + * File: SettingsRepository.kt + * Description: Data repository and storage component for SettingsRepository.kt. + */ + package com.sameerasw.essentials.data.repository import android.content.Context @@ -315,9 +324,18 @@ class SettingsRepository(private val context: Context) { const val KEY_LOCKDOWN_MODE = "lockdown_mode" } + /** + * Executes the is translation mode warning suppressed operation. + * @return The resulting Boolean data. + */ fun isTranslationModeWarningSuppressed(): Boolean = getBoolean(KEY_TRANSLATION_MODE_DO_NOT_SHOW_WARNING, false) + /** + * Executes the set translation mode warning suppressed operation. + * + * @param suppressed [Boolean] Target suppressed. + */ fun setTranslationModeWarningSuppressed(suppressed: Boolean) = putBoolean(KEY_TRANSLATION_MODE_DO_NOT_SHOW_WARNING, suppressed) @@ -342,18 +360,60 @@ class SettingsRepository(private val context: Context) { awaitClose { prefs.unregisterOnSharedPreferenceChangeListener(listener) } } + /** + * Registers a listener to be notified when shared preference values change. + * + * @param listener [SharedPreferences.OnSharedPreferenceChangeListener] The listener instance to register. + */ fun registerOnSharedPreferenceChangeListener(listener: SharedPreferences.OnSharedPreferenceChangeListener) { prefs.registerOnSharedPreferenceChangeListener(listener) } + /** + * Unregisters a previously registered shared preference change listener. + * + * @param listener [SharedPreferences.OnSharedPreferenceChangeListener] The listener instance to unregister. + */ fun unregisterOnSharedPreferenceChangeListener(listener: SharedPreferences.OnSharedPreferenceChangeListener) { prefs.unregisterOnSharedPreferenceChangeListener(listener) } // General Getters + + /** + * Retrieves a boolean preference value by key. + * + * @param key [String] Preference key name. + * @param default [Boolean] Fallback boolean value if key is absent. + * @return The stored boolean value or default. + */ fun getBoolean(key: String, default: Boolean = false): Boolean = prefs.getBoolean(key, default) + + /** + * Retrieves a string preference value by key. + * + * @param key [String] Preference key name. + * @param default [String?] Fallback string value if key is absent. + * @return The stored string value or default. + */ fun getString(key: String, default: String? = null): String? = prefs.getString(key, default) + + /** + * Retrieves an integer preference value by key. + * + * @param key [String] Preference key name. + * @param default [Int] Fallback integer value if key is absent. + * @return The stored integer value or default. + */ fun getInt(key: String, default: Int = 0): Int = prefs.getInt(key, default) + + /** + * Retrieves a float preference value by key, with legacy integer migration fallback. + * + * @param key [String] Preference key name. + * @param default [Float] Fallback float value if key is absent. + * @return The stored float value or default. + */ fun getFloat(key: String, default: Float = 0f): Float { return try { prefs.getFloat(key, default) @@ -370,15 +430,70 @@ class SettingsRepository(private val context: Context) { } } + /** + * Retrieves a long integer preference value by key. + * + * @param key [String] Preference key name. + * @param default [Long] Fallback long value if key is absent. + * @return The stored long value or default. + */ fun getLong(key: String, default: Long = 0L): Long = prefs.getLong(key, default) // General Setters + + /** + * Checks if a preference key exists in persistent storage. + * + * @param key [String] Preference key name. + * @return True if key exists in shared preferences. + */ fun contains(key: String): Boolean = prefs.contains(key) + + /** + * Asynchronously stores a boolean preference value. + * + * @param key [String] Preference key name. + * @param value [Boolean] Boolean value to store. + */ fun putBoolean(key: String, value: Boolean) = prefs.edit().putBoolean(key, value).apply() + + /** + * Asynchronously stores a string preference value. + * + * @param key [String] Preference key name. + * @param value [String?] String value to store. + */ fun putString(key: String, value: String?) = prefs.edit().putString(key, value).apply() + + /** + * Asynchronously stores an integer preference value. + * + * @param key [String] Preference key name. + * @param value [Int] Integer value to store. + */ fun putInt(key: String, value: Int) = prefs.edit().putInt(key, value).apply() + + /** + * Asynchronously stores a float preference value. + * + * @param key [String] Preference key name. + * @param value [Float] Float value to store. + */ fun putFloat(key: String, value: Float) = prefs.edit().putFloat(key, value).apply() + + /** + * Asynchronously stores a long integer preference value. + * + * @param key [String] Preference key name. + * @param value [Long] Long value to store. + */ fun putLong(key: String, value: Long) = prefs.edit().putLong(key, value).apply() + + /** + * Asynchronously removes a preference entry by key. + * + * @param key [String] Preference key name to remove. + */ fun remove(key: String) = prefs.edit().remove(key).apply() // Specific Getters with logic from ViewModel @@ -393,6 +508,10 @@ class SettingsRepository(private val context: Context) { } } + /** + * Executes the get notification lighting color mode operation. + * @return The resulting NotificationLightingColorMode data. + */ fun getNotificationLightingColorMode(): NotificationLightingColorMode { val colorModeName = prefs.getString(KEY_EDGE_LIGHTING_COLOR_MODE, NotificationLightingColorMode.SYSTEM.name) @@ -405,6 +524,10 @@ class SettingsRepository(private val context: Context) { } } + /** + * Executes the get notification lighting glow sides operation. + * @return The resulting Set data. + */ fun getNotificationLightingGlowSides(): Set { val json = prefs.getString(KEY_EDGE_LIGHTING_GLOW_SIDES, null) return if (json != null) { @@ -419,11 +542,20 @@ class SettingsRepository(private val context: Context) { } + /** + * Executes the save notification lighting glow sides operation. + * + * @param sides [Set] Target sides. + */ fun saveNotificationLightingGlowSides(sides: Set) { val json = gson.toJson(sides) putString(KEY_EDGE_LIGHTING_GLOW_SIDES, json) } + /** + * Executes the get notification lighting sweep position operation. + * @return The resulting NotificationLightingSweepPosition data. + */ fun getNotificationLightingSweepPosition(): NotificationLightingSweepPosition { val posName = prefs.getString( KEY_EDGE_LIGHTING_SWEEP_POSITION, @@ -438,13 +570,32 @@ class SettingsRepository(private val context: Context) { } } + /** + * Executes the save notification lighting sweep position operation. + * + * @param position [NotificationLightingSweepPosition] Target position. + */ fun saveNotificationLightingSweepPosition(position: NotificationLightingSweepPosition) { putString(KEY_EDGE_LIGHTING_SWEEP_POSITION, position.name) } + /** + * Executes the get notification lighting system mode operation. + * @return The resulting Int data. + */ fun getNotificationLightingSystemMode(): Int = getInt(KEY_EDGE_LIGHTING_SYSTEM_MODE, 0) + + /** + * Executes the save notification lighting system mode operation. + * + * @param mode [Int] Target mode. + */ fun saveNotificationLightingSystemMode(mode: Int) = putInt(KEY_EDGE_LIGHTING_SYSTEM_MODE, mode) + /** + * Executes the get freeze auto excluded apps operation. + * @return The resulting Set data. + */ fun getFreezeAutoExcludedApps(): Set { val json = prefs.getString(KEY_FREEZE_AUTO_EXCLUDED_APPS, null) return if (json != null) { @@ -456,11 +607,20 @@ class SettingsRepository(private val context: Context) { } else emptySet() } + /** + * Executes the save freeze auto excluded apps operation. + * + * @param apps [Set] Target apps. + */ fun saveFreezeAutoExcludedApps(apps: Set) { val json = gson.toJson(apps) putString(KEY_FREEZE_AUTO_EXCLUDED_APPS, json) } + /** + * Executes the get freeze tags operation. + * @return The resulting List data. + */ fun getFreezeTags(): List { val json = prefs.getString(KEY_FREEZE_TAGS, null) ?: return emptyList() return try { @@ -471,11 +631,20 @@ class SettingsRepository(private val context: Context) { } } + /** + * Executes the save freeze tags operation. + * + * @param tags [List] Target tags. + */ fun saveFreezeTags(tags: List) { val json = gson.toJson(tags) putString(KEY_FREEZE_TAGS, json) } + /** + * Executes the get freeze app tag map operation. + * @return The resulting Map> data. + */ fun getFreezeAppTagMap(): Map> { val json = prefs.getString(KEY_FREEZE_APP_TAG_MAP, null) ?: return emptyMap() return try { @@ -486,13 +655,27 @@ class SettingsRepository(private val context: Context) { } } + /** + * Executes the save freeze app tag map operation. + * + * @param map [Map> Target list string. + */ fun saveFreezeAppTagMap(map: Map>) { val json = gson.toJson(map) putString(KEY_FREEZE_APP_TAG_MAP, json) } + /** + * Executes the get freeze mode operation. + * @return The resulting Int data. + */ fun getFreezeMode(): Int = getInt(KEY_FREEZE_MODE, 0) + /** + * Executes the get haptic feedback type operation. + * @return The resulting HapticFeedbackType data. + */ fun getHapticFeedbackType(): HapticFeedbackType { val typeName = prefs.getString(KEY_HAPTIC_FEEDBACK_TYPE, HapticFeedbackType.SUBTLE.name) return try { @@ -502,6 +685,10 @@ class SettingsRepository(private val context: Context) { } } + /** + * Executes the get diy tab operation. + * @return The resulting com data. + */ fun getDIYTab(): com.sameerasw.essentials.domain.DIYTabs { val tabName = prefs.getString( KEY_DEFAULT_TAB, @@ -516,10 +703,19 @@ class SettingsRepository(private val context: Context) { } } + /** + * Executes the save diy tab operation. + * + * @param tab [com.sameerasw.essentials.domain.DIYTabs] Target tab. + */ fun saveDIYTab(tab: com.sameerasw.essentials.domain.DIYTabs) { putString(KEY_DEFAULT_TAB, tab.name) } + /** + * Executes the get calendar sync selected calendars operation. + * @return The resulting Set data. + */ fun getCalendarSyncSelectedCalendars(): Set { val json = prefs.getString(KEY_CALENDAR_SYNC_SELECTED_CALENDARS, null) return if (json != null) { @@ -531,14 +727,28 @@ class SettingsRepository(private val context: Context) { } else emptySet() } + /** + * Executes the save calendar sync selected calendars operation. + * + * @param calendarIds [Set] Target calendar ids. + */ fun saveCalendarSyncSelectedCalendars(calendarIds: Set) { val json = gson.toJson(calendarIds) putString(KEY_CALENDAR_SYNC_SELECTED_CALENDARS, json) } + /** + * Executes the is calendar sync periodic enabled operation. + * @return The resulting Boolean data. + */ fun isCalendarSyncPeriodicEnabled(): Boolean = getBoolean(KEY_CALENDAR_SYNC_PERIODIC_ENABLED, false) + /** + * Executes the set calendar sync periodic enabled operation. + * + * @param enabled [Boolean] Target enabled. + */ fun setCalendarSyncPeriodicEnabled(enabled: Boolean) = putBoolean(KEY_CALENDAR_SYNC_PERIODIC_ENABLED, enabled) @@ -564,58 +774,162 @@ class SettingsRepository(private val context: Context) { // Feature specific App selections fun loadNotificationLightingSelectedApps() = loadAppSelection(KEY_EDGE_LIGHTING_SELECTED_APPS) + + /** + * Executes the save notification lighting selected apps operation. + * + * @param apps [List] Target apps. + */ fun saveNotificationLightingSelectedApps(apps: List) = saveAppSelection(KEY_EDGE_LIGHTING_SELECTED_APPS, apps) + /** + * Executes the update notification lighting app selection operation. + * + * @param packageName [String] Target package name. + * @param enabled [Boolean] Target enabled. + */ fun updateNotificationLightingAppSelection(packageName: String, enabled: Boolean) = updateAppSelection(KEY_EDGE_LIGHTING_SELECTED_APPS, packageName, enabled) + /** + * Executes the load dynamic night light selected apps operation. + */ fun loadDynamicNightLightSelectedApps() = loadAppSelection(KEY_DYNAMIC_NIGHT_LIGHT_SELECTED_APPS) + /** + * Executes the save dynamic night light selected apps operation. + * + * @param apps [List] Target apps. + */ fun saveDynamicNightLightSelectedApps(apps: List) = saveAppSelection(KEY_DYNAMIC_NIGHT_LIGHT_SELECTED_APPS, apps) + /** + * Executes the update dynamic night light app selection operation. + * + * @param packageName [String] Target package name. + * @param enabled [Boolean] Target enabled. + */ fun updateDynamicNightLightAppSelection(packageName: String, enabled: Boolean) = updateAppSelection(KEY_DYNAMIC_NIGHT_LIGHT_SELECTED_APPS, packageName, enabled) + /** + * Executes the load app lock selected apps operation. + */ fun loadAppLockSelectedApps() = loadAppSelection(KEY_APP_LOCK_SELECTED_APPS) + + /** + * Executes the save app lock selected apps operation. + * + * @param apps [List] Target apps. + */ fun saveAppLockSelectedApps(apps: List) = saveAppSelection(KEY_APP_LOCK_SELECTED_APPS, apps) + /** + * Executes the update app lock app selection operation. + * + * @param packageName [String] Target package name. + * @param enabled [Boolean] Target enabled. + */ fun updateAppLockAppSelection(packageName: String, enabled: Boolean) = updateAppSelection(KEY_APP_LOCK_SELECTED_APPS, packageName, enabled) + /** + * Executes the load freeze selected apps operation. + */ fun loadFreezeSelectedApps() = loadAppSelection(KEY_FREEZE_SELECTED_APPS) + + /** + * Executes the save freeze selected apps operation. + * + * @param apps [List] Target apps. + */ fun saveFreezeSelectedApps(apps: List) = saveAppSelection(KEY_FREEZE_SELECTED_APPS, apps.filter { it.isEnabled }) + /** + * Executes the update freeze app selection operation. + * + * @param packageName [String] Target package name. + * @param enabled [Boolean] Target enabled. + */ fun updateFreezeAppSelection(packageName: String, enabled: Boolean) = updateAppSelection(KEY_FREEZE_SELECTED_APPS, packageName, enabled) + /** + * Executes the load flashlight pulse selected apps operation. + */ fun loadFlashlightPulseSelectedApps() = loadAppSelection(KEY_FLASHLIGHT_PULSE_SELECTED_APPS) + + /** + * Executes the save flashlight pulse selected apps operation. + * + * @param apps [List] Target apps. + */ fun saveFlashlightPulseSelectedApps(apps: List) = saveAppSelection(KEY_FLASHLIGHT_PULSE_SELECTED_APPS, apps) + /** + * Executes the update flashlight pulse app selection operation. + * + * @param packageName [String] Target package name. + * @param enabled [Boolean] Target enabled. + */ fun updateFlashlightPulseAppSelection(packageName: String, enabled: Boolean) = updateAppSelection(KEY_FLASHLIGHT_PULSE_SELECTED_APPS, packageName, enabled) + /** + * Executes the load notification glance selected apps operation. + */ fun loadNotificationGlanceSelectedApps() = loadAppSelection(KEY_NOTIFICATION_GLANCE_SELECTED_APPS) + /** + * Executes the save notification glance selected apps operation. + * + * @param apps [List] Target apps. + */ fun saveNotificationGlanceSelectedApps(apps: List) = saveAppSelection(KEY_NOTIFICATION_GLANCE_SELECTED_APPS, apps) + /** + * Executes the update notification glance app selection operation. + * + * @param packageName [String] Target package name. + * @param enabled [Boolean] Target enabled. + */ fun updateNotificationGlanceAppSelection(packageName: String, enabled: Boolean) = updateAppSelection(KEY_NOTIFICATION_GLANCE_SELECTED_APPS, packageName, enabled) + /** + * Executes the load pocket mode excluded apps operation. + */ fun loadPocketModeExcludedApps() = loadAppSelection(KEY_POCKET_MODE_EXCLUDED_APPS) + + /** + * Executes the save pocket mode excluded apps operation. + * + * @param apps [List] Target apps. + */ fun savePocketModeExcludedApps(apps: List) = saveAppSelection(KEY_POCKET_MODE_EXCLUDED_APPS, apps) + /** + * Executes the update pocket mode excluded app selection operation. + * + * @param packageName [String] Target package name. + * @param enabled [Boolean] Target enabled. + */ fun updatePocketModeExcludedAppSelection(packageName: String, enabled: Boolean) = updateAppSelection(KEY_POCKET_MODE_EXCLUDED_APPS, packageName, enabled) + /** + * Executes the load shut up configs operation. + * @return The resulting List { val json = prefs.getString(KEY_SHUT_UP_SELECTED_APPS, null) return if (json != null) { @@ -632,11 +946,21 @@ class SettingsRepository(private val context: Context) { } } + /** + * Executes the save shut up configs operation. + * + * @param configs [List] Target configs. + */ fun saveShutUpConfigs(configs: List) { val json = gson.toJson(configs) putString(KEY_SHUT_UP_SELECTED_APPS, json) } + /** + * Executes the update shut up config operation. + * + * @param config [com.sameerasw.essentials.domain.model.ShutUpAppConfig] Target config. + */ fun updateShutUpConfig(config: com.sameerasw.essentials.domain.model.ShutUpAppConfig) { val current = loadShutUpConfigs().toMutableList() val index = current.indexOfFirst { it.packageName == config.packageName } @@ -648,11 +972,21 @@ class SettingsRepository(private val context: Context) { saveShutUpConfigs(current) } + /** + * Executes the save shut up original settings operation. + * + * @param settings [Map Target string. + */ fun saveShutUpOriginalSettings(settings: Map) { val json = gson.toJson(settings) putString(KEY_SHUT_UP_ORIGINAL_SETTINGS, json) } + /** + * Executes the get shut up original settings operation. + * @return The resulting Map data. + */ fun getShutUpOriginalSettings(): Map { val json = prefs.getString(KEY_SHUT_UP_ORIGINAL_SETTINGS, null) ?: return emptyMap() return try { @@ -703,11 +1037,20 @@ class SettingsRepository(private val context: Context) { } } + /** + * Executes the save snooze discovered channels operation. + * + * @param channels [List] Target channels. + */ fun saveSnoozeDiscoveredChannels(channels: List) { val json = gson.toJson(channels) putString(KEY_SNOOZE_DISCOVERED_CHANNELS, json) } + /** + * Executes the load snooze blocked channels operation. + * @return The resulting Set data. + */ fun loadSnoozeBlockedChannels(): Set { val json = prefs.getString(KEY_SNOOZE_BLOCKED_CHANNELS, null) return if (json != null) { @@ -721,6 +1064,11 @@ class SettingsRepository(private val context: Context) { } } + /** + * Executes the save snooze blocked channels operation. + * + * @param blockedChannels [Set] Target blocked channels. + */ fun saveSnoozeBlockedChannels(blockedChannels: Set) { val json = gson.toJson(blockedChannels) putString(KEY_SNOOZE_BLOCKED_CHANNELS, json) @@ -743,11 +1091,20 @@ class SettingsRepository(private val context: Context) { } } + /** + * Executes the save maps discovered channels operation. + * + * @param channels [List] Target channels. + */ fun saveMapsDiscoveredChannels(channels: List) { val json = gson.toJson(channels) putString(KEY_MAPS_DISCOVERED_CHANNELS, json) } + /** + * Executes the load maps detection channels operation. + * @return The resulting Set data. + */ fun loadMapsDetectionChannels(): Set { val json = prefs.getString(KEY_MAPS_DETECTION_CHANNELS, null) return if (json != null) { @@ -766,6 +1123,11 @@ class SettingsRepository(private val context: Context) { } } + /** + * Executes the save maps detection channels operation. + * + * @param channels [Set] Target channels. + */ fun saveMapsDetectionChannels(channels: Set) { val json = gson.toJson(channels) putString(KEY_MAPS_DETECTION_CHANNELS, json) @@ -821,6 +1183,11 @@ class SettingsRepository(private val context: Context) { } } + /** + * Executes the export configs operation. + * + * @param outputStream [java.io.OutputStream] Target output stream. + */ fun exportConfigs(outputStream: java.io.OutputStream) { try { val json = getAllConfigsAsJsonString() @@ -832,6 +1199,13 @@ class SettingsRepository(private val context: Context) { } } + /** + * Executes the import configs operation. + * + * @param inputStream [java.io.InputStream] Target input stream. + * @param keepPrefs [Boolean] Target keep prefs. + * @return The resulting Boolean data. + */ fun importConfigs(inputStream: java.io.InputStream, keepPrefs: Boolean): Boolean { return try { val json = inputStream.bufferedReader().use { it.readText() } @@ -921,6 +1295,10 @@ class SettingsRepository(private val context: Context) { } } + /** + * Executes the get bluetooth devices battery operation. + * @return The resulting List { val json = prefs.getString(KEY_BLUETOOTH_DEVICES_BATTERY, null) ?: return emptyList() return try { @@ -933,24 +1311,62 @@ class SettingsRepository(private val context: Context) { } } + /** + * Executes the save bluetooth devices battery operation. + * + * @param devices [List] Target devices. + */ fun saveBluetoothDevicesBattery(devices: List) { val json = gson.toJson(devices) putString(KEY_BLUETOOTH_DEVICES_BATTERY, json) } + /** + * Executes the is bluetooth devices enabled operation. + * @return The resulting Boolean data. + */ fun isBluetoothDevicesEnabled(): Boolean = getBoolean(KEY_SHOW_BLUETOOTH_DEVICES, false) + + /** + * Executes the set bluetooth devices enabled operation. + * + * @param enabled [Boolean] Target enabled. + */ fun setBluetoothDevicesEnabled(enabled: Boolean) = putBoolean(KEY_SHOW_BLUETOOTH_DEVICES, enabled) + /** + * Executes the get battery widget max devices operation. + * @return The resulting Int data. + */ fun getBatteryWidgetMaxDevices(): Int = getInt(KEY_BATTERY_WIDGET_MAX_DEVICES, 8) + + /** + * Executes the set battery widget max devices operation. + * + * @param count [Int] Target count. + */ fun setBatteryWidgetMaxDevices(count: Int) = putInt(KEY_BATTERY_WIDGET_MAX_DEVICES, count) + /** + * Executes the is battery widget background enabled operation. + * @return The resulting Boolean data. + */ fun isBatteryWidgetBackgroundEnabled(): Boolean = getBoolean(KEY_BATTERY_WIDGET_BACKGROUND_ENABLED, true) + /** + * Executes the set battery widget background enabled operation. + * + * @param enabled [Boolean] Target enabled. + */ fun setBatteryWidgetBackgroundEnabled(enabled: Boolean) = putBoolean(KEY_BATTERY_WIDGET_BACKGROUND_ENABLED, enabled) + /** + * Executes the get pinned features operation. + * @return The resulting List data. + */ fun getPinnedFeatures(): List { val json = prefs.getString(KEY_PINNED_FEATURES, null) return if (json != null) { @@ -962,11 +1378,20 @@ class SettingsRepository(private val context: Context) { } else emptyList() } + /** + * Executes the save pinned features operation. + * + * @param features [List] Target features. + */ fun savePinnedFeatures(features: List) { val json = gson.toJson(features) putString(KEY_PINNED_FEATURES, json) } + /** + * Executes the get pinned qs tiles operation. + * @return The resulting List data. + */ fun getPinnedQsTiles(): List { val json = prefs.getString(KEY_PINNED_QS_TILES, null) return if (json != null) { @@ -978,11 +1403,20 @@ class SettingsRepository(private val context: Context) { } else emptyList() } + /** + * Executes the save pinned qs tiles operation. + * + * @param tiles [List] Target tiles. + */ fun savePinnedQsTiles(tiles: List) { val json = gson.toJson(tiles) putString(KEY_PINNED_QS_TILES, json) } + /** + * Executes the get recent searches operation. + * @return The resulting List { val json = prefs.getString(KEY_RECENT_SEARCHES, null) return if (json != null) { @@ -997,11 +1431,20 @@ class SettingsRepository(private val context: Context) { } else emptyList() } + /** + * Executes the save recent searches operation. + * + * @param items [List] Target items. + */ fun saveRecentSearches(items: List) { val json = gson.toJson(items) putString(KEY_RECENT_SEARCHES, json) } + /** + * Executes the get tracked repos operation. + * @return The resulting List data. + */ fun getTrackedRepos(): List { val json = prefs.getString(KEY_TRACKED_REPOS, null) ?: return emptyList() return try { @@ -1011,11 +1454,21 @@ class SettingsRepository(private val context: Context) { } } + /** + * Executes the save tracked repos operation. + * + * @param repos [List] Target repos. + */ fun saveTrackedRepos(repos: List) { val json = gson.toJson(repos) prefs.edit().putString(KEY_TRACKED_REPOS, json).apply() } + /** + * Executes the add or update tracked repo operation. + * + * @param repo [TrackedRepo] Target repo. + */ fun addOrUpdateTrackedRepo(repo: TrackedRepo) { val current = getTrackedRepos().toMutableList() val index = current.indexOfFirst { it.fullName == repo.fullName } @@ -1027,120 +1480,284 @@ class SettingsRepository(private val context: Context) { saveTrackedRepos(current) } + /** + * Executes the is shut up attempt shizuku restart enabled operation. + * @return The resulting Boolean data. + */ fun isShutUpAttemptShizukuRestartEnabled(): Boolean = getBoolean(KEY_SHUT_UP_ATTEMPT_SHIZUKU_RESTART, true) + /** + * Executes the set shut up attempt shizuku restart enabled operation. + * + * @param enabled [Boolean] Target enabled. + */ fun setShutUpAttemptShizukuRestartEnabled(enabled: Boolean) = putBoolean(KEY_SHUT_UP_ATTEMPT_SHIZUKU_RESTART, enabled) + /** + * Executes the get shut up restore delay operation. + * @return The resulting Int data. + */ fun getShutUpRestoreDelay(): Int = getInt(KEY_SHUT_UP_RESTORE_DELAY, 10) + /** + * Executes the set shut up restore delay operation. + * + * @param delaySeconds [Int] Target delay seconds. + */ fun setShutUpRestoreDelay(delaySeconds: Int) = putInt(KEY_SHUT_UP_RESTORE_DELAY, delaySeconds) + /** + * Executes the get shut up restore mode operation. + * @return The resulting String data. + */ fun getShutUpRestoreMode(): String = prefs.getString(KEY_SHUT_UP_RESTORE_MODE, "Auto") ?: "Auto" + /** + * Executes the set shut up restore mode operation. + * + * @param mode [String] Target mode. + */ fun setShutUpRestoreMode(mode: String) = putString(KEY_SHUT_UP_RESTORE_MODE, mode) + /** + * Executes the get shizuku auth token operation. + * @return The resulting String data. + */ fun getShizukuAuthToken(): String = prefs.getString(KEY_SHIZUKU_AUTH_TOKEN, "") ?: "" + /** + * Executes the set shizuku auth token operation. + * + * @param token [String] Target token. + */ fun setShizukuAuthToken(token: String) = putString(KEY_SHIZUKU_AUTH_TOKEN, token) + /** + * Executes the get pixel searchbar type operation. + * @return The resulting String data. + */ fun getPixelSearchbarType(): String = prefs.getString(KEY_PIXEL_SEARCHBAR_TYPE, "empty") ?: "empty" + /** + * Executes the set pixel searchbar type operation. + * + * @param type [String] Target type. + */ fun setPixelSearchbarType(type: String) = putString(KEY_PIXEL_SEARCHBAR_TYPE, type) + /** + * Executes the get pixel searchbar date format operation. + * @return The resulting String data. + */ fun getPixelSearchbarDateFormat(): String = prefs.getString(KEY_PIXEL_SEARCHBAR_DATE_FORMAT, "EEEE, MMMM d") ?: "EEEE, MMMM d" + /** + * Executes the set pixel searchbar date format operation. + * + * @param format [String] Target format. + */ fun setPixelSearchbarDateFormat(format: String) = putString(KEY_PIXEL_SEARCHBAR_DATE_FORMAT, format) + /** + * Executes the get pixel searchbar background pill operation. + * @return The resulting Boolean data. + */ fun getPixelSearchbarBackgroundPill(): Boolean = prefs.getBoolean(KEY_PIXEL_SEARCHBAR_BACKGROUND_PILL, false) + /** + * Executes the set pixel searchbar background pill operation. + * + * @param enabled [Boolean] Target enabled. + */ fun setPixelSearchbarBackgroundPill(enabled: Boolean) = putBoolean(KEY_PIXEL_SEARCHBAR_BACKGROUND_PILL, enabled) + /** + * Executes the get pixel searchbar widget id operation. + * @return The resulting Int data. + */ fun getPixelSearchbarWidgetId(): Int = prefs.getInt( KEY_PIXEL_SEARCHBAR_WIDGET_ID, android.appwidget.AppWidgetManager.INVALID_APPWIDGET_ID ) + /** + * Executes the set pixel searchbar widget id operation. + * + * @param id [Int] Target id. + */ fun setPixelSearchbarWidgetId(id: Int) = prefs.edit().putInt(KEY_PIXEL_SEARCHBAR_WIDGET_ID, id).apply() + /** + * Executes the get pixel searchbar widget provider operation. + * @return The resulting String? data. + */ fun getPixelSearchbarWidgetProvider(): String? = prefs.getString(KEY_PIXEL_SEARCHBAR_WIDGET_PROVIDER, null) + /** + * Executes the set pixel searchbar widget provider operation. + * + * @param provider [String?] Target provider. + */ fun setPixelSearchbarWidgetProvider(provider: String?) = if (provider == null) prefs.edit().remove(KEY_PIXEL_SEARCHBAR_WIDGET_PROVIDER).apply() else putString(KEY_PIXEL_SEARCHBAR_WIDGET_PROVIDER, provider) + /** + * Executes the get pixel searchbar scraped line1 operation. + * @return The resulting String data. + */ fun getPixelSearchbarScrapedLine1(): String = prefs.getString(KEY_PIXEL_SEARCHBAR_SCRAPED_LINE1, "") ?: "" + /** + * Executes the set pixel searchbar scraped line1 operation. + * + * @param text [String] Target text. + */ fun setPixelSearchbarScrapedLine1(text: String) = putString(KEY_PIXEL_SEARCHBAR_SCRAPED_LINE1, text) + /** + * Executes the get pixel searchbar scraped line2 operation. + * @return The resulting String data. + */ fun getPixelSearchbarScrapedLine2(): String = prefs.getString(KEY_PIXEL_SEARCHBAR_SCRAPED_LINE2, "") ?: "" + /** + * Executes the set pixel searchbar scraped line2 operation. + * + * @param text [String] Target text. + */ fun setPixelSearchbarScrapedLine2(text: String) = putString(KEY_PIXEL_SEARCHBAR_SCRAPED_LINE2, text) + /** + * Executes the get pixel searchbar widget padding h operation. + * @return The resulting Int data. + */ fun getPixelSearchbarWidgetPaddingH(): Int = prefs.getInt(KEY_PIXEL_SEARCHBAR_WIDGET_PADDING_H, 0) + /** + * Executes the set pixel searchbar widget padding h operation. + * + * @param value [Int] Target value. + */ fun setPixelSearchbarWidgetPaddingH(value: Int) = prefs.edit().putInt(KEY_PIXEL_SEARCHBAR_WIDGET_PADDING_H, value).apply() + /** + * Executes the get pixel searchbar widget padding v operation. + * @return The resulting Int data. + */ fun getPixelSearchbarWidgetPaddingV(): Int = prefs.getInt(KEY_PIXEL_SEARCHBAR_WIDGET_PADDING_V, 0) + /** + * Executes the set pixel searchbar widget padding v operation. + * + * @param value [Int] Target value. + */ fun setPixelSearchbarWidgetPaddingV(value: Int) = prefs.edit().putInt(KEY_PIXEL_SEARCHBAR_WIDGET_PADDING_V, value).apply() + /** + * Executes the get pixel searchbar tap action enabled operation. + * @return The resulting Boolean data. + */ fun getPixelSearchbarTapActionEnabled(): Boolean = prefs.getBoolean(KEY_PIXEL_SEARCHBAR_TAP_ACTION_ENABLED, true) + /** + * Executes the set pixel searchbar tap action enabled operation. + * + * @param enabled [Boolean] Target enabled. + */ fun setPixelSearchbarTapActionEnabled(enabled: Boolean) = putBoolean(KEY_PIXEL_SEARCHBAR_TAP_ACTION_ENABLED, enabled) + /** + * Executes the get pixel searchbar widget revision operation. + * @return The resulting Int data. + */ fun getPixelSearchbarWidgetRevision(): Int = prefs.getInt(KEY_PIXEL_SEARCHBAR_WIDGET_REVISION, 0) + /** + * Executes the increment pixel searchbar widget revision operation. + */ fun incrementPixelSearchbarWidgetRevision() { val current = getPixelSearchbarWidgetRevision() prefs.edit().putInt(KEY_PIXEL_SEARCHBAR_WIDGET_REVISION, current + 1).apply() } + /** + * Executes the get pixel searchbar music title operation. + * @return The resulting String data. + */ fun getPixelSearchbarMusicTitle(): String = prefs.getString(KEY_PIXEL_SEARCHBAR_MUSIC_TITLE, "") ?: "" + /** + * Executes the set pixel searchbar music title operation. + * + * @param value [String] Target value. + */ fun setPixelSearchbarMusicTitle(value: String) = putString(KEY_PIXEL_SEARCHBAR_MUSIC_TITLE, value) + /** + * Executes the get pixel searchbar music artist operation. + * @return The resulting String data. + */ fun getPixelSearchbarMusicArtist(): String = prefs.getString(KEY_PIXEL_SEARCHBAR_MUSIC_ARTIST, "") ?: "" + /** + * Executes the set pixel searchbar music artist operation. + * + * @param value [String] Target value. + */ fun setPixelSearchbarMusicArtist(value: String) = putString(KEY_PIXEL_SEARCHBAR_MUSIC_ARTIST, value) + /** + * Executes the get pixel searchbar music package operation. + * @return The resulting String data. + */ fun getPixelSearchbarMusicPackage(): String = prefs.getString(KEY_PIXEL_SEARCHBAR_MUSIC_PACKAGE, "") ?: "" + /** + * Executes the set pixel searchbar music package operation. + * + * @param value [String] Target value. + */ fun setPixelSearchbarMusicPackage(value: String) = putString(KEY_PIXEL_SEARCHBAR_MUSIC_PACKAGE, value) + /** + * Executes the get edge lighting sweep selected shapes operation. + * @return The resulting Set data. + */ fun getEdgeLightingSweepSelectedShapes(): Set { val defaultShapes = com.sameerasw.essentials.utils.AmbientMusicShapeHelper.allShapesWithNames.map { it.first } @@ -1157,21 +1774,40 @@ class SettingsRepository(private val context: Context) { } } + /** + * Executes the save edge lighting sweep selected shapes operation. + * + * @param shapes [Set] Target shapes. + */ fun saveEdgeLightingSweepSelectedShapes(shapes: Set) { val json = gson.toJson(shapes) putString(KEY_EDGE_LIGHTING_SWEEP_SELECTED_SHAPES, json) } + /** + * Executes the remove tracked repo operation. + * + * @param fullName [String] Target full name. + */ fun removeTrackedRepo(fullName: String) { val current = getTrackedRepos().toMutableList() current.removeAll { it.fullName == fullName } saveTrackedRepos(current) } + /** + * Executes the get git hub token operation. + * @return The resulting String? data. + */ fun getGitHubToken(): String? { return prefs.getString(KEY_GITHUB_ACCESS_TOKEN, null) } + /** + * Executes the save git hub token operation. + * + * @param token [String?] Target token. + */ fun saveGitHubToken(token: String?) { prefs.edit().putString(KEY_GITHUB_ACCESS_TOKEN, token).apply() } @@ -1188,10 +1824,19 @@ class SettingsRepository(private val context: Context) { awaitClose { prefs.unregisterOnSharedPreferenceChangeListener(listener) } } + /** + * Executes the get git hub workflow token operation. + * @return The resulting String? data. + */ fun getGitHubWorkflowToken(): String? { return prefs.getString(KEY_GITHUB_WORKFLOW_TOKEN, null) } + /** + * Executes the save git hub workflow token operation. + * + * @param token [String?] Target token. + */ fun saveGitHubWorkflowToken(token: String?) { prefs.edit().putString(KEY_GITHUB_WORKFLOW_TOKEN, token).apply() } @@ -1207,6 +1852,11 @@ class SettingsRepository(private val context: Context) { awaitClose { prefs.unregisterOnSharedPreferenceChangeListener(listener) } } + /** + * Executes the save git hub user operation. + * + * @param user [GitHubUser?] Target user. + */ fun saveGitHubUser(user: GitHubUser?) { if (user == null) { prefs.edit().remove(KEY_GITHUB_USER_PROFILE).apply() @@ -1216,6 +1866,10 @@ class SettingsRepository(private val context: Context) { } } + /** + * Executes the get git hub user operation. + * @return The resulting GitHubUser? data. + */ fun getGitHubUser(): GitHubUser? { val json = prefs.getString(KEY_GITHUB_USER_PROFILE, null) ?: return null return try { @@ -1225,23 +1879,61 @@ class SettingsRepository(private val context: Context) { } } + /** + * Executes the is user dictionary enabled operation. + * @return The resulting Boolean data. + */ fun isUserDictionaryEnabled(): Boolean = getBoolean(KEY_USER_DICTIONARY_ENABLED, false) + + /** + * Executes the set user dictionary enabled operation. + * + * @param enabled [Boolean] Target enabled. + */ fun setUserDictionaryEnabled(enabled: Boolean) = putBoolean(KEY_USER_DICTIONARY_ENABLED, enabled) + /** + * Executes the is accented characters enabled operation. + * @return The resulting Boolean data. + */ fun isAccentedCharactersEnabled(): Boolean = getBoolean(KEY_KEYBOARD_ACCENTED_CHARACTERS, false) + + /** + * Executes the set accented characters enabled operation. + * + * @param enabled [Boolean] Target enabled. + */ fun setAccentedCharactersEnabled(enabled: Boolean) = putBoolean(KEY_KEYBOARD_ACCENTED_CHARACTERS, enabled) + /** + * Executes the is battery notification enabled operation. + * @return The resulting Boolean data. + */ fun isBatteryNotificationEnabled(): Boolean = getBoolean(KEY_BATTERY_NOTIFICATION_ENABLED, false) + /** + * Executes the set battery notification enabled operation. + * + * @param enabled [Boolean] Target enabled. + */ fun setBatteryNotificationEnabled(enabled: Boolean) = putBoolean(KEY_BATTERY_NOTIFICATION_ENABLED, enabled) + /** + * Executes the is enable unsupported features operation. + * @return The resulting Boolean data. + */ fun isEnableUnsupportedFeatures(): Boolean = getBoolean(KEY_ENABLE_UNSUPPORTED_FEATURES, false) + /** + * Executes the set enable unsupported features operation. + * + * @param enabled [Boolean] Target enabled. + */ fun setEnableUnsupportedFeatures(enabled: Boolean) = putBoolean(KEY_ENABLE_UNSUPPORTED_FEATURES, enabled) @@ -1250,6 +1942,10 @@ class SettingsRepository(private val context: Context) { context.getSharedPreferences(LIVE_WALLPAPER_PREFS_NAME, Context.MODE_PRIVATE) } + /** + * Executes the get live wallpaper selected video operation. + * @return The resulting String data. + */ fun getLiveWallpaperSelectedVideo(): String = liveWallpaperPrefs.getString( KEY_LIVE_WALLPAPER_SELECTED_VIDEO, @@ -1257,9 +1953,18 @@ class SettingsRepository(private val context: Context) { ) ?: LIVE_WALLPAPER_DEFAULT_VIDEO + /** + * Executes the save live wallpaper selected video operation. + * + * @param video [String] Target video. + */ fun saveLiveWallpaperSelectedVideo(video: String) = liveWallpaperPrefs.edit().putString(KEY_LIVE_WALLPAPER_SELECTED_VIDEO, video).apply() + /** + * Executes the get live wallpaper playback trigger operation. + * @return The resulting String data. + */ fun getLiveWallpaperPlaybackTrigger(): String = liveWallpaperPrefs.getString( KEY_LIVE_WALLPAPER_PLAYBACK_TRIGGER, @@ -1267,9 +1972,18 @@ class SettingsRepository(private val context: Context) { ) ?: LIVE_WALLPAPER_TRIGGER_UNLOCK + /** + * Executes the save live wallpaper playback trigger operation. + * + * @param trigger [String] Target trigger. + */ fun saveLiveWallpaperPlaybackTrigger(trigger: String) = liveWallpaperPrefs.edit().putString(KEY_LIVE_WALLPAPER_PLAYBACK_TRIGGER, trigger).apply() + /** + * Executes the get live wallpaper custom videos operation. + * @return The resulting List data. + */ fun getLiveWallpaperCustomVideos(): List { val stored = liveWallpaperPrefs.getString(KEY_LIVE_WALLPAPER_CUSTOM_VIDEOS, "") ?: "" val delimiter = if (!stored.contains("\n") && stored.contains(",")) "," else "\n" @@ -1279,6 +1993,11 @@ class SettingsRepository(private val context: Context) { .distinct() } + /** + * Executes the save live wallpaper custom videos operation. + * + * @param videos [List] Target videos. + */ fun saveLiveWallpaperCustomVideos(videos: List) = liveWallpaperPrefs.edit() .putString( @@ -1286,6 +2005,11 @@ class SettingsRepository(private val context: Context) { videos.filter { it.isNotEmpty() }.distinct().joinToString("\n") ).apply() + /** + * Executes the add live wallpaper custom video operation. + * + * @param uri [String] Target uri. + */ fun addLiveWallpaperCustomVideo(uri: String) { val current = getLiveWallpaperCustomVideos().toMutableList() if (current.contains(uri)) { @@ -1295,6 +2019,10 @@ class SettingsRepository(private val context: Context) { saveLiveWallpaperCustomVideos(if (current.size > 5) current.take(5) else current) } + /** + * Executes the get live wallpaper available videos operation. + * @return The resulting List data. + */ fun getLiveWallpaperAvailableVideos(): List { val raws = com.sameerasw.essentials.R.raw::class.java.fields.mapNotNull { field -> try { @@ -1306,6 +2034,11 @@ class SettingsRepository(private val context: Context) { return (raws + getLiveWallpaperCustomVideos()).filter { it.isNotBlank() }.distinct() } + /** + * Executes the remove live wallpaper custom video operation. + * + * @param videoUri [String] Target video uri. + */ fun removeLiveWallpaperCustomVideo(videoUri: String) { val current = getLiveWallpaperCustomVideos().toMutableList() val removed = current.removeAll { it == videoUri || it.isBlank() } @@ -1318,18 +2051,40 @@ class SettingsRepository(private val context: Context) { } } + /** + * Executes the get daily wallpaper apply home operation. + * @return The resulting Boolean data. + */ fun getDailyWallpaperApplyHome(): Boolean = getBoolean(KEY_DAILY_WALLPAPER_APPLY_HOME, true) + /** + * Executes the set daily wallpaper apply home operation. + * + * @param value [Boolean] Target value. + */ fun setDailyWallpaperApplyHome(value: Boolean) = putBoolean(KEY_DAILY_WALLPAPER_APPLY_HOME, value) + /** + * Executes the get daily wallpaper apply lock operation. + * @return The resulting Boolean data. + */ fun getDailyWallpaperApplyLock(): Boolean = getBoolean(KEY_DAILY_WALLPAPER_APPLY_LOCK, true) + /** + * Executes the set daily wallpaper apply lock operation. + * + * @param value [Boolean] Target value. + */ fun setDailyWallpaperApplyLock(value: Boolean) = putBoolean(KEY_DAILY_WALLPAPER_APPLY_LOCK, value) + /** + * Executes the get font scale operation. + * @return The resulting Float data. + */ fun getFontScale(): Float { return try { android.provider.Settings.System.getFloat( @@ -1341,6 +2096,11 @@ class SettingsRepository(private val context: Context) { } } + /** + * Executes the set font scale operation. + * + * @param scale [Float] Target scale. + */ fun setFontScale(scale: Float) { putFloat(KEY_FONT_SCALE, scale) try { @@ -1354,6 +2114,10 @@ class SettingsRepository(private val context: Context) { } } + /** + * Executes the get font weight operation. + * @return The resulting Int data. + */ fun getFontWeight(): Int { return try { android.provider.Settings.Secure.getInt( @@ -1365,6 +2129,11 @@ class SettingsRepository(private val context: Context) { } } + /** + * Executes the set font weight operation. + * + * @param weight [Int] Target weight. + */ fun setFontWeight(weight: Int) { putInt(KEY_FONT_WEIGHT, weight) try { @@ -1378,6 +2147,10 @@ class SettingsRepository(private val context: Context) { } } + /** + * Executes the get smallest width operation. + * @return The resulting Int data. + */ fun getSmallestWidth(): Int { val forcedDensity = try { android.provider.Settings.Secure.getInt( @@ -1395,6 +2168,11 @@ class SettingsRepository(private val context: Context) { return context.resources.configuration.smallestScreenWidthDp } + /** + * Executes the set smallest width operation. + * + * @param widthDp [Int] Target width dp. + */ fun setSmallestWidth(widthDp: Int) { putInt(KEY_SMALLEST_WIDTH, widthDp) val metrics = context.resources.displayMetrics @@ -1419,6 +2197,9 @@ class SettingsRepository(private val context: Context) { } } + /** + * Executes the reset smallest width operation. + */ fun resetSmallestWidth() { val command = "wm density reset" if (ShizukuUtils.isShizukuAvailable() && ShizukuUtils.hasPermission()) { @@ -1439,6 +2220,12 @@ class SettingsRepository(private val context: Context) { remove(KEY_SMALLEST_WIDTH) } + /** + * Executes the get animation scale operation. + * + * @param key [String] Target key. + * @return The resulting Float data. + */ fun getAnimationScale(key: String): Float { return try { android.provider.Settings.Global.getFloat(context.contentResolver, key) @@ -1447,6 +2234,12 @@ class SettingsRepository(private val context: Context) { } } + /** + * Executes the set animation scale operation. + * + * @param key [String] Target key. + * @param scale [Float] Target scale. + */ fun setAnimationScale(key: String, scale: Float) { when (key) { android.provider.Settings.Global.ANIMATOR_DURATION_SCALE -> putFloat( @@ -1471,6 +2264,9 @@ class SettingsRepository(private val context: Context) { } } + /** + * Executes the sync system settings with saved operation. + */ fun syncSystemSettingsWithSaved() { try { if (contains(KEY_FONT_SCALE)) { @@ -1529,6 +2325,10 @@ class SettingsRepository(private val context: Context) { } } + /** + * Executes the is aod enabled operation. + * @return The resulting Boolean data. + */ fun isAodEnabled(): Boolean { return android.provider.Settings.Secure.getInt( context.contentResolver, @@ -1537,6 +2337,11 @@ class SettingsRepository(private val context: Context) { ) == 1 } + /** + * Updates System Secure setting for Doze Always-On-Display (AOD). + * + * @param enabled [Boolean] True to enable Always-On-Display, false to disable. + */ fun setAodEnabled(enabled: Boolean) { try { android.provider.Settings.Secure.putInt( @@ -1549,6 +2354,10 @@ class SettingsRepository(private val context: Context) { } } + /** + * Executes the get private dns presets operation. + * @return The resulting List data. + */ fun getPrivateDnsPresets(): List { val json = prefs.getString(KEY_PRIVATE_DNS_PRESETS, null) return if (json != null) { @@ -1592,54 +2401,125 @@ class SettingsRepository(private val context: Context) { ) } + /** + * Executes the save private dns presets operation. + * + * @param presets [List] Target presets. + */ fun savePrivateDnsPresets(presets: List) { val json = gson.toJson(presets) putString(KEY_PRIVATE_DNS_PRESETS, json) } + /** + * Executes the reset private dns presets operation. + */ fun resetPrivateDnsPresets() { savePrivateDnsPresets(getDefaultDnsPresets()) } + /** + * Executes the get ambient music glance album art mode operation. + * @return The resulting String data. + */ fun getAmbientMusicGlanceAlbumArtMode(): String = prefs.getString(KEY_AMBIENT_MUSIC_GLANCE_ALBUM_ART_MODE, "default") ?: "default" + /** + * Executes the set ambient music glance album art mode operation. + * + * @param mode [String] Target mode. + */ fun setAmbientMusicGlanceAlbumArtMode(mode: String) = prefs.edit().putString(KEY_AMBIENT_MUSIC_GLANCE_ALBUM_ART_MODE, mode).apply() + /** + * Executes the get ambient music glance clock size operation. + * @return The resulting Int data. + */ fun getAmbientMusicGlanceClockSize(): Int = prefs.getInt(KEY_AMBIENT_MUSIC_GLANCE_CLOCK_SIZE, 80) + /** + * Executes the set ambient music glance clock size operation. + * + * @param size [Int] Target size. + */ fun setAmbientMusicGlanceClockSize(size: Int) = prefs.edit().putInt(KEY_AMBIENT_MUSIC_GLANCE_CLOCK_SIZE, size).apply() + /** + * Executes the get ambient music glance clock weight operation. + * @return The resulting Int data. + */ fun getAmbientMusicGlanceClockWeight(): Int = prefs.getInt(KEY_AMBIENT_MUSIC_GLANCE_CLOCK_WEIGHT, 400) + /** + * Executes the set ambient music glance clock weight operation. + * + * @param weight [Int] Target weight. + */ fun setAmbientMusicGlanceClockWeight(weight: Int) = prefs.edit().putInt(KEY_AMBIENT_MUSIC_GLANCE_CLOCK_WEIGHT, weight).apply() + /** + * Executes the get ambient music glance clock width operation. + * @return The resulting Int data. + */ fun getAmbientMusicGlanceClockWidth(): Int = prefs.getInt(KEY_AMBIENT_MUSIC_GLANCE_CLOCK_WIDTH, 100) + /** + * Executes the set ambient music glance clock width operation. + * + * @param width [Int] Target width. + */ fun setAmbientMusicGlanceClockWidth(width: Int) = prefs.edit().putInt(KEY_AMBIENT_MUSIC_GLANCE_CLOCK_WIDTH, width).apply() + /** + * Executes the get ambient music glance clock roundness operation. + * @return The resulting Int data. + */ fun getAmbientMusicGlanceClockRoundness(): Int = prefs.getInt(KEY_AMBIENT_MUSIC_GLANCE_CLOCK_ROUNDNESS, 50) + /** + * Executes the set ambient music glance clock roundness operation. + * + * @param roundness [Int] Target roundness. + */ fun setAmbientMusicGlanceClockRoundness(roundness: Int) = prefs.edit().putInt(KEY_AMBIENT_MUSIC_GLANCE_CLOCK_ROUNDNESS, roundness).apply() + /** + * Executes the is ambient music glance force fill while charging enabled operation. + * @return The resulting Boolean data. + */ fun isAmbientMusicGlanceForceFillWhileChargingEnabled(): Boolean = prefs.getBoolean(KEY_AMBIENT_MUSIC_GLANCE_FORCE_FILL_WHILE_CHARGING, false) + /** + * Executes the set ambient music glance force fill while charging enabled operation. + * + * @param enabled [Boolean] Target enabled. + */ fun setAmbientMusicGlanceForceFillWhileChargingEnabled(enabled: Boolean) = prefs.edit().putBoolean(KEY_AMBIENT_MUSIC_GLANCE_FORCE_FILL_WHILE_CHARGING, enabled).apply() + /** + * Executes the is ambient music glance respect notifications enabled operation. + * @return The resulting Boolean data. + */ fun isAmbientMusicGlanceRespectNotificationsEnabled(): Boolean = prefs.getBoolean(KEY_AMBIENT_MUSIC_GLANCE_RESPECT_NOTIFICATIONS, true) + /** + * Executes the set ambient music glance respect notifications enabled operation. + * + * @param enabled [Boolean] Target enabled. + */ fun setAmbientMusicGlanceRespectNotificationsEnabled(enabled: Boolean) = prefs.edit().putBoolean(KEY_AMBIENT_MUSIC_GLANCE_RESPECT_NOTIFICATIONS, enabled).apply() @@ -1648,14 +2528,36 @@ class SettingsRepository(private val context: Context) { fun getScaleAnimationsMode(): String = getString(KEY_SCALE_ANIMATIONS_MODE, "default") ?: "default" + /** + * Executes the set scale animations mode operation. + * + * @param mode [String] Target mode. + */ fun setScaleAnimationsMode(mode: String) = putString(KEY_SCALE_ANIMATIONS_MODE, mode) + /** + * Executes the get refresh rate mode operation. + * @return The resulting String data. + */ fun getRefreshRateMode(): String = getString(KEY_REFRESH_RATE_MODE, com.sameerasw.essentials.utils.RefreshRateUtils.MODE_FIXED) ?: com.sameerasw.essentials.utils.RefreshRateUtils.MODE_FIXED + /** + * Executes the set refresh rate mode operation. + * + * @param mode [String] Target mode. + */ fun setRefreshRateMode(mode: String) = putString(KEY_REFRESH_RATE_MODE, mode) + /** + * Executes the save refresh rate state operation. + * + * @param mode [String] Target mode. + * @param fixed [Float] Target fixed. + * @param min [Float] Target min. + * @param peak [Float] Target peak. + */ fun saveRefreshRateState(mode: String, fixed: Float, min: Float, peak: Float) { putString(KEY_REFRESH_RATE_MODE, mode) putFloat(KEY_REFRESH_RATE_FIXED, fixed) @@ -1663,12 +2565,27 @@ class SettingsRepository(private val context: Context) { putFloat(KEY_REFRESH_RATE_PEAK, peak) } + /** + * Executes the should restore infinity peak on refresh rate reset operation. + * @return The resulting Boolean data. + */ fun shouldRestoreInfinityPeakOnRefreshRateReset(): Boolean = getBoolean(KEY_REFRESH_RATE_DEFAULT_PEAK_INFINITY, false) + /** + * Executes the set restore infinity peak on refresh rate reset operation. + * + * @param enabled [Boolean] Target enabled. + */ fun setRestoreInfinityPeakOnRefreshRateReset(enabled: Boolean) = putBoolean(KEY_REFRESH_RATE_DEFAULT_PEAK_INFINITY, enabled) + /** + * Executes the get scale animations profile operation. + * + * @param mode [String] Target mode. + * @return The resulting ScaleAnimationsProfile data. + */ fun getScaleAnimationsProfile(mode: String): ScaleAnimationsProfile { val key = if (mode == "glove") KEY_SCALE_ANIMATIONS_GLOVE_PROFILE else KEY_SCALE_ANIMATIONS_DEFAULT_PROFILE @@ -1698,6 +2615,12 @@ class SettingsRepository(private val context: Context) { } } + /** + * Executes the save scale animations profile operation. + * + * @param mode [String] Target mode. + * @param profile [ScaleAnimationsProfile] Target profile. + */ fun saveScaleAnimationsProfile(mode: String, profile: ScaleAnimationsProfile) { val key = if (mode == "glove") KEY_SCALE_ANIMATIONS_GLOVE_PROFILE else KEY_SCALE_ANIMATIONS_DEFAULT_PROFILE @@ -1705,6 +2628,10 @@ class SettingsRepository(private val context: Context) { putString(key, json) } + /** + * Executes the get touch sensitivity enabled operation. + * @return The resulting Boolean data. + */ fun getTouchSensitivityEnabled(): Boolean { return try { android.provider.Settings.Secure.getInt( @@ -1717,6 +2644,11 @@ class SettingsRepository(private val context: Context) { } } + /** + * Executes the set touch sensitivity enabled operation. + * + * @param enabled [Boolean] Target enabled. + */ fun setTouchSensitivityEnabled(enabled: Boolean) { try { android.provider.Settings.Secure.putInt( @@ -1729,6 +2661,10 @@ class SettingsRepository(private val context: Context) { } } + /** + * Executes the get auto rotate enabled operation. + * @return The resulting Boolean data. + */ fun getAutoRotateEnabled(): Boolean { return try { android.provider.Settings.System.getInt( @@ -1741,6 +2677,11 @@ class SettingsRepository(private val context: Context) { } } + /** + * Executes the set auto rotate enabled operation. + * + * @param enabled [Boolean] Target enabled. + */ fun setAutoRotateEnabled(enabled: Boolean) { try { android.provider.Settings.System.putInt( @@ -1753,6 +2694,10 @@ class SettingsRepository(private val context: Context) { } } + /** + * Executes the get screen timeout operation. + * @return The resulting Long data. + */ fun getScreenTimeout(): Long { return try { android.provider.Settings.System.getLong( @@ -1765,6 +2710,11 @@ class SettingsRepository(private val context: Context) { } } + /** + * Executes the set screen timeout operation. + * + * @param timeoutMs [Long] Target timeout ms. + */ fun setScreenTimeout(timeoutMs: Long) { try { android.provider.Settings.System.putLong( @@ -1777,28 +2727,97 @@ class SettingsRepository(private val context: Context) { } } + /** + * Executes the get lock screen clock weight operation. + * @return The resulting Int data. + */ fun getLockScreenClockWeight(): Int = getInt(KEY_LOCK_SCREEN_CLOCK_WEIGHT, 300) + + /** + * Executes the set lock screen clock weight operation. + * + * @param value [Int] Target value. + */ fun setLockScreenClockWeight(value: Int) = putInt(KEY_LOCK_SCREEN_CLOCK_WEIGHT, value) + /** + * Executes the get lock screen clock width operation. + * @return The resulting Int data. + */ fun getLockScreenClockWidth(): Int = getInt(KEY_LOCK_SCREEN_CLOCK_WIDTH, 116) + + /** + * Executes the set lock screen clock width operation. + * + * @param value [Int] Target value. + */ fun setLockScreenClockWidth(value: Int) = putInt(KEY_LOCK_SCREEN_CLOCK_WIDTH, value) + /** + * Executes the get lock screen clock grade operation. + * @return The resulting Int data. + */ fun getLockScreenClockGrade(): Int = getInt(KEY_LOCK_SCREEN_CLOCK_GRADE, 0) + + /** + * Executes the set lock screen clock grade operation. + * + * @param value [Int] Target value. + */ fun setLockScreenClockGrade(value: Int) = putInt(KEY_LOCK_SCREEN_CLOCK_GRADE, value) + /** + * Executes the get lock screen clock roundness operation. + * @return The resulting Int data. + */ fun getLockScreenClockRoundness(): Int = getInt(KEY_LOCK_SCREEN_CLOCK_ROUNDNESS, 100) + + /** + * Executes the set lock screen clock roundness operation. + * + * @param value [Int] Target value. + */ fun setLockScreenClockRoundness(value: Int) = putInt(KEY_LOCK_SCREEN_CLOCK_ROUNDNESS, value) + /** + * Executes the get lock screen clock color tone operation. + * @return The resulting Int data. + */ fun getLockScreenClockColorTone(): Int = getInt(KEY_LOCK_SCREEN_CLOCK_COLOR_TONE, 75) + + /** + * Executes the set lock screen clock color tone operation. + * + * @param value [Int] Target value. + */ fun setLockScreenClockColorTone(value: Int) = putInt(KEY_LOCK_SCREEN_CLOCK_COLOR_TONE, value) + /** + * Executes the get lock screen clock selected color id operation. + * @return The resulting String data. + */ fun getLockScreenClockSelectedColorId(): String = getString(KEY_LOCK_SCREEN_CLOCK_SELECTED_COLOR_ID, "DEFAULT") ?: "DEFAULT" + /** + * Executes the set lock screen clock selected color id operation. + * + * @param value [String] Target value. + */ fun setLockScreenClockSelectedColorId(value: String) = putString(KEY_LOCK_SCREEN_CLOCK_SELECTED_COLOR_ID, value) + /** + * Executes the get lock screen clock seed color operation. + * @return The resulting Int data. + */ fun getLockScreenClockSeedColor(): Int = getInt(KEY_LOCK_SCREEN_CLOCK_SEED_COLOR, 0) + + /** + * Executes the set lock screen clock seed color operation. + * + * @param value [Int] Target value. + */ fun setLockScreenClockSeedColor(value: Int) = putInt(KEY_LOCK_SCREEN_CLOCK_SEED_COLOR, value) } diff --git a/app/src/main/java/com/sameerasw/essentials/data/repository/UpdateRepository.kt b/app/src/main/java/com/sameerasw/essentials/data/repository/UpdateRepository.kt index 34b16daf5..fcf4a30a1 100644 --- a/app/src/main/java/com/sameerasw/essentials/data/repository/UpdateRepository.kt +++ b/app/src/main/java/com/sameerasw/essentials/data/repository/UpdateRepository.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Data & Repository Layer + * File: UpdateRepository.kt + * Description: Data repository and storage component for UpdateRepository.kt. + */ + package com.sameerasw.essentials.data.repository import android.content.Context @@ -134,6 +143,12 @@ class UpdateRepository { } companion object { + /** + * Executes the parse operation. + * + * @param versionInfo [String] Target version info. + * @return The resulting SemanticVersion data. + */ fun parse(versionInfo: String): SemanticVersion { try { // Remove "v" prefix if present diff --git a/app/src/main/java/com/sameerasw/essentials/data/repository/WallpaperRepository.kt b/app/src/main/java/com/sameerasw/essentials/data/repository/WallpaperRepository.kt index 73296649a..41d3141bf 100644 --- a/app/src/main/java/com/sameerasw/essentials/data/repository/WallpaperRepository.kt +++ b/app/src/main/java/com/sameerasw/essentials/data/repository/WallpaperRepository.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Data & Repository Layer + * File: WallpaperRepository.kt + * Description: Data repository and storage component for WallpaperRepository.kt. + */ + package com.sameerasw.essentials.data.repository import android.app.WallpaperManager diff --git a/app/src/main/java/com/sameerasw/essentials/domain/DIYTabs.kt b/app/src/main/java/com/sameerasw/essentials/domain/DIYTabs.kt index 2b8b3e72d..de3412e7a 100644 --- a/app/src/main/java/com/sameerasw/essentials/domain/DIYTabs.kt +++ b/app/src/main/java/com/sameerasw/essentials/domain/DIYTabs.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Domain Layer Models & Registries + * File: DIYTabs.kt + * Description: Domain model and business logic entry for DIYTabs.kt. + */ + package com.sameerasw.essentials.domain import androidx.annotation.StringRes diff --git a/app/src/main/java/com/sameerasw/essentials/domain/HapticFeedbackType.kt b/app/src/main/java/com/sameerasw/essentials/domain/HapticFeedbackType.kt index 3715a3729..f207cd20c 100644 --- a/app/src/main/java/com/sameerasw/essentials/domain/HapticFeedbackType.kt +++ b/app/src/main/java/com/sameerasw/essentials/domain/HapticFeedbackType.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Domain Layer Models & Registries + * File: HapticFeedbackType.kt + * Description: Domain model and business logic entry for HapticFeedbackType.kt. + */ + package com.sameerasw.essentials.domain enum class HapticFeedbackType { diff --git a/app/src/main/java/com/sameerasw/essentials/domain/MapsState.kt b/app/src/main/java/com/sameerasw/essentials/domain/MapsState.kt index 2720c65d4..99ee76bd1 100644 --- a/app/src/main/java/com/sameerasw/essentials/domain/MapsState.kt +++ b/app/src/main/java/com/sameerasw/essentials/domain/MapsState.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Domain Layer Models & Registries + * File: MapsState.kt + * Description: Domain model and business logic entry for MapsState.kt. + */ + package com.sameerasw.essentials.domain object MapsState { diff --git a/app/src/main/java/com/sameerasw/essentials/domain/ScreenOffMethod.kt b/app/src/main/java/com/sameerasw/essentials/domain/ScreenOffMethod.kt index 08b758ead..5e9d6a2f4 100644 --- a/app/src/main/java/com/sameerasw/essentials/domain/ScreenOffMethod.kt +++ b/app/src/main/java/com/sameerasw/essentials/domain/ScreenOffMethod.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Domain Layer Models & Registries + * File: ScreenOffMethod.kt + * Description: Domain model and business logic entry for ScreenOffMethod.kt. + */ + package com.sameerasw.essentials.domain enum class ScreenOffMethod { diff --git a/app/src/main/java/com/sameerasw/essentials/domain/StatusBarIcon.kt b/app/src/main/java/com/sameerasw/essentials/domain/StatusBarIcon.kt index 348b8942a..72fec4c48 100644 --- a/app/src/main/java/com/sameerasw/essentials/domain/StatusBarIcon.kt +++ b/app/src/main/java/com/sameerasw/essentials/domain/StatusBarIcon.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Domain Layer Models & Registries + * File: StatusBarIcon.kt + * Description: Domain model and business logic entry for StatusBarIcon.kt. + */ + package com.sameerasw.essentials.domain import com.sameerasw.essentials.R @@ -348,7 +357,7 @@ object StatusBarIconRegistry { /** * Get all blacklist names that should be hidden - * @param iconVisibilities Map of icon IDs to their visibility state + * @param iconVisibilities [Map): Set { @@ -367,7 +376,7 @@ object StatusBarIconRegistry { /** * Get visibility state for all icons based on current blacklist - * @param blacklist Comma-separated blacklist string from settings + * @param blacklist [String?] Comma-separated blacklist string from settings * @return Map of icon ID to visibility state */ fun getVisibilityState(blacklist: String?): Map { diff --git a/app/src/main/java/com/sameerasw/essentials/domain/controller/CaffeinateController.kt b/app/src/main/java/com/sameerasw/essentials/domain/controller/CaffeinateController.kt index ca9b3e2e5..cae6b1c46 100644 --- a/app/src/main/java/com/sameerasw/essentials/domain/controller/CaffeinateController.kt +++ b/app/src/main/java/com/sameerasw/essentials/domain/controller/CaffeinateController.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Domain Layer Models & Registries + * File: CaffeinateController.kt + * Description: Domain model and business logic entry for CaffeinateController.kt. + */ + package com.sameerasw.essentials.domain.controller import android.app.ActivityManager diff --git a/app/src/main/java/com/sameerasw/essentials/domain/diy/Action.kt b/app/src/main/java/com/sameerasw/essentials/domain/diy/Action.kt index db5f48640..cf74717f8 100644 --- a/app/src/main/java/com/sameerasw/essentials/domain/diy/Action.kt +++ b/app/src/main/java/com/sameerasw/essentials/domain/diy/Action.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Domain Layer Models & Registries + * File: Action.kt + * Description: Domain model and business logic entry for Action.kt. + */ + package com.sameerasw.essentials.domain.diy import androidx.annotation.DrawableRes diff --git a/app/src/main/java/com/sameerasw/essentials/domain/diy/Automation.kt b/app/src/main/java/com/sameerasw/essentials/domain/diy/Automation.kt index 221279915..838c3b33d 100644 --- a/app/src/main/java/com/sameerasw/essentials/domain/diy/Automation.kt +++ b/app/src/main/java/com/sameerasw/essentials/domain/diy/Automation.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Domain Layer Models & Registries + * File: Automation.kt + * Description: Domain model and business logic entry for Automation.kt. + */ + package com.sameerasw.essentials.domain.diy import androidx.annotation.Keep diff --git a/app/src/main/java/com/sameerasw/essentials/domain/diy/DIYRepository.kt b/app/src/main/java/com/sameerasw/essentials/domain/diy/DIYRepository.kt index 38a88d8a5..e1775cf20 100644 --- a/app/src/main/java/com/sameerasw/essentials/domain/diy/DIYRepository.kt +++ b/app/src/main/java/com/sameerasw/essentials/domain/diy/DIYRepository.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Domain Layer Models & Registries + * File: DIYRepository.kt + * Description: Domain model and business logic entry for DIYRepository.kt. + */ + package com.sameerasw.essentials.domain.diy import android.content.Context diff --git a/app/src/main/java/com/sameerasw/essentials/domain/diy/State.kt b/app/src/main/java/com/sameerasw/essentials/domain/diy/State.kt index 0ca9d06cc..2526427d3 100644 --- a/app/src/main/java/com/sameerasw/essentials/domain/diy/State.kt +++ b/app/src/main/java/com/sameerasw/essentials/domain/diy/State.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Domain Layer Models & Registries + * File: State.kt + * Description: Domain model and business logic entry for State.kt. + */ + package com.sameerasw.essentials.domain.diy import androidx.annotation.DrawableRes diff --git a/app/src/main/java/com/sameerasw/essentials/domain/diy/Trigger.kt b/app/src/main/java/com/sameerasw/essentials/domain/diy/Trigger.kt index 25536e810..baa3b45b1 100644 --- a/app/src/main/java/com/sameerasw/essentials/domain/diy/Trigger.kt +++ b/app/src/main/java/com/sameerasw/essentials/domain/diy/Trigger.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Domain Layer Models & Registries + * File: Trigger.kt + * Description: Domain model and business logic entry for Trigger.kt. + */ + package com.sameerasw.essentials.domain.diy import androidx.annotation.Keep diff --git a/app/src/main/java/com/sameerasw/essentials/domain/genai/AutomationSuggestion.kt b/app/src/main/java/com/sameerasw/essentials/domain/genai/AutomationSuggestion.kt index 739a6f84a..598b26e46 100644 --- a/app/src/main/java/com/sameerasw/essentials/domain/genai/AutomationSuggestion.kt +++ b/app/src/main/java/com/sameerasw/essentials/domain/genai/AutomationSuggestion.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Domain Layer Models & Registries + * File: AutomationSuggestion.kt + * Description: Domain model and business logic entry for AutomationSuggestion.kt. + */ + package com.sameerasw.essentials.domain.genai import androidx.annotation.Keep diff --git a/app/src/main/java/com/sameerasw/essentials/domain/genai/GenAIAutomationService.kt b/app/src/main/java/com/sameerasw/essentials/domain/genai/GenAIAutomationService.kt index ec31bb1fe..ba8161e4f 100644 --- a/app/src/main/java/com/sameerasw/essentials/domain/genai/GenAIAutomationService.kt +++ b/app/src/main/java/com/sameerasw/essentials/domain/genai/GenAIAutomationService.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Domain Layer Models & Registries + * File: GenAIAutomationService.kt + * Description: Domain model and business logic entry for GenAIAutomationService.kt. + */ + package com.sameerasw.essentials.domain.genai import android.content.Context @@ -36,6 +45,7 @@ object GenAIAutomationService { FeatureStatus.UNAVAILABLE -> { return@withContext Result.failure(IllegalStateException("GenAI feature is UNAVAILABLE on this device")) } + FeatureStatus.DOWNLOADABLE -> { Log.d(TAG, "Gemini Nano model is downloadable. Triggering download...") var downloadFailedReason: String? = null @@ -44,6 +54,7 @@ object GenAIAutomationService { is com.google.mlkit.genai.common.DownloadStatus.DownloadFailed -> { downloadFailedReason = downloadStatus.e.message } + else -> {} } } @@ -51,10 +62,12 @@ object GenAIAutomationService { return@withContext Result.failure(IllegalStateException("Gemini Nano download failed: $downloadFailedReason")) } } + FeatureStatus.DOWNLOADING -> { Log.d(TAG, "Gemini Nano model is currently downloading...") generativeModel.download().collect {} } + FeatureStatus.AVAILABLE -> { // Ready to proceed } diff --git a/app/src/main/java/com/sameerasw/essentials/domain/model/AppSelection.kt b/app/src/main/java/com/sameerasw/essentials/domain/model/AppSelection.kt index 86f83304a..b22d95cb4 100644 --- a/app/src/main/java/com/sameerasw/essentials/domain/model/AppSelection.kt +++ b/app/src/main/java/com/sameerasw/essentials/domain/model/AppSelection.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Domain Layer Models & Registries + * File: AppSelection.kt + * Description: Domain model and business logic entry for AppSelection.kt. + */ + package com.sameerasw.essentials.domain.model import androidx.annotation.Keep diff --git a/app/src/main/java/com/sameerasw/essentials/domain/model/AppStandbyInfo.kt b/app/src/main/java/com/sameerasw/essentials/domain/model/AppStandbyInfo.kt index 4ecf7987d..2f616f9f3 100644 --- a/app/src/main/java/com/sameerasw/essentials/domain/model/AppStandbyInfo.kt +++ b/app/src/main/java/com/sameerasw/essentials/domain/model/AppStandbyInfo.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Domain Layer Models & Registries + * File: AppStandbyInfo.kt + * Description: Domain model and business logic entry for AppStandbyInfo.kt. + */ + package com.sameerasw.essentials.domain.model import android.graphics.drawable.Drawable diff --git a/app/src/main/java/com/sameerasw/essentials/domain/model/AppTag.kt b/app/src/main/java/com/sameerasw/essentials/domain/model/AppTag.kt index 4fcd29032..d6c501700 100644 --- a/app/src/main/java/com/sameerasw/essentials/domain/model/AppTag.kt +++ b/app/src/main/java/com/sameerasw/essentials/domain/model/AppTag.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Domain Layer Models & Registries + * File: AppTag.kt + * Description: Domain model and business logic entry for AppTag.kt. + */ + package com.sameerasw.essentials.domain.model data class AppTag( diff --git a/app/src/main/java/com/sameerasw/essentials/domain/model/DnsPreset.kt b/app/src/main/java/com/sameerasw/essentials/domain/model/DnsPreset.kt index 6042f562d..92ef50aab 100644 --- a/app/src/main/java/com/sameerasw/essentials/domain/model/DnsPreset.kt +++ b/app/src/main/java/com/sameerasw/essentials/domain/model/DnsPreset.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Domain Layer Models & Registries + * File: DnsPreset.kt + * Description: Domain model and business logic entry for DnsPreset.kt. + */ + package com.sameerasw.essentials.domain.model import androidx.annotation.Keep diff --git a/app/src/main/java/com/sameerasw/essentials/domain/model/Feature.kt b/app/src/main/java/com/sameerasw/essentials/domain/model/Feature.kt index c7e17759a..771d0cfb5 100644 --- a/app/src/main/java/com/sameerasw/essentials/domain/model/Feature.kt +++ b/app/src/main/java/com/sameerasw/essentials/domain/model/Feature.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Domain Layer Models & Registries + * File: Feature.kt + * Description: Domain model and business logic entry for Feature.kt. + */ + package com.sameerasw.essentials.domain.model import android.content.Context diff --git a/app/src/main/java/com/sameerasw/essentials/domain/model/FreezeMode.kt b/app/src/main/java/com/sameerasw/essentials/domain/model/FreezeMode.kt index 7b0878e14..b04402fe3 100644 --- a/app/src/main/java/com/sameerasw/essentials/domain/model/FreezeMode.kt +++ b/app/src/main/java/com/sameerasw/essentials/domain/model/FreezeMode.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Domain Layer Models & Registries + * File: FreezeMode.kt + * Description: Domain model and business logic entry for FreezeMode.kt. + */ + package com.sameerasw.essentials.domain.model enum class FreezeMode(val value: Int) { diff --git a/app/src/main/java/com/sameerasw/essentials/domain/model/LocationAlarm.kt b/app/src/main/java/com/sameerasw/essentials/domain/model/LocationAlarm.kt index a0e52e0f3..ced0f9a24 100644 --- a/app/src/main/java/com/sameerasw/essentials/domain/model/LocationAlarm.kt +++ b/app/src/main/java/com/sameerasw/essentials/domain/model/LocationAlarm.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Domain Layer Models & Registries + * File: LocationAlarm.kt + * Description: Domain model and business logic entry for LocationAlarm.kt. + */ + package com.sameerasw.essentials.domain.model import androidx.annotation.Keep diff --git a/app/src/main/java/com/sameerasw/essentials/domain/model/MapsChannel.kt b/app/src/main/java/com/sameerasw/essentials/domain/model/MapsChannel.kt index b1bc65ada..78a2d07f4 100644 --- a/app/src/main/java/com/sameerasw/essentials/domain/model/MapsChannel.kt +++ b/app/src/main/java/com/sameerasw/essentials/domain/model/MapsChannel.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Domain Layer Models & Registries + * File: MapsChannel.kt + * Description: Domain model and business logic entry for MapsChannel.kt. + */ + package com.sameerasw.essentials.domain.model import androidx.annotation.Keep diff --git a/app/src/main/java/com/sameerasw/essentials/domain/model/NotificationApp.kt b/app/src/main/java/com/sameerasw/essentials/domain/model/NotificationApp.kt index 47a3aeddc..1b1da7ba4 100644 --- a/app/src/main/java/com/sameerasw/essentials/domain/model/NotificationApp.kt +++ b/app/src/main/java/com/sameerasw/essentials/domain/model/NotificationApp.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Domain Layer Models & Registries + * File: NotificationApp.kt + * Description: Domain model and business logic entry for NotificationApp.kt. + */ + package com.sameerasw.essentials.domain.model import androidx.compose.runtime.Immutable diff --git a/app/src/main/java/com/sameerasw/essentials/domain/model/NotificationLightingColorMode.kt b/app/src/main/java/com/sameerasw/essentials/domain/model/NotificationLightingColorMode.kt index c531d4f65..528e5d5f7 100644 --- a/app/src/main/java/com/sameerasw/essentials/domain/model/NotificationLightingColorMode.kt +++ b/app/src/main/java/com/sameerasw/essentials/domain/model/NotificationLightingColorMode.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Domain Layer Models & Registries + * File: NotificationLightingColorMode.kt + * Description: Domain model and business logic entry for NotificationLightingColorMode.kt. + */ + package com.sameerasw.essentials.domain.model enum class NotificationLightingColorMode { diff --git a/app/src/main/java/com/sameerasw/essentials/domain/model/NotificationLightingSide.kt b/app/src/main/java/com/sameerasw/essentials/domain/model/NotificationLightingSide.kt index 2a57ba079..15d227a4b 100644 --- a/app/src/main/java/com/sameerasw/essentials/domain/model/NotificationLightingSide.kt +++ b/app/src/main/java/com/sameerasw/essentials/domain/model/NotificationLightingSide.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Domain Layer Models & Registries + * File: NotificationLightingSide.kt + * Description: Domain model and business logic entry for NotificationLightingSide.kt. + */ + package com.sameerasw.essentials.domain.model enum class NotificationLightingSide { diff --git a/app/src/main/java/com/sameerasw/essentials/domain/model/NotificationLightingStyle.kt b/app/src/main/java/com/sameerasw/essentials/domain/model/NotificationLightingStyle.kt index 9ed02c083..5f6264326 100644 --- a/app/src/main/java/com/sameerasw/essentials/domain/model/NotificationLightingStyle.kt +++ b/app/src/main/java/com/sameerasw/essentials/domain/model/NotificationLightingStyle.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Domain Layer Models & Registries + * File: NotificationLightingStyle.kt + * Description: Domain model and business logic entry for NotificationLightingStyle.kt. + */ + package com.sameerasw.essentials.domain.model enum class NotificationLightingStyle { diff --git a/app/src/main/java/com/sameerasw/essentials/domain/model/NotificationLightingSweepPosition.kt b/app/src/main/java/com/sameerasw/essentials/domain/model/NotificationLightingSweepPosition.kt index b5b11cd56..a02d985b6 100644 --- a/app/src/main/java/com/sameerasw/essentials/domain/model/NotificationLightingSweepPosition.kt +++ b/app/src/main/java/com/sameerasw/essentials/domain/model/NotificationLightingSweepPosition.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Domain Layer Models & Registries + * File: NotificationLightingSweepPosition.kt + * Description: Domain model and business logic entry for NotificationLightingSweepPosition.kt. + */ + package com.sameerasw.essentials.domain.model enum class NotificationLightingSweepPosition { diff --git a/app/src/main/java/com/sameerasw/essentials/domain/model/ScaleAnimationsProfile.kt b/app/src/main/java/com/sameerasw/essentials/domain/model/ScaleAnimationsProfile.kt index 9e730eb85..e3c3bddbc 100644 --- a/app/src/main/java/com/sameerasw/essentials/domain/model/ScaleAnimationsProfile.kt +++ b/app/src/main/java/com/sameerasw/essentials/domain/model/ScaleAnimationsProfile.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Domain Layer Models & Registries + * File: ScaleAnimationsProfile.kt + * Description: Domain model and business logic entry for ScaleAnimationsProfile.kt. + */ + package com.sameerasw.essentials.domain.model data class ScaleAnimationsProfile( diff --git a/app/src/main/java/com/sameerasw/essentials/domain/model/SearchableItem.kt b/app/src/main/java/com/sameerasw/essentials/domain/model/SearchableItem.kt index 8fa2d7012..712f9fc96 100644 --- a/app/src/main/java/com/sameerasw/essentials/domain/model/SearchableItem.kt +++ b/app/src/main/java/com/sameerasw/essentials/domain/model/SearchableItem.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Domain Layer Models & Registries + * File: SearchableItem.kt + * Description: Domain model and business logic entry for SearchableItem.kt. + */ + package com.sameerasw.essentials.domain.model import androidx.annotation.DrawableRes diff --git a/app/src/main/java/com/sameerasw/essentials/domain/model/ShutUpAppConfig.kt b/app/src/main/java/com/sameerasw/essentials/domain/model/ShutUpAppConfig.kt index a9a0551b1..b20ce265a 100644 --- a/app/src/main/java/com/sameerasw/essentials/domain/model/ShutUpAppConfig.kt +++ b/app/src/main/java/com/sameerasw/essentials/domain/model/ShutUpAppConfig.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Domain Layer Models & Registries + * File: ShutUpAppConfig.kt + * Description: Domain model and business logic entry for ShutUpAppConfig.kt. + */ + package com.sameerasw.essentials.domain.model data class ShutUpAppConfig( diff --git a/app/src/main/java/com/sameerasw/essentials/domain/model/SnoozeChannel.kt b/app/src/main/java/com/sameerasw/essentials/domain/model/SnoozeChannel.kt index e0695cebd..b00ea0356 100644 --- a/app/src/main/java/com/sameerasw/essentials/domain/model/SnoozeChannel.kt +++ b/app/src/main/java/com/sameerasw/essentials/domain/model/SnoozeChannel.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Domain Layer Models & Registries + * File: SnoozeChannel.kt + * Description: Domain model and business logic entry for SnoozeChannel.kt. + */ + package com.sameerasw.essentials.domain.model import androidx.annotation.Keep diff --git a/app/src/main/java/com/sameerasw/essentials/domain/model/TrackedRepo.kt b/app/src/main/java/com/sameerasw/essentials/domain/model/TrackedRepo.kt index f022fcfaa..1cf2ee604 100644 --- a/app/src/main/java/com/sameerasw/essentials/domain/model/TrackedRepo.kt +++ b/app/src/main/java/com/sameerasw/essentials/domain/model/TrackedRepo.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Domain Layer Models & Registries + * File: TrackedRepo.kt + * Description: Domain model and business logic entry for TrackedRepo.kt. + */ + package com.sameerasw.essentials.domain.model import androidx.annotation.Keep diff --git a/app/src/main/java/com/sameerasw/essentials/domain/model/UpdateInfo.kt b/app/src/main/java/com/sameerasw/essentials/domain/model/UpdateInfo.kt index ef030bc3b..794fc7b5b 100644 --- a/app/src/main/java/com/sameerasw/essentials/domain/model/UpdateInfo.kt +++ b/app/src/main/java/com/sameerasw/essentials/domain/model/UpdateInfo.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Domain Layer Models & Registries + * File: UpdateInfo.kt + * Description: Domain model and business logic entry for UpdateInfo.kt. + */ + package com.sameerasw.essentials.domain.model import androidx.annotation.Keep diff --git a/app/src/main/java/com/sameerasw/essentials/domain/model/WallpaperInfo.kt b/app/src/main/java/com/sameerasw/essentials/domain/model/WallpaperInfo.kt index d488a23e6..2a3a7aab7 100644 --- a/app/src/main/java/com/sameerasw/essentials/domain/model/WallpaperInfo.kt +++ b/app/src/main/java/com/sameerasw/essentials/domain/model/WallpaperInfo.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Domain Layer Models + * File: WallpaperInfo.kt + * Description: Domain model representing live wallpaper metadata, resolution, author, and preview assets. + */ + package com.sameerasw.essentials.domain.model data class WallpaperInfo( diff --git a/app/src/main/java/com/sameerasw/essentials/domain/model/github/GitHubModels.kt b/app/src/main/java/com/sameerasw/essentials/domain/model/github/GitHubModels.kt index bfa33e5f2..37042452b 100644 --- a/app/src/main/java/com/sameerasw/essentials/domain/model/github/GitHubModels.kt +++ b/app/src/main/java/com/sameerasw/essentials/domain/model/github/GitHubModels.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Domain Layer Models & Registries + * File: GitHubModels.kt + * Description: Domain model and business logic entry for GitHubModels.kt. + */ + package com.sameerasw.essentials.domain.model.github import androidx.annotation.Keep diff --git a/app/src/main/java/com/sameerasw/essentials/domain/model/github/GitHubPullRequest.kt b/app/src/main/java/com/sameerasw/essentials/domain/model/github/GitHubPullRequest.kt index ec8c7ec10..6f355258b 100644 --- a/app/src/main/java/com/sameerasw/essentials/domain/model/github/GitHubPullRequest.kt +++ b/app/src/main/java/com/sameerasw/essentials/domain/model/github/GitHubPullRequest.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Domain Layer Models & Registries + * File: GitHubPullRequest.kt + * Description: Domain model and business logic entry for GitHubPullRequest.kt. + */ + package com.sameerasw.essentials.domain.model.github import com.google.gson.annotations.SerializedName diff --git a/app/src/main/java/com/sameerasw/essentials/domain/model/github/GitHubUser.kt b/app/src/main/java/com/sameerasw/essentials/domain/model/github/GitHubUser.kt index f6ce9b1f0..67240259a 100644 --- a/app/src/main/java/com/sameerasw/essentials/domain/model/github/GitHubUser.kt +++ b/app/src/main/java/com/sameerasw/essentials/domain/model/github/GitHubUser.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Domain Layer Models & Registries + * File: GitHubUser.kt + * Description: Domain model and business logic entry for GitHubUser.kt. + */ + package com.sameerasw.essentials.domain.model.github import androidx.annotation.Keep diff --git a/app/src/main/java/com/sameerasw/essentials/domain/registry/FeatureRegistry.kt b/app/src/main/java/com/sameerasw/essentials/domain/registry/FeatureRegistry.kt index 9c98f44db..8e41d9399 100644 --- a/app/src/main/java/com/sameerasw/essentials/domain/registry/FeatureRegistry.kt +++ b/app/src/main/java/com/sameerasw/essentials/domain/registry/FeatureRegistry.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Domain Layer Registries + * File: FeatureRegistry.kt + * Description: Central registry defining all app features, categories, permission requirements, and toggles. + */ + package com.sameerasw.essentials.domain.registry import android.content.Context @@ -36,19 +45,6 @@ object FeatureRegistry { ALL_FEATURES.filter { !it.isDeviceSupported(context) } val ALL_FEATURES = listOf( - object : Feature( - id = "AppFunctions AI", - title = R.string.feat_app_functions_title, - iconRes = R.drawable.google, - category = R.string.cat_system, - description = R.string.feat_app_functions_desc, - aboutDescription = R.string.about_desc_app_functions, - showToggle = true - ) { - override fun isEnabled(viewModel: MainViewModel) = true - override fun onToggle(viewModel: MainViewModel, context: Context, enabled: Boolean) {} - override fun isDeviceSupported(context: Context) = android.os.Build.VERSION.SDK_INT >= 35 - }, // Sound Group Children object : Feature( id = "Sound mode tile", @@ -350,7 +346,9 @@ object FeatureRegistry { parentFeatureId = "Networks", showToggle = false ) { - override fun isEnabled(viewModel: MainViewModel) = viewModel.networkDownloadRateLimit.intValue != -1 + override fun isEnabled(viewModel: MainViewModel) = + viewModel.networkDownloadRateLimit.intValue != -1 + override fun onToggle(viewModel: MainViewModel, context: Context, enabled: Boolean) {} }, @@ -363,7 +361,9 @@ object FeatureRegistry { permissionKeys = listOf("WRITE_SECURE_SETTINGS"), parentFeatureId = "Networks" ) { - override fun isEnabled(viewModel: MainViewModel) = viewModel.isMobileDataAlwaysOnEnabled.value + override fun isEnabled(viewModel: MainViewModel) = + viewModel.isMobileDataAlwaysOnEnabled.value + override fun onToggle(viewModel: MainViewModel, context: Context, enabled: Boolean) = viewModel.setMobileDataAlwaysOnEnabled(enabled, context) }, @@ -377,7 +377,9 @@ object FeatureRegistry { permissionKeys = listOf("WRITE_SECURE_SETTINGS"), parentFeatureId = "Networks" ) { - override fun isEnabled(viewModel: MainViewModel) = viewModel.isWirelessDisplayCertificationEnabled.value + override fun isEnabled(viewModel: MainViewModel) = + viewModel.isWirelessDisplayCertificationEnabled.value + override fun onToggle(viewModel: MainViewModel, context: Context, enabled: Boolean) = viewModel.setWirelessDisplayCertificationEnabled(enabled, context) }, @@ -1115,7 +1117,6 @@ object FeatureRegistry { }, - object : Feature( id = "Screen locked security", title = R.string.feat_screen_locked_security_title, diff --git a/app/src/main/java/com/sameerasw/essentials/domain/registry/PermissionRegistry.kt b/app/src/main/java/com/sameerasw/essentials/domain/registry/PermissionRegistry.kt index c0abf8c7c..8e60fdecc 100644 --- a/app/src/main/java/com/sameerasw/essentials/domain/registry/PermissionRegistry.kt +++ b/app/src/main/java/com/sameerasw/essentials/domain/registry/PermissionRegistry.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Domain Layer Registries + * File: PermissionRegistry.kt + * Description: Registry containing system permission declarations, intent actions, and guidance strings. + */ + package com.sameerasw.essentials.domain.registry import com.sameerasw.essentials.R @@ -30,11 +39,20 @@ fun initPermissionRegistry() { PermissionRegistry.register("WRITE_SECURE_SETTINGS", R.string.tile_developer_options) PermissionRegistry.register("WRITE_SECURE_SETTINGS", R.string.tile_charge_optimization) PermissionRegistry.register("WRITE_SECURE_SETTINGS", R.string.feat_lock_screen_clock_title) - PermissionRegistry.register("WRITE_SECURE_SETTINGS", R.string.feat_allow_overlays_in_settings_title) + PermissionRegistry.register( + "WRITE_SECURE_SETTINGS", + R.string.feat_allow_overlays_in_settings_title + ) PermissionRegistry.register("WRITE_SECURE_SETTINGS", R.string.feat_networks_title) - PermissionRegistry.register("WRITE_SECURE_SETTINGS", R.string.feat_network_download_rate_limit_title) + PermissionRegistry.register( + "WRITE_SECURE_SETTINGS", + R.string.feat_network_download_rate_limit_title + ) PermissionRegistry.register("WRITE_SECURE_SETTINGS", R.string.feat_mobile_data_always_on_title) - PermissionRegistry.register("WRITE_SECURE_SETTINGS", R.string.feat_wireless_display_certification_title) + PermissionRegistry.register( + "WRITE_SECURE_SETTINGS", + R.string.feat_wireless_display_certification_title + ) // Shizuku permission PermissionRegistry.register("SHIZUKU", R.string.feat_freeze_title) diff --git a/app/src/main/java/com/sameerasw/essentials/domain/registry/SearchRegistry.kt b/app/src/main/java/com/sameerasw/essentials/domain/registry/SearchRegistry.kt index c5b084729..13915d67c 100644 --- a/app/src/main/java/com/sameerasw/essentials/domain/registry/SearchRegistry.kt +++ b/app/src/main/java/com/sameerasw/essentials/domain/registry/SearchRegistry.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Domain Layer Registries + * File: SearchRegistry.kt + * Description: Registry indexing searchable features, settings items, and in-app action shortcuts. + */ + package com.sameerasw.essentials.domain.registry import android.content.Context diff --git a/app/src/main/java/com/sameerasw/essentials/domain/watermark/MetadataProvider.kt b/app/src/main/java/com/sameerasw/essentials/domain/watermark/MetadataProvider.kt index 97b5c5db9..3e30664de 100644 --- a/app/src/main/java/com/sameerasw/essentials/domain/watermark/MetadataProvider.kt +++ b/app/src/main/java/com/sameerasw/essentials/domain/watermark/MetadataProvider.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Domain Layer Models & Registries + * File: MetadataProvider.kt + * Description: Domain model and business logic entry for MetadataProvider.kt. + */ + package com.sameerasw.essentials.domain.watermark import android.content.Context diff --git a/app/src/main/java/com/sameerasw/essentials/domain/watermark/WatermarkEngine.kt b/app/src/main/java/com/sameerasw/essentials/domain/watermark/WatermarkEngine.kt index 2a182b637..2d3fe1b0d 100644 --- a/app/src/main/java/com/sameerasw/essentials/domain/watermark/WatermarkEngine.kt +++ b/app/src/main/java/com/sameerasw/essentials/domain/watermark/WatermarkEngine.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Domain Layer Models & Registries + * File: WatermarkEngine.kt + * Description: Domain model and business logic entry for WatermarkEngine.kt. + */ + package com.sameerasw.essentials.domain.watermark import android.content.Context diff --git a/app/src/main/java/com/sameerasw/essentials/domain/watermark/WatermarkRepository.kt b/app/src/main/java/com/sameerasw/essentials/domain/watermark/WatermarkRepository.kt index 4596cf9e8..cc077c3f8 100644 --- a/app/src/main/java/com/sameerasw/essentials/domain/watermark/WatermarkRepository.kt +++ b/app/src/main/java/com/sameerasw/essentials/domain/watermark/WatermarkRepository.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Domain Layer Models & Registries + * File: WatermarkRepository.kt + * Description: Domain model and business logic entry for WatermarkRepository.kt. + */ + package com.sameerasw.essentials.domain.watermark import android.content.Context diff --git a/app/src/main/java/com/sameerasw/essentials/external/ExternalActionReceiver.kt b/app/src/main/java/com/sameerasw/essentials/external/ExternalActionReceiver.kt index d26690a33..8094b9a5d 100644 --- a/app/src/main/java/com/sameerasw/essentials/external/ExternalActionReceiver.kt +++ b/app/src/main/java/com/sameerasw/essentials/external/ExternalActionReceiver.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: External + * File: ExternalActionReceiver.kt + * Description: Component file for ExternalActionReceiver.kt. + */ + package com.sameerasw.essentials.external import android.content.BroadcastReceiver diff --git a/app/src/main/java/com/sameerasw/essentials/external/ExternalControlProvider.kt b/app/src/main/java/com/sameerasw/essentials/external/ExternalControlProvider.kt index bae9a42a9..732a3a455 100644 --- a/app/src/main/java/com/sameerasw/essentials/external/ExternalControlProvider.kt +++ b/app/src/main/java/com/sameerasw/essentials/external/ExternalControlProvider.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: External + * File: ExternalControlProvider.kt + * Description: Component file for ExternalControlProvider.kt. + */ + package com.sameerasw.essentials.external import android.content.ContentProvider diff --git a/app/src/main/java/com/sameerasw/essentials/external/ExternalHandler.kt b/app/src/main/java/com/sameerasw/essentials/external/ExternalHandler.kt index 0b15fdd49..86b25a5e6 100644 --- a/app/src/main/java/com/sameerasw/essentials/external/ExternalHandler.kt +++ b/app/src/main/java/com/sameerasw/essentials/external/ExternalHandler.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: External + * File: ExternalHandler.kt + * Description: Component file for ExternalHandler.kt. + */ + package com.sameerasw.essentials.external import android.content.Context diff --git a/app/src/main/java/com/sameerasw/essentials/external/ExternalRouter.kt b/app/src/main/java/com/sameerasw/essentials/external/ExternalRouter.kt index 6ca92b900..cfa81cfc6 100644 --- a/app/src/main/java/com/sameerasw/essentials/external/ExternalRouter.kt +++ b/app/src/main/java/com/sameerasw/essentials/external/ExternalRouter.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: External + * File: ExternalRouter.kt + * Description: Component file for ExternalRouter.kt. + */ + package com.sameerasw.essentials.external import android.content.Context diff --git a/app/src/main/java/com/sameerasw/essentials/external/LocationAlarmExternalHandler.kt b/app/src/main/java/com/sameerasw/essentials/external/LocationAlarmExternalHandler.kt index e705052a5..07f35dbb2 100644 --- a/app/src/main/java/com/sameerasw/essentials/external/LocationAlarmExternalHandler.kt +++ b/app/src/main/java/com/sameerasw/essentials/external/LocationAlarmExternalHandler.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: External + * File: LocationAlarmExternalHandler.kt + * Description: Component file for LocationAlarmExternalHandler.kt. + */ + package com.sameerasw.essentials.external import android.content.Context diff --git a/app/src/main/java/com/sameerasw/essentials/external/SettingsExternalHandler.kt b/app/src/main/java/com/sameerasw/essentials/external/SettingsExternalHandler.kt index 4e9781c85..a7b6d6db6 100644 --- a/app/src/main/java/com/sameerasw/essentials/external/SettingsExternalHandler.kt +++ b/app/src/main/java/com/sameerasw/essentials/external/SettingsExternalHandler.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: External + * File: SettingsExternalHandler.kt + * Description: Component file for SettingsExternalHandler.kt. + */ + package com.sameerasw.essentials.external import android.content.Context diff --git a/app/src/main/java/com/sameerasw/essentials/ime/EssentialsInputMethodService.kt b/app/src/main/java/com/sameerasw/essentials/ime/EssentialsInputMethodService.kt index 5e9cbc93e..4ec62d0cd 100644 --- a/app/src/main/java/com/sameerasw/essentials/ime/EssentialsInputMethodService.kt +++ b/app/src/main/java/com/sameerasw/essentials/ime/EssentialsInputMethodService.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Ime + * File: EssentialsInputMethodService.kt + * Description: Component file for EssentialsInputMethodService.kt. + */ + package com.sameerasw.essentials.ime import android.content.ClipboardManager diff --git a/app/src/main/java/com/sameerasw/essentials/ime/KeyboardLifecycleOwner.kt b/app/src/main/java/com/sameerasw/essentials/ime/KeyboardLifecycleOwner.kt index 3f2cd316d..cf3f78379 100644 --- a/app/src/main/java/com/sameerasw/essentials/ime/KeyboardLifecycleOwner.kt +++ b/app/src/main/java/com/sameerasw/essentials/ime/KeyboardLifecycleOwner.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Ime + * File: KeyboardLifecycleOwner.kt + * Description: Component file for KeyboardLifecycleOwner.kt. + */ + package com.sameerasw.essentials.ime import androidx.lifecycle.Lifecycle diff --git a/app/src/main/java/com/sameerasw/essentials/ime/SuggestionEngine.kt b/app/src/main/java/com/sameerasw/essentials/ime/SuggestionEngine.kt index f323056a3..1a45e1d07 100644 --- a/app/src/main/java/com/sameerasw/essentials/ime/SuggestionEngine.kt +++ b/app/src/main/java/com/sameerasw/essentials/ime/SuggestionEngine.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Ime + * File: SuggestionEngine.kt + * Description: Component file for SuggestionEngine.kt. + */ + package com.sameerasw.essentials.ime import android.content.Context diff --git a/app/src/main/java/com/sameerasw/essentials/ime/UndoRedoManager.kt b/app/src/main/java/com/sameerasw/essentials/ime/UndoRedoManager.kt index 11dfd0429..55eba9512 100644 --- a/app/src/main/java/com/sameerasw/essentials/ime/UndoRedoManager.kt +++ b/app/src/main/java/com/sameerasw/essentials/ime/UndoRedoManager.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Ime + * File: UndoRedoManager.kt + * Description: Component file for UndoRedoManager.kt. + */ + package com.sameerasw.essentials.ime import android.view.inputmethod.InputConnection diff --git a/app/src/main/java/com/sameerasw/essentials/input/InputDeviceScanner.kt b/app/src/main/java/com/sameerasw/essentials/input/InputDeviceScanner.kt index 294091188..471675496 100644 --- a/app/src/main/java/com/sameerasw/essentials/input/InputDeviceScanner.kt +++ b/app/src/main/java/com/sameerasw/essentials/input/InputDeviceScanner.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Input + * File: InputDeviceScanner.kt + * Description: Component file for InputDeviceScanner.kt. + */ + package com.sameerasw.essentials.input import com.sameerasw.essentials.shizuku.ShizukuProcessHelper diff --git a/app/src/main/java/com/sameerasw/essentials/input/InputEventModels.kt b/app/src/main/java/com/sameerasw/essentials/input/InputEventModels.kt index 14b1c665d..1888bd1bd 100644 --- a/app/src/main/java/com/sameerasw/essentials/input/InputEventModels.kt +++ b/app/src/main/java/com/sameerasw/essentials/input/InputEventModels.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Input + * File: InputEventModels.kt + * Description: Component file for InputEventModels.kt. + */ + package com.sameerasw.essentials.input diff --git a/app/src/main/java/com/sameerasw/essentials/input/InputEventReader.kt b/app/src/main/java/com/sameerasw/essentials/input/InputEventReader.kt index 7eebc1844..9127596dc 100644 --- a/app/src/main/java/com/sameerasw/essentials/input/InputEventReader.kt +++ b/app/src/main/java/com/sameerasw/essentials/input/InputEventReader.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Input + * File: InputEventReader.kt + * Description: Component file for InputEventReader.kt. + */ + package com.sameerasw.essentials.input import java.io.InputStream diff --git a/app/src/main/java/com/sameerasw/essentials/input/VolumeLongPressDetector.kt b/app/src/main/java/com/sameerasw/essentials/input/VolumeLongPressDetector.kt index 9b6972e7d..262e1bc19 100644 --- a/app/src/main/java/com/sameerasw/essentials/input/VolumeLongPressDetector.kt +++ b/app/src/main/java/com/sameerasw/essentials/input/VolumeLongPressDetector.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Input + * File: VolumeLongPressDetector.kt + * Description: Component file for VolumeLongPressDetector.kt. + */ + package com.sameerasw.essentials.input import kotlinx.coroutines.CoroutineScope diff --git a/app/src/main/java/com/sameerasw/essentials/services/AppDetectionService.kt b/app/src/main/java/com/sameerasw/essentials/services/AppDetectionService.kt index 0447434dc..923988a63 100644 --- a/app/src/main/java/com/sameerasw/essentials/services/AppDetectionService.kt +++ b/app/src/main/java/com/sameerasw/essentials/services/AppDetectionService.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Background Services & Receivers + * File: AppDetectionService.kt + * Description: Background service component for AppDetectionService.kt. + */ + package com.sameerasw.essentials.services import android.app.Notification diff --git a/app/src/main/java/com/sameerasw/essentials/services/AppUpdateWorker.kt b/app/src/main/java/com/sameerasw/essentials/services/AppUpdateWorker.kt index e69fcb9f1..13abf90d2 100644 --- a/app/src/main/java/com/sameerasw/essentials/services/AppUpdateWorker.kt +++ b/app/src/main/java/com/sameerasw/essentials/services/AppUpdateWorker.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Background Services & Receivers + * File: AppUpdateWorker.kt + * Description: Background service component for AppUpdateWorker.kt. + */ + package com.sameerasw.essentials.services import android.content.Context diff --git a/app/src/main/java/com/sameerasw/essentials/services/BatteryNotificationService.kt b/app/src/main/java/com/sameerasw/essentials/services/BatteryNotificationService.kt index d6f854e9d..67fa2ec57 100644 --- a/app/src/main/java/com/sameerasw/essentials/services/BatteryNotificationService.kt +++ b/app/src/main/java/com/sameerasw/essentials/services/BatteryNotificationService.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Background Services & Receivers + * File: BatteryNotificationService.kt + * Description: Background service component for BatteryNotificationService.kt. + */ + package com.sameerasw.essentials.services import android.app.Notification diff --git a/app/src/main/java/com/sameerasw/essentials/services/CaffeinateWakeLockService.kt b/app/src/main/java/com/sameerasw/essentials/services/CaffeinateWakeLockService.kt index 325b92b38..7c84c3d7b 100644 --- a/app/src/main/java/com/sameerasw/essentials/services/CaffeinateWakeLockService.kt +++ b/app/src/main/java/com/sameerasw/essentials/services/CaffeinateWakeLockService.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Background Services & Receivers + * File: CaffeinateWakeLockService.kt + * Description: Background service component for CaffeinateWakeLockService.kt. + */ + package com.sameerasw.essentials.services import android.app.Notification diff --git a/app/src/main/java/com/sameerasw/essentials/services/CalendarSyncManager.kt b/app/src/main/java/com/sameerasw/essentials/services/CalendarSyncManager.kt index 9687b80a3..3d2242b8d 100644 --- a/app/src/main/java/com/sameerasw/essentials/services/CalendarSyncManager.kt +++ b/app/src/main/java/com/sameerasw/essentials/services/CalendarSyncManager.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Background Services & Receivers + * File: CalendarSyncManager.kt + * Description: Background service component for CalendarSyncManager.kt. + */ + package com.sameerasw.essentials.services import android.content.Context diff --git a/app/src/main/java/com/sameerasw/essentials/services/CalendarSyncWorker.kt b/app/src/main/java/com/sameerasw/essentials/services/CalendarSyncWorker.kt index bc6b1f392..d7dec9cbb 100644 --- a/app/src/main/java/com/sameerasw/essentials/services/CalendarSyncWorker.kt +++ b/app/src/main/java/com/sameerasw/essentials/services/CalendarSyncWorker.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Background Services & Receivers + * File: CalendarSyncWorker.kt + * Description: Background service component for CalendarSyncWorker.kt. + */ + package com.sameerasw.essentials.services import android.content.Context diff --git a/app/src/main/java/com/sameerasw/essentials/services/DailyWallpaperWorker.kt b/app/src/main/java/com/sameerasw/essentials/services/DailyWallpaperWorker.kt index b9bb78b7b..fb56129bc 100644 --- a/app/src/main/java/com/sameerasw/essentials/services/DailyWallpaperWorker.kt +++ b/app/src/main/java/com/sameerasw/essentials/services/DailyWallpaperWorker.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Background Services & Receivers + * File: DailyWallpaperWorker.kt + * Description: Background service component for DailyWallpaperWorker.kt. + */ + package com.sameerasw.essentials.services import android.content.Context diff --git a/app/src/main/java/com/sameerasw/essentials/services/DeviceInfoSyncManager.kt b/app/src/main/java/com/sameerasw/essentials/services/DeviceInfoSyncManager.kt index e16d136cd..02f426b38 100644 --- a/app/src/main/java/com/sameerasw/essentials/services/DeviceInfoSyncManager.kt +++ b/app/src/main/java/com/sameerasw/essentials/services/DeviceInfoSyncManager.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Background Services & Receivers + * File: DeviceInfoSyncManager.kt + * Description: Background service component for DeviceInfoSyncManager.kt. + */ + package com.sameerasw.essentials.services import android.content.Context diff --git a/app/src/main/java/com/sameerasw/essentials/services/EssentialsConditionProvider.kt b/app/src/main/java/com/sameerasw/essentials/services/EssentialsConditionProvider.kt index abb678a55..d99601523 100644 --- a/app/src/main/java/com/sameerasw/essentials/services/EssentialsConditionProvider.kt +++ b/app/src/main/java/com/sameerasw/essentials/services/EssentialsConditionProvider.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Background Services & Receivers + * File: EssentialsConditionProvider.kt + * Description: Background service component for EssentialsConditionProvider.kt. + */ + package com.sameerasw.essentials.services import android.content.ComponentName diff --git a/app/src/main/java/com/sameerasw/essentials/services/EssentialsWearableListenerService.kt b/app/src/main/java/com/sameerasw/essentials/services/EssentialsWearableListenerService.kt index e1c885f71..828918efa 100644 --- a/app/src/main/java/com/sameerasw/essentials/services/EssentialsWearableListenerService.kt +++ b/app/src/main/java/com/sameerasw/essentials/services/EssentialsWearableListenerService.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Background Services & Receivers + * File: EssentialsWearableListenerService.kt + * Description: Background service component for EssentialsWearableListenerService.kt. + */ + package com.sameerasw.essentials.services import android.content.Context diff --git a/app/src/main/java/com/sameerasw/essentials/services/InputEventListenerService.kt b/app/src/main/java/com/sameerasw/essentials/services/InputEventListenerService.kt index eb6f9030f..17d84b4b3 100644 --- a/app/src/main/java/com/sameerasw/essentials/services/InputEventListenerService.kt +++ b/app/src/main/java/com/sameerasw/essentials/services/InputEventListenerService.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Background Services & Receivers + * File: InputEventListenerService.kt + * Description: Background service component for InputEventListenerService.kt. + */ + package com.sameerasw.essentials.services import android.app.Service diff --git a/app/src/main/java/com/sameerasw/essentials/services/LiveWallpaperService.kt b/app/src/main/java/com/sameerasw/essentials/services/LiveWallpaperService.kt index e552b441d..5f61f4ff2 100644 --- a/app/src/main/java/com/sameerasw/essentials/services/LiveWallpaperService.kt +++ b/app/src/main/java/com/sameerasw/essentials/services/LiveWallpaperService.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Background Services & Receivers + * File: LiveWallpaperService.kt + * Description: Background service component for LiveWallpaperService.kt. + */ + package com.sameerasw.essentials.services import android.app.KeyguardManager diff --git a/app/src/main/java/com/sameerasw/essentials/services/LocationReachedService.kt b/app/src/main/java/com/sameerasw/essentials/services/LocationReachedService.kt index 62972b138..1787d5adc 100644 --- a/app/src/main/java/com/sameerasw/essentials/services/LocationReachedService.kt +++ b/app/src/main/java/com/sameerasw/essentials/services/LocationReachedService.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Background Services & Receivers + * File: LocationReachedService.kt + * Description: Background service component for LocationReachedService.kt. + */ + package com.sameerasw.essentials.services import android.app.Notification diff --git a/app/src/main/java/com/sameerasw/essentials/services/NotificationLightingService.kt b/app/src/main/java/com/sameerasw/essentials/services/NotificationLightingService.kt index 95dc7209a..967ad39f8 100644 --- a/app/src/main/java/com/sameerasw/essentials/services/NotificationLightingService.kt +++ b/app/src/main/java/com/sameerasw/essentials/services/NotificationLightingService.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Background Services & Receivers + * File: NotificationLightingService.kt + * Description: Background service component for NotificationLightingService.kt. + */ + package com.sameerasw.essentials.services import android.app.Notification diff --git a/app/src/main/java/com/sameerasw/essentials/services/NotificationListener.kt b/app/src/main/java/com/sameerasw/essentials/services/NotificationListener.kt index cc908c1c1..377f1124f 100644 --- a/app/src/main/java/com/sameerasw/essentials/services/NotificationListener.kt +++ b/app/src/main/java/com/sameerasw/essentials/services/NotificationListener.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Background Services & Receivers + * File: NotificationListener.kt + * Description: Background service component for NotificationListener.kt. + */ + package com.sameerasw.essentials.services import android.app.Notification diff --git a/app/src/main/java/com/sameerasw/essentials/services/ScreenOffWidgetProvider.kt b/app/src/main/java/com/sameerasw/essentials/services/ScreenOffWidgetProvider.kt index fb94c0567..e96e8cca3 100644 --- a/app/src/main/java/com/sameerasw/essentials/services/ScreenOffWidgetProvider.kt +++ b/app/src/main/java/com/sameerasw/essentials/services/ScreenOffWidgetProvider.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Background Services & Receivers + * File: ScreenOffWidgetProvider.kt + * Description: Background service component for ScreenOffWidgetProvider.kt. + */ + package com.sameerasw.essentials.services import android.app.PendingIntent diff --git a/app/src/main/java/com/sameerasw/essentials/services/automation/AutomationManager.kt b/app/src/main/java/com/sameerasw/essentials/services/automation/AutomationManager.kt index f252dceb9..12c2a89a3 100644 --- a/app/src/main/java/com/sameerasw/essentials/services/automation/AutomationManager.kt +++ b/app/src/main/java/com/sameerasw/essentials/services/automation/AutomationManager.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Background Services & Receivers + * File: AutomationManager.kt + * Description: Background service component for AutomationManager.kt. + */ + package com.sameerasw.essentials.services.automation import android.content.Context diff --git a/app/src/main/java/com/sameerasw/essentials/services/automation/AutomationService.kt b/app/src/main/java/com/sameerasw/essentials/services/automation/AutomationService.kt index 995c233b1..b7d25f2da 100644 --- a/app/src/main/java/com/sameerasw/essentials/services/automation/AutomationService.kt +++ b/app/src/main/java/com/sameerasw/essentials/services/automation/AutomationService.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Background Services & Receivers + * File: AutomationService.kt + * Description: Background service component for AutomationService.kt. + */ + package com.sameerasw.essentials.services.automation import android.app.Notification diff --git a/app/src/main/java/com/sameerasw/essentials/services/automation/executors/ActionExecutor.kt b/app/src/main/java/com/sameerasw/essentials/services/automation/executors/ActionExecutor.kt index a257bace9..c3d136b24 100644 --- a/app/src/main/java/com/sameerasw/essentials/services/automation/executors/ActionExecutor.kt +++ b/app/src/main/java/com/sameerasw/essentials/services/automation/executors/ActionExecutor.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Background Services & Receivers + * File: ActionExecutor.kt + * Description: Background service component for ActionExecutor.kt. + */ + package com.sameerasw.essentials.services.automation.executors import android.content.Context diff --git a/app/src/main/java/com/sameerasw/essentials/services/automation/executors/CombinedActionExecutor.kt b/app/src/main/java/com/sameerasw/essentials/services/automation/executors/CombinedActionExecutor.kt index 8911ecbfa..b5fcc13f9 100644 --- a/app/src/main/java/com/sameerasw/essentials/services/automation/executors/CombinedActionExecutor.kt +++ b/app/src/main/java/com/sameerasw/essentials/services/automation/executors/CombinedActionExecutor.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Background Services & Receivers + * File: CombinedActionExecutor.kt + * Description: Background service component for CombinedActionExecutor.kt. + */ + package com.sameerasw.essentials.services.automation.executors import android.app.ActivityManager @@ -331,14 +340,21 @@ object CombinedActionExecutor { } is Action.SometimesEssentials -> { - val repository = com.sameerasw.essentials.data.repository.SettingsRepository(context) + val repository = + com.sameerasw.essentials.data.repository.SettingsRepository(context) if (action.changeNotificationLighting) { - repository.putBoolean(com.sameerasw.essentials.data.repository.SettingsRepository.KEY_EDGE_LIGHTING_ENABLED, action.notificationLightingEnabled) + repository.putBoolean( + com.sameerasw.essentials.data.repository.SettingsRepository.KEY_EDGE_LIGHTING_ENABLED, + action.notificationLightingEnabled + ) } if (action.changeFlashlightPulse) { - repository.putBoolean(com.sameerasw.essentials.data.repository.SettingsRepository.KEY_FLASHLIGHT_PULSE_ENABLED, action.flashlightPulseEnabled) + repository.putBoolean( + com.sameerasw.essentials.data.repository.SettingsRepository.KEY_FLASHLIGHT_PULSE_ENABLED, + action.flashlightPulseEnabled + ) } if (action.changeBatteryNotification) { @@ -346,22 +362,45 @@ object CombinedActionExecutor { } if (action.changeSmartPixels) { - repository.putBoolean(com.sameerasw.essentials.data.repository.SettingsRepository.KEY_SMART_PIXELS_ENABLED, action.smartPixelsEnabled) + repository.putBoolean( + com.sameerasw.essentials.data.repository.SettingsRepository.KEY_SMART_PIXELS_ENABLED, + action.smartPixelsEnabled + ) } if (action.changeEssentialsOnDisplay) { when (action.essentialsOnDisplayMode) { "Off" -> { - repository.putBoolean(com.sameerasw.essentials.data.repository.SettingsRepository.KEY_AMBIENT_MUSIC_GLANCE_ENABLED, false) - repository.putBoolean(com.sameerasw.essentials.data.repository.SettingsRepository.KEY_AMBIENT_MUSIC_GLANCE_DOCKED_MODE, false) + repository.putBoolean( + com.sameerasw.essentials.data.repository.SettingsRepository.KEY_AMBIENT_MUSIC_GLANCE_ENABLED, + false + ) + repository.putBoolean( + com.sameerasw.essentials.data.repository.SettingsRepository.KEY_AMBIENT_MUSIC_GLANCE_DOCKED_MODE, + false + ) } + "On" -> { - repository.putBoolean(com.sameerasw.essentials.data.repository.SettingsRepository.KEY_AMBIENT_MUSIC_GLANCE_ENABLED, true) - repository.putBoolean(com.sameerasw.essentials.data.repository.SettingsRepository.KEY_AMBIENT_MUSIC_GLANCE_DOCKED_MODE, false) + repository.putBoolean( + com.sameerasw.essentials.data.repository.SettingsRepository.KEY_AMBIENT_MUSIC_GLANCE_ENABLED, + true + ) + repository.putBoolean( + com.sameerasw.essentials.data.repository.SettingsRepository.KEY_AMBIENT_MUSIC_GLANCE_DOCKED_MODE, + false + ) } + "Docked" -> { - repository.putBoolean(com.sameerasw.essentials.data.repository.SettingsRepository.KEY_AMBIENT_MUSIC_GLANCE_ENABLED, true) - repository.putBoolean(com.sameerasw.essentials.data.repository.SettingsRepository.KEY_AMBIENT_MUSIC_GLANCE_DOCKED_MODE, true) + repository.putBoolean( + com.sameerasw.essentials.data.repository.SettingsRepository.KEY_AMBIENT_MUSIC_GLANCE_ENABLED, + true + ) + repository.putBoolean( + com.sameerasw.essentials.data.repository.SettingsRepository.KEY_AMBIENT_MUSIC_GLANCE_DOCKED_MODE, + true + ) } } } @@ -370,15 +409,26 @@ object CombinedActionExecutor { when (action.alwaysOnDisplayMode) { "Off" -> { repository.setAodEnabled(false) - repository.putBoolean(com.sameerasw.essentials.data.repository.SettingsRepository.KEY_AOD_FORCE_TURN_OFF_ENABLED, false) + repository.putBoolean( + com.sameerasw.essentials.data.repository.SettingsRepository.KEY_AOD_FORCE_TURN_OFF_ENABLED, + false + ) } + "On" -> { repository.setAodEnabled(true) - repository.putBoolean(com.sameerasw.essentials.data.repository.SettingsRepository.KEY_AOD_FORCE_TURN_OFF_ENABLED, false) + repository.putBoolean( + com.sameerasw.essentials.data.repository.SettingsRepository.KEY_AOD_FORCE_TURN_OFF_ENABLED, + false + ) } + "Dynamic" -> { repository.setAodEnabled(true) - repository.putBoolean(com.sameerasw.essentials.data.repository.SettingsRepository.KEY_AOD_FORCE_TURN_OFF_ENABLED, true) + repository.putBoolean( + com.sameerasw.essentials.data.repository.SettingsRepository.KEY_AOD_FORCE_TURN_OFF_ENABLED, + true + ) } } } @@ -391,9 +441,18 @@ object CombinedActionExecutor { repository.setScaleAnimationsMode(newMode) repository.setFontScale(profile.fontScale) repository.setFontWeight(profile.fontWeight) - repository.setAnimationScale(android.provider.Settings.Global.ANIMATOR_DURATION_SCALE, profile.animatorDurationScale) - repository.setAnimationScale(android.provider.Settings.Global.TRANSITION_ANIMATION_SCALE, profile.transitionAnimationScale) - repository.setAnimationScale(android.provider.Settings.Global.WINDOW_ANIMATION_SCALE, profile.windowAnimationScale) + repository.setAnimationScale( + android.provider.Settings.Global.ANIMATOR_DURATION_SCALE, + profile.animatorDurationScale + ) + repository.setAnimationScale( + android.provider.Settings.Global.TRANSITION_ANIMATION_SCALE, + profile.transitionAnimationScale + ) + repository.setAnimationScale( + android.provider.Settings.Global.WINDOW_ANIMATION_SCALE, + profile.windowAnimationScale + ) repository.setSmallestWidth(profile.smallestWidth) repository.setTouchSensitivityEnabled(profile.touchSensitivityEnabled) repository.setAutoRotateEnabled(profile.autoRotateEnabled) @@ -405,7 +464,11 @@ object CombinedActionExecutor { val key = "lock_screen_custom_clock_face" val value = "{\"clockId\":\"${action.lockScreenClockStyle}\"}" val success = try { - android.provider.Settings.Secure.putString(context.contentResolver, key, value) + android.provider.Settings.Secure.putString( + context.contentResolver, + key, + value + ) } catch (e: Exception) { false } @@ -416,13 +479,18 @@ object CombinedActionExecutor { } if (action.changeSyncSoundModeWatch) { - val prefs = context.getSharedPreferences("essentials_prefs", Context.MODE_PRIVATE) - prefs.edit().putBoolean("watch_sync_sound_mode_enabled", action.syncSoundModeWatchEnabled).apply() + val prefs = + context.getSharedPreferences("essentials_prefs", Context.MODE_PRIVATE) + prefs.edit().putBoolean( + "watch_sync_sound_mode_enabled", + action.syncSoundModeWatchEnabled + ).apply() } } is Action.FreezeTag -> { - val repository = com.sameerasw.essentials.data.repository.SettingsRepository(context) + val repository = + com.sameerasw.essentials.data.repository.SettingsRepository(context) val appTagMap = repository.getFreezeAppTagMap() val selectedTags = action.tagIds.toSet() @@ -435,7 +503,10 @@ object CombinedActionExecutor { if (action.mode == "Freeze") { com.sameerasw.essentials.utils.FreezeManager.freezeApp(context, pkg) } else { - com.sameerasw.essentials.utils.FreezeManager.unfreezeApp(context, pkg) + com.sameerasw.essentials.utils.FreezeManager.unfreezeApp( + context, + pkg + ) } } } diff --git a/app/src/main/java/com/sameerasw/essentials/services/automation/modules/AutomationModule.kt b/app/src/main/java/com/sameerasw/essentials/services/automation/modules/AutomationModule.kt index 1a2768278..ec979f1bf 100644 --- a/app/src/main/java/com/sameerasw/essentials/services/automation/modules/AutomationModule.kt +++ b/app/src/main/java/com/sameerasw/essentials/services/automation/modules/AutomationModule.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Background Services & Receivers + * File: AutomationModule.kt + * Description: Background service component for AutomationModule.kt. + */ + package com.sameerasw.essentials.services.automation.modules import android.content.Context diff --git a/app/src/main/java/com/sameerasw/essentials/services/automation/modules/BluetoothModule.kt b/app/src/main/java/com/sameerasw/essentials/services/automation/modules/BluetoothModule.kt index 1134a85df..c1187e193 100644 --- a/app/src/main/java/com/sameerasw/essentials/services/automation/modules/BluetoothModule.kt +++ b/app/src/main/java/com/sameerasw/essentials/services/automation/modules/BluetoothModule.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Background Services & Receivers + * File: BluetoothModule.kt + * Description: Background service component for BluetoothModule.kt. + */ + package com.sameerasw.essentials.services.automation.modules import android.annotation.SuppressLint diff --git a/app/src/main/java/com/sameerasw/essentials/services/automation/modules/DisplayModule.kt b/app/src/main/java/com/sameerasw/essentials/services/automation/modules/DisplayModule.kt index d4aa1b720..204d76caa 100644 --- a/app/src/main/java/com/sameerasw/essentials/services/automation/modules/DisplayModule.kt +++ b/app/src/main/java/com/sameerasw/essentials/services/automation/modules/DisplayModule.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Background Services & Receivers + * File: DisplayModule.kt + * Description: Background service component for DisplayModule.kt. + */ + package com.sameerasw.essentials.services.automation.modules import android.content.BroadcastReceiver diff --git a/app/src/main/java/com/sameerasw/essentials/services/automation/modules/PowerModule.kt b/app/src/main/java/com/sameerasw/essentials/services/automation/modules/PowerModule.kt index 4fc1e0c97..5de65bb4f 100644 --- a/app/src/main/java/com/sameerasw/essentials/services/automation/modules/PowerModule.kt +++ b/app/src/main/java/com/sameerasw/essentials/services/automation/modules/PowerModule.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Background Services & Receivers + * File: PowerModule.kt + * Description: Background service component for PowerModule.kt. + */ + package com.sameerasw.essentials.services.automation.modules import android.content.BroadcastReceiver diff --git a/app/src/main/java/com/sameerasw/essentials/services/automation/modules/TimeModule.kt b/app/src/main/java/com/sameerasw/essentials/services/automation/modules/TimeModule.kt index 4c9ac85de..c2c229976 100644 --- a/app/src/main/java/com/sameerasw/essentials/services/automation/modules/TimeModule.kt +++ b/app/src/main/java/com/sameerasw/essentials/services/automation/modules/TimeModule.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Background Services & Receivers + * File: TimeModule.kt + * Description: Background service component for TimeModule.kt. + */ + package com.sameerasw.essentials.services.automation.modules import android.app.AlarmManager diff --git a/app/src/main/java/com/sameerasw/essentials/services/automation/modules/WifiModule.kt b/app/src/main/java/com/sameerasw/essentials/services/automation/modules/WifiModule.kt index 8e9a45ab8..9ee80e235 100644 --- a/app/src/main/java/com/sameerasw/essentials/services/automation/modules/WifiModule.kt +++ b/app/src/main/java/com/sameerasw/essentials/services/automation/modules/WifiModule.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Background Services & Receivers + * File: WifiModule.kt + * Description: Background service component for WifiModule.kt. + */ + package com.sameerasw.essentials.services.automation.modules import android.content.Context diff --git a/app/src/main/java/com/sameerasw/essentials/services/automation/receivers/TimeAutomationReceiver.kt b/app/src/main/java/com/sameerasw/essentials/services/automation/receivers/TimeAutomationReceiver.kt index f54389cf6..773a28228 100644 --- a/app/src/main/java/com/sameerasw/essentials/services/automation/receivers/TimeAutomationReceiver.kt +++ b/app/src/main/java/com/sameerasw/essentials/services/automation/receivers/TimeAutomationReceiver.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Background Services & Receivers + * File: TimeAutomationReceiver.kt + * Description: Background service component for TimeAutomationReceiver.kt. + */ + package com.sameerasw.essentials.services.automation.receivers import android.content.BroadcastReceiver diff --git a/app/src/main/java/com/sameerasw/essentials/services/dreams/AmbientDreamService.kt b/app/src/main/java/com/sameerasw/essentials/services/dreams/AmbientDreamService.kt index 4ddffd80f..66b4b2f46 100644 --- a/app/src/main/java/com/sameerasw/essentials/services/dreams/AmbientDreamService.kt +++ b/app/src/main/java/com/sameerasw/essentials/services/dreams/AmbientDreamService.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Background Services & Receivers + * File: AmbientDreamService.kt + * Description: Background service component for AmbientDreamService.kt. + */ + package com.sameerasw.essentials.services.dreams import android.content.BroadcastReceiver diff --git a/app/src/main/java/com/sameerasw/essentials/services/handlers/AmbientGlanceHandler.kt b/app/src/main/java/com/sameerasw/essentials/services/handlers/AmbientGlanceHandler.kt index e67634b3d..d4da5b706 100644 --- a/app/src/main/java/com/sameerasw/essentials/services/handlers/AmbientGlanceHandler.kt +++ b/app/src/main/java/com/sameerasw/essentials/services/handlers/AmbientGlanceHandler.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Background Services & Receivers + * File: AmbientGlanceHandler.kt + * Description: Background service component for AmbientGlanceHandler.kt. + */ + package com.sameerasw.essentials.services.handlers import android.accessibilityservice.AccessibilityService diff --git a/app/src/main/java/com/sameerasw/essentials/services/handlers/AodForceTurnOffHandler.kt b/app/src/main/java/com/sameerasw/essentials/services/handlers/AodForceTurnOffHandler.kt index 98bc44fe8..fa365e777 100644 --- a/app/src/main/java/com/sameerasw/essentials/services/handlers/AodForceTurnOffHandler.kt +++ b/app/src/main/java/com/sameerasw/essentials/services/handlers/AodForceTurnOffHandler.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Background Services & Receivers + * File: AodForceTurnOffHandler.kt + * Description: Background service component for AodForceTurnOffHandler.kt. + */ + package com.sameerasw.essentials.services.handlers import android.accessibilityservice.AccessibilityService diff --git a/app/src/main/java/com/sameerasw/essentials/services/handlers/AppFlowHandler.kt b/app/src/main/java/com/sameerasw/essentials/services/handlers/AppFlowHandler.kt index 1a6b75f94..b33687719 100644 --- a/app/src/main/java/com/sameerasw/essentials/services/handlers/AppFlowHandler.kt +++ b/app/src/main/java/com/sameerasw/essentials/services/handlers/AppFlowHandler.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Background Services & Receivers + * File: AppFlowHandler.kt + * Description: Background service component for AppFlowHandler.kt. + */ + package com.sameerasw.essentials.services.handlers import android.accessibilityservice.AccessibilityService diff --git a/app/src/main/java/com/sameerasw/essentials/services/handlers/ButtonRemapHandler.kt b/app/src/main/java/com/sameerasw/essentials/services/handlers/ButtonRemapHandler.kt index db206b08b..47026ba56 100644 --- a/app/src/main/java/com/sameerasw/essentials/services/handlers/ButtonRemapHandler.kt +++ b/app/src/main/java/com/sameerasw/essentials/services/handlers/ButtonRemapHandler.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Background Services & Receivers + * File: ButtonRemapHandler.kt + * Description: Background service component for ButtonRemapHandler.kt. + */ + package com.sameerasw.essentials.services.handlers import android.accessibilityservice.AccessibilityService diff --git a/app/src/main/java/com/sameerasw/essentials/services/handlers/FlashlightHandler.kt b/app/src/main/java/com/sameerasw/essentials/services/handlers/FlashlightHandler.kt index 4e4c91feb..30d73c830 100644 --- a/app/src/main/java/com/sameerasw/essentials/services/handlers/FlashlightHandler.kt +++ b/app/src/main/java/com/sameerasw/essentials/services/handlers/FlashlightHandler.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Background Services & Receivers + * File: FlashlightHandler.kt + * Description: Background service component for FlashlightHandler.kt. + */ + package com.sameerasw.essentials.services.handlers import android.accessibilityservice.AccessibilityService @@ -119,7 +128,10 @@ class FlashlightHandler( fun register() { if (com.sameerasw.essentials.utils.DeviceUtils.isTclDevice()) { - Log.w("Flashlight", "Disabling flashlight handler callbacks on TCL device to prevent HAL lock issue") + Log.w( + "Flashlight", + "Disabling flashlight handler callbacks on TCL device to prevent HAL lock issue" + ) return } torchCallback.let { cameraManager.registerTorchCallback(it, handler) } diff --git a/app/src/main/java/com/sameerasw/essentials/services/handlers/NotificationLightingHandler.kt b/app/src/main/java/com/sameerasw/essentials/services/handlers/NotificationLightingHandler.kt index 899bf5567..86af9cae2 100644 --- a/app/src/main/java/com/sameerasw/essentials/services/handlers/NotificationLightingHandler.kt +++ b/app/src/main/java/com/sameerasw/essentials/services/handlers/NotificationLightingHandler.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Background Services & Receivers + * File: NotificationLightingHandler.kt + * Description: Background service component for NotificationLightingHandler.kt. + */ + package com.sameerasw.essentials.services.handlers import android.accessibilityservice.AccessibilityService diff --git a/app/src/main/java/com/sameerasw/essentials/services/handlers/OmniGestureOverlayHandler.kt b/app/src/main/java/com/sameerasw/essentials/services/handlers/OmniGestureOverlayHandler.kt index d2a2311f8..1524e0247 100644 --- a/app/src/main/java/com/sameerasw/essentials/services/handlers/OmniGestureOverlayHandler.kt +++ b/app/src/main/java/com/sameerasw/essentials/services/handlers/OmniGestureOverlayHandler.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Background Services & Receivers + * File: OmniGestureOverlayHandler.kt + * Description: Background service component for OmniGestureOverlayHandler.kt. + */ + package com.sameerasw.essentials.services.handlers import android.accessibilityservice.AccessibilityService diff --git a/app/src/main/java/com/sameerasw/essentials/services/handlers/PocketModeHandler.kt b/app/src/main/java/com/sameerasw/essentials/services/handlers/PocketModeHandler.kt index 9a9bd1aa7..eaa7e3111 100644 --- a/app/src/main/java/com/sameerasw/essentials/services/handlers/PocketModeHandler.kt +++ b/app/src/main/java/com/sameerasw/essentials/services/handlers/PocketModeHandler.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Background Services & Receivers + * File: PocketModeHandler.kt + * Description: Background service component for PocketModeHandler.kt. + */ + package com.sameerasw.essentials.services.handlers import android.accessibilityservice.AccessibilityService diff --git a/app/src/main/java/com/sameerasw/essentials/services/handlers/SmartPixelsHandler.kt b/app/src/main/java/com/sameerasw/essentials/services/handlers/SmartPixelsHandler.kt index 26229be1b..e5436e589 100644 --- a/app/src/main/java/com/sameerasw/essentials/services/handlers/SmartPixelsHandler.kt +++ b/app/src/main/java/com/sameerasw/essentials/services/handlers/SmartPixelsHandler.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Background Services & Receivers + * File: SmartPixelsHandler.kt + * Description: Background service component for SmartPixelsHandler.kt. + */ + package com.sameerasw.essentials.services.handlers import android.accessibilityservice.AccessibilityService @@ -18,11 +27,15 @@ class SmartPixelsHandler(private val service: AccessibilityService) { private var isOverlayAdded = false private val prefs by lazy { - service.getSharedPreferences(SettingsRepository.PREFS_NAME, AccessibilityService.MODE_PRIVATE) + service.getSharedPreferences( + SettingsRepository.PREFS_NAME, + AccessibilityService.MODE_PRIVATE + ) } fun init() { - windowManager = service.getSystemService(AccessibilityService.WINDOW_SERVICE) as? WindowManager + windowManager = + service.getSystemService(AccessibilityService.WINDOW_SERVICE) as? WindowManager updateState() } @@ -80,7 +93,11 @@ class SmartPixelsHandler(private val service: AccessibilityService) { try { windowManager?.removeView(overlayView) } catch (e: Exception) { - Log.e("SmartPixelsHandler", "Failed to remove Smart Pixels accessibility overlay", e) + Log.e( + "SmartPixelsHandler", + "Failed to remove Smart Pixels accessibility overlay", + e + ) } isOverlayAdded = false } diff --git a/app/src/main/java/com/sameerasw/essentials/services/handlers/SoundModeHandler.kt b/app/src/main/java/com/sameerasw/essentials/services/handlers/SoundModeHandler.kt index e79abe352..d6ef65d95 100644 --- a/app/src/main/java/com/sameerasw/essentials/services/handlers/SoundModeHandler.kt +++ b/app/src/main/java/com/sameerasw/essentials/services/handlers/SoundModeHandler.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Background Services & Receivers + * File: SoundModeHandler.kt + * Description: Background service component for SoundModeHandler.kt. + */ + package com.sameerasw.essentials.services.handlers import android.app.NotificationManager diff --git a/app/src/main/java/com/sameerasw/essentials/services/handlers/StatusBarIconHandler.kt b/app/src/main/java/com/sameerasw/essentials/services/handlers/StatusBarIconHandler.kt index a04e4b54e..bf19cd583 100644 --- a/app/src/main/java/com/sameerasw/essentials/services/handlers/StatusBarIconHandler.kt +++ b/app/src/main/java/com/sameerasw/essentials/services/handlers/StatusBarIconHandler.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Background Services & Receivers + * File: StatusBarIconHandler.kt + * Description: Background service component for StatusBarIconHandler.kt. + */ + package com.sameerasw.essentials.services.handlers import android.content.BroadcastReceiver @@ -11,7 +20,7 @@ import android.os.BatteryManager import android.provider.Settings import android.telephony.TelephonyManager import com.sameerasw.essentials.domain.StatusBarIconRegistry -import com.sameerasw.essentials.ui.components.pickers.NetworkType +import com.sameerasw.essentials.ui.core.pickers.NetworkType import com.sameerasw.essentials.utils.updateIconBlacklistSetting import com.sameerasw.essentials.viewmodels.StatusBarIconViewModel import kotlinx.coroutines.CoroutineScope diff --git a/app/src/main/java/com/sameerasw/essentials/services/receivers/AirSyncBridgeReceiver.kt b/app/src/main/java/com/sameerasw/essentials/services/receivers/AirSyncBridgeReceiver.kt index 807cde65c..5da019c70 100644 --- a/app/src/main/java/com/sameerasw/essentials/services/receivers/AirSyncBridgeReceiver.kt +++ b/app/src/main/java/com/sameerasw/essentials/services/receivers/AirSyncBridgeReceiver.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Background Services & Receivers + * File: AirSyncBridgeReceiver.kt + * Description: Background service component for AirSyncBridgeReceiver.kt. + */ + package com.sameerasw.essentials.services.receivers import android.content.BroadcastReceiver diff --git a/app/src/main/java/com/sameerasw/essentials/services/receivers/AppBootReceiver.kt b/app/src/main/java/com/sameerasw/essentials/services/receivers/AppBootReceiver.kt index 2e449c6e0..1c8eed75a 100644 --- a/app/src/main/java/com/sameerasw/essentials/services/receivers/AppBootReceiver.kt +++ b/app/src/main/java/com/sameerasw/essentials/services/receivers/AppBootReceiver.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Background Services & Receivers + * File: AppBootReceiver.kt + * Description: Background service component for AppBootReceiver.kt. + */ + package com.sameerasw.essentials.services.receivers import android.content.BroadcastReceiver diff --git a/app/src/main/java/com/sameerasw/essentials/services/receivers/BatteryAutomationReceiver.kt b/app/src/main/java/com/sameerasw/essentials/services/receivers/BatteryAutomationReceiver.kt index 97052e871..d6a37ccb4 100644 --- a/app/src/main/java/com/sameerasw/essentials/services/receivers/BatteryAutomationReceiver.kt +++ b/app/src/main/java/com/sameerasw/essentials/services/receivers/BatteryAutomationReceiver.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Background Services & Receivers + * File: BatteryAutomationReceiver.kt + * Description: Background service component for BatteryAutomationReceiver.kt. + */ + package com.sameerasw.essentials.services.receivers import android.content.BroadcastReceiver diff --git a/app/src/main/java/com/sameerasw/essentials/services/receivers/CallVibrationReceiver.kt b/app/src/main/java/com/sameerasw/essentials/services/receivers/CallVibrationReceiver.kt index 13cb0ba4d..fa3fd06bf 100644 --- a/app/src/main/java/com/sameerasw/essentials/services/receivers/CallVibrationReceiver.kt +++ b/app/src/main/java/com/sameerasw/essentials/services/receivers/CallVibrationReceiver.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Background Services & Receivers + * File: CallVibrationReceiver.kt + * Description: Background service component for CallVibrationReceiver.kt. + */ + package com.sameerasw.essentials.services.receivers import android.content.BroadcastReceiver diff --git a/app/src/main/java/com/sameerasw/essentials/services/receivers/DownloadUpdateReceiver.kt b/app/src/main/java/com/sameerasw/essentials/services/receivers/DownloadUpdateReceiver.kt index e39fa3e8f..4b21341db 100644 --- a/app/src/main/java/com/sameerasw/essentials/services/receivers/DownloadUpdateReceiver.kt +++ b/app/src/main/java/com/sameerasw/essentials/services/receivers/DownloadUpdateReceiver.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Background Services & Receivers + * File: DownloadUpdateReceiver.kt + * Description: Background service component for DownloadUpdateReceiver.kt. + */ + package com.sameerasw.essentials.services.receivers import android.content.BroadcastReceiver diff --git a/app/src/main/java/com/sameerasw/essentials/services/receivers/FlashlightActionReceiver.kt b/app/src/main/java/com/sameerasw/essentials/services/receivers/FlashlightActionReceiver.kt index c35e61fe8..f689d9054 100644 --- a/app/src/main/java/com/sameerasw/essentials/services/receivers/FlashlightActionReceiver.kt +++ b/app/src/main/java/com/sameerasw/essentials/services/receivers/FlashlightActionReceiver.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Background Services & Receivers + * File: FlashlightActionReceiver.kt + * Description: Background service component for FlashlightActionReceiver.kt. + */ + package com.sameerasw.essentials.services.receivers import android.content.BroadcastReceiver diff --git a/app/src/main/java/com/sameerasw/essentials/services/receivers/QsTileActionRouter.kt b/app/src/main/java/com/sameerasw/essentials/services/receivers/QsTileActionRouter.kt index 31f33dbe7..cf3d33423 100644 --- a/app/src/main/java/com/sameerasw/essentials/services/receivers/QsTileActionRouter.kt +++ b/app/src/main/java/com/sameerasw/essentials/services/receivers/QsTileActionRouter.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Background Services & Receivers + * File: QsTileActionRouter.kt + * Description: Background service component for QsTileActionRouter.kt. + */ + package com.sameerasw.essentials.services.receivers import android.content.BroadcastReceiver diff --git a/app/src/main/java/com/sameerasw/essentials/services/receivers/SecurityDeviceAdminReceiver.kt b/app/src/main/java/com/sameerasw/essentials/services/receivers/SecurityDeviceAdminReceiver.kt index dc47055b0..478327c39 100644 --- a/app/src/main/java/com/sameerasw/essentials/services/receivers/SecurityDeviceAdminReceiver.kt +++ b/app/src/main/java/com/sameerasw/essentials/services/receivers/SecurityDeviceAdminReceiver.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Background Services & Receivers + * File: SecurityDeviceAdminReceiver.kt + * Description: Background service component for SecurityDeviceAdminReceiver.kt. + */ + package com.sameerasw.essentials.services.receivers import android.app.admin.DeviceAdminReceiver diff --git a/app/src/main/java/com/sameerasw/essentials/services/receivers/SecurityReceiver.kt b/app/src/main/java/com/sameerasw/essentials/services/receivers/SecurityReceiver.kt index e8b053ff2..3822d8e20 100644 --- a/app/src/main/java/com/sameerasw/essentials/services/receivers/SecurityReceiver.kt +++ b/app/src/main/java/com/sameerasw/essentials/services/receivers/SecurityReceiver.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Background Services & Receivers + * File: SecurityReceiver.kt + * Description: Background service component for SecurityReceiver.kt. + */ + package com.sameerasw.essentials.services.receivers import android.content.BroadcastReceiver diff --git a/app/src/main/java/com/sameerasw/essentials/services/receivers/ShizukuActionReceiver.kt b/app/src/main/java/com/sameerasw/essentials/services/receivers/ShizukuActionReceiver.kt index 0627d8fe6..502ec652f 100644 --- a/app/src/main/java/com/sameerasw/essentials/services/receivers/ShizukuActionReceiver.kt +++ b/app/src/main/java/com/sameerasw/essentials/services/receivers/ShizukuActionReceiver.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Background Services & Receivers + * File: ShizukuActionReceiver.kt + * Description: Background service component for ShizukuActionReceiver.kt. + */ + package com.sameerasw.essentials.services.receivers import android.app.NotificationManager diff --git a/app/src/main/java/com/sameerasw/essentials/services/receivers/StatusBarAutomationReceiver.kt b/app/src/main/java/com/sameerasw/essentials/services/receivers/StatusBarAutomationReceiver.kt index 6b8f1372f..4dd5b009b 100644 --- a/app/src/main/java/com/sameerasw/essentials/services/receivers/StatusBarAutomationReceiver.kt +++ b/app/src/main/java/com/sameerasw/essentials/services/receivers/StatusBarAutomationReceiver.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Background Services & Receivers + * File: StatusBarAutomationReceiver.kt + * Description: Background service component for StatusBarAutomationReceiver.kt. + */ + package com.sameerasw.essentials.services.receivers import android.content.BroadcastReceiver diff --git a/app/src/main/java/com/sameerasw/essentials/services/tiles/AdaptiveBrightnessTileService.kt b/app/src/main/java/com/sameerasw/essentials/services/tiles/AdaptiveBrightnessTileService.kt index 69b5c2ea6..f5632102d 100644 --- a/app/src/main/java/com/sameerasw/essentials/services/tiles/AdaptiveBrightnessTileService.kt +++ b/app/src/main/java/com/sameerasw/essentials/services/tiles/AdaptiveBrightnessTileService.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Background Services & Receivers + * File: AdaptiveBrightnessTileService.kt + * Description: Background service component for AdaptiveBrightnessTileService.kt. + */ + package com.sameerasw.essentials.services.tiles import android.content.Intent diff --git a/app/src/main/java/com/sameerasw/essentials/services/tiles/AlwaysOnDisplayTileService.kt b/app/src/main/java/com/sameerasw/essentials/services/tiles/AlwaysOnDisplayTileService.kt index 89686b17e..6fb4e7fb1 100644 --- a/app/src/main/java/com/sameerasw/essentials/services/tiles/AlwaysOnDisplayTileService.kt +++ b/app/src/main/java/com/sameerasw/essentials/services/tiles/AlwaysOnDisplayTileService.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Background Services & Receivers + * File: AlwaysOnDisplayTileService.kt + * Description: Background service component for AlwaysOnDisplayTileService.kt. + */ + package com.sameerasw.essentials.services.tiles import android.graphics.drawable.Icon diff --git a/app/src/main/java/com/sameerasw/essentials/services/tiles/AppFreezingTileService.kt b/app/src/main/java/com/sameerasw/essentials/services/tiles/AppFreezingTileService.kt index c3fd6ea11..dfc4cdba2 100644 --- a/app/src/main/java/com/sameerasw/essentials/services/tiles/AppFreezingTileService.kt +++ b/app/src/main/java/com/sameerasw/essentials/services/tiles/AppFreezingTileService.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Background Services & Receivers + * File: AppFreezingTileService.kt + * Description: Background service component for AppFreezingTileService.kt. + */ + package com.sameerasw.essentials.services.tiles import android.app.PendingIntent diff --git a/app/src/main/java/com/sameerasw/essentials/services/tiles/AppLockTileService.kt b/app/src/main/java/com/sameerasw/essentials/services/tiles/AppLockTileService.kt index 3d8234d74..aee2de130 100644 --- a/app/src/main/java/com/sameerasw/essentials/services/tiles/AppLockTileService.kt +++ b/app/src/main/java/com/sameerasw/essentials/services/tiles/AppLockTileService.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Background Services & Receivers + * File: AppLockTileService.kt + * Description: Background service component for AppLockTileService.kt. + */ + package com.sameerasw.essentials.services.tiles import android.app.PendingIntent diff --git a/app/src/main/java/com/sameerasw/essentials/services/tiles/BaseTileService.kt b/app/src/main/java/com/sameerasw/essentials/services/tiles/BaseTileService.kt index 82d265879..710c66532 100644 --- a/app/src/main/java/com/sameerasw/essentials/services/tiles/BaseTileService.kt +++ b/app/src/main/java/com/sameerasw/essentials/services/tiles/BaseTileService.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Background Services & Receivers + * File: BaseTileService.kt + * Description: Background service component for BaseTileService.kt. + */ + package com.sameerasw.essentials.services.tiles import android.graphics.drawable.Icon diff --git a/app/src/main/java/com/sameerasw/essentials/services/tiles/BatteryNotificationTileService.kt b/app/src/main/java/com/sameerasw/essentials/services/tiles/BatteryNotificationTileService.kt index 561a82437..43a177371 100644 --- a/app/src/main/java/com/sameerasw/essentials/services/tiles/BatteryNotificationTileService.kt +++ b/app/src/main/java/com/sameerasw/essentials/services/tiles/BatteryNotificationTileService.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Background Services & Receivers + * File: BatteryNotificationTileService.kt + * Description: Background service component for BatteryNotificationTileService.kt. + */ + package com.sameerasw.essentials.services.tiles import android.content.Intent diff --git a/app/src/main/java/com/sameerasw/essentials/services/tiles/BubblesTileService.kt b/app/src/main/java/com/sameerasw/essentials/services/tiles/BubblesTileService.kt index 7a256e33c..026b2f8e5 100644 --- a/app/src/main/java/com/sameerasw/essentials/services/tiles/BubblesTileService.kt +++ b/app/src/main/java/com/sameerasw/essentials/services/tiles/BubblesTileService.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Background Services & Receivers + * File: BubblesTileService.kt + * Description: Background service component for BubblesTileService.kt. + */ + package com.sameerasw.essentials.services.tiles import android.Manifest diff --git a/app/src/main/java/com/sameerasw/essentials/services/tiles/CaffeinateTileService.kt b/app/src/main/java/com/sameerasw/essentials/services/tiles/CaffeinateTileService.kt index b144b8d55..e81bd6d55 100644 --- a/app/src/main/java/com/sameerasw/essentials/services/tiles/CaffeinateTileService.kt +++ b/app/src/main/java/com/sameerasw/essentials/services/tiles/CaffeinateTileService.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Background Services & Receivers + * File: CaffeinateTileService.kt + * Description: Background service component for CaffeinateTileService.kt. + */ + package com.sameerasw.essentials.services.tiles import android.app.ActivityManager diff --git a/app/src/main/java/com/sameerasw/essentials/services/tiles/ChargeQuickTileService.kt b/app/src/main/java/com/sameerasw/essentials/services/tiles/ChargeQuickTileService.kt index e694d3caa..834e1885f 100644 --- a/app/src/main/java/com/sameerasw/essentials/services/tiles/ChargeQuickTileService.kt +++ b/app/src/main/java/com/sameerasw/essentials/services/tiles/ChargeQuickTileService.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Background Services & Receivers + * File: ChargeQuickTileService.kt + * Description: Background service component for ChargeQuickTileService.kt. + */ + package com.sameerasw.essentials.services.tiles import android.content.Intent diff --git a/app/src/main/java/com/sameerasw/essentials/services/tiles/ColorPickerTileService.kt b/app/src/main/java/com/sameerasw/essentials/services/tiles/ColorPickerTileService.kt index 569e21411..882c3d436 100644 --- a/app/src/main/java/com/sameerasw/essentials/services/tiles/ColorPickerTileService.kt +++ b/app/src/main/java/com/sameerasw/essentials/services/tiles/ColorPickerTileService.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Background Services & Receivers + * File: ColorPickerTileService.kt + * Description: Background service component for ColorPickerTileService.kt. + */ + package com.sameerasw.essentials.services.tiles import android.app.PendingIntent diff --git a/app/src/main/java/com/sameerasw/essentials/services/tiles/DeveloperOptionsTileService.kt b/app/src/main/java/com/sameerasw/essentials/services/tiles/DeveloperOptionsTileService.kt index 2e66daaac..53223512f 100644 --- a/app/src/main/java/com/sameerasw/essentials/services/tiles/DeveloperOptionsTileService.kt +++ b/app/src/main/java/com/sameerasw/essentials/services/tiles/DeveloperOptionsTileService.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Background Services & Receivers + * File: DeveloperOptionsTileService.kt + * Description: Background service component for DeveloperOptionsTileService.kt. + */ + package com.sameerasw.essentials.services.tiles import android.content.Intent diff --git a/app/src/main/java/com/sameerasw/essentials/services/tiles/DynamicNightLightTileService.kt b/app/src/main/java/com/sameerasw/essentials/services/tiles/DynamicNightLightTileService.kt index f79877fcc..6f7aa5d41 100644 --- a/app/src/main/java/com/sameerasw/essentials/services/tiles/DynamicNightLightTileService.kt +++ b/app/src/main/java/com/sameerasw/essentials/services/tiles/DynamicNightLightTileService.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Background Services & Receivers + * File: DynamicNightLightTileService.kt + * Description: Background service component for DynamicNightLightTileService.kt. + */ + package com.sameerasw.essentials.services.tiles import android.graphics.drawable.Icon diff --git a/app/src/main/java/com/sameerasw/essentials/services/tiles/FlashlightPulseTileService.kt b/app/src/main/java/com/sameerasw/essentials/services/tiles/FlashlightPulseTileService.kt index 423a2117a..860536e63 100644 --- a/app/src/main/java/com/sameerasw/essentials/services/tiles/FlashlightPulseTileService.kt +++ b/app/src/main/java/com/sameerasw/essentials/services/tiles/FlashlightPulseTileService.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Background Services & Receivers + * File: FlashlightPulseTileService.kt + * Description: Background service component for FlashlightPulseTileService.kt. + */ + package com.sameerasw.essentials.services.tiles import android.service.quicksettings.Tile diff --git a/app/src/main/java/com/sameerasw/essentials/services/tiles/FlashlightTileService.kt b/app/src/main/java/com/sameerasw/essentials/services/tiles/FlashlightTileService.kt index eaa9e8841..26d1d1491 100644 --- a/app/src/main/java/com/sameerasw/essentials/services/tiles/FlashlightTileService.kt +++ b/app/src/main/java/com/sameerasw/essentials/services/tiles/FlashlightTileService.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Background Services & Receivers + * File: FlashlightTileService.kt + * Description: Background service component for FlashlightTileService.kt. + */ + package com.sameerasw.essentials.services.tiles import android.content.Intent diff --git a/app/src/main/java/com/sameerasw/essentials/services/tiles/LockdownTileService.kt b/app/src/main/java/com/sameerasw/essentials/services/tiles/LockdownTileService.kt index eb3ab7572..6bd125816 100644 --- a/app/src/main/java/com/sameerasw/essentials/services/tiles/LockdownTileService.kt +++ b/app/src/main/java/com/sameerasw/essentials/services/tiles/LockdownTileService.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Background Services & Receivers + * File: LockdownTileService.kt + * Description: Background service component for LockdownTileService.kt. + */ + package com.sameerasw.essentials.services.tiles import android.graphics.drawable.Icon diff --git a/app/src/main/java/com/sameerasw/essentials/services/tiles/MapsPowerSavingTileService.kt b/app/src/main/java/com/sameerasw/essentials/services/tiles/MapsPowerSavingTileService.kt index 3dc99e0eb..bd0d72495 100644 --- a/app/src/main/java/com/sameerasw/essentials/services/tiles/MapsPowerSavingTileService.kt +++ b/app/src/main/java/com/sameerasw/essentials/services/tiles/MapsPowerSavingTileService.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Background Services & Receivers + * File: MapsPowerSavingTileService.kt + * Description: Background service component for MapsPowerSavingTileService.kt. + */ + package com.sameerasw.essentials.services.tiles import android.content.Intent diff --git a/app/src/main/java/com/sameerasw/essentials/services/tiles/MonoAudioTileService.kt b/app/src/main/java/com/sameerasw/essentials/services/tiles/MonoAudioTileService.kt index c8c236234..f99f48f1b 100644 --- a/app/src/main/java/com/sameerasw/essentials/services/tiles/MonoAudioTileService.kt +++ b/app/src/main/java/com/sameerasw/essentials/services/tiles/MonoAudioTileService.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Background Services & Receivers + * File: MonoAudioTileService.kt + * Description: Background service component for MonoAudioTileService.kt. + */ + package com.sameerasw.essentials.services.tiles import android.graphics.drawable.Icon diff --git a/app/src/main/java/com/sameerasw/essentials/services/tiles/NfcTileService.kt b/app/src/main/java/com/sameerasw/essentials/services/tiles/NfcTileService.kt index 98e0406e8..3d685a090 100644 --- a/app/src/main/java/com/sameerasw/essentials/services/tiles/NfcTileService.kt +++ b/app/src/main/java/com/sameerasw/essentials/services/tiles/NfcTileService.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Background Services & Receivers + * File: NfcTileService.kt + * Description: Background service component for NfcTileService.kt. + */ + package com.sameerasw.essentials.services.tiles import android.content.Context diff --git a/app/src/main/java/com/sameerasw/essentials/services/tiles/NotificationLightingTileService.kt b/app/src/main/java/com/sameerasw/essentials/services/tiles/NotificationLightingTileService.kt index 2c2866473..efe4dc7c9 100644 --- a/app/src/main/java/com/sameerasw/essentials/services/tiles/NotificationLightingTileService.kt +++ b/app/src/main/java/com/sameerasw/essentials/services/tiles/NotificationLightingTileService.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Background Services & Receivers + * File: NotificationLightingTileService.kt + * Description: Background service component for NotificationLightingTileService.kt. + */ + package com.sameerasw.essentials.services.tiles import android.graphics.drawable.Icon diff --git a/app/src/main/java/com/sameerasw/essentials/services/tiles/PocketModeTileService.kt b/app/src/main/java/com/sameerasw/essentials/services/tiles/PocketModeTileService.kt index 74c575814..824d17434 100644 --- a/app/src/main/java/com/sameerasw/essentials/services/tiles/PocketModeTileService.kt +++ b/app/src/main/java/com/sameerasw/essentials/services/tiles/PocketModeTileService.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Background Services & Receivers + * File: PocketModeTileService.kt + * Description: Background service component for PocketModeTileService.kt. + */ + package com.sameerasw.essentials.services.tiles import android.graphics.drawable.Icon diff --git a/app/src/main/java/com/sameerasw/essentials/services/tiles/PrivateDnsTileService.kt b/app/src/main/java/com/sameerasw/essentials/services/tiles/PrivateDnsTileService.kt index 6f71cba97..bc9ee642d 100644 --- a/app/src/main/java/com/sameerasw/essentials/services/tiles/PrivateDnsTileService.kt +++ b/app/src/main/java/com/sameerasw/essentials/services/tiles/PrivateDnsTileService.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Background Services & Receivers + * File: PrivateDnsTileService.kt + * Description: Background service component for PrivateDnsTileService.kt. + */ + package com.sameerasw.essentials.services.tiles import android.content.Intent diff --git a/app/src/main/java/com/sameerasw/essentials/services/tiles/PrivateNotificationsTileService.kt b/app/src/main/java/com/sameerasw/essentials/services/tiles/PrivateNotificationsTileService.kt index f86a57c5f..13d68bd83 100644 --- a/app/src/main/java/com/sameerasw/essentials/services/tiles/PrivateNotificationsTileService.kt +++ b/app/src/main/java/com/sameerasw/essentials/services/tiles/PrivateNotificationsTileService.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Background Services & Receivers + * File: PrivateNotificationsTileService.kt + * Description: Background service component for PrivateNotificationsTileService.kt. + */ + package com.sameerasw.essentials.services.tiles import android.Manifest diff --git a/app/src/main/java/com/sameerasw/essentials/services/tiles/QsTileRegistry.kt b/app/src/main/java/com/sameerasw/essentials/services/tiles/QsTileRegistry.kt index 4648aff2b..b3e281aec 100644 --- a/app/src/main/java/com/sameerasw/essentials/services/tiles/QsTileRegistry.kt +++ b/app/src/main/java/com/sameerasw/essentials/services/tiles/QsTileRegistry.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Background Services & Receivers + * File: QsTileRegistry.kt + * Description: Background service component for QsTileRegistry.kt. + */ + package com.sameerasw.essentials.services.tiles import com.sameerasw.essentials.R diff --git a/app/src/main/java/com/sameerasw/essentials/services/tiles/RefreshRateTileService.kt b/app/src/main/java/com/sameerasw/essentials/services/tiles/RefreshRateTileService.kt index 9d3f5e62b..b15f0595f 100644 --- a/app/src/main/java/com/sameerasw/essentials/services/tiles/RefreshRateTileService.kt +++ b/app/src/main/java/com/sameerasw/essentials/services/tiles/RefreshRateTileService.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Background Services & Receivers + * File: RefreshRateTileService.kt + * Description: Background service component for RefreshRateTileService.kt. + */ + package com.sameerasw.essentials.services.tiles import android.content.Intent diff --git a/app/src/main/java/com/sameerasw/essentials/services/tiles/RestartSystemUiTileService.kt b/app/src/main/java/com/sameerasw/essentials/services/tiles/RestartSystemUiTileService.kt index 49a4b97dc..05fec90fb 100644 --- a/app/src/main/java/com/sameerasw/essentials/services/tiles/RestartSystemUiTileService.kt +++ b/app/src/main/java/com/sameerasw/essentials/services/tiles/RestartSystemUiTileService.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Background Services & Receivers + * File: RestartSystemUiTileService.kt + * Description: Background service component for RestartSystemUiTileService.kt. + */ + package com.sameerasw.essentials.services.tiles import android.content.Intent diff --git a/app/src/main/java/com/sameerasw/essentials/services/tiles/ScaleAnimationsTileService.kt b/app/src/main/java/com/sameerasw/essentials/services/tiles/ScaleAnimationsTileService.kt index a92c16049..58ece30e5 100644 --- a/app/src/main/java/com/sameerasw/essentials/services/tiles/ScaleAnimationsTileService.kt +++ b/app/src/main/java/com/sameerasw/essentials/services/tiles/ScaleAnimationsTileService.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Background Services & Receivers + * File: ScaleAnimationsTileService.kt + * Description: Background service component for ScaleAnimationsTileService.kt. + */ + package com.sameerasw.essentials.services.tiles import android.graphics.drawable.Icon diff --git a/app/src/main/java/com/sameerasw/essentials/services/tiles/ScreenLockedSecurityTileService.kt b/app/src/main/java/com/sameerasw/essentials/services/tiles/ScreenLockedSecurityTileService.kt index 38a4ca902..16b41646c 100644 --- a/app/src/main/java/com/sameerasw/essentials/services/tiles/ScreenLockedSecurityTileService.kt +++ b/app/src/main/java/com/sameerasw/essentials/services/tiles/ScreenLockedSecurityTileService.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Background Services & Receivers + * File: ScreenLockedSecurityTileService.kt + * Description: Background service component for ScreenLockedSecurityTileService.kt. + */ + package com.sameerasw.essentials.services.tiles import android.app.PendingIntent diff --git a/app/src/main/java/com/sameerasw/essentials/services/tiles/ScreenOffAccessibilityService.kt b/app/src/main/java/com/sameerasw/essentials/services/tiles/ScreenOffAccessibilityService.kt index d7c5d8902..8a57f4aa2 100644 --- a/app/src/main/java/com/sameerasw/essentials/services/tiles/ScreenOffAccessibilityService.kt +++ b/app/src/main/java/com/sameerasw/essentials/services/tiles/ScreenOffAccessibilityService.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Background Services & Receivers + * File: ScreenOffAccessibilityService.kt + * Description: Background service component for ScreenOffAccessibilityService.kt. + */ + package com.sameerasw.essentials.services.tiles import android.accessibilityservice.AccessibilityService diff --git a/app/src/main/java/com/sameerasw/essentials/services/tiles/SoundModeTileService.kt b/app/src/main/java/com/sameerasw/essentials/services/tiles/SoundModeTileService.kt index 8da534da2..351e54798 100644 --- a/app/src/main/java/com/sameerasw/essentials/services/tiles/SoundModeTileService.kt +++ b/app/src/main/java/com/sameerasw/essentials/services/tiles/SoundModeTileService.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Background Services & Receivers + * File: SoundModeTileService.kt + * Description: Background service component for SoundModeTileService.kt. + */ + package com.sameerasw.essentials.services.tiles import android.app.NotificationManager diff --git a/app/src/main/java/com/sameerasw/essentials/services/tiles/StayAwakeTileService.kt b/app/src/main/java/com/sameerasw/essentials/services/tiles/StayAwakeTileService.kt index 1ddba7ae2..262939d6c 100644 --- a/app/src/main/java/com/sameerasw/essentials/services/tiles/StayAwakeTileService.kt +++ b/app/src/main/java/com/sameerasw/essentials/services/tiles/StayAwakeTileService.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Background Services & Receivers + * File: StayAwakeTileService.kt + * Description: Background service component for StayAwakeTileService.kt. + */ + package com.sameerasw.essentials.services.tiles import android.graphics.drawable.Icon diff --git a/app/src/main/java/com/sameerasw/essentials/services/tiles/TapToWakeTileService.kt b/app/src/main/java/com/sameerasw/essentials/services/tiles/TapToWakeTileService.kt index c86ebf6fa..bbbc9cf2b 100644 --- a/app/src/main/java/com/sameerasw/essentials/services/tiles/TapToWakeTileService.kt +++ b/app/src/main/java/com/sameerasw/essentials/services/tiles/TapToWakeTileService.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Background Services & Receivers + * File: TapToWakeTileService.kt + * Description: Background service component for TapToWakeTileService.kt. + */ + package com.sameerasw.essentials.services.tiles import android.Manifest diff --git a/app/src/main/java/com/sameerasw/essentials/services/tiles/UiBlurTileService.kt b/app/src/main/java/com/sameerasw/essentials/services/tiles/UiBlurTileService.kt index 88f7090ca..8f9792628 100644 --- a/app/src/main/java/com/sameerasw/essentials/services/tiles/UiBlurTileService.kt +++ b/app/src/main/java/com/sameerasw/essentials/services/tiles/UiBlurTileService.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Background Services & Receivers + * File: UiBlurTileService.kt + * Description: Background service component for UiBlurTileService.kt. + */ + package com.sameerasw.essentials.services.tiles import android.Manifest diff --git a/app/src/main/java/com/sameerasw/essentials/services/tiles/UsbDebuggingTileService.kt b/app/src/main/java/com/sameerasw/essentials/services/tiles/UsbDebuggingTileService.kt index 4dd64e8c6..6aac05519 100644 --- a/app/src/main/java/com/sameerasw/essentials/services/tiles/UsbDebuggingTileService.kt +++ b/app/src/main/java/com/sameerasw/essentials/services/tiles/UsbDebuggingTileService.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Background Services & Receivers + * File: UsbDebuggingTileService.kt + * Description: Background service component for UsbDebuggingTileService.kt. + */ + package com.sameerasw.essentials.services.tiles import android.content.Intent diff --git a/app/src/main/java/com/sameerasw/essentials/services/widgets/BatteriesWidget.kt b/app/src/main/java/com/sameerasw/essentials/services/widgets/BatteriesWidget.kt index 256b30bb9..ef8910576 100644 --- a/app/src/main/java/com/sameerasw/essentials/services/widgets/BatteriesWidget.kt +++ b/app/src/main/java/com/sameerasw/essentials/services/widgets/BatteriesWidget.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Background Services & Receivers + * File: BatteriesWidget.kt + * Description: Background service component for BatteriesWidget.kt. + */ + package com.sameerasw.essentials.services.widgets import android.content.Context diff --git a/app/src/main/java/com/sameerasw/essentials/services/widgets/BatteriesWidgetReceiver.kt b/app/src/main/java/com/sameerasw/essentials/services/widgets/BatteriesWidgetReceiver.kt index 122c74f3c..3e46c1e3e 100644 --- a/app/src/main/java/com/sameerasw/essentials/services/widgets/BatteriesWidgetReceiver.kt +++ b/app/src/main/java/com/sameerasw/essentials/services/widgets/BatteriesWidgetReceiver.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Background Services & Receivers + * File: BatteriesWidgetReceiver.kt + * Description: Background service component for BatteriesWidgetReceiver.kt. + */ + package com.sameerasw.essentials.services.widgets import android.content.Context diff --git a/app/src/main/java/com/sameerasw/essentials/services/widgets/FavoritesWidget.kt b/app/src/main/java/com/sameerasw/essentials/services/widgets/FavoritesWidget.kt index 47d08d9d7..493d8db7d 100644 --- a/app/src/main/java/com/sameerasw/essentials/services/widgets/FavoritesWidget.kt +++ b/app/src/main/java/com/sameerasw/essentials/services/widgets/FavoritesWidget.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Background Services & Receivers + * File: FavoritesWidget.kt + * Description: Background service component for FavoritesWidget.kt. + */ + package com.sameerasw.essentials.services.widgets import android.content.Context @@ -193,7 +202,11 @@ class FavoritesWidget : GlanceAppWidget() { .cornerRadius( iconCornerRadius ) - .background(ColorProvider(pastelColor)), + .background( + ColorProvider( + pastelColor + ) + ), contentAlignment = Alignment.Center ) { Image( @@ -246,7 +259,11 @@ class FavoritesWidget : GlanceAppWidget() { .cornerRadius( iconCornerRadius ) - .background(ColorProvider(pastelColor)), + .background( + ColorProvider( + pastelColor + ) + ), contentAlignment = Alignment.Center ) { Image( diff --git a/app/src/main/java/com/sameerasw/essentials/services/widgets/FavoritesWidgetReceiver.kt b/app/src/main/java/com/sameerasw/essentials/services/widgets/FavoritesWidgetReceiver.kt index a8277ff13..1cf59031d 100644 --- a/app/src/main/java/com/sameerasw/essentials/services/widgets/FavoritesWidgetReceiver.kt +++ b/app/src/main/java/com/sameerasw/essentials/services/widgets/FavoritesWidgetReceiver.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Background Services & Receivers + * File: FavoritesWidgetReceiver.kt + * Description: Background service component for FavoritesWidgetReceiver.kt. + */ + package com.sameerasw.essentials.services.widgets import android.content.Context diff --git a/app/src/main/java/com/sameerasw/essentials/services/widgets/MusicBroadcastReceiver.kt b/app/src/main/java/com/sameerasw/essentials/services/widgets/MusicBroadcastReceiver.kt index 6d4a3e292..77e867440 100644 --- a/app/src/main/java/com/sameerasw/essentials/services/widgets/MusicBroadcastReceiver.kt +++ b/app/src/main/java/com/sameerasw/essentials/services/widgets/MusicBroadcastReceiver.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Background Services & Receivers + * File: MusicBroadcastReceiver.kt + * Description: Background service component for MusicBroadcastReceiver.kt. + */ + package com.sameerasw.essentials.services.widgets import android.content.BroadcastReceiver diff --git a/app/src/main/java/com/sameerasw/essentials/services/widgets/MusicClickActionCallback.kt b/app/src/main/java/com/sameerasw/essentials/services/widgets/MusicClickActionCallback.kt index c88d7396b..96bd97130 100644 --- a/app/src/main/java/com/sameerasw/essentials/services/widgets/MusicClickActionCallback.kt +++ b/app/src/main/java/com/sameerasw/essentials/services/widgets/MusicClickActionCallback.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Background Services & Receivers + * File: MusicClickActionCallback.kt + * Description: Background service component for MusicClickActionCallback.kt. + */ + package com.sameerasw.essentials.services.widgets import android.content.Context diff --git a/app/src/main/java/com/sameerasw/essentials/services/widgets/PixelSearchbarWidget.kt b/app/src/main/java/com/sameerasw/essentials/services/widgets/PixelSearchbarWidget.kt index 67972a075..35753e934 100644 --- a/app/src/main/java/com/sameerasw/essentials/services/widgets/PixelSearchbarWidget.kt +++ b/app/src/main/java/com/sameerasw/essentials/services/widgets/PixelSearchbarWidget.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Background Services & Receivers + * File: PixelSearchbarWidget.kt + * Description: Background service component for PixelSearchbarWidget.kt. + */ + package com.sameerasw.essentials.services.widgets import android.content.Context diff --git a/app/src/main/java/com/sameerasw/essentials/services/widgets/PixelSearchbarWidgetReceiver.kt b/app/src/main/java/com/sameerasw/essentials/services/widgets/PixelSearchbarWidgetReceiver.kt index d784a7edc..563a9c10e 100644 --- a/app/src/main/java/com/sameerasw/essentials/services/widgets/PixelSearchbarWidgetReceiver.kt +++ b/app/src/main/java/com/sameerasw/essentials/services/widgets/PixelSearchbarWidgetReceiver.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Background Services & Receivers + * File: PixelSearchbarWidgetReceiver.kt + * Description: Background service component for PixelSearchbarWidgetReceiver.kt. + */ + package com.sameerasw.essentials.services.widgets import android.content.Context diff --git a/app/src/main/java/com/sameerasw/essentials/services/widgets/QsTileClickActionCallback.kt b/app/src/main/java/com/sameerasw/essentials/services/widgets/QsTileClickActionCallback.kt index 824e28447..507834874 100644 --- a/app/src/main/java/com/sameerasw/essentials/services/widgets/QsTileClickActionCallback.kt +++ b/app/src/main/java/com/sameerasw/essentials/services/widgets/QsTileClickActionCallback.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Background Services & Receivers + * File: QsTileClickActionCallback.kt + * Description: Background service component for QsTileClickActionCallback.kt. + */ + package com.sameerasw.essentials.services.widgets import android.content.Context diff --git a/app/src/main/java/com/sameerasw/essentials/services/widgets/QsTilesWidget.kt b/app/src/main/java/com/sameerasw/essentials/services/widgets/QsTilesWidget.kt index 5f60c4f50..cf9b51ac5 100644 --- a/app/src/main/java/com/sameerasw/essentials/services/widgets/QsTilesWidget.kt +++ b/app/src/main/java/com/sameerasw/essentials/services/widgets/QsTilesWidget.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Background Services & Receivers + * File: QsTilesWidget.kt + * Description: Background service component for QsTilesWidget.kt. + */ + package com.sameerasw.essentials.services.widgets import android.content.Context @@ -216,7 +225,11 @@ class QsTilesWidget : GlanceAppWidget() { .cornerRadius( iconCornerRadius ) - .background(ColorProvider(pastelColor)), + .background( + ColorProvider( + pastelColor + ) + ), contentAlignment = Alignment.Center ) { Image( diff --git a/app/src/main/java/com/sameerasw/essentials/services/widgets/QsTilesWidgetReceiver.kt b/app/src/main/java/com/sameerasw/essentials/services/widgets/QsTilesWidgetReceiver.kt index 205655d5d..7f7d6fd7d 100644 --- a/app/src/main/java/com/sameerasw/essentials/services/widgets/QsTilesWidgetReceiver.kt +++ b/app/src/main/java/com/sameerasw/essentials/services/widgets/QsTilesWidgetReceiver.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Background Services & Receivers + * File: QsTilesWidgetReceiver.kt + * Description: Background service component for QsTilesWidgetReceiver.kt. + */ + package com.sameerasw.essentials.services.widgets import android.content.Context diff --git a/app/src/main/java/com/sameerasw/essentials/services/widgets/WidgetScraperService.kt b/app/src/main/java/com/sameerasw/essentials/services/widgets/WidgetScraperService.kt index 1e89bca75..fa1293a1b 100644 --- a/app/src/main/java/com/sameerasw/essentials/services/widgets/WidgetScraperService.kt +++ b/app/src/main/java/com/sameerasw/essentials/services/widgets/WidgetScraperService.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Background Services & Receivers + * File: WidgetScraperService.kt + * Description: Background service component for WidgetScraperService.kt. + */ + package com.sameerasw.essentials.services.widgets import android.app.Service diff --git a/app/src/main/java/com/sameerasw/essentials/shizuku/ShizukuPermissionHelper.kt b/app/src/main/java/com/sameerasw/essentials/shizuku/ShizukuPermissionHelper.kt index 7446bff2e..a5b78da1f 100644 --- a/app/src/main/java/com/sameerasw/essentials/shizuku/ShizukuPermissionHelper.kt +++ b/app/src/main/java/com/sameerasw/essentials/shizuku/ShizukuPermissionHelper.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Shizuku + * File: ShizukuPermissionHelper.kt + * Description: Component file for ShizukuPermissionHelper.kt. + */ + package com.sameerasw.essentials.shizuku import android.content.Context diff --git a/app/src/main/java/com/sameerasw/essentials/shizuku/ShizukuProcessHelper.kt b/app/src/main/java/com/sameerasw/essentials/shizuku/ShizukuProcessHelper.kt index 805be2213..219930bda 100644 --- a/app/src/main/java/com/sameerasw/essentials/shizuku/ShizukuProcessHelper.kt +++ b/app/src/main/java/com/sameerasw/essentials/shizuku/ShizukuProcessHelper.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Shizuku + * File: ShizukuProcessHelper.kt + * Description: Component file for ShizukuProcessHelper.kt. + */ + package com.sameerasw.essentials.shizuku import rikka.shizuku.Shizuku diff --git a/app/src/main/java/com/sameerasw/essentials/translation/StringLoader.kt b/app/src/main/java/com/sameerasw/essentials/translation/StringLoader.kt index 8cc2b16b4..300ad812e 100644 --- a/app/src/main/java/com/sameerasw/essentials/translation/StringLoader.kt +++ b/app/src/main/java/com/sameerasw/essentials/translation/StringLoader.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Translation + * File: StringLoader.kt + * Description: Component file for StringLoader.kt. + */ + package com.sameerasw.essentials.translation import android.content.Context diff --git a/app/src/main/java/com/sameerasw/essentials/translation/TranslatableText.kt b/app/src/main/java/com/sameerasw/essentials/translation/TranslatableText.kt index 659185c61..68e95f8f0 100644 --- a/app/src/main/java/com/sameerasw/essentials/translation/TranslatableText.kt +++ b/app/src/main/java/com/sameerasw/essentials/translation/TranslatableText.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Translation + * File: TranslatableText.kt + * Description: Component file for TranslatableText.kt. + */ + package com.sameerasw.essentials.translation import androidx.compose.foundation.ExperimentalFoundationApi diff --git a/app/src/main/java/com/sameerasw/essentials/translation/TranslationManager.kt b/app/src/main/java/com/sameerasw/essentials/translation/TranslationManager.kt index 7fb10a19e..6223ecccb 100644 --- a/app/src/main/java/com/sameerasw/essentials/translation/TranslationManager.kt +++ b/app/src/main/java/com/sameerasw/essentials/translation/TranslationManager.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Translation + * File: TranslationManager.kt + * Description: Component file for TranslationManager.kt. + */ + package com.sameerasw.essentials.translation import android.content.Context diff --git a/app/src/main/java/com/sameerasw/essentials/translation/model/TranslationModels.kt b/app/src/main/java/com/sameerasw/essentials/translation/model/TranslationModels.kt index 05da3ae03..80ffb03d5 100644 --- a/app/src/main/java/com/sameerasw/essentials/translation/model/TranslationModels.kt +++ b/app/src/main/java/com/sameerasw/essentials/translation/model/TranslationModels.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Translation + * File: TranslationModels.kt + * Description: Component file for TranslationModels.kt. + */ + package com.sameerasw.essentials.translation.model import androidx.compose.runtime.mutableStateListOf diff --git a/app/src/main/java/com/sameerasw/essentials/translation/ui/TranslatableCardContainer.kt b/app/src/main/java/com/sameerasw/essentials/translation/ui/TranslatableCardContainer.kt index 637faa038..bd65f955c 100644 --- a/app/src/main/java/com/sameerasw/essentials/translation/ui/TranslatableCardContainer.kt +++ b/app/src/main/java/com/sameerasw/essentials/translation/ui/TranslatableCardContainer.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Translation + * File: TranslatableCardContainer.kt + * Description: Component file for TranslatableCardContainer.kt. + */ + package com.sameerasw.essentials.translation.ui import androidx.compose.foundation.gestures.awaitEachGesture diff --git a/app/src/main/java/com/sameerasw/essentials/translation/ui/TranslationBottomSheet.kt b/app/src/main/java/com/sameerasw/essentials/translation/ui/TranslationBottomSheet.kt index 5d67dc840..fffc94014 100644 --- a/app/src/main/java/com/sameerasw/essentials/translation/ui/TranslationBottomSheet.kt +++ b/app/src/main/java/com/sameerasw/essentials/translation/ui/TranslationBottomSheet.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Translation + * File: TranslationBottomSheet.kt + * Description: Component file for TranslationBottomSheet.kt. + */ + package com.sameerasw.essentials.translation.ui import androidx.compose.foundation.background @@ -34,7 +43,7 @@ import androidx.compose.ui.unit.dp import com.sameerasw.essentials.R import com.sameerasw.essentials.translation.StringLoader import com.sameerasw.essentials.translation.TranslationManager -import com.sameerasw.essentials.ui.components.containers.RoundedCardContainer +import com.sameerasw.essentials.ui.core.containers.RoundedCardContainer import com.sameerasw.essentials.utils.HapticUtil @OptIn(ExperimentalMaterial3Api::class) diff --git a/app/src/main/java/com/sameerasw/essentials/translation/ui/TranslationFocusOutline.kt b/app/src/main/java/com/sameerasw/essentials/translation/ui/TranslationFocusOutline.kt index ba7b38286..ffcd2eecb 100644 --- a/app/src/main/java/com/sameerasw/essentials/translation/ui/TranslationFocusOutline.kt +++ b/app/src/main/java/com/sameerasw/essentials/translation/ui/TranslationFocusOutline.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Translation + * File: TranslationFocusOutline.kt + * Description: Component file for TranslationFocusOutline.kt. + */ + package com.sameerasw.essentials.translation.ui import androidx.compose.animation.core.FastOutSlowInEasing diff --git a/app/src/main/java/com/sameerasw/essentials/translation/ui/TranslationLongPressMenu.kt b/app/src/main/java/com/sameerasw/essentials/translation/ui/TranslationLongPressMenu.kt index f5966ba32..4864d6b7b 100644 --- a/app/src/main/java/com/sameerasw/essentials/translation/ui/TranslationLongPressMenu.kt +++ b/app/src/main/java/com/sameerasw/essentials/translation/ui/TranslationLongPressMenu.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Translation + * File: TranslationLongPressMenu.kt + * Description: Component file for TranslationLongPressMenu.kt. + */ + package com.sameerasw.essentials.translation.ui import androidx.compose.foundation.layout.Column @@ -38,9 +47,11 @@ fun TranslationLongPressMenu( // Info Header Entry with background matching SegmentedDropdownMenuItem SegmentedDropdownMenuItem( text = { - Column(modifier = Modifier - .fillMaxWidth() - .padding(vertical = 2.dp)) { + Column( + modifier = Modifier + .fillMaxWidth() + .padding(vertical = 2.dp) + ) { Text( text = fullText, style = MaterialTheme.typography.bodySmall, diff --git a/app/src/main/java/com/sameerasw/essentials/translation/ui/TranslationMenuItems.kt b/app/src/main/java/com/sameerasw/essentials/translation/ui/TranslationMenuItems.kt index 80ec2f94b..8f3325157 100644 --- a/app/src/main/java/com/sameerasw/essentials/translation/ui/TranslationMenuItems.kt +++ b/app/src/main/java/com/sameerasw/essentials/translation/ui/TranslationMenuItems.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Translation + * File: TranslationMenuItems.kt + * Description: Component file for TranslationMenuItems.kt. + */ + package com.sameerasw.essentials.translation.ui import androidx.compose.material3.Icon diff --git a/app/src/main/java/com/sameerasw/essentials/translation/ui/TranslationSessionSheet.kt b/app/src/main/java/com/sameerasw/essentials/translation/ui/TranslationSessionSheet.kt index 76a8e4dde..cbd6755d4 100644 --- a/app/src/main/java/com/sameerasw/essentials/translation/ui/TranslationSessionSheet.kt +++ b/app/src/main/java/com/sameerasw/essentials/translation/ui/TranslationSessionSheet.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Translation + * File: TranslationSessionSheet.kt + * Description: Component file for TranslationSessionSheet.kt. + */ + package com.sameerasw.essentials.translation.ui import android.util.Log @@ -44,7 +53,7 @@ import com.sameerasw.essentials.data.repository.GitHubRepository import com.sameerasw.essentials.data.repository.SettingsRepository import com.sameerasw.essentials.translation.TranslationManager import com.sameerasw.essentials.translation.model.TranslationEdit -import com.sameerasw.essentials.ui.components.containers.RoundedCardContainer +import com.sameerasw.essentials.ui.core.containers.RoundedCardContainer import com.sameerasw.essentials.utils.HapticUtil import kotlinx.coroutines.launch diff --git a/app/src/main/java/com/sameerasw/essentials/translation/ui/TranslationWarningBottomSheet.kt b/app/src/main/java/com/sameerasw/essentials/translation/ui/TranslationWarningBottomSheet.kt index 78df9c2c7..96f2806c3 100644 --- a/app/src/main/java/com/sameerasw/essentials/translation/ui/TranslationWarningBottomSheet.kt +++ b/app/src/main/java/com/sameerasw/essentials/translation/ui/TranslationWarningBottomSheet.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Translation + * File: TranslationWarningBottomSheet.kt + * Description: Component file for TranslationWarningBottomSheet.kt. + */ + package com.sameerasw.essentials.translation.ui import androidx.compose.foundation.background @@ -36,7 +45,7 @@ import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.unit.dp import com.sameerasw.essentials.R -import com.sameerasw.essentials.ui.components.containers.RoundedCardContainer +import com.sameerasw.essentials.ui.core.containers.RoundedCardContainer import com.sameerasw.essentials.utils.ColorUtil import com.sameerasw.essentials.utils.HapticUtil diff --git a/app/src/main/java/com/sameerasw/essentials/ui/activities/ActionShortcutActivity.kt b/app/src/main/java/com/sameerasw/essentials/ui/activities/ActionShortcutActivity.kt index ca20c896d..ee8de2bec 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/activities/ActionShortcutActivity.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/activities/ActionShortcutActivity.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Application Activities + * File: ActionShortcutActivity.kt + * Description: Activity component for ActionShortcutActivity.kt. + */ + package com.sameerasw.essentials.ui.activities import android.os.Bundle diff --git a/app/src/main/java/com/sameerasw/essentials/ui/activities/AppFreezingActivity.kt b/app/src/main/java/com/sameerasw/essentials/ui/activities/AppFreezingActivity.kt index 812159c80..d3f04c1cc 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/activities/AppFreezingActivity.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/activities/AppFreezingActivity.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Application Activities + * File: AppFreezingActivity.kt + * Description: Activity component for AppFreezingActivity.kt. + */ + package com.sameerasw.essentials.ui.activities import android.content.Intent @@ -94,7 +103,9 @@ class AppFreezingActivity : ComponentActivity() { val isShizukuAvailable by viewModel.isShizukuAvailable val isShizukuPermissionGranted by viewModel.isShizukuPermissionGranted var fabMenuExpanded by rememberSaveable { mutableStateOf(false) } - androidx.activity.compose.BackHandler(fabMenuExpanded) { fabMenuExpanded = false } + androidx.activity.compose.BackHandler(fabMenuExpanded) { + fabMenuExpanded = false + } Box( modifier = Modifier @@ -136,7 +147,10 @@ class AppFreezingActivity : ComponentActivity() { Box( modifier = Modifier .align(Alignment.BottomEnd) - .padding(bottom = WindowInsets.navigationBars.asPaddingValues().calculateBottomPadding() + 16.dp, end = 16.dp) + .padding( + bottom = WindowInsets.navigationBars.asPaddingValues() + .calculateBottomPadding() + 16.dp, end = 16.dp + ) ) { FloatingActionButton( onClick = { @@ -238,7 +252,10 @@ class AppFreezingActivity : ComponentActivity() { onClick = { HapticUtil.performVirtualKeyHaptic(view) fabMenuExpanded = false - val intent = Intent(context, FeatureSettingsActivity::class.java).apply { + val intent = Intent( + context, + FeatureSettingsActivity::class.java + ).apply { putExtra("feature", "Freeze") } context.startActivity(intent) diff --git a/app/src/main/java/com/sameerasw/essentials/AppLockActivity.kt b/app/src/main/java/com/sameerasw/essentials/ui/activities/AppLockActivity.kt similarity index 97% rename from app/src/main/java/com/sameerasw/essentials/AppLockActivity.kt rename to app/src/main/java/com/sameerasw/essentials/ui/activities/AppLockActivity.kt index dd9eac455..b10101471 100644 --- a/app/src/main/java/com/sameerasw/essentials/AppLockActivity.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/activities/AppLockActivity.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Application Activities + * File: AppLockActivity.kt + * Description: Activity component for AppLockActivity.kt. + */ + package com.sameerasw.essentials import android.content.Intent diff --git a/app/src/main/java/com/sameerasw/essentials/AppUpdatesActivity.kt b/app/src/main/java/com/sameerasw/essentials/ui/activities/AppUpdatesActivity.kt similarity index 98% rename from app/src/main/java/com/sameerasw/essentials/AppUpdatesActivity.kt rename to app/src/main/java/com/sameerasw/essentials/ui/activities/AppUpdatesActivity.kt index 20c31e37b..73fc8dc75 100644 --- a/app/src/main/java/com/sameerasw/essentials/AppUpdatesActivity.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/activities/AppUpdatesActivity.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Application Activities + * File: AppUpdatesActivity.kt + * Description: Activity component for AppUpdatesActivity.kt. + */ + package com.sameerasw.essentials import android.os.Build @@ -49,10 +58,10 @@ import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp import androidx.lifecycle.viewmodel.compose.viewModel import com.sameerasw.essentials.ui.components.ReusableTopAppBar -import com.sameerasw.essentials.ui.components.cards.TrackedRepoCard -import com.sameerasw.essentials.ui.components.containers.RoundedCardContainer -import com.sameerasw.essentials.ui.components.sheets.AddRepoBottomSheet -import com.sameerasw.essentials.ui.components.sheets.UpdateBottomSheet +import com.sameerasw.essentials.ui.core.cards.TrackedRepoCard +import com.sameerasw.essentials.ui.core.containers.RoundedCardContainer +import com.sameerasw.essentials.ui.core.sheets.AddRepoBottomSheet +import com.sameerasw.essentials.ui.core.sheets.UpdateBottomSheet import com.sameerasw.essentials.ui.theme.EssentialsTheme import com.sameerasw.essentials.utils.HapticUtil import com.sameerasw.essentials.viewmodels.AppUpdatesViewModel diff --git a/app/src/main/java/com/sameerasw/essentials/ui/activities/AutomationEditorActivity.kt b/app/src/main/java/com/sameerasw/essentials/ui/activities/AutomationEditorActivity.kt index 04a30beeb..929f3166d 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/activities/AutomationEditorActivity.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/activities/AutomationEditorActivity.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Application Activities + * File: AutomationEditorActivity.kt + * Description: Activity component for AutomationEditorActivity.kt. + */ + package com.sameerasw.essentials.ui.activities import android.content.Context @@ -65,16 +74,16 @@ import com.sameerasw.essentials.domain.diy.Trigger import com.sameerasw.essentials.domain.model.AppSelection import com.sameerasw.essentials.domain.model.NotificationApp import com.sameerasw.essentials.ui.components.ReusableTopAppBar -import com.sameerasw.essentials.ui.components.cards.AppToggleItem -import com.sameerasw.essentials.ui.components.containers.RoundedCardContainer import com.sameerasw.essentials.ui.components.menus.SegmentedDropdownMenu import com.sameerasw.essentials.ui.components.menus.SegmentedDropdownMenuItem -import com.sameerasw.essentials.ui.components.pickers.SegmentedPicker -import com.sameerasw.essentials.ui.components.sheets.BluetoothDeviceSelectionSheet -import com.sameerasw.essentials.ui.components.sheets.DimWallpaperSettingsSheet -import com.sameerasw.essentials.ui.components.sheets.ScreenOffSettingsSheet -import com.sameerasw.essentials.ui.components.sheets.SoundModeSettingsSheet -import com.sameerasw.essentials.ui.components.sheets.WifiNetworkSelectionSheet +import com.sameerasw.essentials.ui.core.cards.AppToggleItem +import com.sameerasw.essentials.ui.core.containers.RoundedCardContainer +import com.sameerasw.essentials.ui.core.pickers.SegmentedPicker +import com.sameerasw.essentials.ui.core.sheets.BluetoothDeviceSelectionSheet +import com.sameerasw.essentials.ui.core.sheets.DimWallpaperSettingsSheet +import com.sameerasw.essentials.ui.core.sheets.ScreenOffSettingsSheet +import com.sameerasw.essentials.ui.core.sheets.SoundModeSettingsSheet +import com.sameerasw.essentials.ui.core.sheets.WifiNetworkSelectionSheet import com.sameerasw.essentials.ui.theme.EssentialsTheme import com.sameerasw.essentials.utils.AppUtil import com.sameerasw.essentials.utils.HapticUtil @@ -756,7 +765,7 @@ class AutomationEditorActivity : ComponentActivity() { } if (showTimeSettings) { - com.sameerasw.essentials.ui.components.sheets.TimeSelectionSheet( + com.sameerasw.essentials.ui.core.sheets.TimeSelectionSheet( initialTrigger = selectedTrigger as? Trigger.Schedule, initialState = selectedState as? DIYState.TimePeriod, onDismiss = { showTimeSettings = false }, @@ -856,7 +865,7 @@ class AutomationEditorActivity : ComponentActivity() { } if (showDeviceEffectsSettings && configAction is Action.DeviceEffects) { - com.sameerasw.essentials.ui.components.sheets.DeviceEffectsSettingsSheet( + com.sameerasw.essentials.ui.core.sheets.DeviceEffectsSettingsSheet( initialAction = configAction as Action.DeviceEffects, onDismiss = { showDeviceEffectsSettings = false }, onSave = { newAction -> @@ -898,7 +907,7 @@ class AutomationEditorActivity : ComponentActivity() { } if (showSometimesEssentialsSettings && configAction is Action.SometimesEssentials) { - com.sameerasw.essentials.ui.components.sheets.SometimesEssentialsSettingsSheet( + com.sameerasw.essentials.ui.core.sheets.SometimesEssentialsSettingsSheet( initialAction = configAction as Action.SometimesEssentials, onDismiss = { showSometimesEssentialsSettings = false }, onSave = { newAction -> @@ -920,9 +929,10 @@ class AutomationEditorActivity : ComponentActivity() { if (showFreezeTagSettings && configAction is Action.FreezeTag) { val availableTags = remember { - com.sameerasw.essentials.data.repository.SettingsRepository(context).getFreezeTags() + com.sameerasw.essentials.data.repository.SettingsRepository(context) + .getFreezeTags() } - com.sameerasw.essentials.ui.components.sheets.FreezeTagSettingsSheet( + com.sameerasw.essentials.ui.core.sheets.FreezeTagSettingsSheet( initialAction = configAction as Action.FreezeTag, availableTags = availableTags, onDismiss = { showFreezeTagSettings = false }, diff --git a/app/src/main/java/com/sameerasw/essentials/ui/activities/BatteryDetailsActivity.kt b/app/src/main/java/com/sameerasw/essentials/ui/activities/BatteryDetailsActivity.kt index ac415d167..ecb98c185 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/activities/BatteryDetailsActivity.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/activities/BatteryDetailsActivity.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Application Activities + * File: BatteryDetailsActivity.kt + * Description: Activity component for BatteryDetailsActivity.kt. + */ + package com.sameerasw.essentials.ui.activities import android.os.Bundle @@ -8,9 +17,9 @@ import androidx.compose.runtime.LaunchedEffect import androidx.compose.runtime.getValue import androidx.compose.runtime.remember import androidx.compose.ui.platform.LocalContext -import com.sameerasw.essentials.ui.components.sheets.BatteryDetailsBottomSheet +import com.sameerasw.essentials.ui.core.sheets.BatteryDetailsBottomSheet import com.sameerasw.essentials.ui.theme.EssentialsTheme -import com.sameerasw.essentials.utils.BatteryInfoUtil +import com.sameerasw.essentials.utils.battery.BatteryInfoUtil class BatteryDetailsActivity : ComponentActivity() { override fun onCreate(savedInstanceState: Bundle?) { diff --git a/app/src/main/java/com/sameerasw/essentials/ui/activities/ColorPickerActivity.kt b/app/src/main/java/com/sameerasw/essentials/ui/activities/ColorPickerActivity.kt index b0c781dfa..fcc9481c1 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/activities/ColorPickerActivity.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/activities/ColorPickerActivity.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Application Activities + * File: ColorPickerActivity.kt + * Description: Activity component for ColorPickerActivity.kt. + */ + package com.sameerasw.essentials.ui.activities import android.content.Intent @@ -12,7 +21,7 @@ import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.setValue import com.sameerasw.essentials.R -import com.sameerasw.essentials.ui.components.sheets.ColorPickerBottomSheet +import com.sameerasw.essentials.ui.core.sheets.ColorPickerBottomSheet import com.sameerasw.essentials.ui.theme.EssentialsTheme import com.sameerasw.essentials.utils.HapticUtil diff --git a/app/src/main/java/com/sameerasw/essentials/FeatureSettingsActivity.kt b/app/src/main/java/com/sameerasw/essentials/ui/activities/FeatureSettingsActivity.kt similarity index 84% rename from app/src/main/java/com/sameerasw/essentials/FeatureSettingsActivity.kt rename to app/src/main/java/com/sameerasw/essentials/ui/activities/FeatureSettingsActivity.kt index 86800e388..578bd18ac 100644 --- a/app/src/main/java/com/sameerasw/essentials/FeatureSettingsActivity.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/activities/FeatureSettingsActivity.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Application Activities + * File: FeatureSettingsActivity.kt + * Description: Activity component for FeatureSettingsActivity.kt. + */ + package com.sameerasw.essentials import android.os.Build @@ -49,47 +58,47 @@ import com.sameerasw.essentials.domain.HapticFeedbackType import com.sameerasw.essentials.domain.registry.FeatureRegistry import com.sameerasw.essentials.ui.components.EssentialsFloatingToolbar import com.sameerasw.essentials.ui.components.animations.LottieFeatureAnimation -import com.sameerasw.essentials.ui.components.cards.FeatureCard -import com.sameerasw.essentials.ui.components.containers.RoundedCardContainer import com.sameerasw.essentials.ui.components.linkActions.LinkPickerScreen -import com.sameerasw.essentials.ui.components.sheets.PermissionsBottomSheet -import com.sameerasw.essentials.ui.composables.configs.AlwaysOnDisplaySettingsUI -import com.sameerasw.essentials.ui.composables.configs.AppLockSettingsUI -import com.sameerasw.essentials.ui.composables.configs.BatteriesSettingsUI -import com.sameerasw.essentials.ui.composables.configs.BatteryNotificationSettingsUI -import com.sameerasw.essentials.ui.composables.configs.ButtonRemapSettingsUI -import com.sameerasw.essentials.ui.composables.configs.CaffeinateSettingsUI -import com.sameerasw.essentials.ui.composables.configs.CalendarSyncSettingsUI -import com.sameerasw.essentials.ui.composables.configs.DynamicNightLightSettingsUI -import com.sameerasw.essentials.ui.composables.configs.EssentialsOnDisplaySettingsUI -import com.sameerasw.essentials.ui.composables.configs.FlashlightPulseSettingsUI -import com.sameerasw.essentials.ui.composables.configs.FlashlightSettingsUI -import com.sameerasw.essentials.ui.composables.configs.FreezeSettingsUI -import com.sameerasw.essentials.ui.composables.configs.KeyboardSettingsUI -import com.sameerasw.essentials.ui.composables.configs.LiveWallpaperSettingsUI -import com.sameerasw.essentials.ui.composables.configs.LocationReachedSettingsUI -import com.sameerasw.essentials.ui.composables.configs.LockScreenClockSettingsUI -import com.sameerasw.essentials.ui.composables.configs.MapsPowerSavingSettingsUI -import com.sameerasw.essentials.ui.composables.configs.NavigationSettingsUI -import com.sameerasw.essentials.ui.composables.configs.NetworksSettingsUI -import com.sameerasw.essentials.ui.composables.configs.NotificationLightingSettingsUI -import com.sameerasw.essentials.ui.composables.configs.NotificationSnoozingSettingsUI -import com.sameerasw.essentials.ui.composables.configs.OtherCustomizationsSettingsUI -import com.sameerasw.essentials.ui.composables.configs.PocketModeSettingsUI -import com.sameerasw.essentials.ui.composables.configs.PowerAndBatterySettingsUI -import com.sameerasw.essentials.ui.composables.configs.QuickSettingsTilesSettingsUI -import com.sameerasw.essentials.ui.composables.configs.RefreshRateSettingsUI -import com.sameerasw.essentials.ui.composables.configs.RemoteLockSettingsUI -import com.sameerasw.essentials.ui.composables.configs.ScreenLockedSecuritySettingsUI -import com.sameerasw.essentials.ui.composables.configs.ScreenOffWidgetSettingsUI -import com.sameerasw.essentials.ui.composables.configs.ShutUpSettingsUI -import com.sameerasw.essentials.ui.composables.configs.SnoozeNotificationsSettingsUI -import com.sameerasw.essentials.ui.composables.configs.SoundModeTileSettingsUI -import com.sameerasw.essentials.ui.composables.configs.StandbyAppsSettingsUI -import com.sameerasw.essentials.ui.composables.configs.StatusBarIconSettingsUI -import com.sameerasw.essentials.ui.composables.configs.TextAnimationsSettingsUI -import com.sameerasw.essentials.ui.composables.configs.WatchControlsSettingsUI -import com.sameerasw.essentials.ui.composables.configs.WatchSettingsUI +import com.sameerasw.essentials.ui.core.cards.FeatureCard +import com.sameerasw.essentials.ui.core.containers.RoundedCardContainer +import com.sameerasw.essentials.ui.core.sheets.PermissionsBottomSheet +import com.sameerasw.essentials.ui.features.battery.BatteriesSettingsUI +import com.sameerasw.essentials.ui.features.security.AppLockSettingsUI +import com.sameerasw.essentials.ui.features.system.AlwaysOnDisplaySettingsUI +import com.sameerasw.essentials.ui.features.system.BatteryNotificationSettingsUI +import com.sameerasw.essentials.ui.features.system.ButtonRemapSettingsUI +import com.sameerasw.essentials.ui.features.system.CaffeinateSettingsUI +import com.sameerasw.essentials.ui.features.system.CalendarSyncSettingsUI +import com.sameerasw.essentials.ui.features.system.DynamicNightLightSettingsUI +import com.sameerasw.essentials.ui.features.system.EssentialsOnDisplaySettingsUI +import com.sameerasw.essentials.ui.features.system.FlashlightPulseSettingsUI +import com.sameerasw.essentials.ui.features.system.FlashlightSettingsUI +import com.sameerasw.essentials.ui.features.system.FreezeSettingsUI +import com.sameerasw.essentials.ui.features.system.KeyboardSettingsUI +import com.sameerasw.essentials.ui.features.system.LiveWallpaperSettingsUI +import com.sameerasw.essentials.ui.features.system.LocationReachedSettingsUI +import com.sameerasw.essentials.ui.features.system.LockScreenClockSettingsUI +import com.sameerasw.essentials.ui.features.system.MapsPowerSavingSettingsUI +import com.sameerasw.essentials.ui.features.system.NavigationSettingsUI +import com.sameerasw.essentials.ui.features.system.NetworksSettingsUI +import com.sameerasw.essentials.ui.features.system.NotificationLightingSettingsUI +import com.sameerasw.essentials.ui.features.system.NotificationSnoozingSettingsUI +import com.sameerasw.essentials.ui.features.system.OtherCustomizationsSettingsUI +import com.sameerasw.essentials.ui.features.system.PocketModeSettingsUI +import com.sameerasw.essentials.ui.features.system.PowerAndBatterySettingsUI +import com.sameerasw.essentials.ui.features.system.QuickSettingsTilesSettingsUI +import com.sameerasw.essentials.ui.features.system.RefreshRateSettingsUI +import com.sameerasw.essentials.ui.features.system.RemoteLockSettingsUI +import com.sameerasw.essentials.ui.features.system.ScreenLockedSecuritySettingsUI +import com.sameerasw.essentials.ui.features.system.ScreenOffWidgetSettingsUI +import com.sameerasw.essentials.ui.features.system.ShutUpSettingsUI +import com.sameerasw.essentials.ui.features.system.SnoozeNotificationsSettingsUI +import com.sameerasw.essentials.ui.features.system.SoundModeTileSettingsUI +import com.sameerasw.essentials.ui.features.system.StandbyAppsSettingsUI +import com.sameerasw.essentials.ui.features.system.StatusBarIconSettingsUI +import com.sameerasw.essentials.ui.features.system.TextAnimationsSettingsUI +import com.sameerasw.essentials.ui.features.system.WatchControlsSettingsUI +import com.sameerasw.essentials.ui.features.system.WatchSettingsUI import com.sameerasw.essentials.ui.modifiers.BlurDirection import com.sameerasw.essentials.ui.modifiers.highlight import com.sameerasw.essentials.ui.modifiers.progressiveBlur @@ -340,7 +349,10 @@ class FeatureSettingsActivity : AppCompatActivity() { "Shut-Up!" -> !isWriteSecureSettingsEnabled || !viewModel.isUsageStatsPermissionGranted.value "Power and Battery" -> !isWriteSecureSettingsEnabled - "Networks" -> !isWriteSecureSettingsEnabled && !com.sameerasw.essentials.utils.ShellUtils.hasPermission(context) + "Networks" -> !isWriteSecureSettingsEnabled && !com.sameerasw.essentials.utils.ShellUtils.hasPermission( + context + ) + else -> false } if (hasMissingPermissions) { @@ -380,7 +392,7 @@ class FeatureSettingsActivity : AppCompatActivity() { } if (showHelpSheet && selectedHelpFeature != null) { - com.sameerasw.essentials.ui.components.sheets.FeatureHelpBottomSheet( + com.sameerasw.essentials.ui.core.sheets.FeatureHelpBottomSheet( onDismissRequest = { showHelpSheet = false selectedHelpFeature = null @@ -390,13 +402,13 @@ class FeatureSettingsActivity : AppCompatActivity() { } if (showInstructionsSheet) { - com.sameerasw.essentials.ui.components.sheets.InstructionsBottomSheet( + com.sameerasw.essentials.ui.core.sheets.InstructionsBottomSheet( onDismissRequest = { showInstructionsSheet = false } ) } if (showWatchInstallHelpSheet) { - com.sameerasw.essentials.ui.components.sheets.WatchInstallHelpBottomSheet( + com.sameerasw.essentials.ui.features.watch.sheets.WatchInstallHelpBottomSheet( onDismissRequest = { showWatchInstallHelpSheet = false } ) } @@ -542,6 +554,7 @@ class FeatureSettingsActivity : AppCompatActivity() { "Other customizations" ) ) + "Notifications" -> listOf( listOf( "Notification lighting", @@ -552,6 +565,7 @@ class FeatureSettingsActivity : AppCompatActivity() { "Snooze system notifications" ) ) + "Widgets" -> listOf( listOf( "Pixel Searchbar" @@ -561,6 +575,7 @@ class FeatureSettingsActivity : AppCompatActivity() { "Batteries" ) ) + "Input" -> listOf( listOf( "Button remap", @@ -571,6 +586,7 @@ class FeatureSettingsActivity : AppCompatActivity() { "System Keyboard" ) ) + "Power and battery" -> listOf( listOf( "Power and Battery", @@ -580,6 +596,7 @@ class FeatureSettingsActivity : AppCompatActivity() { "Battery notification" ) ) + "Watch" -> listOf( listOf( "Watch Controls", @@ -594,6 +611,7 @@ class FeatureSettingsActivity : AppCompatActivity() { "Watch Wireless Debugging" ) ) + "Security" -> listOf( listOf( "Screen locked security", @@ -604,13 +622,17 @@ class FeatureSettingsActivity : AppCompatActivity() { "Lockdown mode" ) ) + else -> null } if (definedSections != null) { val assignedIds = definedSections.flatten().toSet() val unassigned = children.filter { it.id !in assignedIds } - definedSections.map { ids -> ids.mapNotNull { childMap[it] } }.filter { it.isNotEmpty() } + if (unassigned.isNotEmpty()) listOf(unassigned) else emptyList() + definedSections.map { ids -> ids.mapNotNull { childMap[it] } } + .filter { it.isNotEmpty() } + if (unassigned.isNotEmpty()) listOf( + unassigned + ) else emptyList() } else { listOf(children) } @@ -623,66 +645,74 @@ class FeatureSettingsActivity : AppCompatActivity() { .padding(top = 16.dp) ) { sectionChildren.forEach { child -> - val permissionAwareToggle: (Boolean) -> Unit = { enabled -> - val missingPermission = when (child.id) { - "Screen off widget" -> !isAccessibilityEnabled - "Statusbar icons" -> !isWriteSecureSettingsEnabled - "Notification lighting" -> !isOverlayPermissionGranted || !isNotificationLightingAccessibilityEnabled || !isNotificationListenerEnabled - "Button remap" -> !isAccessibilityEnabled - "Dynamic night light" -> (if (viewModel.isUseUsageAccess.value) !viewModel.isUsageStatsPermissionGranted.value else !isAccessibilityEnabled) || !isWriteSecureSettingsEnabled - "Snooze system notifications" -> !isNotificationListenerEnabled - "Screen locked security" -> !isAccessibilityEnabled || !isWriteSecureSettingsEnabled || !viewModel.isDeviceAdminEnabled.value - "App lock" -> !isAccessibilityEnabled || (if (viewModel.isUseUsageAccess.value) !viewModel.isUsageStatsPermissionGranted.value else false) - "Freeze" -> !com.sameerasw.essentials.utils.ShellUtils.hasPermission( - context - ) - - "Essentials On Display" -> !isAccessibilityEnabled || !isNotificationListenerEnabled - "Call vibrations" -> !isReadPhoneStateEnabled || !isNotificationListenerEnabled - "Calendar Sync" -> androidx.core.content.ContextCompat.checkSelfPermission( - context, - android.Manifest.permission.READ_CALENDAR - ) != android.content.pm.PackageManager.PERMISSION_GRANTED - - "Batteries" -> (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S && androidx.core.content.ContextCompat.checkSelfPermission( - context, - android.Manifest.permission.BLUETOOTH_CONNECT - ) != android.content.pm.PackageManager.PERMISSION_GRANTED) - - "Maps power saving mode" -> !isNotificationListenerEnabled || !com.sameerasw.essentials.utils.ShellUtils.hasPermission( - context - ) - - "Caffeinate" -> !viewModel.isPostNotificationsEnabled.value - "Battery notification" -> !viewModel.isPostNotificationsEnabled.value || (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S && !viewModel.isBluetoothPermissionGranted.value) - "Text and animations" -> !viewModel.isWriteSettingsEnabled.value || !isWriteSecureSettingsEnabled - "Lock screen clock" -> !isWriteSecureSettingsEnabled - "Screen refresh rate" -> !com.sameerasw.essentials.utils.ShellUtils.hasPermission( - context - ) - - "Shut-Up!" -> !isWriteSecureSettingsEnabled || !viewModel.isUsageStatsPermissionGranted.value - "Power and Battery" -> !isWriteSecureSettingsEnabled - "Networks" -> !isWriteSecureSettingsEnabled && !com.sameerasw.essentials.utils.ShellUtils.hasPermission(context) - "Disable safe volume warning" -> !isWriteSecureSettingsEnabled - "Notification snoozing" -> !isWriteSecureSettingsEnabled - else -> false - } + val permissionAwareToggle: (Boolean) -> Unit = + { enabled -> + val missingPermission = when (child.id) { + "Screen off widget" -> !isAccessibilityEnabled + "Statusbar icons" -> !isWriteSecureSettingsEnabled + "Notification lighting" -> !isOverlayPermissionGranted || !isNotificationLightingAccessibilityEnabled || !isNotificationListenerEnabled + "Button remap" -> !isAccessibilityEnabled + "Dynamic night light" -> (if (viewModel.isUseUsageAccess.value) !viewModel.isUsageStatsPermissionGranted.value else !isAccessibilityEnabled) || !isWriteSecureSettingsEnabled + "Snooze system notifications" -> !isNotificationListenerEnabled + "Screen locked security" -> !isAccessibilityEnabled || !isWriteSecureSettingsEnabled || !viewModel.isDeviceAdminEnabled.value + "App lock" -> !isAccessibilityEnabled || (if (viewModel.isUseUsageAccess.value) !viewModel.isUsageStatsPermissionGranted.value else false) + "Freeze" -> !com.sameerasw.essentials.utils.ShellUtils.hasPermission( + context + ) + + "Essentials On Display" -> !isAccessibilityEnabled || !isNotificationListenerEnabled + "Call vibrations" -> !isReadPhoneStateEnabled || !isNotificationListenerEnabled + "Calendar Sync" -> androidx.core.content.ContextCompat.checkSelfPermission( + context, + android.Manifest.permission.READ_CALENDAR + ) != android.content.pm.PackageManager.PERMISSION_GRANTED - if (missingPermission) { - childFeatureForPermissions = child.id - showPermissionSheet = true - } else { - BiometricSecurityHelper.runWithAuth( - activity = this@FeatureSettingsActivity, - feature = child, - isToggle = true, - action = { - child.onToggle(viewModel, context, enabled) - } - ) + "Batteries" -> (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S && androidx.core.content.ContextCompat.checkSelfPermission( + context, + android.Manifest.permission.BLUETOOTH_CONNECT + ) != android.content.pm.PackageManager.PERMISSION_GRANTED) + + "Maps power saving mode" -> !isNotificationListenerEnabled || !com.sameerasw.essentials.utils.ShellUtils.hasPermission( + context + ) + + "Caffeinate" -> !viewModel.isPostNotificationsEnabled.value + "Battery notification" -> !viewModel.isPostNotificationsEnabled.value || (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S && !viewModel.isBluetoothPermissionGranted.value) + "Text and animations" -> !viewModel.isWriteSettingsEnabled.value || !isWriteSecureSettingsEnabled + "Lock screen clock" -> !isWriteSecureSettingsEnabled + "Screen refresh rate" -> !com.sameerasw.essentials.utils.ShellUtils.hasPermission( + context + ) + + "Shut-Up!" -> !isWriteSecureSettingsEnabled || !viewModel.isUsageStatsPermissionGranted.value + "Power and Battery" -> !isWriteSecureSettingsEnabled + "Networks" -> !isWriteSecureSettingsEnabled && !com.sameerasw.essentials.utils.ShellUtils.hasPermission( + context + ) + + "Disable safe volume warning" -> !isWriteSecureSettingsEnabled + "Notification snoozing" -> !isWriteSecureSettingsEnabled + else -> false + } + + if (missingPermission) { + childFeatureForPermissions = child.id + showPermissionSheet = true + } else { + BiometricSecurityHelper.runWithAuth( + activity = this@FeatureSettingsActivity, + feature = child, + isToggle = true, + action = { + child.onToggle( + viewModel, + context, + enabled + ) + } + ) + } } - } FeatureCard( modifier = Modifier.highlight(highlightSetting == child.id), @@ -802,7 +832,7 @@ class FeatureSettingsActivity : AppCompatActivity() { } "Smart pixels" -> { - com.sameerasw.essentials.ui.composables.configs.SmartPixelsSettingsUI( + com.sameerasw.essentials.ui.features.system.SmartPixelsSettingsUI( viewModel = viewModel, modifier = Modifier.padding(top = 16.dp), highlightSetting = highlightSetting diff --git a/app/src/main/java/com/sameerasw/essentials/ui/activities/FlashlightIntensityActivity.kt b/app/src/main/java/com/sameerasw/essentials/ui/activities/FlashlightIntensityActivity.kt index 21c4e652e..3e9c7b3bf 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/activities/FlashlightIntensityActivity.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/activities/FlashlightIntensityActivity.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Application Activities + * File: FlashlightIntensityActivity.kt + * Description: Activity component for FlashlightIntensityActivity.kt. + */ + package com.sameerasw.essentials.ui.activities import android.content.Context diff --git a/app/src/main/java/com/sameerasw/essentials/LinkPickerActivity.kt b/app/src/main/java/com/sameerasw/essentials/ui/activities/LinkPickerActivity.kt similarity index 91% rename from app/src/main/java/com/sameerasw/essentials/LinkPickerActivity.kt rename to app/src/main/java/com/sameerasw/essentials/ui/activities/LinkPickerActivity.kt index cb2a00503..f52d9a004 100644 --- a/app/src/main/java/com/sameerasw/essentials/LinkPickerActivity.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/activities/LinkPickerActivity.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Application Activities + * File: LinkPickerActivity.kt + * Description: Activity component for LinkPickerActivity.kt. + */ + package com.sameerasw.essentials import android.content.Intent diff --git a/app/src/main/java/com/sameerasw/essentials/ui/activities/LiveWallpaperActivity.kt b/app/src/main/java/com/sameerasw/essentials/ui/activities/LiveWallpaperActivity.kt index 88bb0faeb..8b90a4932 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/activities/LiveWallpaperActivity.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/activities/LiveWallpaperActivity.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Application Activities + * File: LiveWallpaperActivity.kt + * Description: Activity component for LiveWallpaperActivity.kt. + */ + package com.sameerasw.essentials.ui.activities import android.content.Intent diff --git a/app/src/main/java/com/sameerasw/essentials/ui/activities/LocationAlarmActivity.kt b/app/src/main/java/com/sameerasw/essentials/ui/activities/LocationAlarmActivity.kt index 35a00c6a8..dff843366 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/activities/LocationAlarmActivity.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/activities/LocationAlarmActivity.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Application Activities + * File: LocationAlarmActivity.kt + * Description: Activity component for LocationAlarmActivity.kt. + */ + package com.sameerasw.essentials.ui.activities import android.app.KeyguardManager diff --git a/app/src/main/java/com/sameerasw/essentials/PixelSearchActivity.kt b/app/src/main/java/com/sameerasw/essentials/ui/activities/PixelSearchActivity.kt similarity index 54% rename from app/src/main/java/com/sameerasw/essentials/PixelSearchActivity.kt rename to app/src/main/java/com/sameerasw/essentials/ui/activities/PixelSearchActivity.kt index 4bfd8f3ae..4c110c7dc 100644 --- a/app/src/main/java/com/sameerasw/essentials/PixelSearchActivity.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/activities/PixelSearchActivity.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Application Activities + * File: PixelSearchActivity.kt + * Description: Activity component for PixelSearchActivity.kt. + */ + package com.sameerasw.essentials import android.app.Activity diff --git a/app/src/main/java/com/sameerasw/essentials/ui/activities/PixelSearchbarSettingsActivity.kt b/app/src/main/java/com/sameerasw/essentials/ui/activities/PixelSearchbarSettingsActivity.kt index df086fba3..f7b15aafc 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/activities/PixelSearchbarSettingsActivity.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/activities/PixelSearchbarSettingsActivity.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Application Activities + * File: PixelSearchbarSettingsActivity.kt + * Description: Activity component for PixelSearchbarSettingsActivity.kt. + */ + package com.sameerasw.essentials.ui.activities import android.app.Activity @@ -59,12 +68,12 @@ import com.sameerasw.essentials.R import com.sameerasw.essentials.domain.model.Feature import com.sameerasw.essentials.services.widgets.WidgetScraperService import com.sameerasw.essentials.ui.components.EssentialsFloatingToolbar -import com.sameerasw.essentials.ui.components.cards.IconToggleItem -import com.sameerasw.essentials.ui.components.containers.RoundedCardContainer -import com.sameerasw.essentials.ui.components.pickers.SegmentedPicker -import com.sameerasw.essentials.ui.components.sheets.FeatureHelpBottomSheet -import com.sameerasw.essentials.ui.components.sheets.PermissionsBottomSheet import com.sameerasw.essentials.ui.components.sliders.ConfigSliderItem +import com.sameerasw.essentials.ui.core.cards.IconToggleItem +import com.sameerasw.essentials.ui.core.containers.RoundedCardContainer +import com.sameerasw.essentials.ui.core.pickers.SegmentedPicker +import com.sameerasw.essentials.ui.core.sheets.FeatureHelpBottomSheet +import com.sameerasw.essentials.ui.core.sheets.PermissionsBottomSheet import com.sameerasw.essentials.ui.modifiers.BlurDirection import com.sameerasw.essentials.ui.modifiers.progressiveBlur import com.sameerasw.essentials.ui.theme.EssentialsTheme diff --git a/app/src/main/java/com/sameerasw/essentials/ui/activities/PixelSearchbarTapActivity.kt b/app/src/main/java/com/sameerasw/essentials/ui/activities/PixelSearchbarTapActivity.kt index d6e643cdf..cf46b9e51 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/activities/PixelSearchbarTapActivity.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/activities/PixelSearchbarTapActivity.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Application Activities + * File: PixelSearchbarTapActivity.kt + * Description: Activity component for PixelSearchbarTapActivity.kt. + */ + package com.sameerasw.essentials.ui.activities import android.os.Bundle diff --git a/app/src/main/java/com/sameerasw/essentials/ui/activities/PrivateDnsSettingsActivity.kt b/app/src/main/java/com/sameerasw/essentials/ui/activities/PrivateDnsSettingsActivity.kt index 9ac7f6c74..e1d748db5 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/activities/PrivateDnsSettingsActivity.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/activities/PrivateDnsSettingsActivity.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Application Activities + * File: PrivateDnsSettingsActivity.kt + * Description: Activity component for PrivateDnsSettingsActivity.kt. + */ + package com.sameerasw.essentials.ui.activities import android.os.Bundle @@ -50,7 +59,7 @@ import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.unit.dp import com.sameerasw.essentials.R -import com.sameerasw.essentials.ui.components.containers.RoundedCardContainer +import com.sameerasw.essentials.ui.core.containers.RoundedCardContainer import com.sameerasw.essentials.ui.theme.EssentialsTheme import com.sameerasw.essentials.utils.HapticUtil @@ -203,7 +212,7 @@ fun PrivateDnsSettingsOverlay(onDismiss: () -> Unit) { ) RoundedCardContainer { - com.sameerasw.essentials.ui.components.pickers.SegmentedPicker( + com.sameerasw.essentials.ui.core.pickers.SegmentedPicker( items = listOf(false, true), selectedItem = isCycleMode, onItemSelected = { isCycleMode = it }, diff --git a/app/src/main/java/com/sameerasw/essentials/ui/activities/QSPreferencesActivity.kt b/app/src/main/java/com/sameerasw/essentials/ui/activities/QSPreferencesActivity.kt index 8949a7e51..6fddabe69 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/activities/QSPreferencesActivity.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/activities/QSPreferencesActivity.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Application Activities + * File: QSPreferencesActivity.kt + * Description: Activity component for QSPreferencesActivity.kt. + */ + package com.sameerasw.essentials.ui.activities import android.content.ComponentName diff --git a/app/src/main/java/com/sameerasw/essentials/ui/activities/QsTilesWidgetConfigurationActivity.kt b/app/src/main/java/com/sameerasw/essentials/ui/activities/QsTilesWidgetConfigurationActivity.kt index e89d123f0..4fc4bfe2e 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/activities/QsTilesWidgetConfigurationActivity.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/activities/QsTilesWidgetConfigurationActivity.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Application Activities + * File: QsTilesWidgetConfigurationActivity.kt + * Description: Activity component for QsTilesWidgetConfigurationActivity.kt. + */ + package com.sameerasw.essentials.ui.activities import android.app.Activity diff --git a/app/src/main/java/com/sameerasw/essentials/ui/activities/ScreenOffWidgetConfigureActivity.kt b/app/src/main/java/com/sameerasw/essentials/ui/activities/ScreenOffWidgetConfigureActivity.kt index 3d1c162fb..127348c9f 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/activities/ScreenOffWidgetConfigureActivity.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/activities/ScreenOffWidgetConfigureActivity.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Application Activities + * File: ScreenOffWidgetConfigureActivity.kt + * Description: Activity component for ScreenOffWidgetConfigureActivity.kt. + */ + package com.sameerasw.essentials.ui.activities import android.appwidget.AppWidgetManager @@ -40,8 +49,8 @@ import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.unit.dp import com.sameerasw.essentials.R import com.sameerasw.essentials.services.ScreenOffWidgetProvider -import com.sameerasw.essentials.ui.components.cards.IconToggleItem -import com.sameerasw.essentials.ui.components.containers.RoundedCardContainer +import com.sameerasw.essentials.ui.core.cards.IconToggleItem +import com.sameerasw.essentials.ui.core.containers.RoundedCardContainer import com.sameerasw.essentials.ui.theme.EssentialsTheme import com.sameerasw.essentials.utils.HapticUtil diff --git a/app/src/main/java/com/sameerasw/essentials/SettingsActivity.kt b/app/src/main/java/com/sameerasw/essentials/ui/activities/SettingsActivity.kt similarity index 98% rename from app/src/main/java/com/sameerasw/essentials/SettingsActivity.kt rename to app/src/main/java/com/sameerasw/essentials/ui/activities/SettingsActivity.kt index c5e9788d6..d083a3f46 100644 --- a/app/src/main/java/com/sameerasw/essentials/SettingsActivity.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/activities/SettingsActivity.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Application Activities + * File: SettingsActivity.kt + * Description: Activity component for SettingsActivity.kt. + */ + package com.sameerasw.essentials @@ -85,20 +94,20 @@ import com.sameerasw.essentials.translation.TranslationManager import com.sameerasw.essentials.translation.ui.TranslationSessionSheet import com.sameerasw.essentials.ui.components.EssentialsFloatingToolbar import com.sameerasw.essentials.ui.components.MadebySameeraswCard -import com.sameerasw.essentials.ui.components.cards.FeatureCard -import com.sameerasw.essentials.ui.components.cards.IconToggleItem -import com.sameerasw.essentials.ui.components.cards.PermissionCard -import com.sameerasw.essentials.ui.components.containers.RoundedCardContainer import com.sameerasw.essentials.ui.components.dialogs.AboutSection import com.sameerasw.essentials.ui.components.menus.SegmentedDropdownMenuItem -import com.sameerasw.essentials.ui.components.pickers.CrashReportingPicker -import com.sameerasw.essentials.ui.components.pickers.DefaultTabPicker -import com.sameerasw.essentials.ui.components.pickers.LanguagePicker -import com.sameerasw.essentials.ui.components.sheets.GitHubAuthSheet -import com.sameerasw.essentials.ui.components.sheets.ImportConfigConfirmationSheet -import com.sameerasw.essentials.ui.components.sheets.InstructionsBottomSheet -import com.sameerasw.essentials.ui.components.sheets.UnsupportedFeaturesConfirmationSheet -import com.sameerasw.essentials.ui.components.sheets.UpdateBottomSheet +import com.sameerasw.essentials.ui.core.cards.FeatureCard +import com.sameerasw.essentials.ui.core.cards.IconToggleItem +import com.sameerasw.essentials.ui.core.cards.PermissionCard +import com.sameerasw.essentials.ui.core.containers.RoundedCardContainer +import com.sameerasw.essentials.ui.core.pickers.CrashReportingPicker +import com.sameerasw.essentials.ui.core.pickers.DefaultTabPicker +import com.sameerasw.essentials.ui.core.pickers.LanguagePicker +import com.sameerasw.essentials.ui.core.sheets.GitHubAuthSheet +import com.sameerasw.essentials.ui.core.sheets.ImportConfigConfirmationSheet +import com.sameerasw.essentials.ui.core.sheets.InstructionsBottomSheet +import com.sameerasw.essentials.ui.core.sheets.UnsupportedFeaturesConfirmationSheet +import com.sameerasw.essentials.ui.core.sheets.UpdateBottomSheet import com.sameerasw.essentials.ui.modifiers.BlurDirection import com.sameerasw.essentials.ui.modifiers.progressiveBlur import com.sameerasw.essentials.ui.theme.EssentialsTheme @@ -152,7 +161,7 @@ class SettingsActivity : AppCompatActivity() { } if (showBugReportSheet) { - com.sameerasw.essentials.ui.components.sheets.BugReportBottomSheet( + com.sameerasw.essentials.ui.core.sheets.BugReportBottomSheet( viewModel = viewModel, onDismissRequest = { showBugReportSheet = false } ) @@ -266,7 +275,8 @@ fun SettingsContent( var isGenAISupported by remember { mutableStateOf(false) } LaunchedEffect(Unit) { - isGenAISupported = com.sameerasw.essentials.domain.genai.GenAIAutomationService.isSupported() + isGenAISupported = + com.sameerasw.essentials.domain.genai.GenAIAutomationService.isSupported() } val isUpdateNotificationEnabled by viewModel.isUpdateNotificationEnabled @@ -471,7 +481,6 @@ fun SettingsContent( } - // Updates Section Text( text = "Updates", diff --git a/app/src/main/java/com/sameerasw/essentials/ShortcutHandlerActivity.kt b/app/src/main/java/com/sameerasw/essentials/ui/activities/ShortcutHandlerActivity.kt similarity index 94% rename from app/src/main/java/com/sameerasw/essentials/ShortcutHandlerActivity.kt rename to app/src/main/java/com/sameerasw/essentials/ui/activities/ShortcutHandlerActivity.kt index f271cbbcf..199035a8b 100644 --- a/app/src/main/java/com/sameerasw/essentials/ShortcutHandlerActivity.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/activities/ShortcutHandlerActivity.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Application Activities + * File: ShortcutHandlerActivity.kt + * Description: Activity component for ShortcutHandlerActivity.kt. + */ + package com.sameerasw.essentials import android.content.Intent diff --git a/app/src/main/java/com/sameerasw/essentials/ShutUpShortcutActivity.kt b/app/src/main/java/com/sameerasw/essentials/ui/activities/ShutUpShortcutActivity.kt similarity index 97% rename from app/src/main/java/com/sameerasw/essentials/ShutUpShortcutActivity.kt rename to app/src/main/java/com/sameerasw/essentials/ui/activities/ShutUpShortcutActivity.kt index f1e2e19d5..860749caa 100644 --- a/app/src/main/java/com/sameerasw/essentials/ShutUpShortcutActivity.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/activities/ShutUpShortcutActivity.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Application Activities + * File: ShutUpShortcutActivity.kt + * Description: Activity component for ShutUpShortcutActivity.kt. + */ + package com.sameerasw.essentials import android.content.ContentResolver diff --git a/app/src/main/java/com/sameerasw/essentials/ui/activities/TileAuthActivity.kt b/app/src/main/java/com/sameerasw/essentials/ui/activities/TileAuthActivity.kt index 423843256..90c7f5fa3 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/activities/TileAuthActivity.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/activities/TileAuthActivity.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Application Activities + * File: TileAuthActivity.kt + * Description: Activity component for TileAuthActivity.kt. + */ + package com.sameerasw.essentials.ui.activities import android.os.Bundle diff --git a/app/src/main/java/com/sameerasw/essentials/ui/activities/TravelCompassActivity.kt b/app/src/main/java/com/sameerasw/essentials/ui/activities/TravelCompassActivity.kt index afc7b729a..e98b9ce89 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/activities/TravelCompassActivity.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/activities/TravelCompassActivity.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Application Activities + * File: TravelCompassActivity.kt + * Description: Activity component for TravelCompassActivity.kt. + */ + package com.sameerasw.essentials.ui.activities import android.content.Intent diff --git a/app/src/main/java/com/sameerasw/essentials/ui/activities/WallpaperActivity.kt b/app/src/main/java/com/sameerasw/essentials/ui/activities/WallpaperActivity.kt index c9d293c4d..7d64bc9f1 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/activities/WallpaperActivity.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/activities/WallpaperActivity.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Application Activities + * File: WallpaperActivity.kt + * Description: Activity component for WallpaperActivity.kt. + */ + package com.sameerasw.essentials.ui.activities import android.os.Bundle diff --git a/app/src/main/java/com/sameerasw/essentials/ui/activities/WatermarkActivity.kt b/app/src/main/java/com/sameerasw/essentials/ui/activities/WatermarkActivity.kt index 3d79b9d50..906857bbb 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/activities/WatermarkActivity.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/activities/WatermarkActivity.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Application Activities + * File: WatermarkActivity.kt + * Description: Activity component for WatermarkActivity.kt. + */ + package com.sameerasw.essentials.ui.activities import android.content.Intent diff --git a/app/src/main/java/com/sameerasw/essentials/ui/activities/YourAndroidActivity.kt b/app/src/main/java/com/sameerasw/essentials/ui/activities/YourAndroidActivity.kt index 37dfc5406..9abbf44c0 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/activities/YourAndroidActivity.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/activities/YourAndroidActivity.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Application Activities + * File: YourAndroidActivity.kt + * Description: Activity component for YourAndroidActivity.kt. + */ + package com.sameerasw.essentials.ui.activities import android.os.Bundle @@ -64,13 +73,13 @@ import com.sameerasw.essentials.ui.components.AppsActionButtons import com.sameerasw.essentials.ui.components.DeviceHeroCard import com.sameerasw.essentials.ui.components.EssentialsFloatingToolbar import com.sameerasw.essentials.ui.components.ImportExportButtons -import com.sameerasw.essentials.ui.components.cards.TrackedRepoCard -import com.sameerasw.essentials.ui.components.containers.RoundedCardContainer import com.sameerasw.essentials.ui.components.menus.SegmentedDropdownMenu import com.sameerasw.essentials.ui.components.menus.SegmentedDropdownMenuItem -import com.sameerasw.essentials.ui.components.sheets.AddRepoBottomSheet -import com.sameerasw.essentials.ui.components.sheets.GitHubAuthSheet -import com.sameerasw.essentials.ui.components.sheets.UpdateBottomSheet +import com.sameerasw.essentials.ui.core.cards.TrackedRepoCard +import com.sameerasw.essentials.ui.core.containers.RoundedCardContainer +import com.sameerasw.essentials.ui.core.sheets.AddRepoBottomSheet +import com.sameerasw.essentials.ui.core.sheets.GitHubAuthSheet +import com.sameerasw.essentials.ui.core.sheets.UpdateBottomSheet import com.sameerasw.essentials.ui.modifiers.BlurDirection import com.sameerasw.essentials.ui.modifiers.progressiveBlur import com.sameerasw.essentials.ui.theme.EssentialsTheme diff --git a/app/src/main/java/com/sameerasw/essentials/ui/components/AppsComponents.kt b/app/src/main/java/com/sameerasw/essentials/ui/components/AppsComponents.kt index c5ac3bfc2..d90732208 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/components/AppsComponents.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/components/AppsComponents.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Module + * File: AppsComponents.kt + * Description: UI layout element for AppsComponents.kt. + */ + package com.sameerasw.essentials.ui.components import androidx.compose.foundation.background diff --git a/app/src/main/java/com/sameerasw/essentials/ui/components/DeviceHeroCard.kt b/app/src/main/java/com/sameerasw/essentials/ui/components/DeviceHeroCard.kt index 74637da97..31dc400de 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/components/DeviceHeroCard.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/components/DeviceHeroCard.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Module + * File: DeviceHeroCard.kt + * Description: UI layout element for DeviceHeroCard.kt. + */ + package com.sameerasw.essentials.ui.components import android.content.ComponentName @@ -48,7 +57,7 @@ import coil.decode.GifDecoder import coil.decode.ImageDecoderDecoder import coil.request.ImageRequest import com.sameerasw.essentials.R -import com.sameerasw.essentials.ui.components.containers.RoundedCardContainer +import com.sameerasw.essentials.ui.core.containers.RoundedCardContainer import com.sameerasw.essentials.ui.theme.Shapes import com.sameerasw.essentials.utils.DeviceImageMapper import com.sameerasw.essentials.utils.DeviceInfo @@ -326,7 +335,7 @@ fun DeviceHeroCard( ) } - com.sameerasw.essentials.ui.components.cards.BatteryInfoCard() + com.sameerasw.essentials.ui.core.cards.BatteryInfoCard() if (isPixel) { Column( diff --git a/app/src/main/java/com/sameerasw/essentials/ui/components/EssentialsFloatingToolbar.kt b/app/src/main/java/com/sameerasw/essentials/ui/components/EssentialsFloatingToolbar.kt index 200f38cd6..06ae9e4a2 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/components/EssentialsFloatingToolbar.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/components/EssentialsFloatingToolbar.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Module + * File: EssentialsFloatingToolbar.kt + * Description: UI layout element for EssentialsFloatingToolbar.kt. + */ + package com.sameerasw.essentials.ui.components import androidx.compose.animation.core.Spring diff --git a/app/src/main/java/com/sameerasw/essentials/ui/components/FavoriteCarousel.kt b/app/src/main/java/com/sameerasw/essentials/ui/components/FavoriteCarousel.kt index 74d206dbd..3692f4fa0 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/components/FavoriteCarousel.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/components/FavoriteCarousel.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Module + * File: FavoriteCarousel.kt + * Description: UI layout element for FavoriteCarousel.kt. + */ + package com.sameerasw.essentials.ui.components import androidx.compose.animation.core.animateDpAsState diff --git a/app/src/main/java/com/sameerasw/essentials/ui/components/HelpAndGuides.kt b/app/src/main/java/com/sameerasw/essentials/ui/components/HelpAndGuides.kt index cd012a07b..4868a4349 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/components/HelpAndGuides.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/components/HelpAndGuides.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Module + * File: HelpAndGuides.kt + * Description: UI layout element for HelpAndGuides.kt. + */ + package com.sameerasw.essentials.ui.components import android.content.Intent @@ -41,7 +50,7 @@ import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.unit.dp import androidx.core.net.toUri import com.sameerasw.essentials.R -import com.sameerasw.essentials.ui.components.containers.RoundedCardContainer +import com.sameerasw.essentials.ui.core.containers.RoundedCardContainer data class InstructionStep( val instruction: String, diff --git a/app/src/main/java/com/sameerasw/essentials/ui/components/MadebySameeraswCard.kt b/app/src/main/java/com/sameerasw/essentials/ui/components/MadebySameeraswCard.kt index 1700fafcd..1c088b875 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/components/MadebySameeraswCard.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/components/MadebySameeraswCard.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Module + * File: MadebySameeraswCard.kt + * Description: UI layout element for MadebySameeraswCard.kt. + */ + package com.sameerasw.essentials.ui.components import android.content.Intent diff --git a/app/src/main/java/com/sameerasw/essentials/ui/components/ReusableTopAppBar.kt b/app/src/main/java/com/sameerasw/essentials/ui/components/ReusableTopAppBar.kt index ea357a01b..7c32f46c9 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/components/ReusableTopAppBar.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/components/ReusableTopAppBar.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Module + * File: ReusableTopAppBar.kt + * Description: UI layout element for ReusableTopAppBar.kt. + */ + package com.sameerasw.essentials.ui.components import androidx.compose.foundation.background diff --git a/app/src/main/java/com/sameerasw/essentials/ui/components/WhatsNewCustomContent.kt b/app/src/main/java/com/sameerasw/essentials/ui/components/WhatsNewCustomContent.kt index 75fcf839e..41e133b1d 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/components/WhatsNewCustomContent.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/components/WhatsNewCustomContent.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Module + * File: WhatsNewCustomContent.kt + * Description: UI layout element for WhatsNewCustomContent.kt. + */ + package com.sameerasw.essentials.ui.components import androidx.compose.foundation.layout.Arrangement diff --git a/app/src/main/java/com/sameerasw/essentials/ui/components/animations/LottieFeatureAnimation.kt b/app/src/main/java/com/sameerasw/essentials/ui/components/animations/LottieFeatureAnimation.kt index 49b5504a4..b71c2e7d4 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/components/animations/LottieFeatureAnimation.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/components/animations/LottieFeatureAnimation.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Module + * File: LottieFeatureAnimation.kt + * Description: UI layout element for LottieFeatureAnimation.kt. + */ + package com.sameerasw.essentials.ui.components.animations import androidx.compose.foundation.layout.Box diff --git a/app/src/main/java/com/sameerasw/essentials/ui/components/buttons/ListExpandToggleButton.kt b/app/src/main/java/com/sameerasw/essentials/ui/components/buttons/ListExpandToggleButton.kt index 4ab479838..6b51783a1 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/components/buttons/ListExpandToggleButton.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/components/buttons/ListExpandToggleButton.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Module + * File: ListExpandToggleButton.kt + * Description: UI layout element for ListExpandToggleButton.kt. + */ + package com.sameerasw.essentials.ui.components.buttons import androidx.compose.animation.core.animateFloatAsState @@ -96,7 +105,9 @@ fun ListExpandToggleButton( contentPadding = PaddingValues(horizontal = 20.dp, vertical = 14.dp) ) { Icon( - painter = painterResource(id = iconRes ?: R.drawable.rounded_keyboard_arrow_down_24), + painter = painterResource( + id = iconRes ?: R.drawable.rounded_keyboard_arrow_down_24 + ), contentDescription = null, tint = MaterialTheme.colorScheme.primary, modifier = Modifier diff --git a/app/src/main/java/com/sameerasw/essentials/ui/components/dialogs/AboutSection.kt b/app/src/main/java/com/sameerasw/essentials/ui/components/dialogs/AboutSection.kt index 0de26e61d..2bb583749 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/components/dialogs/AboutSection.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/components/dialogs/AboutSection.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Module + * File: AboutSection.kt + * Description: UI layout element for AboutSection.kt. + */ + package com.sameerasw.essentials.ui.components.dialogs import android.content.ActivityNotFoundException diff --git a/app/src/main/java/com/sameerasw/essentials/ui/components/genai/GenAIFloatingPill.kt b/app/src/main/java/com/sameerasw/essentials/ui/components/genai/GenAIFloatingPill.kt index f47eade1f..4b4aaa930 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/components/genai/GenAIFloatingPill.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/components/genai/GenAIFloatingPill.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Module + * File: GenAIFloatingPill.kt + * Description: UI layout element for GenAIFloatingPill.kt. + */ + package com.sameerasw.essentials.ui.components.genai import android.view.Gravity @@ -116,7 +125,7 @@ fun GenAIFloatingPill( ) window.setSoftInputMode( WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN or - WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE + WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE ) window.setDimAmount(0.32f) window.setBackgroundDrawableResource(android.R.color.transparent) @@ -168,7 +177,11 @@ fun GenAIFloatingPill( text = suggestion.explanation, style = MaterialTheme.typography.bodyMedium, color = MaterialTheme.colorScheme.onPrimary.copy(alpha = 0.9f), - modifier = Modifier.padding(bottom = 12.dp, start = 4.dp, end = 4.dp) + modifier = Modifier.padding( + bottom = 12.dp, + start = 4.dp, + end = 4.dp + ) ) } @@ -177,19 +190,36 @@ fun GenAIFloatingPill( val appsCount = suggestion.selectedApps.size if (appsCount > 0) "Apps ($appsCount selected)" else "App Automation" } + suggestion.triggerType == "Schedule" && suggestion.hour != null -> { - String.format("Schedule (%02d:%02d)", suggestion.hour, suggestion.minute ?: 0) + String.format( + "Schedule (%02d:%02d)", + suggestion.hour, + suggestion.minute ?: 0 + ) } + suggestion.stateType == "TimePeriod" && suggestion.hour != null && suggestion.endHour != null -> { - String.format("Time Period (%02d:%02d - %02d:%02d)", suggestion.hour, suggestion.minute ?: 0, suggestion.endHour, suggestion.endMinute ?: 0) + String.format( + "Time Period (%02d:%02d - %02d:%02d)", + suggestion.hour, + suggestion.minute ?: 0, + suggestion.endHour, + suggestion.endMinute ?: 0 + ) } + else -> suggestion.triggerType ?: suggestion.stateType ?: suggestion.title.ifEmpty { suggestion.type } } val iconRes = when { - suggestion.type.equals("APP", ignoreCase = true) -> R.drawable.rounded_apps_24 + suggestion.type.equals( + "APP", + ignoreCase = true + ) -> R.drawable.rounded_apps_24 + suggestion.triggerType != null -> R.drawable.rounded_bolt_24 suggestion.stateType != null -> R.drawable.rounded_toggle_on_24 else -> R.drawable.rounded_apps_24 @@ -281,14 +311,22 @@ fun GenAIFloatingPill( val tags = suggestion.freezeTagIds.joinToString() if (tags.isNotBlank()) "$mode ($tags)" else mode } + "SoundMode" -> suggestion.soundMode ?: "SOUND" "SometimesEssentials" -> { val details = mutableListOf() - if (suggestion.lockScreenClockStyle != null) details.add("Clock: ${suggestion.lockScreenClockStyle}") - if (suggestion.alwaysOnDisplayMode != null) details.add("AOD: ${suggestion.alwaysOnDisplayMode}") - if (suggestion.essentialsOnDisplayMode != null) details.add("EOD: ${suggestion.essentialsOnDisplayMode}") + if (suggestion.lockScreenClockStyle != null) details.add( + "Clock: ${suggestion.lockScreenClockStyle}" + ) + if (suggestion.alwaysOnDisplayMode != null) details.add( + "AOD: ${suggestion.alwaysOnDisplayMode}" + ) + if (suggestion.essentialsOnDisplayMode != null) details.add( + "EOD: ${suggestion.essentialsOnDisplayMode}" + ) if (details.isNotEmpty()) details.joinToString(" • ") else null } + else -> null } @@ -321,7 +359,9 @@ fun GenAIFloatingPill( Text( text = actionDetail, style = MaterialTheme.typography.bodySmall, - color = MaterialTheme.colorScheme.onPrimary.copy(alpha = 0.8f), + color = MaterialTheme.colorScheme.onPrimary.copy( + alpha = 0.8f + ), maxLines = 1, overflow = TextOverflow.Ellipsis ) @@ -386,7 +426,9 @@ fun GenAIFloatingPill( focusedTextColor = MaterialTheme.colorScheme.onPrimary, unfocusedTextColor = MaterialTheme.colorScheme.onPrimary, disabledTextColor = MaterialTheme.colorScheme.onPrimary, - disabledPlaceholderColor = MaterialTheme.colorScheme.onPrimary.copy(alpha = 0.6f), + disabledPlaceholderColor = MaterialTheme.colorScheme.onPrimary.copy( + alpha = 0.6f + ), focusedContainerColor = Color.Transparent, unfocusedContainerColor = Color.Transparent, disabledContainerColor = Color.Transparent, diff --git a/app/src/main/java/com/sameerasw/essentials/ui/components/linkActions/AppPickerAdapter.kt b/app/src/main/java/com/sameerasw/essentials/ui/components/linkActions/AppPickerAdapter.kt index df5e4469c..98e38d11b 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/components/linkActions/AppPickerAdapter.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/components/linkActions/AppPickerAdapter.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Module + * File: AppPickerAdapter.kt + * Description: UI layout element for AppPickerAdapter.kt. + */ + package com.sameerasw.essentials.ui.components.linkActions import android.content.pm.ResolveInfo diff --git a/app/src/main/java/com/sameerasw/essentials/ui/components/linkActions/LinkPickerAdapter.kt b/app/src/main/java/com/sameerasw/essentials/ui/components/linkActions/LinkPickerAdapter.kt index edefe9363..9163d776c 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/components/linkActions/LinkPickerAdapter.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/components/linkActions/LinkPickerAdapter.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Module + * File: LinkPickerAdapter.kt + * Description: UI layout element for LinkPickerAdapter.kt. + */ + package com.sameerasw.essentials.ui.components.linkActions import android.content.ClipData diff --git a/app/src/main/java/com/sameerasw/essentials/ui/components/linkActions/OpenWithFragment.kt b/app/src/main/java/com/sameerasw/essentials/ui/components/linkActions/OpenWithFragment.kt index ed953e833..34021cafd 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/components/linkActions/OpenWithFragment.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/components/linkActions/OpenWithFragment.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Module + * File: OpenWithFragment.kt + * Description: UI layout element for OpenWithFragment.kt. + */ + package com.sameerasw.essentials.ui.components.linkActions import android.content.Intent @@ -21,7 +30,7 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.unit.Dp import androidx.compose.ui.unit.dp -import com.sameerasw.essentials.ui.components.containers.RoundedCardContainer +import com.sameerasw.essentials.ui.core.containers.RoundedCardContainer @Composable fun OpenWithContent( diff --git a/app/src/main/java/com/sameerasw/essentials/ui/components/linkActions/ShareWithFragment.kt b/app/src/main/java/com/sameerasw/essentials/ui/components/linkActions/ShareWithFragment.kt index 56a2ebf9e..9f0a8ceb4 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/components/linkActions/ShareWithFragment.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/components/linkActions/ShareWithFragment.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Module + * File: ShareWithFragment.kt + * Description: UI layout element for ShareWithFragment.kt. + */ + package com.sameerasw.essentials.ui.components.linkActions import android.content.Intent @@ -21,7 +30,7 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.unit.Dp import androidx.compose.ui.unit.dp -import com.sameerasw.essentials.ui.components.containers.RoundedCardContainer +import com.sameerasw.essentials.ui.core.containers.RoundedCardContainer @Composable fun ShareWithContent( diff --git a/app/src/main/java/com/sameerasw/essentials/ui/components/menus/SegmentedMenu.kt b/app/src/main/java/com/sameerasw/essentials/ui/components/menus/SegmentedMenu.kt index 098a10a52..6f7fe6c99 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/components/menus/SegmentedMenu.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/components/menus/SegmentedMenu.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Module + * File: SegmentedMenu.kt + * Description: UI layout element for SegmentedMenu.kt. + */ + package com.sameerasw.essentials.ui.components.menus import androidx.compose.foundation.background @@ -14,7 +23,7 @@ import androidx.compose.ui.draw.clip import androidx.compose.ui.graphics.Color import androidx.compose.ui.unit.DpOffset import androidx.compose.ui.unit.dp -import com.sameerasw.essentials.ui.components.containers.RoundedCardContainer +import com.sameerasw.essentials.ui.core.containers.RoundedCardContainer @Composable fun SegmentedDropdownMenu( diff --git a/app/src/main/java/com/sameerasw/essentials/ui/components/modifiers/ShimmerModifier.kt b/app/src/main/java/com/sameerasw/essentials/ui/components/modifiers/ShimmerModifier.kt index d47c76f69..11ccf1724 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/components/modifiers/ShimmerModifier.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/components/modifiers/ShimmerModifier.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Module + * File: ShimmerModifier.kt + * Description: UI layout element for ShimmerModifier.kt. + */ + package com.sameerasw.essentials.ui.components.modifiers import androidx.compose.animation.core.FastOutSlowInEasing diff --git a/app/src/main/java/com/sameerasw/essentials/ui/components/sliders/ConfigSliderItem.kt b/app/src/main/java/com/sameerasw/essentials/ui/components/sliders/ConfigSliderItem.kt index 3adf64cec..3bd5a4b82 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/components/sliders/ConfigSliderItem.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/components/sliders/ConfigSliderItem.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Module + * File: ConfigSliderItem.kt + * Description: UI layout element for ConfigSliderItem.kt. + */ + package com.sameerasw.essentials.ui.components.sliders import androidx.compose.foundation.ExperimentalFoundationApi diff --git a/app/src/main/java/com/sameerasw/essentials/ui/components/text/SimpleMarkdown.kt b/app/src/main/java/com/sameerasw/essentials/ui/components/text/SimpleMarkdown.kt index a788a9f8a..342684bb5 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/components/text/SimpleMarkdown.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/components/text/SimpleMarkdown.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Module + * File: SimpleMarkdown.kt + * Description: UI layout element for SimpleMarkdown.kt. + */ + package com.sameerasw.essentials.ui.components.text import androidx.compose.foundation.background diff --git a/app/src/main/java/com/sameerasw/essentials/ui/composables/SetupFeatures.kt b/app/src/main/java/com/sameerasw/essentials/ui/composables/SetupFeatures.kt index 2385c0c93..bfa4f0fd7 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/composables/SetupFeatures.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/composables/SetupFeatures.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Module + * File: SetupFeatures.kt + * Description: UI layout element for SetupFeatures.kt. + */ + package com.sameerasw.essentials.ui.composables import android.app.Activity @@ -82,11 +91,10 @@ import com.sameerasw.essentials.domain.registry.PermissionRegistry import com.sameerasw.essentials.ui.activities.YourAndroidActivity import com.sameerasw.essentials.ui.components.FavoriteCarousel import com.sameerasw.essentials.ui.components.buttons.ListExpandToggleButton -import com.sameerasw.essentials.ui.components.cards.FeatureCard -import com.sameerasw.essentials.ui.components.cards.IconToggleItem -import com.sameerasw.essentials.ui.components.containers.RoundedCardContainer -import com.sameerasw.essentials.ui.components.sheets.PermissionItem -import com.sameerasw.essentials.ui.components.sheets.PermissionsBottomSheet +import com.sameerasw.essentials.ui.core.cards.FeatureCard +import com.sameerasw.essentials.ui.core.containers.RoundedCardContainer +import com.sameerasw.essentials.ui.core.sheets.PermissionItem +import com.sameerasw.essentials.ui.core.sheets.PermissionsBottomSheet import com.sameerasw.essentials.utils.BiometricSecurityHelper import com.sameerasw.essentials.utils.DeviceUtils import com.sameerasw.essentials.utils.HapticUtil @@ -849,13 +857,13 @@ fun SetupFeatures( var showInstructionsSheet by rememberSaveable { mutableStateOf(false) } if (showInstructionsSheet) { - com.sameerasw.essentials.ui.components.sheets.InstructionsBottomSheet( + com.sameerasw.essentials.ui.core.sheets.InstructionsBottomSheet( onDismissRequest = { showInstructionsSheet = false } ) } if (showHelpSheet && selectedHelpFeature != null) { - com.sameerasw.essentials.ui.components.sheets.FeatureHelpBottomSheet( + com.sameerasw.essentials.ui.core.sheets.FeatureHelpBottomSheet( onDismissRequest = { showHelpSheet = false selectedHelpFeature = null @@ -1282,7 +1290,9 @@ fun SetupFeatures( val sections = sectionFeatureIdsList.map { ids -> ids.mapNotNull { featureMap[it] } - }.filter { it.isNotEmpty() } + if (unassignedFeatures.isNotEmpty()) listOf(unassignedFeatures) else emptyList() + }.filter { it.isNotEmpty() } + if (unassignedFeatures.isNotEmpty()) listOf( + unassignedFeatures + ) else emptyList() sections.forEachIndexed { sectionIndex, sectionFeatures -> item { diff --git a/app/src/main/java/com/sameerasw/essentials/ui/composables/WelcomeScreen.kt b/app/src/main/java/com/sameerasw/essentials/ui/composables/WelcomeScreen.kt index 715af0437..f1a5c22f8 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/composables/WelcomeScreen.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/composables/WelcomeScreen.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Module + * File: WelcomeScreen.kt + * Description: UI layout element for WelcomeScreen.kt. + */ + package com.sameerasw.essentials.ui.composables import android.content.Intent @@ -78,12 +87,12 @@ import coil.request.ImageRequest import com.sameerasw.essentials.R import com.sameerasw.essentials.ui.components.HelpAndGuidesContent import com.sameerasw.essentials.ui.components.WhatsNewCustomContent -import com.sameerasw.essentials.ui.components.cards.IconToggleItem -import com.sameerasw.essentials.ui.components.containers.RoundedCardContainer -import com.sameerasw.essentials.ui.components.pickers.CrashReportingPicker -import com.sameerasw.essentials.ui.components.pickers.LanguagePicker -import com.sameerasw.essentials.ui.components.sheets.UpdateBottomSheet import com.sameerasw.essentials.ui.components.text.SimpleMarkdown +import com.sameerasw.essentials.ui.core.cards.IconToggleItem +import com.sameerasw.essentials.ui.core.containers.RoundedCardContainer +import com.sameerasw.essentials.ui.core.pickers.CrashReportingPicker +import com.sameerasw.essentials.ui.core.pickers.LanguagePicker +import com.sameerasw.essentials.ui.core.sheets.UpdateBottomSheet import com.sameerasw.essentials.ui.theme.GoogleSansFlexRounded import com.sameerasw.essentials.utils.DeviceUtils import com.sameerasw.essentials.utils.HapticUtil diff --git a/app/src/main/java/com/sameerasw/essentials/ui/components/cards/AppToggleItem.kt b/app/src/main/java/com/sameerasw/essentials/ui/core/cards/AppToggleItem.kt similarity index 97% rename from app/src/main/java/com/sameerasw/essentials/ui/components/cards/AppToggleItem.kt rename to app/src/main/java/com/sameerasw/essentials/ui/core/cards/AppToggleItem.kt index 9b99de08d..bd139a912 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/components/cards/AppToggleItem.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/core/cards/AppToggleItem.kt @@ -1,4 +1,13 @@ -package com.sameerasw.essentials.ui.components.cards +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Core Components + * File: AppToggleItem.kt + * Description: Reusable core UI component for AppToggleItem.kt. + */ + +package com.sameerasw.essentials.ui.core.cards import androidx.compose.foundation.Image import androidx.compose.foundation.background diff --git a/app/src/main/java/com/sameerasw/essentials/ui/components/cards/BatteryInfoCard.kt b/app/src/main/java/com/sameerasw/essentials/ui/core/cards/BatteryInfoCard.kt similarity index 94% rename from app/src/main/java/com/sameerasw/essentials/ui/components/cards/BatteryInfoCard.kt rename to app/src/main/java/com/sameerasw/essentials/ui/core/cards/BatteryInfoCard.kt index f9b7e46bf..8eecf116e 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/components/cards/BatteryInfoCard.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/core/cards/BatteryInfoCard.kt @@ -1,4 +1,13 @@ -package com.sameerasw.essentials.ui.components.cards +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Core Components + * File: BatteryInfoCard.kt + * Description: Reusable core UI component for BatteryInfoCard.kt. + */ + +package com.sameerasw.essentials.ui.core.cards import android.content.BroadcastReceiver import android.content.Context @@ -32,12 +41,12 @@ import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.unit.dp import com.sameerasw.essentials.R -import com.sameerasw.essentials.ui.components.sheets.BatteryDetailsBottomSheet +import com.sameerasw.essentials.ui.core.sheets.BatteryDetailsBottomSheet import com.sameerasw.essentials.ui.theme.Shapes -import com.sameerasw.essentials.utils.BatteryInfoUtil import com.sameerasw.essentials.utils.DeviceUtils import com.sameerasw.essentials.utils.HapticUtil import com.sameerasw.essentials.utils.ShellUtils +import com.sameerasw.essentials.utils.battery.BatteryInfoUtil @OptIn(ExperimentalFoundationApi::class) @Composable diff --git a/app/src/main/java/com/sameerasw/essentials/ui/components/cards/ConfigPickerItem.kt b/app/src/main/java/com/sameerasw/essentials/ui/core/cards/ConfigPickerItem.kt similarity index 96% rename from app/src/main/java/com/sameerasw/essentials/ui/components/cards/ConfigPickerItem.kt rename to app/src/main/java/com/sameerasw/essentials/ui/core/cards/ConfigPickerItem.kt index a69632b76..0550600b4 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/components/cards/ConfigPickerItem.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/core/cards/ConfigPickerItem.kt @@ -1,4 +1,13 @@ -package com.sameerasw.essentials.ui.components.cards +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Core Components + * File: ConfigPickerItem.kt + * Description: Reusable core UI component for ConfigPickerItem.kt. + */ + +package com.sameerasw.essentials.ui.core.cards import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.ColumnScope diff --git a/app/src/main/java/com/sameerasw/essentials/ui/components/cards/FeatureCard.kt b/app/src/main/java/com/sameerasw/essentials/ui/core/cards/FeatureCard.kt similarity index 98% rename from app/src/main/java/com/sameerasw/essentials/ui/components/cards/FeatureCard.kt rename to app/src/main/java/com/sameerasw/essentials/ui/core/cards/FeatureCard.kt index f346a50c9..079b0092a 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/components/cards/FeatureCard.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/core/cards/FeatureCard.kt @@ -1,4 +1,14 @@ -package com.sameerasw.essentials.ui.components.cards +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Core UI Components + * File: FeatureCard.kt + * Description: Reusable high-level feature card composable with pastel icon containers + * and status indicators. + */ + +package com.sameerasw.essentials.ui.core.cards import androidx.compose.animation.core.animateDpAsState import androidx.compose.animation.core.animateFloatAsState diff --git a/app/src/main/java/com/sameerasw/essentials/ui/components/cards/FeatureDropdownRow.kt b/app/src/main/java/com/sameerasw/essentials/ui/core/cards/FeatureDropdownRow.kt similarity index 93% rename from app/src/main/java/com/sameerasw/essentials/ui/components/cards/FeatureDropdownRow.kt rename to app/src/main/java/com/sameerasw/essentials/ui/core/cards/FeatureDropdownRow.kt index 1bdbe5d93..4a7a3985c 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/components/cards/FeatureDropdownRow.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/core/cards/FeatureDropdownRow.kt @@ -1,4 +1,13 @@ -package com.sameerasw.essentials.ui.components.cards +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Core Components + * File: FeatureDropdownRow.kt + * Description: Reusable core UI component for FeatureDropdownRow.kt. + */ + +package com.sameerasw.essentials.ui.core.cards import androidx.compose.foundation.background import androidx.compose.foundation.layout.Arrangement @@ -91,7 +100,9 @@ fun FeatureDropdownRow( enabled = isChecked, shape = RoundedCornerShape(12.dp), color = if (isChecked) MaterialTheme.colorScheme.primaryContainer else MaterialTheme.colorScheme.surfaceContainerHighest, - contentColor = if (isChecked) MaterialTheme.colorScheme.onPrimaryContainer else MaterialTheme.colorScheme.onSurfaceVariant.copy(alpha = 0.5f) + contentColor = if (isChecked) MaterialTheme.colorScheme.onPrimaryContainer else MaterialTheme.colorScheme.onSurfaceVariant.copy( + alpha = 0.5f + ) ) { Text( text = selectedValue, diff --git a/app/src/main/java/com/sameerasw/essentials/ui/components/cards/FeatureToggleRow.kt b/app/src/main/java/com/sameerasw/essentials/ui/core/cards/FeatureToggleRow.kt similarity index 92% rename from app/src/main/java/com/sameerasw/essentials/ui/components/cards/FeatureToggleRow.kt rename to app/src/main/java/com/sameerasw/essentials/ui/core/cards/FeatureToggleRow.kt index 856bb73c8..e8ce6852b 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/components/cards/FeatureToggleRow.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/core/cards/FeatureToggleRow.kt @@ -1,4 +1,13 @@ -package com.sameerasw.essentials.ui.components.cards +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Core Components + * File: FeatureToggleRow.kt + * Description: Reusable core UI component for FeatureToggleRow.kt. + */ + +package com.sameerasw.essentials.ui.core.cards import androidx.compose.foundation.background import androidx.compose.foundation.layout.Arrangement diff --git a/app/src/main/java/com/sameerasw/essentials/ui/components/cards/IconToggleItem.kt b/app/src/main/java/com/sameerasw/essentials/ui/core/cards/IconToggleItem.kt similarity index 97% rename from app/src/main/java/com/sameerasw/essentials/ui/components/cards/IconToggleItem.kt rename to app/src/main/java/com/sameerasw/essentials/ui/core/cards/IconToggleItem.kt index f26a074d6..e00d102e3 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/components/cards/IconToggleItem.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/core/cards/IconToggleItem.kt @@ -1,4 +1,14 @@ -package com.sameerasw.essentials.ui.components.cards +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Core UI Components + * File: IconToggleItem.kt + * Description: Standard settings item composable with leading icon, title, supporting text, + * and trailing switch control. + */ + +package com.sameerasw.essentials.ui.core.cards import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Row diff --git a/app/src/main/java/com/sameerasw/essentials/ui/components/cards/PermissionCard.kt b/app/src/main/java/com/sameerasw/essentials/ui/core/cards/PermissionCard.kt similarity index 97% rename from app/src/main/java/com/sameerasw/essentials/ui/components/cards/PermissionCard.kt rename to app/src/main/java/com/sameerasw/essentials/ui/core/cards/PermissionCard.kt index 0df48f878..4388beadb 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/components/cards/PermissionCard.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/core/cards/PermissionCard.kt @@ -1,4 +1,14 @@ -package com.sameerasw.essentials.ui.components.cards +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Core UI Components + * File: PermissionCard.kt + * Description: Material 3 card container for rendering permission requirement states, + * action triggers, Shizuku options, and guidance instructions. + */ + +package com.sameerasw.essentials.ui.core.cards import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Box diff --git a/app/src/main/java/com/sameerasw/essentials/ui/components/cards/SelectionCardItem.kt b/app/src/main/java/com/sameerasw/essentials/ui/core/cards/SelectionCardItem.kt similarity index 87% rename from app/src/main/java/com/sameerasw/essentials/ui/components/cards/SelectionCardItem.kt rename to app/src/main/java/com/sameerasw/essentials/ui/core/cards/SelectionCardItem.kt index 30b988188..8afe954aa 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/components/cards/SelectionCardItem.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/core/cards/SelectionCardItem.kt @@ -1,4 +1,13 @@ -package com.sameerasw.essentials.ui.components.cards +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Core Components + * File: SelectionCardItem.kt + * Description: Reusable core UI component for SelectionCardItem.kt. + */ + +package com.sameerasw.essentials.ui.core.cards import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.fillMaxWidth diff --git a/app/src/main/java/com/sameerasw/essentials/ui/components/cards/TrackedRepoCard.kt b/app/src/main/java/com/sameerasw/essentials/ui/core/cards/TrackedRepoCard.kt similarity index 98% rename from app/src/main/java/com/sameerasw/essentials/ui/components/cards/TrackedRepoCard.kt rename to app/src/main/java/com/sameerasw/essentials/ui/core/cards/TrackedRepoCard.kt index 2b21ec5fa..278931263 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/components/cards/TrackedRepoCard.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/core/cards/TrackedRepoCard.kt @@ -1,4 +1,13 @@ -package com.sameerasw.essentials.ui.components.cards +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Core Components + * File: TrackedRepoCard.kt + * Description: Reusable core UI component for TrackedRepoCard.kt. + */ + +package com.sameerasw.essentials.ui.core.cards import androidx.compose.foundation.Image import androidx.compose.foundation.combinedClickable diff --git a/app/src/main/java/com/sameerasw/essentials/ui/components/containers/RoundedCardContainer.kt b/app/src/main/java/com/sameerasw/essentials/ui/core/containers/RoundedCardContainer.kt similarity index 76% rename from app/src/main/java/com/sameerasw/essentials/ui/components/containers/RoundedCardContainer.kt rename to app/src/main/java/com/sameerasw/essentials/ui/core/containers/RoundedCardContainer.kt index 6f294df16..a496eeb24 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/components/containers/RoundedCardContainer.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/core/containers/RoundedCardContainer.kt @@ -1,4 +1,13 @@ -package com.sameerasw.essentials.ui.components.containers +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Core UI Components + * File: RoundedCardContainer.kt + * Description: Material 3 Expressive 24.dp rounded card container wrapper for grouping settings items. + */ + +package com.sameerasw.essentials.ui.core.containers import androidx.compose.foundation.background import androidx.compose.foundation.layout.Arrangement diff --git a/app/src/main/java/com/sameerasw/essentials/ui/components/containers/RoundedCardLazyContainer.kt b/app/src/main/java/com/sameerasw/essentials/ui/core/containers/RoundedCardLazyContainer.kt similarity index 89% rename from app/src/main/java/com/sameerasw/essentials/ui/components/containers/RoundedCardLazyContainer.kt rename to app/src/main/java/com/sameerasw/essentials/ui/core/containers/RoundedCardLazyContainer.kt index dbf5dcdec..79c71c373 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/components/containers/RoundedCardLazyContainer.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/core/containers/RoundedCardLazyContainer.kt @@ -1,4 +1,13 @@ -package com.sameerasw.essentials.ui.components.containers +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Core Components + * File: RoundedCardLazyContainer.kt + * Description: Reusable core UI component for RoundedCardLazyContainer.kt. + */ + +package com.sameerasw.essentials.ui.core.containers import android.content.Intent import android.net.Uri diff --git a/app/src/main/java/com/sameerasw/essentials/ui/components/pickers/AlbumArtModePicker.kt b/app/src/main/java/com/sameerasw/essentials/ui/core/pickers/AlbumArtModePicker.kt similarity index 89% rename from app/src/main/java/com/sameerasw/essentials/ui/components/pickers/AlbumArtModePicker.kt rename to app/src/main/java/com/sameerasw/essentials/ui/core/pickers/AlbumArtModePicker.kt index 773f4511f..96a7c746f 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/components/pickers/AlbumArtModePicker.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/core/pickers/AlbumArtModePicker.kt @@ -1,4 +1,13 @@ -package com.sameerasw.essentials.ui.components.pickers +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Core Components + * File: AlbumArtModePicker.kt + * Description: Reusable core UI component for AlbumArtModePicker.kt. + */ + +package com.sameerasw.essentials.ui.core.pickers import androidx.compose.foundation.background import androidx.compose.foundation.layout.Arrangement @@ -20,7 +29,7 @@ import androidx.compose.ui.semantics.role import androidx.compose.ui.semantics.semantics import androidx.compose.ui.unit.dp import com.sameerasw.essentials.R -import com.sameerasw.essentials.ui.components.containers.RoundedCardContainer +import com.sameerasw.essentials.ui.core.containers.RoundedCardContainer import com.sameerasw.essentials.utils.HapticUtil @OptIn(ExperimentalMaterial3ExpressiveApi::class) diff --git a/app/src/main/java/com/sameerasw/essentials/ui/components/pickers/CrashReportingPicker.kt b/app/src/main/java/com/sameerasw/essentials/ui/core/pickers/CrashReportingPicker.kt similarity index 96% rename from app/src/main/java/com/sameerasw/essentials/ui/components/pickers/CrashReportingPicker.kt rename to app/src/main/java/com/sameerasw/essentials/ui/core/pickers/CrashReportingPicker.kt index f7838fc7b..c073e80e4 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/components/pickers/CrashReportingPicker.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/core/pickers/CrashReportingPicker.kt @@ -1,4 +1,13 @@ -package com.sameerasw.essentials.ui.components.pickers +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Core Components + * File: CrashReportingPicker.kt + * Description: Reusable core UI component for CrashReportingPicker.kt. + */ + +package com.sameerasw.essentials.ui.core.pickers import androidx.compose.foundation.background import androidx.compose.foundation.layout.Arrangement diff --git a/app/src/main/java/com/sameerasw/essentials/ui/components/pickers/DefaultTabPicker.kt b/app/src/main/java/com/sameerasw/essentials/ui/core/pickers/DefaultTabPicker.kt similarity index 96% rename from app/src/main/java/com/sameerasw/essentials/ui/components/pickers/DefaultTabPicker.kt rename to app/src/main/java/com/sameerasw/essentials/ui/core/pickers/DefaultTabPicker.kt index d4f19e7a3..accdb64c6 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/components/pickers/DefaultTabPicker.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/core/pickers/DefaultTabPicker.kt @@ -1,4 +1,13 @@ -package com.sameerasw.essentials.ui.components.pickers +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Core Components + * File: DefaultTabPicker.kt + * Description: Reusable core UI component for DefaultTabPicker.kt. + */ + +package com.sameerasw.essentials.ui.core.pickers import androidx.compose.foundation.background import androidx.compose.foundation.layout.Arrangement diff --git a/app/src/main/java/com/sameerasw/essentials/ui/components/pickers/HapticFeedbackPicker.kt b/app/src/main/java/com/sameerasw/essentials/ui/core/pickers/HapticFeedbackPicker.kt similarity index 92% rename from app/src/main/java/com/sameerasw/essentials/ui/components/pickers/HapticFeedbackPicker.kt rename to app/src/main/java/com/sameerasw/essentials/ui/core/pickers/HapticFeedbackPicker.kt index c9e618995..58e616a4d 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/components/pickers/HapticFeedbackPicker.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/core/pickers/HapticFeedbackPicker.kt @@ -1,4 +1,13 @@ -package com.sameerasw.essentials.ui.components.pickers +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Core Components + * File: HapticFeedbackPicker.kt + * Description: Reusable core UI component for HapticFeedbackPicker.kt. + */ + +package com.sameerasw.essentials.ui.core.pickers import androidx.compose.foundation.background import androidx.compose.foundation.basicMarquee diff --git a/app/src/main/java/com/sameerasw/essentials/ui/components/pickers/LanguagePicker.kt b/app/src/main/java/com/sameerasw/essentials/ui/core/pickers/LanguagePicker.kt similarity index 81% rename from app/src/main/java/com/sameerasw/essentials/ui/components/pickers/LanguagePicker.kt rename to app/src/main/java/com/sameerasw/essentials/ui/core/pickers/LanguagePicker.kt index 9facfb4d9..538b656da 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/components/pickers/LanguagePicker.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/core/pickers/LanguagePicker.kt @@ -1,4 +1,13 @@ -package com.sameerasw.essentials.ui.components.pickers +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Core Components + * File: LanguagePicker.kt + * Description: Reusable core UI component for LanguagePicker.kt. + */ + +package com.sameerasw.essentials.ui.core.pickers import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.material3.ExperimentalMaterial3ExpressiveApi @@ -7,8 +16,8 @@ import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.res.stringResource import com.sameerasw.essentials.R -import com.sameerasw.essentials.ui.components.cards.ConfigPickerItem import com.sameerasw.essentials.ui.components.menus.SegmentedDropdownMenuItem +import com.sameerasw.essentials.ui.core.cards.ConfigPickerItem import com.sameerasw.essentials.utils.LanguageUtils @OptIn(ExperimentalMaterial3ExpressiveApi::class) diff --git a/app/src/main/java/com/sameerasw/essentials/ui/components/pickers/MultiSegmentedPicker.kt b/app/src/main/java/com/sameerasw/essentials/ui/core/pickers/MultiSegmentedPicker.kt similarity index 96% rename from app/src/main/java/com/sameerasw/essentials/ui/components/pickers/MultiSegmentedPicker.kt rename to app/src/main/java/com/sameerasw/essentials/ui/core/pickers/MultiSegmentedPicker.kt index 3e90b2d87..9420869db 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/components/pickers/MultiSegmentedPicker.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/core/pickers/MultiSegmentedPicker.kt @@ -1,4 +1,13 @@ -package com.sameerasw.essentials.ui.components.pickers +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Core Components + * File: MultiSegmentedPicker.kt + * Description: Reusable core UI component for MultiSegmentedPicker.kt. + */ + +package com.sameerasw.essentials.ui.core.pickers import androidx.compose.foundation.background import androidx.compose.foundation.basicMarquee diff --git a/app/src/main/java/com/sameerasw/essentials/ui/components/pickers/NetworkTypePicker.kt b/app/src/main/java/com/sameerasw/essentials/ui/core/pickers/NetworkTypePicker.kt similarity index 92% rename from app/src/main/java/com/sameerasw/essentials/ui/components/pickers/NetworkTypePicker.kt rename to app/src/main/java/com/sameerasw/essentials/ui/core/pickers/NetworkTypePicker.kt index 3376e15d4..d155e0af4 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/components/pickers/NetworkTypePicker.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/core/pickers/NetworkTypePicker.kt @@ -1,4 +1,13 @@ -package com.sameerasw.essentials.ui.components.pickers +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Core Components + * File: NetworkTypePicker.kt + * Description: Reusable core UI component for NetworkTypePicker.kt. + */ + +package com.sameerasw.essentials.ui.core.pickers import androidx.compose.foundation.background import androidx.compose.foundation.layout.Arrangement diff --git a/app/src/main/java/com/sameerasw/essentials/ui/components/pickers/RestoreModePicker.kt b/app/src/main/java/com/sameerasw/essentials/ui/core/pickers/RestoreModePicker.kt similarity index 94% rename from app/src/main/java/com/sameerasw/essentials/ui/components/pickers/RestoreModePicker.kt rename to app/src/main/java/com/sameerasw/essentials/ui/core/pickers/RestoreModePicker.kt index 0ca27cee7..22f50a3c4 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/components/pickers/RestoreModePicker.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/core/pickers/RestoreModePicker.kt @@ -1,4 +1,13 @@ -package com.sameerasw.essentials.ui.components.pickers +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Core Components + * File: RestoreModePicker.kt + * Description: Reusable core UI component for RestoreModePicker.kt. + */ + +package com.sameerasw.essentials.ui.core.pickers import androidx.compose.foundation.background import androidx.compose.foundation.layout.Arrangement diff --git a/app/src/main/java/com/sameerasw/essentials/ui/components/pickers/ScreenOffMethodPicker.kt b/app/src/main/java/com/sameerasw/essentials/ui/core/pickers/ScreenOffMethodPicker.kt similarity index 92% rename from app/src/main/java/com/sameerasw/essentials/ui/components/pickers/ScreenOffMethodPicker.kt rename to app/src/main/java/com/sameerasw/essentials/ui/core/pickers/ScreenOffMethodPicker.kt index ed5ab646a..01e0c5f59 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/components/pickers/ScreenOffMethodPicker.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/core/pickers/ScreenOffMethodPicker.kt @@ -1,4 +1,13 @@ -package com.sameerasw.essentials.ui.components.pickers +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Core Components + * File: ScreenOffMethodPicker.kt + * Description: Reusable core UI component for ScreenOffMethodPicker.kt. + */ + +package com.sameerasw.essentials.ui.core.pickers import androidx.compose.foundation.background import androidx.compose.foundation.basicMarquee diff --git a/app/src/main/java/com/sameerasw/essentials/ui/components/pickers/SegmentedPicker.kt b/app/src/main/java/com/sameerasw/essentials/ui/core/pickers/SegmentedPicker.kt similarity index 96% rename from app/src/main/java/com/sameerasw/essentials/ui/components/pickers/SegmentedPicker.kt rename to app/src/main/java/com/sameerasw/essentials/ui/core/pickers/SegmentedPicker.kt index f536f1670..0007cba89 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/components/pickers/SegmentedPicker.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/core/pickers/SegmentedPicker.kt @@ -1,4 +1,13 @@ -package com.sameerasw.essentials.ui.components.pickers +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Core UI Components + * File: SegmentedPicker.kt + * Description: Connected button group segmented picker control following Material 3 Expressive design. + */ + +package com.sameerasw.essentials.ui.core.pickers import androidx.compose.foundation.background import androidx.compose.foundation.basicMarquee diff --git a/app/src/main/java/com/sameerasw/essentials/ui/components/sheets/AddRepoBottomSheet.kt b/app/src/main/java/com/sameerasw/essentials/ui/core/sheets/AddRepoBottomSheet.kt similarity index 98% rename from app/src/main/java/com/sameerasw/essentials/ui/components/sheets/AddRepoBottomSheet.kt rename to app/src/main/java/com/sameerasw/essentials/ui/core/sheets/AddRepoBottomSheet.kt index b530092b9..5d08dee92 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/components/sheets/AddRepoBottomSheet.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/core/sheets/AddRepoBottomSheet.kt @@ -1,4 +1,13 @@ -package com.sameerasw.essentials.ui.components.sheets +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Core Components + * File: AddRepoBottomSheet.kt + * Description: Reusable core UI component for AddRepoBottomSheet.kt. + */ + +package com.sameerasw.essentials.ui.core.sheets import androidx.compose.foundation.Image import androidx.compose.foundation.layout.Arrangement @@ -47,8 +56,8 @@ import androidx.compose.ui.unit.dp import coil.compose.AsyncImage import com.sameerasw.essentials.R import com.sameerasw.essentials.domain.model.UpdateInfo -import com.sameerasw.essentials.ui.components.containers.RoundedCardContainer import com.sameerasw.essentials.ui.components.text.SimpleMarkdown +import com.sameerasw.essentials.ui.core.containers.RoundedCardContainer import com.sameerasw.essentials.utils.HapticUtil import com.sameerasw.essentials.utils.TimeUtil import com.sameerasw.essentials.viewmodels.AppUpdatesViewModel diff --git a/app/src/main/java/com/sameerasw/essentials/ui/components/sheets/BugReportBottomSheet.kt b/app/src/main/java/com/sameerasw/essentials/ui/core/sheets/BugReportBottomSheet.kt similarity index 96% rename from app/src/main/java/com/sameerasw/essentials/ui/components/sheets/BugReportBottomSheet.kt rename to app/src/main/java/com/sameerasw/essentials/ui/core/sheets/BugReportBottomSheet.kt index 542e9d4ed..10bc96fba 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/components/sheets/BugReportBottomSheet.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/core/sheets/BugReportBottomSheet.kt @@ -1,4 +1,13 @@ -package com.sameerasw.essentials.ui.components.sheets +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Core Components + * File: BugReportBottomSheet.kt + * Description: Reusable core UI component for BugReportBottomSheet.kt. + */ + +package com.sameerasw.essentials.ui.core.sheets import android.content.Intent import android.net.Uri @@ -38,7 +47,7 @@ import androidx.compose.ui.text.font.FontFamily import androidx.compose.ui.text.input.KeyboardType import androidx.compose.ui.unit.dp import com.sameerasw.essentials.R -import com.sameerasw.essentials.ui.components.containers.RoundedCardContainer +import com.sameerasw.essentials.ui.core.containers.RoundedCardContainer import com.sameerasw.essentials.viewmodels.MainViewModel import io.sentry.Sentry import io.sentry.protocol.Feedback diff --git a/app/src/main/java/com/sameerasw/essentials/ui/components/sheets/ColorPickerBottomSheet.kt b/app/src/main/java/com/sameerasw/essentials/ui/core/sheets/ColorPickerBottomSheet.kt similarity index 95% rename from app/src/main/java/com/sameerasw/essentials/ui/components/sheets/ColorPickerBottomSheet.kt rename to app/src/main/java/com/sameerasw/essentials/ui/core/sheets/ColorPickerBottomSheet.kt index a7b936d6e..3e7c746d2 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/components/sheets/ColorPickerBottomSheet.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/core/sheets/ColorPickerBottomSheet.kt @@ -1,4 +1,13 @@ -package com.sameerasw.essentials.ui.components.sheets +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Core Components + * File: ColorPickerBottomSheet.kt + * Description: Reusable core UI component for ColorPickerBottomSheet.kt. + */ + +package com.sameerasw.essentials.ui.core.sheets import android.content.Intent import androidx.compose.foundation.background @@ -39,8 +48,8 @@ import androidx.compose.ui.text.AnnotatedString import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.unit.dp import com.sameerasw.essentials.R -import com.sameerasw.essentials.ui.components.containers.RoundedCardContainer -import com.sameerasw.essentials.ui.components.pickers.SegmentedPicker +import com.sameerasw.essentials.ui.core.containers.RoundedCardContainer +import com.sameerasw.essentials.ui.core.pickers.SegmentedPicker import com.sameerasw.essentials.utils.ColorFormatUtils import com.sameerasw.essentials.utils.HapticUtil diff --git a/app/src/main/java/com/sameerasw/essentials/ui/components/sheets/EssentialsBottomSheet.kt b/app/src/main/java/com/sameerasw/essentials/ui/core/sheets/EssentialsBottomSheet.kt similarity index 87% rename from app/src/main/java/com/sameerasw/essentials/ui/components/sheets/EssentialsBottomSheet.kt rename to app/src/main/java/com/sameerasw/essentials/ui/core/sheets/EssentialsBottomSheet.kt index 632caf617..6da7d4cb2 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/components/sheets/EssentialsBottomSheet.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/core/sheets/EssentialsBottomSheet.kt @@ -1,4 +1,13 @@ -package com.sameerasw.essentials.ui.components.sheets +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Core Components + * File: EssentialsBottomSheet.kt + * Description: Reusable core UI component for EssentialsBottomSheet.kt. + */ + +package com.sameerasw.essentials.ui.core.sheets import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.ColumnScope diff --git a/app/src/main/java/com/sameerasw/essentials/ui/components/sheets/FeatureHelpBottomSheet.kt b/app/src/main/java/com/sameerasw/essentials/ui/core/sheets/FeatureHelpBottomSheet.kt similarity index 94% rename from app/src/main/java/com/sameerasw/essentials/ui/components/sheets/FeatureHelpBottomSheet.kt rename to app/src/main/java/com/sameerasw/essentials/ui/core/sheets/FeatureHelpBottomSheet.kt index b6a390496..c32ff4392 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/components/sheets/FeatureHelpBottomSheet.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/core/sheets/FeatureHelpBottomSheet.kt @@ -1,4 +1,13 @@ -package com.sameerasw.essentials.ui.components.sheets +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Core Components + * File: FeatureHelpBottomSheet.kt + * Description: Reusable core UI component for FeatureHelpBottomSheet.kt. + */ + +package com.sameerasw.essentials.ui.core.sheets import androidx.compose.foundation.background import androidx.compose.foundation.layout.Arrangement @@ -28,7 +37,7 @@ import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp import androidx.lifecycle.viewmodel.compose.viewModel import com.sameerasw.essentials.domain.model.Feature -import com.sameerasw.essentials.ui.components.containers.RoundedCardContainer +import com.sameerasw.essentials.ui.core.containers.RoundedCardContainer import com.sameerasw.essentials.utils.ColorUtil import com.sameerasw.essentials.utils.PermissionUIHelper import com.sameerasw.essentials.viewmodels.MainViewModel diff --git a/app/src/main/java/com/sameerasw/essentials/ui/components/sheets/GitHubAuthSheet.kt b/app/src/main/java/com/sameerasw/essentials/ui/core/sheets/GitHubAuthSheet.kt similarity index 96% rename from app/src/main/java/com/sameerasw/essentials/ui/components/sheets/GitHubAuthSheet.kt rename to app/src/main/java/com/sameerasw/essentials/ui/core/sheets/GitHubAuthSheet.kt index 6085a4b4b..03400b586 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/components/sheets/GitHubAuthSheet.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/core/sheets/GitHubAuthSheet.kt @@ -1,4 +1,13 @@ -package com.sameerasw.essentials.ui.components.sheets +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Core Components + * File: GitHubAuthSheet.kt + * Description: Reusable core UI component for GitHubAuthSheet.kt. + */ + +package com.sameerasw.essentials.ui.core.sheets import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column diff --git a/app/src/main/java/com/sameerasw/essentials/ui/components/sheets/ImportConfigConfirmationSheet.kt b/app/src/main/java/com/sameerasw/essentials/ui/core/sheets/ImportConfigConfirmationSheet.kt similarity index 92% rename from app/src/main/java/com/sameerasw/essentials/ui/components/sheets/ImportConfigConfirmationSheet.kt rename to app/src/main/java/com/sameerasw/essentials/ui/core/sheets/ImportConfigConfirmationSheet.kt index 5d83fe0c5..3a5171fa9 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/components/sheets/ImportConfigConfirmationSheet.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/core/sheets/ImportConfigConfirmationSheet.kt @@ -1,4 +1,13 @@ -package com.sameerasw.essentials.ui.components.sheets +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Core Components + * File: ImportConfigConfirmationSheet.kt + * Description: Reusable core UI component for ImportConfigConfirmationSheet.kt. + */ + +package com.sameerasw.essentials.ui.core.sheets import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column @@ -20,7 +29,7 @@ import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.unit.dp import com.sameerasw.essentials.R -import com.sameerasw.essentials.ui.components.containers.RoundedCardContainer +import com.sameerasw.essentials.ui.core.containers.RoundedCardContainer import com.sameerasw.essentials.utils.HapticUtil @OptIn(ExperimentalMaterial3Api::class) diff --git a/app/src/main/java/com/sameerasw/essentials/ui/components/sheets/InstructionsBottomSheet.kt b/app/src/main/java/com/sameerasw/essentials/ui/core/sheets/InstructionsBottomSheet.kt similarity index 96% rename from app/src/main/java/com/sameerasw/essentials/ui/components/sheets/InstructionsBottomSheet.kt rename to app/src/main/java/com/sameerasw/essentials/ui/core/sheets/InstructionsBottomSheet.kt index ac4cc8098..b580043a4 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/components/sheets/InstructionsBottomSheet.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/core/sheets/InstructionsBottomSheet.kt @@ -1,4 +1,13 @@ -package com.sameerasw.essentials.ui.components.sheets +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Core Components + * File: InstructionsBottomSheet.kt + * Description: Reusable core UI component for InstructionsBottomSheet.kt. + */ + +package com.sameerasw.essentials.ui.core.sheets import android.content.ActivityNotFoundException import android.content.Intent diff --git a/app/src/main/java/com/sameerasw/essentials/ui/components/sheets/PermissionsBottomSheet.kt b/app/src/main/java/com/sameerasw/essentials/ui/core/sheets/PermissionsBottomSheet.kt similarity index 89% rename from app/src/main/java/com/sameerasw/essentials/ui/components/sheets/PermissionsBottomSheet.kt rename to app/src/main/java/com/sameerasw/essentials/ui/core/sheets/PermissionsBottomSheet.kt index a8ea74d8e..e1824724b 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/components/sheets/PermissionsBottomSheet.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/core/sheets/PermissionsBottomSheet.kt @@ -1,4 +1,13 @@ -package com.sameerasw.essentials.ui.components.sheets +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Core Components + * File: PermissionsBottomSheet.kt + * Description: Reusable core UI component for PermissionsBottomSheet.kt. + */ + +package com.sameerasw.essentials.ui.core.sheets import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column @@ -14,8 +23,8 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp import com.sameerasw.essentials.R -import com.sameerasw.essentials.ui.components.cards.PermissionCard -import com.sameerasw.essentials.ui.components.containers.RoundedCardContainer +import com.sameerasw.essentials.ui.core.cards.PermissionCard +import com.sameerasw.essentials.ui.core.containers.RoundedCardContainer data class PermissionItem( val iconRes: Int, diff --git a/app/src/main/java/com/sameerasw/essentials/ui/components/sheets/PrankBottomSheet.kt b/app/src/main/java/com/sameerasw/essentials/ui/core/sheets/PrankBottomSheet.kt similarity index 95% rename from app/src/main/java/com/sameerasw/essentials/ui/components/sheets/PrankBottomSheet.kt rename to app/src/main/java/com/sameerasw/essentials/ui/core/sheets/PrankBottomSheet.kt index e57a987bf..fec7982ea 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/components/sheets/PrankBottomSheet.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/core/sheets/PrankBottomSheet.kt @@ -1,4 +1,13 @@ -package com.sameerasw.essentials.ui.components.sheets +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Core Components + * File: PrankBottomSheet.kt + * Description: Reusable core UI component for PrankBottomSheet.kt. + */ + +package com.sameerasw.essentials.ui.core.sheets import androidx.compose.foundation.gestures.detectTapGestures import androidx.compose.foundation.layout.Arrangement diff --git a/app/src/main/java/com/sameerasw/essentials/ui/components/sheets/TimeSelectionSheet.kt b/app/src/main/java/com/sameerasw/essentials/ui/core/sheets/TimeSelectionSheet.kt similarity index 97% rename from app/src/main/java/com/sameerasw/essentials/ui/components/sheets/TimeSelectionSheet.kt rename to app/src/main/java/com/sameerasw/essentials/ui/core/sheets/TimeSelectionSheet.kt index 2dc0b4033..6456ab06d 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/components/sheets/TimeSelectionSheet.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/core/sheets/TimeSelectionSheet.kt @@ -1,4 +1,13 @@ -package com.sameerasw.essentials.ui.components.sheets +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Core Components + * File: TimeSelectionSheet.kt + * Description: Reusable core UI component for TimeSelectionSheet.kt. + */ + +package com.sameerasw.essentials.ui.core.sheets import androidx.compose.foundation.background import androidx.compose.foundation.layout.Arrangement @@ -34,7 +43,7 @@ import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.unit.dp import com.sameerasw.essentials.R import com.sameerasw.essentials.domain.diy.Trigger -import com.sameerasw.essentials.ui.components.pickers.MultiSegmentedPicker +import com.sameerasw.essentials.ui.core.pickers.MultiSegmentedPicker import com.sameerasw.essentials.utils.HapticUtil import java.util.Calendar import com.sameerasw.essentials.domain.diy.State as DIYState diff --git a/app/src/main/java/com/sameerasw/essentials/ui/components/sheets/UnsupportedFeaturesConfirmationSheet.kt b/app/src/main/java/com/sameerasw/essentials/ui/core/sheets/UnsupportedFeaturesConfirmationSheet.kt similarity index 88% rename from app/src/main/java/com/sameerasw/essentials/ui/components/sheets/UnsupportedFeaturesConfirmationSheet.kt rename to app/src/main/java/com/sameerasw/essentials/ui/core/sheets/UnsupportedFeaturesConfirmationSheet.kt index 4af5a6eda..aad67de88 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/components/sheets/UnsupportedFeaturesConfirmationSheet.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/core/sheets/UnsupportedFeaturesConfirmationSheet.kt @@ -1,4 +1,13 @@ -package com.sameerasw.essentials.ui.components.sheets +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Core Components + * File: UnsupportedFeaturesConfirmationSheet.kt + * Description: Reusable core UI component for UnsupportedFeaturesConfirmationSheet.kt. + */ + +package com.sameerasw.essentials.ui.core.sheets import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column @@ -15,7 +24,7 @@ import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp -import com.sameerasw.essentials.ui.components.containers.RoundedCardContainer +import com.sameerasw.essentials.ui.core.containers.RoundedCardContainer @Composable fun UnsupportedFeaturesConfirmationSheet( diff --git a/app/src/main/java/com/sameerasw/essentials/ui/components/sheets/UpdateBottomSheet.kt b/app/src/main/java/com/sameerasw/essentials/ui/core/sheets/UpdateBottomSheet.kt similarity index 97% rename from app/src/main/java/com/sameerasw/essentials/ui/components/sheets/UpdateBottomSheet.kt rename to app/src/main/java/com/sameerasw/essentials/ui/core/sheets/UpdateBottomSheet.kt index 1fc4f8b28..d108b99f5 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/components/sheets/UpdateBottomSheet.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/core/sheets/UpdateBottomSheet.kt @@ -1,4 +1,13 @@ -package com.sameerasw.essentials.ui.components.sheets +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Core Components + * File: UpdateBottomSheet.kt + * Description: Reusable core UI component for UpdateBottomSheet.kt. + */ + +package com.sameerasw.essentials.ui.core.sheets import android.content.Intent import androidx.compose.foundation.layout.Arrangement @@ -46,8 +55,8 @@ import com.google.gson.Gson import com.google.gson.JsonObject import com.sameerasw.essentials.R import com.sameerasw.essentials.domain.model.UpdateInfo -import com.sameerasw.essentials.ui.components.containers.RoundedCardContainer import com.sameerasw.essentials.ui.components.text.SimpleMarkdown +import com.sameerasw.essentials.ui.core.containers.RoundedCardContainer import com.sameerasw.essentials.utils.AutoUpdateManagerHelper import com.sameerasw.essentials.utils.HapticUtil import kotlinx.coroutines.Dispatchers diff --git a/app/src/main/java/com/sameerasw/essentials/ui/composables/configs/StandbyAppsSettingsUI.kt b/app/src/main/java/com/sameerasw/essentials/ui/features/apps/StandbyAppsSettingsUI.kt similarity index 92% rename from app/src/main/java/com/sameerasw/essentials/ui/composables/configs/StandbyAppsSettingsUI.kt rename to app/src/main/java/com/sameerasw/essentials/ui/features/apps/StandbyAppsSettingsUI.kt index 4da4a9248..5af2d5ea8 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/composables/configs/StandbyAppsSettingsUI.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/features/apps/StandbyAppsSettingsUI.kt @@ -1,4 +1,13 @@ -package com.sameerasw.essentials.ui.composables.configs +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Feature - Apps + * File: StandbyAppsSettingsUI.kt + * Description: UI component and settings composable for Apps feature domain. + */ + +package com.sameerasw.essentials.ui.features.system import android.content.Intent import android.net.Uri @@ -38,11 +47,11 @@ import androidx.lifecycle.LifecycleEventObserver import coil.compose.AsyncImage import com.sameerasw.essentials.R import com.sameerasw.essentials.domain.model.AppStandbyInfo -import com.sameerasw.essentials.ui.components.containers.RoundedCardContainer import com.sameerasw.essentials.ui.components.menus.SegmentedDropdownMenu import com.sameerasw.essentials.ui.components.menus.SegmentedDropdownMenuItem -import com.sameerasw.essentials.ui.components.sheets.PermissionItem -import com.sameerasw.essentials.ui.components.sheets.PermissionsBottomSheet +import com.sameerasw.essentials.ui.core.containers.RoundedCardContainer +import com.sameerasw.essentials.ui.core.sheets.PermissionItem +import com.sameerasw.essentials.ui.core.sheets.PermissionsBottomSheet import com.sameerasw.essentials.utils.HapticUtil import com.sameerasw.essentials.viewmodels.MainViewModel @@ -55,7 +64,8 @@ fun StandbyAppsSettingsUI( val context = LocalContext.current var requestingPermissionFor by remember { mutableStateOf(false) } - val isShizukuGranted = viewModel.isShizukuAvailable.value && viewModel.isShizukuPermissionGranted.value + val isShizukuGranted = + viewModel.isShizukuAvailable.value && viewModel.isShizukuPermissionGranted.value val isRootGranted = viewModel.isRootAvailable.value && viewModel.isRootPermissionGranted.value val isShellGranted = isShizukuGranted || isRootGranted @@ -147,7 +157,7 @@ fun StandbyAppsSettingsUI( modifier = Modifier.padding(start = 16.dp, bottom = 4.dp) ) - RoundedCardContainer{ + RoundedCardContainer { if (bucketApps.isEmpty()) { Box( modifier = Modifier @@ -169,7 +179,11 @@ fun StandbyAppsSettingsUI( isShellGranted = isShellGranted, onMoveBucket = { targetBucket -> if (isShellGranted) { - viewModel.setAppStandbyBucket(app.packageName, targetBucket, context) + viewModel.setAppStandbyBucket( + app.packageName, + targetBucket, + context + ) } else { requestingPermissionFor = true } diff --git a/app/src/main/java/com/sameerasw/essentials/ui/components/sheets/AppSelectionSheets.kt b/app/src/main/java/com/sameerasw/essentials/ui/features/apps/sheets/AppSelectionSheets.kt similarity index 98% rename from app/src/main/java/com/sameerasw/essentials/ui/components/sheets/AppSelectionSheets.kt rename to app/src/main/java/com/sameerasw/essentials/ui/features/apps/sheets/AppSelectionSheets.kt index e239875e3..33153e4b3 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/components/sheets/AppSelectionSheets.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/features/apps/sheets/AppSelectionSheets.kt @@ -1,4 +1,13 @@ -package com.sameerasw.essentials.ui.components.sheets +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Feature - Apps + * File: AppSelectionSheets.kt + * Description: UI component and settings composable for Apps feature domain. + */ + +package com.sameerasw.essentials.ui.core.sheets import android.content.Context import androidx.compose.foundation.Image @@ -45,7 +54,7 @@ import androidx.compose.ui.unit.dp import com.sameerasw.essentials.R import com.sameerasw.essentials.domain.model.AppSelection import com.sameerasw.essentials.domain.model.NotificationApp -import com.sameerasw.essentials.ui.components.cards.AppToggleItem +import com.sameerasw.essentials.ui.core.cards.AppToggleItem import com.sameerasw.essentials.utils.AppUtil import com.sameerasw.essentials.utils.HapticUtil import kotlinx.coroutines.Dispatchers diff --git a/app/src/main/java/com/sameerasw/essentials/ui/composables/sheets/UserDictionaryBottomSheet.kt b/app/src/main/java/com/sameerasw/essentials/ui/features/apps/sheets/UserDictionaryBottomSheet.kt similarity index 96% rename from app/src/main/java/com/sameerasw/essentials/ui/composables/sheets/UserDictionaryBottomSheet.kt rename to app/src/main/java/com/sameerasw/essentials/ui/features/apps/sheets/UserDictionaryBottomSheet.kt index 7fe6ca555..f943eddac 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/composables/sheets/UserDictionaryBottomSheet.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/features/apps/sheets/UserDictionaryBottomSheet.kt @@ -1,4 +1,13 @@ -package com.sameerasw.essentials.ui.composables.sheets +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Feature - Apps + * File: UserDictionaryBottomSheet.kt + * Description: UI component and settings composable for Apps feature domain. + */ + +package com.sameerasw.essentials.ui.features.apps.sheets import androidx.compose.foundation.background import androidx.compose.foundation.clickable @@ -35,7 +44,7 @@ import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.res.painterResource import androidx.compose.ui.unit.dp import com.sameerasw.essentials.R -import com.sameerasw.essentials.ui.components.containers.RoundedCardContainer +import com.sameerasw.essentials.ui.core.containers.RoundedCardContainer import com.sameerasw.essentials.viewmodels.MainViewModel @OptIn(ExperimentalMaterial3Api::class) diff --git a/app/src/main/java/com/sameerasw/essentials/ui/composables/configs/NotificationSnoozingSettingsUI.kt b/app/src/main/java/com/sameerasw/essentials/ui/features/audio/NotificationSnoozingSettingsUI.kt similarity index 93% rename from app/src/main/java/com/sameerasw/essentials/ui/composables/configs/NotificationSnoozingSettingsUI.kt rename to app/src/main/java/com/sameerasw/essentials/ui/features/audio/NotificationSnoozingSettingsUI.kt index 38d70d30e..40729b2b7 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/composables/configs/NotificationSnoozingSettingsUI.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/features/audio/NotificationSnoozingSettingsUI.kt @@ -1,4 +1,13 @@ -package com.sameerasw.essentials.ui.composables.configs +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Feature - Audio + * File: NotificationSnoozingSettingsUI.kt + * Description: UI component and settings composable for Audio feature domain. + */ + +package com.sameerasw.essentials.ui.features.system import android.widget.Toast import androidx.compose.animation.AnimatedVisibility @@ -19,9 +28,9 @@ import androidx.compose.ui.platform.LocalView import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp import com.sameerasw.essentials.R -import com.sameerasw.essentials.ui.components.cards.IconToggleItem -import com.sameerasw.essentials.ui.components.containers.RoundedCardContainer import com.sameerasw.essentials.ui.components.sliders.ConfigSliderItem +import com.sameerasw.essentials.ui.core.cards.IconToggleItem +import com.sameerasw.essentials.ui.core.containers.RoundedCardContainer import com.sameerasw.essentials.ui.modifiers.highlight import com.sameerasw.essentials.utils.HapticUtil import com.sameerasw.essentials.viewmodels.MainViewModel diff --git a/app/src/main/java/com/sameerasw/essentials/ui/composables/configs/ShutUpSettingsUI.kt b/app/src/main/java/com/sameerasw/essentials/ui/features/audio/ShutUpSettingsUI.kt similarity index 92% rename from app/src/main/java/com/sameerasw/essentials/ui/composables/configs/ShutUpSettingsUI.kt rename to app/src/main/java/com/sameerasw/essentials/ui/features/audio/ShutUpSettingsUI.kt index 03e1e8a1b..b437fdbd3 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/composables/configs/ShutUpSettingsUI.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/features/audio/ShutUpSettingsUI.kt @@ -1,4 +1,13 @@ -package com.sameerasw.essentials.ui.composables.configs +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Audio & Sound Controls + * File: ShutUpSettingsUI.kt + * Description: Composable screen for media mute and ShutUp per-app rules. + */ + +package com.sameerasw.essentials.ui.features.system import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column @@ -23,13 +32,13 @@ import androidx.compose.ui.unit.dp import com.sameerasw.essentials.R import com.sameerasw.essentials.domain.model.AppSelection import com.sameerasw.essentials.domain.model.ShutUpAppConfig -import com.sameerasw.essentials.ui.components.cards.FeatureCard -import com.sameerasw.essentials.ui.components.containers.RoundedCardContainer import com.sameerasw.essentials.ui.components.menus.SegmentedDropdownMenuItem -import com.sameerasw.essentials.ui.components.pickers.RestoreModePicker -import com.sameerasw.essentials.ui.components.sheets.AppSelectionSheet -import com.sameerasw.essentials.ui.components.sheets.ShutUpPerAppSettingsSheet import com.sameerasw.essentials.ui.components.sliders.ConfigSliderItem +import com.sameerasw.essentials.ui.core.cards.FeatureCard +import com.sameerasw.essentials.ui.core.containers.RoundedCardContainer +import com.sameerasw.essentials.ui.core.pickers.RestoreModePicker +import com.sameerasw.essentials.ui.core.sheets.AppSelectionSheet +import com.sameerasw.essentials.ui.core.sheets.ShutUpPerAppSettingsSheet import com.sameerasw.essentials.utils.AppUtil import com.sameerasw.essentials.viewmodels.MainViewModel diff --git a/app/src/main/java/com/sameerasw/essentials/ui/composables/configs/SnoozeNotificationsSettingsUI.kt b/app/src/main/java/com/sameerasw/essentials/ui/features/audio/SnoozeNotificationsSettingsUI.kt similarity index 86% rename from app/src/main/java/com/sameerasw/essentials/ui/composables/configs/SnoozeNotificationsSettingsUI.kt rename to app/src/main/java/com/sameerasw/essentials/ui/features/audio/SnoozeNotificationsSettingsUI.kt index b4c7db8c0..516e89023 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/composables/configs/SnoozeNotificationsSettingsUI.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/features/audio/SnoozeNotificationsSettingsUI.kt @@ -1,4 +1,13 @@ -package com.sameerasw.essentials.ui.composables.configs +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Feature - Audio + * File: SnoozeNotificationsSettingsUI.kt + * Description: UI component and settings composable for Audio feature domain. + */ + +package com.sameerasw.essentials.ui.features.system import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column @@ -11,8 +20,8 @@ import androidx.compose.ui.platform.LocalView import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp import com.sameerasw.essentials.R -import com.sameerasw.essentials.ui.components.cards.IconToggleItem -import com.sameerasw.essentials.ui.components.containers.RoundedCardContainer +import com.sameerasw.essentials.ui.core.cards.IconToggleItem +import com.sameerasw.essentials.ui.core.containers.RoundedCardContainer import com.sameerasw.essentials.ui.modifiers.highlight import com.sameerasw.essentials.utils.HapticUtil import com.sameerasw.essentials.viewmodels.MainViewModel diff --git a/app/src/main/java/com/sameerasw/essentials/ui/composables/configs/SoundModeTileSettingsUI.kt b/app/src/main/java/com/sameerasw/essentials/ui/features/audio/SoundModeTileSettingsUI.kt similarity index 98% rename from app/src/main/java/com/sameerasw/essentials/ui/composables/configs/SoundModeTileSettingsUI.kt rename to app/src/main/java/com/sameerasw/essentials/ui/features/audio/SoundModeTileSettingsUI.kt index fdce8a630..6d5d55059 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/composables/configs/SoundModeTileSettingsUI.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/features/audio/SoundModeTileSettingsUI.kt @@ -1,4 +1,13 @@ -package com.sameerasw.essentials.ui.composables.configs +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Feature - Audio + * File: SoundModeTileSettingsUI.kt + * Description: UI component and settings composable for Audio feature domain. + */ + +package com.sameerasw.essentials.ui.features.system import androidx.compose.foundation.gestures.detectTapGestures import androidx.compose.foundation.layout.Arrangement diff --git a/app/src/main/java/com/sameerasw/essentials/ui/composables/configs/LikeSongSettingsSheet.kt b/app/src/main/java/com/sameerasw/essentials/ui/features/audio/sheets/LikeSongSettingsSheet.kt similarity index 94% rename from app/src/main/java/com/sameerasw/essentials/ui/composables/configs/LikeSongSettingsSheet.kt rename to app/src/main/java/com/sameerasw/essentials/ui/features/audio/sheets/LikeSongSettingsSheet.kt index 952277fee..6b3e50ece 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/composables/configs/LikeSongSettingsSheet.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/features/audio/sheets/LikeSongSettingsSheet.kt @@ -1,4 +1,13 @@ -package com.sameerasw.essentials.ui.composables.configs +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Feature - Audio + * File: LikeSongSettingsSheet.kt + * Description: UI component and settings composable for Audio feature domain. + */ + +package com.sameerasw.essentials.ui.features.system import android.content.Context import android.content.Intent @@ -29,8 +38,8 @@ import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.unit.dp import com.sameerasw.essentials.R -import com.sameerasw.essentials.ui.components.cards.IconToggleItem -import com.sameerasw.essentials.ui.components.containers.RoundedCardContainer +import com.sameerasw.essentials.ui.core.cards.IconToggleItem +import com.sameerasw.essentials.ui.core.containers.RoundedCardContainer import com.sameerasw.essentials.viewmodels.MainViewModel @OptIn(ExperimentalMaterial3Api::class) diff --git a/app/src/main/java/com/sameerasw/essentials/ui/components/sheets/ShutUpPerAppSettingsSheet.kt b/app/src/main/java/com/sameerasw/essentials/ui/features/audio/sheets/ShutUpPerAppSettingsSheet.kt similarity index 95% rename from app/src/main/java/com/sameerasw/essentials/ui/components/sheets/ShutUpPerAppSettingsSheet.kt rename to app/src/main/java/com/sameerasw/essentials/ui/features/audio/sheets/ShutUpPerAppSettingsSheet.kt index 73715070d..f269c30ed 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/components/sheets/ShutUpPerAppSettingsSheet.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/features/audio/sheets/ShutUpPerAppSettingsSheet.kt @@ -1,4 +1,13 @@ -package com.sameerasw.essentials.ui.components.sheets +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Feature - Audio + * File: ShutUpPerAppSettingsSheet.kt + * Description: UI component and settings composable for Audio feature domain. + */ + +package com.sameerasw.essentials.ui.core.sheets import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column @@ -29,8 +38,8 @@ import androidx.compose.ui.unit.dp import androidx.lifecycle.viewmodel.compose.viewModel import com.sameerasw.essentials.R import com.sameerasw.essentials.domain.model.ShutUpAppConfig -import com.sameerasw.essentials.ui.components.cards.IconToggleItem -import com.sameerasw.essentials.ui.components.containers.RoundedCardContainer +import com.sameerasw.essentials.ui.core.cards.IconToggleItem +import com.sameerasw.essentials.ui.core.containers.RoundedCardContainer import com.sameerasw.essentials.viewmodels.MainViewModel @OptIn(ExperimentalMaterial3Api::class) diff --git a/app/src/main/java/com/sameerasw/essentials/ui/components/sheets/SoundModeSettingsSheet.kt b/app/src/main/java/com/sameerasw/essentials/ui/features/audio/sheets/SoundModeSettingsSheet.kt similarity index 96% rename from app/src/main/java/com/sameerasw/essentials/ui/components/sheets/SoundModeSettingsSheet.kt rename to app/src/main/java/com/sameerasw/essentials/ui/features/audio/sheets/SoundModeSettingsSheet.kt index dc2ff53e8..f5791a416 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/components/sheets/SoundModeSettingsSheet.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/features/audio/sheets/SoundModeSettingsSheet.kt @@ -1,4 +1,13 @@ -package com.sameerasw.essentials.ui.components.sheets +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Feature - Audio + * File: SoundModeSettingsSheet.kt + * Description: UI component and settings composable for Audio feature domain. + */ + +package com.sameerasw.essentials.ui.core.sheets import androidx.compose.foundation.background import androidx.compose.foundation.clickable @@ -37,7 +46,7 @@ import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.unit.dp import com.sameerasw.essentials.R import com.sameerasw.essentials.domain.diy.Action -import com.sameerasw.essentials.ui.components.containers.RoundedCardContainer +import com.sameerasw.essentials.ui.core.containers.RoundedCardContainer import com.sameerasw.essentials.utils.ColorUtil import com.sameerasw.essentials.utils.HapticUtil diff --git a/app/src/main/java/com/sameerasw/essentials/ui/composables/DIYScreen.kt b/app/src/main/java/com/sameerasw/essentials/ui/features/automation/DIYScreen.kt similarity index 93% rename from app/src/main/java/com/sameerasw/essentials/ui/composables/DIYScreen.kt rename to app/src/main/java/com/sameerasw/essentials/ui/features/automation/DIYScreen.kt index 4515a867e..18388cbba 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/composables/DIYScreen.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/features/automation/DIYScreen.kt @@ -1,5 +1,15 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Feature - Automation + * File: DIYScreen.kt + * Description: UI component and settings composable for Automation feature domain. + */ + package com.sameerasw.essentials.ui.composables + import androidx.compose.foundation.gestures.detectTapGestures import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Box @@ -18,8 +28,6 @@ import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember import androidx.compose.runtime.setValue - - import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.input.pointer.pointerInput @@ -30,9 +38,9 @@ import androidx.compose.ui.unit.dp import androidx.lifecycle.viewmodel.compose.viewModel import com.sameerasw.essentials.R import com.sameerasw.essentials.ui.activities.AutomationEditorActivity -import com.sameerasw.essentials.ui.components.containers.RoundedCardContainer import com.sameerasw.essentials.ui.components.diy.AutomationItem -import com.sameerasw.essentials.ui.components.sheets.NewAutomationSheet +import com.sameerasw.essentials.ui.core.containers.RoundedCardContainer +import com.sameerasw.essentials.ui.core.sheets.NewAutomationSheet import com.sameerasw.essentials.utils.HapticUtil import com.sameerasw.essentials.viewmodels.DIYViewModel @@ -190,7 +198,8 @@ fun DIYScreen( } if (showGenAIPill) { - val currentSuggestion = (genAIState as? com.sameerasw.essentials.viewmodels.GenAIState.Success)?.suggestion + val currentSuggestion = + (genAIState as? com.sameerasw.essentials.viewmodels.GenAIState.Success)?.suggestion com.sameerasw.essentials.ui.components.genai.GenAIFloatingPill( onSend = { prompt -> viewModel.requestGenAISuggestion(prompt, context) @@ -215,10 +224,15 @@ fun DIYScreen( when (val state = genAIState) { is com.sameerasw.essentials.viewmodels.GenAIState.Error -> { androidx.compose.runtime.LaunchedEffect(state) { - android.widget.Toast.makeText(context, state.message, android.widget.Toast.LENGTH_LONG).show() + android.widget.Toast.makeText( + context, + state.message, + android.widget.Toast.LENGTH_LONG + ).show() viewModel.dismissGenAISuggestion() } } + else -> {} } } diff --git a/app/src/main/java/com/sameerasw/essentials/ui/components/diy/AutomationItem.kt b/app/src/main/java/com/sameerasw/essentials/ui/features/automation/components/AutomationItem.kt similarity index 98% rename from app/src/main/java/com/sameerasw/essentials/ui/components/diy/AutomationItem.kt rename to app/src/main/java/com/sameerasw/essentials/ui/features/automation/components/AutomationItem.kt index 0c52c67f1..e60710ba9 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/components/diy/AutomationItem.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/features/automation/components/AutomationItem.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Feature - Automation + * File: AutomationItem.kt + * Description: UI component and settings composable for Automation feature domain. + */ + package com.sameerasw.essentials.ui.components.diy import androidx.compose.foundation.ExperimentalFoundationApi @@ -44,9 +53,9 @@ import androidx.compose.ui.unit.dp import com.sameerasw.essentials.R import com.sameerasw.essentials.domain.diy.Action import com.sameerasw.essentials.domain.diy.Automation -import com.sameerasw.essentials.ui.components.containers.RoundedCardContainer import com.sameerasw.essentials.ui.components.menus.SegmentedDropdownMenu import com.sameerasw.essentials.ui.components.menus.SegmentedDropdownMenuItem +import com.sameerasw.essentials.ui.core.containers.RoundedCardContainer import com.sameerasw.essentials.utils.HapticUtil @OptIn(ExperimentalFoundationApi::class) diff --git a/app/src/main/java/com/sameerasw/essentials/ui/components/sheets/GenAIAutomationPreviewSheet.kt b/app/src/main/java/com/sameerasw/essentials/ui/features/automation/sheets/GenAIAutomationPreviewSheet.kt similarity index 96% rename from app/src/main/java/com/sameerasw/essentials/ui/components/sheets/GenAIAutomationPreviewSheet.kt rename to app/src/main/java/com/sameerasw/essentials/ui/features/automation/sheets/GenAIAutomationPreviewSheet.kt index 23b1f8399..f41aed5db 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/components/sheets/GenAIAutomationPreviewSheet.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/features/automation/sheets/GenAIAutomationPreviewSheet.kt @@ -1,4 +1,13 @@ -package com.sameerasw.essentials.ui.components.sheets +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Feature - Automation + * File: GenAIAutomationPreviewSheet.kt + * Description: UI component and settings composable for Automation feature domain. + */ + +package com.sameerasw.essentials.ui.core.sheets import androidx.compose.foundation.background import androidx.compose.foundation.layout.Arrangement @@ -33,7 +42,7 @@ import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.unit.dp import com.sameerasw.essentials.R import com.sameerasw.essentials.domain.genai.AutomationSuggestion -import com.sameerasw.essentials.ui.components.containers.RoundedCardContainer +import com.sameerasw.essentials.ui.core.containers.RoundedCardContainer import com.sameerasw.essentials.utils.HapticUtil @OptIn(ExperimentalMaterial3Api::class) diff --git a/app/src/main/java/com/sameerasw/essentials/ui/components/sheets/NewAutomationSheet.kt b/app/src/main/java/com/sameerasw/essentials/ui/features/automation/sheets/NewAutomationSheet.kt similarity index 93% rename from app/src/main/java/com/sameerasw/essentials/ui/components/sheets/NewAutomationSheet.kt rename to app/src/main/java/com/sameerasw/essentials/ui/features/automation/sheets/NewAutomationSheet.kt index eadda7337..0f6ea7f25 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/components/sheets/NewAutomationSheet.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/features/automation/sheets/NewAutomationSheet.kt @@ -1,4 +1,14 @@ -package com.sameerasw.essentials.ui.components.sheets +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Feature - Automation + * File: NewAutomationSheet.kt + * Description: UI component and settings composable for Automation feature domain. + */ + +package com.sameerasw.essentials.ui.core.sheets + import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.Arrangement @@ -20,10 +30,8 @@ import androidx.compose.runtime.Composable import androidx.compose.runtime.LaunchedEffect import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableStateOf -import androidx.compose.runtime.setValue import androidx.compose.runtime.remember - - +import androidx.compose.runtime.setValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalContext @@ -36,7 +44,7 @@ import com.sameerasw.essentials.R import com.sameerasw.essentials.data.repository.SettingsRepository import com.sameerasw.essentials.domain.diy.Automation import com.sameerasw.essentials.domain.diy.DIYRepository -import com.sameerasw.essentials.ui.components.containers.RoundedCardContainer +import com.sameerasw.essentials.ui.core.containers.RoundedCardContainer import com.sameerasw.essentials.utils.HapticUtil @OptIn(ExperimentalMaterial3Api::class) @@ -52,13 +60,17 @@ fun NewAutomationSheet( var aiPromptText by remember { mutableStateOf("") } val isGenAIEnabled = remember(context) { - SettingsRepository(context).getBoolean(SettingsRepository.KEY_GENAI_AUTOMATION_ENABLED, false) + SettingsRepository(context).getBoolean( + SettingsRepository.KEY_GENAI_AUTOMATION_ENABLED, + false + ) } var isGenAISupported by remember { mutableStateOf(false) } LaunchedEffect(Unit) { if (isGenAIEnabled) { - isGenAISupported = com.sameerasw.essentials.domain.genai.GenAIAutomationService.isSupported() + isGenAISupported = + com.sameerasw.essentials.domain.genai.GenAIAutomationService.isSupported() } } @@ -116,7 +128,7 @@ fun NewAutomationSheet( RoundedCardContainer( modifier = Modifier.padding(bottom = 16.dp) ) { - com.sameerasw.essentials.ui.components.cards.IconToggleItem( + com.sameerasw.essentials.ui.core.cards.IconToggleItem( iconRes = R.drawable.rounded_auto_awesome_24, title = stringResource(R.string.diy_genai_lazy_title), showToggle = false, diff --git a/app/src/main/java/com/sameerasw/essentials/ui/composables/configs/BatteriesSettingsUI.kt b/app/src/main/java/com/sameerasw/essentials/ui/features/battery/BatteriesSettingsUI.kt similarity index 96% rename from app/src/main/java/com/sameerasw/essentials/ui/composables/configs/BatteriesSettingsUI.kt rename to app/src/main/java/com/sameerasw/essentials/ui/features/battery/BatteriesSettingsUI.kt index 18d9b5703..d449b817b 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/composables/configs/BatteriesSettingsUI.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/features/battery/BatteriesSettingsUI.kt @@ -1,4 +1,13 @@ -package com.sameerasw.essentials.ui.composables.configs +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Battery Settings + * File: BatteriesSettingsUI.kt + * Description: UI settings composable screen for battery stats, rings, and charging options. + */ + +package com.sameerasw.essentials.ui.features.battery import android.content.Intent import android.net.Uri @@ -30,8 +39,8 @@ import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp import com.sameerasw.essentials.R -import com.sameerasw.essentials.ui.components.cards.IconToggleItem -import com.sameerasw.essentials.ui.components.containers.RoundedCardContainer +import com.sameerasw.essentials.ui.core.cards.IconToggleItem +import com.sameerasw.essentials.ui.core.containers.RoundedCardContainer import com.sameerasw.essentials.utils.HapticUtil import com.sameerasw.essentials.viewmodels.MainViewModel diff --git a/app/src/main/java/com/sameerasw/essentials/ui/components/battery/BatteryAppsTabContent.kt b/app/src/main/java/com/sameerasw/essentials/ui/features/battery/components/BatteryAppsTabContent.kt similarity index 97% rename from app/src/main/java/com/sameerasw/essentials/ui/components/battery/BatteryAppsTabContent.kt rename to app/src/main/java/com/sameerasw/essentials/ui/features/battery/components/BatteryAppsTabContent.kt index 230570984..28ebed057 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/components/battery/BatteryAppsTabContent.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/features/battery/components/BatteryAppsTabContent.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Feature - Battery + * File: BatteryAppsTabContent.kt + * Description: UI component and settings composable for Battery feature domain. + */ + package com.sameerasw.essentials.ui.components.battery import android.view.View @@ -37,7 +46,7 @@ import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.unit.dp import androidx.core.graphics.drawable.toBitmap import com.sameerasw.essentials.R -import com.sameerasw.essentials.ui.components.containers.RoundedCardContainer +import com.sameerasw.essentials.ui.core.containers.RoundedCardContainer import com.sameerasw.essentials.ui.theme.Shapes import com.sameerasw.essentials.utils.BatteryUsageApp import com.sameerasw.essentials.utils.HapticUtil diff --git a/app/src/main/java/com/sameerasw/essentials/ui/components/battery/BatteryCommonComponents.kt b/app/src/main/java/com/sameerasw/essentials/ui/features/battery/components/BatteryCommonComponents.kt similarity index 98% rename from app/src/main/java/com/sameerasw/essentials/ui/components/battery/BatteryCommonComponents.kt rename to app/src/main/java/com/sameerasw/essentials/ui/features/battery/components/BatteryCommonComponents.kt index cd6be701e..714b0d292 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/components/battery/BatteryCommonComponents.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/features/battery/components/BatteryCommonComponents.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Feature - Battery + * File: BatteryCommonComponents.kt + * Description: UI component and settings composable for Battery feature domain. + */ + package com.sameerasw.essentials.ui.components.battery import androidx.compose.animation.AnimatedContent diff --git a/app/src/main/java/com/sameerasw/essentials/ui/components/battery/BatteryInfoTabContent.kt b/app/src/main/java/com/sameerasw/essentials/ui/features/battery/components/BatteryInfoTabContent.kt similarity index 97% rename from app/src/main/java/com/sameerasw/essentials/ui/components/battery/BatteryInfoTabContent.kt rename to app/src/main/java/com/sameerasw/essentials/ui/features/battery/components/BatteryInfoTabContent.kt index 5146dff2d..c2e524f9b 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/components/battery/BatteryInfoTabContent.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/features/battery/components/BatteryInfoTabContent.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Feature - Battery + * File: BatteryInfoTabContent.kt + * Description: UI component and settings composable for Battery feature domain. + */ + package com.sameerasw.essentials.ui.components.battery import androidx.compose.animation.AnimatedVisibility @@ -37,12 +46,12 @@ import androidx.compose.ui.unit.dp import com.sameerasw.essentials.R import com.sameerasw.essentials.data.repository.SettingsRepository import com.sameerasw.essentials.ui.components.buttons.ListExpandToggleButton -import com.sameerasw.essentials.ui.components.containers.RoundedCardContainer -import com.sameerasw.essentials.ui.components.pickers.MultiSegmentedPicker +import com.sameerasw.essentials.ui.core.containers.RoundedCardContainer +import com.sameerasw.essentials.ui.core.pickers.MultiSegmentedPicker import com.sameerasw.essentials.ui.theme.Shapes -import com.sameerasw.essentials.utils.BatteryDetails -import com.sameerasw.essentials.utils.BatteryInfoUtil -import com.sameerasw.essentials.utils.ThermalInfo +import com.sameerasw.essentials.utils.battery.BatteryDetails +import com.sameerasw.essentials.utils.battery.BatteryInfoUtil +import com.sameerasw.essentials.utils.hardware.ThermalInfo import java.util.Locale @Composable @@ -542,7 +551,7 @@ fun BatteryInfoTabContent( var autoResetEnabled by remember { mutableStateOf(settingsRepository.getBoolean("auto_reset_battery_stats", false)) } - com.sameerasw.essentials.ui.components.cards.IconToggleItem( + com.sameerasw.essentials.ui.core.cards.IconToggleItem( title = stringResource(R.string.label_auto_reset_battery_stats_title), description = stringResource(R.string.label_auto_reset_battery_stats_desc), isChecked = autoResetEnabled, diff --git a/app/src/main/java/com/sameerasw/essentials/ui/components/battery/BatterySystemTabContent.kt b/app/src/main/java/com/sameerasw/essentials/ui/features/battery/components/BatterySystemTabContent.kt similarity index 95% rename from app/src/main/java/com/sameerasw/essentials/ui/components/battery/BatterySystemTabContent.kt rename to app/src/main/java/com/sameerasw/essentials/ui/features/battery/components/BatterySystemTabContent.kt index bc5fad976..5cfeeda71 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/components/battery/BatterySystemTabContent.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/features/battery/components/BatterySystemTabContent.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Feature - Battery + * File: BatterySystemTabContent.kt + * Description: UI component and settings composable for Battery feature domain. + */ + package com.sameerasw.essentials.ui.components.battery import androidx.compose.foundation.layout.fillMaxWidth @@ -10,7 +19,7 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.res.stringResource import com.sameerasw.essentials.R import com.sameerasw.essentials.ui.components.buttons.ListExpandToggleButton -import com.sameerasw.essentials.ui.components.containers.RoundedCardContainer +import com.sameerasw.essentials.ui.core.containers.RoundedCardContainer import com.sameerasw.essentials.utils.CpuWakeupItem import java.util.Locale diff --git a/app/src/main/java/com/sameerasw/essentials/ui/components/sheets/BatteryDetailsBottomSheet.kt b/app/src/main/java/com/sameerasw/essentials/ui/features/battery/sheets/BatteryDetailsBottomSheet.kt similarity index 95% rename from app/src/main/java/com/sameerasw/essentials/ui/components/sheets/BatteryDetailsBottomSheet.kt rename to app/src/main/java/com/sameerasw/essentials/ui/features/battery/sheets/BatteryDetailsBottomSheet.kt index 0ebb06363..0823bcc2d 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/components/sheets/BatteryDetailsBottomSheet.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/features/battery/sheets/BatteryDetailsBottomSheet.kt @@ -1,4 +1,13 @@ -package com.sameerasw.essentials.ui.components.sheets +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Feature - Battery + * File: BatteryDetailsBottomSheet.kt + * Description: UI component and settings composable for Battery feature domain. + */ + +package com.sameerasw.essentials.ui.core.sheets import androidx.compose.animation.animateContentSize import androidx.compose.foundation.ExperimentalFoundationApi @@ -39,13 +48,13 @@ import com.sameerasw.essentials.R import com.sameerasw.essentials.ui.components.battery.BatteryAppsTabContent import com.sameerasw.essentials.ui.components.battery.BatteryInfoTabContent import com.sameerasw.essentials.ui.components.battery.BatterySystemTabContent -import com.sameerasw.essentials.ui.components.containers.RoundedCardContainer -import com.sameerasw.essentials.utils.BatteryDetails -import com.sameerasw.essentials.utils.BatteryInfoUtil +import com.sameerasw.essentials.ui.core.containers.RoundedCardContainer import com.sameerasw.essentials.utils.BatteryStatsUtil import com.sameerasw.essentials.utils.BatteryUsageApp import com.sameerasw.essentials.utils.CpuWakeupItem import com.sameerasw.essentials.utils.DeviceUtils +import com.sameerasw.essentials.utils.battery.BatteryDetails +import com.sameerasw.essentials.utils.battery.BatteryInfoUtil import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.withContext @@ -233,7 +242,7 @@ fun BatteryDetailsBottomSheet( } RoundedCardContainer { - com.sameerasw.essentials.ui.components.pickers.SegmentedPicker( + com.sameerasw.essentials.ui.core.pickers.SegmentedPicker( items = tabResIds, selectedItem = tabResIds[selectedTab], onItemSelected = { selectedTab = tabResIds.indexOf(it) }, diff --git a/app/src/main/java/com/sameerasw/essentials/ui/composables/configs/AlwaysOnDisplaySettingsUI.kt b/app/src/main/java/com/sameerasw/essentials/ui/features/display/AlwaysOnDisplaySettingsUI.kt similarity index 93% rename from app/src/main/java/com/sameerasw/essentials/ui/composables/configs/AlwaysOnDisplaySettingsUI.kt rename to app/src/main/java/com/sameerasw/essentials/ui/features/display/AlwaysOnDisplaySettingsUI.kt index 489482255..5e87938ce 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/composables/configs/AlwaysOnDisplaySettingsUI.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/features/display/AlwaysOnDisplaySettingsUI.kt @@ -1,4 +1,13 @@ -package com.sameerasw.essentials.ui.composables.configs +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Feature - Display + * File: AlwaysOnDisplaySettingsUI.kt + * Description: UI component and settings composable for Display feature domain. + */ + +package com.sameerasw.essentials.ui.features.system import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column @@ -21,9 +30,9 @@ import androidx.compose.ui.platform.LocalView import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp import com.sameerasw.essentials.R -import com.sameerasw.essentials.ui.components.cards.IconToggleItem -import com.sameerasw.essentials.ui.components.containers.RoundedCardContainer -import com.sameerasw.essentials.ui.components.sheets.AppSelectionSheet +import com.sameerasw.essentials.ui.core.cards.IconToggleItem +import com.sameerasw.essentials.ui.core.containers.RoundedCardContainer +import com.sameerasw.essentials.ui.core.sheets.AppSelectionSheet import com.sameerasw.essentials.ui.modifiers.highlight import com.sameerasw.essentials.utils.HapticUtil import com.sameerasw.essentials.viewmodels.MainViewModel diff --git a/app/src/main/java/com/sameerasw/essentials/ui/composables/configs/EssentialsOnDisplaySettingsUI.kt b/app/src/main/java/com/sameerasw/essentials/ui/features/display/EssentialsOnDisplaySettingsUI.kt similarity index 94% rename from app/src/main/java/com/sameerasw/essentials/ui/composables/configs/EssentialsOnDisplaySettingsUI.kt rename to app/src/main/java/com/sameerasw/essentials/ui/features/display/EssentialsOnDisplaySettingsUI.kt index f3569cd99..62776a7d5 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/composables/configs/EssentialsOnDisplaySettingsUI.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/features/display/EssentialsOnDisplaySettingsUI.kt @@ -1,4 +1,13 @@ -package com.sameerasw.essentials.ui.composables.configs +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Feature - Display + * File: EssentialsOnDisplaySettingsUI.kt + * Description: UI component and settings composable for Display feature domain. + */ + +package com.sameerasw.essentials.ui.features.system import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Spacer @@ -17,12 +26,12 @@ import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp import com.sameerasw.essentials.R -import com.sameerasw.essentials.ui.components.cards.IconToggleItem -import com.sameerasw.essentials.ui.components.containers.RoundedCardContainer -import com.sameerasw.essentials.ui.components.pickers.AlbumArtModePicker -import com.sameerasw.essentials.ui.components.sheets.PermissionItem -import com.sameerasw.essentials.ui.components.sheets.PermissionsBottomSheet import com.sameerasw.essentials.ui.components.sliders.ConfigSliderItem +import com.sameerasw.essentials.ui.core.cards.IconToggleItem +import com.sameerasw.essentials.ui.core.containers.RoundedCardContainer +import com.sameerasw.essentials.ui.core.pickers.AlbumArtModePicker +import com.sameerasw.essentials.ui.core.sheets.PermissionItem +import com.sameerasw.essentials.ui.core.sheets.PermissionsBottomSheet import com.sameerasw.essentials.ui.modifiers.highlight import com.sameerasw.essentials.viewmodels.MainViewModel diff --git a/app/src/main/java/com/sameerasw/essentials/ui/composables/configs/RefreshRateSettingsUI.kt b/app/src/main/java/com/sameerasw/essentials/ui/features/display/RefreshRateSettingsUI.kt similarity index 95% rename from app/src/main/java/com/sameerasw/essentials/ui/composables/configs/RefreshRateSettingsUI.kt rename to app/src/main/java/com/sameerasw/essentials/ui/features/display/RefreshRateSettingsUI.kt index 1f5ca3fe5..955a7b0ee 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/composables/configs/RefreshRateSettingsUI.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/features/display/RefreshRateSettingsUI.kt @@ -1,4 +1,13 @@ -package com.sameerasw.essentials.ui.composables.configs +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Feature - Display + * File: RefreshRateSettingsUI.kt + * Description: UI component and settings composable for Display feature domain. + */ + +package com.sameerasw.essentials.ui.features.system import androidx.compose.foundation.background import androidx.compose.foundation.layout.Arrangement @@ -21,9 +30,9 @@ import androidx.compose.ui.platform.LocalView import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp import com.sameerasw.essentials.R -import com.sameerasw.essentials.ui.components.containers.RoundedCardContainer -import com.sameerasw.essentials.ui.components.pickers.SegmentedPicker import com.sameerasw.essentials.ui.components.sliders.ConfigSliderItem +import com.sameerasw.essentials.ui.core.containers.RoundedCardContainer +import com.sameerasw.essentials.ui.core.pickers.SegmentedPicker import com.sameerasw.essentials.utils.HapticUtil import com.sameerasw.essentials.utils.RefreshRateUtils import com.sameerasw.essentials.viewmodels.MainViewModel diff --git a/app/src/main/java/com/sameerasw/essentials/ui/composables/configs/SmartPixelsSettingsUI.kt b/app/src/main/java/com/sameerasw/essentials/ui/features/display/SmartPixelsSettingsUI.kt similarity index 87% rename from app/src/main/java/com/sameerasw/essentials/ui/composables/configs/SmartPixelsSettingsUI.kt rename to app/src/main/java/com/sameerasw/essentials/ui/features/display/SmartPixelsSettingsUI.kt index e61d2845f..c7a54647b 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/composables/configs/SmartPixelsSettingsUI.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/features/display/SmartPixelsSettingsUI.kt @@ -1,8 +1,16 @@ -package com.sameerasw.essentials.ui.composables.configs +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Feature - Display + * File: SmartPixelsSettingsUI.kt + * Description: UI component and settings composable for Display feature domain. + */ + +package com.sameerasw.essentials.ui.features.system import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column -import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding import androidx.compose.material3.ExperimentalMaterial3ExpressiveApi import androidx.compose.runtime.Composable @@ -16,9 +24,9 @@ import androidx.compose.ui.platform.LocalView import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp import com.sameerasw.essentials.R -import com.sameerasw.essentials.ui.components.cards.IconToggleItem -import com.sameerasw.essentials.ui.components.containers.RoundedCardContainer import com.sameerasw.essentials.ui.components.sliders.ConfigSliderItem +import com.sameerasw.essentials.ui.core.cards.IconToggleItem +import com.sameerasw.essentials.ui.core.containers.RoundedCardContainer import com.sameerasw.essentials.ui.modifiers.highlight import com.sameerasw.essentials.utils.HapticUtil import com.sameerasw.essentials.viewmodels.MainViewModel diff --git a/app/src/main/java/com/sameerasw/essentials/ui/composables/FreezeGridUI.kt b/app/src/main/java/com/sameerasw/essentials/ui/features/freeze/FreezeGridUI.kt similarity index 96% rename from app/src/main/java/com/sameerasw/essentials/ui/composables/FreezeGridUI.kt rename to app/src/main/java/com/sameerasw/essentials/ui/features/freeze/FreezeGridUI.kt index c6a0c886d..8fa4986a2 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/composables/FreezeGridUI.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/features/freeze/FreezeGridUI.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Feature - Freeze + * File: FreezeGridUI.kt + * Description: UI component and settings composable for Freeze feature domain. + */ + package com.sameerasw.essentials.ui.composables import android.content.Intent @@ -374,15 +383,23 @@ fun FreezeGridUI( horizontalArrangement = Arrangement.spacedBy(4.dp) ) { rowApps.forEach { app -> - val appTagIds = freezeAppTagMap[app.packageName] ?: emptyList() - val neverAutoFreezeTagIds = freezeTags.filter { it.neverAutoFreeze }.map { it.id }.toSet() - val isLockedByTag = appTagIds.any { neverAutoFreezeTagIds.contains(it) } + val appTagIds = + freezeAppTagMap[app.packageName] ?: emptyList() + val neverAutoFreezeTagIds = + freezeTags.filter { it.neverAutoFreeze }.map { it.id } + .toSet() + val isLockedByTag = + appTagIds.any { neverAutoFreezeTagIds.contains(it) } val tagColor = if (isTagColorCodedEnabled) { appTagIds.firstOrNull()?.let { firstTagId -> freezeTags.find { it.id == firstTagId }?.colorHex?.let { colorHex -> try { - Color(android.graphics.Color.parseColor(colorHex)) + Color( + android.graphics.Color.parseColor( + colorHex + ) + ) } catch (e: Exception) { null } @@ -462,7 +479,7 @@ fun FreezeGridUI( } appForTagAssignment?.let { targetApp -> - com.sameerasw.essentials.ui.components.sheets.AssignTagsSheet( + com.sameerasw.essentials.ui.core.sheets.AssignTagsSheet( appName = targetApp.appName, availableTags = freezeTags, assignedTagIds = freezeAppTagMap[targetApp.packageName] ?: emptyList(), diff --git a/app/src/main/java/com/sameerasw/essentials/ui/composables/configs/FreezeSettingsUI.kt b/app/src/main/java/com/sameerasw/essentials/ui/features/freeze/FreezeSettingsUI.kt similarity index 97% rename from app/src/main/java/com/sameerasw/essentials/ui/composables/configs/FreezeSettingsUI.kt rename to app/src/main/java/com/sameerasw/essentials/ui/features/freeze/FreezeSettingsUI.kt index cf9a2d738..53184c486 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/composables/configs/FreezeSettingsUI.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/features/freeze/FreezeSettingsUI.kt @@ -1,4 +1,13 @@ -package com.sameerasw.essentials.ui.composables.configs +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Feature - Freeze + * File: FreezeSettingsUI.kt + * Description: UI component and settings composable for Freeze feature domain. + */ + +package com.sameerasw.essentials.ui.features.system import androidx.activity.compose.rememberLauncherForActivityResult import androidx.activity.result.contract.ActivityResultContracts @@ -49,15 +58,15 @@ import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp import com.sameerasw.essentials.R import com.sameerasw.essentials.domain.model.FreezeMode -import com.sameerasw.essentials.ui.components.cards.AppToggleItem -import com.sameerasw.essentials.ui.components.cards.FeatureCard -import com.sameerasw.essentials.ui.components.cards.IconToggleItem -import com.sameerasw.essentials.ui.components.containers.RoundedCardContainer import com.sameerasw.essentials.ui.components.menus.SegmentedDropdownMenu import com.sameerasw.essentials.ui.components.menus.SegmentedDropdownMenuItem -import com.sameerasw.essentials.ui.components.pickers.SegmentedPicker -import com.sameerasw.essentials.ui.components.sheets.AppSelectionSheet -import com.sameerasw.essentials.ui.components.sheets.PermissionsBottomSheet +import com.sameerasw.essentials.ui.core.cards.AppToggleItem +import com.sameerasw.essentials.ui.core.cards.FeatureCard +import com.sameerasw.essentials.ui.core.cards.IconToggleItem +import com.sameerasw.essentials.ui.core.containers.RoundedCardContainer +import com.sameerasw.essentials.ui.core.pickers.SegmentedPicker +import com.sameerasw.essentials.ui.core.sheets.AppSelectionSheet +import com.sameerasw.essentials.ui.core.sheets.PermissionsBottomSheet import com.sameerasw.essentials.ui.modifiers.highlight import com.sameerasw.essentials.utils.HapticUtil import com.sameerasw.essentials.utils.PermissionUIHelper @@ -496,7 +505,9 @@ fun FreezeSettingsUI( androidx.compose.material3.ListItem( leadingContent = { - val richColor = androidx.compose.runtime.remember(color) { com.sameerasw.essentials.utils.ColorUtil.toRichColor(color) } + val richColor = androidx.compose.runtime.remember(color) { + com.sameerasw.essentials.utils.ColorUtil.toRichColor(color) + } Box( modifier = Modifier .size(32.dp) @@ -723,7 +734,11 @@ fun FreezeSettingsUI( enabled = !isLockedByTag, onCheckedChange = { isChecked -> if (!isLockedByTag) { - viewModel.updateFreezeAppAutoFreeze(context, app.packageName, isChecked) + viewModel.updateFreezeAppAutoFreeze( + context, + app.packageName, + isChecked + ) } } ) @@ -732,7 +747,7 @@ fun FreezeSettingsUI( } if (isTagEditorSheetOpen) { - com.sameerasw.essentials.ui.components.sheets.FreezeTagEditorSheet( + com.sameerasw.essentials.ui.core.sheets.FreezeTagEditorSheet( tagToEdit = tagToEdit, onDismissRequest = { isTagEditorSheetOpen = false }, onSave = { tag -> diff --git a/app/src/main/java/com/sameerasw/essentials/ui/components/FreezeTagColorPicker.kt b/app/src/main/java/com/sameerasw/essentials/ui/features/freeze/components/FreezeTagColorPicker.kt similarity index 92% rename from app/src/main/java/com/sameerasw/essentials/ui/components/FreezeTagColorPicker.kt rename to app/src/main/java/com/sameerasw/essentials/ui/features/freeze/components/FreezeTagColorPicker.kt index 602e78222..b5760e753 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/components/FreezeTagColorPicker.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/features/freeze/components/FreezeTagColorPicker.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Feature - Freeze + * File: FreezeTagColorPicker.kt + * Description: UI component and settings composable for Freeze feature domain. + */ + package com.sameerasw.essentials.ui.components import androidx.compose.foundation.background @@ -25,7 +34,7 @@ import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp import com.sameerasw.essentials.R -import com.sameerasw.essentials.ui.components.sheets.PRESET_PASTEL_COLORS +import com.sameerasw.essentials.ui.core.sheets.PRESET_PASTEL_COLORS import com.sameerasw.essentials.utils.HapticUtil @OptIn(ExperimentalMaterial3Api::class) diff --git a/app/src/main/java/com/sameerasw/essentials/ui/components/FreezeTagIconPicker.kt b/app/src/main/java/com/sameerasw/essentials/ui/features/freeze/components/FreezeTagIconPicker.kt similarity index 92% rename from app/src/main/java/com/sameerasw/essentials/ui/components/FreezeTagIconPicker.kt rename to app/src/main/java/com/sameerasw/essentials/ui/features/freeze/components/FreezeTagIconPicker.kt index 05812701a..d24664538 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/components/FreezeTagIconPicker.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/features/freeze/components/FreezeTagIconPicker.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Feature - Freeze + * File: FreezeTagIconPicker.kt + * Description: UI component and settings composable for Freeze feature domain. + */ + package com.sameerasw.essentials.ui.components import androidx.compose.foundation.background @@ -76,7 +85,8 @@ fun FreezeTagIconPicker( ) { index -> val iconName = icons[index] val isSelected = iconName == selectedIconName - val iconResId = context.resources.getIdentifier(iconName, "drawable", context.packageName) + val iconResId = + context.resources.getIdentifier(iconName, "drawable", context.packageName) Box( modifier = Modifier diff --git a/app/src/main/java/com/sameerasw/essentials/ui/components/sheets/AssignTagsSheet.kt b/app/src/main/java/com/sameerasw/essentials/ui/features/freeze/sheets/AssignTagsSheet.kt similarity index 94% rename from app/src/main/java/com/sameerasw/essentials/ui/components/sheets/AssignTagsSheet.kt rename to app/src/main/java/com/sameerasw/essentials/ui/features/freeze/sheets/AssignTagsSheet.kt index eaf1e65f3..a9ebe73c6 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/components/sheets/AssignTagsSheet.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/features/freeze/sheets/AssignTagsSheet.kt @@ -1,4 +1,13 @@ -package com.sameerasw.essentials.ui.components.sheets +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Feature - Freeze + * File: AssignTagsSheet.kt + * Description: UI component and settings composable for Freeze feature domain. + */ + +package com.sameerasw.essentials.ui.core.sheets import androidx.compose.foundation.background import androidx.compose.foundation.clickable @@ -39,7 +48,7 @@ import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.unit.dp import com.sameerasw.essentials.R import com.sameerasw.essentials.domain.model.AppTag -import com.sameerasw.essentials.ui.components.containers.RoundedCardContainer +import com.sameerasw.essentials.ui.core.containers.RoundedCardContainer import com.sameerasw.essentials.utils.HapticUtil @OptIn(ExperimentalMaterial3Api::class) @@ -100,7 +109,9 @@ fun AssignTagsSheet( androidx.compose.material3.ListItem( leadingContent = { - val richColor = remember(color) { com.sameerasw.essentials.utils.ColorUtil.toRichColor(color) } + val richColor = remember(color) { + com.sameerasw.essentials.utils.ColorUtil.toRichColor(color) + } Box( modifier = Modifier .size(32.dp) diff --git a/app/src/main/java/com/sameerasw/essentials/ui/components/sheets/FreezeTagEditorSheet.kt b/app/src/main/java/com/sameerasw/essentials/ui/features/freeze/sheets/FreezeTagEditorSheet.kt similarity index 95% rename from app/src/main/java/com/sameerasw/essentials/ui/components/sheets/FreezeTagEditorSheet.kt rename to app/src/main/java/com/sameerasw/essentials/ui/features/freeze/sheets/FreezeTagEditorSheet.kt index 5888e4733..86e9926e4 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/components/sheets/FreezeTagEditorSheet.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/features/freeze/sheets/FreezeTagEditorSheet.kt @@ -1,4 +1,13 @@ -package com.sameerasw.essentials.ui.components.sheets +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Feature - Freeze + * File: FreezeTagEditorSheet.kt + * Description: UI component and settings composable for Freeze feature domain. + */ + +package com.sameerasw.essentials.ui.core.sheets import androidx.compose.foundation.background import androidx.compose.foundation.layout.Arrangement @@ -37,8 +46,8 @@ import androidx.compose.ui.unit.dp import com.sameerasw.essentials.R import com.sameerasw.essentials.domain.model.AppTag import com.sameerasw.essentials.ui.components.FreezeTagIconPicker -import com.sameerasw.essentials.ui.components.cards.IconToggleItem -import com.sameerasw.essentials.ui.components.containers.RoundedCardContainer +import com.sameerasw.essentials.ui.core.cards.IconToggleItem +import com.sameerasw.essentials.ui.core.containers.RoundedCardContainer import com.sameerasw.essentials.utils.HapticUtil import java.util.UUID @@ -94,7 +103,7 @@ fun FreezeTagEditorSheet( ) { Text( text = if (tagToEdit == null) stringResource(R.string.action_create_tag) - else stringResource(R.string.action_update_tag), + else stringResource(R.string.action_update_tag), style = MaterialTheme.typography.titleLarge, fontWeight = FontWeight.Bold, color = MaterialTheme.colorScheme.onSurface diff --git a/app/src/main/java/com/sameerasw/essentials/ui/components/sheets/FreezeTagSettingsSheet.kt b/app/src/main/java/com/sameerasw/essentials/ui/features/freeze/sheets/FreezeTagSettingsSheet.kt similarity index 94% rename from app/src/main/java/com/sameerasw/essentials/ui/components/sheets/FreezeTagSettingsSheet.kt rename to app/src/main/java/com/sameerasw/essentials/ui/features/freeze/sheets/FreezeTagSettingsSheet.kt index be6d98d92..ef2df27c7 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/components/sheets/FreezeTagSettingsSheet.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/features/freeze/sheets/FreezeTagSettingsSheet.kt @@ -1,16 +1,23 @@ -package com.sameerasw.essentials.ui.components.sheets +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Feature - Freeze + * File: FreezeTagSettingsSheet.kt + * Description: UI component and settings composable for Freeze feature domain. + */ + +package com.sameerasw.essentials.ui.core.sheets import androidx.compose.foundation.background import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column -import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size -import androidx.compose.foundation.layout.width import androidx.compose.foundation.shape.CircleShape import androidx.compose.material3.Button import androidx.compose.material3.Checkbox @@ -38,8 +45,8 @@ import androidx.compose.ui.unit.dp import com.sameerasw.essentials.R import com.sameerasw.essentials.domain.diy.Action import com.sameerasw.essentials.domain.model.AppTag -import com.sameerasw.essentials.ui.components.containers.RoundedCardContainer -import com.sameerasw.essentials.ui.components.pickers.SegmentedPicker +import com.sameerasw.essentials.ui.core.containers.RoundedCardContainer +import com.sameerasw.essentials.ui.core.pickers.SegmentedPicker import com.sameerasw.essentials.utils.ColorUtil import com.sameerasw.essentials.utils.HapticUtil @@ -76,8 +83,8 @@ fun FreezeTagSettingsSheet( color = MaterialTheme.colorScheme.onSurface ) - - RoundedCardContainer{ + + RoundedCardContainer { SegmentedPicker( items = modeOptions, selectedItem = selectedMode, diff --git a/app/src/main/java/com/sameerasw/essentials/ui/composables/configs/ButtonRemapSettingsUI.kt b/app/src/main/java/com/sameerasw/essentials/ui/features/hardware/ButtonRemapSettingsUI.kt similarity index 98% rename from app/src/main/java/com/sameerasw/essentials/ui/composables/configs/ButtonRemapSettingsUI.kt rename to app/src/main/java/com/sameerasw/essentials/ui/features/hardware/ButtonRemapSettingsUI.kt index 95bf90340..92f7c59fb 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/composables/configs/ButtonRemapSettingsUI.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/features/hardware/ButtonRemapSettingsUI.kt @@ -1,4 +1,13 @@ -package com.sameerasw.essentials.ui.composables.configs +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Hardware Features + * File: ButtonRemapSettingsUI.kt + * Description: Composable screen for remapping volume and hardware keys. + */ + +package com.sameerasw.essentials.ui.features.system import androidx.compose.animation.AnimatedVisibility import androidx.compose.animation.expandVertically @@ -43,10 +52,10 @@ import com.sameerasw.essentials.R import com.sameerasw.essentials.domain.HapticFeedbackType import com.sameerasw.essentials.shizuku.ShizukuPermissionHelper import com.sameerasw.essentials.shizuku.ShizukuStatus -import com.sameerasw.essentials.ui.components.cards.IconToggleItem -import com.sameerasw.essentials.ui.components.containers.RoundedCardContainer -import com.sameerasw.essentials.ui.components.pickers.HapticFeedbackPicker -import com.sameerasw.essentials.ui.components.pickers.SegmentedPicker +import com.sameerasw.essentials.ui.core.cards.IconToggleItem +import com.sameerasw.essentials.ui.core.containers.RoundedCardContainer +import com.sameerasw.essentials.ui.core.pickers.HapticFeedbackPicker +import com.sameerasw.essentials.ui.core.pickers.SegmentedPicker import com.sameerasw.essentials.ui.modifiers.highlight import com.sameerasw.essentials.utils.HapticUtil import com.sameerasw.essentials.viewmodels.MainViewModel diff --git a/app/src/main/java/com/sameerasw/essentials/ui/composables/configs/FlashlightPulseSettingsUI.kt b/app/src/main/java/com/sameerasw/essentials/ui/features/hardware/FlashlightPulseSettingsUI.kt similarity index 93% rename from app/src/main/java/com/sameerasw/essentials/ui/composables/configs/FlashlightPulseSettingsUI.kt rename to app/src/main/java/com/sameerasw/essentials/ui/features/hardware/FlashlightPulseSettingsUI.kt index 6163cb206..f6d30a5cb 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/composables/configs/FlashlightPulseSettingsUI.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/features/hardware/FlashlightPulseSettingsUI.kt @@ -1,4 +1,13 @@ -package com.sameerasw.essentials.ui.composables.configs +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Feature - Hardware + * File: FlashlightPulseSettingsUI.kt + * Description: UI component and settings composable for Hardware feature domain. + */ + +package com.sameerasw.essentials.ui.features.system import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column @@ -21,10 +30,10 @@ import androidx.compose.ui.platform.LocalView import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp import com.sameerasw.essentials.R -import com.sameerasw.essentials.ui.components.cards.IconToggleItem -import com.sameerasw.essentials.ui.components.containers.RoundedCardContainer -import com.sameerasw.essentials.ui.components.sheets.AppSelectionSheet import com.sameerasw.essentials.ui.components.sliders.ConfigSliderItem +import com.sameerasw.essentials.ui.core.cards.IconToggleItem +import com.sameerasw.essentials.ui.core.containers.RoundedCardContainer +import com.sameerasw.essentials.ui.core.sheets.AppSelectionSheet import com.sameerasw.essentials.ui.modifiers.highlight import com.sameerasw.essentials.utils.HapticUtil import com.sameerasw.essentials.viewmodels.MainViewModel diff --git a/app/src/main/java/com/sameerasw/essentials/ui/composables/configs/FlashlightSettingsUI.kt b/app/src/main/java/com/sameerasw/essentials/ui/features/hardware/FlashlightSettingsUI.kt similarity index 90% rename from app/src/main/java/com/sameerasw/essentials/ui/composables/configs/FlashlightSettingsUI.kt rename to app/src/main/java/com/sameerasw/essentials/ui/features/hardware/FlashlightSettingsUI.kt index cb707df60..da29b8f4a 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/composables/configs/FlashlightSettingsUI.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/features/hardware/FlashlightSettingsUI.kt @@ -1,4 +1,13 @@ -package com.sameerasw.essentials.ui.composables.configs +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Hardware Features + * File: FlashlightSettingsUI.kt + * Description: Composable screen for flashlight shortcuts and intensity controls. + */ + +package com.sameerasw.essentials.ui.features.system import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column @@ -12,8 +21,8 @@ import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp import com.sameerasw.essentials.R -import com.sameerasw.essentials.ui.components.cards.IconToggleItem -import com.sameerasw.essentials.ui.components.containers.RoundedCardContainer +import com.sameerasw.essentials.ui.core.cards.IconToggleItem +import com.sameerasw.essentials.ui.core.containers.RoundedCardContainer import com.sameerasw.essentials.ui.modifiers.highlight import com.sameerasw.essentials.viewmodels.MainViewModel diff --git a/app/src/main/java/com/sameerasw/essentials/ui/composables/configs/PocketModeSettingsUI.kt b/app/src/main/java/com/sameerasw/essentials/ui/features/hardware/PocketModeSettingsUI.kt similarity index 93% rename from app/src/main/java/com/sameerasw/essentials/ui/composables/configs/PocketModeSettingsUI.kt rename to app/src/main/java/com/sameerasw/essentials/ui/features/hardware/PocketModeSettingsUI.kt index 0e82ae603..30bae6604 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/composables/configs/PocketModeSettingsUI.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/features/hardware/PocketModeSettingsUI.kt @@ -1,4 +1,13 @@ -package com.sameerasw.essentials.ui.composables.configs +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Feature - Hardware + * File: PocketModeSettingsUI.kt + * Description: UI component and settings composable for Hardware feature domain. + */ + +package com.sameerasw.essentials.ui.features.system import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column @@ -21,10 +30,10 @@ import androidx.compose.ui.platform.LocalView import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp import com.sameerasw.essentials.R -import com.sameerasw.essentials.ui.components.cards.IconToggleItem -import com.sameerasw.essentials.ui.components.containers.RoundedCardContainer -import com.sameerasw.essentials.ui.components.sheets.AppSelectionSheet import com.sameerasw.essentials.ui.components.sliders.ConfigSliderItem +import com.sameerasw.essentials.ui.core.cards.IconToggleItem +import com.sameerasw.essentials.ui.core.containers.RoundedCardContainer +import com.sameerasw.essentials.ui.core.sheets.AppSelectionSheet import com.sameerasw.essentials.ui.modifiers.highlight import com.sameerasw.essentials.utils.HapticUtil import com.sameerasw.essentials.viewmodels.MainViewModel diff --git a/app/src/main/java/com/sameerasw/essentials/ui/components/sheets/DeviceEffectsSettingsSheet.kt b/app/src/main/java/com/sameerasw/essentials/ui/features/hardware/sheets/DeviceEffectsSettingsSheet.kt similarity index 98% rename from app/src/main/java/com/sameerasw/essentials/ui/components/sheets/DeviceEffectsSettingsSheet.kt rename to app/src/main/java/com/sameerasw/essentials/ui/features/hardware/sheets/DeviceEffectsSettingsSheet.kt index 96a43233c..e0255c151 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/components/sheets/DeviceEffectsSettingsSheet.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/features/hardware/sheets/DeviceEffectsSettingsSheet.kt @@ -1,4 +1,13 @@ -package com.sameerasw.essentials.ui.components.sheets +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Feature - Hardware + * File: DeviceEffectsSettingsSheet.kt + * Description: UI component and settings composable for Hardware feature domain. + */ + +package com.sameerasw.essentials.ui.core.sheets import androidx.compose.foundation.background import androidx.compose.foundation.clickable diff --git a/app/src/main/java/com/sameerasw/essentials/ui/composables/configs/NotificationLightingSettingsUI.kt b/app/src/main/java/com/sameerasw/essentials/ui/features/lighting/NotificationLightingSettingsUI.kt similarity index 97% rename from app/src/main/java/com/sameerasw/essentials/ui/composables/configs/NotificationLightingSettingsUI.kt rename to app/src/main/java/com/sameerasw/essentials/ui/features/lighting/NotificationLightingSettingsUI.kt index 284c9a559..bc3a02de2 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/composables/configs/NotificationLightingSettingsUI.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/features/lighting/NotificationLightingSettingsUI.kt @@ -1,4 +1,13 @@ -package com.sameerasw.essentials.ui.composables.configs +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Feature - Lighting + * File: NotificationLightingSettingsUI.kt + * Description: UI component and settings composable for Lighting feature domain. + */ + +package com.sameerasw.essentials.ui.features.system import android.content.Intent import android.net.Uri @@ -49,18 +58,18 @@ import com.sameerasw.essentials.R import com.sameerasw.essentials.domain.model.NotificationLightingColorMode import com.sameerasw.essentials.domain.model.NotificationLightingStyle import com.sameerasw.essentials.domain.model.NotificationLightingSweepPosition -import com.sameerasw.essentials.ui.components.cards.FeatureCard -import com.sameerasw.essentials.ui.components.cards.IconToggleItem -import com.sameerasw.essentials.ui.components.containers.RoundedCardContainer -import com.sameerasw.essentials.ui.components.pickers.GlowSidesPicker -import com.sameerasw.essentials.ui.components.pickers.NotificationLightingColorModePicker -import com.sameerasw.essentials.ui.components.pickers.NotificationLightingStylePicker -import com.sameerasw.essentials.ui.components.pickers.NotificationLightingSystemModePicker -import com.sameerasw.essentials.ui.components.sheets.AppSelectionSheet -import com.sameerasw.essentials.ui.components.sheets.PermissionItem -import com.sameerasw.essentials.ui.components.sheets.PermissionsBottomSheet -import com.sameerasw.essentials.ui.components.sheets.SweepShapesBottomSheet import com.sameerasw.essentials.ui.components.sliders.ConfigSliderItem +import com.sameerasw.essentials.ui.core.cards.FeatureCard +import com.sameerasw.essentials.ui.core.cards.IconToggleItem +import com.sameerasw.essentials.ui.core.containers.RoundedCardContainer +import com.sameerasw.essentials.ui.core.pickers.GlowSidesPicker +import com.sameerasw.essentials.ui.core.pickers.NotificationLightingColorModePicker +import com.sameerasw.essentials.ui.core.pickers.NotificationLightingStylePicker +import com.sameerasw.essentials.ui.core.pickers.NotificationLightingSystemModePicker +import com.sameerasw.essentials.ui.core.sheets.AppSelectionSheet +import com.sameerasw.essentials.ui.core.sheets.PermissionItem +import com.sameerasw.essentials.ui.core.sheets.PermissionsBottomSheet +import com.sameerasw.essentials.ui.core.sheets.SweepShapesBottomSheet import com.sameerasw.essentials.ui.modifiers.highlight import com.sameerasw.essentials.utils.HapticUtil import com.sameerasw.essentials.utils.ShellUtils diff --git a/app/src/main/java/com/sameerasw/essentials/ui/components/pickers/EdgeLightingColorModePicker.kt b/app/src/main/java/com/sameerasw/essentials/ui/features/lighting/pickers/EdgeLightingColorModePicker.kt similarity index 90% rename from app/src/main/java/com/sameerasw/essentials/ui/components/pickers/EdgeLightingColorModePicker.kt rename to app/src/main/java/com/sameerasw/essentials/ui/features/lighting/pickers/EdgeLightingColorModePicker.kt index 22be206ea..f0395cb5a 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/components/pickers/EdgeLightingColorModePicker.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/features/lighting/pickers/EdgeLightingColorModePicker.kt @@ -1,4 +1,13 @@ -package com.sameerasw.essentials.ui.components.pickers +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Feature - Lighting + * File: EdgeLightingColorModePicker.kt + * Description: UI component and settings composable for Lighting feature domain. + */ + +package com.sameerasw.essentials.ui.core.pickers import androidx.compose.foundation.background import androidx.compose.foundation.layout.Arrangement diff --git a/app/src/main/java/com/sameerasw/essentials/ui/components/pickers/EdgeLightingStylePicker.kt b/app/src/main/java/com/sameerasw/essentials/ui/features/lighting/pickers/EdgeLightingStylePicker.kt similarity index 90% rename from app/src/main/java/com/sameerasw/essentials/ui/components/pickers/EdgeLightingStylePicker.kt rename to app/src/main/java/com/sameerasw/essentials/ui/features/lighting/pickers/EdgeLightingStylePicker.kt index 2168e9c41..ffca577f6 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/components/pickers/EdgeLightingStylePicker.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/features/lighting/pickers/EdgeLightingStylePicker.kt @@ -1,4 +1,13 @@ -package com.sameerasw.essentials.ui.components.pickers +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Feature - Lighting + * File: EdgeLightingStylePicker.kt + * Description: UI component and settings composable for Lighting feature domain. + */ + +package com.sameerasw.essentials.ui.core.pickers import androidx.compose.foundation.background import androidx.compose.foundation.layout.Arrangement @@ -21,7 +30,7 @@ import androidx.compose.ui.semantics.semantics import androidx.compose.ui.unit.dp import com.sameerasw.essentials.R import com.sameerasw.essentials.domain.model.NotificationLightingStyle -import com.sameerasw.essentials.ui.components.containers.RoundedCardContainer +import com.sameerasw.essentials.ui.core.containers.RoundedCardContainer import com.sameerasw.essentials.utils.HapticUtil @OptIn(ExperimentalMaterial3ExpressiveApi::class) diff --git a/app/src/main/java/com/sameerasw/essentials/ui/components/pickers/GlowSidesPicker.kt b/app/src/main/java/com/sameerasw/essentials/ui/features/lighting/pickers/GlowSidesPicker.kt similarity index 91% rename from app/src/main/java/com/sameerasw/essentials/ui/components/pickers/GlowSidesPicker.kt rename to app/src/main/java/com/sameerasw/essentials/ui/features/lighting/pickers/GlowSidesPicker.kt index db79c578a..13c9c49b1 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/components/pickers/GlowSidesPicker.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/features/lighting/pickers/GlowSidesPicker.kt @@ -1,4 +1,13 @@ -package com.sameerasw.essentials.ui.components.pickers +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Feature - Lighting + * File: GlowSidesPicker.kt + * Description: UI component and settings composable for Lighting feature domain. + */ + +package com.sameerasw.essentials.ui.core.pickers import androidx.compose.foundation.background import androidx.compose.foundation.layout.Arrangement diff --git a/app/src/main/java/com/sameerasw/essentials/ui/components/pickers/NotificationLightingSystemModePicker.kt b/app/src/main/java/com/sameerasw/essentials/ui/features/lighting/pickers/NotificationLightingSystemModePicker.kt similarity index 89% rename from app/src/main/java/com/sameerasw/essentials/ui/components/pickers/NotificationLightingSystemModePicker.kt rename to app/src/main/java/com/sameerasw/essentials/ui/features/lighting/pickers/NotificationLightingSystemModePicker.kt index 81ae4e940..00cf28de7 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/components/pickers/NotificationLightingSystemModePicker.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/features/lighting/pickers/NotificationLightingSystemModePicker.kt @@ -1,4 +1,13 @@ -package com.sameerasw.essentials.ui.components.pickers +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Feature - Lighting + * File: NotificationLightingSystemModePicker.kt + * Description: UI component and settings composable for Lighting feature domain. + */ + +package com.sameerasw.essentials.ui.core.pickers import androidx.compose.foundation.background import androidx.compose.foundation.layout.Arrangement @@ -20,7 +29,7 @@ import androidx.compose.ui.semantics.role import androidx.compose.ui.semantics.semantics import androidx.compose.ui.unit.dp import com.sameerasw.essentials.R -import com.sameerasw.essentials.ui.components.containers.RoundedCardContainer +import com.sameerasw.essentials.ui.core.containers.RoundedCardContainer import com.sameerasw.essentials.utils.HapticUtil @OptIn(ExperimentalMaterial3ExpressiveApi::class) diff --git a/app/src/main/java/com/sameerasw/essentials/ui/components/sheets/SweepShapesBottomSheet.kt b/app/src/main/java/com/sameerasw/essentials/ui/features/lighting/sheets/SweepShapesBottomSheet.kt similarity index 95% rename from app/src/main/java/com/sameerasw/essentials/ui/components/sheets/SweepShapesBottomSheet.kt rename to app/src/main/java/com/sameerasw/essentials/ui/features/lighting/sheets/SweepShapesBottomSheet.kt index 1de4f708a..f1c100ade 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/components/sheets/SweepShapesBottomSheet.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/features/lighting/sheets/SweepShapesBottomSheet.kt @@ -1,4 +1,13 @@ -package com.sameerasw.essentials.ui.components.sheets +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Feature - Lighting + * File: SweepShapesBottomSheet.kt + * Description: UI component and settings composable for Lighting feature domain. + */ + +package com.sameerasw.essentials.ui.core.sheets import androidx.compose.foundation.background import androidx.compose.foundation.clickable diff --git a/app/src/main/java/com/sameerasw/essentials/ui/components/cards/LocationAlarmCard.kt b/app/src/main/java/com/sameerasw/essentials/ui/features/location/LocationAlarmCard.kt similarity index 95% rename from app/src/main/java/com/sameerasw/essentials/ui/components/cards/LocationAlarmCard.kt rename to app/src/main/java/com/sameerasw/essentials/ui/features/location/LocationAlarmCard.kt index 4cbae66ee..e3543df12 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/components/cards/LocationAlarmCard.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/features/location/LocationAlarmCard.kt @@ -1,4 +1,13 @@ -package com.sameerasw.essentials.ui.components.cards +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Feature - Location + * File: LocationAlarmCard.kt + * Description: UI component and settings composable for Location feature domain. + */ + +package com.sameerasw.essentials.ui.core.cards import androidx.compose.foundation.background import androidx.compose.foundation.clickable diff --git a/app/src/main/java/com/sameerasw/essentials/ui/components/LocationIconPicker.kt b/app/src/main/java/com/sameerasw/essentials/ui/features/location/LocationIconPicker.kt similarity index 94% rename from app/src/main/java/com/sameerasw/essentials/ui/components/LocationIconPicker.kt rename to app/src/main/java/com/sameerasw/essentials/ui/features/location/LocationIconPicker.kt index d8890d1e7..d88b42989 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/components/LocationIconPicker.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/features/location/LocationIconPicker.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Feature - Location + * File: LocationIconPicker.kt + * Description: UI component and settings composable for Location feature domain. + */ + package com.sameerasw.essentials.ui.components import androidx.compose.foundation.background diff --git a/app/src/main/java/com/sameerasw/essentials/ui/composables/configs/LocationReachedSettingsUI.kt b/app/src/main/java/com/sameerasw/essentials/ui/features/location/LocationReachedSettingsUI.kt similarity index 97% rename from app/src/main/java/com/sameerasw/essentials/ui/composables/configs/LocationReachedSettingsUI.kt rename to app/src/main/java/com/sameerasw/essentials/ui/features/location/LocationReachedSettingsUI.kt index 7628e2cff..651cdfd01 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/composables/configs/LocationReachedSettingsUI.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/features/location/LocationReachedSettingsUI.kt @@ -1,4 +1,13 @@ -package com.sameerasw.essentials.ui.composables.configs +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Feature - Location + * File: LocationReachedSettingsUI.kt + * Description: UI component and settings composable for Location feature domain. + */ + +package com.sameerasw.essentials.ui.features.system import android.content.Intent import android.os.Build @@ -41,9 +50,9 @@ import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.unit.dp import androidx.lifecycle.viewmodel.compose.viewModel import com.sameerasw.essentials.R -import com.sameerasw.essentials.ui.components.cards.LocationAlarmCard -import com.sameerasw.essentials.ui.components.containers.RoundedCardContainer -import com.sameerasw.essentials.ui.components.sheets.LocationReachedBottomSheet +import com.sameerasw.essentials.ui.core.cards.LocationAlarmCard +import com.sameerasw.essentials.ui.core.containers.RoundedCardContainer +import com.sameerasw.essentials.ui.core.sheets.LocationReachedBottomSheet import com.sameerasw.essentials.utils.HapticUtil import com.sameerasw.essentials.viewmodels.LocationReachedViewModel import com.sameerasw.essentials.viewmodels.MainViewModel @@ -207,7 +216,7 @@ fun LocationReachedSettingsUI( modifier = Modifier.fillMaxWidth(), containerColor = MaterialTheme.colorScheme.errorContainer ) { - com.sameerasw.essentials.ui.components.cards.IconToggleItem( + com.sameerasw.essentials.ui.core.cards.IconToggleItem( title = stringResource(R.string.location_reached_fsi_title), description = stringResource(R.string.location_reached_fsi_desc), isChecked = false, diff --git a/app/src/main/java/com/sameerasw/essentials/ui/components/sheets/LocationReachedBottomSheet.kt b/app/src/main/java/com/sameerasw/essentials/ui/features/location/sheets/LocationReachedBottomSheet.kt similarity index 96% rename from app/src/main/java/com/sameerasw/essentials/ui/components/sheets/LocationReachedBottomSheet.kt rename to app/src/main/java/com/sameerasw/essentials/ui/features/location/sheets/LocationReachedBottomSheet.kt index a89dde48e..042253ba2 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/components/sheets/LocationReachedBottomSheet.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/features/location/sheets/LocationReachedBottomSheet.kt @@ -1,4 +1,13 @@ -package com.sameerasw.essentials.ui.components.sheets +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Feature - Location + * File: LocationReachedBottomSheet.kt + * Description: UI component and settings composable for Location feature domain. + */ + +package com.sameerasw.essentials.ui.core.sheets import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column @@ -31,7 +40,7 @@ import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.unit.dp import com.sameerasw.essentials.R import com.sameerasw.essentials.ui.components.LocationIconPicker -import com.sameerasw.essentials.ui.components.containers.RoundedCardContainer +import com.sameerasw.essentials.ui.core.containers.RoundedCardContainer import com.sameerasw.essentials.viewmodels.LocationReachedViewModel @OptIn(ExperimentalMaterial3Api::class, ExperimentalMaterial3ExpressiveApi::class) diff --git a/app/src/main/java/com/sameerasw/essentials/ui/composables/configs/DynamicNightLightSettingsUI.kt b/app/src/main/java/com/sameerasw/essentials/ui/features/network/DynamicNightLightSettingsUI.kt similarity index 89% rename from app/src/main/java/com/sameerasw/essentials/ui/composables/configs/DynamicNightLightSettingsUI.kt rename to app/src/main/java/com/sameerasw/essentials/ui/features/network/DynamicNightLightSettingsUI.kt index d17914db7..0f4eba72d 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/composables/configs/DynamicNightLightSettingsUI.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/features/network/DynamicNightLightSettingsUI.kt @@ -1,4 +1,13 @@ -package com.sameerasw.essentials.ui.composables.configs +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Feature - Network + * File: DynamicNightLightSettingsUI.kt + * Description: UI component and settings composable for Network feature domain. + */ + +package com.sameerasw.essentials.ui.features.system import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column @@ -19,9 +28,9 @@ import androidx.compose.ui.platform.LocalView import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp import com.sameerasw.essentials.R -import com.sameerasw.essentials.ui.components.cards.IconToggleItem -import com.sameerasw.essentials.ui.components.containers.RoundedCardContainer -import com.sameerasw.essentials.ui.components.sheets.AppSelectionSheet +import com.sameerasw.essentials.ui.core.cards.IconToggleItem +import com.sameerasw.essentials.ui.core.containers.RoundedCardContainer +import com.sameerasw.essentials.ui.core.sheets.AppSelectionSheet import com.sameerasw.essentials.ui.modifiers.highlight import com.sameerasw.essentials.utils.HapticUtil import com.sameerasw.essentials.viewmodels.MainViewModel diff --git a/app/src/main/java/com/sameerasw/essentials/ui/composables/configs/NetworksSettingsUI.kt b/app/src/main/java/com/sameerasw/essentials/ui/features/network/NetworksSettingsUI.kt similarity index 90% rename from app/src/main/java/com/sameerasw/essentials/ui/composables/configs/NetworksSettingsUI.kt rename to app/src/main/java/com/sameerasw/essentials/ui/features/network/NetworksSettingsUI.kt index 6302d9394..e6ff1dd25 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/composables/configs/NetworksSettingsUI.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/features/network/NetworksSettingsUI.kt @@ -1,4 +1,13 @@ -package com.sameerasw.essentials.ui.composables.configs +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Network & Connectivity + * File: NetworksSettingsUI.kt + * Description: Composable screen for DNS presets and network tiles. + */ + +package com.sameerasw.essentials.ui.features.system import android.content.Intent import android.net.Uri @@ -23,11 +32,11 @@ import androidx.compose.ui.unit.dp import androidx.lifecycle.Lifecycle import androidx.lifecycle.LifecycleEventObserver import com.sameerasw.essentials.R -import com.sameerasw.essentials.ui.components.cards.IconToggleItem -import com.sameerasw.essentials.ui.components.containers.RoundedCardContainer -import com.sameerasw.essentials.ui.components.sheets.PermissionItem -import com.sameerasw.essentials.ui.components.sheets.PermissionsBottomSheet import com.sameerasw.essentials.ui.components.sliders.ConfigSliderItem +import com.sameerasw.essentials.ui.core.cards.IconToggleItem +import com.sameerasw.essentials.ui.core.containers.RoundedCardContainer +import com.sameerasw.essentials.ui.core.sheets.PermissionItem +import com.sameerasw.essentials.ui.core.sheets.PermissionsBottomSheet import com.sameerasw.essentials.ui.modifiers.highlight import com.sameerasw.essentials.utils.HapticUtil import com.sameerasw.essentials.viewmodels.MainViewModel @@ -94,7 +103,8 @@ fun NetworksSettingsUI( val isShizukuGranted = viewModel.isShizukuPermissionGranted.value val isRootAvailable = viewModel.isRootAvailable.value val isRootGranted = viewModel.isRootPermissionGranted.value - val isShellGranted = (isShizukuAvailable && isShizukuGranted) || (isRootAvailable && isRootGranted) + val isShellGranted = + (isShizukuAvailable && isShizukuGranted) || (isRootAvailable && isRootGranted) val isHasWritePermission = viewModel.isWriteSecureSettingsEnabled.value || isShellGranted LaunchedEffect(Unit) { @@ -162,7 +172,8 @@ fun NetworksSettingsUI( val currentIndex = remember(currentRateLimit) { val idx = presetValues.indexOf(currentRateLimit) if (idx != -1) idx - else presetValues.indices.minByOrNull { kotlin.math.abs(presetValues[it] - currentRateLimit) } ?: 0 + else presetValues.indices.minByOrNull { kotlin.math.abs(presetValues[it] - currentRateLimit) } + ?: 0 } var sliderValue by remember(currentIndex) { mutableFloatStateOf(currentIndex.toFloat()) } @@ -223,13 +234,15 @@ fun NetworksSettingsUI( if (isHasWritePermission) { viewModel.setWirelessDisplayCertificationEnabled(enabled, context) } else { - requestingPermissionFor = NetworkPermissionModule.WIRELESS_DISPLAY_CERTIFICATION + requestingPermissionFor = + NetworkPermissionModule.WIRELESS_DISPLAY_CERTIFICATION } }, enabled = true, onDisabledClick = { if (!isHasWritePermission) { - requestingPermissionFor = NetworkPermissionModule.WIRELESS_DISPLAY_CERTIFICATION + requestingPermissionFor = + NetworkPermissionModule.WIRELESS_DISPLAY_CERTIFICATION } }, iconRes = R.drawable.rounded_cast_24, diff --git a/app/src/main/java/com/sameerasw/essentials/ui/components/sheets/BluetoothDeviceSelectionSheet.kt b/app/src/main/java/com/sameerasw/essentials/ui/features/network/sheets/BluetoothDeviceSelectionSheet.kt similarity index 91% rename from app/src/main/java/com/sameerasw/essentials/ui/components/sheets/BluetoothDeviceSelectionSheet.kt rename to app/src/main/java/com/sameerasw/essentials/ui/features/network/sheets/BluetoothDeviceSelectionSheet.kt index 90bc6dcd7..1846c2cc5 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/components/sheets/BluetoothDeviceSelectionSheet.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/features/network/sheets/BluetoothDeviceSelectionSheet.kt @@ -1,4 +1,13 @@ -package com.sameerasw.essentials.ui.components.sheets +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Feature - Network + * File: BluetoothDeviceSelectionSheet.kt + * Description: UI component and settings composable for Network feature domain. + */ + +package com.sameerasw.essentials.ui.core.sheets import android.Manifest import android.content.pm.PackageManager @@ -28,8 +37,8 @@ import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.unit.dp import androidx.core.content.ContextCompat import com.sameerasw.essentials.R -import com.sameerasw.essentials.ui.components.cards.SelectionCardItem -import com.sameerasw.essentials.ui.components.containers.RoundedCardContainer +import com.sameerasw.essentials.ui.core.cards.SelectionCardItem +import com.sameerasw.essentials.ui.core.containers.RoundedCardContainer import com.sameerasw.essentials.utils.BluetoothPairedDevicesUtil @OptIn(ExperimentalMaterial3Api::class) diff --git a/app/src/main/java/com/sameerasw/essentials/ui/components/sheets/WifiNetworkSelectionSheet.kt b/app/src/main/java/com/sameerasw/essentials/ui/features/network/sheets/WifiNetworkSelectionSheet.kt similarity index 95% rename from app/src/main/java/com/sameerasw/essentials/ui/components/sheets/WifiNetworkSelectionSheet.kt rename to app/src/main/java/com/sameerasw/essentials/ui/features/network/sheets/WifiNetworkSelectionSheet.kt index ee3e31432..610d4b7d0 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/components/sheets/WifiNetworkSelectionSheet.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/features/network/sheets/WifiNetworkSelectionSheet.kt @@ -1,4 +1,13 @@ -package com.sameerasw.essentials.ui.components.sheets +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Feature - Network + * File: WifiNetworkSelectionSheet.kt + * Description: UI component and settings composable for Network feature domain. + */ + +package com.sameerasw.essentials.ui.core.sheets import android.Manifest import android.content.pm.PackageManager @@ -40,8 +49,8 @@ import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.unit.dp import androidx.core.content.ContextCompat import com.sameerasw.essentials.R -import com.sameerasw.essentials.ui.components.cards.SelectionCardItem -import com.sameerasw.essentials.ui.components.containers.RoundedCardContainer +import com.sameerasw.essentials.ui.core.cards.SelectionCardItem +import com.sameerasw.essentials.ui.core.containers.RoundedCardContainer import com.sameerasw.essentials.utils.HapticUtil import com.sameerasw.essentials.utils.WifiUtil import kotlinx.coroutines.Dispatchers diff --git a/app/src/main/java/com/sameerasw/essentials/ui/composables/configs/BatteryNotificationSettingsUI.kt b/app/src/main/java/com/sameerasw/essentials/ui/features/power/BatteryNotificationSettingsUI.kt similarity index 80% rename from app/src/main/java/com/sameerasw/essentials/ui/composables/configs/BatteryNotificationSettingsUI.kt rename to app/src/main/java/com/sameerasw/essentials/ui/features/power/BatteryNotificationSettingsUI.kt index ca43c3d2d..47a9dbcdc 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/composables/configs/BatteryNotificationSettingsUI.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/features/power/BatteryNotificationSettingsUI.kt @@ -1,4 +1,13 @@ -package com.sameerasw.essentials.ui.composables.configs +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Power & Battery Features + * File: BatteryNotificationSettingsUI.kt + * Description: Composable screen for configuring low/full battery notifications. + */ + +package com.sameerasw.essentials.ui.features.system import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column @@ -11,8 +20,8 @@ import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp import com.sameerasw.essentials.R -import com.sameerasw.essentials.ui.components.cards.IconToggleItem -import com.sameerasw.essentials.ui.components.containers.RoundedCardContainer +import com.sameerasw.essentials.ui.core.cards.IconToggleItem +import com.sameerasw.essentials.ui.core.containers.RoundedCardContainer import com.sameerasw.essentials.viewmodels.MainViewModel @Composable diff --git a/app/src/main/java/com/sameerasw/essentials/ui/composables/configs/CaffeinateSettingsUI.kt b/app/src/main/java/com/sameerasw/essentials/ui/features/power/CaffeinateSettingsUI.kt similarity index 91% rename from app/src/main/java/com/sameerasw/essentials/ui/composables/configs/CaffeinateSettingsUI.kt rename to app/src/main/java/com/sameerasw/essentials/ui/features/power/CaffeinateSettingsUI.kt index a612eca6f..7c7512b9a 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/composables/configs/CaffeinateSettingsUI.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/features/power/CaffeinateSettingsUI.kt @@ -1,4 +1,13 @@ -package com.sameerasw.essentials.ui.composables.configs +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Power & Battery Features + * File: CaffeinateSettingsUI.kt + * Description: Composable screen for Caffeinate display timeout settings. + */ + +package com.sameerasw.essentials.ui.features.system import android.Manifest import android.content.Context @@ -22,11 +31,11 @@ import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp import androidx.core.net.toUri import com.sameerasw.essentials.R -import com.sameerasw.essentials.ui.components.cards.IconToggleItem -import com.sameerasw.essentials.ui.components.containers.RoundedCardContainer -import com.sameerasw.essentials.ui.components.pickers.MultiSegmentedPicker -import com.sameerasw.essentials.ui.components.sheets.PermissionItem -import com.sameerasw.essentials.ui.components.sheets.PermissionsBottomSheet +import com.sameerasw.essentials.ui.core.cards.IconToggleItem +import com.sameerasw.essentials.ui.core.containers.RoundedCardContainer +import com.sameerasw.essentials.ui.core.pickers.MultiSegmentedPicker +import com.sameerasw.essentials.ui.core.sheets.PermissionItem +import com.sameerasw.essentials.ui.core.sheets.PermissionsBottomSheet import com.sameerasw.essentials.viewmodels.CaffeinateViewModel @OptIn(ExperimentalLayoutApi::class) diff --git a/app/src/main/java/com/sameerasw/essentials/ui/composables/configs/MapsPowerSavingSettingsUI.kt b/app/src/main/java/com/sameerasw/essentials/ui/features/power/MapsPowerSavingSettingsUI.kt similarity index 85% rename from app/src/main/java/com/sameerasw/essentials/ui/composables/configs/MapsPowerSavingSettingsUI.kt rename to app/src/main/java/com/sameerasw/essentials/ui/features/power/MapsPowerSavingSettingsUI.kt index 2977aef3c..4d64e20c3 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/composables/configs/MapsPowerSavingSettingsUI.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/features/power/MapsPowerSavingSettingsUI.kt @@ -1,4 +1,13 @@ -package com.sameerasw.essentials.ui.composables.configs +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Feature - Power + * File: MapsPowerSavingSettingsUI.kt + * Description: UI component and settings composable for Power feature domain. + */ + +package com.sameerasw.essentials.ui.features.system import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column @@ -12,8 +21,8 @@ import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.platform.LocalView import androidx.compose.ui.unit.dp import com.sameerasw.essentials.R -import com.sameerasw.essentials.ui.components.cards.IconToggleItem -import com.sameerasw.essentials.ui.components.containers.RoundedCardContainer +import com.sameerasw.essentials.ui.core.cards.IconToggleItem +import com.sameerasw.essentials.ui.core.containers.RoundedCardContainer import com.sameerasw.essentials.ui.modifiers.highlight import com.sameerasw.essentials.utils.HapticUtil import com.sameerasw.essentials.viewmodels.MainViewModel diff --git a/app/src/main/java/com/sameerasw/essentials/ui/composables/configs/PowerAndBatterySettingsUI.kt b/app/src/main/java/com/sameerasw/essentials/ui/features/power/PowerAndBatterySettingsUI.kt similarity index 97% rename from app/src/main/java/com/sameerasw/essentials/ui/composables/configs/PowerAndBatterySettingsUI.kt rename to app/src/main/java/com/sameerasw/essentials/ui/features/power/PowerAndBatterySettingsUI.kt index baa10e6b9..6084f075c 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/composables/configs/PowerAndBatterySettingsUI.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/features/power/PowerAndBatterySettingsUI.kt @@ -1,4 +1,13 @@ -package com.sameerasw.essentials.ui.composables.configs +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Feature - Power + * File: PowerAndBatterySettingsUI.kt + * Description: UI component and settings composable for Power feature domain. + */ + +package com.sameerasw.essentials.ui.features.system import android.widget.Toast import androidx.compose.animation.AnimatedVisibility @@ -19,9 +28,9 @@ import androidx.compose.ui.platform.LocalView import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp import com.sameerasw.essentials.R -import com.sameerasw.essentials.ui.components.cards.IconToggleItem -import com.sameerasw.essentials.ui.components.containers.RoundedCardContainer import com.sameerasw.essentials.ui.components.sliders.ConfigSliderItem +import com.sameerasw.essentials.ui.core.cards.IconToggleItem +import com.sameerasw.essentials.ui.core.containers.RoundedCardContainer import com.sameerasw.essentials.utils.HapticUtil import com.sameerasw.essentials.viewmodels.MainViewModel @@ -363,7 +372,7 @@ fun PowerAndBatterySettingsUI( // Sound Trigger Mode Selector val soundTriggerValue = getInt("soundtrigger_mode", 1) - com.sameerasw.essentials.ui.components.cards.ConfigPickerItem( + com.sameerasw.essentials.ui.core.cards.ConfigPickerItem( title = stringResource(R.string.label_soundtrigger_mode), description = stringResource(R.string.desc_soundtrigger_mode), selectedValue = when (soundTriggerValue) { @@ -412,7 +421,7 @@ fun PowerAndBatterySettingsUI( else -> stringResource(R.string.location_mode_throttle) } - com.sameerasw.essentials.ui.components.cards.ConfigPickerItem( + com.sameerasw.essentials.ui.core.cards.ConfigPickerItem( title = stringResource(R.string.label_location_mode), description = stringResource(R.string.desc_location_mode), selectedValue = selectedLabel, diff --git a/app/src/main/java/com/sameerasw/essentials/ui/components/sheets/DimWallpaperSettingsSheet.kt b/app/src/main/java/com/sameerasw/essentials/ui/features/power/sheets/DimWallpaperSettingsSheet.kt similarity index 97% rename from app/src/main/java/com/sameerasw/essentials/ui/components/sheets/DimWallpaperSettingsSheet.kt rename to app/src/main/java/com/sameerasw/essentials/ui/features/power/sheets/DimWallpaperSettingsSheet.kt index 47ab172f1..43f655cf4 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/components/sheets/DimWallpaperSettingsSheet.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/features/power/sheets/DimWallpaperSettingsSheet.kt @@ -1,4 +1,13 @@ -package com.sameerasw.essentials.ui.components.sheets +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Feature - Power + * File: DimWallpaperSettingsSheet.kt + * Description: UI component and settings composable for Power feature domain. + */ + +package com.sameerasw.essentials.ui.core.sheets import androidx.compose.foundation.background import androidx.compose.foundation.layout.Arrangement diff --git a/app/src/main/java/com/sameerasw/essentials/ui/components/sheets/ScreenOffSettingsSheet.kt b/app/src/main/java/com/sameerasw/essentials/ui/features/power/sheets/ScreenOffSettingsSheet.kt similarity index 92% rename from app/src/main/java/com/sameerasw/essentials/ui/components/sheets/ScreenOffSettingsSheet.kt rename to app/src/main/java/com/sameerasw/essentials/ui/features/power/sheets/ScreenOffSettingsSheet.kt index 6a3466297..ab6b1282b 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/components/sheets/ScreenOffSettingsSheet.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/features/power/sheets/ScreenOffSettingsSheet.kt @@ -1,4 +1,13 @@ -package com.sameerasw.essentials.ui.components.sheets +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Feature - Power + * File: ScreenOffSettingsSheet.kt + * Description: UI component and settings composable for Power feature domain. + */ + +package com.sameerasw.essentials.ui.core.sheets import android.os.Build import android.os.Vibrator @@ -31,9 +40,9 @@ import androidx.compose.ui.unit.dp import com.sameerasw.essentials.R import com.sameerasw.essentials.domain.ScreenOffMethod import com.sameerasw.essentials.domain.diy.Action -import com.sameerasw.essentials.ui.components.containers.RoundedCardContainer -import com.sameerasw.essentials.ui.components.pickers.HapticFeedbackPicker -import com.sameerasw.essentials.ui.components.pickers.ScreenOffMethodPicker +import com.sameerasw.essentials.ui.core.containers.RoundedCardContainer +import com.sameerasw.essentials.ui.core.pickers.HapticFeedbackPicker +import com.sameerasw.essentials.ui.core.pickers.ScreenOffMethodPicker import com.sameerasw.essentials.utils.HapticUtil import com.sameerasw.essentials.utils.ShellUtils import com.sameerasw.essentials.utils.performHapticFeedback diff --git a/app/src/main/java/com/sameerasw/essentials/ui/composables/configs/AppLockSettingsUI.kt b/app/src/main/java/com/sameerasw/essentials/ui/features/security/AppLockSettingsUI.kt similarity index 85% rename from app/src/main/java/com/sameerasw/essentials/ui/composables/configs/AppLockSettingsUI.kt rename to app/src/main/java/com/sameerasw/essentials/ui/features/security/AppLockSettingsUI.kt index 4f2a64571..c512f6ed7 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/composables/configs/AppLockSettingsUI.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/features/security/AppLockSettingsUI.kt @@ -1,4 +1,14 @@ -package com.sameerasw.essentials.ui.composables.configs +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Security & Device Protection + * File: AppLockSettingsUI.kt + * Description: Composable UI for configuring AppLock authentication, target applications, + * usage access permissions, and auto-lock delay intervals. + */ + +package com.sameerasw.essentials.ui.features.security import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column @@ -18,29 +28,33 @@ import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp import androidx.fragment.app.FragmentActivity import com.sameerasw.essentials.R -import com.sameerasw.essentials.ui.components.cards.ConfigPickerItem -import com.sameerasw.essentials.ui.components.cards.FeatureCard -import com.sameerasw.essentials.ui.components.cards.IconToggleItem -import com.sameerasw.essentials.ui.components.containers.RoundedCardContainer import com.sameerasw.essentials.ui.components.menus.SegmentedDropdownMenuItem -import com.sameerasw.essentials.ui.components.sheets.AppSelectionSheet +import com.sameerasw.essentials.ui.core.cards.ConfigPickerItem +import com.sameerasw.essentials.ui.core.cards.FeatureCard +import com.sameerasw.essentials.ui.core.cards.IconToggleItem +import com.sameerasw.essentials.ui.core.containers.RoundedCardContainer +import com.sameerasw.essentials.ui.core.sheets.AppSelectionSheet import com.sameerasw.essentials.ui.modifiers.highlight import com.sameerasw.essentials.utils.BiometricHelper import com.sameerasw.essentials.viewmodels.MainViewModel +import com.sameerasw.essentials.viewmodels.PermissionViewModel +import com.sameerasw.essentials.viewmodels.SecurityViewModel @OptIn(ExperimentalMaterial3Api::class) @Composable fun AppLockSettingsUI( viewModel: MainViewModel, + securityViewModel: SecurityViewModel = androidx.lifecycle.viewmodel.compose.viewModel(), + permissionViewModel: PermissionViewModel = androidx.lifecycle.viewmodel.compose.viewModel(), modifier: Modifier = Modifier, highlightKey: String? = null ) { val context = LocalContext.current var isAppSelectionSheetOpen by remember { mutableStateOf(false) } - val isAppLockEnabled by viewModel.isAppLockEnabled + val isAppLockEnabled by securityViewModel.isAppLockEnabled val isUseUsageAccess by viewModel.isUseUsageAccess - val isAccessibilityEnabled by viewModel.isAccessibilityEnabled + val isAccessibilityEnabled by permissionViewModel.isAccessibilityEnabled val isUsageStatsPermissionGranted by viewModel.isUsageStatsPermissionGranted val canEnableAppLock = diff --git a/app/src/main/java/com/sameerasw/essentials/ui/composables/configs/RemoteLockSettingsUI.kt b/app/src/main/java/com/sameerasw/essentials/ui/features/security/RemoteLockSettingsUI.kt similarity index 87% rename from app/src/main/java/com/sameerasw/essentials/ui/composables/configs/RemoteLockSettingsUI.kt rename to app/src/main/java/com/sameerasw/essentials/ui/features/security/RemoteLockSettingsUI.kt index da9e1cb28..7442dabd6 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/composables/configs/RemoteLockSettingsUI.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/features/security/RemoteLockSettingsUI.kt @@ -1,4 +1,13 @@ -package com.sameerasw.essentials.ui.composables.configs +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Feature - Security + * File: RemoteLockSettingsUI.kt + * Description: UI component and settings composable for Security feature domain. + */ + +package com.sameerasw.essentials.ui.features.system import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.fillMaxSize @@ -17,7 +26,7 @@ import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp import com.sameerasw.essentials.R import com.sameerasw.essentials.data.repository.SettingsRepository -import com.sameerasw.essentials.ui.components.containers.RoundedCardContainer +import com.sameerasw.essentials.ui.core.containers.RoundedCardContainer import com.sameerasw.essentials.ui.modifiers.highlight import com.sameerasw.essentials.utils.PermissionUtils import com.sameerasw.essentials.viewmodels.MainViewModel @@ -43,11 +52,11 @@ fun RemoteLockSettingsUI( } if (showPermissionSheet) { - com.sameerasw.essentials.ui.components.sheets.PermissionsBottomSheet( + com.sameerasw.essentials.ui.core.sheets.PermissionsBottomSheet( onDismissRequest = { showPermissionSheet = false }, featureTitle = R.string.feat_lock_from_watch_title, permissions = listOf( - com.sameerasw.essentials.ui.components.sheets.PermissionItem( + com.sameerasw.essentials.ui.core.sheets.PermissionItem( iconRes = R.drawable.rounded_settings_accessibility_24, title = R.string.perm_accessibility_title, description = R.string.perm_accessibility_desc_common, @@ -56,7 +65,7 @@ fun RemoteLockSettingsUI( action = { PermissionUtils.openAccessibilitySettings(context) }, isGranted = isAccessibilityEnabled ), - com.sameerasw.essentials.ui.components.sheets.PermissionItem( + com.sameerasw.essentials.ui.core.sheets.PermissionItem( iconRes = R.drawable.rounded_security_24, title = R.string.perm_device_admin_title, description = R.string.perm_device_admin_desc, @@ -82,7 +91,7 @@ fun RemoteLockSettingsUI( ) RoundedCardContainer { - com.sameerasw.essentials.ui.components.pickers.SegmentedPicker( + com.sameerasw.essentials.ui.core.pickers.SegmentedPicker( items = listOf(0, 1), selectedItem = remoteLockMode, onItemSelected = { mode -> diff --git a/app/src/main/java/com/sameerasw/essentials/ui/composables/configs/ScreenLockedSecuritySettingsUI.kt b/app/src/main/java/com/sameerasw/essentials/ui/features/security/ScreenLockedSecuritySettingsUI.kt similarity index 91% rename from app/src/main/java/com/sameerasw/essentials/ui/composables/configs/ScreenLockedSecuritySettingsUI.kt rename to app/src/main/java/com/sameerasw/essentials/ui/features/security/ScreenLockedSecuritySettingsUI.kt index 70ba48bf1..e159fa0cc 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/composables/configs/ScreenLockedSecuritySettingsUI.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/features/security/ScreenLockedSecuritySettingsUI.kt @@ -1,4 +1,13 @@ -package com.sameerasw.essentials.ui.composables.configs +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Feature - Security + * File: ScreenLockedSecuritySettingsUI.kt + * Description: UI component and settings composable for Security feature domain. + */ + +package com.sameerasw.essentials.ui.features.system import android.content.Intent import android.net.Uri @@ -19,10 +28,10 @@ import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp import androidx.fragment.app.FragmentActivity import com.sameerasw.essentials.R -import com.sameerasw.essentials.ui.components.cards.IconToggleItem -import com.sameerasw.essentials.ui.components.containers.RoundedCardContainer -import com.sameerasw.essentials.ui.components.sheets.PermissionItem -import com.sameerasw.essentials.ui.components.sheets.PermissionsBottomSheet +import com.sameerasw.essentials.ui.core.cards.IconToggleItem +import com.sameerasw.essentials.ui.core.containers.RoundedCardContainer +import com.sameerasw.essentials.ui.core.sheets.PermissionItem +import com.sameerasw.essentials.ui.core.sheets.PermissionsBottomSheet import com.sameerasw.essentials.ui.modifiers.highlight import com.sameerasw.essentials.utils.BiometricHelper import com.sameerasw.essentials.viewmodels.MainViewModel diff --git a/app/src/main/java/com/sameerasw/essentials/ui/composables/configs/CalendarSyncSettingsUI.kt b/app/src/main/java/com/sameerasw/essentials/ui/features/system/CalendarSyncSettingsUI.kt similarity index 93% rename from app/src/main/java/com/sameerasw/essentials/ui/composables/configs/CalendarSyncSettingsUI.kt rename to app/src/main/java/com/sameerasw/essentials/ui/features/system/CalendarSyncSettingsUI.kt index 6c04f37ec..70d71b4a6 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/composables/configs/CalendarSyncSettingsUI.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/features/system/CalendarSyncSettingsUI.kt @@ -1,4 +1,13 @@ -package com.sameerasw.essentials.ui.composables.configs +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Feature - System + * File: CalendarSyncSettingsUI.kt + * Description: UI component and settings composable for System feature domain. + */ + +package com.sameerasw.essentials.ui.features.system import android.widget.Toast import androidx.compose.foundation.background @@ -26,8 +35,8 @@ import androidx.compose.ui.platform.LocalView import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp import com.sameerasw.essentials.R -import com.sameerasw.essentials.ui.components.cards.IconToggleItem -import com.sameerasw.essentials.ui.components.containers.RoundedCardContainer +import com.sameerasw.essentials.ui.core.cards.IconToggleItem +import com.sameerasw.essentials.ui.core.containers.RoundedCardContainer import com.sameerasw.essentials.ui.modifiers.highlight import com.sameerasw.essentials.utils.HapticUtil import com.sameerasw.essentials.viewmodels.MainViewModel diff --git a/app/src/main/java/com/sameerasw/essentials/ui/composables/configs/KeyboardSettingsUI.kt b/app/src/main/java/com/sameerasw/essentials/ui/features/system/KeyboardSettingsUI.kt similarity index 96% rename from app/src/main/java/com/sameerasw/essentials/ui/composables/configs/KeyboardSettingsUI.kt rename to app/src/main/java/com/sameerasw/essentials/ui/features/system/KeyboardSettingsUI.kt index 0a4c00c43..c0ffdc8a4 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/composables/configs/KeyboardSettingsUI.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/features/system/KeyboardSettingsUI.kt @@ -1,4 +1,13 @@ -package com.sameerasw.essentials.ui.composables.configs +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Feature - System + * File: KeyboardSettingsUI.kt + * Description: UI component and settings composable for System feature domain. + */ + +package com.sameerasw.essentials.ui.features.system import androidx.compose.foundation.background import androidx.compose.foundation.layout.Arrangement @@ -31,9 +40,9 @@ import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp import com.sameerasw.essentials.R -import com.sameerasw.essentials.ui.components.cards.IconToggleItem -import com.sameerasw.essentials.ui.components.containers.RoundedCardContainer import com.sameerasw.essentials.ui.components.sliders.ConfigSliderItem +import com.sameerasw.essentials.ui.core.cards.IconToggleItem +import com.sameerasw.essentials.ui.core.containers.RoundedCardContainer import com.sameerasw.essentials.ui.modifiers.highlight import com.sameerasw.essentials.viewmodels.MainViewModel import kotlinx.coroutines.delay @@ -320,7 +329,7 @@ fun KeyboardSettingsUI( Spacer(Modifier.height(32.dp)) if (viewModel.isUserDictionarySheetVisible.value) { - com.sameerasw.essentials.ui.composables.sheets.UserDictionaryBottomSheet( + com.sameerasw.essentials.ui.features.apps.sheets.UserDictionaryBottomSheet( viewModel = viewModel, onDismissRequest = { viewModel.isUserDictionarySheetVisible.value = false } ) diff --git a/app/src/main/java/com/sameerasw/essentials/ui/composables/configs/LiveWallpaperSettingsUI.kt b/app/src/main/java/com/sameerasw/essentials/ui/features/system/LiveWallpaperSettingsUI.kt similarity index 97% rename from app/src/main/java/com/sameerasw/essentials/ui/composables/configs/LiveWallpaperSettingsUI.kt rename to app/src/main/java/com/sameerasw/essentials/ui/features/system/LiveWallpaperSettingsUI.kt index ca7f4dd6f..cd8241f92 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/composables/configs/LiveWallpaperSettingsUI.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/features/system/LiveWallpaperSettingsUI.kt @@ -1,4 +1,13 @@ -package com.sameerasw.essentials.ui.composables.configs +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Feature - System + * File: LiveWallpaperSettingsUI.kt + * Description: UI component and settings composable for System feature domain. + */ + +package com.sameerasw.essentials.ui.features.system import android.app.WallpaperManager import android.content.ComponentName @@ -54,10 +63,10 @@ import androidx.compose.ui.unit.dp import com.sameerasw.essentials.R import com.sameerasw.essentials.data.repository.SettingsRepository import com.sameerasw.essentials.services.LiveWallpaperService -import com.sameerasw.essentials.ui.components.containers.RoundedCardContainer import com.sameerasw.essentials.ui.components.menus.SegmentedDropdownMenu import com.sameerasw.essentials.ui.components.menus.SegmentedDropdownMenuItem -import com.sameerasw.essentials.ui.components.pickers.SegmentedPicker +import com.sameerasw.essentials.ui.core.containers.RoundedCardContainer +import com.sameerasw.essentials.ui.core.pickers.SegmentedPicker import com.sameerasw.essentials.utils.HapticUtil import com.sameerasw.essentials.viewmodels.MainViewModel import kotlinx.coroutines.Dispatchers diff --git a/app/src/main/java/com/sameerasw/essentials/ui/composables/configs/LockScreenClockSettingsUI.kt b/app/src/main/java/com/sameerasw/essentials/ui/features/system/LockScreenClockSettingsUI.kt similarity index 96% rename from app/src/main/java/com/sameerasw/essentials/ui/composables/configs/LockScreenClockSettingsUI.kt rename to app/src/main/java/com/sameerasw/essentials/ui/features/system/LockScreenClockSettingsUI.kt index 2b41004a9..98930bcae 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/composables/configs/LockScreenClockSettingsUI.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/features/system/LockScreenClockSettingsUI.kt @@ -1,4 +1,13 @@ -package com.sameerasw.essentials.ui.composables.configs +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Feature - System + * File: LockScreenClockSettingsUI.kt + * Description: UI component and settings composable for System feature domain. + */ + +package com.sameerasw.essentials.ui.features.system import androidx.compose.foundation.background import androidx.compose.foundation.border @@ -41,10 +50,10 @@ import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp import com.sameerasw.essentials.R -import com.sameerasw.essentials.ui.components.cards.IconToggleItem -import com.sameerasw.essentials.ui.components.containers.RoundedCardContainer -import com.sameerasw.essentials.ui.components.pickers.SegmentedPicker import com.sameerasw.essentials.ui.components.sliders.ConfigSliderItem +import com.sameerasw.essentials.ui.core.cards.IconToggleItem +import com.sameerasw.essentials.ui.core.containers.RoundedCardContainer +import com.sameerasw.essentials.ui.core.pickers.SegmentedPicker import com.sameerasw.essentials.utils.HapticUtil import com.sameerasw.essentials.viewmodels.MainViewModel diff --git a/app/src/main/java/com/sameerasw/essentials/ui/composables/configs/NavigationSettingsUI.kt b/app/src/main/java/com/sameerasw/essentials/ui/features/system/NavigationSettingsUI.kt similarity index 95% rename from app/src/main/java/com/sameerasw/essentials/ui/composables/configs/NavigationSettingsUI.kt rename to app/src/main/java/com/sameerasw/essentials/ui/features/system/NavigationSettingsUI.kt index 18365fd09..d2ecf3999 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/composables/configs/NavigationSettingsUI.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/features/system/NavigationSettingsUI.kt @@ -1,4 +1,13 @@ -package com.sameerasw.essentials.ui.composables.configs +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Feature - System + * File: NavigationSettingsUI.kt + * Description: UI component and settings composable for System feature domain. + */ + +package com.sameerasw.essentials.ui.features.system import android.content.Intent import android.net.Uri @@ -17,17 +26,17 @@ import androidx.compose.runtime.remember import androidx.compose.runtime.setValue import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalContext -import androidx.lifecycle.compose.LocalLifecycleOwner import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp import androidx.lifecycle.Lifecycle import androidx.lifecycle.LifecycleEventObserver +import androidx.lifecycle.compose.LocalLifecycleOwner import com.sameerasw.essentials.R -import com.sameerasw.essentials.ui.components.cards.IconToggleItem -import com.sameerasw.essentials.ui.components.containers.RoundedCardContainer -import com.sameerasw.essentials.ui.components.sheets.PermissionItem -import com.sameerasw.essentials.ui.components.sheets.PermissionsBottomSheet import com.sameerasw.essentials.ui.components.sliders.ConfigSliderItem +import com.sameerasw.essentials.ui.core.cards.IconToggleItem +import com.sameerasw.essentials.ui.core.containers.RoundedCardContainer +import com.sameerasw.essentials.ui.core.sheets.PermissionItem +import com.sameerasw.essentials.ui.core.sheets.PermissionsBottomSheet import com.sameerasw.essentials.ui.modifiers.highlight import com.sameerasw.essentials.utils.PermissionUtils import com.sameerasw.essentials.viewmodels.MainViewModel diff --git a/app/src/main/java/com/sameerasw/essentials/ui/composables/configs/OtherCustomizationsSettingsUI.kt b/app/src/main/java/com/sameerasw/essentials/ui/features/system/OtherCustomizationsSettingsUI.kt similarity index 95% rename from app/src/main/java/com/sameerasw/essentials/ui/composables/configs/OtherCustomizationsSettingsUI.kt rename to app/src/main/java/com/sameerasw/essentials/ui/features/system/OtherCustomizationsSettingsUI.kt index c4d69c9d2..9d810bdbe 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/composables/configs/OtherCustomizationsSettingsUI.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/features/system/OtherCustomizationsSettingsUI.kt @@ -1,10 +1,16 @@ -package com.sameerasw.essentials.ui.composables.configs +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Feature - System + * File: OtherCustomizationsSettingsUI.kt + * Description: UI component and settings composable for System feature domain. + */ + +package com.sameerasw.essentials.ui.features.system import android.content.Intent import android.net.Uri -import androidx.compose.animation.AnimatedVisibility -import androidx.compose.animation.expandVertically -import androidx.compose.animation.shrinkVertically import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.fillMaxWidth @@ -25,11 +31,10 @@ import androidx.compose.ui.unit.dp import androidx.lifecycle.Lifecycle import androidx.lifecycle.LifecycleEventObserver import com.sameerasw.essentials.R -import com.sameerasw.essentials.ui.components.cards.IconToggleItem -import com.sameerasw.essentials.ui.components.containers.RoundedCardContainer -import com.sameerasw.essentials.ui.components.sheets.PermissionItem -import com.sameerasw.essentials.ui.components.sheets.PermissionsBottomSheet -import com.sameerasw.essentials.ui.components.sliders.ConfigSliderItem +import com.sameerasw.essentials.ui.core.cards.IconToggleItem +import com.sameerasw.essentials.ui.core.containers.RoundedCardContainer +import com.sameerasw.essentials.ui.core.sheets.PermissionItem +import com.sameerasw.essentials.ui.core.sheets.PermissionsBottomSheet import com.sameerasw.essentials.ui.modifiers.highlight import com.sameerasw.essentials.viewmodels.MainViewModel diff --git a/app/src/main/java/com/sameerasw/essentials/ui/composables/configs/StatusBarIconSettingsUI.kt b/app/src/main/java/com/sameerasw/essentials/ui/features/system/StatusBarIconSettingsUI.kt similarity index 97% rename from app/src/main/java/com/sameerasw/essentials/ui/composables/configs/StatusBarIconSettingsUI.kt rename to app/src/main/java/com/sameerasw/essentials/ui/features/system/StatusBarIconSettingsUI.kt index 71468bc24..63535edb6 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/composables/configs/StatusBarIconSettingsUI.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/features/system/StatusBarIconSettingsUI.kt @@ -1,4 +1,13 @@ -package com.sameerasw.essentials.ui.composables.configs +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: System Customization + * File: StatusBarIconSettingsUI.kt + * Description: Composable screen for system status bar icon blacklist controls. + */ + +package com.sameerasw.essentials.ui.features.system import android.Manifest import android.content.Context @@ -35,12 +44,12 @@ import androidx.core.content.ContextCompat import androidx.core.content.edit import com.sameerasw.essentials.R import com.sameerasw.essentials.domain.StatusBarIconRegistry -import com.sameerasw.essentials.ui.components.cards.IconToggleItem -import com.sameerasw.essentials.ui.components.containers.RoundedCardContainer -import com.sameerasw.essentials.ui.components.pickers.NetworkTypePicker -import com.sameerasw.essentials.ui.components.pickers.SegmentedPicker -import com.sameerasw.essentials.ui.components.sheets.PermissionItem -import com.sameerasw.essentials.ui.components.sheets.PermissionsBottomSheet +import com.sameerasw.essentials.ui.core.cards.IconToggleItem +import com.sameerasw.essentials.ui.core.containers.RoundedCardContainer +import com.sameerasw.essentials.ui.core.pickers.NetworkTypePicker +import com.sameerasw.essentials.ui.core.pickers.SegmentedPicker +import com.sameerasw.essentials.ui.core.sheets.PermissionItem +import com.sameerasw.essentials.ui.core.sheets.PermissionsBottomSheet import com.sameerasw.essentials.ui.modifiers.highlight import com.sameerasw.essentials.utils.HapticUtil import com.sameerasw.essentials.viewmodels.MainViewModel diff --git a/app/src/main/java/com/sameerasw/essentials/ui/composables/configs/TextAnimationsSettingsUI.kt b/app/src/main/java/com/sameerasw/essentials/ui/features/system/TextAnimationsSettingsUI.kt similarity index 96% rename from app/src/main/java/com/sameerasw/essentials/ui/composables/configs/TextAnimationsSettingsUI.kt rename to app/src/main/java/com/sameerasw/essentials/ui/features/system/TextAnimationsSettingsUI.kt index 9bce1ef38..1af2bcb50 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/composables/configs/TextAnimationsSettingsUI.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/features/system/TextAnimationsSettingsUI.kt @@ -1,4 +1,13 @@ -package com.sameerasw.essentials.ui.composables.configs +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Feature - System + * File: TextAnimationsSettingsUI.kt + * Description: UI component and settings composable for System feature domain. + */ + +package com.sameerasw.essentials.ui.features.system import androidx.compose.foundation.background import androidx.compose.foundation.layout.Arrangement @@ -23,9 +32,9 @@ import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp import com.sameerasw.essentials.R -import com.sameerasw.essentials.ui.components.containers.RoundedCardContainer -import com.sameerasw.essentials.ui.components.pickers.SegmentedPicker import com.sameerasw.essentials.ui.components.sliders.ConfigSliderItem +import com.sameerasw.essentials.ui.core.containers.RoundedCardContainer +import com.sameerasw.essentials.ui.core.pickers.SegmentedPicker import com.sameerasw.essentials.utils.HapticUtil import com.sameerasw.essentials.viewmodels.MainViewModel @@ -69,14 +78,14 @@ fun TextAnimationsSettingsUI( } RoundedCardContainer { - com.sameerasw.essentials.ui.components.cards.IconToggleItem( + com.sameerasw.essentials.ui.core.cards.IconToggleItem( title = stringResource(R.string.label_increase_touch_sensitivity), subtitle = stringResource(R.string.desc_increase_touch_sensitivity), icon = R.drawable.rounded_touch_app_24, checked = viewModel.isTouchSensitivityEnabled.value, onCheckedChange = { viewModel.setTouchSensitivityEnabled(it) } ) - com.sameerasw.essentials.ui.components.cards.IconToggleItem( + com.sameerasw.essentials.ui.core.cards.IconToggleItem( title = stringResource(R.string.label_auto_rotate), subtitle = stringResource(R.string.desc_auto_rotate), icon = R.drawable.rounded_mobile_rotate_24, diff --git a/app/src/main/java/com/sameerasw/essentials/ui/components/sheets/SometimesEssentialsSettingsSheet.kt b/app/src/main/java/com/sameerasw/essentials/ui/features/system/sheets/SometimesEssentialsSettingsSheet.kt similarity index 95% rename from app/src/main/java/com/sameerasw/essentials/ui/components/sheets/SometimesEssentialsSettingsSheet.kt rename to app/src/main/java/com/sameerasw/essentials/ui/features/system/sheets/SometimesEssentialsSettingsSheet.kt index 7e6087112..3c4a09534 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/components/sheets/SometimesEssentialsSettingsSheet.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/features/system/sheets/SometimesEssentialsSettingsSheet.kt @@ -1,4 +1,13 @@ -package com.sameerasw.essentials.ui.components.sheets +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Feature - System + * File: SometimesEssentialsSettingsSheet.kt + * Description: UI component and settings composable for System feature domain. + */ + +package com.sameerasw.essentials.ui.core.sheets import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column @@ -27,9 +36,9 @@ import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.unit.dp import com.sameerasw.essentials.R import com.sameerasw.essentials.domain.diy.Action -import com.sameerasw.essentials.ui.components.cards.FeatureDropdownRow -import com.sameerasw.essentials.ui.components.cards.FeatureToggleRow -import com.sameerasw.essentials.ui.components.containers.RoundedCardContainer +import com.sameerasw.essentials.ui.core.cards.FeatureDropdownRow +import com.sameerasw.essentials.ui.core.cards.FeatureToggleRow +import com.sameerasw.essentials.ui.core.containers.RoundedCardContainer import com.sameerasw.essentials.utils.HapticUtil @OptIn(ExperimentalMaterial3Api::class) @@ -202,7 +211,10 @@ fun SometimesEssentialsSettingsSheet( } ) - val currentClockLabel = clockOptions.find { it.first == lockScreenClockStyle }?.second?.let { stringResource(it) } ?: lockScreenClockStyle + val currentClockLabel = + clockOptions.find { it.first == lockScreenClockStyle }?.second?.let { + stringResource(it) + } ?: lockScreenClockStyle FeatureDropdownRow( title = stringResource(R.string.feat_lock_screen_clock_title), iconRes = R.drawable.rounded_nest_clock_farsight_analog_24, diff --git a/app/src/main/java/com/sameerasw/essentials/ui/composables/configs/QuickSettingsTilesSettingsUI.kt b/app/src/main/java/com/sameerasw/essentials/ui/features/tiles/QuickSettingsTilesSettingsUI.kt similarity index 98% rename from app/src/main/java/com/sameerasw/essentials/ui/composables/configs/QuickSettingsTilesSettingsUI.kt rename to app/src/main/java/com/sameerasw/essentials/ui/features/tiles/QuickSettingsTilesSettingsUI.kt index 27413e5ce..83c1a1648 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/composables/configs/QuickSettingsTilesSettingsUI.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/features/tiles/QuickSettingsTilesSettingsUI.kt @@ -1,4 +1,13 @@ -package com.sameerasw.essentials.ui.composables.configs +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Feature - Tiles + * File: QuickSettingsTilesSettingsUI.kt + * Description: UI component and settings composable for Tiles feature domain. + */ + +package com.sameerasw.essentials.ui.features.system import android.app.Activity import android.app.StatusBarManager @@ -75,7 +84,7 @@ import com.sameerasw.essentials.services.tiles.StayAwakeTileService import com.sameerasw.essentials.services.tiles.TapToWakeTileService import com.sameerasw.essentials.services.tiles.UiBlurTileService import com.sameerasw.essentials.services.tiles.UsbDebuggingTileService -import com.sameerasw.essentials.ui.components.sheets.PermissionsBottomSheet +import com.sameerasw.essentials.ui.core.sheets.PermissionsBottomSheet import com.sameerasw.essentials.ui.modifiers.highlight import com.sameerasw.essentials.utils.DeviceUtils import com.sameerasw.essentials.utils.PermissionUIHelper @@ -401,7 +410,7 @@ fun QuickSettingsTilesSettingsUI( } } - com.sameerasw.essentials.ui.components.sheets.FeatureHelpBottomSheet( + com.sameerasw.essentials.ui.core.sheets.FeatureHelpBottomSheet( onDismissRequest = { showHelpSheet = false selectedHelpTile = null diff --git a/app/src/main/java/com/sameerasw/essentials/ui/composables/configs/ScreenOffWidgetSettingsUI.kt b/app/src/main/java/com/sameerasw/essentials/ui/features/tiles/ScreenOffWidgetSettingsUI.kt similarity index 90% rename from app/src/main/java/com/sameerasw/essentials/ui/composables/configs/ScreenOffWidgetSettingsUI.kt rename to app/src/main/java/com/sameerasw/essentials/ui/features/tiles/ScreenOffWidgetSettingsUI.kt index 84b079d5f..f26d44e1b 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/composables/configs/ScreenOffWidgetSettingsUI.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/features/tiles/ScreenOffWidgetSettingsUI.kt @@ -1,4 +1,13 @@ -package com.sameerasw.essentials.ui.composables.configs +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Feature - Tiles + * File: ScreenOffWidgetSettingsUI.kt + * Description: UI component and settings composable for Tiles feature domain. + */ + +package com.sameerasw.essentials.ui.features.system import android.content.SharedPreferences import android.os.Vibrator @@ -21,9 +30,9 @@ import androidx.core.content.edit import com.sameerasw.essentials.R import com.sameerasw.essentials.domain.HapticFeedbackType import com.sameerasw.essentials.domain.ScreenOffMethod -import com.sameerasw.essentials.ui.components.containers.RoundedCardContainer -import com.sameerasw.essentials.ui.components.pickers.HapticFeedbackPicker -import com.sameerasw.essentials.ui.components.pickers.ScreenOffMethodPicker +import com.sameerasw.essentials.ui.core.containers.RoundedCardContainer +import com.sameerasw.essentials.ui.core.pickers.HapticFeedbackPicker +import com.sameerasw.essentials.ui.core.pickers.ScreenOffMethodPicker import com.sameerasw.essentials.ui.modifiers.highlight import com.sameerasw.essentials.utils.performHapticFeedback import com.sameerasw.essentials.viewmodels.MainViewModel diff --git a/app/src/main/java/com/sameerasw/essentials/ui/composables/wallpaper/WallpaperScreen.kt b/app/src/main/java/com/sameerasw/essentials/ui/features/wallpaper/WallpaperScreen.kt similarity index 52% rename from app/src/main/java/com/sameerasw/essentials/ui/composables/wallpaper/WallpaperScreen.kt rename to app/src/main/java/com/sameerasw/essentials/ui/features/wallpaper/WallpaperScreen.kt index fb5ca7f6a..3174da54c 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/composables/wallpaper/WallpaperScreen.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/features/wallpaper/WallpaperScreen.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Feature - Wallpaper + * File: WallpaperScreen.kt + * Description: UI component and settings composable for Wallpaper feature domain. + */ + package com.sameerasw.essentials.ui.composables.wallpaper import android.app.WallpaperColors @@ -86,7 +95,6 @@ import androidx.compose.ui.draw.clip import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.asImageBitmap import androidx.compose.ui.graphics.graphicsLayer -import androidx.compose.ui.graphics.toArgb import androidx.compose.ui.layout.ContentScale import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.platform.LocalDensity @@ -102,10 +110,10 @@ import com.sameerasw.essentials.R import com.sameerasw.essentials.data.repository.SettingsRepository import com.sameerasw.essentials.services.LiveWallpaperService import com.sameerasw.essentials.ui.components.EssentialsFloatingToolbar -import com.sameerasw.essentials.ui.components.containers.RoundedCardContainer import com.sameerasw.essentials.ui.components.menus.SegmentedDropdownMenu import com.sameerasw.essentials.ui.components.menus.SegmentedDropdownMenuItem -import com.sameerasw.essentials.ui.components.pickers.SegmentedPicker +import com.sameerasw.essentials.ui.core.containers.RoundedCardContainer +import com.sameerasw.essentials.ui.core.pickers.SegmentedPicker import com.sameerasw.essentials.ui.modifiers.BlurDirection import com.sameerasw.essentials.ui.modifiers.progressiveBlur import com.sameerasw.essentials.utils.HapticUtil @@ -298,28 +306,42 @@ fun WallpaperScreen( } - - val baseColorScheme = MaterialTheme.colorScheme - val targetPrimary = if (pagerState.currentPage == 0 && extractedColors != null) extractedColors!!.primary else baseColorScheme.primary - val targetSecondary = if (pagerState.currentPage == 0 && extractedColors?.secondary != null) extractedColors!!.secondary!! else baseColorScheme.secondary - val targetTertiary = if (pagerState.currentPage == 0 && extractedColors?.tertiary != null) extractedColors!!.tertiary!! else baseColorScheme.tertiary + val targetPrimary = + if (pagerState.currentPage == 0 && extractedColors != null) extractedColors!!.primary else baseColorScheme.primary + val targetSecondary = + if (pagerState.currentPage == 0 && extractedColors?.secondary != null) extractedColors!!.secondary!! else baseColorScheme.secondary + val targetTertiary = + if (pagerState.currentPage == 0 && extractedColors?.tertiary != null) extractedColors!!.tertiary!! else baseColorScheme.tertiary val animSpec = tween(durationMillis = 800) - val animatedPrimary by animateColorAsState(targetValue = targetPrimary, animationSpec = animSpec, label = "animatedPrimary") - val animatedSecondary by animateColorAsState(targetValue = targetSecondary, animationSpec = animSpec, label = "animatedSecondary") - val animatedTertiary by animateColorAsState(targetValue = targetTertiary, animationSpec = animSpec, label = "animatedTertiary") + val animatedPrimary by animateColorAsState( + targetValue = targetPrimary, + animationSpec = animSpec, + label = "animatedPrimary" + ) + val animatedSecondary by animateColorAsState( + targetValue = targetSecondary, + animationSpec = animSpec, + label = "animatedSecondary" + ) + val animatedTertiary by animateColorAsState( + targetValue = targetTertiary, + animationSpec = animSpec, + label = "animatedTertiary" + ) - val activeColorScheme = remember(animatedPrimary, animatedSecondary, animatedTertiary, baseColorScheme) { - baseColorScheme.copy( - primary = animatedPrimary, - secondary = animatedSecondary, - tertiary = animatedTertiary, - primaryContainer = animatedPrimary.copy(alpha = 0.25f), - onPrimaryContainer = animatedPrimary - ) - } + val activeColorScheme = + remember(animatedPrimary, animatedSecondary, animatedTertiary, baseColorScheme) { + baseColorScheme.copy( + primary = animatedPrimary, + secondary = animatedSecondary, + tertiary = animatedTertiary, + primaryContainer = animatedPrimary.copy(alpha = 0.25f), + onPrimaryContainer = animatedPrimary + ) + } MaterialTheme(colorScheme = activeColorScheme) { Box( @@ -331,608 +353,636 @@ fun WallpaperScreen( direction = BlurDirection.TOP ) ) { - Row( - modifier = Modifier - .align(Alignment.TopCenter) - .padding(top = statusBarHeight + 16.dp) - .background( - color = MaterialTheme.colorScheme.surfaceContainerHigh, - shape = CircleShape - ) - .padding(6.dp) - .zIndex(3f), - horizontalArrangement = Arrangement.spacedBy(ButtonGroupDefaults.ConnectedSpaceBetween), - verticalAlignment = Alignment.CenterVertically - ) { - val tabs = listOf(0, 1) - tabs.forEachIndexed { index, page -> - ToggleButton( - checked = pagerState.currentPage == page, - onCheckedChange = { - HapticUtil.performUIHaptic(view) - coroutineScope.launch { - pagerState.animateScrollToPage(page) - } - }, - shapes = when (index) { - 0 -> ButtonGroupDefaults.connectedLeadingButtonShapes() - else -> ButtonGroupDefaults.connectedTrailingButtonShapes() - }, - modifier = Modifier.size(width = 80.dp, height = 48.dp) - ) { - Icon( - painter = painterResource( - id = if (page == 0) R.drawable.rounded_wallpaper_24 else R.drawable.rounded_slow_motion_video_24 - ), - contentDescription = null, - modifier = Modifier.size(24.dp) + Row( + modifier = Modifier + .align(Alignment.TopCenter) + .padding(top = statusBarHeight + 16.dp) + .background( + color = MaterialTheme.colorScheme.surfaceContainerHigh, + shape = CircleShape ) + .padding(6.dp) + .zIndex(3f), + horizontalArrangement = Arrangement.spacedBy(ButtonGroupDefaults.ConnectedSpaceBetween), + verticalAlignment = Alignment.CenterVertically + ) { + val tabs = listOf(0, 1) + tabs.forEachIndexed { index, page -> + ToggleButton( + checked = pagerState.currentPage == page, + onCheckedChange = { + HapticUtil.performUIHaptic(view) + coroutineScope.launch { + pagerState.animateScrollToPage(page) + } + }, + shapes = when (index) { + 0 -> ButtonGroupDefaults.connectedLeadingButtonShapes() + else -> ButtonGroupDefaults.connectedTrailingButtonShapes() + }, + modifier = Modifier.size(width = 80.dp, height = 48.dp) + ) { + Icon( + painter = painterResource( + id = if (page == 0) R.drawable.rounded_wallpaper_24 else R.drawable.rounded_slow_motion_video_24 + ), + contentDescription = null, + modifier = Modifier.size(24.dp) + ) + } } } - } - HorizontalPager( - state = pagerState, - modifier = Modifier - .fillMaxSize() - .progressiveBlur( - blurRadius = if (isBlurEnabled) 40f else 0f, - height = bottomBlurHeightPx, - direction = BlurDirection.BOTTOM - ) - ) { page -> - if (page == 0) { - Box(modifier = Modifier.fillMaxSize()) { - if (wallpaperInfo != null) { - SubcomposeAsyncImage( - model = wallpaperInfo!!.urlMobile, - contentDescription = null, - contentScale = ContentScale.Crop, - modifier = Modifier.fillMaxSize(), - onSuccess = { state -> - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O_MR1) { - val drawable = state.result.drawable - val bitmap = (drawable as? BitmapDrawable)?.bitmap - ?: (drawable as? coil.drawable.CrossfadeDrawable)?.let { - // Handle crossfade or custom coil drawable if needed - null - } - bitmap?.let { b -> - coroutineScope.launch(Dispatchers.Default) { - runCatching { - val wallpaperColors = WallpaperColors.fromBitmap(b) - val primary = Color(wallpaperColors.primaryColor.toArgb()) - val secondary = wallpaperColors.secondaryColor?.let { Color(it.toArgb()) } - val tertiary = wallpaperColors.tertiaryColor?.let { Color(it.toArgb()) } - withContext(Dispatchers.Main) { - extractedColors = ExtractedWallpaperColors( - primary = primary, - secondary = secondary, - tertiary = tertiary - ) + HorizontalPager( + state = pagerState, + modifier = Modifier + .fillMaxSize() + .progressiveBlur( + blurRadius = if (isBlurEnabled) 40f else 0f, + height = bottomBlurHeightPx, + direction = BlurDirection.BOTTOM + ) + ) { page -> + if (page == 0) { + Box(modifier = Modifier.fillMaxSize()) { + if (wallpaperInfo != null) { + SubcomposeAsyncImage( + model = wallpaperInfo!!.urlMobile, + contentDescription = null, + contentScale = ContentScale.Crop, + modifier = Modifier.fillMaxSize(), + onSuccess = { state -> + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O_MR1) { + val drawable = state.result.drawable + val bitmap = (drawable as? BitmapDrawable)?.bitmap + ?: (drawable as? coil.drawable.CrossfadeDrawable)?.let { + // Handle crossfade or custom coil drawable if needed + null + } + bitmap?.let { b -> + coroutineScope.launch(Dispatchers.Default) { + runCatching { + val wallpaperColors = + WallpaperColors.fromBitmap(b) + val primary = + Color(wallpaperColors.primaryColor.toArgb()) + val secondary = + wallpaperColors.secondaryColor?.let { + Color(it.toArgb()) + } + val tertiary = + wallpaperColors.tertiaryColor?.let { + Color(it.toArgb()) + } + withContext(Dispatchers.Main) { + extractedColors = ExtractedWallpaperColors( + primary = primary, + secondary = secondary, + tertiary = tertiary + ) + } } } } } + }, + loading = { + Box( + modifier = Modifier + .fillMaxSize() + .background(MaterialTheme.colorScheme.surfaceContainer), + contentAlignment = Alignment.Center + ) { + LoadingIndicator() + } + }, + error = { + Box( + modifier = Modifier + .fillMaxSize() + .background(MaterialTheme.colorScheme.surfaceContainer), + contentAlignment = Alignment.Center + ) { + Icon( + painter = painterResource(id = R.drawable.rounded_draw_24), + contentDescription = null, + tint = MaterialTheme.colorScheme.onSurfaceVariant + ) + } } - }, - loading = { - Box( - modifier = Modifier - .fillMaxSize() - .background(MaterialTheme.colorScheme.surfaceContainer), - contentAlignment = Alignment.Center - ) { + ) + } else { + Box( + modifier = Modifier + .fillMaxSize() + .background(MaterialTheme.colorScheme.surfaceContainer), + contentAlignment = Alignment.Center + ) { + if (isLoading) { LoadingIndicator() } + } + } + + PullToRefreshBox( + isRefreshing = isLoading, + onRefresh = { + HapticUtil.performUIHaptic(view) + viewModel.fetchTodayWallpaper(context) }, - error = { + state = pullRefreshState, + indicator = { Box( modifier = Modifier - .fillMaxSize() - .background(MaterialTheme.colorScheme.surfaceContainer), - contentAlignment = Alignment.Center + .fillMaxWidth() + .padding(top = statusBarHeight + 64.dp), + contentAlignment = Alignment.TopCenter ) { - Icon( - painter = painterResource(id = R.drawable.rounded_draw_24), - contentDescription = null, - tint = MaterialTheme.colorScheme.onSurfaceVariant - ) + val scale = + if (isLoading) 1f else pullRefreshState.distanceFraction.coerceIn( + 0f, + 1f + ) + if (scale > 0f) { + Card( + shape = CircleShape, + colors = CardDefaults.cardColors( + containerColor = MaterialTheme.colorScheme.surfaceContainerHigh + ), + elevation = CardDefaults.cardElevation(defaultElevation = 6.dp), + modifier = Modifier + .size(48.dp) + .graphicsLayer { + scaleX = scale + scaleY = scale + alpha = scale + } + ) { + Box( + modifier = Modifier.fillMaxSize(), + contentAlignment = Alignment.Center + ) { + LoadingIndicator( + modifier = Modifier.size(36.dp) + ) + } + } + } } - } - ) - } else { - Box( - modifier = Modifier - .fillMaxSize() - .background(MaterialTheme.colorScheme.surfaceContainer), - contentAlignment = Alignment.Center + }, + modifier = Modifier.fillMaxSize() ) { - if (isLoading) { - LoadingIndicator() - } - } - } - - PullToRefreshBox( - isRefreshing = isLoading, - onRefresh = { - HapticUtil.performUIHaptic(view) - viewModel.fetchTodayWallpaper(context) - }, - state = pullRefreshState, - indicator = { Box( modifier = Modifier - .fillMaxWidth() - .padding(top = statusBarHeight + 64.dp), - contentAlignment = Alignment.TopCenter - ) { - val scale = - if (isLoading) 1f else pullRefreshState.distanceFraction.coerceIn( - 0f, - 1f + .fillMaxSize() + .verticalScroll(rememberScrollState()) + ) + } + } + } else { + Box( + modifier = Modifier + .fillMaxSize() + .background(MaterialTheme.colorScheme.surfaceContainer) + ) { + LazyVerticalGrid( + columns = GridCells.Fixed(3), + contentPadding = PaddingValues( + top = statusBarHeight + 96.dp, + bottom = bottomPadding + 180.dp, + start = 24.dp, + end = 24.dp + ), + verticalArrangement = Arrangement.spacedBy(12.dp), + horizontalArrangement = Arrangement.spacedBy(12.dp), + modifier = Modifier.fillMaxSize() + ) { + item { + AddVideoItem(onClick = { + HapticUtil.performCustomHaptic(view, 0.5f) + pickerLauncher.launch( + PickVisualMediaRequest( + ActivityResultContracts.PickVisualMedia.VideoOnly + ) ) - if (scale > 0f) { - Card( - shape = CircleShape, - colors = CardDefaults.cardColors( - containerColor = MaterialTheme.colorScheme.surfaceContainerHigh - ), - elevation = CardDefaults.cardElevation(defaultElevation = 6.dp), - modifier = Modifier - .size(48.dp) - .graphicsLayer { - scaleX = scale - scaleY = scale - alpha = scale - } + }) + } + + items(availableVideos) { video -> + ThumbnailItem( + videoName = video, + isSelected = video == selectedVideo, + onClick = { + HapticUtil.performCustomHaptic(view, 0.5f) + selectedVideo = video + repository.saveLiveWallpaperSelectedVideo(video) + }, + onRemove = if (context.resources.getIdentifier( + video, + "raw", + context.packageName + ) == 0 ) { - Box( - modifier = Modifier.fillMaxSize(), - contentAlignment = Alignment.Center - ) { - LoadingIndicator( - modifier = Modifier.size(36.dp) - ) + { + repository.removeLiveWallpaperCustomVideo(video) + availableVideos = + repository.getLiveWallpaperAvailableVideos() + selectedVideo = + repository.getLiveWallpaperSelectedVideo() } - } - } + } else null + ) } - }, - modifier = Modifier.fillMaxSize() - ) { - Box( - modifier = Modifier - .fillMaxSize() - .verticalScroll(rememberScrollState()) - ) - } - } - } else { - Box( - modifier = Modifier - .fillMaxSize() - .background(MaterialTheme.colorScheme.surfaceContainer) - ) { - LazyVerticalGrid( - columns = GridCells.Fixed(3), - contentPadding = PaddingValues( - top = statusBarHeight + 96.dp, - bottom = bottomPadding + 180.dp, - start = 24.dp, - end = 24.dp - ), - verticalArrangement = Arrangement.spacedBy(12.dp), - horizontalArrangement = Arrangement.spacedBy(12.dp), - modifier = Modifier.fillMaxSize() - ) { - item { - AddVideoItem(onClick = { - HapticUtil.performCustomHaptic(view, 0.5f) - pickerLauncher.launch(PickVisualMediaRequest(ActivityResultContracts.PickVisualMedia.VideoOnly)) - }) - } - - items(availableVideos) { video -> - ThumbnailItem( - videoName = video, - isSelected = video == selectedVideo, - onClick = { - HapticUtil.performCustomHaptic(view, 0.5f) - selectedVideo = video - repository.saveLiveWallpaperSelectedVideo(video) - }, - onRemove = if (context.resources.getIdentifier( - video, - "raw", - context.packageName - ) == 0 - ) { - { - repository.removeLiveWallpaperCustomVideo(video) - availableVideos = - repository.getLiveWallpaperAvailableVideos() - selectedVideo = repository.getLiveWallpaperSelectedVideo() - } - } else null - ) } } } } - } - AnimatedVisibility( - visible = (pagerState.currentPage == 0 && wallpaperInfo != null) || pagerState.currentPage == 1, - enter = fadeIn(animationSpec = tween(400)) + slideInVertically(animationSpec = tween(400)) { it / 2 }, - exit = fadeOut(animationSpec = tween(400)) + slideOutVertically( - animationSpec = tween( - 400 - ) - ) { it / 2 }, - modifier = Modifier - .align(Alignment.BottomCenter) - .padding(horizontal = 24.dp) - .padding(bottom = 96.dp + bottomPadding) - .zIndex(2f) - ) { - Column( - horizontalAlignment = Alignment.CenterHorizontally, - modifier = Modifier.fillMaxWidth() - ) { - AnimatedVisibility( - visible = showSettingsCard, - enter = expandVertically(animationSpec = tween(300)) + fadeIn( - animationSpec = tween( - 300 - ) - ), - exit = shrinkVertically(animationSpec = tween(300)) + fadeOut( - animationSpec = tween( - 300 - ) + AnimatedVisibility( + visible = (pagerState.currentPage == 0 && wallpaperInfo != null) || pagerState.currentPage == 1, + enter = fadeIn(animationSpec = tween(400)) + slideInVertically( + animationSpec = tween( + 400 ) + ) { it / 2 }, + exit = fadeOut(animationSpec = tween(400)) + slideOutVertically( + animationSpec = tween( + 400 + ) + ) { it / 2 }, + modifier = Modifier + .align(Alignment.BottomCenter) + .padding(horizontal = 24.dp) + .padding(bottom = 96.dp + bottomPadding) + .zIndex(2f) + ) { + Column( + horizontalAlignment = Alignment.CenterHorizontally, + modifier = Modifier.fillMaxWidth() ) { - Card( - shape = RoundedCornerShape(16.dp), - colors = CardDefaults.cardColors( - containerColor = MaterialTheme.colorScheme.surfaceContainerHigh + AnimatedVisibility( + visible = showSettingsCard, + enter = expandVertically(animationSpec = tween(300)) + fadeIn( + animationSpec = tween( + 300 + ) ), - modifier = Modifier - .fillMaxWidth() - .padding(bottom = 12.dp) + exit = shrinkVertically(animationSpec = tween(300)) + fadeOut( + animationSpec = tween( + 300 + ) + ) ) { - if (pagerState.currentPage == 0) { - Column( - modifier = Modifier - .fillMaxWidth() - .padding(16.dp), - verticalArrangement = Arrangement.spacedBy(12.dp) - ) { - Row( - modifier = Modifier.fillMaxWidth(), - verticalAlignment = Alignment.CenterVertically, - horizontalArrangement = Arrangement.SpaceBetween + Card( + shape = RoundedCornerShape(16.dp), + colors = CardDefaults.cardColors( + containerColor = MaterialTheme.colorScheme.surfaceContainerHigh + ), + modifier = Modifier + .fillMaxWidth() + .padding(bottom = 12.dp) + ) { + if (pagerState.currentPage == 0) { + Column( + modifier = Modifier + .fillMaxWidth() + .padding(16.dp), + verticalArrangement = Arrangement.spacedBy(12.dp) ) { - Column( - verticalArrangement = Arrangement.spacedBy(2.dp) + Row( + modifier = Modifier.fillMaxWidth(), + verticalAlignment = Alignment.CenterVertically, + horizontalArrangement = Arrangement.SpaceBetween ) { - Text( - text = stringResource(R.string.label_wallpaper_auto_update), - style = MaterialTheme.typography.titleMedium.copy( - fontWeight = FontWeight.Bold - ), - color = MaterialTheme.colorScheme.onSurface - ) - if (isAutoUpdateEnabled && !dailyWallpaperAutoUpdateTime.isNullOrEmpty()) { - val timeText = if (isDailyWallpaperShowLastTime) { - stringResource( - R.string.label_wallpaper_last_checked, - dailyWallpaperLastCheckedFormatted - ) - } else { - val showTime = - if (dailyWallpaperNextAutoUpdateTime > 0L) { - stringResource( - R.string.label_wallpaper_hours, - dailyWallpaperNextAutoUpdateTime.toInt() - ) - } else { - stringResource(R.string.label_wallpaper_a_few_minutes) - } - stringResource( - R.string.label_wallpaper_next_check, - showTime - ) - } + Column( + verticalArrangement = Arrangement.spacedBy(2.dp) + ) { Text( - text = timeText, - style = MaterialTheme.typography.labelSmall, - color = MaterialTheme.colorScheme.onSurfaceVariant, - modifier = Modifier.clickable( - enabled = true, - onClick = { - HapticUtil.performUIHaptic(view) - viewModel.setDailyWallpaperShowLastTime() - }) + text = stringResource(R.string.label_wallpaper_auto_update), + style = MaterialTheme.typography.titleMedium.copy( + fontWeight = FontWeight.Bold + ), + color = MaterialTheme.colorScheme.onSurface ) - } - } - Switch( - checked = isAutoUpdateEnabled, - onCheckedChange = { checked -> - HapticUtil.performUIHaptic(view) - viewModel.setDailyWallpaperAutoUpdate(checked, context) - } - ) - } - - Row( - modifier = Modifier - .fillMaxWidth() - .padding(top = 4.dp), - horizontalArrangement = Arrangement.spacedBy(ButtonGroupDefaults.ConnectedSpaceBetween), - verticalAlignment = Alignment.CenterVertically - ) { - ToggleButton( - checked = applyHome, - onCheckedChange = { - if (!applyHome || applyLock) { - HapticUtil.performUIHaptic(view) - applyHome = !applyHome - repository.setDailyWallpaperApplyHome(applyHome) + if (isAutoUpdateEnabled && !dailyWallpaperAutoUpdateTime.isNullOrEmpty()) { + val timeText = if (isDailyWallpaperShowLastTime) { + stringResource( + R.string.label_wallpaper_last_checked, + dailyWallpaperLastCheckedFormatted + ) + } else { + val showTime = + if (dailyWallpaperNextAutoUpdateTime > 0L) { + stringResource( + R.string.label_wallpaper_hours, + dailyWallpaperNextAutoUpdateTime.toInt() + ) + } else { + stringResource(R.string.label_wallpaper_a_few_minutes) + } + stringResource( + R.string.label_wallpaper_next_check, + showTime + ) + } + Text( + text = timeText, + style = MaterialTheme.typography.labelSmall, + color = MaterialTheme.colorScheme.onSurfaceVariant, + modifier = Modifier.clickable( + enabled = true, + onClick = { + HapticUtil.performUIHaptic(view) + viewModel.setDailyWallpaperShowLastTime() + }) + ) } - }, - shapes = ButtonGroupDefaults.connectedLeadingButtonShapes(), - modifier = Modifier.weight(1f) - ) { - Text("Home Screen") - } - ToggleButton( - checked = applyLock, - onCheckedChange = { - if (!applyLock || applyHome) { + } + Switch( + checked = isAutoUpdateEnabled, + onCheckedChange = { checked -> HapticUtil.performUIHaptic(view) - applyLock = !applyLock - repository.setDailyWallpaperApplyLock(applyLock) + viewModel.setDailyWallpaperAutoUpdate( + checked, + context + ) } - }, - shapes = ButtonGroupDefaults.connectedTrailingButtonShapes(), - modifier = Modifier.weight(1f) - ) { - Text("Lock Screen") + ) } - } - extractedColors?.let { colors -> Row( modifier = Modifier .fillMaxWidth() .padding(top = 4.dp), - verticalAlignment = Alignment.CenterVertically, - horizontalArrangement = Arrangement.SpaceBetween + horizontalArrangement = Arrangement.spacedBy( + ButtonGroupDefaults.ConnectedSpaceBetween + ), + verticalAlignment = Alignment.CenterVertically ) { - Text( - text = stringResource(R.string.label_wallpaper_extracted_colors), - style = MaterialTheme.typography.bodyMedium, - color = MaterialTheme.colorScheme.onSurfaceVariant - ) + ToggleButton( + checked = applyHome, + onCheckedChange = { + if (!applyHome || applyLock) { + HapticUtil.performUIHaptic(view) + applyHome = !applyHome + repository.setDailyWallpaperApplyHome(applyHome) + } + }, + shapes = ButtonGroupDefaults.connectedLeadingButtonShapes(), + modifier = Modifier.weight(1f) + ) { + Text("Home Screen") + } + ToggleButton( + checked = applyLock, + onCheckedChange = { + if (!applyLock || applyHome) { + HapticUtil.performUIHaptic(view) + applyLock = !applyLock + repository.setDailyWallpaperApplyLock(applyLock) + } + }, + shapes = ButtonGroupDefaults.connectedTrailingButtonShapes(), + modifier = Modifier.weight(1f) + ) { + Text("Lock Screen") + } + } + + extractedColors?.let { colors -> Row( - horizontalArrangement = Arrangement.spacedBy(8.dp), - verticalAlignment = Alignment.CenterVertically + modifier = Modifier + .fillMaxWidth() + .padding(top = 4.dp), + verticalAlignment = Alignment.CenterVertically, + horizontalArrangement = Arrangement.SpaceBetween ) { - Box( - modifier = Modifier - .size(24.dp) - .background(colors.primary, CircleShape) + Text( + text = stringResource(R.string.label_wallpaper_extracted_colors), + style = MaterialTheme.typography.bodyMedium, + color = MaterialTheme.colorScheme.onSurfaceVariant ) - colors.secondary?.let { sec -> - Box( - modifier = Modifier - .size(24.dp) - .background(sec, CircleShape) - ) - } - colors.tertiary?.let { tert -> + Row( + horizontalArrangement = Arrangement.spacedBy(8.dp), + verticalAlignment = Alignment.CenterVertically + ) { Box( modifier = Modifier .size(24.dp) - .background(tert, CircleShape) + .background(colors.primary, CircleShape) ) + colors.secondary?.let { sec -> + Box( + modifier = Modifier + .size(24.dp) + .background(sec, CircleShape) + ) + } + colors.tertiary?.let { tert -> + Box( + modifier = Modifier + .size(24.dp) + .background(tert, CircleShape) + ) + } } } } } - } - } else { - Column( - modifier = Modifier - .fillMaxWidth() - .padding(16.dp), - verticalArrangement = Arrangement.spacedBy(12.dp) - ) { - Text( - text = stringResource(R.string.live_wallpaper_playback_trigger_title), - style = MaterialTheme.typography.titleMedium.copy(fontWeight = FontWeight.Bold), - color = MaterialTheme.colorScheme.onSurface - ) - - val options = listOf( - SettingsRepository.LIVE_WALLPAPER_TRIGGER_UNLOCK to stringResource( - R.string.live_wallpaper_trigger_unlock - ), - SettingsRepository.LIVE_WALLPAPER_TRIGGER_SCREEN_ON to stringResource( - R.string.live_wallpaper_trigger_screen_on + } else { + Column( + modifier = Modifier + .fillMaxWidth() + .padding(16.dp), + verticalArrangement = Arrangement.spacedBy(12.dp) + ) { + Text( + text = stringResource(R.string.live_wallpaper_playback_trigger_title), + style = MaterialTheme.typography.titleMedium.copy(fontWeight = FontWeight.Bold), + color = MaterialTheme.colorScheme.onSurface ) - ) - SegmentedPicker( - items = options, - selectedItem = options.find { it.first == playbackTrigger } - ?: options.first(), - onItemSelected = { option -> - HapticUtil.performUIHaptic(view) - playbackTrigger = option.first - repository.saveLiveWallpaperPlaybackTrigger(option.first) - }, - labelProvider = { it.second }, - containerColor = Color.Transparent, - contentPadding = PaddingValues(0.dp), - modifier = Modifier.fillMaxWidth() - ) - - if (repository.getLiveWallpaperCustomVideos().isNotEmpty()) { - Button( - onClick = { - HapticUtil.performHeavyHaptic(view) - repository.saveLiveWallpaperCustomVideos(emptyList()) - availableVideos = - repository.getLiveWallpaperAvailableVideos() - selectedVideo = - repository.getLiveWallpaperSelectedVideo() - }, - colors = ButtonDefaults.buttonColors( - containerColor = MaterialTheme.colorScheme.errorContainer, - contentColor = MaterialTheme.colorScheme.onErrorContainer + val options = listOf( + SettingsRepository.LIVE_WALLPAPER_TRIGGER_UNLOCK to stringResource( + R.string.live_wallpaper_trigger_unlock ), - modifier = Modifier - .fillMaxWidth() - .padding(top = 4.dp) - ) { - Icon( - painter = painterResource(id = R.drawable.rounded_delete_24), - contentDescription = null, - modifier = Modifier.size(18.dp) + SettingsRepository.LIVE_WALLPAPER_TRIGGER_SCREEN_ON to stringResource( + R.string.live_wallpaper_trigger_screen_on ) - Spacer(modifier = Modifier.width(8.dp)) - Text(text = stringResource(R.string.label_clear_custom_videos)) + ) + + SegmentedPicker( + items = options, + selectedItem = options.find { it.first == playbackTrigger } + ?: options.first(), + onItemSelected = { option -> + HapticUtil.performUIHaptic(view) + playbackTrigger = option.first + repository.saveLiveWallpaperPlaybackTrigger(option.first) + }, + labelProvider = { it.second }, + containerColor = Color.Transparent, + contentPadding = PaddingValues(0.dp), + modifier = Modifier.fillMaxWidth() + ) + + if (repository.getLiveWallpaperCustomVideos().isNotEmpty()) { + Button( + onClick = { + HapticUtil.performHeavyHaptic(view) + repository.saveLiveWallpaperCustomVideos(emptyList()) + availableVideos = + repository.getLiveWallpaperAvailableVideos() + selectedVideo = + repository.getLiveWallpaperSelectedVideo() + }, + colors = ButtonDefaults.buttonColors( + containerColor = MaterialTheme.colorScheme.errorContainer, + contentColor = MaterialTheme.colorScheme.onErrorContainer + ), + modifier = Modifier + .fillMaxWidth() + .padding(top = 4.dp) + ) { + Icon( + painter = painterResource(id = R.drawable.rounded_delete_24), + contentDescription = null, + modifier = Modifier.size(18.dp) + ) + Spacer(modifier = Modifier.width(8.dp)) + Text(text = stringResource(R.string.label_clear_custom_videos)) + } } } } } } - } - SplitButtonLayout( - leadingButton = { - SplitButtonDefaults.LeadingButton( - onClick = { - if (pagerState.currentPage == 0) { - HapticUtil.performHeavyHaptic(view) - wallpaperInfo?.urlMobile?.let { url -> - viewModel.applyWallpaper(context, url) { success -> - if (!success) { - Toast.makeText( - context, - R.string.label_wallpaper_apply_failed, - Toast.LENGTH_SHORT - ).show() + SplitButtonLayout( + leadingButton = { + SplitButtonDefaults.LeadingButton( + onClick = { + if (pagerState.currentPage == 0) { + HapticUtil.performHeavyHaptic(view) + wallpaperInfo?.urlMobile?.let { url -> + viewModel.applyWallpaper(context, url) { success -> + if (!success) { + Toast.makeText( + context, + R.string.label_wallpaper_apply_failed, + Toast.LENGTH_SHORT + ).show() + } } } - } - } else { - HapticUtil.performCustomHaptic(view, 0.8f) - val intent = - Intent(WallpaperManager.ACTION_CHANGE_LIVE_WALLPAPER).apply { - putExtra( - WallpaperManager.EXTRA_LIVE_WALLPAPER_COMPONENT, - ComponentName( - context, - LiveWallpaperService::class.java + } else { + HapticUtil.performCustomHaptic(view, 0.8f) + val intent = + Intent(WallpaperManager.ACTION_CHANGE_LIVE_WALLPAPER).apply { + putExtra( + WallpaperManager.EXTRA_LIVE_WALLPAPER_COMPONENT, + ComponentName( + context, + LiveWallpaperService::class.java + ) ) - ) - } - context.startActivity(intent) - } - }, - modifier = Modifier.height(56.dp) - ) { - Icon( - painter = painterResource(id = R.drawable.rounded_open_in_new_24), - contentDescription = null, - modifier = Modifier.size(22.dp) - ) - Spacer(modifier = Modifier.width(8.dp)) - Text( - text = stringResource(R.string.label_wallpaper_apply), - style = MaterialTheme.typography.titleMedium.copy(fontWeight = FontWeight.Bold) - ) + } + context.startActivity(intent) + } + }, + modifier = Modifier.height(56.dp) + ) { + Icon( + painter = painterResource(id = R.drawable.rounded_open_in_new_24), + contentDescription = null, + modifier = Modifier.size(22.dp) + ) + Spacer(modifier = Modifier.width(8.dp)) + Text( + text = stringResource(R.string.label_wallpaper_apply), + style = MaterialTheme.typography.titleMedium.copy(fontWeight = FontWeight.Bold) + ) + } + }, + trailingButton = { + SplitButtonDefaults.TrailingButton( + onClick = { + HapticUtil.performUIHaptic(view) + showSettingsCard = !showSettingsCard + }, + modifier = Modifier.height(56.dp) + ) { + Icon( + painter = painterResource(id = if (showSettingsCard) R.drawable.rounded_keyboard_arrow_down_24 else R.drawable.rounded_keyboard_arrow_up_24), + contentDescription = "Options", + modifier = Modifier.size(24.dp) + ) + } + } + ) + } + } + + EssentialsFloatingToolbar( + title = stringResource(R.string.feat_daily_wallpaper_title), + onBackClick = { + HapticUtil.performUIHaptic(view) + onBack() + }, + onHelpClick = { + HapticUtil.performUIHaptic(view) + showHelpSheet = true + }, + modifier = Modifier + .align(Alignment.BottomCenter) + .zIndex(1f) + ) + + if (showHelpSheet) { + WallpaperHelpBottomSheet( + selectedTab = pagerState.currentPage, + onDismissRequest = { showHelpSheet = false }, + wallpaperInfo = wallpaperInfo, + onViewImage = { + try { + val intent = + Intent( + Intent.ACTION_VIEW, + Uri.parse(wallpaperInfo?.photoLink ?: "") + ) + context.startActivity(intent) + } catch (e: Exception) { + e.printStackTrace() } }, - trailingButton = { - SplitButtonDefaults.TrailingButton( - onClick = { - HapticUtil.performUIHaptic(view) - showSettingsCard = !showSettingsCard - }, - modifier = Modifier.height(56.dp) - ) { - Icon( - painter = painterResource(id = if (showSettingsCard) R.drawable.rounded_keyboard_arrow_down_24 else R.drawable.rounded_keyboard_arrow_up_24), - contentDescription = "Options", - modifier = Modifier.size(24.dp) + onViewAuthor = { + try { + val intent = + Intent( + Intent.ACTION_VIEW, + Uri.parse(wallpaperInfo?.authorLink ?: "") + ) + context.startActivity(intent) + } catch (e: Exception) { + e.printStackTrace() + } + }, + onViewCollection = { + try { + val intent = Intent( + Intent.ACTION_VIEW, + Uri.parse("https://unsplash.com/collections/LqO9knU9z2A/Likes") ) + context.startActivity(intent) + } catch (e: Exception) { + e.printStackTrace() } } ) } } - - EssentialsFloatingToolbar( - title = stringResource(R.string.feat_daily_wallpaper_title), - onBackClick = { - HapticUtil.performUIHaptic(view) - onBack() - }, - onHelpClick = { - HapticUtil.performUIHaptic(view) - showHelpSheet = true - }, - modifier = Modifier - .align(Alignment.BottomCenter) - .zIndex(1f) - ) - - if (showHelpSheet) { - WallpaperHelpBottomSheet( - selectedTab = pagerState.currentPage, - onDismissRequest = { showHelpSheet = false }, - wallpaperInfo = wallpaperInfo, - onViewImage = { - try { - val intent = - Intent(Intent.ACTION_VIEW, Uri.parse(wallpaperInfo?.photoLink ?: "")) - context.startActivity(intent) - } catch (e: Exception) { - e.printStackTrace() - } - }, - onViewAuthor = { - try { - val intent = - Intent(Intent.ACTION_VIEW, Uri.parse(wallpaperInfo?.authorLink ?: "")) - context.startActivity(intent) - } catch (e: Exception) { - e.printStackTrace() - } - }, - onViewCollection = { - try { - val intent = Intent( - Intent.ACTION_VIEW, - Uri.parse("https://unsplash.com/collections/LqO9knU9z2A/Likes") - ) - context.startActivity(intent) - } catch (e: Exception) { - e.printStackTrace() - } - } - ) - } } } -} @OptIn(ExperimentalMaterial3Api::class) @Composable diff --git a/app/src/main/java/com/sameerasw/essentials/ui/composables/configs/WatchControlsSettingsUI.kt b/app/src/main/java/com/sameerasw/essentials/ui/features/watch/WatchControlsSettingsUI.kt similarity index 97% rename from app/src/main/java/com/sameerasw/essentials/ui/composables/configs/WatchControlsSettingsUI.kt rename to app/src/main/java/com/sameerasw/essentials/ui/features/watch/WatchControlsSettingsUI.kt index d4228bc48..d944cd705 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/composables/configs/WatchControlsSettingsUI.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/features/watch/WatchControlsSettingsUI.kt @@ -1,4 +1,13 @@ -package com.sameerasw.essentials.ui.composables.configs +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Feature - Watch + * File: WatchControlsSettingsUI.kt + * Description: UI component and settings composable for Watch feature domain. + */ + +package com.sameerasw.essentials.ui.features.system import androidx.compose.foundation.gestures.detectTapGestures import androidx.compose.foundation.layout.Arrangement diff --git a/app/src/main/java/com/sameerasw/essentials/ui/composables/configs/WatchSettingsUI.kt b/app/src/main/java/com/sameerasw/essentials/ui/features/watch/WatchSettingsUI.kt similarity index 96% rename from app/src/main/java/com/sameerasw/essentials/ui/composables/configs/WatchSettingsUI.kt rename to app/src/main/java/com/sameerasw/essentials/ui/features/watch/WatchSettingsUI.kt index 01c029cbe..0c19d620a 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/composables/configs/WatchSettingsUI.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/features/watch/WatchSettingsUI.kt @@ -1,4 +1,13 @@ -package com.sameerasw.essentials.ui.composables.configs +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: WearOS Companion + * File: WatchSettingsUI.kt + * Description: Composable screen for Smartwatch sync and remote lock options. + */ + +package com.sameerasw.essentials.ui.features.system import androidx.compose.foundation.background import androidx.compose.foundation.clickable @@ -28,7 +37,7 @@ import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp import com.sameerasw.essentials.R -import com.sameerasw.essentials.ui.components.containers.RoundedCardContainer +import com.sameerasw.essentials.ui.core.containers.RoundedCardContainer import com.sameerasw.essentials.utils.HapticUtil import com.sameerasw.essentials.viewmodels.WatchViewModel diff --git a/app/src/main/java/com/sameerasw/essentials/ui/components/sheets/WatchInstallHelpBottomSheet.kt b/app/src/main/java/com/sameerasw/essentials/ui/features/watch/sheets/WatchInstallHelpBottomSheet.kt similarity index 95% rename from app/src/main/java/com/sameerasw/essentials/ui/components/sheets/WatchInstallHelpBottomSheet.kt rename to app/src/main/java/com/sameerasw/essentials/ui/features/watch/sheets/WatchInstallHelpBottomSheet.kt index c71f9b040..068f1d924 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/components/sheets/WatchInstallHelpBottomSheet.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/features/watch/sheets/WatchInstallHelpBottomSheet.kt @@ -1,4 +1,13 @@ -package com.sameerasw.essentials.ui.components.sheets +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: WearOS Companion + * File: WatchInstallHelpBottomSheet.kt + * Description: Guidance bottom sheet for installing the WearOS companion APK via ADB commands. + */ + +package com.sameerasw.essentials.ui.features.watch.sheets import androidx.compose.foundation.background import androidx.compose.foundation.layout.Arrangement @@ -31,7 +40,8 @@ import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp import androidx.lifecycle.viewmodel.compose.viewModel import com.sameerasw.essentials.R -import com.sameerasw.essentials.ui.components.containers.RoundedCardContainer +import com.sameerasw.essentials.ui.core.containers.RoundedCardContainer +import com.sameerasw.essentials.ui.core.sheets.EssentialsBottomSheet import com.sameerasw.essentials.utils.HapticUtil import com.sameerasw.essentials.viewmodels.WatchViewModel diff --git a/app/src/main/java/com/sameerasw/essentials/ui/composables/watermark/WatermarkScreen.kt b/app/src/main/java/com/sameerasw/essentials/ui/features/watermark/WatermarkScreen.kt similarity index 97% rename from app/src/main/java/com/sameerasw/essentials/ui/composables/watermark/WatermarkScreen.kt rename to app/src/main/java/com/sameerasw/essentials/ui/features/watermark/WatermarkScreen.kt index ff69af537..e848b8316 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/composables/watermark/WatermarkScreen.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/features/watermark/WatermarkScreen.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Feature - Watermark + * File: WatermarkScreen.kt + * Description: UI component and settings composable for Watermark feature domain. + */ + package com.sameerasw.essentials.ui.composables.watermark import android.app.Activity @@ -38,10 +47,10 @@ import com.sameerasw.essentials.R import com.sameerasw.essentials.ui.components.ReusableTopAppBar import com.sameerasw.essentials.ui.components.menus.SegmentedDropdownMenu import com.sameerasw.essentials.ui.components.menus.SegmentedDropdownMenuItem -import com.sameerasw.essentials.ui.components.sheets.EditWatermarkSheet -import com.sameerasw.essentials.ui.components.sheets.ExifSettingsSheet import com.sameerasw.essentials.ui.components.watermark.WatermarkControls import com.sameerasw.essentials.ui.components.watermark.WatermarkPreviewArea +import com.sameerasw.essentials.ui.core.sheets.EditWatermarkSheet +import com.sameerasw.essentials.ui.core.sheets.ExifSettingsSheet import com.sameerasw.essentials.utils.HapticUtil.performUIHaptic import com.sameerasw.essentials.viewmodels.WatermarkUiState import com.sameerasw.essentials.viewmodels.WatermarkViewModel diff --git a/app/src/main/java/com/sameerasw/essentials/ui/components/watermark/WatermarkControls.kt b/app/src/main/java/com/sameerasw/essentials/ui/features/watermark/components/WatermarkControls.kt similarity index 97% rename from app/src/main/java/com/sameerasw/essentials/ui/components/watermark/WatermarkControls.kt rename to app/src/main/java/com/sameerasw/essentials/ui/features/watermark/components/WatermarkControls.kt index 29ba5e500..e5f6103f2 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/components/watermark/WatermarkControls.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/features/watermark/components/WatermarkControls.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Feature - Watermark + * File: WatermarkControls.kt + * Description: UI component and settings composable for Watermark feature domain. + */ + package com.sameerasw.essentials.ui.components.watermark import androidx.compose.foundation.background @@ -34,10 +43,10 @@ import com.sameerasw.essentials.R import com.sameerasw.essentials.domain.watermark.ColorMode import com.sameerasw.essentials.domain.watermark.WatermarkOptions import com.sameerasw.essentials.domain.watermark.WatermarkStyle -import com.sameerasw.essentials.ui.components.cards.IconToggleItem -import com.sameerasw.essentials.ui.components.containers.RoundedCardContainer -import com.sameerasw.essentials.ui.components.pickers.SegmentedPicker import com.sameerasw.essentials.ui.components.sliders.ConfigSliderItem +import com.sameerasw.essentials.ui.core.cards.IconToggleItem +import com.sameerasw.essentials.ui.core.containers.RoundedCardContainer +import com.sameerasw.essentials.ui.core.pickers.SegmentedPicker import com.sameerasw.essentials.utils.HapticUtil.performSliderHaptic import com.sameerasw.essentials.utils.HapticUtil.performUIHaptic diff --git a/app/src/main/java/com/sameerasw/essentials/ui/components/watermark/WatermarkPreview.kt b/app/src/main/java/com/sameerasw/essentials/ui/features/watermark/components/WatermarkPreview.kt similarity index 92% rename from app/src/main/java/com/sameerasw/essentials/ui/components/watermark/WatermarkPreview.kt rename to app/src/main/java/com/sameerasw/essentials/ui/features/watermark/components/WatermarkPreview.kt index b2cee7177..004febbbb 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/components/watermark/WatermarkPreview.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/features/watermark/components/WatermarkPreview.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Feature - Watermark + * File: WatermarkPreview.kt + * Description: UI component and settings composable for Watermark feature domain. + */ + package com.sameerasw.essentials.ui.components.watermark import androidx.compose.foundation.layout.Box diff --git a/app/src/main/java/com/sameerasw/essentials/ui/components/watermark/WatermarkPreviewArea.kt b/app/src/main/java/com/sameerasw/essentials/ui/features/watermark/components/WatermarkPreviewArea.kt similarity index 97% rename from app/src/main/java/com/sameerasw/essentials/ui/components/watermark/WatermarkPreviewArea.kt rename to app/src/main/java/com/sameerasw/essentials/ui/features/watermark/components/WatermarkPreviewArea.kt index 0e3c63a68..e91951edb 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/components/watermark/WatermarkPreviewArea.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/features/watermark/components/WatermarkPreviewArea.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Feature - Watermark + * File: WatermarkPreviewArea.kt + * Description: UI component and settings composable for Watermark feature domain. + */ + package com.sameerasw.essentials.ui.components.watermark import android.net.Uri diff --git a/app/src/main/java/com/sameerasw/essentials/ui/components/watermark/WatermarkSharedComponents.kt b/app/src/main/java/com/sameerasw/essentials/ui/features/watermark/components/WatermarkSharedComponents.kt similarity index 95% rename from app/src/main/java/com/sameerasw/essentials/ui/components/watermark/WatermarkSharedComponents.kt rename to app/src/main/java/com/sameerasw/essentials/ui/features/watermark/components/WatermarkSharedComponents.kt index 46a47bb8c..79b836f9b 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/components/watermark/WatermarkSharedComponents.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/features/watermark/components/WatermarkSharedComponents.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Feature - Watermark + * File: WatermarkSharedComponents.kt + * Description: UI component and settings composable for Watermark feature domain. + */ + package com.sameerasw.essentials.ui.components.watermark import androidx.compose.foundation.background diff --git a/app/src/main/java/com/sameerasw/essentials/ui/components/sheets/EditWatermarkSheet.kt b/app/src/main/java/com/sameerasw/essentials/ui/features/watermark/sheets/EditWatermarkSheet.kt similarity index 96% rename from app/src/main/java/com/sameerasw/essentials/ui/components/sheets/EditWatermarkSheet.kt rename to app/src/main/java/com/sameerasw/essentials/ui/features/watermark/sheets/EditWatermarkSheet.kt index 70189627e..a6f2ae8ae 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/components/sheets/EditWatermarkSheet.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/features/watermark/sheets/EditWatermarkSheet.kt @@ -1,4 +1,13 @@ -package com.sameerasw.essentials.ui.components.sheets +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Feature - Watermark + * File: EditWatermarkSheet.kt + * Description: UI component and settings composable for Watermark feature domain. + */ + +package com.sameerasw.essentials.ui.core.sheets import androidx.compose.foundation.background import androidx.compose.foundation.clickable @@ -39,8 +48,8 @@ import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp import com.sameerasw.essentials.R import com.sameerasw.essentials.domain.watermark.WatermarkOptions -import com.sameerasw.essentials.ui.components.cards.IconToggleItem -import com.sameerasw.essentials.ui.components.containers.RoundedCardContainer +import com.sameerasw.essentials.ui.core.cards.IconToggleItem +import com.sameerasw.essentials.ui.core.containers.RoundedCardContainer import com.sameerasw.essentials.utils.HapticUtil.performUIHaptic import java.text.SimpleDateFormat import java.util.Calendar diff --git a/app/src/main/java/com/sameerasw/essentials/ui/components/sheets/ExifSettingsSheet.kt b/app/src/main/java/com/sameerasw/essentials/ui/features/watermark/sheets/ExifSettingsSheet.kt similarity index 93% rename from app/src/main/java/com/sameerasw/essentials/ui/components/sheets/ExifSettingsSheet.kt rename to app/src/main/java/com/sameerasw/essentials/ui/features/watermark/sheets/ExifSettingsSheet.kt index 78cb94d6f..f64397d66 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/components/sheets/ExifSettingsSheet.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/features/watermark/sheets/ExifSettingsSheet.kt @@ -1,4 +1,13 @@ -package com.sameerasw.essentials.ui.components.sheets +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Feature - Watermark + * File: ExifSettingsSheet.kt + * Description: UI component and settings composable for Watermark feature domain. + */ + +package com.sameerasw.essentials.ui.core.sheets import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column @@ -13,8 +22,8 @@ import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp import com.sameerasw.essentials.R import com.sameerasw.essentials.domain.watermark.WatermarkOptions -import com.sameerasw.essentials.ui.components.cards.IconToggleItem -import com.sameerasw.essentials.ui.components.containers.RoundedCardContainer +import com.sameerasw.essentials.ui.core.cards.IconToggleItem +import com.sameerasw.essentials.ui.core.containers.RoundedCardContainer @OptIn(ExperimentalMaterial3Api::class) @Composable diff --git a/app/src/main/java/com/sameerasw/essentials/ui/ime/EmojiData.kt b/app/src/main/java/com/sameerasw/essentials/ui/ime/EmojiData.kt index d8b129a49..06c856095 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/ime/EmojiData.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/ime/EmojiData.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Module + * File: EmojiData.kt + * Description: UI layout element for EmojiData.kt. + */ + package com.sameerasw.essentials.ui.ime import android.content.Context diff --git a/app/src/main/java/com/sameerasw/essentials/ui/ime/EmojiPicker.kt b/app/src/main/java/com/sameerasw/essentials/ui/ime/EmojiPicker.kt index d12ae22b4..dfd034d1a 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/ime/EmojiPicker.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/ime/EmojiPicker.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Module + * File: EmojiPicker.kt + * Description: UI layout element for EmojiPicker.kt. + */ + package com.sameerasw.essentials.ui.ime import androidx.compose.foundation.background diff --git a/app/src/main/java/com/sameerasw/essentials/ui/ime/KaomojiData.kt b/app/src/main/java/com/sameerasw/essentials/ui/ime/KaomojiData.kt index ddb5ff040..a6b6cd82d 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/ime/KaomojiData.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/ime/KaomojiData.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Module + * File: KaomojiData.kt + * Description: UI layout element for KaomojiData.kt. + */ + package com.sameerasw.essentials.ui.ime import android.content.Context diff --git a/app/src/main/java/com/sameerasw/essentials/ui/ime/KaomojiPicker.kt b/app/src/main/java/com/sameerasw/essentials/ui/ime/KaomojiPicker.kt index b1cfabbce..8f9061ba3 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/ime/KaomojiPicker.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/ime/KaomojiPicker.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Module + * File: KaomojiPicker.kt + * Description: UI layout element for KaomojiPicker.kt. + */ + package com.sameerasw.essentials.ui.ime import androidx.compose.foundation.background diff --git a/app/src/main/java/com/sameerasw/essentials/ui/ime/KeyboardInputView.kt b/app/src/main/java/com/sameerasw/essentials/ui/ime/KeyboardInputView.kt index afd5aaf3a..8257c667b 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/ime/KeyboardInputView.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/ime/KeyboardInputView.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Module + * File: KeyboardInputView.kt + * Description: UI layout element for KeyboardInputView.kt. + */ + package com.sameerasw.essentials.ui.ime import android.view.KeyEvent diff --git a/app/src/main/java/com/sameerasw/essentials/ui/modifiers/HighlightModifier.kt b/app/src/main/java/com/sameerasw/essentials/ui/modifiers/HighlightModifier.kt index 915ba8872..a719fbf18 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/modifiers/HighlightModifier.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/modifiers/HighlightModifier.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Module + * File: HighlightModifier.kt + * Description: UI layout element for HighlightModifier.kt. + */ + package com.sameerasw.essentials.ui.modifiers import androidx.compose.animation.core.Animatable diff --git a/app/src/main/java/com/sameerasw/essentials/ui/modifiers/ProgressiveBlurModifier.kt b/app/src/main/java/com/sameerasw/essentials/ui/modifiers/ProgressiveBlurModifier.kt index 8c74c3920..38f286bb5 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/modifiers/ProgressiveBlurModifier.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/modifiers/ProgressiveBlurModifier.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Module + * File: ProgressiveBlurModifier.kt + * Description: UI layout element for ProgressiveBlurModifier.kt. + */ + package com.sameerasw.essentials.ui.modifiers import android.graphics.RenderEffect diff --git a/app/src/main/java/com/sameerasw/essentials/ui/state/MenuStateManager.kt b/app/src/main/java/com/sameerasw/essentials/ui/state/MenuStateManager.kt index 3c433c4ca..d40dcd05e 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/state/MenuStateManager.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/state/MenuStateManager.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Module + * File: MenuStateManager.kt + * Description: UI layout element for MenuStateManager.kt. + */ + package com.sameerasw.essentials.ui.state import androidx.compose.runtime.compositionLocalOf diff --git a/app/src/main/java/com/sameerasw/essentials/ui/theme/Color.kt b/app/src/main/java/com/sameerasw/essentials/ui/theme/Color.kt index 464bbcc1d..694a50bf4 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/theme/Color.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/theme/Color.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Module + * File: Color.kt + * Description: UI layout element for Color.kt. + */ + package com.sameerasw.essentials.ui.theme import androidx.compose.ui.graphics.Color diff --git a/app/src/main/java/com/sameerasw/essentials/ui/theme/Shapes.kt b/app/src/main/java/com/sameerasw/essentials/ui/theme/Shapes.kt index 06327bb07..fd9ecaaba 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/theme/Shapes.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/theme/Shapes.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Module + * File: Shapes.kt + * Description: UI layout element for Shapes.kt. + */ + package com.sameerasw.essentials.ui.theme import androidx.compose.foundation.shape.RoundedCornerShape diff --git a/app/src/main/java/com/sameerasw/essentials/ui/theme/Theme.kt b/app/src/main/java/com/sameerasw/essentials/ui/theme/Theme.kt index 3955a2864..c31f91f69 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/theme/Theme.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/theme/Theme.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Module + * File: Theme.kt + * Description: UI layout element for Theme.kt. + */ + package com.sameerasw.essentials.ui.theme import android.os.Build diff --git a/app/src/main/java/com/sameerasw/essentials/ui/theme/Type.kt b/app/src/main/java/com/sameerasw/essentials/ui/theme/Type.kt index e6189ebfc..c9ebf7192 100644 --- a/app/src/main/java/com/sameerasw/essentials/ui/theme/Type.kt +++ b/app/src/main/java/com/sameerasw/essentials/ui/theme/Type.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Module + * File: Type.kt + * Description: UI layout element for Type.kt. + */ + package com.sameerasw.essentials.ui.theme import androidx.compose.material3.Typography diff --git a/app/src/main/java/com/sameerasw/essentials/utils/AppUtil.kt b/app/src/main/java/com/sameerasw/essentials/utils/AppUtil.kt index fdfe39688..9619113a6 100644 --- a/app/src/main/java/com/sameerasw/essentials/utils/AppUtil.kt +++ b/app/src/main/java/com/sameerasw/essentials/utils/AppUtil.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Core Utilities + * File: AppUtil.kt + * Description: General application helper methods for installed package details. + */ + package com.sameerasw.essentials.utils import android.content.Context @@ -198,6 +207,13 @@ object AppUtil { return bitmap } + /** + * Executes the drawable to bitmap operation. + * + * @param drawable [android.graphics.drawable.Drawable] Target drawable. + * @param size [Int?] Target size. + * @return The resulting Bitmap data. + */ fun drawableToBitmap(drawable: android.graphics.drawable.Drawable, size: Int? = null): Bitmap { if (drawable is BitmapDrawable && size == null) { return drawable.bitmap @@ -229,6 +245,13 @@ object AppUtil { return drawableToBitmap(drawable, SHORTCUT_ICON_SIZE) } + /** + * Executes the get app version operation. + * + * @param context [Context] Target context. + * @param packageName [String] Target package name. + * @return The resulting String? data. + */ fun getAppVersion(context: Context, packageName: String): String? { return try { val pInfo = context.packageManager.getPackageInfo(packageName, 0) diff --git a/app/src/main/java/com/sameerasw/essentials/utils/AutoUpdateManagerHelper.kt b/app/src/main/java/com/sameerasw/essentials/utils/AutoUpdateManagerHelper.kt index b15ee144b..d79742528 100644 --- a/app/src/main/java/com/sameerasw/essentials/utils/AutoUpdateManagerHelper.kt +++ b/app/src/main/java/com/sameerasw/essentials/utils/AutoUpdateManagerHelper.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Utilities - General + * File: AutoUpdateManagerHelper.kt + * Description: Utility helper for AutoUpdateManagerHelper.kt. + */ + package com.sameerasw.essentials.utils import AutoUpdaterManager diff --git a/app/src/main/java/com/sameerasw/essentials/utils/BluetoothBatteryUtils.kt b/app/src/main/java/com/sameerasw/essentials/utils/BluetoothBatteryUtils.kt index 2a92fabc0..2ba264622 100644 --- a/app/src/main/java/com/sameerasw/essentials/utils/BluetoothBatteryUtils.kt +++ b/app/src/main/java/com/sameerasw/essentials/utils/BluetoothBatteryUtils.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Utilities - General + * File: BluetoothBatteryUtils.kt + * Description: Utility helper for BluetoothBatteryUtils.kt. + */ + package com.sameerasw.essentials.utils import android.annotation.SuppressLint diff --git a/app/src/main/java/com/sameerasw/essentials/utils/BluetoothPairedDevicesUtil.kt b/app/src/main/java/com/sameerasw/essentials/utils/BluetoothPairedDevicesUtil.kt index 24ed00c52..d918d8084 100644 --- a/app/src/main/java/com/sameerasw/essentials/utils/BluetoothPairedDevicesUtil.kt +++ b/app/src/main/java/com/sameerasw/essentials/utils/BluetoothPairedDevicesUtil.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Utilities - General + * File: BluetoothPairedDevicesUtil.kt + * Description: Utility helper for BluetoothPairedDevicesUtil.kt. + */ + package com.sameerasw.essentials.utils import android.annotation.SuppressLint diff --git a/app/src/main/java/com/sameerasw/essentials/utils/DeviceUtils.kt b/app/src/main/java/com/sameerasw/essentials/utils/DeviceUtils.kt index 3309877f9..93f20b747 100644 --- a/app/src/main/java/com/sameerasw/essentials/utils/DeviceUtils.kt +++ b/app/src/main/java/com/sameerasw/essentials/utils/DeviceUtils.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Utilities - General + * File: DeviceUtils.kt + * Description: Utility helper for DeviceUtils.kt. + */ + package com.sameerasw.essentials.utils import android.app.ActivityManager diff --git a/app/src/main/java/com/sameerasw/essentials/utils/FreezeManager.kt b/app/src/main/java/com/sameerasw/essentials/utils/FreezeManager.kt index c394214c6..922d28e66 100644 --- a/app/src/main/java/com/sameerasw/essentials/utils/FreezeManager.kt +++ b/app/src/main/java/com/sameerasw/essentials/utils/FreezeManager.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Utilities - General + * File: FreezeManager.kt + * Description: Utility helper for FreezeManager.kt. + */ + package com.sameerasw.essentials.utils import android.content.Context @@ -88,6 +97,13 @@ object FreezeManager { } } + /** + * Executes the is app active operation. + * + * @param context [Context] Target context. + * @param packageName [String] Target package name. + * @return The resulting Boolean data. + */ fun isAppActive(context: Context, packageName: String): Boolean { // 1. Check Foreground if (isAppInForeground(context, packageName)) return true @@ -302,6 +318,12 @@ object FreezeManager { HiddenApiBypass.invoke(builderClass, builder, "build") } else null + /** + * Executes the call set packages suspended operation. + * + * @param version [Int] Target version. + * @return The resulting Array< data. + */ fun callSetPackagesSuspended(version: Int): Array<*>? { return try { when (version) { diff --git a/app/src/main/java/com/sameerasw/essentials/utils/LanguageUtils.kt b/app/src/main/java/com/sameerasw/essentials/utils/LanguageUtils.kt index 47edd9229..ac180ffd9 100644 --- a/app/src/main/java/com/sameerasw/essentials/utils/LanguageUtils.kt +++ b/app/src/main/java/com/sameerasw/essentials/utils/LanguageUtils.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Utilities - General + * File: LanguageUtils.kt + * Description: Utility helper for LanguageUtils.kt. + */ + package com.sameerasw.essentials.utils import java.util.Locale diff --git a/app/src/main/java/com/sameerasw/essentials/utils/LogManager.kt b/app/src/main/java/com/sameerasw/essentials/utils/LogManager.kt index 056cb8eb7..5e010802d 100644 --- a/app/src/main/java/com/sameerasw/essentials/utils/LogManager.kt +++ b/app/src/main/java/com/sameerasw/essentials/utils/LogManager.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Utilities - General + * File: LogManager.kt + * Description: Utility helper for LogManager.kt. + */ + package com.sameerasw.essentials.utils import android.content.Context diff --git a/app/src/main/java/com/sameerasw/essentials/utils/OmniTriggerUtil.kt b/app/src/main/java/com/sameerasw/essentials/utils/OmniTriggerUtil.kt index e990ada0d..dabf1fea7 100644 --- a/app/src/main/java/com/sameerasw/essentials/utils/OmniTriggerUtil.kt +++ b/app/src/main/java/com/sameerasw/essentials/utils/OmniTriggerUtil.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Utilities - General + * File: OmniTriggerUtil.kt + * Description: Utility helper for OmniTriggerUtil.kt. + */ + package com.sameerasw.essentials.utils import android.annotation.SuppressLint diff --git a/app/src/main/java/com/sameerasw/essentials/utils/OverlayHelper.kt b/app/src/main/java/com/sameerasw/essentials/utils/OverlayHelper.kt index fc1ae9678..c682770fa 100644 --- a/app/src/main/java/com/sameerasw/essentials/utils/OverlayHelper.kt +++ b/app/src/main/java/com/sameerasw/essentials/utils/OverlayHelper.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Utilities - General + * File: OverlayHelper.kt + * Description: Utility helper for OverlayHelper.kt. + */ + package com.sameerasw.essentials.utils import android.animation.Animator @@ -381,6 +390,9 @@ object OverlayHelper { savedStateRegistryController.savedStateRegistry override val viewModelStore: ViewModelStore = store + /** + * Executes the on create operation. + */ fun onCreate() { savedStateRegistryController.performRestore(null) lifecycleRegistry.handleLifecycleEvent(Lifecycle.Event.ON_CREATE) @@ -388,6 +400,9 @@ object OverlayHelper { lifecycleRegistry.handleLifecycleEvent(Lifecycle.Event.ON_RESUME) } + /** + * Executes the on destroy operation. + */ fun onDestroy() { lifecycleRegistry.handleLifecycleEvent(Lifecycle.Event.ON_PAUSE) lifecycleRegistry.handleLifecycleEvent(Lifecycle.Event.ON_STOP) @@ -464,8 +479,8 @@ object OverlayHelper { /** * Removes an overlay view from the WindowManager. * - * @param windowManager The WindowManager instance - * @param view The overlay view to remove + * @param windowManager [WindowManager?] The WindowManager instance + * @param view [View] The overlay view to remove */ fun removeOverlayView(windowManager: WindowManager?, view: View) { try { @@ -477,8 +492,8 @@ object OverlayHelper { /** * Removes all overlay views and clears the list. * - * @param windowManager The WindowManager instance - * @param overlayViews The list of overlay views to remove + * @param windowManager [WindowManager?] The WindowManager instance + * @param overlayViews [MutableList] The list of overlay views to remove */ fun removeAllOverlays(windowManager: WindowManager?, overlayViews: MutableList) { try { @@ -551,8 +566,8 @@ object OverlayHelper { /** * Animates the overlay view to fade in over 1 second. * - * @param view The overlay view to animate - * @param onAnimationEnd Optional callback when animation completes + * @param view [View] The overlay view to animate + * @param onAnimationEnd [((] Optional callback when animation completes */ fun fadeInOverlay(view: View, onAnimationEnd: (() -> Unit)? = null) { view.alpha = 0f @@ -655,6 +670,9 @@ object OverlayHelper { val durationHold = (pulseDurationMillis * 0.4).toLong() val durationOut = (pulseDurationMillis * 0.5).toLong() + /** + * Executes the start pulse operation. + */ fun startPulse() { if (pulseCount >= maxPulses) { onAnimationEnd?.invoke() @@ -712,6 +730,9 @@ object OverlayHelper { val holdDuration = (pulseDurationMillis * 0.4).toLong() val shrinkDuration = (pulseDurationMillis * 0.5).toLong() + /** + * Executes the start pulse operation. + */ fun startPulse() { if (pulseCount >= maxPulses) { onAnimationEnd?.invoke() @@ -833,6 +854,9 @@ object OverlayHelper { var pulseCount = 0 + /** + * Executes the start pulse operation. + */ fun startPulse() { if (pulseCount >= maxPulses) { onAnimationEnd?.invoke() diff --git a/app/src/main/java/com/sameerasw/essentials/utils/PermissionUtils.kt b/app/src/main/java/com/sameerasw/essentials/utils/PermissionUtils.kt index 235ed8434..4ca9d0430 100644 --- a/app/src/main/java/com/sameerasw/essentials/utils/PermissionUtils.kt +++ b/app/src/main/java/com/sameerasw/essentials/utils/PermissionUtils.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Core Utilities + * File: PermissionUtils.kt + * Description: System permission validation and settings navigation helpers. + */ + package com.sameerasw.essentials.utils import android.app.admin.DevicePolicyManager @@ -14,6 +23,12 @@ import com.sameerasw.essentials.services.tiles.ScreenOffAccessibilityService object PermissionUtils { + /** + * Executes the is accessibility service enabled operation. + * + * @param context [Context] Target context. + * @return The resulting Boolean data. + */ fun isAccessibilityServiceEnabled(context: Context): Boolean { val enabledServices = Settings.Secure.getString( context.contentResolver, @@ -23,11 +38,23 @@ object PermissionUtils { return enabledServices?.contains(serviceName) == true } + /** + * Executes the can write secure settings operation. + * + * @param context [Context] Target context. + * @return The resulting Boolean data. + */ fun canWriteSecureSettings(context: Context): Boolean { return context.checkSelfPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) == android.content.pm.PackageManager.PERMISSION_GRANTED } + /** + * Executes the has notification listener permission operation. + * + * @param context [Context] Target context. + * @return The resulting Boolean data. + */ fun hasNotificationListenerPermission(context: Context): Boolean { return try { val enabledServices = Settings.Secure.getString( @@ -41,6 +68,12 @@ object PermissionUtils { } } + /** + * Executes the can draw overlays operation. + * + * @param context [Context] Target context. + * @return The resulting Boolean data. + */ fun canDrawOverlays(context: Context): Boolean { return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { Settings.canDrawOverlays(context) @@ -49,12 +82,24 @@ object PermissionUtils { } } + /** + * Executes the is device admin active operation. + * + * @param context [Context] Target context. + * @return The resulting Boolean data. + */ fun isDeviceAdminActive(context: Context): Boolean { val dpm = context.getSystemService(Context.DEVICE_POLICY_SERVICE) as DevicePolicyManager val adminComponent = ComponentName(context, SecurityDeviceAdminReceiver::class.java) return dpm.isAdminActive(adminComponent) } + /** + * Executes the is notification lighting accessibility service enabled operation. + * + * @param context [Context] Target context. + * @return The resulting Boolean data. + */ fun isNotificationLightingAccessibilityServiceEnabled(context: Context): Boolean { return try { val enabledServices = Settings.Secure.getString( @@ -69,6 +114,12 @@ object PermissionUtils { } } + /** + * Executes the is default browser operation. + * + * @param context [Context] Target context. + * @return The resulting Boolean data. + */ fun isDefaultBrowser(context: Context): Boolean { return try { val pm = context.packageManager @@ -91,6 +142,11 @@ object PermissionUtils { } } + /** + * Executes the open accessibility settings operation. + * + * @param context [Context] Target context. + */ fun openAccessibilitySettings(context: Context) { try { val intent = Intent(Settings.ACTION_ACCESSIBILITY_SETTINGS) @@ -101,6 +157,12 @@ object PermissionUtils { } } + /** + * Executes the has location permission operation. + * + * @param context [Context] Target context. + * @return The resulting Boolean data. + */ fun hasLocationPermission(context: Context): Boolean { return androidx.core.content.ContextCompat.checkSelfPermission( context, @@ -108,6 +170,12 @@ object PermissionUtils { ) == android.content.pm.PackageManager.PERMISSION_GRANTED } + /** + * Executes the has background location permission operation. + * + * @param context [Context] Target context. + * @return The resulting Boolean data. + */ fun hasBackgroundLocationPermission(context: Context): Boolean { return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) { androidx.core.content.ContextCompat.checkSelfPermission( @@ -119,6 +187,12 @@ object PermissionUtils { } } + /** + * Executes the can use full screen intent operation. + * + * @param context [Context] Target context. + * @return The resulting Boolean data. + */ fun canUseFullScreenIntent(context: Context): Boolean { return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) { val nm = @@ -129,12 +203,24 @@ object PermissionUtils { } } + /** + * Executes the is keyboard enabled operation. + * + * @param context [Context] Target context. + * @return The resulting Boolean data. + */ fun isKeyboardEnabled(context: Context): Boolean { val imm = context.getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager val enabledImeList = imm.enabledInputMethodList return enabledImeList.any { it.packageName == context.packageName } } + /** + * Executes the is keyboard selected operation. + * + * @param context [Context] Target context. + * @return The resulting Boolean data. + */ fun isKeyboardSelected(context: Context): Boolean { val defaultIme = Settings.Secure.getString( context.contentResolver, @@ -143,10 +229,22 @@ object PermissionUtils { return defaultIme?.startsWith(context.packageName) == true } + /** + * Executes the can write system settings operation. + * + * @param context [Context] Target context. + * @return The resulting Boolean data. + */ fun canWriteSystemSettings(context: Context): Boolean { return Settings.System.canWrite(context) } + /** + * Executes the has bluetooth permission operation. + * + * @param context [Context] Target context. + * @return The resulting Boolean data. + */ fun hasBluetoothPermission(context: Context): Boolean { return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) { androidx.core.content.ContextCompat.checkSelfPermission( @@ -165,6 +263,12 @@ object PermissionUtils { } } + /** + * Executes the has read phone state permission operation. + * + * @param context [Context] Target context. + * @return The resulting Boolean data. + */ fun hasReadPhoneStatePermission(context: Context): Boolean { return androidx.core.content.ContextCompat.checkSelfPermission( context, @@ -172,12 +276,24 @@ object PermissionUtils { ) == android.content.pm.PackageManager.PERMISSION_GRANTED } + /** + * Executes the has notification policy access operation. + * + * @param context [Context] Target context. + * @return The resulting Boolean data. + */ fun hasNotificationPolicyAccess(context: Context): Boolean { val notificationManager = context.getSystemService(Context.NOTIFICATION_SERVICE) as android.app.NotificationManager return notificationManager.isNotificationPolicyAccessGranted } + /** + * Executes the has read calendar permission operation. + * + * @param context [Context] Target context. + * @return The resulting Boolean data. + */ fun hasReadCalendarPermission(context: Context): Boolean { return androidx.core.content.ContextCompat.checkSelfPermission( context, @@ -185,6 +301,11 @@ object PermissionUtils { ) == android.content.pm.PackageManager.PERMISSION_GRANTED } + /** + * Executes the open notification policy settings operation. + * + * @param context [Context] Target context. + */ fun openNotificationPolicySettings(context: Context) { try { val intent = Intent(Settings.ACTION_NOTIFICATION_POLICY_ACCESS_SETTINGS) @@ -195,6 +316,11 @@ object PermissionUtils { } } + /** + * Executes the open write settings operation. + * + * @param context [Context] Target context. + */ fun openWriteSettings(context: Context) { try { val intent = Intent(Settings.ACTION_MANAGE_WRITE_SETTINGS) @@ -208,6 +334,11 @@ object PermissionUtils { } } + /** + * Executes the open overlay settings operation. + * + * @param context [Context] Target context. + */ fun openOverlaySettings(context: Context) { try { val intent = Intent(Settings.ACTION_MANAGE_OVERLAY_PERMISSION) @@ -221,6 +352,12 @@ object PermissionUtils { } } + /** + * Executes the is post notifications enabled operation. + * + * @param context [Context] Target context. + * @return The resulting Boolean data. + */ fun isPostNotificationsEnabled(context: Context): Boolean { return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { androidx.core.content.ContextCompat.checkSelfPermission( @@ -232,6 +369,12 @@ object PermissionUtils { } } + /** + * Executes the has usage stats permission operation. + * + * @param context [Context] Target context. + * @return The resulting Boolean data. + */ fun hasUsageStatsPermission(context: Context): Boolean { val appOps = context.getSystemService(Context.APP_OPS_SERVICE) as android.app.AppOpsManager val mode = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) { @@ -250,6 +393,11 @@ object PermissionUtils { return mode == android.app.AppOpsManager.MODE_ALLOWED } + /** + * Executes the open usage stats settings operation. + * + * @param context [Context] Target context. + */ fun openUsageStatsSettings(context: Context) { try { val intent = Intent(Settings.ACTION_USAGE_ACCESS_SETTINGS) @@ -259,6 +407,11 @@ object PermissionUtils { } } + /** + * Executes the open device admin settings operation. + * + * @param context [Context] Target context. + */ fun openDeviceAdminSettings(context: Context) { try { val intent = Intent(DevicePolicyManager.ACTION_ADD_DEVICE_ADMIN) diff --git a/app/src/main/java/com/sameerasw/essentials/utils/ServiceUtils.kt b/app/src/main/java/com/sameerasw/essentials/utils/ServiceUtils.kt index da40fccce..2ce27e153 100644 --- a/app/src/main/java/com/sameerasw/essentials/utils/ServiceUtils.kt +++ b/app/src/main/java/com/sameerasw/essentials/utils/ServiceUtils.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Utilities - General + * File: ServiceUtils.kt + * Description: Utility helper for ServiceUtils.kt. + */ + package com.sameerasw.essentials.utils import android.content.Context @@ -18,6 +27,11 @@ import java.util.concurrent.TimeUnit object ServiceUtils { + /** + * Executes the start required services operation. + * + * @param context [Context] Target context. + */ fun startRequiredServices(context: Context) { val settingsRepository = SettingsRepository(context) diff --git a/app/src/main/java/com/sameerasw/essentials/utils/ShellUtils.kt b/app/src/main/java/com/sameerasw/essentials/utils/ShellUtils.kt index c4d396ac3..24f225b48 100644 --- a/app/src/main/java/com/sameerasw/essentials/utils/ShellUtils.kt +++ b/app/src/main/java/com/sameerasw/essentials/utils/ShellUtils.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Core Utilities + * File: ShellUtils.kt + * Description: Executes shell commands with root or Shizuku fallback. + */ + package com.sameerasw.essentials.utils import android.app.NotificationChannel diff --git a/app/src/main/java/com/sameerasw/essentials/utils/ShortcutUtil.kt b/app/src/main/java/com/sameerasw/essentials/utils/ShortcutUtil.kt index b0401ac83..327bfca32 100644 --- a/app/src/main/java/com/sameerasw/essentials/utils/ShortcutUtil.kt +++ b/app/src/main/java/com/sameerasw/essentials/utils/ShortcutUtil.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Utilities - General + * File: ShortcutUtil.kt + * Description: Utility helper for ShortcutUtil.kt. + */ + package com.sameerasw.essentials.utils import android.content.Context @@ -10,6 +19,12 @@ import com.sameerasw.essentials.ShortcutHandlerActivity import com.sameerasw.essentials.domain.model.NotificationApp object ShortcutUtil { + /** + * Executes the pin app shortcut operation. + * + * @param context [Context] Target context. + * @param app [NotificationApp] Target app. + */ fun pinAppShortcut(context: Context, app: NotificationApp) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { val shortcutManager = context.getSystemService(ShortcutManager::class.java) @@ -42,6 +57,11 @@ object ShortcutUtil { } } + /** + * Executes the update launcher dynamic shortcuts operation. + * + * @param context [Context] Target context. + */ fun updateLauncherDynamicShortcuts(context: Context) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N_MR1) { val repository = com.sameerasw.essentials.data.repository.SettingsRepository(context) diff --git a/app/src/main/java/com/sameerasw/essentials/utils/StatusBarIconUtils.kt b/app/src/main/java/com/sameerasw/essentials/utils/StatusBarIconUtils.kt index f5e5abaed..51a382bab 100644 --- a/app/src/main/java/com/sameerasw/essentials/utils/StatusBarIconUtils.kt +++ b/app/src/main/java/com/sameerasw/essentials/utils/StatusBarIconUtils.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Utilities - General + * File: StatusBarIconUtils.kt + * Description: Utility helper for StatusBarIconUtils.kt. + */ + package com.sameerasw.essentials.utils import android.content.Context diff --git a/app/src/main/java/com/sameerasw/essentials/utils/StatusBarManager.kt b/app/src/main/java/com/sameerasw/essentials/utils/StatusBarManager.kt index 54f364a46..25e3d36bd 100644 --- a/app/src/main/java/com/sameerasw/essentials/utils/StatusBarManager.kt +++ b/app/src/main/java/com/sameerasw/essentials/utils/StatusBarManager.kt @@ -1,3 +1,13 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: System UI & Status Bar Controls + * File: StatusBarManager.kt + * Description: Manages System UI status bar disable flags, quick settings panel expansion, + * and lock screen security restrictions via system shell commands. + */ + package com.sameerasw.essentials.utils import android.content.Context @@ -19,9 +29,9 @@ object StatusBarManager { /** * Request disabling specific status bar features. - * @param context Context to run shell commands - * @param requesterId Unique ID of the module (e.g., "ScreenLockedSecurity") - * @param flags Set of flags to disable + * @param context [Context] Context to run shell commands + * @param requesterId [String] Unique ID of the module (e.g., "ScreenLockedSecurity") + * @param flags [Set] Set of flags to disable */ fun requestDisable(context: Context, requesterId: String, flags: Set) { disableRequests[requesterId] = flags @@ -30,8 +40,8 @@ object StatusBarManager { /** * Restore status bar features for a specific module. - * @param context Context to run shell commands - * @param requesterId Unique ID of the module + * @param context [Context] Context to run shell commands + * @param requesterId [String] Unique ID of the module */ fun requestRestore(context: Context, requesterId: String) { if (disableRequests.containsKey(requesterId)) { diff --git a/app/src/main/java/com/sameerasw/essentials/utils/TimeUtil.kt b/app/src/main/java/com/sameerasw/essentials/utils/TimeUtil.kt index 165155a90..3eaa0e87b 100644 --- a/app/src/main/java/com/sameerasw/essentials/utils/TimeUtil.kt +++ b/app/src/main/java/com/sameerasw/essentials/utils/TimeUtil.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Utilities - General + * File: TimeUtil.kt + * Description: Utility helper for TimeUtil.kt. + */ + package com.sameerasw.essentials.utils import android.content.Context diff --git a/app/src/main/java/com/sameerasw/essentials/utils/UpdateNotificationHelper.kt b/app/src/main/java/com/sameerasw/essentials/utils/UpdateNotificationHelper.kt index 42be384f4..d276633fc 100644 --- a/app/src/main/java/com/sameerasw/essentials/utils/UpdateNotificationHelper.kt +++ b/app/src/main/java/com/sameerasw/essentials/utils/UpdateNotificationHelper.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Utilities - General + * File: UpdateNotificationHelper.kt + * Description: Utility helper for UpdateNotificationHelper.kt. + */ + package com.sameerasw.essentials.utils import android.app.NotificationChannel diff --git a/app/src/main/java/com/sameerasw/essentials/utils/BatteryHistoryManager.kt b/app/src/main/java/com/sameerasw/essentials/utils/battery/BatteryHistoryManager.kt similarity index 91% rename from app/src/main/java/com/sameerasw/essentials/utils/BatteryHistoryManager.kt rename to app/src/main/java/com/sameerasw/essentials/utils/battery/BatteryHistoryManager.kt index f0b5b57dd..5717a0757 100644 --- a/app/src/main/java/com/sameerasw/essentials/utils/BatteryHistoryManager.kt +++ b/app/src/main/java/com/sameerasw/essentials/utils/battery/BatteryHistoryManager.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Battery Utilities + * File: BatteryHistoryManager.kt + * Description: Stores and queries historical battery charge log points. + */ + package com.sameerasw.essentials.utils import android.content.Context diff --git a/app/src/main/java/com/sameerasw/essentials/utils/BatteryInfoUtil.kt b/app/src/main/java/com/sameerasw/essentials/utils/battery/BatteryInfoUtil.kt similarity index 97% rename from app/src/main/java/com/sameerasw/essentials/utils/BatteryInfoUtil.kt rename to app/src/main/java/com/sameerasw/essentials/utils/battery/BatteryInfoUtil.kt index 8425d64bb..c05d469f0 100644 --- a/app/src/main/java/com/sameerasw/essentials/utils/BatteryInfoUtil.kt +++ b/app/src/main/java/com/sameerasw/essentials/utils/battery/BatteryInfoUtil.kt @@ -1,10 +1,22 @@ -package com.sameerasw.essentials.utils +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Battery Utilities + * File: BatteryInfoUtil.kt + * Description: System helper utility for querying battery status, health, and design stats. + */ + +package com.sameerasw.essentials.utils.battery import android.content.Context import android.content.Intent import android.content.IntentFilter import android.os.BatteryManager import com.sameerasw.essentials.R +import com.sameerasw.essentials.utils.ShellUtils +import com.sameerasw.essentials.utils.hardware.ThermalInfo +import com.sameerasw.essentials.utils.hardware.ThermalUtil data class BatteryDetails( val level: Int, diff --git a/app/src/main/java/com/sameerasw/essentials/utils/BatteryRingDrawer.kt b/app/src/main/java/com/sameerasw/essentials/utils/battery/BatteryRingDrawer.kt similarity index 97% rename from app/src/main/java/com/sameerasw/essentials/utils/BatteryRingDrawer.kt rename to app/src/main/java/com/sameerasw/essentials/utils/battery/BatteryRingDrawer.kt index 5b01376b4..7d85a5202 100644 --- a/app/src/main/java/com/sameerasw/essentials/utils/BatteryRingDrawer.kt +++ b/app/src/main/java/com/sameerasw/essentials/utils/battery/BatteryRingDrawer.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Battery Utilities + * File: BatteryRingDrawer.kt + * Description: Draws dynamic battery level ring indicators on camera cutouts. + */ + package com.sameerasw.essentials.utils import android.content.Context diff --git a/app/src/main/java/com/sameerasw/essentials/utils/BatteryStatsUtil.kt b/app/src/main/java/com/sameerasw/essentials/utils/battery/BatteryStatsUtil.kt similarity index 97% rename from app/src/main/java/com/sameerasw/essentials/utils/BatteryStatsUtil.kt rename to app/src/main/java/com/sameerasw/essentials/utils/battery/BatteryStatsUtil.kt index 5c6501c95..1114b7d51 100644 --- a/app/src/main/java/com/sameerasw/essentials/utils/BatteryStatsUtil.kt +++ b/app/src/main/java/com/sameerasw/essentials/utils/battery/BatteryStatsUtil.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Battery Utilities + * File: BatteryStatsUtil.kt + * Description: Calculates per-app battery consumption statistics. + */ + package com.sameerasw.essentials.utils import android.content.Context diff --git a/app/src/main/java/com/sameerasw/essentials/utils/FlashlightUtil.kt b/app/src/main/java/com/sameerasw/essentials/utils/hardware/FlashlightUtil.kt similarity index 97% rename from app/src/main/java/com/sameerasw/essentials/utils/FlashlightUtil.kt rename to app/src/main/java/com/sameerasw/essentials/utils/hardware/FlashlightUtil.kt index 9e49e4b75..6dc7773a6 100644 --- a/app/src/main/java/com/sameerasw/essentials/utils/FlashlightUtil.kt +++ b/app/src/main/java/com/sameerasw/essentials/utils/hardware/FlashlightUtil.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Hardware Utilities + * File: FlashlightUtil.kt + * Description: Controls camera torch intensity and pulse patterns. + */ + package com.sameerasw.essentials.utils import android.content.Context diff --git a/app/src/main/java/com/sameerasw/essentials/utils/RefreshRateUtils.kt b/app/src/main/java/com/sameerasw/essentials/utils/hardware/RefreshRateUtils.kt similarity index 97% rename from app/src/main/java/com/sameerasw/essentials/utils/RefreshRateUtils.kt rename to app/src/main/java/com/sameerasw/essentials/utils/hardware/RefreshRateUtils.kt index 32f6d027e..26634e7a3 100644 --- a/app/src/main/java/com/sameerasw/essentials/utils/RefreshRateUtils.kt +++ b/app/src/main/java/com/sameerasw/essentials/utils/hardware/RefreshRateUtils.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Hardware Utilities + * File: RefreshRateUtils.kt + * Description: Queries and modifies display refresh rate profiles. + */ + package com.sameerasw.essentials.utils import android.content.Context diff --git a/app/src/main/java/com/sameerasw/essentials/utils/SurfaceFlingerControl.kt b/app/src/main/java/com/sameerasw/essentials/utils/hardware/SurfaceFlingerControl.kt similarity index 90% rename from app/src/main/java/com/sameerasw/essentials/utils/SurfaceFlingerControl.kt rename to app/src/main/java/com/sameerasw/essentials/utils/hardware/SurfaceFlingerControl.kt index 13694f243..8ecdc4337 100644 --- a/app/src/main/java/com/sameerasw/essentials/utils/SurfaceFlingerControl.kt +++ b/app/src/main/java/com/sameerasw/essentials/utils/hardware/SurfaceFlingerControl.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Hardware Utilities + * File: SurfaceFlingerControl.kt + * Description: Interacts with SurfaceFlinger for display mode adjustments. + */ + package com.sameerasw.essentials.utils import android.content.Context @@ -79,7 +88,8 @@ object SurfaceFlingerControl { } if (context != null) { - val output = ShellUtils.runCommandWithOutput(context, "service call SurfaceFlinger 1010") + val output = + ShellUtils.runCommandWithOutput(context, "service call SurfaceFlinger 1010") if (!output.isNullOrEmpty()) { val hexValues = Regex("0x[0-9a-fA-F]+").findAll(output).map { it.value }.toList() if (hexValues.size >= 5) { diff --git a/app/src/main/java/com/sameerasw/essentials/utils/ThermalUtil.kt b/app/src/main/java/com/sameerasw/essentials/utils/hardware/ThermalUtil.kt similarity index 91% rename from app/src/main/java/com/sameerasw/essentials/utils/ThermalUtil.kt rename to app/src/main/java/com/sameerasw/essentials/utils/hardware/ThermalUtil.kt index c38fe27a0..f0e047f41 100644 --- a/app/src/main/java/com/sameerasw/essentials/utils/ThermalUtil.kt +++ b/app/src/main/java/com/sameerasw/essentials/utils/hardware/ThermalUtil.kt @@ -1,6 +1,16 @@ -package com.sameerasw.essentials.utils +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Hardware Utilities + * File: ThermalUtil.kt + * Description: Hardware helper for monitoring device thermal zones and CPU throttling states. + */ + +package com.sameerasw.essentials.utils.hardware import android.content.Context +import com.sameerasw.essentials.utils.ShellUtils data class ThermalItem( val name: String, diff --git a/app/src/main/java/com/sameerasw/essentials/utils/WifiUtil.kt b/app/src/main/java/com/sameerasw/essentials/utils/hardware/WifiUtil.kt similarity index 87% rename from app/src/main/java/com/sameerasw/essentials/utils/WifiUtil.kt rename to app/src/main/java/com/sameerasw/essentials/utils/hardware/WifiUtil.kt index 79c98602c..21ab3fe04 100644 --- a/app/src/main/java/com/sameerasw/essentials/utils/WifiUtil.kt +++ b/app/src/main/java/com/sameerasw/essentials/utils/hardware/WifiUtil.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Hardware Utilities + * File: WifiUtil.kt + * Description: Helper utility for managing Wi-Fi state and network scanning. + */ + package com.sameerasw.essentials.utils import android.content.Context diff --git a/app/src/main/java/com/sameerasw/essentials/utils/BiometricHelper.kt b/app/src/main/java/com/sameerasw/essentials/utils/security/BiometricHelper.kt similarity index 89% rename from app/src/main/java/com/sameerasw/essentials/utils/BiometricHelper.kt rename to app/src/main/java/com/sameerasw/essentials/utils/security/BiometricHelper.kt index 8f41ae05c..232164365 100644 --- a/app/src/main/java/com/sameerasw/essentials/utils/BiometricHelper.kt +++ b/app/src/main/java/com/sameerasw/essentials/utils/security/BiometricHelper.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Security Utilities + * File: BiometricHelper.kt + * Description: BiometricPrompt wrapper for authenticating user identity. + */ + package com.sameerasw.essentials.utils import androidx.biometric.BiometricManager diff --git a/app/src/main/java/com/sameerasw/essentials/utils/BiometricSecurityHelper.kt b/app/src/main/java/com/sameerasw/essentials/utils/security/BiometricSecurityHelper.kt similarity index 89% rename from app/src/main/java/com/sameerasw/essentials/utils/BiometricSecurityHelper.kt rename to app/src/main/java/com/sameerasw/essentials/utils/security/BiometricSecurityHelper.kt index 4ce37f094..4718fa372 100644 --- a/app/src/main/java/com/sameerasw/essentials/utils/BiometricSecurityHelper.kt +++ b/app/src/main/java/com/sameerasw/essentials/utils/security/BiometricSecurityHelper.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Utilities - Security + * File: BiometricSecurityHelper.kt + * Description: Utility helper for BiometricSecurityHelper.kt. + */ + package com.sameerasw.essentials.utils import androidx.fragment.app.FragmentActivity diff --git a/app/src/main/java/com/sameerasw/essentials/utils/DeviceLockUtils.kt b/app/src/main/java/com/sameerasw/essentials/utils/security/DeviceLockUtils.kt similarity index 95% rename from app/src/main/java/com/sameerasw/essentials/utils/DeviceLockUtils.kt rename to app/src/main/java/com/sameerasw/essentials/utils/security/DeviceLockUtils.kt index 486654558..256db67cd 100644 --- a/app/src/main/java/com/sameerasw/essentials/utils/DeviceLockUtils.kt +++ b/app/src/main/java/com/sameerasw/essentials/utils/security/DeviceLockUtils.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Security Utilities + * File: DeviceLockUtils.kt + * Description: Utility for locking the device screen programmatically. + */ + package com.sameerasw.essentials.utils import android.accessibilityservice.AccessibilityService diff --git a/app/src/main/java/com/sameerasw/essentials/utils/RootUtils.kt b/app/src/main/java/com/sameerasw/essentials/utils/security/RootUtils.kt similarity index 88% rename from app/src/main/java/com/sameerasw/essentials/utils/RootUtils.kt rename to app/src/main/java/com/sameerasw/essentials/utils/security/RootUtils.kt index b6e590f6d..1ad7961b1 100644 --- a/app/src/main/java/com/sameerasw/essentials/utils/RootUtils.kt +++ b/app/src/main/java/com/sameerasw/essentials/utils/security/RootUtils.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Security Utilities + * File: RootUtils.kt + * Description: Helper methods for executing root shell actions and verifying superuser access. + */ + package com.sameerasw.essentials.utils import java.io.DataOutputStream diff --git a/app/src/main/java/com/sameerasw/essentials/utils/ShizukuUtils.kt b/app/src/main/java/com/sameerasw/essentials/utils/security/ShizukuUtils.kt similarity index 92% rename from app/src/main/java/com/sameerasw/essentials/utils/ShizukuUtils.kt rename to app/src/main/java/com/sameerasw/essentials/utils/security/ShizukuUtils.kt index f3c06ed18..5b65df618 100644 --- a/app/src/main/java/com/sameerasw/essentials/utils/ShizukuUtils.kt +++ b/app/src/main/java/com/sameerasw/essentials/utils/security/ShizukuUtils.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Security Utilities + * File: ShizukuUtils.kt + * Description: Wrapper utility for interacting with Shizuku binder and privileged commands. + */ + package com.sameerasw.essentials.utils import android.content.pm.PackageManager @@ -123,7 +132,8 @@ object ShizukuUtils { } fun stopShizuku(context: android.content.Context) { - val settingsRepository = com.sameerasw.essentials.data.repository.SettingsRepository(context) + val settingsRepository = + com.sameerasw.essentials.data.repository.SettingsRepository(context) val token = settingsRepository.getShizukuAuthToken() if (token.isEmpty()) { android.util.Log.w("ShizukuUtils", "Shizuku auth token is missing, cannot stop Shizuku") diff --git a/app/src/main/java/com/sameerasw/essentials/utils/AmbientMusicShapeHelper.kt b/app/src/main/java/com/sameerasw/essentials/utils/ui/AmbientMusicShapeHelper.kt similarity index 94% rename from app/src/main/java/com/sameerasw/essentials/utils/AmbientMusicShapeHelper.kt rename to app/src/main/java/com/sameerasw/essentials/utils/ui/AmbientMusicShapeHelper.kt index 5beed7e22..4c692efb5 100644 --- a/app/src/main/java/com/sameerasw/essentials/utils/AmbientMusicShapeHelper.kt +++ b/app/src/main/java/com/sameerasw/essentials/utils/ui/AmbientMusicShapeHelper.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Utilities - Ui + * File: AmbientMusicShapeHelper.kt + * Description: Utility helper for AmbientMusicShapeHelper.kt. + */ + package com.sameerasw.essentials.utils import android.graphics.Path diff --git a/app/src/main/java/com/sameerasw/essentials/utils/ColorFormatUtils.kt b/app/src/main/java/com/sameerasw/essentials/utils/ui/ColorFormatUtils.kt similarity index 84% rename from app/src/main/java/com/sameerasw/essentials/utils/ColorFormatUtils.kt rename to app/src/main/java/com/sameerasw/essentials/utils/ui/ColorFormatUtils.kt index cea5606d7..d32574e09 100644 --- a/app/src/main/java/com/sameerasw/essentials/utils/ColorFormatUtils.kt +++ b/app/src/main/java/com/sameerasw/essentials/utils/ui/ColorFormatUtils.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Utilities + * File: ColorFormatUtils.kt + * Description: Utility methods for formatting ARGB and HEX color codes. + */ + package com.sameerasw.essentials.utils import android.graphics.Color diff --git a/app/src/main/java/com/sameerasw/essentials/utils/ColorUtil.kt b/app/src/main/java/com/sameerasw/essentials/utils/ui/ColorUtil.kt similarity index 88% rename from app/src/main/java/com/sameerasw/essentials/utils/ColorUtil.kt rename to app/src/main/java/com/sameerasw/essentials/utils/ui/ColorUtil.kt index 0afe81436..036ee3a02 100644 --- a/app/src/main/java/com/sameerasw/essentials/utils/ColorUtil.kt +++ b/app/src/main/java/com/sameerasw/essentials/utils/ui/ColorUtil.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Utilities + * File: ColorUtil.kt + * Description: Generates pastel background and vibrant icon tint pairs. + */ + package com.sameerasw.essentials.utils import androidx.compose.ui.graphics.Color diff --git a/app/src/main/java/com/sameerasw/essentials/utils/DeviceImageMapper.kt b/app/src/main/java/com/sameerasw/essentials/utils/ui/DeviceImageMapper.kt similarity index 83% rename from app/src/main/java/com/sameerasw/essentials/utils/DeviceImageMapper.kt rename to app/src/main/java/com/sameerasw/essentials/utils/ui/DeviceImageMapper.kt index abc0c0164..64cad9f0b 100644 --- a/app/src/main/java/com/sameerasw/essentials/utils/DeviceImageMapper.kt +++ b/app/src/main/java/com/sameerasw/essentials/utils/ui/DeviceImageMapper.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Utilities + * File: DeviceImageMapper.kt + * Description: Maps device model codenames to hero device image assets. + */ + package com.sameerasw.essentials.utils import com.sameerasw.essentials.R diff --git a/app/src/main/java/com/sameerasw/essentials/utils/HapticFeedbackUtils.kt b/app/src/main/java/com/sameerasw/essentials/utils/ui/HapticFeedbackUtils.kt similarity index 89% rename from app/src/main/java/com/sameerasw/essentials/utils/HapticFeedbackUtils.kt rename to app/src/main/java/com/sameerasw/essentials/utils/ui/HapticFeedbackUtils.kt index d2892e6a2..cff19d40b 100644 --- a/app/src/main/java/com/sameerasw/essentials/utils/HapticFeedbackUtils.kt +++ b/app/src/main/java/com/sameerasw/essentials/utils/ui/HapticFeedbackUtils.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Utilities - Ui + * File: HapticFeedbackUtils.kt + * Description: Utility helper for HapticFeedbackUtils.kt. + */ + package com.sameerasw.essentials.utils import android.Manifest diff --git a/app/src/main/java/com/sameerasw/essentials/utils/HapticUtil.kt b/app/src/main/java/com/sameerasw/essentials/utils/ui/HapticUtil.kt similarity index 96% rename from app/src/main/java/com/sameerasw/essentials/utils/HapticUtil.kt rename to app/src/main/java/com/sameerasw/essentials/utils/ui/HapticUtil.kt index 35b38ecc0..577a55a9c 100644 --- a/app/src/main/java/com/sameerasw/essentials/utils/HapticUtil.kt +++ b/app/src/main/java/com/sameerasw/essentials/utils/ui/HapticUtil.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Utilities + * File: HapticUtil.kt + * Description: Provides haptic feedback helpers using HapticFeedbackType preferences. + */ + package com.sameerasw.essentials.utils import android.content.Context diff --git a/app/src/main/java/com/sameerasw/essentials/utils/PermissionUIHelper.kt b/app/src/main/java/com/sameerasw/essentials/utils/ui/PermissionUIHelper.kt similarity index 98% rename from app/src/main/java/com/sameerasw/essentials/utils/PermissionUIHelper.kt rename to app/src/main/java/com/sameerasw/essentials/utils/ui/PermissionUIHelper.kt index 98070a4fd..1b7f8d319 100644 --- a/app/src/main/java/com/sameerasw/essentials/utils/PermissionUIHelper.kt +++ b/app/src/main/java/com/sameerasw/essentials/utils/ui/PermissionUIHelper.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: UI Utilities + * File: PermissionUIHelper.kt + * Description: Renders permission guidance dialogs and bottom sheets. + */ + package com.sameerasw.essentials.utils import android.app.Activity @@ -11,7 +20,7 @@ import android.provider.Settings import androidx.core.app.ActivityCompat import com.sameerasw.essentials.R import com.sameerasw.essentials.domain.registry.PermissionRegistry -import com.sameerasw.essentials.ui.components.sheets.PermissionItem +import com.sameerasw.essentials.ui.core.sheets.PermissionItem import com.sameerasw.essentials.viewmodels.MainViewModel object PermissionUIHelper { diff --git a/app/src/main/java/com/sameerasw/essentials/viewmodels/AppUpdatesViewModel.kt b/app/src/main/java/com/sameerasw/essentials/viewmodels/AppUpdatesViewModel.kt index d1c12af7d..463314910 100644 --- a/app/src/main/java/com/sameerasw/essentials/viewmodels/AppUpdatesViewModel.kt +++ b/app/src/main/java/com/sameerasw/essentials/viewmodels/AppUpdatesViewModel.kt @@ -1,3 +1,13 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: App Updates & Release Tracking + * File: AppUpdatesViewModel.kt + * Description: ViewModel managing GitHub repository tracking, update notifications, + * release downloads, and in-app APK installation triggers. + */ + package com.sameerasw.essentials.viewmodels import android.content.Context @@ -78,6 +88,11 @@ class AppUpdatesViewModel : ViewModel() { private val _selectedApkName = mutableStateOf("Auto") val selectedApkName: State = _selectedApkName + /** + * Executes the set selected apk name operation. + * + * @param name [String] Target name. + */ fun setSelectedApkName(name: String) { _selectedApkName.value = name } @@ -88,15 +103,30 @@ class AppUpdatesViewModel : ViewModel() { private val _installStatus = mutableStateOf(null) val installStatus: State = _installStatus + /** + * Executes the on search query changed operation. + * + * @param query [String] Target query. + */ fun onSearchQueryChanged(query: String) { _searchQuery.value = query _errorMessage.value = null } + /** + * Executes the on app selected operation. + * + * @param app [NotificationApp?] Target app. + */ fun onAppSelected(app: NotificationApp?) { _selectedApp.value = app } + /** + * Executes the load tracked repos operation. + * + * @param context [Context] Target context. + */ fun loadTrackedRepos(context: Context) { _isLoading.value = true viewModelScope.launch { @@ -105,6 +135,11 @@ class AppUpdatesViewModel : ViewModel() { } } + /** + * Executes the search repo operation. + * + * @param context [Context] Target context. + */ fun searchRepo(context: Context) { val query = _searchQuery.value.trim() if (query.isEmpty()) return @@ -174,6 +209,12 @@ class AppUpdatesViewModel : ViewModel() { } } + /** + * Executes the track repo operation. + * + * @param context [Context] Target context. + * @param selectedApk [String] Target selected apk. + */ fun trackRepo(context: Context, selectedApk: String) { val repo = _searchResult.value ?: return val release = _latestRelease.value ?: return @@ -205,11 +246,23 @@ class AppUpdatesViewModel : ViewModel() { clearSearch() } + /** + * Executes the untrack repo operation. + * + * @param context [Context] Target context. + * @param fullName [String] Target full name. + */ fun untrackRepo(context: Context, fullName: String) { SettingsRepository(context).removeTrackedRepo(fullName) loadTrackedRepos(context) } + /** + * Executes the prepare edit operation. + * + * @param context [Context] Target context. + * @param repo [TrackedRepo] Target repo. + */ fun prepareEdit(context: Context, repo: TrackedRepo) { _searchQuery.value = repo.fullName _isSearching.value = false @@ -319,6 +372,9 @@ class AppUpdatesViewModel : ViewModel() { return null } + /** + * Executes the clear search operation. + */ fun clearSearch() { _searchQuery.value = "" _searchResult.value = null @@ -330,22 +386,44 @@ class AppUpdatesViewModel : ViewModel() { _selectedApkName.value = "Auto" } + /** + * Executes the clear error operation. + */ fun clearError() { _errorMessage.value = null } + /** + * Executes the consume dismiss signal operation. + */ fun consumeDismissSignal() { _shouldDismissSheet.value = false } + /** + * Executes the set allow pre releases operation. + * + * @param allow [Boolean] Target allow. + */ fun setAllowPreReleases(allow: Boolean) { _allowPreReleases.value = allow } + /** + * Executes the set notifications enabled operation. + * + * @param enabled [Boolean] Target enabled. + */ fun setNotificationsEnabled(enabled: Boolean) { _notificationsEnabled.value = enabled } + /** + * Executes the fetch release notes if needed operation. + * + * @param context [Context] Target context. + * @param repo [TrackedRepo] Target repo. + */ fun fetchReleaseNotesIfNeeded(context: Context, repo: TrackedRepo) { if (!repo.latestReleaseBody.isNullOrBlank()) return @@ -385,6 +463,11 @@ class AppUpdatesViewModel : ViewModel() { } } + /** + * Executes the check for updates operation. + * + * @param context [Context] Target context. + */ fun checkForUpdates(context: Context) { if (_trackedRepos.value.isEmpty()) return @@ -478,6 +561,12 @@ class AppUpdatesViewModel : ViewModel() { return 0 } + /** + * Executes the download and install operation. + * + * @param context [Context] Target context. + * @param repo [TrackedRepo] Target repo. + */ fun downloadAndInstall(context: Context, repo: TrackedRepo) { val downloadUrl = repo.downloadUrl ?: return _installingRepoId.value = repo.fullName @@ -559,6 +648,12 @@ class AppUpdatesViewModel : ViewModel() { } } + /** + * Executes the export tracked repos operation. + * + * @param context [Context] Target context. + * @param outputStream [OutputStream] Target output stream. + */ fun exportTrackedRepos(context: Context, outputStream: OutputStream) { try { val repos = SettingsRepository(context).getTrackedRepos() @@ -575,6 +670,13 @@ class AppUpdatesViewModel : ViewModel() { } } + /** + * Executes the import tracked repos operation. + * + * @param context [Context] Target context. + * @param inputStream [InputStream] Target input stream. + * @return The resulting Boolean data. + */ fun importTrackedRepos(context: Context, inputStream: InputStream): Boolean { return try { val json = inputStream.bufferedReader().use { it.readText() } diff --git a/app/src/main/java/com/sameerasw/essentials/viewmodels/BatteryViewModel.kt b/app/src/main/java/com/sameerasw/essentials/viewmodels/BatteryViewModel.kt new file mode 100644 index 000000000..f2bf967ec --- /dev/null +++ b/app/src/main/java/com/sameerasw/essentials/viewmodels/BatteryViewModel.kt @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Battery & Power Management + * File: BatteryViewModel.kt + * Description: ViewModel managing state for battery statistics, charging history, + * ring drawer overlays, and power saving notification toggles. + */ + +package com.sameerasw.essentials.viewmodels + +import android.content.Context +import androidx.compose.runtime.mutableStateOf +import androidx.lifecycle.ViewModel +import com.sameerasw.essentials.data.repository.SettingsRepository +import com.sameerasw.essentials.utils.battery.BatteryInfoUtil + +class BatteryViewModel : ViewModel() { + val isBatteryNotificationEnabled = mutableStateOf(false) + val isMapsPowerSavingEnabled = mutableStateOf(false) + val isChargeQuickTileActive = mutableStateOf(false) + val batteryPercentage = mutableStateOf(0) + val isCharging = mutableStateOf(false) + + /** + * Initializes battery settings and updates state. + * + * @param context [Context] Application context used for checking battery info and settings. + */ + fun loadBatteryState(context: Context) { + val repo = SettingsRepository(context) + isBatteryNotificationEnabled.value = repo.isBatteryNotificationEnabled() + isMapsPowerSavingEnabled.value = repo.getBoolean("maps_power_saving_enabled", false) + + val details = BatteryInfoUtil.getBasicDetails(context) + batteryPercentage.value = details.level + isCharging.value = + details.plugged != 0 || details.status == android.os.BatteryManager.BATTERY_STATUS_CHARGING + } + + /** + * Updates power saving toggle for Maps navigation. + * + * @param context [Context] Application context for persistence. + * @param enabled [Boolean] True if maps power saving mode should be active. + */ + fun setMapsPowerSavingEnabled(context: Context, enabled: Boolean) { + isMapsPowerSavingEnabled.value = enabled + SettingsRepository(context).putBoolean("maps_power_saving_enabled", enabled) + } +} diff --git a/app/src/main/java/com/sameerasw/essentials/viewmodels/CaffeinateViewModel.kt b/app/src/main/java/com/sameerasw/essentials/viewmodels/CaffeinateViewModel.kt index 1f6a25875..787eedd22 100644 --- a/app/src/main/java/com/sameerasw/essentials/viewmodels/CaffeinateViewModel.kt +++ b/app/src/main/java/com/sameerasw/essentials/viewmodels/CaffeinateViewModel.kt @@ -1,3 +1,13 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Screen Awake / Caffeinate + * File: CaffeinateViewModel.kt + * Description: ViewModel managing display awake timers, wake lock background service triggers, + * and timeout preset configurations. + */ + package com.sameerasw.essentials.viewmodels import android.Manifest diff --git a/app/src/main/java/com/sameerasw/essentials/viewmodels/DIYViewModel.kt b/app/src/main/java/com/sameerasw/essentials/viewmodels/DIYViewModel.kt index a9b070567..8725e373c 100644 --- a/app/src/main/java/com/sameerasw/essentials/viewmodels/DIYViewModel.kt +++ b/app/src/main/java/com/sameerasw/essentials/viewmodels/DIYViewModel.kt @@ -1,12 +1,22 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Automation & DIY Rules + * File: DIYViewModel.kt + * Description: ViewModel managing custom triggers, system actions, AI automation suggestions, + * and rule persistent storage. + */ + package com.sameerasw.essentials.viewmodels import android.app.Application import android.content.Context import androidx.lifecycle.AndroidViewModel import androidx.lifecycle.viewModelScope -import com.sameerasw.essentials.domain.diy.DIYRepository import com.sameerasw.essentials.domain.diy.Action import com.sameerasw.essentials.domain.diy.Automation +import com.sameerasw.essentials.domain.diy.DIYRepository import com.sameerasw.essentials.domain.diy.State import com.sameerasw.essentials.domain.diy.Trigger import com.sameerasw.essentials.domain.genai.AutomationSuggestion @@ -42,16 +52,32 @@ class DIYViewModel(application: Application) : AndroidViewModel(application) { initialValue = emptyList() ) + /** + * Executes the delete automation operation. + * + * @param id [String] Target id. + */ fun deleteAutomation(id: String) { repository.removeAutomation(id) } + /** + * Executes the toggle automation operation. + * + * @param id [String] Target id. + */ fun toggleAutomation(id: String) { repository.getAutomation(id)?.let { automation -> repository.updateAutomation(automation.copy(isEnabled = !automation.isEnabled)) } } + /** + * Executes the request gen ai suggestion operation. + * + * @param description [String] Target description. + * @param context [Context?] Target context. + */ fun requestGenAISuggestion(description: String, context: Context? = null) { viewModelScope.launch { _genAIState.value = GenAIState.Loading @@ -64,10 +90,18 @@ class DIYViewModel(application: Application) : AndroidViewModel(application) { } } + /** + * Executes the dismiss gen ai suggestion operation. + */ fun dismissGenAISuggestion() { _genAIState.value = GenAIState.Idle } + /** + * Executes the confirm gen ai suggestion operation. + * + * @param suggestion [AutomationSuggestion] Target suggestion. + */ fun confirmGenAISuggestion(suggestion: AutomationSuggestion) { val automation = mapSuggestionToAutomation(suggestion) repository.addAutomation(automation) @@ -92,6 +126,7 @@ class DIYViewModel(application: Application) : AndroidViewModel(application) { hour = suggestion.hour ?: 0, minute = suggestion.minute ?: 0 ) + "BluetoothConnected" -> Trigger.BluetoothConnected() "BluetoothDisconnected" -> Trigger.BluetoothDisconnected() "WifiConnected" -> Trigger.WifiConnected() @@ -108,6 +143,7 @@ class DIYViewModel(application: Application) : AndroidViewModel(application) { endHour = suggestion.endHour ?: 0, endMinute = suggestion.endMinute ?: 0 ) + else -> if (type == Automation.Type.STATE) State.Charging else null } @@ -122,6 +158,7 @@ class DIYViewModel(application: Application) : AndroidViewModel(application) { "DimWallpaper" -> Action.DimWallpaper( dimAmount = suggestion.dimWallpaperAmount ?: 0.5f ) + "DeviceEffects" -> Action.DeviceEffects() "SoundMode" -> { val mode = when (suggestion.soundMode?.uppercase()) { @@ -131,6 +168,7 @@ class DIYViewModel(application: Application) : AndroidViewModel(application) { } Action.SoundMode(mode = mode) } + "TurnOnLowPower" -> Action.TurnOnLowPower "TurnOffLowPower" -> Action.TurnOffLowPower "ScreenOff" -> Action.ScreenOff() @@ -157,10 +195,12 @@ class DIYViewModel(application: Application) : AndroidViewModel(application) { changeSmartPixels = suggestion.smartPixelsEnabled != null, smartPixelsEnabled = suggestion.smartPixelsEnabled ?: true ) + "FreezeTag" -> Action.FreezeTag( mode = suggestion.freezeTagMode ?: "Freeze", tagIds = suggestion.freezeTagIds ) + else -> null } } diff --git a/app/src/main/java/com/sameerasw/essentials/viewmodels/GitHubAuthViewModel.kt b/app/src/main/java/com/sameerasw/essentials/viewmodels/GitHubAuthViewModel.kt index 9ededed48..a3600c7ac 100644 --- a/app/src/main/java/com/sameerasw/essentials/viewmodels/GitHubAuthViewModel.kt +++ b/app/src/main/java/com/sameerasw/essentials/viewmodels/GitHubAuthViewModel.kt @@ -1,3 +1,13 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: GitHub OAuth Authentication + * File: GitHubAuthViewModel.kt + * Description: ViewModel managing GitHub OAuth device flow, access token storage, + * and user profile synchronization. + */ + package com.sameerasw.essentials.viewmodels import android.content.Context diff --git a/app/src/main/java/com/sameerasw/essentials/viewmodels/LocationReachedViewModel.kt b/app/src/main/java/com/sameerasw/essentials/viewmodels/LocationReachedViewModel.kt index 515df2748..581fba026 100644 --- a/app/src/main/java/com/sameerasw/essentials/viewmodels/LocationReachedViewModel.kt +++ b/app/src/main/java/com/sameerasw/essentials/viewmodels/LocationReachedViewModel.kt @@ -1,3 +1,13 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Location Alarms & Geofencing + * File: LocationReachedViewModel.kt + * Description: ViewModel managing destination geofencing alarms, GPS location tracking, + * and background alarm service triggers. + */ + package com.sameerasw.essentials.viewmodels import android.app.Application @@ -96,14 +106,29 @@ class LocationReachedViewModel(application: Application) : AndroidViewModel(appl } } + /** + * Executes the set show bottom sheet operation. + * + * @param show [Boolean] Target show. + */ fun setShowBottomSheet(show: Boolean) { repository.setShowBottomSheet(show) } + /** + * Executes the set temp alarm operation. + * + * @param alarm [LocationAlarm?] Target alarm. + */ fun setTempAlarm(alarm: LocationAlarm?) { repository.setTempAlarm(alarm) } + /** + * Executes the save alarm operation. + * + * @param alarm [LocationAlarm] Target alarm. + */ fun saveAlarm(alarm: LocationAlarm) { val currentList = savedAlarms.value.toMutableList() val index = currentList.indexOfFirst { it.id == alarm.id } @@ -117,6 +142,11 @@ class LocationReachedViewModel(application: Application) : AndroidViewModel(appl repository.setTempAlarm(null) } + /** + * Executes the delete alarm operation. + * + * @param alarmId [String] Target alarm id. + */ fun deleteAlarm(alarmId: String) { if (activeAlarmId.value == alarmId) { stopTracking() @@ -125,6 +155,11 @@ class LocationReachedViewModel(application: Application) : AndroidViewModel(appl repository.saveAlarms(currentList) } + /** + * Executes the start tracking operation. + * + * @param alarmId [String] Target alarm id. + */ fun startTracking(alarmId: String) { val alarm = savedAlarms.value.find { it.id == alarmId } ?: return @@ -159,6 +194,9 @@ class LocationReachedViewModel(application: Application) : AndroidViewModel(appl repository.saveLastTrip(null) } + /** + * Executes the stop tracking operation. + */ fun stopTracking() { val id = activeAlarmId.value ?: return val alarm = savedAlarms.value.find { it.id == id } @@ -180,6 +218,9 @@ class LocationReachedViewModel(application: Application) : AndroidViewModel(appl startTime.value = 0L } + /** + * Executes the pause tracking operation. + */ fun pauseTracking() { val id = activeAlarmId.value ?: return val intent = Intent(getApplication(), LocationReachedService::class.java).apply { @@ -189,6 +230,9 @@ class LocationReachedViewModel(application: Application) : AndroidViewModel(appl repository.updatePausedState(id, true) } + /** + * Executes the resume tracking operation. + */ fun resumeTracking() { val id = activeAlarmId.value ?: return val intent = Intent(getApplication(), LocationReachedService::class.java).apply { @@ -201,6 +245,9 @@ class LocationReachedViewModel(application: Application) : AndroidViewModel(appl private var distanceTrackingJob: kotlinx.coroutines.Job? = null + /** + * Executes the start ui tracking operation. + */ fun startUiTracking() { if (distanceTrackingJob?.isActive == true) return @@ -216,6 +263,9 @@ class LocationReachedViewModel(application: Application) : AndroidViewModel(appl } } + /** + * Executes the stop ui tracking operation. + */ fun stopUiTracking() { distanceTrackingJob?.cancel() distanceTrackingJob = null @@ -227,6 +277,9 @@ class LocationReachedViewModel(application: Application) : AndroidViewModel(appl } @android.annotation.SuppressLint("MissingPermission") + /** + * Executes the update current distance operation. + */ fun updateCurrentDistance() { val id = activeAlarmId.value val activeAlarm = savedAlarms.value.find { it.id == id } ?: tempAlarm.value ?: return @@ -266,6 +319,15 @@ class LocationReachedViewModel(application: Application) : AndroidViewModel(appl remainingTimeMinutes.value = (remainingMillis / 60000).toInt().coerceAtLeast(1) } + /** + * Executes the calculate distance operation. + * + * @param lat1 [Double] Target lat1. + * @param lon1 [Double] Target lon1. + * @param lat2 [Double] Target lat2. + * @param lon2 [Double] Target lon2. + * @return The resulting Float data. + */ fun calculateDistance(lat1: Double, lon1: Double, lat2: Double, lon2: Double): Float { val r = 6371e3 // Earth's radius in meters val phi1 = lat1 * PI / 180 @@ -281,6 +343,12 @@ class LocationReachedViewModel(application: Application) : AndroidViewModel(appl return (r * c).toFloat() } + /** + * Executes the handle intent operation. + * + * @param intent [Intent] Target intent. + * @return The resulting Boolean data. + */ fun handleIntent(intent: Intent): Boolean { val action = intent.action val type = intent.type diff --git a/app/src/main/java/com/sameerasw/essentials/viewmodels/MainViewModel.kt b/app/src/main/java/com/sameerasw/essentials/viewmodels/MainViewModel.kt index a9d46a08f..bdc3a1a89 100644 --- a/app/src/main/java/com/sameerasw/essentials/viewmodels/MainViewModel.kt +++ b/app/src/main/java/com/sameerasw/essentials/viewmodels/MainViewModel.kt @@ -1,3 +1,12 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Viewmodels + * File: MainViewModel.kt + * Description: Component file for MainViewModel.kt. + */ + package com.sameerasw.essentials.viewmodels import android.Manifest @@ -450,8 +459,10 @@ class MainViewModel : ViewModel() { SettingsRepository.KEY_DYNAMIC_NIGHT_LIGHT_ENABLED -> isDynamicNightLightEnabled.value = settingsRepository.getBoolean(key) + SettingsRepository.KEY_SMART_PIXELS_ENABLED -> isSmartPixelsEnabled.value = settingsRepository.getBoolean(key) + SettingsRepository.KEY_SMART_PIXELS_INTENSITY -> smartPixelsIntensity.floatValue = settingsRepository.getFloat(key, 50f) @@ -866,26 +877,50 @@ class MainViewModel : ViewModel() { } } + /** + * Updates the Sentry crash and feedback reporting mode preference. + * + * @param mode [String] Desired report mode ("automatic", "manual", or "disabled"). + * @param context [Context] Application context for settings persistence. + */ fun setSentryReportMode(mode: String, context: Context) { sentryReportMode.value = mode settingsRepository.putString(SettingsRepository.KEY_SENTRY_REPORT_MODE, mode) } + /** + * Applies and updates the application-wide display language locale. + * + * @param languageCode [String] BCP-47 language tag (e.g., "en", "si", "de"). + */ fun setAppLanguage(languageCode: String) { appLanguage.value = languageCode val appLocale: LocaleListCompat = LocaleListCompat.forLanguageTags(languageCode) AppCompatDelegate.setApplicationLocales(appLocale) } + /** + * Loads saved ShutUp per-app media ducking and mute configurations from persistent storage. + */ fun loadShutUpConfigs() { shutUpConfigs.value = settingsRepository.loadShutUpConfigs() } + /** + * Updates ducking or mute configuration for a specific target package. + * + * @param config [com.sameerasw.essentials.domain.model.ShutUpAppConfig] The updated ShutUpAppConfig object to store. + */ fun updateShutUpConfig(config: com.sameerasw.essentials.domain.model.ShutUpAppConfig) { settingsRepository.updateShutUpConfig(config) loadShutUpConfigs() } + /** + * Executes the remove shut up config operation. + * + * @param packageName [String] Target package name. + */ fun removeShutUpConfig(packageName: String) { val current = shutUpConfigs.value.toMutableList() current.removeAll { it.packageName == packageName } @@ -893,26 +928,52 @@ class MainViewModel : ViewModel() { loadShutUpConfigs() } + /** + * Executes the set shut up attempt shizuku restart enabled operation. + * + * @param enabled [Boolean] Target enabled. + */ fun setShutUpAttemptShizukuRestartEnabled(enabled: Boolean) { isShutUpAttemptShizukuRestart.value = enabled settingsRepository.setShutUpAttemptShizukuRestartEnabled(enabled) } + /** + * Executes the set shut up restore delay operation. + * + * @param delaySeconds [Int] Target delay seconds. + */ fun setShutUpRestoreDelay(delaySeconds: Int) { shutUpRestoreDelay.intValue = delaySeconds settingsRepository.setShutUpRestoreDelay(delaySeconds) } + /** + * Executes the set shut up restore mode operation. + * + * @param mode [String] Target mode. + */ fun setShutUpRestoreMode(mode: String) { shutUpRestoreMode.value = mode settingsRepository.setShutUpRestoreMode(mode) } + /** + * Executes the set shizuku auth token operation. + * + * @param token [String] Target token. + */ fun setShizukuAuthToken(token: String) { shizukuAuthToken.value = token settingsRepository.setShizukuAuthToken(token) } + /** + * Executes the save shut up selected apps operation. + * + * @param context [Context] Target context. + * @param apps [List] Target apps. + */ fun saveShutUpSelectedApps(context: Context, apps: List) { val currentConfigs = settingsRepository.loadShutUpConfigs().associateBy { it.packageName } val newConfigs = apps.filter { it.isEnabled }.map { @@ -965,6 +1026,11 @@ class MainViewModel : ViewModel() { } } + /** + * Executes the check operation. + * + * @param context [Context] Target context. + */ fun check(context: Context) { appContext = context.applicationContext settingsRepository = SettingsRepository(context) @@ -1034,7 +1100,10 @@ class MainViewModel : ViewModel() { isMobileDataAlwaysOnEnabled.value = settingsRepository.getBoolean(SettingsRepository.KEY_MOBILE_DATA_ALWAYS_ON, false) isWirelessDisplayCertificationEnabled.value = - settingsRepository.getBoolean(SettingsRepository.KEY_WIRELESS_DISPLAY_CERTIFICATION, false) + settingsRepository.getBoolean( + SettingsRepository.KEY_WIRELESS_DISPLAY_CERTIFICATION, + false + ) isTransparentNavigationBarEnabled.value = settingsRepository.getBoolean(SettingsRepository.KEY_TRANSPARENT_NAVIGATION_BAR, false) isPreferGpuComposingEnabled.value = @@ -1628,7 +1697,10 @@ class MainViewModel : ViewModel() { freezeTags.value = settingsRepository.getFreezeTags() freezeAppTagMap.value = settingsRepository.getFreezeAppTagMap() isFreezeTagColorCodedEnabled.value = - settingsRepository.getBoolean(SettingsRepository.KEY_FREEZE_TAG_COLOR_CODED_ENABLED, false) + settingsRepository.getBoolean( + SettingsRepository.KEY_FREEZE_TAG_COLOR_CODED_ENABLED, + false + ) // Sync PackageManager component enabled state on startup val showLauncher = isFreezeShowInLauncherEnabled.value @@ -1737,6 +1809,12 @@ class MainViewModel : ViewModel() { context.stopService(intent) } + /** + * Executes the set battery notification enabled operation. + * + * @param enabled [Boolean] Target enabled. + * @param context [Context] Target context. + */ fun setBatteryNotificationEnabled(enabled: Boolean, context: Context) { isBatteryNotificationEnabled.value = enabled settingsRepository.setBatteryNotificationEnabled(enabled) @@ -1747,6 +1825,12 @@ class MainViewModel : ViewModel() { } } + /** + * Executes the set enable unsupported features operation. + * + * @param enabled [Boolean] Target enabled. + * @param context [Context] Target context. + */ fun setEnableUnsupportedFeatures(enabled: Boolean, context: Context) { isEnableUnsupportedFeatures.value = enabled settingsRepository.setEnableUnsupportedFeatures(enabled) @@ -1755,6 +1839,12 @@ class MainViewModel : ViewModel() { } } + /** + * Executes the on search query changed operation. + * + * @param query [String] Target query. + * @param context [Context] Target context. + */ fun onSearchQueryChanged(query: String, context: Context) { searchQuery.value = query searchJob?.cancel() @@ -1780,6 +1870,11 @@ class MainViewModel : ViewModel() { } } + /** + * Executes the add recent search operation. + * + * @param item [SearchableItem] Target item. + */ fun addRecentSearch(item: SearchableItem) { val current = recentSearches.value.toMutableList() // Remove existing to move to top @@ -1791,11 +1886,19 @@ class MainViewModel : ViewModel() { settingsRepository.saveRecentSearches(limited) } + /** + * Executes the clear recent searches operation. + */ fun clearRecentSearches() { recentSearches.value = emptyList() settingsRepository.saveRecentSearches(emptyList()) } + /** + * Executes the toggle pin feature operation. + * + * @param featureId [String] Target feature id. + */ fun togglePinFeature(featureId: String) { val current = pinnedFeatureKeys.value.toMutableList() if (current.contains(featureId)) { @@ -1815,6 +1918,11 @@ class MainViewModel : ViewModel() { } } + /** + * Executes the toggle pin qs tile operation. + * + * @param serviceClassName [String] Target service class name. + */ fun togglePinQsTile(serviceClassName: String) { val current = pinnedQsTileKeys.value.toMutableList() if (current.contains(serviceClassName)) { @@ -1833,32 +1941,67 @@ class MainViewModel : ViewModel() { } } + /** + * Executes the set auto update enabled operation. + * + * @param enabled [Boolean] Target enabled. + * @param context [Context] Target context. + */ fun setAutoUpdateEnabled(enabled: Boolean, context: Context) { isAutoUpdateEnabled.value = enabled settingsRepository.putBoolean(SettingsRepository.KEY_AUTO_UPDATE_ENABLED, enabled) } + /** + * Executes the set gen ai automation enabled operation. + * + * @param enabled [Boolean] Target enabled. + * @param context [Context] Target context. + */ fun setGenAIAutomationEnabled(enabled: Boolean, context: Context) { isGenAIAutomationEnabled.value = enabled settingsRepository.putBoolean(SettingsRepository.KEY_GENAI_AUTOMATION_ENABLED, enabled) } + /** + * Executes the set update notification enabled operation. + * + * @param enabled [Boolean] Target enabled. + * @param context [Context] Target context. + */ fun setUpdateNotificationEnabled(enabled: Boolean, context: Context) { isUpdateNotificationEnabled.value = enabled settingsRepository.putBoolean(SettingsRepository.KEY_UPDATE_NOTIFICATION_ENABLED, enabled) } + /** + * Executes the set pre release check enabled operation. + * + * @param enabled [Boolean] Target enabled. + * @param context [Context] Target context. + */ fun setPreReleaseCheckEnabled(enabled: Boolean, context: Context) { isPreReleaseCheckEnabled.value = enabled settingsRepository.putBoolean(SettingsRepository.KEY_CHECK_PRE_RELEASES_ENABLED, enabled) } + /** + * Executes the set developer mode enabled operation. + * + * @param enabled [Boolean] Target enabled. + * @param context [Context] Target context. + */ fun setDeveloperModeEnabled(enabled: Boolean, context: Context) { isDeveloperModeEnabled.value = enabled settingsRepository.putBoolean(SettingsRepository.KEY_DEVELOPER_MODE_ENABLED, enabled) } + /** + * Executes the start workflow auth flow operation. + * + * @param context [Context] Target context. + */ fun startWorkflowAuthFlow(context: Context) { workflowAuthState.value = com.sameerasw.essentials.viewmodels.AuthState.Loading viewModelScope.launch { @@ -1926,11 +2069,19 @@ class MainViewModel : ViewModel() { } } + /** + * Executes the cancel workflow auth flow operation. + */ fun cancelWorkflowAuthFlow() { workflowPollingJob?.cancel() workflowAuthState.value = com.sameerasw.essentials.viewmodels.AuthState.Idle } + /** + * Executes the trigger wallpaper update operation. + * + * @param target [String] Target target. + */ fun triggerWallpaperUpdate(target: String) { val token = settingsRepository.getGitHubWorkflowToken() ?: return wallpaperTriggerState.value = "loading" @@ -1954,27 +2105,56 @@ class MainViewModel : ViewModel() { } } + /** + * Executes the set root enabled operation. + * + * @param enabled [Boolean] Target enabled. + * @param context [Context] Target context. + */ fun setRootEnabled(enabled: Boolean, context: Context) { settingsRepository.putBoolean(SettingsRepository.KEY_USE_ROOT, enabled) isRootEnabled.value = enabled check(context) } + /** + * Executes the set user dictionary enabled operation. + * + * @param enabled [Boolean] Target enabled. + * @param context [Context] Target context. + */ fun setUserDictionaryEnabled(enabled: Boolean, context: Context) { isUserDictionaryEnabled.value = enabled settingsRepository.setUserDictionaryEnabled(enabled) } + /** + * Executes the set long press symbols enabled operation. + * + * @param enabled [Boolean] Target enabled. + * @param context [Context] Target context. + */ fun setLongPressSymbolsEnabled(enabled: Boolean, context: Context) { isLongPressSymbolsEnabled.value = enabled settingsRepository.putBoolean(SettingsRepository.KEY_KEYBOARD_LONG_PRESS_SYMBOLS, enabled) } + /** + * Executes the set accented characters enabled operation. + * + * @param enabled [Boolean] Target enabled. + * @param context [Context] Target context. + */ fun setAccentedCharactersEnabled(enabled: Boolean, context: Context) { isAccentedCharactersEnabled.value = enabled settingsRepository.setAccentedCharactersEnabled(enabled) } + /** + * Executes the load user dictionary words operation. + * + * @param context [Context] Target context. + */ fun loadUserDictionaryWords(context: Context) { context.applicationContext as? com.sameerasw.essentials.ime.EssentialsInputMethodService @@ -1999,6 +2179,12 @@ class MainViewModel : ViewModel() { } } + /** + * Executes the delete user word operation. + * + * @param word [String] Target word. + * @param context [Context] Target context. + */ fun deleteUserWord(word: String, context: Context) { viewModelScope.launch(Dispatchers.IO) { // Read, remove, write @@ -2015,6 +2201,11 @@ class MainViewModel : ViewModel() { } } + /** + * Executes the clear user dictionary operation. + * + * @param context [Context] Target context. + */ fun clearUserDictionary(context: Context) { viewModelScope.launch(Dispatchers.IO) { val file = java.io.File(context.filesDir, "user_dict.txt") @@ -2031,16 +2222,33 @@ class MainViewModel : ViewModel() { } } + /** + * Executes the set pitch black theme enabled operation. + * + * @param enabled [Boolean] Target enabled. + * @param context [Context] Target context. + */ fun setPitchBlackThemeEnabled(enabled: Boolean, context: Context) { isPitchBlackThemeEnabled.value = enabled settingsRepository.putBoolean(SettingsRepository.KEY_PITCH_BLACK_THEME_ENABLED, enabled) } + /** + * Executes the set blur enabled operation. + * + * @param enabled [Boolean] Target enabled. + * @param context [Context] Target context. + */ fun setBlurEnabled(enabled: Boolean, context: Context) { settingsRepository.putBoolean(SettingsRepository.KEY_USE_BLUR, enabled) updateBlurState(context) } + /** + * Executes the set swipe tabs enabled operation. + * + * @param enabled [Boolean] Target enabled. + */ fun setSwipeTabsEnabled(enabled: Boolean) { settingsRepository.putBoolean(SettingsRepository.KEY_SWIPE_TABS, enabled) isSwipeTabsEnabled.value = enabled @@ -2055,6 +2263,12 @@ class MainViewModel : ViewModel() { isBlurEnabled.value = useBlurSetting && !isProblematic && !isPowerSave } + /** + * Executes the check for updates operation. + * + * @param context [Context] Target context. + * @param manual [Boolean] Target manual. + */ fun checkForUpdates(context: Context, manual: Boolean = false) { if (isCheckingUpdate.value) return if (isUpdateAvailable.value && !manual) return @@ -2114,6 +2328,11 @@ class MainViewModel : ViewModel() { } } + /** + * Executes the refresh tracked updates operation. + * + * @param context [Context] Target context. + */ fun refreshTrackedUpdates(context: Context) { val trackedRepos = settingsRepository.getTrackedRepos() if (trackedRepos.isEmpty()) { @@ -2128,6 +2347,11 @@ class MainViewModel : ViewModel() { return PermissionUtils.isDeviceAdminActive(context) } + /** + * Executes the request device admin operation. + * + * @param context [Context] Target context. + */ fun requestDeviceAdmin(context: Context) { val adminComponent = ComponentName(context, SecurityDeviceAdminReceiver::class.java) val intent = Intent(DevicePolicyManager.ACTION_ADD_DEVICE_ADMIN).apply { @@ -2145,6 +2369,11 @@ class MainViewModel : ViewModel() { } } + /** + * Executes the request read phone state permission operation. + * + * @param activity [Activity] Target activity. + */ fun requestReadPhoneStatePermission(activity: Activity) { androidx.core.app.ActivityCompat.requestPermissions( activity, @@ -2154,11 +2383,23 @@ class MainViewModel : ViewModel() { } + /** + * Executes the set widget enabled operation. + * + * @param enabled [Boolean] Target enabled. + * @param context [Context] Target context. + */ fun setWidgetEnabled(enabled: Boolean, context: Context) { isWidgetEnabled.value = enabled settingsRepository.putBoolean(SettingsRepository.KEY_WIDGET_ENABLED, enabled) } + /** + * Executes the set status bar icon control enabled operation. + * + * @param enabled [Boolean] Target enabled. + * @param context [Context] Target context. + */ fun setStatusBarIconControlEnabled(enabled: Boolean, context: Context) { isStatusBarIconControlEnabled.value = enabled settingsRepository.putBoolean( @@ -2167,27 +2408,57 @@ class MainViewModel : ViewModel() { ) } + /** + * Executes the set maps power saving enabled operation. + * + * @param enabled [Boolean] Target enabled. + * @param context [Context] Target context. + */ fun setMapsPowerSavingEnabled(enabled: Boolean, context: Context) { isMapsPowerSavingEnabled.value = enabled MapsState.isEnabled = enabled settingsRepository.putBoolean(SettingsRepository.KEY_MAPS_POWER_SAVING_ENABLED, enabled) } + /** + * Executes the set notification lighting enabled operation. + * + * @param enabled [Boolean] Target enabled. + * @param context [Context] Target context. + */ fun setNotificationLightingEnabled(enabled: Boolean, context: Context) { isNotificationLightingEnabled.value = enabled settingsRepository.putBoolean(SettingsRepository.KEY_EDGE_LIGHTING_ENABLED, enabled) } + /** + * Executes the set only show when screen off operation. + * + * @param enabled [Boolean] Target enabled. + * @param context [Context] Target context. + */ fun setOnlyShowWhenScreenOff(enabled: Boolean, context: Context) { onlyShowWhenScreenOff.value = enabled settingsRepository.putBoolean(SettingsRepository.KEY_EDGE_LIGHTING_ONLY_SCREEN_OFF, enabled) } + /** + * Executes the set ambient display enabled operation. + * + * @param enabled [Boolean] Target enabled. + * @param context [Context] Target context. + */ fun setAmbientDisplayEnabled(enabled: Boolean, context: Context) { isAmbientDisplayEnabled.value = enabled settingsRepository.putBoolean(SettingsRepository.KEY_EDGE_LIGHTING_AMBIENT_DISPLAY, enabled) } + /** + * Executes the set ambient show lock screen enabled operation. + * + * @param enabled [Boolean] Target enabled. + * @param context [Context] Target context. + */ fun setAmbientShowLockScreenEnabled(enabled: Boolean, context: Context) { isAmbientShowLockScreenEnabled.value = enabled settingsRepository.putBoolean( @@ -2196,12 +2467,24 @@ class MainViewModel : ViewModel() { ) } + /** + * Executes the set hide gesture bar enabled operation. + * + * @param enabled [Boolean] Target enabled. + * @param context [Context] Target context. + */ fun setHideGestureBarEnabled(enabled: Boolean, context: Context) { isHideGestureBarEnabled.value = enabled settingsRepository.putBoolean(SettingsRepository.KEY_HIDE_GESTURE_BAR_ENABLED, enabled) applyHideGestureBar(context, enabled) } + /** + * Executes the set circle to search gesture enabled operation. + * + * @param enabled [Boolean] Target enabled. + * @param context [Context] Target context. + */ fun setCircleToSearchGestureEnabled(enabled: Boolean, context: Context) { isCircleToSearchGestureEnabled.value = enabled settingsRepository.putBoolean( @@ -2210,11 +2493,21 @@ class MainViewModel : ViewModel() { ) } + /** + * Executes the set circle to search gesture height operation. + * + * @param height [Float] Target height. + */ fun setCircleToSearchGestureHeight(height: Float) { circleToSearchGestureHeight.floatValue = height settingsRepository.putFloat(SettingsRepository.KEY_CIRCLE_TO_SEARCH_GESTURE_HEIGHT, height) } + /** + * Executes the set circle to search preview enabled operation. + * + * @param enabled [Boolean] Target enabled. + */ fun setCircleToSearchPreviewEnabled(enabled: Boolean) { isCircleToSearchPreviewEnabled.value = enabled settingsRepository.putBoolean( @@ -2223,6 +2516,12 @@ class MainViewModel : ViewModel() { ) } + /** + * Executes the set hide gesture bar on launcher enabled operation. + * + * @param enabled [Boolean] Target enabled. + * @param context [Context] Target context. + */ fun setHideGestureBarOnLauncherEnabled(enabled: Boolean, context: Context) { isHideGestureBarOnLauncherEnabled.value = enabled settingsRepository.putBoolean( @@ -2240,23 +2539,44 @@ class MainViewModel : ViewModel() { updateAppDetectionService(context) } + /** + * Executes the set disable rotation suggestion enabled operation. + * + * @param enabled [Boolean] Target enabled. + * @param context [Context] Target context. + */ fun setDisableRotationSuggestionEnabled(enabled: Boolean, context: Context) { isDisableRotationSuggestionEnabled.value = enabled settingsRepository.putBoolean(SettingsRepository.KEY_DISABLE_ROTATION_SUGGESTION, enabled) applyDisableRotationSuggestion(context, enabled) } + /** + * Executes the set allow overlays in settings enabled operation. + * + * @param enabled [Boolean] Target enabled. + * @param context [Context] Target context. + */ fun setAllowOverlaysInSettingsEnabled(enabled: Boolean, context: Context) { isAllowOverlaysInSettingsEnabled.value = enabled settingsRepository.putBoolean(SettingsRepository.KEY_ALLOW_OVERLAYS_IN_SETTINGS, enabled) applyAllowOverlaysInSettings(context, enabled) } + /** + * Executes the refresh allow overlays in settings state operation. + * + * @param context [Context] Target context. + */ fun refreshAllowOverlaysInSettingsState(context: Context) { try { - val currentVal = Settings.Secure.getInt(context.contentResolver, "secure_overlay_settings", 0) == 1 + val currentVal = + Settings.Secure.getInt(context.contentResolver, "secure_overlay_settings", 0) == 1 isAllowOverlaysInSettingsEnabled.value = currentVal - settingsRepository.putBoolean(SettingsRepository.KEY_ALLOW_OVERLAYS_IN_SETTINGS, currentVal) + settingsRepository.putBoolean( + SettingsRepository.KEY_ALLOW_OVERLAYS_IN_SETTINGS, + currentVal + ) } catch (e: Exception) { // Secure setting not accessible without permission } @@ -2282,45 +2602,89 @@ class MainViewModel : ViewModel() { } } + /** + * Executes the set network download rate limit operation. + * + * @param limit [Int] Target limit. + * @param context [Context] Target context. + */ fun setNetworkDownloadRateLimit(limit: Int, context: Context) { networkDownloadRateLimit.intValue = limit settingsRepository.putInt(SettingsRepository.KEY_NETWORK_DOWNLOAD_RATE_LIMIT, limit) applyNetworkDownloadRateLimit(context, limit) } + /** + * Executes the set mobile data always on enabled operation. + * + * @param enabled [Boolean] Target enabled. + * @param context [Context] Target context. + */ fun setMobileDataAlwaysOnEnabled(enabled: Boolean, context: Context) { isMobileDataAlwaysOnEnabled.value = enabled settingsRepository.putBoolean(SettingsRepository.KEY_MOBILE_DATA_ALWAYS_ON, enabled) applyMobileDataAlwaysOn(context, enabled) } + /** + * Executes the set wireless display certification enabled operation. + * + * @param enabled [Boolean] Target enabled. + * @param context [Context] Target context. + */ fun setWirelessDisplayCertificationEnabled(enabled: Boolean, context: Context) { isWirelessDisplayCertificationEnabled.value = enabled - settingsRepository.putBoolean(SettingsRepository.KEY_WIRELESS_DISPLAY_CERTIFICATION, enabled) + settingsRepository.putBoolean( + SettingsRepository.KEY_WIRELESS_DISPLAY_CERTIFICATION, + enabled + ) applyWirelessDisplayCertification(context, enabled) } + /** + * Executes the refresh networks state operation. + * + * @param context [Context] Target context. + */ fun refreshNetworksState(context: Context) { try { - val liveRateLimit = Settings.Global.getInt(context.contentResolver, "ingress_rate_limit_bytes_per_second", -1) + val liveRateLimit = Settings.Global.getInt( + context.contentResolver, + "ingress_rate_limit_bytes_per_second", + -1 + ) networkDownloadRateLimit.intValue = liveRateLimit - settingsRepository.putInt(SettingsRepository.KEY_NETWORK_DOWNLOAD_RATE_LIMIT, liveRateLimit) + settingsRepository.putInt( + SettingsRepository.KEY_NETWORK_DOWNLOAD_RATE_LIMIT, + liveRateLimit + ) } catch (e: Exception) { // Permission restricted } try { - val liveMobileData = Settings.Global.getInt(context.contentResolver, "mobile_data_always_on", 0) == 1 + val liveMobileData = + Settings.Global.getInt(context.contentResolver, "mobile_data_always_on", 0) == 1 isMobileDataAlwaysOnEnabled.value = liveMobileData - settingsRepository.putBoolean(SettingsRepository.KEY_MOBILE_DATA_ALWAYS_ON, liveMobileData) + settingsRepository.putBoolean( + SettingsRepository.KEY_MOBILE_DATA_ALWAYS_ON, + liveMobileData + ) } catch (e: Exception) { // Permission restricted } try { - val liveWirelessDisplay = Settings.Global.getInt(context.contentResolver, "wifi_display_certification_on", 0) == 1 + val liveWirelessDisplay = Settings.Global.getInt( + context.contentResolver, + "wifi_display_certification_on", + 0 + ) == 1 isWirelessDisplayCertificationEnabled.value = liveWirelessDisplay - settingsRepository.putBoolean(SettingsRepository.KEY_WIRELESS_DISPLAY_CERTIFICATION, liveWirelessDisplay) + settingsRepository.putBoolean( + SettingsRepository.KEY_WIRELESS_DISPLAY_CERTIFICATION, + liveWirelessDisplay + ) } catch (e: Exception) { // Permission restricted } @@ -2379,12 +2743,23 @@ class MainViewModel : ViewModel() { } } + /** + * Executes the set transparent navigation bar enabled operation. + * + * @param enabled [Boolean] Target enabled. + * @param context [Context] Target context. + */ fun setTransparentNavigationBarEnabled(enabled: Boolean, context: Context) { isTransparentNavigationBarEnabled.value = enabled settingsRepository.putBoolean(SettingsRepository.KEY_TRANSPARENT_NAVIGATION_BAR, enabled) applyTransparentNavigationBar(context, enabled) } + /** + * Executes the refresh transparent navigation bar state operation. + * + * @param context [Context] Target context. + */ fun refreshTransparentNavigationBarState(context: Context) { viewModelScope.launch(kotlinx.coroutines.Dispatchers.IO) { val pkg = "com.android.internal.systemui.navbar.transparent" @@ -2395,7 +2770,10 @@ class MainViewModel : ViewModel() { } kotlinx.coroutines.withContext(kotlinx.coroutines.Dispatchers.Main) { isTransparentNavigationBarEnabled.value = isEnabled - settingsRepository.putBoolean(SettingsRepository.KEY_TRANSPARENT_NAVIGATION_BAR, isEnabled) + settingsRepository.putBoolean( + SettingsRepository.KEY_TRANSPARENT_NAVIGATION_BAR, + isEnabled + ) } } } @@ -2409,6 +2787,11 @@ class MainViewModel : ViewModel() { } } + /** + * Executes the load standby apps operation. + * + * @param context [Context] Target context. + */ fun loadStandbyApps(context: Context) { viewModelScope.launch(kotlinx.coroutines.Dispatchers.IO) { isStandbyAppsLoading.value = true @@ -2447,6 +2830,13 @@ class MainViewModel : ViewModel() { } } + /** + * Executes the set app standby bucket operation. + * + * @param packageName [String] Target package name. + * @param targetBucket [Int] Target target bucket. + * @param context [Context] Target context. + */ fun setAppStandbyBucket(packageName: String, targetBucket: Int, context: Context) { val currentList = standbyAppsList.value val updatedList = currentList.map { app -> @@ -2469,12 +2859,23 @@ class MainViewModel : ViewModel() { } } + /** + * Executes the set prefer gpu composing enabled operation. + * + * @param enabled [Boolean] Target enabled. + * @param context [Context] Target context. + */ fun setPreferGpuComposingEnabled(enabled: Boolean, context: Context) { isPreferGpuComposingEnabled.value = enabled settingsRepository.putBoolean(SettingsRepository.KEY_PREFER_GPU_COMPOSING, enabled) applyPreferGpuComposing(context, enabled) } + /** + * Executes the refresh prefer gpu composing state operation. + * + * @param context [Context] Target context. + */ fun refreshPreferGpuComposingState(context: Context) { viewModelScope.launch(kotlinx.coroutines.Dispatchers.IO) { val isShellGranted = (isShizukuAvailable.value && isShizukuPermissionGranted.value) || @@ -2483,7 +2884,10 @@ class MainViewModel : ViewModel() { val isRoot = isRootAvailable.value && isRootPermissionGranted.value val liveValue = SurfaceFlingerControl.isHwOverlaysDisabled(context, isRoot) isPreferGpuComposingEnabled.value = liveValue - settingsRepository.putBoolean(SettingsRepository.KEY_PREFER_GPU_COMPOSING, liveValue) + settingsRepository.putBoolean( + SettingsRepository.KEY_PREFER_GPU_COMPOSING, + liveValue + ) } } } @@ -2518,6 +2922,12 @@ class MainViewModel : ViewModel() { } } + /** + * Executes the set pixel searchbar enabled operation. + * + * @param enabled [Boolean] Target enabled. + * @param context [Context] Target context. + */ fun setPixelSearchbarEnabled(enabled: Boolean, context: Context) { isPixelSearchbarEnabled.value = enabled settingsRepository.putBoolean(SettingsRepository.KEY_PIXEL_SEARCHBAR, enabled) @@ -2559,6 +2969,12 @@ class MainViewModel : ViewModel() { } } + /** + * Executes the set pixel searchbar type operation. + * + * @param type [String] Target type. + * @param context [Context] Target context. + */ fun setPixelSearchbarType(type: String, context: Context) { pixelSearchbarType.value = type settingsRepository.setPixelSearchbarType(type) @@ -2576,6 +2992,12 @@ class MainViewModel : ViewModel() { } } + /** + * Executes the set pixel searchbar date format operation. + * + * @param format [String] Target format. + * @param context [Context] Target context. + */ fun setPixelSearchbarDateFormat(format: String, context: Context) { pixelSearchbarDateFormat.value = format settingsRepository.setPixelSearchbarDateFormat(format) @@ -2590,6 +3012,12 @@ class MainViewModel : ViewModel() { } } + /** + * Executes the set pixel searchbar background pill operation. + * + * @param enabled [Boolean] Target enabled. + * @param context [Context] Target context. + */ fun setPixelSearchbarBackgroundPill(enabled: Boolean, context: Context) { pixelSearchbarBackgroundPill.value = enabled settingsRepository.setPixelSearchbarBackgroundPill(enabled) @@ -2604,6 +3032,13 @@ class MainViewModel : ViewModel() { } } + /** + * Executes the set pixel searchbar widget id operation. + * + * @param id [Int] Target id. + * @param provider [String?] Target provider. + * @param context [Context] Target context. + */ fun setPixelSearchbarWidgetId(id: Int, provider: String?, context: Context) { pixelSearchbarWidgetId.intValue = id pixelSearchbarWidgetProvider.value = provider @@ -2612,6 +3047,11 @@ class MainViewModel : ViewModel() { updatePixelSearchbarWidget(context) } + /** + * Executes the clear pixel searchbar widget operation. + * + * @param context [Context] Target context. + */ fun clearPixelSearchbarWidget(context: Context) { pixelSearchbarWidgetId.intValue = android.appwidget.AppWidgetManager.INVALID_APPWIDGET_ID pixelSearchbarWidgetProvider.value = null @@ -2626,6 +3066,13 @@ class MainViewModel : ViewModel() { updatePixelSearchbarWidget(context) } + /** + * Executes the update pixel searchbar scraped text operation. + * + * @param line1 [String] Target line1. + * @param line2 [String] Target line2. + * @param context [Context] Target context. + */ fun updatePixelSearchbarScrapedText(line1: String, line2: String, context: Context) { pixelSearchbarScrapedLine1.value = line1 pixelSearchbarScrapedLine2.value = line2 @@ -2634,18 +3081,36 @@ class MainViewModel : ViewModel() { updatePixelSearchbarWidget(context) } + /** + * Executes the set pixel searchbar widget padding h operation. + * + * @param value [Int] Target value. + * @param context [Context] Target context. + */ fun setPixelSearchbarWidgetPaddingH(value: Int, context: Context) { pixelSearchbarWidgetPaddingH.intValue = value settingsRepository.setPixelSearchbarWidgetPaddingH(value) updatePixelSearchbarWidget(context) } + /** + * Executes the set pixel searchbar widget padding v operation. + * + * @param value [Int] Target value. + * @param context [Context] Target context. + */ fun setPixelSearchbarWidgetPaddingV(value: Int, context: Context) { pixelSearchbarWidgetPaddingV.intValue = value settingsRepository.setPixelSearchbarWidgetPaddingV(value) updatePixelSearchbarWidget(context) } + /** + * Executes the set pixel searchbar tap action enabled operation. + * + * @param enabled [Boolean] Target enabled. + * @param context [Context] Target context. + */ fun setPixelSearchbarTapActionEnabled(enabled: Boolean, context: Context) { pixelSearchbarTapActionEnabled.value = enabled settingsRepository.setPixelSearchbarTapActionEnabled(enabled) @@ -2668,6 +3133,11 @@ class MainViewModel : ViewModel() { updatePixelSearchbarWidget(context) } + /** + * Executes the update media from active session operation. + * + * @param context [Context] Target context. + */ fun updateMediaFromActiveSession(context: Context) { try { val manager = @@ -2725,6 +3195,11 @@ class MainViewModel : ViewModel() { } } + /** + * Executes the update pixel searchbar widget operation. + * + * @param context [Context] Target context. + */ fun updatePixelSearchbarWidget(context: Context) { viewModelScope.launch(kotlinx.coroutines.Dispatchers.IO) { try { @@ -2741,6 +3216,12 @@ class MainViewModel : ViewModel() { } } + /** + * Executes the set lock screen clock id operation. + * + * @param clockId [String] Target clock id. + * @param context [Context] Target context. + */ fun setLockScreenClockId(clockId: String, context: Context) { val timestamp = System.currentTimeMillis() val json = if (lockScreenClockSelectedColorId.value == "DEFAULT") { @@ -2778,30 +3259,60 @@ class MainViewModel : ViewModel() { } } + /** + * Executes the set lock screen clock weight operation. + * + * @param value [Int] Target value. + * @param context [Context] Target context. + */ fun setLockScreenClockWeight(value: Int, context: Context) { lockScreenClockWeight.intValue = value settingsRepository.setLockScreenClockWeight(value) lockScreenClockId.value?.let { setLockScreenClockId(it, context) } } + /** + * Executes the set lock screen clock width operation. + * + * @param value [Int] Target value. + * @param context [Context] Target context. + */ fun setLockScreenClockWidth(value: Int, context: Context) { lockScreenClockWidth.intValue = value settingsRepository.setLockScreenClockWidth(value) lockScreenClockId.value?.let { setLockScreenClockId(it, context) } } + /** + * Executes the set lock screen clock grade operation. + * + * @param value [Int] Target value. + * @param context [Context] Target context. + */ fun setLockScreenClockGrade(value: Int, context: Context) { lockScreenClockGrade.intValue = value settingsRepository.setLockScreenClockGrade(value) lockScreenClockId.value?.let { setLockScreenClockId(it, context) } } + /** + * Executes the set lock screen clock roundness operation. + * + * @param value [Int] Target value. + * @param context [Context] Target context. + */ fun setLockScreenClockRoundness(value: Int, context: Context) { lockScreenClockRoundness.intValue = value settingsRepository.setLockScreenClockRoundness(value) lockScreenClockId.value?.let { setLockScreenClockId(it, context) } } + /** + * Executes the set lock screen clock color tone operation. + * + * @param value [Int] Target value. + * @param context [Context] Target context. + */ fun setLockScreenClockColorTone(value: Int, context: Context) { lockScreenClockColorTone.intValue = value settingsRepository.setLockScreenClockColorTone(value) @@ -2817,6 +3328,13 @@ class MainViewModel : ViewModel() { lockScreenClockId.value?.let { setLockScreenClockId(it, context) } } + /** + * Executes the set lock screen clock color operation. + * + * @param id [String] Target id. + * @param seed [Int] Target seed. + * @param context [Context] Target context. + */ fun setLockScreenClockColor(id: String, seed: Int, context: Context) { lockScreenClockSelectedColorId.value = id val effectiveSeed = if (id == "DEFAULT") 0 else calculateEffectiveSeedColor( @@ -2882,16 +3400,34 @@ class MainViewModel : ViewModel() { } } + /** + * Executes the set skip silent notifications operation. + * + * @param enabled [Boolean] Target enabled. + * @param context [Context] Target context. + */ fun setSkipSilentNotifications(enabled: Boolean, context: Context) { skipSilentNotifications.value = enabled settingsRepository.putBoolean(SettingsRepository.KEY_EDGE_LIGHTING_SKIP_SILENT, enabled) } + /** + * Executes the set skip persistent notifications operation. + * + * @param enabled [Boolean] Target enabled. + * @param context [Context] Target context. + */ fun setSkipPersistentNotifications(enabled: Boolean, context: Context) { skipPersistentNotifications.value = enabled settingsRepository.putBoolean(SettingsRepository.KEY_EDGE_LIGHTING_SKIP_PERSISTENT, enabled) } + /** + * Executes the set notification lighting style operation. + * + * @param style [NotificationLightingStyle] Target style. + * @param context [Context] Target context. + */ fun setNotificationLightingStyle(style: NotificationLightingStyle, context: Context) { if (style == NotificationLightingStyle.SYSTEM && !ShellUtils.hasPermission(context)) { // Permission handling should be done in UI, but we can ensure state consistency here @@ -2901,41 +3437,88 @@ class MainViewModel : ViewModel() { settingsRepository.putString(SettingsRepository.KEY_EDGE_LIGHTING_STYLE, style.name) } + /** + * Executes the set notification lighting system mode operation. + * + * @param mode [Int] Target mode. + * @param context [Context] Target context. + */ fun setNotificationLightingSystemMode(mode: Int, context: Context) { notificationLightingSystemMode.intValue = mode settingsRepository.saveNotificationLightingSystemMode(mode) } + /** + * Executes the set notification lighting color mode operation. + * + * @param mode [NotificationLightingColorMode] Target mode. + * @param context [Context] Target context. + */ fun setNotificationLightingColorMode(mode: NotificationLightingColorMode, context: Context) { notificationLightingColorMode.value = mode settingsRepository.putString(SettingsRepository.KEY_EDGE_LIGHTING_COLOR_MODE, mode.name) } + /** + * Executes the set notification lighting custom color operation. + * + * @param color [Int] Target color. + * @param context [Context] Target context. + */ fun setNotificationLightingCustomColor(color: Int, context: Context) { notificationLightingCustomColor.intValue = color settingsRepository.putInt(SettingsRepository.KEY_EDGE_LIGHTING_CUSTOM_COLOR, color) } + /** + * Executes the set button remap enabled operation. + * + * @param enabled [Boolean] Target enabled. + * @param context [Context] Target context. + */ fun setButtonRemapEnabled(enabled: Boolean, context: Context) { isButtonRemapEnabled.value = enabled settingsRepository.putBoolean(SettingsRepository.KEY_BUTTON_REMAP_ENABLED, enabled) } + /** + * Executes the set call vibrations enabled operation. + * + * @param enabled [Boolean] Target enabled. + */ fun setCallVibrationsEnabled(enabled: Boolean) { isCallVibrationsEnabled.value = enabled settingsRepository.putBoolean(SettingsRepository.KEY_CALL_VIBRATIONS_ENABLED, enabled) } + /** + * Executes the set button remap use shizuku operation. + * + * @param enabled [Boolean] Target enabled. + * @param context [Context] Target context. + */ fun setButtonRemapUseShizuku(enabled: Boolean, context: Context) { isButtonRemapUseShizuku.value = enabled settingsRepository.putBoolean(SettingsRepository.KEY_BUTTON_REMAP_USE_SHIZUKU, enabled) } + /** + * Executes the set volume up action off operation. + * + * @param action [String] Target action. + * @param context [Context] Target context. + */ fun setVolumeUpActionOff(action: String, context: Context) { volumeUpActionOff.value = action settingsRepository.putString(SettingsRepository.KEY_BUTTON_REMAP_VOL_UP_ACTION_OFF, action) } + /** + * Executes the set volume down action off operation. + * + * @param action [String] Target action. + * @param context [Context] Target context. + */ fun setVolumeDownActionOff(action: String, context: Context) { volumeDownActionOff.value = action settingsRepository.putString( @@ -2944,48 +3527,101 @@ class MainViewModel : ViewModel() { ) } + /** + * Executes the set volume up action on operation. + * + * @param action [String] Target action. + * @param context [Context] Target context. + */ fun setVolumeUpActionOn(action: String, context: Context) { volumeUpActionOn.value = action settingsRepository.putString(SettingsRepository.KEY_BUTTON_REMAP_VOL_UP_ACTION_ON, action) } + /** + * Executes the set volume down action on operation. + * + * @param action [String] Target action. + * @param context [Context] Target context. + */ fun setVolumeDownActionOn(action: String, context: Context) { volumeDownActionOn.value = action settingsRepository.putString(SettingsRepository.KEY_BUTTON_REMAP_VOL_DOWN_ACTION_ON, action) } + /** + * Executes the set remap haptic type operation. + * + * @param type [HapticFeedbackType] Target type. + * @param context [Context] Target context. + */ fun setRemapHapticType(type: HapticFeedbackType, context: Context) { remapHapticType.value = type settingsRepository.putString(SettingsRepository.KEY_BUTTON_REMAP_HAPTIC_TYPE, type.name) } + /** + * Executes the set dynamic night light enabled operation. + * + * @param enabled [Boolean] Target enabled. + * @param context [Context] Target context. + */ fun setDynamicNightLightEnabled(enabled: Boolean, context: Context) { isDynamicNightLightEnabled.value = enabled settingsRepository.putBoolean(SettingsRepository.KEY_DYNAMIC_NIGHT_LIGHT_ENABLED, enabled) updateAppDetectionService(context) } + /** + * Executes the set smart pixels enabled operation. + * + * @param context [Context] Target context. + * @param enabled [Boolean] Target enabled. + */ fun setSmartPixelsEnabled(context: Context, enabled: Boolean) { isSmartPixelsEnabled.value = enabled settingsRepository.putBoolean(SettingsRepository.KEY_SMART_PIXELS_ENABLED, enabled) } + /** + * Executes the set smart pixels intensity operation. + * + * @param context [Context] Target context. + * @param intensity [Float] Target intensity. + */ fun setSmartPixelsIntensity(context: Context, intensity: Float) { smartPixelsIntensity.floatValue = intensity settingsRepository.putFloat(SettingsRepository.KEY_SMART_PIXELS_INTENSITY, intensity) } + /** + * Executes the set app lock enabled operation. + * + * @param enabled [Boolean] Target enabled. + * @param context [Context] Target context. + */ fun setAppLockEnabled(enabled: Boolean, context: Context) { isAppLockEnabled.value = enabled settingsRepository.putBoolean(SettingsRepository.KEY_APP_LOCK_ENABLED, enabled) updateAppDetectionService(context) } + /** + * Executes the set app lock auto lock delay index operation. + * + * @param index [Int] Target index. + */ fun setAppLockAutoLockDelayIndex(index: Int) { appLockAutoLockDelayIndex.intValue = index settingsRepository.putInt(SettingsRepository.KEY_APP_LOCK_AUTO_LOCK_DELAY_INDEX, index) } + /** + * Executes the set use usage access operation. + * + * @param enabled [Boolean] Target enabled. + * @param context [Context] Target context. + */ fun setUseUsageAccess(enabled: Boolean, context: Context) { isUseUsageAccess.value = enabled settingsRepository.putBoolean(SettingsRepository.KEY_USE_USAGE_ACCESS, enabled) @@ -2998,6 +3634,11 @@ class MainViewModel : ViewModel() { val isLikeSongToastEnabled = mutableStateOf(false) + /** + * Executes the set like song toast enabled operation. + * + * @param enabled [Boolean] Target enabled. + */ fun setLikeSongToastEnabled(enabled: Boolean) { isLikeSongToastEnabled.value = enabled settingsRepository.putBoolean(SettingsRepository.KEY_LIKE_SONG_TOAST_ENABLED, enabled) @@ -3005,6 +3646,11 @@ class MainViewModel : ViewModel() { val isLikeSongAodOverlayEnabled = mutableStateOf(false) + /** + * Executes the set like song aod overlay enabled operation. + * + * @param enabled [Boolean] Target enabled. + */ fun setLikeSongAodOverlayEnabled(enabled: Boolean) { isLikeSongAodOverlayEnabled.value = enabled settingsRepository.putBoolean(SettingsRepository.KEY_LIKE_SONG_AOD_OVERLAY_ENABLED, enabled) @@ -3012,11 +3658,21 @@ class MainViewModel : ViewModel() { val isAmbientMusicGlanceEnabled = mutableStateOf(false) + /** + * Executes the set ambient music glance enabled operation. + * + * @param enabled [Boolean] Target enabled. + */ fun setAmbientMusicGlanceEnabled(enabled: Boolean) { isAmbientMusicGlanceEnabled.value = enabled settingsRepository.putBoolean(SettingsRepository.KEY_AMBIENT_MUSIC_GLANCE_ENABLED, enabled) } + /** + * Executes the set ambient music glance random shapes enabled operation. + * + * @param enabled [Boolean] Target enabled. + */ fun setAmbientMusicGlanceRandomShapesEnabled(enabled: Boolean) { isAmbientMusicGlanceRandomShapesEnabled.value = enabled settingsRepository.putBoolean( @@ -3025,41 +3681,81 @@ class MainViewModel : ViewModel() { ) } + /** + * Executes the set ambient music glance album art mode operation. + * + * @param mode [String] Target mode. + */ fun setAmbientMusicGlanceAlbumArtMode(mode: String) { ambientMusicGlanceAlbumArtMode.value = mode settingsRepository.setAmbientMusicGlanceAlbumArtMode(mode) } + /** + * Executes the set ambient music glance clock size operation. + * + * @param size [Int] Target size. + */ fun setAmbientMusicGlanceClockSize(size: Int) { ambientMusicGlanceClockSize.intValue = size settingsRepository.setAmbientMusicGlanceClockSize(size) } + /** + * Executes the set ambient music glance clock weight operation. + * + * @param weight [Int] Target weight. + */ fun setAmbientMusicGlanceClockWeight(weight: Int) { ambientMusicGlanceClockWeight.intValue = weight settingsRepository.setAmbientMusicGlanceClockWeight(weight) } + /** + * Executes the set ambient music glance clock width operation. + * + * @param width [Int] Target width. + */ fun setAmbientMusicGlanceClockWidth(width: Int) { ambientMusicGlanceClockWidth.intValue = width settingsRepository.setAmbientMusicGlanceClockWidth(width) } + /** + * Executes the set ambient music glance clock roundness operation. + * + * @param roundness [Int] Target roundness. + */ fun setAmbientMusicGlanceClockRoundness(roundness: Int) { ambientMusicGlanceClockRoundness.intValue = roundness settingsRepository.setAmbientMusicGlanceClockRoundness(roundness) } + /** + * Executes the set ambient music glance force fill while charging enabled operation. + * + * @param enabled [Boolean] Target enabled. + */ fun setAmbientMusicGlanceForceFillWhileChargingEnabled(enabled: Boolean) { isAmbientMusicGlanceForceFillWhileChargingEnabled.value = enabled settingsRepository.setAmbientMusicGlanceForceFillWhileChargingEnabled(enabled) } + /** + * Executes the set ambient music glance respect notifications enabled operation. + * + * @param enabled [Boolean] Target enabled. + */ fun setAmbientMusicGlanceRespectNotificationsEnabled(enabled: Boolean) { isAmbientMusicGlanceRespectNotificationsEnabled.value = enabled settingsRepository.setAmbientMusicGlanceRespectNotificationsEnabled(enabled) } + /** + * Executes the switch scale animations mode operation. + * + * @param mode [String] Target mode. + */ fun switchScaleAnimationsMode(mode: String) { val oldMode = scaleAnimationsMode.value if (oldMode == mode) return @@ -3106,16 +3802,29 @@ class MainViewModel : ViewModel() { setScreenTimeout(newProfile.screenTimeout) } + /** + * Executes the set touch sensitivity enabled operation. + * + * @param enabled [Boolean] Target enabled. + */ fun setTouchSensitivityEnabled(enabled: Boolean) { isTouchSensitivityEnabled.value = enabled settingsRepository.setTouchSensitivityEnabled(enabled) } + /** + * Executes the set auto rotate enabled operation. + * + * @param enabled [Boolean] Target enabled. + */ fun setAutoRotateEnabled(enabled: Boolean) { isAutoRotateEnabled.value = enabled settingsRepository.setAutoRotateEnabled(enabled) } + /** + * Executes the restart system ui operation. + */ fun restartSystemUI() { viewModelScope.launch { withContext(Dispatchers.IO) { @@ -3128,11 +3837,21 @@ class MainViewModel : ViewModel() { } } + /** + * Executes the set screen timeout operation. + * + * @param timeoutMs [Long] Target timeout ms. + */ fun setScreenTimeout(timeoutMs: Long) { screenTimeout.value = timeoutMs settingsRepository.setScreenTimeout(timeoutMs) } + /** + * Executes the set refresh rate mode operation. + * + * @param mode [String] Target mode. + */ fun setRefreshRateMode(mode: String) { refreshRateMode.value = mode if (mode == RefreshRateUtils.MODE_RANGE) { @@ -3157,10 +3876,20 @@ class MainViewModel : ViewModel() { settingsRepository.setRefreshRateMode(mode) } + /** + * Executes the update fixed refresh rate operation. + * + * @param value [Float] Target value. + */ fun updateFixedRefreshRate(value: Float) { fixedRefreshRate.floatValue = value } + /** + * Executes the update min refresh rate operation. + * + * @param value [Float] Target value. + */ fun updateMinRefreshRate(value: Float) { val safeMin = value.coerceAtMost(peakRefreshRate.floatValue.takeIf { it > 0f } ?: value) minRefreshRate.floatValue = safeMin @@ -3169,6 +3898,11 @@ class MainViewModel : ViewModel() { } } + /** + * Executes the update peak refresh rate operation. + * + * @param value [Float] Target value. + */ fun updatePeakRefreshRate(value: Float) { val safePeak = value.coerceAtLeast(minRefreshRate.floatValue.takeIf { it > 0f } ?: value) peakRefreshRate.floatValue = safePeak @@ -3177,6 +3911,11 @@ class MainViewModel : ViewModel() { } } + /** + * Executes the apply fixed refresh rate operation. + * + * @param context [Context] Target context. + */ fun applyFixedRefreshRate(context: Context) { val value = fixedRefreshRate.floatValue if (value <= 0f) { @@ -3201,6 +3940,11 @@ class MainViewModel : ViewModel() { } } + /** + * Executes the apply refresh rate range operation. + * + * @param context [Context] Target context. + */ fun applyRefreshRateRange(context: Context) { val minValue = minRefreshRate.floatValue val peakValue = peakRefreshRate.floatValue @@ -3232,6 +3976,11 @@ class MainViewModel : ViewModel() { } } + /** + * Executes the reset refresh rate operation. + * + * @param context [Context] Target context. + */ fun resetRefreshRate(context: Context) { val restoreInfinityPeak = settingsRepository.shouldRestoreInfinityPeakOnRefreshRateReset() if (RefreshRateUtils.resetRefreshRate(context, restoreInfinityPeak)) { @@ -3322,24 +4071,48 @@ class MainViewModel : ViewModel() { ) } + /** + * Executes the update font scale operation. + * + * @param scale [Float] Target scale. + */ fun updateFontScale(scale: Float) { fontScale.floatValue = scale } + /** + * Executes the save font scale operation. + */ fun saveFontScale() { settingsRepository.setFontScale(fontScale.floatValue) } + /** + * Executes the set font scale operation. + * + * @param scale [Float] Target scale. + */ fun setFontScale(scale: Float) { fontScale.floatValue = scale settingsRepository.setFontScale(scale) } + /** + * Executes the set font weight operation. + * + * @param weight [Int] Target weight. + */ fun setFontWeight(weight: Int) { fontWeight.intValue = weight settingsRepository.setFontWeight(weight) } + /** + * Executes the set animation scale operation. + * + * @param key [String] Target key. + * @param scale [Float] Target scale. + */ fun setAnimationScale(key: String, scale: Float) { when (key) { Settings.Global.ANIMATOR_DURATION_SCALE -> animatorDurationScale.floatValue = @@ -3354,35 +4127,62 @@ class MainViewModel : ViewModel() { settingsRepository.setAnimationScale(key, scale) } + /** + * Executes the reset text to default operation. + */ fun resetTextToDefault() { setFontScale(1.0f) setFontWeight(0) } + /** + * Executes the reset animations to default operation. + */ fun resetAnimationsToDefault() { setAnimationScale(Settings.Global.ANIMATOR_DURATION_SCALE, 1.0f) setAnimationScale(Settings.Global.TRANSITION_ANIMATION_SCALE, 1.0f) setAnimationScale(Settings.Global.WINDOW_ANIMATION_SCALE, 1.0f) } + /** + * Executes the update smallest width operation. + * + * @param width [Int] Target width. + */ fun updateSmallestWidth(width: Int) { smallestWidth.intValue = width } + /** + * Executes the save smallest width operation. + */ fun saveSmallestWidth() { settingsRepository.setSmallestWidth(smallestWidth.intValue) } + /** + * Executes the set smallest width operation. + * + * @param width [Int] Target width. + */ fun setSmallestWidth(width: Int) { smallestWidth.intValue = width settingsRepository.setSmallestWidth(width) } + /** + * Executes the reset scale to default operation. + */ fun resetScaleToDefault() { settingsRepository.resetSmallestWidth() smallestWidth.intValue = settingsRepository.getSmallestWidth() } + /** + * Executes the set ambient music glance docked mode enabled operation. + * + * @param enabled [Boolean] Target enabled. + */ fun setAmbientMusicGlanceDockedModeEnabled(enabled: Boolean) { isAmbientMusicGlanceDockedModeEnabled.value = enabled settingsRepository.putBoolean( @@ -3391,6 +4191,12 @@ class MainViewModel : ViewModel() { ) } + /** + * Executes the set calendar sync enabled operation. + * + * @param enabled [Boolean] Target enabled. + * @param context [Context] Target context. + */ fun setCalendarSyncEnabled(enabled: Boolean, context: Context) { isCalendarSyncEnabled.value = enabled settingsRepository.putBoolean(SettingsRepository.KEY_CALENDAR_SYNC_ENABLED, enabled) @@ -3404,6 +4210,11 @@ class MainViewModel : ViewModel() { } } + /** + * Executes the fetch calendars operation. + * + * @param context [Context] Target context. + */ fun fetchCalendars(context: Context) { if (ContextCompat.checkSelfPermission( context, @@ -3454,6 +4265,11 @@ class MainViewModel : ViewModel() { } } + /** + * Executes the toggle calendar selection operation. + * + * @param calendarId [Long] Target calendar id. + */ fun toggleCalendarSelection(calendarId: Long) { val currentIds = selectedCalendarIds.value.toMutableSet() val idString = calendarId.toString() @@ -3473,6 +4289,12 @@ class MainViewModel : ViewModel() { } } + /** + * Executes the set calendar sync periodic enabled operation. + * + * @param enabled [Boolean] Target enabled. + * @param context [Context] Target context. + */ fun setCalendarSyncPeriodicEnabled(enabled: Boolean, context: Context) { isCalendarSyncPeriodicEnabled.value = enabled settingsRepository.setCalendarSyncPeriodicEnabled(enabled) @@ -3500,15 +4322,32 @@ class MainViewModel : ViewModel() { WorkManager.getInstance(context).cancelUniqueWork("calendar_sync_work") } + /** + * Executes the trigger calendar sync now operation. + * + * @param context [Context] Target context. + */ fun triggerCalendarSyncNow(context: Context) { com.sameerasw.essentials.services.CalendarSyncManager.forceSync(context) } + /** + * Executes the set freeze when locked enabled operation. + * + * @param enabled [Boolean] Target enabled. + * @param context [Context] Target context. + */ fun setFreezeWhenLockedEnabled(enabled: Boolean, context: Context) { isFreezeWhenLockedEnabled.value = enabled settingsRepository.putBoolean(SettingsRepository.KEY_FREEZE_WHEN_LOCKED_ENABLED, enabled) } + /** + * Executes the set freeze dont freeze active apps enabled operation. + * + * @param enabled [Boolean] Target enabled. + * @param context [Context] Target context. + */ fun setFreezeDontFreezeActiveAppsEnabled(enabled: Boolean, context: Context) { isFreezeDontFreezeActiveAppsEnabled.value = enabled settingsRepository.putBoolean( @@ -3517,11 +4356,23 @@ class MainViewModel : ViewModel() { ) } + /** + * Executes the set freeze lock delay index operation. + * + * @param index [Int] Target index. + * @param context [Context] Target context. + */ fun setFreezeLockDelayIndex(index: Int, context: Context) { freezeLockDelayIndex.intValue = index settingsRepository.putInt(SettingsRepository.KEY_FREEZE_LOCK_DELAY_INDEX, index) } + /** + * Executes the set freeze show in launcher enabled operation. + * + * @param enabled [Boolean] Target enabled. + * @param context [Context] Target context. + */ fun setFreezeShowInLauncherEnabled(enabled: Boolean, context: Context) { isFreezeShowInLauncherEnabled.value = enabled settingsRepository.putBoolean(SettingsRepository.KEY_FREEZE_SHOW_IN_LAUNCHER, enabled) @@ -3539,21 +4390,45 @@ class MainViewModel : ViewModel() { } } + /** + * Executes the save notification lighting pulse count operation. + * + * @param context [Context] Target context. + * @param count [Float] Target count. + */ fun saveNotificationLightingPulseCount(context: Context, count: Float) { notificationLightingPulseCount.value = count settingsRepository.putFloat(SettingsRepository.KEY_EDGE_LIGHTING_PULSE_COUNT, count) } + /** + * Executes the save notification lighting pulse duration operation. + * + * @param context [Context] Target context. + * @param duration [Float] Target duration. + */ fun saveNotificationLightingPulseDuration(context: Context, duration: Float) { notificationLightingPulseDuration.value = duration settingsRepository.putFloat(SettingsRepository.KEY_EDGE_LIGHTING_PULSE_DURATION, duration) } + /** + * Executes the set flashlight pulse enabled operation. + * + * @param enabled [Boolean] Target enabled. + * @param context [Context] Target context. + */ fun setFlashlightPulseEnabled(enabled: Boolean, context: Context) { isFlashlightPulseEnabled.value = enabled settingsRepository.putBoolean(SettingsRepository.KEY_FLASHLIGHT_PULSE_ENABLED, enabled) } + /** + * Executes the set flashlight pulse facedown only operation. + * + * @param enabled [Boolean] Target enabled. + * @param context [Context] Target context. + */ fun setFlashlightPulseFacedownOnly(enabled: Boolean, context: Context) { isFlashlightPulseFacedownOnly.value = enabled settingsRepository.putBoolean( @@ -3562,6 +4437,12 @@ class MainViewModel : ViewModel() { ) } + /** + * Executes the set flashlight pulse use lighting apps operation. + * + * @param enabled [Boolean] Target enabled. + * @param context [Context] Target context. + */ fun setFlashlightPulseUseLightingApps(enabled: Boolean, context: Context) { isFlashlightPulseUseLightingApps.value = enabled settingsRepository.putBoolean( @@ -3570,6 +4451,11 @@ class MainViewModel : ViewModel() { ) } + /** + * Executes the set flashlight pulse max intensity operation. + * + * @param intensity [Float] Target intensity. + */ fun setFlashlightPulseMaxIntensity(intensity: Float) { flashlightPulseMaxIntensity.floatValue = intensity settingsRepository.putFloat( @@ -3578,6 +4464,12 @@ class MainViewModel : ViewModel() { ) } + /** + * Executes the set flashlight pulse disable on dnd operation. + * + * @param enabled [Boolean] Target enabled. + * @param context [Context] Target context. + */ fun setFlashlightPulseDisableOnDnd(enabled: Boolean, context: Context) { isFlashlightPulseDisableOnDnd.value = enabled settingsRepository.putBoolean( @@ -3586,6 +4478,11 @@ class MainViewModel : ViewModel() { ) } + /** + * Executes the preview flashlight pulse operation. + * + * @param context [Context] Target context. + */ fun previewFlashlightPulse(context: Context) { val intent = Intent(context, FlashlightActionReceiver::class.java).apply { action = FlashlightActionReceiver.ACTION_PULSE_NOTIFICATION @@ -3630,6 +4527,11 @@ class MainViewModel : ViewModel() { putExtra("system_lighting_mode", notificationLightingSystemMode.intValue) } + /** + * Executes the trigger notification lighting operation. + * + * @param context [Context] Target context. + */ fun triggerNotificationLighting(context: Context) { if (notificationLightingStyle.value == NotificationLightingStyle.SYSTEM) { triggerNotificationLightingSystem(context) @@ -3645,6 +4547,11 @@ class MainViewModel : ViewModel() { } } + /** + * Executes the trigger notification lighting system operation. + * + * @param context [Context] Target context. + */ fun triggerNotificationLightingSystem(context: Context) { if (!ShellUtils.hasPermission(context)) return @@ -3680,12 +4587,22 @@ class MainViewModel : ViewModel() { } } + /** + * Executes the open ime settings operation. + * + * @param context [Context] Target context. + */ fun openImeSettings(context: Context) { val intent = Intent(Settings.ACTION_INPUT_METHOD_SETTINGS) intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) context.startActivity(intent) } + /** + * Executes the request write secure settings permission operation. + * + * @param context [Context] Target context. + */ fun requestWriteSecureSettingsPermission(context: Context) { val adbCommand = "adb shell pm grant ${context.packageName} android.permission.WRITE_SECURE_SETTINGS" @@ -3695,19 +4612,40 @@ class MainViewModel : ViewModel() { clipboard.setPrimaryClip(clip) } + /** + * Executes the request usage stats permission operation. + * + * @param context [Context] Target context. + */ fun requestUsageStatsPermission(context: Context) { PermissionUtils.openUsageStatsSettings(context) } + /** + * Executes the request write settings permission operation. + * + * @param context [Context] Target context. + */ fun requestWriteSettingsPermission(context: Context) { PermissionUtils.openWriteSettings(context) } + /** + * Executes the show ime picker operation. + * + * @param context [Context] Target context. + */ fun showImePicker(context: Context) { val imm = context.getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager imm.showInputMethodPicker() } + /** + * Executes the trigger notification lighting with radius operation. + * + * @param context [Context] Target context. + * @param cornerRadiusDp [Float] Target corner radius dp. + */ fun triggerNotificationLightingWithRadius(context: Context, cornerRadiusDp: Float) { try { val intent = Intent(context, NotificationLightingService::class.java).apply { @@ -3791,72 +4729,156 @@ class MainViewModel : ViewModel() { } } + /** + * Executes the set haptic feedback operation. + * + * @param type [HapticFeedbackType] Target type. + * @param context [Context] Target context. + */ fun setHapticFeedback(type: HapticFeedbackType, context: Context) { hapticFeedbackType.value = type settingsRepository.putString(SettingsRepository.KEY_HAPTIC_FEEDBACK_TYPE, type.name) } + /** + * Executes the set default tab operation. + * + * @param tab [com.sameerasw.essentials.domain.DIYTabs] Target tab. + * @param context [Context] Target context. + */ fun setDefaultTab(tab: com.sameerasw.essentials.domain.DIYTabs, context: Context) { defaultTab.value = tab settingsRepository.saveDIYTab(tab) settingsRepository.saveDIYTab(tab) } + /** + * Executes the set keyboard height operation. + * + * @param height [Float] Target height. + * @param context [Context] Target context. + */ fun setKeyboardHeight(height: Float, context: Context) { keyboardHeight.floatValue = height settingsRepository.putFloat(SettingsRepository.KEY_KEYBOARD_HEIGHT, height) } + /** + * Executes the set keyboard bottom padding operation. + * + * @param padding [Float] Target padding. + * @param context [Context] Target context. + */ fun setKeyboardBottomPadding(padding: Float, context: Context) { keyboardBottomPadding.floatValue = padding settingsRepository.putFloat(SettingsRepository.KEY_KEYBOARD_BOTTOM_PADDING, padding) } + /** + * Executes the set keyboard roundness operation. + * + * @param roundness [Float] Target roundness. + * @param context [Context] Target context. + */ fun setKeyboardRoundness(roundness: Float, context: Context) { keyboardRoundness.floatValue = roundness settingsRepository.putFloat(SettingsRepository.KEY_KEYBOARD_ROUNDNESS, roundness) } + /** + * Executes the set keyboard haptics enabled operation. + * + * @param enabled [Boolean] Target enabled. + * @param context [Context] Target context. + */ fun setKeyboardHapticsEnabled(enabled: Boolean, context: Context) { isKeyboardHapticsEnabled.value = enabled settingsRepository.putBoolean(SettingsRepository.KEY_KEYBOARD_HAPTICS_ENABLED, enabled) } + /** + * Executes the set keyboard functions bottom operation. + * + * @param isBottom [Boolean] Target is bottom. + * @param context [Context] Target context. + */ fun setKeyboardFunctionsBottom(isBottom: Boolean, context: Context) { isKeyboardFunctionsBottom.value = isBottom settingsRepository.putBoolean(SettingsRepository.KEY_KEYBOARD_FUNCTIONS_BOTTOM, isBottom) } + /** + * Executes the set keyboard functions padding operation. + * + * @param padding [Float] Target padding. + * @param context [Context] Target context. + */ fun setKeyboardFunctionsPadding(padding: Float, context: Context) { keyboardFunctionsPadding.floatValue = padding settingsRepository.putFloat(SettingsRepository.KEY_KEYBOARD_FUNCTIONS_PADDING, padding) } + /** + * Executes the set keyboard haptic strength operation. + * + * @param strength [Float] Target strength. + * @param context [Context] Target context. + */ fun setKeyboardHapticStrength(strength: Float, context: Context) { keyboardHapticStrength.floatValue = strength settingsRepository.putFloat(SettingsRepository.KEY_KEYBOARD_HAPTIC_STRENGTH, strength) } + /** + * Executes the set keyboard shape operation. + * + * @param shape [Int] Target shape. + * @param context [Context] Target context. + */ fun setKeyboardShape(shape: Int, context: Context) { keyboardShape.intValue = shape settingsRepository.putInt(SettingsRepository.KEY_KEYBOARD_SHAPE, shape) } + /** + * Executes the set keyboard always dark operation. + * + * @param enabled [Boolean] Target enabled. + * @param context [Context] Target context. + */ fun setKeyboardAlwaysDark(enabled: Boolean, context: Context) { isKeyboardAlwaysDark.value = enabled settingsRepository.putBoolean(SettingsRepository.KEY_KEYBOARD_ALWAYS_DARK, enabled) } + /** + * Executes the set keyboard pitch black operation. + * + * @param enabled [Boolean] Target enabled. + * @param context [Context] Target context. + */ fun setKeyboardPitchBlack(enabled: Boolean, context: Context) { isKeyboardPitchBlack.value = enabled settingsRepository.putBoolean(SettingsRepository.KEY_KEYBOARD_PITCH_BLACK, enabled) } + /** + * Executes the set keyboard clipboard enabled operation. + * + * @param enabled [Boolean] Target enabled. + * @param context [Context] Target context. + */ fun setKeyboardClipboardEnabled(enabled: Boolean, context: Context) { isKeyboardClipboardEnabled.value = enabled settingsRepository.putBoolean(SettingsRepository.KEY_KEYBOARD_CLIPBOARD_ENABLED, enabled) } + /** + * Executes the set air sync connection enabled operation. + * + * @param enabled [Boolean] Target enabled. + * @param context [Context] Target context. + */ fun setAirSyncConnectionEnabled(enabled: Boolean, context: Context) { if (enabled) { // Request permission if not granted, though it's signature level so should be automatic if signed correctly @@ -3866,6 +4888,12 @@ class MainViewModel : ViewModel() { settingsRepository.putBoolean(SettingsRepository.KEY_AIRSYNC_CONNECTION_ENABLED, enabled) } + /** + * Executes the set bluetooth devices enabled operation. + * + * @param enabled [Boolean] Target enabled. + * @param context [Context] Target context. + */ fun setBluetoothDevicesEnabled(enabled: Boolean, context: Context) { isBluetoothDevicesEnabled.value = enabled settingsRepository.setBluetoothDevicesEnabled(enabled) @@ -3880,6 +4908,12 @@ class MainViewModel : ViewModel() { context.sendBroadcast(intent) } + /** + * Executes the set battery widget max devices operation. + * + * @param count [Int] Target count. + * @param context [Context] Target context. + */ fun setBatteryWidgetMaxDevices(count: Int, context: Context) { batteryWidgetMaxDevices.intValue = count settingsRepository.setBatteryWidgetMaxDevices(count) @@ -3894,6 +4928,12 @@ class MainViewModel : ViewModel() { context.sendBroadcast(intent) } + /** + * Executes the set battery widget background enabled operation. + * + * @param enabled [Boolean] Target enabled. + * @param context [Context] Target context. + */ fun setBatteryWidgetBackgroundEnabled(enabled: Boolean, context: Context) { isBatteryWidgetBackgroundEnabled.value = enabled settingsRepository.setBatteryWidgetBackgroundEnabled(enabled) @@ -3913,10 +4953,21 @@ class MainViewModel : ViewModel() { return PermissionUtils.isAccessibilityServiceEnabled(context) } + /** + * Executes the can write secure settings operation. + * + * @param context [Context] Target context. + * @return The resulting Boolean data. + */ fun canWriteSecureSettings(context: Context): Boolean { return PermissionUtils.canWriteSecureSettings(context) } + /** + * Executes the request read phone state permission operation. + * + * @param activity [androidx.activity.ComponentActivity] Target activity. + */ fun requestReadPhoneStatePermission(activity: androidx.activity.ComponentActivity) { androidx.core.app.ActivityCompat.requestPermissions( activity, @@ -3925,6 +4976,11 @@ class MainViewModel : ViewModel() { ) } + /** + * Executes the request location permission operation. + * + * @param activity [androidx.activity.ComponentActivity] Target activity. + */ fun requestLocationPermission(activity: androidx.activity.ComponentActivity) { androidx.core.app.ActivityCompat.requestPermissions( activity, @@ -3936,6 +4992,11 @@ class MainViewModel : ViewModel() { ) } + /** + * Executes the request background location permission operation. + * + * @param activity [androidx.activity.ComponentActivity] Target activity. + */ fun requestBackgroundLocationPermission(activity: androidx.activity.ComponentActivity) { if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.Q) { androidx.core.app.ActivityCompat.requestPermissions( @@ -3946,6 +5007,11 @@ class MainViewModel : ViewModel() { } } + /** + * Executes the request bluetooth permission operation. + * + * @param activity [androidx.activity.ComponentActivity] Target activity. + */ fun requestBluetoothPermission(activity: androidx.activity.ComponentActivity) { androidx.core.app.ActivityCompat.requestPermissions( activity, @@ -3958,6 +5024,11 @@ class MainViewModel : ViewModel() { ) } + /** + * Executes the request calendar permission operation. + * + * @param activity [androidx.activity.ComponentActivity] Target activity. + */ fun requestCalendarPermission(activity: androidx.activity.ComponentActivity) { androidx.core.app.ActivityCompat.requestPermissions( activity, @@ -3966,6 +5037,11 @@ class MainViewModel : ViewModel() { ) } + /** + * Executes the request notification permission operation. + * + * @param activity [androidx.activity.ComponentActivity] Target activity. + */ fun requestNotificationPermission(activity: androidx.activity.ComponentActivity) { if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.TIRAMISU) { androidx.core.app.ActivityCompat.requestPermissions( @@ -3976,6 +5052,11 @@ class MainViewModel : ViewModel() { } } + /** + * Executes the request full screen intent permission operation. + * + * @param context [Context] Target context. + */ fun requestFullScreenIntentPermission(context: Context) { if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.UPSIDE_DOWN_CAKE) { try { @@ -3997,6 +5078,11 @@ class MainViewModel : ViewModel() { return PermissionUtils.hasNotificationListenerPermission(context) } + /** + * Executes the request notification listener permission operation. + * + * @param context [Context] Target context. + */ fun requestNotificationListenerPermission(context: Context) { val intent = Intent(Settings.ACTION_NOTIFICATION_LISTENER_SETTINGS).apply { flags = Intent.FLAG_ACTIVITY_NEW_TASK @@ -4004,11 +5090,20 @@ class MainViewModel : ViewModel() { context.startActivity(intent) } + /** + * Executes the request shizuku permission operation. + */ fun requestShizukuPermission() { ShizukuUtils.requestPermission() isShizukuPermissionGranted.value = ShizukuUtils.hasPermission() } + /** + * Executes the grant write secure settings with shizuku operation. + * + * @param context [Context] Target context. + * @return The resulting Boolean data. + */ fun grantWriteSecureSettingsWithShizuku(context: Context): Boolean { val success = ShizukuUtils.grantWriteSecureSettingsPermission() if (success) { @@ -4019,15 +5114,30 @@ class MainViewModel : ViewModel() { return success } + /** + * Executes the check caffeinate active operation. + * + * @param context [Context] Target context. + */ fun checkCaffeinateActive(context: Context) { isCaffeinateActive.value = isCaffeinateServiceRunning(context) } + /** + * Executes the start caffeinate operation. + * + * @param context [Context] Target context. + */ fun startCaffeinate(context: Context) { context.startService(Intent(context, CaffeinateWakeLockService::class.java)) isCaffeinateActive.value = true } + /** + * Executes the stop caffeinate operation. + * + * @param context [Context] Target context. + */ fun stopCaffeinate(context: Context) { context.stopService(Intent(context, CaffeinateWakeLockService::class.java)) isCaffeinateActive.value = false @@ -4060,6 +5170,12 @@ class MainViewModel : ViewModel() { settingsRepository.saveNotificationLightingSelectedApps(apps) } + /** + * Executes the load notification lighting selected apps operation. + * + * @param context [Context] Target context. + * @return The resulting List data. + */ fun loadNotificationLightingSelectedApps(context: Context): List { return settingsRepository.loadNotificationLightingSelectedApps() } @@ -4072,14 +5188,33 @@ class MainViewModel : ViewModel() { settingsRepository.updateNotificationLightingAppSelection(packageName, enabled) } + /** + * Executes the load flashlight pulse selected apps operation. + * + * @param context [Context] Target context. + * @return The resulting List data. + */ fun loadFlashlightPulseSelectedApps(context: Context): List { return settingsRepository.loadFlashlightPulseSelectedApps() } + /** + * Executes the save flashlight pulse selected apps operation. + * + * @param context [Context] Target context. + * @param apps [List] Target apps. + */ fun saveFlashlightPulseSelectedApps(context: Context, apps: List) { settingsRepository.saveFlashlightPulseSelectedApps(apps) } + /** + * Executes the update flashlight pulse app enabled operation. + * + * @param context [Context] Target context. + * @param packageName [String] Target package name. + * @param enabled [Boolean] Target enabled. + */ fun updateFlashlightPulseAppEnabled(context: Context, packageName: String, enabled: Boolean) { settingsRepository.updateFlashlightPulseAppSelection(packageName, enabled) } @@ -4089,6 +5224,12 @@ class MainViewModel : ViewModel() { settingsRepository.putFloat(SettingsRepository.KEY_EDGE_LIGHTING_CORNER_RADIUS, radiusDp) } + /** + * Executes the load notification lighting corner radius operation. + * + * @param context [Context] Target context. + * @return The resulting Float data. + */ fun loadNotificationLightingCornerRadius(context: Context): Float { return settingsRepository.getFloat(SettingsRepository.KEY_EDGE_LIGHTING_CORNER_RADIUS, 20f) } @@ -4101,6 +5242,12 @@ class MainViewModel : ViewModel() { ) } + /** + * Executes the load notification lighting stroke thickness operation. + * + * @param context [Context] Target context. + * @return The resulting Float data. + */ fun loadNotificationLightingStrokeThickness(context: Context): Float { return settingsRepository.getFloat( SettingsRepository.KEY_EDGE_LIGHTING_STROKE_THICKNESS, @@ -4113,10 +5260,23 @@ class MainViewModel : ViewModel() { settingsRepository.saveDynamicNightLightSelectedApps(apps) } + /** + * Executes the load dynamic night light selected apps operation. + * + * @param context [Context] Target context. + * @return The resulting List data. + */ fun loadDynamicNightLightSelectedApps(context: Context): List { return settingsRepository.loadDynamicNightLightSelectedApps() } + /** + * Executes the update dynamic night light app enabled operation. + * + * @param context [Context] Target context. + * @param packageName [String] Target package name. + * @param enabled [Boolean] Target enabled. + */ fun updateDynamicNightLightAppEnabled(context: Context, packageName: String, enabled: Boolean) { settingsRepository.updateDynamicNightLightAppSelection(packageName, enabled) } @@ -4126,10 +5286,23 @@ class MainViewModel : ViewModel() { settingsRepository.saveAppLockSelectedApps(apps) } + /** + * Executes the load app lock selected apps operation. + * + * @param context [Context] Target context. + * @return The resulting List data. + */ fun loadAppLockSelectedApps(context: Context): List { return settingsRepository.loadAppLockSelectedApps() } + /** + * Executes the update app lock app enabled operation. + * + * @param context [Context] Target context. + * @param packageName [String] Target package name. + * @param enabled [Boolean] Target enabled. + */ fun updateAppLockAppEnabled(context: Context, packageName: String, enabled: Boolean) { settingsRepository.updateAppLockAppSelection(packageName, enabled) } @@ -4143,10 +5316,23 @@ class MainViewModel : ViewModel() { ) // Full refresh if list structure changes significantly } + /** + * Executes the load freeze selected apps operation. + * + * @param context [Context] Target context. + * @return The resulting List data. + */ fun loadFreezeSelectedApps(context: Context): List { return settingsRepository.loadFreezeSelectedApps() } + /** + * Executes the update freeze app enabled operation. + * + * @param context [Context] Target context. + * @param packageName [String] Target package name. + * @param enabled [Boolean] Target enabled. + */ fun updateFreezeAppEnabled(context: Context, packageName: String, enabled: Boolean) { settingsRepository.updateFreezeAppSelection(packageName, enabled) refreshFreezePickedApps(context, silent = true) @@ -4171,7 +5357,8 @@ class MainViewModel : ViewModel() { } private fun syncNeverAutoFreezeApps(context: Context) { - val neverAutoFreezeTagIds = freezeTags.value.filter { it.neverAutoFreeze }.map { it.id }.toSet() + val neverAutoFreezeTagIds = + freezeTags.value.filter { it.neverAutoFreeze }.map { it.id }.toSet() if (neverAutoFreezeTagIds.isEmpty()) return val currentExcluded = freezeAutoExcludedApps.value.toMutableSet() @@ -4190,6 +5377,12 @@ class MainViewModel : ViewModel() { } } + /** + * Executes the add freeze tag operation. + * + * @param context [Context] Target context. + * @param tag [com.sameerasw.essentials.domain.model.AppTag] Target tag. + */ fun addFreezeTag(context: Context, tag: com.sameerasw.essentials.domain.model.AppTag) { val updated = freezeTags.value + tag freezeTags.value = updated @@ -4197,6 +5390,12 @@ class MainViewModel : ViewModel() { syncNeverAutoFreezeApps(context) } + /** + * Executes the update freeze tag operation. + * + * @param context [Context] Target context. + * @param tag [com.sameerasw.essentials.domain.model.AppTag] Target tag. + */ fun updateFreezeTag(context: Context, tag: com.sameerasw.essentials.domain.model.AppTag) { val updated = freezeTags.value.map { if (it.id == tag.id) tag else it } freezeTags.value = updated @@ -4204,6 +5403,12 @@ class MainViewModel : ViewModel() { syncNeverAutoFreezeApps(context) } + /** + * Executes the delete freeze tag operation. + * + * @param context [Context] Target context. + * @param tagId [String] Target tag id. + */ fun deleteFreezeTag(context: Context, tagId: String) { val updatedTags = freezeTags.value.filter { it.id != tagId } freezeTags.value = updatedTags @@ -4216,6 +5421,13 @@ class MainViewModel : ViewModel() { settingsRepository.saveFreezeAppTagMap(updatedMap) } + /** + * Executes the set app tags operation. + * + * @param context [Context] Target context. + * @param packageName [String] Target package name. + * @param tagIds [List] Target tag ids. + */ fun setAppTags(context: Context, packageName: String, tagIds: List) { val currentMap = freezeAppTagMap.value.toMutableMap() if (tagIds.isEmpty()) { @@ -4228,11 +5440,25 @@ class MainViewModel : ViewModel() { syncNeverAutoFreezeApps(context) } + /** + * Executes the set freeze tag color coded operation. + * + * @param enabled [Boolean] Target enabled. + */ fun setFreezeTagColorCoded(enabled: Boolean) { isFreezeTagColorCodedEnabled.value = enabled - settingsRepository.putBoolean(SettingsRepository.KEY_FREEZE_TAG_COLOR_CODED_ENABLED, enabled) + settingsRepository.putBoolean( + SettingsRepository.KEY_FREEZE_TAG_COLOR_CODED_ENABLED, + enabled + ) } + /** + * Executes the refresh freeze picked apps operation. + * + * @param context [Context] Target context. + * @param silent [Boolean] Target silent. + */ fun refreshFreezePickedApps(context: Context, silent: Boolean = false) { viewModelScope.launch { if (!silent) isFreezePickedAppsLoading.value = true @@ -4278,30 +5504,56 @@ class MainViewModel : ViewModel() { } } + /** + * Executes the freeze all auto operation. + * + * @param context [Context] Target context. + */ fun freezeAllAuto(context: Context) { viewModelScope.launch(Dispatchers.IO) { com.sameerasw.essentials.utils.FreezeManager.freezeAll(context) } } + /** + * Executes the unfreeze all auto operation. + * + * @param context [Context] Target context. + */ fun unfreezeAllAuto(context: Context) { viewModelScope.launch(Dispatchers.IO) { com.sameerasw.essentials.utils.FreezeManager.unfreezeAll(context) } } + /** + * Executes the freeze all manual operation. + * + * @param context [Context] Target context. + */ fun freezeAllManual(context: Context) { viewModelScope.launch(Dispatchers.IO) { com.sameerasw.essentials.utils.FreezeManager.freezeAllManual(context) } } + /** + * Executes the unfreeze all manual operation. + * + * @param context [Context] Target context. + */ fun unfreezeAllManual(context: Context) { viewModelScope.launch(Dispatchers.IO) { com.sameerasw.essentials.utils.FreezeManager.unfreezeAllManual(context) } } + /** + * Executes the launch and unfreeze app operation. + * + * @param context [Context] Target context. + * @param packageName [String] Target package name. + */ fun launchAndUnfreezeApp(context: Context, packageName: String) { viewModelScope.launch(Dispatchers.IO) { val isFrozen = @@ -4320,6 +5572,11 @@ class MainViewModel : ViewModel() { } } + /** + * Executes the freeze all apps operation. + * + * @param context [Context] Target context. + */ fun freezeAllApps(context: Context) { viewModelScope.launch(Dispatchers.IO) { com.sameerasw.essentials.utils.FreezeManager.freezeAllManual(context) @@ -4327,6 +5584,11 @@ class MainViewModel : ViewModel() { } } + /** + * Executes the unfreeze all apps operation. + * + * @param context [Context] Target context. + */ fun unfreezeAllApps(context: Context) { viewModelScope.launch(Dispatchers.IO) { com.sameerasw.essentials.utils.FreezeManager.unfreezeAllManual(context) @@ -4334,6 +5596,11 @@ class MainViewModel : ViewModel() { } } + /** + * Executes the freeze automatic apps operation. + * + * @param context [Context] Target context. + */ fun freezeAutomaticApps(context: Context) { viewModelScope.launch(Dispatchers.IO) { com.sameerasw.essentials.utils.FreezeManager.freezeAll(context) @@ -4341,6 +5608,12 @@ class MainViewModel : ViewModel() { } } + /** + * Executes the any apps currently frozen operation. + * + * @param context [Context] Target context. + * @return The resulting Boolean data. + */ fun anyAppsCurrentlyFrozen(context: Context): Boolean { val picked = freezePickedApps.value return picked.any { @@ -4351,11 +5624,22 @@ class MainViewModel : ViewModel() { } } + /** + * Executes the set freeze mode operation. + * + * @param mode [Int] Target mode. + * @param context [Context] Target context. + */ fun setFreezeMode(mode: Int, context: Context) { freezeMode.intValue = mode settingsRepository.putInt(SettingsRepository.KEY_FREEZE_MODE, mode) } + /** + * Executes the load snooze channels operation. + * + * @param context [Context] Target context. + */ fun loadSnoozeChannels(context: Context) { val discovered = settingsRepository.loadSnoozeDiscoveredChannels() val blocked = settingsRepository.loadSnoozeBlockedChannels() @@ -4367,6 +5651,13 @@ class MainViewModel : ViewModel() { snoozeChannels.value = channels.distinctBy { it.id }.sortedBy { it.name } } + /** + * Executes the set snooze channel blocked operation. + * + * @param channelId [String] Target channel id. + * @param blocked [Boolean] Target blocked. + * @param context [Context] Target context. + */ fun setSnoozeChannelBlocked(channelId: String, blocked: Boolean, context: Context) { val currentBlocked = settingsRepository.loadSnoozeBlockedChannels().toMutableSet() if (blocked) { @@ -4387,6 +5678,13 @@ class MainViewModel : ViewModel() { }.distinctBy { it.id }.sortedBy { it.name } } + /** + * Executes the set maps channel detected operation. + * + * @param channelId [String] Target channel id. + * @param detected [Boolean] Target detected. + * @param context [Context] Target context. + */ fun setMapsChannelDetected(channelId: String, detected: Boolean, context: Context) { val currentDetected = settingsRepository.loadMapsDetectionChannels().toMutableSet() if (detected) { @@ -4398,11 +5696,23 @@ class MainViewModel : ViewModel() { loadMapsChannels(context) } + /** + * Executes the set snooze heads up enabled operation. + * + * @param enabled [Boolean] Target enabled. + * @param context [Context] Target context. + */ fun setSnoozeHeadsUpEnabled(enabled: Boolean, context: Context) { isSnoozeHeadsUpEnabled.value = enabled settingsRepository.putBoolean(SettingsRepository.KEY_SNOOZE_HEADS_UP_ENABLED, enabled) } + /** + * Executes the set flashlight always turn off enabled operation. + * + * @param enabled [Boolean] Target enabled. + * @param context [Context] Target context. + */ fun setFlashlightAlwaysTurnOffEnabled(enabled: Boolean, context: Context) { isFlashlightAlwaysTurnOffEnabled.value = enabled settingsRepository.putBoolean( @@ -4411,6 +5721,12 @@ class MainViewModel : ViewModel() { ) } + /** + * Executes the set flashlight pocket turn off enabled operation. + * + * @param enabled [Boolean] Target enabled. + * @param context [Context] Target context. + */ fun setFlashlightPocketTurnOffEnabled(enabled: Boolean, context: Context) { isFlashlightPocketTurnOffEnabled.value = enabled settingsRepository.putBoolean( @@ -4419,6 +5735,12 @@ class MainViewModel : ViewModel() { ) } + /** + * Executes the set flashlight overheat enabled operation. + * + * @param enabled [Boolean] Target enabled. + * @param context [Context] Target context. + */ fun setFlashlightOverheatEnabled(enabled: Boolean, context: Context) { isFlashlightOverheatEnabled.value = enabled settingsRepository.putBoolean( @@ -4427,11 +5749,23 @@ class MainViewModel : ViewModel() { ) } + /** + * Executes the set flashlight fade enabled operation. + * + * @param enabled [Boolean] Target enabled. + * @param context [Context] Target context. + */ fun setFlashlightFadeEnabled(enabled: Boolean, context: Context) { isFlashlightFadeEnabled.value = enabled settingsRepository.putBoolean(SettingsRepository.KEY_FLASHLIGHT_FADE_ENABLED, enabled) } + /** + * Executes the set flashlight adjust enabled operation. + * + * @param enabled [Boolean] Target enabled. + * @param context [Context] Target context. + */ fun setFlashlightAdjustEnabled(enabled: Boolean, context: Context) { isFlashlightAdjustEnabled.value = enabled settingsRepository.putBoolean( @@ -4440,11 +5774,23 @@ class MainViewModel : ViewModel() { ) } + /** + * Executes the set flashlight global enabled operation. + * + * @param enabled [Boolean] Target enabled. + * @param context [Context] Target context. + */ fun setFlashlightGlobalEnabled(enabled: Boolean, context: Context) { isFlashlightGlobalEnabled.value = enabled settingsRepository.putBoolean(SettingsRepository.KEY_FLASHLIGHT_GLOBAL_ENABLED, enabled) } + /** + * Executes the set flashlight live update enabled operation. + * + * @param enabled [Boolean] Target enabled. + * @param context [Context] Target context. + */ fun setFlashlightLiveUpdateEnabled(enabled: Boolean, context: Context) { isFlashlightLiveUpdateEnabled.value = enabled settingsRepository.putBoolean( @@ -4453,12 +5799,24 @@ class MainViewModel : ViewModel() { ) } + /** + * Executes the set flashlight last intensity operation. + * + * @param intensity [Int] Target intensity. + * @param context [Context] Target context. + */ fun setFlashlightLastIntensity(intensity: Int, context: Context) { flashlightLastIntensity.value = intensity settingsRepository.putInt(SettingsRepository.KEY_FLASHLIGHT_LAST_INTENSITY, intensity) } + /** + * Executes the set screen locked security enabled operation. + * + * @param enabled [Boolean] Target enabled. + * @param context [Context] Target context. + */ fun setScreenLockedSecurityEnabled(enabled: Boolean, context: Context) { isScreenLockedSecurityEnabled.value = enabled settingsRepository.putBoolean( @@ -4473,21 +5831,45 @@ class MainViewModel : ViewModel() { } } + /** + * Executes the set notification lighting glow sides operation. + * + * @param sides [Set] Target sides. + * @param context [Context] Target context. + */ fun setNotificationLightingGlowSides(sides: Set, context: Context) { notificationLightingGlowSides.value = sides settingsRepository.saveNotificationLightingGlowSides(sides) } + /** + * Executes the save notification lighting indicator x operation. + * + * @param context [Context] Target context. + * @param x [Float] Target x. + */ fun saveNotificationLightingIndicatorX(context: Context, x: Float) { notificationLightingIndicatorX.value = x settingsRepository.putFloat(SettingsRepository.KEY_EDGE_LIGHTING_INDICATOR_X, x) } + /** + * Executes the save notification lighting indicator y operation. + * + * @param context [Context] Target context. + * @param y [Float] Target y. + */ fun saveNotificationLightingIndicatorY(context: Context, y: Float) { notificationLightingIndicatorY.value = y settingsRepository.putFloat(SettingsRepository.KEY_EDGE_LIGHTING_INDICATOR_Y, y) } + /** + * Executes the save notification lighting indicator scale operation. + * + * @param context [Context] Target context. + * @param scale [Float] Target scale. + */ fun saveNotificationLightingIndicatorScale(context: Context, scale: Float) { notificationLightingIndicatorScale.value = scale settingsRepository.putFloat(SettingsRepository.KEY_EDGE_LIGHTING_INDICATOR_SCALE, scale) @@ -4501,11 +5883,23 @@ class MainViewModel : ViewModel() { settingsRepository.saveNotificationLightingSweepPosition(position) } + /** + * Executes the save notification lighting sweep thickness operation. + * + * @param context [Context] Target context. + * @param thickness [Float] Target thickness. + */ fun saveNotificationLightingSweepThickness(context: Context, thickness: Float) { notificationLightingSweepThickness.floatValue = thickness settingsRepository.putFloat(SettingsRepository.KEY_EDGE_LIGHTING_SWEEP_THICKNESS, thickness) } + /** + * Executes the save notification lighting sweep random shapes operation. + * + * @param context [Context] Target context. + * @param enabled [Boolean] Target enabled. + */ fun saveNotificationLightingSweepRandomShapes(context: Context, enabled: Boolean) { notificationLightingSweepRandomShapes.value = enabled settingsRepository.putBoolean( @@ -4514,12 +5908,23 @@ class MainViewModel : ViewModel() { ) } + /** + * Executes the save edge lighting sweep selected shapes operation. + * + * @param shapes [Set] Target shapes. + */ fun saveEdgeLightingSweepSelectedShapes(shapes: Set) { edgeLightingSweepSelectedShapes.value = shapes settingsRepository.saveEdgeLightingSweepSelectedShapes(shapes) } + /** + * Executes the export configs operation. + * + * @param context [Context] Target context. + * @param outputStream [java.io.OutputStream] Target output stream. + */ fun exportConfigs(context: Context, outputStream: java.io.OutputStream) { settingsRepository.exportConfigs(outputStream) } @@ -4545,6 +5950,11 @@ class MainViewModel : ViewModel() { val appTagMap: Map> = emptyMap() ) + /** + * Executes the export freeze apps operation. + * + * @param outputStream [java.io.OutputStream] Target output stream. + */ fun exportFreezeApps(outputStream: java.io.OutputStream) { try { val apps = settingsRepository.loadFreezeSelectedApps() @@ -4565,6 +5975,13 @@ class MainViewModel : ViewModel() { } } + /** + * Executes the import freeze apps operation. + * + * @param context [Context] Target context. + * @param inputStream [java.io.InputStream] Target input stream. + * @return The resulting Boolean data. + */ fun importFreezeApps(context: Context, inputStream: java.io.InputStream): Boolean { return try { val json = inputStream.bufferedReader().use { it.readText() } @@ -4636,51 +6053,103 @@ class MainViewModel : ViewModel() { } } + /** + * Executes the set auto accessibility enabled operation. + * + * @param isEnabled [Boolean] Target is enabled. + * @param context [Context] Target context. + */ fun setAutoAccessibilityEnabled(isEnabled: Boolean, context: Context) { settingsRepository.putBoolean(SettingsRepository.KEY_AUTO_ACCESSIBILITY_ENABLED, isEnabled) isAutoAccessibilityEnabled.value = isEnabled } + /** + * Executes the generate bug report operation. + * + * @param context [Context] Target context. + * @return The resulting String data. + */ fun generateBugReport(context: Context): String { val settingsJson = settingsRepository.getAllConfigsAsJsonString() return com.sameerasw.essentials.utils.LogManager.generateReport(context, settingsJson) } + /** + * Executes the set aod enabled operation. + * + * @param enabled [Boolean] Target enabled. + */ fun setAodEnabled(enabled: Boolean) { isAodEnabled.value = enabled settingsRepository.setAodEnabled(enabled) } + /** + * Executes the toggle notification glance enabled operation. + * + * @param enabled [Boolean] Target enabled. + */ fun toggleNotificationGlanceEnabled(enabled: Boolean) { settingsRepository.putBoolean(SettingsRepository.KEY_NOTIFICATION_GLANCE_ENABLED, enabled) isNotificationGlanceEnabled.value = enabled } + /** + * Executes the toggle aod force turn off enabled operation. + * + * @param enabled [Boolean] Target enabled. + */ fun toggleAodForceTurnOffEnabled(enabled: Boolean) { settingsRepository.putBoolean(SettingsRepository.KEY_AOD_FORCE_TURN_OFF_ENABLED, enabled) isAodForceTurnOffEnabled.value = enabled } + /** + * Executes the set pocket mode enabled operation. + * + * @param enabled [Boolean] Target enabled. + */ fun setPocketModeEnabled(enabled: Boolean) { settingsRepository.putBoolean(SettingsRepository.KEY_POCKET_MODE_ENABLED, enabled) isPocketModeEnabled.value = enabled } + /** + * Executes the set pocket mode use light sensor operation. + * + * @param enabled [Boolean] Target enabled. + */ fun setPocketModeUseLightSensor(enabled: Boolean) { settingsRepository.putBoolean(SettingsRepository.KEY_POCKET_MODE_USE_LIGHT_SENSOR, enabled) isPocketModeUseLightSensor.value = enabled } + /** + * Executes the set pocket mode trigger delay operation. + * + * @param seconds [Float] Target seconds. + */ fun setPocketModeTriggerDelay(seconds: Float) { pocketModeTriggerDelay.floatValue = seconds settingsRepository.putFloat(SettingsRepository.KEY_POCKET_MODE_TRIGGER_DELAY, seconds) } + /** + * Executes the set pocket mode lock screen only operation. + * + * @param enabled [Boolean] Target enabled. + */ fun setPocketModeLockScreenOnly(enabled: Boolean) { settingsRepository.putBoolean(SettingsRepository.KEY_POCKET_MODE_LOCK_SCREEN_ONLY, enabled) isPocketModeLockScreenOnly.value = enabled } + /** + * Executes the set notification glance same as lighting enabled operation. + * + * @param enabled [Boolean] Target enabled. + */ fun setNotificationGlanceSameAsLightingEnabled(enabled: Boolean) { isNotificationGlanceSameAsLightingEnabled.value = enabled settingsRepository.putBoolean( @@ -4689,10 +6158,22 @@ class MainViewModel : ViewModel() { ) } + /** + * Executes the load notification glance selected apps operation. + * + * @param context [Context] Target context. + * @return The resulting List data. + */ fun loadNotificationGlanceSelectedApps(context: Context): List { return settingsRepository.loadNotificationGlanceSelectedApps() } + /** + * Executes the save notification glance selected apps operation. + * + * @param context [Context] Target context. + * @param apps [List] Target apps. + */ fun saveNotificationGlanceSelectedApps(context: Context, apps: List) { settingsRepository.saveNotificationGlanceSelectedApps(apps) } @@ -4705,10 +6186,22 @@ class MainViewModel : ViewModel() { settingsRepository.updateNotificationGlanceAppSelection(packageName, enabled) } + /** + * Executes the load pocket mode excluded apps operation. + * + * @param context [Context] Target context. + * @return The resulting List data. + */ fun loadPocketModeExcludedApps(context: Context): List { return settingsRepository.loadPocketModeExcludedApps() } + /** + * Executes the save pocket mode excluded apps operation. + * + * @param context [Context] Target context. + * @param apps [List] Target apps. + */ fun savePocketModeExcludedApps(context: Context, apps: List) { settingsRepository.savePocketModeExcludedApps(apps) } @@ -4740,6 +6233,12 @@ class MainViewModel : ViewModel() { } } + /** + * Executes the set onboarding completed operation. + * + * @param completed [Boolean] Target completed. + * @param context [Context] Target context. + */ fun setOnboardingCompleted(completed: Boolean, context: Context) { isOnboardingCompleted.value = completed settingsRepository.putBoolean(SettingsRepository.KEY_ONBOARDING_COMPLETED, completed) @@ -4751,6 +6250,9 @@ class MainViewModel : ViewModel() { } } + /** + * Executes the complete whats new operation. + */ fun completeWhatsNew() { isWhatsNewVisible.value = false settingsRepository.putInt( @@ -4759,26 +6261,50 @@ class MainViewModel : ViewModel() { ) } + /** + * Executes the reset onboarding operation. + * + * @param context [Context] Target context. + */ fun resetOnboarding(context: Context) { setOnboardingCompleted(false, context) // Reset tab to ESSENTIALS setDefaultTab(com.sameerasw.essentials.domain.DIYTabs.ESSENTIALS, context) } + /** + * Executes the reset update note operation. + * + * @param context [Context] Target context. + */ fun resetUpdateNote(context: Context) { settingsRepository.putInt(SettingsRepository.KEY_WHATS_NEW_LAST_SHOWN_COUNTER, 0) } + /** + * Executes the reset dns presets operation. + */ fun resetDnsPresets() { settingsRepository.resetPrivateDnsPresets() } + /** + * Executes the add dns preset operation. + * + * @param name [String] Target name. + * @param hostname [String] Target hostname. + */ fun addDnsPreset(name: String, hostname: String) { val current = settingsRepository.getPrivateDnsPresets().toMutableList() current.add(DnsPreset(name = name, hostname = hostname)) settingsRepository.savePrivateDnsPresets(current) } + /** + * Executes the remove dns preset operation. + * + * @param preset [DnsPreset] Target preset. + */ fun removeDnsPreset(preset: DnsPreset) { val current = settingsRepository.getPrivateDnsPresets().toMutableList() current.removeAll { it.id == preset.id } @@ -4803,6 +6329,9 @@ class MainViewModel : ViewModel() { val isWallpaperLoading = mutableStateOf(false) private val wallpaperRepository = com.sameerasw.essentials.data.repository.WallpaperRepository() + /** + * Executes the load cached wallpaper operation. + */ fun loadCachedWallpaper() { if (!::settingsRepository.isInitialized) return val id = @@ -4836,6 +6365,11 @@ class MainViewModel : ViewModel() { ) } + /** + * Executes the fetch today wallpaper operation. + * + * @param context [Context] Target context. + */ fun fetchTodayWallpaper(context: Context) { viewModelScope.launch { isWallpaperLoading.value = true @@ -4875,6 +6409,13 @@ class MainViewModel : ViewModel() { } } + /** + * Executes the apply wallpaper operation. + * + * @param context [Context] Target context. + * @param url [String] Target url. + * @param onResult [(Boolean] Target on result. + */ fun applyWallpaper(context: Context, url: String, onResult: (Boolean) -> Unit) { viewModelScope.launch { isWallpaperLoading.value = true @@ -4888,12 +6429,21 @@ class MainViewModel : ViewModel() { val dailyWallpaperAutoUpdateTime = mutableStateOf(null) val isDailyWallpaperShowLastTime = mutableStateOf(false) + /** + * Executes the set daily wallpaper show last time operation. + */ fun setDailyWallpaperShowLastTime() { val status = !isDailyWallpaperShowLastTime.value isDailyWallpaperShowLastTime.value = status settingsRepository.putBoolean(SettingsRepository.KEY_DAILY_WALLPAPER_SHOW_LAST_TIME, status) } + /** + * Executes the set daily wallpaper auto update operation. + * + * @param enabled [Boolean] Target enabled. + * @param context [Context] Target context. + */ fun setDailyWallpaperAutoUpdate(enabled: Boolean, context: Context) { isDailyWallpaperAutoUpdateEnabled.value = enabled settingsRepository.putBoolean(SettingsRepository.KEY_DAILY_WALLPAPER_AUTO_UPDATE, enabled) @@ -4973,6 +6523,11 @@ class MainViewModel : ViewModel() { } + /** + * Executes the load battery saver constants operation. + * + * @param context [Context] Target context. + */ fun loadBatterySaverConstants(context: Context) { val constantsStr = Settings.Global.getString(context.contentResolver, "battery_saver_constants") ?: "" @@ -4988,18 +6543,36 @@ class MainViewModel : ViewModel() { batterySaverConstants.value = map } + /** + * Executes the update battery saver constant operation. + * + * @param context [Context] Target context. + * @param key [String] Target key. + * @param value [String] Target value. + */ fun updateBatterySaverConstant(context: Context, key: String, value: String) { val currentMap = batterySaverConstants.value.toMutableMap() currentMap[key] = value saveBatterySaverConstants(context, currentMap) } + /** + * Executes the remove battery saver constant operation. + * + * @param context [Context] Target context. + * @param key [String] Target key. + */ fun removeBatterySaverConstant(context: Context, key: String) { val currentMap = batterySaverConstants.value.toMutableMap() currentMap.remove(key) saveBatterySaverConstants(context, currentMap) } + /** + * Executes the reset battery saver constants operation. + * + * @param context [Context] Target context. + */ fun resetBatterySaverConstants(context: Context) { try { Settings.Global.putString(context.contentResolver, "battery_saver_constants", null) @@ -5023,12 +6596,23 @@ class MainViewModel : ViewModel() { } } + /** + * Executes the sync audio safe volume state operation. + * + * @param context [Context] Target context. + */ fun syncAudioSafeVolumeState(context: Context) { val rawValue = Settings.Global.getInt(context.contentResolver, "audio_safe_volume_state", 3) // 1 = Disable (toggle is on), 3 = Active (toggle is off) isAudioSafeVolumeDisabled.value = (rawValue == 1) } + /** + * Executes the set audio safe volume disabled operation. + * + * @param context [Context] Target context. + * @param disabled [Boolean] Target disabled. + */ fun setAudioSafeVolumeDisabled(context: Context, disabled: Boolean) { val targetValue = if (disabled) 1 else 3 try { @@ -5039,11 +6623,22 @@ class MainViewModel : ViewModel() { } } + /** + * Executes the sync low power trigger level operation. + * + * @param context [Context] Target context. + */ fun syncLowPowerTriggerLevel(context: Context) { val level = Settings.Global.getInt(context.contentResolver, "low_power_trigger_level", 0) lowPowerTriggerLevel.intValue = level } + /** + * Executes the set low power trigger level operation. + * + * @param context [Context] Target context. + * @param level [Int] Target level. + */ fun setLowPowerTriggerLevel(context: Context, level: Int) { try { Settings.Global.putInt(context.contentResolver, "low_power_trigger_level", level) @@ -5053,12 +6648,23 @@ class MainViewModel : ViewModel() { } } + /** + * Executes the sync show notification snooze operation. + * + * @param context [Context] Target context. + */ fun syncShowNotificationSnooze(context: Context) { val enabled = Settings.Secure.getInt(context.contentResolver, "show_notification_snooze", 0) == 1 isShowNotificationSnoozeEnabled.value = enabled } + /** + * Executes the set show notification snooze enabled operation. + * + * @param context [Context] Target context. + * @param enabled [Boolean] Target enabled. + */ fun setShowNotificationSnoozeEnabled(context: Context, enabled: Boolean) { try { Settings.Secure.putInt( @@ -5072,6 +6678,11 @@ class MainViewModel : ViewModel() { } } + /** + * Executes the load notification snooze options operation. + * + * @param context [Context] Target context. + */ fun loadNotificationSnoozeOptions(context: Context) { val raw = Settings.Global.getString(context.contentResolver, "notification_snooze_options") ?: "" @@ -5096,6 +6707,13 @@ class MainViewModel : ViewModel() { notificationSnoozeOptions.value = opts } + /** + * Executes the save notification snooze options operation. + * + * @param context [Context] Target context. + * @param def [Int] Target def. + * @param opts [List] Target opts. + */ fun saveNotificationSnoozeOptions(context: Context, def: Int, opts: List) { val serialized = "default=$def,options_array=${opts.joinToString(":")}" try { @@ -5111,6 +6729,11 @@ class MainViewModel : ViewModel() { } } + /** + * Executes the reset notification snooze options operation. + * + * @param context [Context] Target context. + */ fun resetNotificationSnoozeOptions(context: Context) { try { Settings.Global.putString(context.contentResolver, "notification_snooze_options", null) @@ -5127,6 +6750,10 @@ class MainViewModel : ViewModel() { } val isLockdownModeEnabled = mutableStateOf(false) + + /** + * Executes the toggle lockdown mode operation. + */ fun toggleLockdownMode() { settingsRepository.putBoolean( SettingsRepository.KEY_LOCKDOWN_MODE, diff --git a/app/src/main/java/com/sameerasw/essentials/viewmodels/PermissionViewModel.kt b/app/src/main/java/com/sameerasw/essentials/viewmodels/PermissionViewModel.kt new file mode 100644 index 000000000..c833823be --- /dev/null +++ b/app/src/main/java/com/sameerasw/essentials/viewmodels/PermissionViewModel.kt @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: System & Security Permissions + * File: PermissionViewModel.kt + * Description: Manages permission checks, Shizuku availability, system accessibility states, + * and overlay permissions across the Essentials app. + */ + +package com.sameerasw.essentials.viewmodels + +import android.content.Context +import androidx.compose.runtime.mutableStateOf +import androidx.lifecycle.ViewModel +import com.sameerasw.essentials.utils.PermissionUtils +import com.sameerasw.essentials.utils.ShizukuUtils + +class PermissionViewModel : ViewModel() { + val isAccessibilityEnabled = mutableStateOf(false) + val isWidgetEnabled = mutableStateOf(false) + val isStatusBarIconControlEnabled = mutableStateOf(false) + val isWriteSecureSettingsEnabled = mutableStateOf(false) + val isReadPhoneStateEnabled = mutableStateOf(false) + val isPostNotificationsEnabled = mutableStateOf(false) + val isShizukuPermissionGranted = mutableStateOf(false) + val isShizukuAvailable = mutableStateOf(false) + val isNotificationListenerEnabled = mutableStateOf(false) + val isOverlayPermissionGranted = mutableStateOf(false) + val isNotificationLightingAccessibilityEnabled = mutableStateOf(false) + + /** + * Refreshes all system and app permissions status. + * + * @param context [Context] Application context used for checking system services and permissions. + */ + fun refreshPermissions(context: Context) { + isAccessibilityEnabled.value = PermissionUtils.isAccessibilityServiceEnabled(context) + isWriteSecureSettingsEnabled.value = PermissionUtils.canWriteSecureSettings(context) + isReadPhoneStateEnabled.value = PermissionUtils.hasReadPhoneStatePermission(context) + isPostNotificationsEnabled.value = PermissionUtils.isPostNotificationsEnabled(context) + isShizukuAvailable.value = ShizukuUtils.isShizukuAvailable() + isShizukuPermissionGranted.value = ShizukuUtils.hasPermission() + isNotificationListenerEnabled.value = + PermissionUtils.hasNotificationListenerPermission(context) + isOverlayPermissionGranted.value = PermissionUtils.canDrawOverlays(context) + isNotificationLightingAccessibilityEnabled.value = + PermissionUtils.isNotificationLightingAccessibilityServiceEnabled(context) + } +} diff --git a/app/src/main/java/com/sameerasw/essentials/viewmodels/QuickSettingsTilesViewModel.kt b/app/src/main/java/com/sameerasw/essentials/viewmodels/QuickSettingsTilesViewModel.kt new file mode 100644 index 000000000..bfe226b4f --- /dev/null +++ b/app/src/main/java/com/sameerasw/essentials/viewmodels/QuickSettingsTilesViewModel.kt @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Quick Settings Tiles + * File: QuickSettingsTilesViewModel.kt + * Description: Manages QS tile status synchronization, tile action dispatching, + * and user tile customization preferences. + */ + +package com.sameerasw.essentials.viewmodels + +import android.content.Context +import androidx.compose.runtime.mutableStateOf +import androidx.lifecycle.ViewModel +import com.sameerasw.essentials.data.repository.SettingsRepository + +class QuickSettingsTilesViewModel : ViewModel() { + val isCaffeinateTileActive = mutableStateOf(false) + val isFlashlightTileActive = mutableStateOf(false) + val isAlwaysOnDisplayTileActive = mutableStateOf(false) + val isAdaptiveBrightnessTileActive = mutableStateOf(false) + val isDeveloperOptionsTileActive = mutableStateOf(false) + + /** + * Synchronizes Quick Settings tile state values with system setting values. + * + * @param context [Context] Application context used for checking system tile states. + */ + fun syncTileStates(context: Context) { + val repo = SettingsRepository(context) + isCaffeinateTileActive.value = repo.getBoolean("caffeinate_active", false) + isAlwaysOnDisplayTileActive.value = repo.getBoolean("aod_tile_active", false) + } +} diff --git a/app/src/main/java/com/sameerasw/essentials/viewmodels/SecurityViewModel.kt b/app/src/main/java/com/sameerasw/essentials/viewmodels/SecurityViewModel.kt new file mode 100644 index 000000000..41e755d56 --- /dev/null +++ b/app/src/main/java/com/sameerasw/essentials/viewmodels/SecurityViewModel.kt @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Security & Device Admin + * File: SecurityViewModel.kt + * Description: Handles state management for AppLock, RemoteLock, Biometric security, + * and lock screen security features. + */ + +package com.sameerasw.essentials.viewmodels + +import android.content.Context +import androidx.compose.runtime.mutableStateOf +import androidx.lifecycle.ViewModel +import com.sameerasw.essentials.data.repository.SettingsRepository + +class SecurityViewModel : ViewModel() { + val isAppLockEnabled = mutableStateOf(false) + val isRemoteLockEnabled = mutableStateOf(false) + val isScreenLockedSecurityEnabled = mutableStateOf(false) + val isBiometricsRequired = mutableStateOf(false) + + /** + * Initializes security toggles and states from persistent repository. + * + * @param context [Context] Application context used to retrieve settings. + */ + fun loadSecurityState(context: Context) { + val repo = SettingsRepository(context) + isAppLockEnabled.value = repo.getBoolean(SettingsRepository.KEY_APP_LOCK_ENABLED, false) + isRemoteLockEnabled.value = repo.getBoolean("remote_lock_enabled", false) + isScreenLockedSecurityEnabled.value = + repo.getBoolean("screen_locked_security_enabled", false) + } + + /** + * Sets AppLock active state. + * + * @param context [Context] Application context for persistence. + * @param enabled [Boolean] True to enable AppLock protection. + */ + fun setAppLockEnabled(context: Context, enabled: Boolean) { + isAppLockEnabled.value = enabled + SettingsRepository(context).putBoolean(SettingsRepository.KEY_APP_LOCK_ENABLED, enabled) + } +} diff --git a/app/src/main/java/com/sameerasw/essentials/viewmodels/SettingsViewModel.kt b/app/src/main/java/com/sameerasw/essentials/viewmodels/SettingsViewModel.kt new file mode 100644 index 000000000..16b19a7d5 --- /dev/null +++ b/app/src/main/java/com/sameerasw/essentials/viewmodels/SettingsViewModel.kt @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: App Settings & Configuration + * File: SettingsViewModel.kt + * Description: Manages user preferences persistence, default tabs, pinned features, + * and app-wide UI customization settings. + */ + +package com.sameerasw.essentials.viewmodels + +import android.content.Context +import androidx.compose.runtime.mutableStateOf +import androidx.lifecycle.ViewModel +import com.sameerasw.essentials.data.repository.SettingsRepository +import com.sameerasw.essentials.domain.DIYTabs +import com.sameerasw.essentials.domain.HapticFeedbackType + +class SettingsViewModel : ViewModel() { + val pinnedFeatureKeys = mutableStateOf>(emptyList()) + val pinnedQsTileKeys = mutableStateOf>(emptyList()) + val hapticFeedbackType = mutableStateOf(HapticFeedbackType.SUBTLE) + val defaultTab = mutableStateOf(DIYTabs.ESSENTIALS) + + /** + * Loads saved pinned features and user settings from repository. + * + * @param context [Context] Application context for shared preferences access. + */ + fun loadSettings(context: Context) { + val repo = SettingsRepository(context) + pinnedFeatureKeys.value = repo.getPinnedFeatures() + pinnedQsTileKeys.value = repo.getPinnedQsTiles() + } + + /** + * Toggles a pinned feature key. + * + * @param context [Context] Application context for persistence. + * @param key [String] Unique key of the feature card. + */ + fun togglePinFeature(context: Context, key: String) { + val repo = SettingsRepository(context) + val current = pinnedFeatureKeys.value.toMutableList() + if (current.contains(key)) { + current.remove(key) + } else { + current.add(key) + } + repo.savePinnedFeatures(current) + pinnedFeatureKeys.value = current + } +} diff --git a/app/src/main/java/com/sameerasw/essentials/viewmodels/StatusBarIconViewModel.kt b/app/src/main/java/com/sameerasw/essentials/viewmodels/StatusBarIconViewModel.kt index 5213e02c8..6b0cd8c24 100644 --- a/app/src/main/java/com/sameerasw/essentials/viewmodels/StatusBarIconViewModel.kt +++ b/app/src/main/java/com/sameerasw/essentials/viewmodels/StatusBarIconViewModel.kt @@ -1,3 +1,13 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Status Bar Customization + * File: StatusBarIconViewModel.kt + * Description: ViewModel managing status bar icon visibility, blacklist state, + * smart Wi-Fi/Data icon hiding, and tile synchronization. + */ + package com.sameerasw.essentials.viewmodels import android.content.Context @@ -11,7 +21,7 @@ import androidx.compose.runtime.mutableStateOf import androidx.core.content.edit import androidx.lifecycle.ViewModel import com.sameerasw.essentials.domain.StatusBarIconRegistry -import com.sameerasw.essentials.ui.components.pickers.NetworkType +import com.sameerasw.essentials.ui.core.pickers.NetworkType import com.sameerasw.essentials.utils.resetAllIconVisibilities import com.sameerasw.essentials.utils.updateIconBlacklistSetting import kotlinx.coroutines.CoroutineScope @@ -99,6 +109,11 @@ class StatusBarIconViewModel : ViewModel() { val isShizukuAvailable = mutableStateOf(false) val isRootAvailable = mutableStateOf(false) + /** + * Executes the check operation. + * + * @param context [Context] Target context. + */ fun check(context: Context) { isWriteSecureSettingsEnabled.value = canWriteSecureSettings(context) isShizukuAvailable.value = com.sameerasw.essentials.utils.ShizukuUtils.hasPermission() @@ -143,54 +158,132 @@ class StatusBarIconViewModel : ViewModel() { setIconVisibility("mobile_data", visible, context) } + /** + * Executes the set wi fi visible operation. + * + * @param visible [Boolean] Target visible. + * @param context [Context] Target context. + */ fun setWiFiVisible(visible: Boolean, context: Context) { setIconVisibility("wifi", visible, context) } + /** + * Executes the set vpn visible operation. + * + * @param visible [Boolean] Target visible. + * @param context [Context] Target context. + */ fun setVpnVisible(visible: Boolean, context: Context) { setIconVisibility("vpn", visible, context) } + /** + * Executes the set alarm clock visible operation. + * + * @param visible [Boolean] Target visible. + * @param context [Context] Target context. + */ fun setAlarmClockVisible(visible: Boolean, context: Context) { setIconVisibility("alarm", visible, context) } + /** + * Executes the set hotspot visible operation. + * + * @param visible [Boolean] Target visible. + * @param context [Context] Target context. + */ fun setHotspotVisible(visible: Boolean, context: Context) { setIconVisibility("hotspot", visible, context) } + /** + * Executes the set bluetooth visible operation. + * + * @param visible [Boolean] Target visible. + * @param context [Context] Target context. + */ fun setBluetoothVisible(visible: Boolean, context: Context) { setIconVisibility("bluetooth", visible, context) } + /** + * Executes the set data saver visible operation. + * + * @param visible [Boolean] Target visible. + * @param context [Context] Target context. + */ fun setDataSaverVisible(visible: Boolean, context: Context) { setIconVisibility("data_saver", visible, context) } + /** + * Executes the set headset visible operation. + * + * @param visible [Boolean] Target visible. + * @param context [Context] Target context. + */ fun setHeadsetVisible(visible: Boolean, context: Context) { setIconVisibility("headset", visible, context) } + /** + * Executes the set rotate visible operation. + * + * @param visible [Boolean] Target visible. + * @param context [Context] Target context. + */ fun setRotateVisible(visible: Boolean, context: Context) { setIconVisibility("rotate", visible, context) } + /** + * Executes the set volte visible operation. + * + * @param visible [Boolean] Target visible. + * @param context [Context] Target context. + */ fun setVolteVisible(visible: Boolean, context: Context) { setIconVisibility("volte", visible, context) } + /** + * Executes the set cast visible operation. + * + * @param visible [Boolean] Target visible. + * @param context [Context] Target context. + */ fun setCastVisible(visible: Boolean, context: Context) { setIconVisibility("cast", visible, context) } + /** + * Executes the set clock visible operation. + * + * @param visible [Boolean] Target visible. + * @param context [Context] Target context. + */ fun setClockVisible(visible: Boolean, context: Context) { setIconVisibility("clock", visible, context) } + /** + * Executes the set airplane visible operation. + * + * @param visible [Boolean] Target visible. + * @param context [Context] Target context. + */ fun setAirplaneVisible(visible: Boolean, context: Context) { setIconVisibility("airplane_mode", visible, context) } + /** + * Executes the set smart wi fi enabled operation. + * + * @param enabled [Boolean] Target enabled. + * @param context [Context] Target context. + */ fun setSmartWiFiEnabled(enabled: Boolean, context: Context) { isSmartWiFiEnabled.value = enabled context.getSharedPreferences("essentials_prefs", Context.MODE_PRIVATE).edit { @@ -199,6 +292,12 @@ class StatusBarIconViewModel : ViewModel() { updateIconBlacklist(context) } + /** + * Executes the set smart data enabled operation. + * + * @param enabled [Boolean] Target enabled. + * @param context [Context] Target context. + */ fun setSmartDataEnabled(enabled: Boolean, context: Context) { isSmartDataEnabled.value = enabled context.getSharedPreferences("essentials_prefs", Context.MODE_PRIVATE).edit { @@ -208,6 +307,12 @@ class StatusBarIconViewModel : ViewModel() { updateSelectedNetworkTypes(context, enabled) } + /** + * Executes the update selected network types operation. + * + * @param context [Context] Target context. + * @param enabled [Boolean] Target enabled. + */ fun updateSelectedNetworkTypes(context: Context, enabled: Boolean) { val prefs = context.getSharedPreferences("essentials_prefs", Context.MODE_PRIVATE) val currentTypes = prefs.getStringSet( @@ -301,6 +406,10 @@ class StatusBarIconViewModel : ViewModel() { return com.sameerasw.essentials.utils.PermissionUtils.canWriteSecureSettings(context) } + /** + * Executes the get adb command operation. + * @return The resulting String data. + */ fun getAdbCommand(): String { return "adb shell pm grant com.sameerasw.essentials android.permission.WRITE_SECURE_SETTINGS" } @@ -371,6 +480,12 @@ class StatusBarIconViewModel : ViewModel() { ) == 1) } + /** + * Executes the set clock position operation. + * + * @param position [Int] Target position. + * @param context [Context] Target context. + */ fun setClockPosition(position: Int, context: Context) { clockPosition.value = position context.getSharedPreferences("essentials_prefs", Context.MODE_PRIVATE).edit { @@ -379,16 +494,34 @@ class StatusBarIconViewModel : ViewModel() { updateIconBlacklist(context) } + /** + * Executes the set clock seconds enabled operation. + * + * @param enabled [Boolean] Target enabled. + * @param context [Context] Target context. + */ fun setClockSecondsEnabled(enabled: Boolean, context: Context) { isClockSecondsEnabled.value = enabled updateSettingsValue(context, "clock_seconds", if (enabled) 1 else 0) } + /** + * Executes the set privacy chip enabled operation. + * + * @param enabled [Boolean] Target enabled. + * @param context [Context] Target context. + */ fun setPrivacyChipEnabled(enabled: Boolean, context: Context) { isPrivacyChipEnabled.value = enabled updateSettingsValue(context, "privacy_chip_2447_enabled", if (enabled) 1 else 0) } + /** + * Executes the set battery percentage mode operation. + * + * @param mode [Int] Target mode. + * @param context [Context] Target context. + */ fun setBatteryPercentageMode(mode: Int, context: Context) { batteryPercentageMode.value = mode context.getSharedPreferences("essentials_prefs", Context.MODE_PRIVATE).edit { @@ -456,6 +589,13 @@ class StatusBarIconViewModel : ViewModel() { applyAdvancedFlags(context) } + /** + * Executes the set advanced flag enabled operation. + * + * @param context [Context] Target context. + * @param flagKey [String] Target flag key. + * @param enabled [Boolean] Target enabled. + */ fun setAdvancedFlagEnabled(context: Context, flagKey: String, enabled: Boolean) { val prefs = context.getSharedPreferences("essentials_prefs", Context.MODE_PRIVATE) when (flagKey) { diff --git a/app/src/main/java/com/sameerasw/essentials/viewmodels/WatchViewModel.kt b/app/src/main/java/com/sameerasw/essentials/viewmodels/WatchViewModel.kt index 97804b78e..805e17612 100644 --- a/app/src/main/java/com/sameerasw/essentials/viewmodels/WatchViewModel.kt +++ b/app/src/main/java/com/sameerasw/essentials/viewmodels/WatchViewModel.kt @@ -1,3 +1,13 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: WearOS Smartwatch Sync + * File: WatchViewModel.kt + * Description: ViewModel managing Wearable Data API node detection, companion app version checks, + * and smartwatch remote lock preferences. + */ + package com.sameerasw.essentials.viewmodels import android.content.Context diff --git a/app/src/main/java/com/sameerasw/essentials/viewmodels/WatermarkViewModel.kt b/app/src/main/java/com/sameerasw/essentials/viewmodels/WatermarkViewModel.kt index bb344445e..039c007ed 100644 --- a/app/src/main/java/com/sameerasw/essentials/viewmodels/WatermarkViewModel.kt +++ b/app/src/main/java/com/sameerasw/essentials/viewmodels/WatermarkViewModel.kt @@ -1,3 +1,13 @@ +/* + * Copyright (c) 2026 sameerasw.com + * License: MIT License + * + * Feature Module: Photo Watermark & EXIF Processing + * File: WatermarkViewModel.kt + * Description: ViewModel managing camera photo watermark options, EXIF metadata extraction, + * and image rendering engine parameters. + */ + package com.sameerasw.essentials.viewmodels import android.content.Context @@ -38,6 +48,12 @@ class WatermarkViewModel( ) : ViewModel() { companion object { + /** + * Executes the provide factory operation. + * + * @param context [Context] Target context. + * @return The resulting ViewModelProvider data. + */ fun provideFactory(context: Context): ViewModelProvider.Factory = object : ViewModelProvider.Factory { @Suppress("UNCHECKED_CAST") @@ -108,6 +124,11 @@ class WatermarkViewModel( } } + /** + * Executes the load preview operation. + * + * @param uri [Uri] Target uri. + */ fun loadPreview(uri: Uri) { currentUri = uri viewModelScope.launch(Dispatchers.IO) { @@ -175,6 +196,12 @@ class WatermarkViewModel( } } + /** + * Executes the format date operation. + * + * @param dateString [String] Target date string. + * @return The resulting String data. + */ fun formatDate(dateString: String): String { try { // Input format: yyyy:MM:dd HH:mm:ss @@ -288,18 +315,33 @@ class WatermarkViewModel( } } + /** + * Executes the set style operation. + * + * @param style [WatermarkStyle] Target style. + */ fun setStyle(style: WatermarkStyle) { viewModelScope.launch { watermarkRepository.updateStyle(style) } } + /** + * Executes the set show brand operation. + * + * @param show [Boolean] Target show. + */ fun setShowBrand(show: Boolean) { viewModelScope.launch { watermarkRepository.updateShowBrand(show) } } + /** + * Executes the set show exif operation. + * + * @param show [Boolean] Target show. + */ fun setShowExif(show: Boolean) { viewModelScope.launch { watermarkRepository.updateShowExif(show) @@ -320,12 +362,22 @@ class WatermarkViewModel( } } + /** + * Executes the set color mode operation. + * + * @param mode [ColorMode] Target mode. + */ fun setColorMode(mode: ColorMode) { viewModelScope.launch { watermarkRepository.updateColorMode(mode) } } + /** + * Executes the set move to top operation. + * + * @param move [Boolean] Target move. + */ fun setMoveToTop(move: Boolean) { viewModelScope.launch { watermarkRepository.updateMoveToTop(move) @@ -333,6 +385,11 @@ class WatermarkViewModel( } } + /** + * Executes the set left align operation. + * + * @param left [Boolean] Target left. + */ fun setLeftAlign(left: Boolean) { viewModelScope.launch { watermarkRepository.updateLeftAlign(left) @@ -340,6 +397,11 @@ class WatermarkViewModel( } } + /** + * Executes the set brand text size operation. + * + * @param size [Int] Target size. + */ fun setBrandTextSize(size: Int) { viewModelScope.launch { watermarkRepository.updateBrandTextSize(size) @@ -347,6 +409,11 @@ class WatermarkViewModel( } } + /** + * Executes the set data text size operation. + * + * @param size [Int] Target size. + */ fun setDataTextSize(size: Int) { viewModelScope.launch { watermarkRepository.updateDataTextSize(size) @@ -354,6 +421,13 @@ class WatermarkViewModel( } } + /** + * Executes the set custom text settings operation. + * + * @param show [Boolean] Target show. + * @param text [String] Target text. + * @param size [Int] Target size. + */ fun setCustomTextSettings(show: Boolean, text: String, size: Int) { viewModelScope.launch { watermarkRepository.updateCustomTextSettings(show, text, size) @@ -361,6 +435,11 @@ class WatermarkViewModel( } } + /** + * Executes the set custom text size operation. + * + * @param size [Int] Target size. + */ fun setCustomTextSize(size: Int) { viewModelScope.launch { watermarkRepository.updateCustomTextSize(size) @@ -368,6 +447,11 @@ class WatermarkViewModel( } } + /** + * Executes the set padding operation. + * + * @param padding [Int] Target padding. + */ fun setPadding(padding: Int) { viewModelScope.launch { watermarkRepository.updatePadding(padding) @@ -375,6 +459,11 @@ class WatermarkViewModel( } } + /** + * Executes the set border stroke operation. + * + * @param stroke [Int] Target stroke. + */ fun setBorderStroke(stroke: Int) { viewModelScope.launch { watermarkRepository.updateBorderStroke(stroke) @@ -382,6 +471,11 @@ class WatermarkViewModel( } } + /** + * Executes the set border corner operation. + * + * @param corner [Int] Target corner. + */ fun setBorderCorner(corner: Int) { viewModelScope.launch { watermarkRepository.updateBorderCorner(corner) @@ -389,6 +483,13 @@ class WatermarkViewModel( } } + /** + * Executes the set logo settings operation. + * + * @param show [Boolean] Target show. + * @param resId [Int?] Target res id. + * @param size [Int] Target size. + */ fun setLogoSettings(show: Boolean, resId: Int?, size: Int) { _showLogo.value = show _logoResId.value = resId @@ -399,6 +500,11 @@ class WatermarkViewModel( } } + /** + * Executes the set show logo operation. + * + * @param show [Boolean] Target show. + */ fun setShowLogo(show: Boolean) { _showLogo.value = show viewModelScope.launch { @@ -407,11 +513,21 @@ class WatermarkViewModel( } } + /** + * Executes the set logo res id operation. + * + * @param resId [Int?] Target res id. + */ fun setLogoResId(resId: Int?) { _logoResId.value = resId updatePreview() } + /** + * Executes the set logo size operation. + * + * @param size [Int] Target size. + */ fun setLogoSize(size: Int) { viewModelScope.launch { watermarkRepository.updateLogoSize(size) @@ -419,6 +535,11 @@ class WatermarkViewModel( } } + /** + * Executes the rotate operation. + * + * @param left [Boolean] Target left. + */ fun rotate(left: Boolean) { viewModelScope.launch { val currentRotation = _options.value.rotation @@ -429,6 +550,13 @@ class WatermarkViewModel( } } + /** + * Executes the update overridden texts operation. + * + * @param brand [String] Target brand. + * @param custom [String] Target custom. + * @param date [String?] Target date. + */ fun updateOverriddenTexts(brand: String, custom: String, date: String?) { _currentBrandText.value = brand _currentCustomText.value = custom @@ -436,6 +564,11 @@ class WatermarkViewModel( updatePreview() } + /** + * Executes the save image operation. + * + * @param uri [Uri] Target uri. + */ fun saveImage(uri: Uri) { viewModelScope.launch { _uiState.value = WatermarkUiState.Processing @@ -496,6 +629,12 @@ class WatermarkViewModel( } } + /** + * Executes the share image operation. + * + * @param uri [Uri] Target uri. + * @param onShareReady [(Uri] Target on share ready. + */ fun shareImage(uri: Uri, onShareReady: (Uri) -> Unit) { viewModelScope.launch { _uiState.value = WatermarkUiState.Processing @@ -562,6 +701,9 @@ class WatermarkViewModel( } } + /** + * Executes the reset state operation. + */ fun resetState() { _uiState.value = WatermarkUiState.Idle } diff --git a/app/src/main/res/drawable/rounded_auto_awesome_24.xml b/app/src/main/res/drawable/rounded_auto_awesome_24.xml index 5aadaa7c6..2e57f600d 100644 --- a/app/src/main/res/drawable/rounded_auto_awesome_24.xml +++ b/app/src/main/res/drawable/rounded_auto_awesome_24.xml @@ -3,7 +3,7 @@ android:height="24dp" android:viewportWidth="24" android:viewportHeight="24"> - + diff --git a/app/src/main/res/drawable/rounded_bottom_navigation_24.xml b/app/src/main/res/drawable/rounded_bottom_navigation_24.xml index ce0a9ab87..ba56c7c8c 100644 --- a/app/src/main/res/drawable/rounded_bottom_navigation_24.xml +++ b/app/src/main/res/drawable/rounded_bottom_navigation_24.xml @@ -13,8 +13,15 @@ ~ See the License for the specific language governing permissions and ~ limitations under the License. --> - - - - + + + + diff --git a/app/src/main/res/drawable/rounded_mobiledata_arrows_24.xml b/app/src/main/res/drawable/rounded_mobiledata_arrows_24.xml index 8ba846166..d8ad4cfab 100644 --- a/app/src/main/res/drawable/rounded_mobiledata_arrows_24.xml +++ b/app/src/main/res/drawable/rounded_mobiledata_arrows_24.xml @@ -13,8 +13,15 @@ ~ See the License for the specific language governing permissions and ~ limitations under the License. --> - - - - + + + + diff --git a/app/src/main/res/drawable/rounded_videogame_asset_24.xml b/app/src/main/res/drawable/rounded_videogame_asset_24.xml index 23369bc34..6b6e7613c 100644 --- a/app/src/main/res/drawable/rounded_videogame_asset_24.xml +++ b/app/src/main/res/drawable/rounded_videogame_asset_24.xml @@ -13,8 +13,15 @@ ~ See the License for the specific language governing permissions and ~ limitations under the License. --> - - - - + + + + diff --git a/app/src/main/res/xml/app_metadata.xml b/app/src/main/res/xml/app_metadata.xml index 38687297e..235f231f8 100644 --- a/app/src/main/res/xml/app_metadata.xml +++ b/app/src/main/res/xml/app_metadata.xml @@ -1,3 +1,2 @@ - - + diff --git a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.md new file mode 100644 index 000000000..6d943b2a6 --- /dev/null +++ b/docs/ARCHITECTURE.md @@ -0,0 +1,44 @@ +# Architecture & Data Flow Overview + +This document details the architectural layout, decoupled ViewModels layer, data flow pipelines, and persistent storage mechanics of the **Essentials** Android application. + +--- + +## Architectural Pattern + +The Essentials application follows the **MVVM (Model-View-ViewModel)** pattern combined with a **Feature-Based Modular Architecture**. + +```mermaid +graph TD + UI[Jetpack Compose UI Layer] --> ViewModels[Domain ViewModels Layer] + ViewModels --> Repositories[Repository & Data Layer] + ViewModels --> Controllers[Domain Controllers] + Repositories --> Storage[SharedPreferences / Sysfs / System API] + Services[Android Background Services] --> Repositories + Services --> Controllers +``` + +--- + +## Decoupled ViewModels Layer + +To prevent monolithic ViewModel anti-patterns, state management is split across domain-specific ViewModels: + +| ViewModel | Responsibilities | Primary Data Sources | +| :--- | :--- | :--- | +| **`PermissionViewModel`** | System permission states (`WRITE_SECURE_SETTINGS`, Shizuku binder, accessibility services, overlay permissions). | `PermissionUtils`, `ShizukuUtils` | +| **`SettingsViewModel`** | App preferences, default startup tabs, pinned features, and QS tile order. | `SettingsRepository` | +| **`SecurityViewModel`** | AppLock biometric security, RemoteLock modes, and lock screen security restrictions. | `SettingsRepository`, `BiometricHelper` | +| **`BatteryViewModel`** | Battery statistics, charging state logs, ring cutout overlays, and Maps power saving. | `BatteryInfoUtil`, `SettingsRepository` | +| **`QuickSettingsTilesViewModel`** | QS tile active states and tile customization settings. | `QsTileRegistry`, `SettingsRepository` | +| **`StatusBarIconViewModel`** | Status bar icon blacklist (`icon_blacklist`), Smart Wi-Fi / Data auto-hiding. | `StatusBarIconUtils`, `SettingsRepository` | +| **`AppUpdatesViewModel`** | GitHub repository release tracking, APK downloads, and in-app update prompts. | `GitHubRepository`, `UpdateRepository` | +| **`DIYViewModel`** | Automation triggers, action execution rules, and GenAI prompt generator. | `DIYRepository`, `GenAIAutomationService` | +| **`WatermarkViewModel`** | Photo watermark engine, EXIF metadata parsing, and image processing pipeline. | `WatermarkEngine`, `WatermarkRepository` | + +--- + +## Data Access & Persistence + +- **`SettingsRepository`**: Wraps `SharedPreferences` (`essentials_prefs`) using Gson JSON serialization for complex object sets (e.g., pinned feature keys, DNS presets, standby app lists). +- **System Settings Interoperability**: Uses `WRITE_SECURE_SETTINGS` to modify system secure settings (e.g., `doze_always_on`, `refresh_rate_mode`, `icon_blacklist`). diff --git a/docs/FEATURES_MODULES.md b/docs/FEATURES_MODULES.md new file mode 100644 index 000000000..c448bfbdc --- /dev/null +++ b/docs/FEATURES_MODULES.md @@ -0,0 +1,36 @@ +# Feature Modules & UI Composable Guide + +This document describes all 17 feature modules in `ui/features/` and their respective UI composables, bottom sheets, and pickers. + +--- + +## Feature Modules Reference + +### 1. `ui/features/power/` +- **Composables**: `PowerAndBatterySettingsUI.kt`, `CaffeinateSettingsUI.kt`, `BatteryNotificationSettingsUI.kt`, `MapsPowerSavingSettingsUI.kt` +- **Sheets**: `ScreenOffSettingsSheet.kt`, `DimWallpaperSettingsSheet.kt` +- **Purpose**: Controls display awake timeout rules, low/full battery alerts, and navigation power saving. + +### 2. `ui/features/hardware/` +- **Composables**: `FlashlightSettingsUI.kt`, `FlashlightPulseSettingsUI.kt`, `ButtonRemapSettingsUI.kt`, `PocketModeSettingsUI.kt` +- **Sheets**: `DeviceEffectsSettingsSheet.kt` +- **Purpose**: Flashlight intensity modulation, hardware button remapping, and proximity sensor pocket detection. + +### 3. `ui/features/network/` +- **Composables**: `NetworksSettingsUI.kt`, `DynamicNightLightSettingsUI.kt` +- **Sheets**: `WifiNetworkSelectionSheet.kt`, `BluetoothDeviceSelectionSheet.kt` +- **Purpose**: Private DNS server presets, network mode QS tiles, and Wi-Fi/Bluetooth device selection. + +### 4. `ui/features/audio/` +- **Composables**: `SoundModeTileSettingsUI.kt`, `NotificationSnoozingSettingsUI.kt`, `SnoozeNotificationsSettingsUI.kt`, `ShutUpSettingsUI.kt` +- **Sheets**: `SoundModeSettingsSheet.kt`, `ShutUpPerAppSettingsSheet.kt`, `LikeSongSettingsSheet.kt` +- **Purpose**: Media ducking (ShutUp), notification snooze timers, and sound profile cycling. + +### 5. `ui/features/security/` +- **Composables**: `AppLockSettingsUI.kt`, `RemoteLockSettingsUI.kt`, `ScreenLockedSecuritySettingsUI.kt` +- **Purpose**: Biometric app lock, smartwatch remote lock triggers, and status bar expansion restrictions when locked. + +### 6. `ui/features/system/` +- **Composables**: `StatusBarIconSettingsUI.kt`, `NavigationSettingsUI.kt`, `OtherCustomizationsSettingsUI.kt`, `TextAnimationsSettingsUI.kt`, `LockScreenClockSettingsUI.kt`, `CalendarSyncSettingsUI.kt`, `KeyboardSettingsUI.kt`, `LiveWallpaperSettingsUI.kt` +- **Sheets**: `SometimesEssentialsSettingsSheet.kt` +- **Purpose**: System status bar icon hiding, animation duration scales, lock screen typography, and IME keyboard settings. diff --git a/docs/SERVICES_AND_PERMISSIONS.md b/docs/SERVICES_AND_PERMISSIONS.md new file mode 100644 index 000000000..e98f6197e --- /dev/null +++ b/docs/SERVICES_AND_PERMISSIONS.md @@ -0,0 +1,25 @@ +# Services, QS Tiles & Permissions Matrix + +This document outlines background services, Quick Settings tiles, and system permission requirements across the Essentials app. + +--- + +## Quick Settings Tile Services (`services/tiles/`) + +| Tile Service | Action & Description | Permission Requirements | +| :--- | :--- | :--- | +| **`CaffeinateTileService`** | Toggles screen awake wake lock timers. | `POST_NOTIFICATIONS` (Foreground Service) | +| **`FlashlightTileService`** | Toggles camera torch intensity. | `CAMERA` | +| **`PrivateDnsTileService`** | Cycles Private DNS provider mode (Off / Automatic / Custom Hostname). | `WRITE_SECURE_SETTINGS` | +| **`RefreshRateTileService`** | Cycles display refresh rate profiles (Fixed / Auto / Peak). | `WRITE_SECURE_SETTINGS` | +| **`SoundModeTileService`** | Cycles sound profiles (Normal / Vibrate / Silent). | `ACCESS_NOTIFICATION_POLICY` | +| **`AppFreezingTileService`** | Freezes background apps using package state policies. | `Shizuku` / `Root` | +| **`ChargeQuickTileService`** | Toggles fast charging policy sysfs node. | `Root` | + +--- + +## Privileged Permission Matrix + +- **`WRITE_SECURE_SETTINGS`**: Granted via ADB (`adb shell pm grant com.sameerasw.essentials android.permission.WRITE_SECURE_SETTINGS`). Allows modifying system secure settings. +- **`Shizuku` Binder Interface**: Enables executing privileged system API calls without full root access. +- **`Root` (`su`)**: Used for direct kernel sysfs writes (e.g. charging current control, SurfaceFlinger adjustments). diff --git a/docs/STRUCTURE.md b/docs/STRUCTURE.md new file mode 100644 index 000000000..44930f11e --- /dev/null +++ b/docs/STRUCTURE.md @@ -0,0 +1,71 @@ +# Project Directory & Package Structure + +This document outlines the package layout and file organization of the Essentials Android app following the **Feature-Modular Architecture** refactor. + +--- + +## High-Level Directory Overview + +``` +app/src/main/java/com/sameerasw/essentials/ +├── MainActivity.kt # Root Activity launching main Jetpack Compose UI +├── EssentialsApp.kt # Application subclass handling Sentry & global initialization +├── data/ # Data access, repositories, preferences, and data sources +│ ├── model/ # Data models & DTOs +│ └── repository/ # Repositories (SettingsRepository, GitHubRepository, etc.) +├── domain/ # Business logic, registries, and domain models +│ ├── controller/ # Domain feature controllers (CaffeinateController, etc.) +│ ├── model/ # Domain entities +│ └── registry/ # Feature, Permission, and Search Registries +├── services/ # Android background services, tile services, and receivers +│ ├── automation/ # Custom automation rules engine & executors +│ ├── dreams/ # Ambient screen saver DreamService implementation +│ ├── handlers/ # Background event handlers +│ ├── tiles/ # Quick Settings Tile services & QS registry +│ └── widgets/ # Glance app widgets and receivers +├── ui/ # Jetpack Compose UI layer +│ ├── activities/ # Sub-activities (AppLockActivity, SettingsActivity, etc.) +│ ├── core/ # Reusable core UI components +│ │ ├── cards/ # Material 3 cards (IconToggleItem, FeatureCard, etc.) +│ │ ├── containers/ # Card container layouts (RoundedCardContainer, etc.) +│ │ ├── pickers/ # Segmented and multi-select pickers +│ │ └── sheets/ # Standard bottom sheets (EssentialsBottomSheet, etc.) +│ └── features/ # Feature-based UI modules +│ ├── apps/ # App standby & user dictionary controls +│ ├── audio/ # ShutUp media ducking & sound mode tiles +│ ├── automation/ # DIY rules editor & AI prompt generator +│ ├── battery/ # Battery stats, charging logs, and info tabs +│ ├── display/ # Refresh rate, Smart Pixels, & AOD settings +│ ├── freeze/ # App freezer, tags manager, and grid UI +│ ├── hardware/ # Torch intensity, pulse patterns, & button remap +│ ├── lighting/ # Notification edge lighting & sweep shape pickers +│ ├── location/ # Geofencing destination alarms & cards +│ ├── network/ # Private DNS presets & network mode tiles +│ ├── power/ # Caffeinate timeout & battery notification UI +│ ├── security/ # AppLock, RemoteLock, & lock screen security +│ ├── system/ # Status bar icon blacklist & animation scales +│ ├── tiles/ # Quick Settings tile manager UI +│ ├── wallpaper/ # Live wallpaper engine controls & picker +│ ├── watch/ # WearOS companion sync & ADB install guidance +│ └── watermark/ # Photo watermark engine & EXIF metadata editor +├── utils/ # Modular utility helpers +│ ├── battery/ # Battery Ring drawer & history log manager +│ ├── hardware/ # SurfaceFlinger, refresh rate, & torch controls +│ ├── security/ # Shizuku binder, Root shell, & Biometric helpers +│ └── ui/ # HapticUtil, ColorUtil, & permission guidance +└── viewmodels/ # Decoupled domain ViewModels + ├── MainViewModel.kt # Main state coordinator + ├── PermissionViewModel.kt # System permissions state ViewModel + ├── SettingsViewModel.kt # Preferences & pinned features ViewModel + ├── SecurityViewModel.kt # AppLock & RemoteLock ViewModel + ├── BatteryViewModel.kt # Battery stats & charging state ViewModel + ├── QuickSettingsTilesViewModel.kt # QS tile toggle states ViewModel + ├── StatusBarIconViewModel.kt # System status bar icon blacklist ViewModel + ├── AppUpdatesViewModel.kt # GitHub release tracking & update ViewModel + ├── CaffeinateViewModel.kt # Display awake timer ViewModel + ├── DIYViewModel.kt # Automation rules ViewModel + ├── LocationReachedViewModel.kt # GPS geofencing ViewModel + ├── WatchViewModel.kt # Smartwatch sync ViewModel + ├── WatermarkViewModel.kt # Photo watermark & EXIF ViewModel + └── GitHubAuthViewModel.kt # GitHub OAuth device flow ViewModel +```