Feature theme selection#19
Conversation
| if (view is android.widget.TextView) { | ||
| // Check if text contains Tibetan characters (Unicode range U+0F00-U+0FFF) | ||
| val text = view.text?.toString() ?: "" | ||
| val hasTibetan = text.any { it.code in 0x0F00..0x0FFF } |
Check warning
Code scanning / detekt
Report magic numbers. Magic number is a numeric literal that is not defined as a constant and hence it's unclear what the purpose of this number is. It's better to declare such numbers as constants and give them a proper name. By default, -1, 0, 1, and 2 are not considered to be magic numbers. Warning
| if (view is android.widget.TextView) { | ||
| // Check if text contains Tibetan characters (Unicode range U+0F00-U+0FFF) | ||
| val text = view.text?.toString() ?: "" | ||
| val hasTibetan = text.any { it.code in 0x0F00..0x0FFF } |
Check warning
Code scanning / detekt
Report magic numbers. Magic number is a numeric literal that is not defined as a constant and hence it's unclear what the purpose of this number is. It's better to declare such numbers as constants and give them a proper name. By default, -1, 0, 1, and 2 are not considered to be magic numbers. Warning
|
|
||
| // Move text down 8dp to prevent overlap with icon | ||
| val density = resources.displayMetrics.density | ||
| view.translationY = 8 * density |
Check warning
Code scanning / detekt
Report magic numbers. Magic number is a numeric literal that is not defined as a constant and hence it's unclear what the purpose of this number is. It's better to declare such numbers as constants and give them a proper name. By default, -1, 0, 1, and 2 are not considered to be magic numbers. Warning
| val v = getString(THEME_MODE, defValue = org.openedx.core.data.storage.ThemeMode.SYSTEM.name) | ||
| return try { | ||
| org.openedx.core.data.storage.ThemeMode.valueOf(v) | ||
| } catch (e: Exception) { |
Check warning
Code scanning / detekt
The caught exception is swallowed. The original exception could be lost. Warning
| import androidx.compose.runtime.CompositionLocalProvider | ||
| import androidx.compose.runtime.ReadOnlyComposable | ||
| import androidx.compose.ui.platform.LocalContext | ||
| import org.koin.core.context.GlobalContext |
Check warning
Code scanning / detekt
Detects unused imports Warning
| val value = prefs.getString("theme_mode", ThemeMode.SYSTEM.name) ?: ThemeMode.SYSTEM.name | ||
| val mode = try { | ||
| ThemeMode.valueOf(value) | ||
| } catch (e: Exception) { |
Check warning
Code scanning / detekt
The caught exception is swallowed. The original exception could be lost. Warning
| @Composable | ||
| private fun LanguageOption( | ||
| name: String, | ||
| code: String, |
Check warning
Code scanning / detekt
Function parameter is unused and should be removed. Warning
|
|
||
| val topBarWidth by remember(key1 = windowSize) { |
Check warning
Code scanning / detekt
Reports methods that have an empty first line. Warning
No description provided.