mirror of
https://github.com/atsunatsu/Look4Sat.git
synced 2026-10-02 19:17:21 +00:00
Cleaned up classes and resources, updated dependencies
This commit is contained in:
1 parent
574ffe09c2
commit
bfbe437ab1
38 files changed
+95
-178
No files matched your search
@@ -23,16 +23,15 @@ import android.os.Bundle
|
||||
import androidx.activity.ComponentActivity
|
||||
import androidx.activity.compose.setContent
|
||||
import androidx.activity.enableEdgeToEdge
|
||||
import androidx.compose.runtime.collectAsState
|
||||
import androidx.compose.ui.platform.LocalContext
|
||||
import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen
|
||||
import com.rtbishop.look4sat.presentation.MainTheme
|
||||
import com.rtbishop.look4sat.presentation.MainScreen
|
||||
import com.rtbishop.look4sat.presentation.MainTheme
|
||||
|
||||
class MainActivity : ComponentActivity() {
|
||||
|
||||
override fun attachBaseContext(newBase: Context?) {
|
||||
overrideSystemFontAndDisplaySizeScaling(newBase)
|
||||
val config = Configuration(newBase?.resources?.configuration)
|
||||
applyOverrideConfiguration(config.apply { fontScale = 1.0f })
|
||||
super.attachBaseContext(newBase)
|
||||
}
|
||||
|
||||
@@ -41,14 +40,7 @@ class MainActivity : ComponentActivity() {
|
||||
enableEdgeToEdge()
|
||||
super.onCreate(savedInstanceState)
|
||||
setContent {
|
||||
val container = (LocalContext.current.applicationContext as MainApplication).container
|
||||
val otherSettings = container.settingsRepo.otherSettings.collectAsState().value
|
||||
MainTheme(isDarkTheme = !otherSettings.stateOfLightTheme) { MainScreen() }
|
||||
MainTheme(isDarkTheme = true) { MainScreen() }
|
||||
}
|
||||
}
|
||||
|
||||
private fun overrideSystemFontAndDisplaySizeScaling(newBase: Context?) {
|
||||
val newConfig = Configuration(newBase?.resources?.configuration).apply { fontScale = 1.0f }
|
||||
applyOverrideConfiguration(newConfig)
|
||||
}
|
||||
}
|
||||
@@ -20,9 +20,9 @@ import com.rtbishop.look4sat.presentation.satellites.satellitesDestination
|
||||
import com.rtbishop.look4sat.presentation.settings.settingsDestination
|
||||
|
||||
sealed class Screen(val route: String, val iconResId: Int, val titleResId: Int) {
|
||||
data object Satellites : Screen("satellites", R.drawable.ic_sputnik, R.string.nav_satellites)
|
||||
data object Satellites : Screen("satellites", R.drawable.ic_satellites, R.string.nav_satellites)
|
||||
data object Passes : Screen("passes", R.drawable.ic_passes, R.string.nav_passes)
|
||||
data object Radar : Screen("radar", R.drawable.ic_satellite, R.string.nav_radar)
|
||||
data object Radar : Screen("radar", R.drawable.ic_radar, R.string.nav_radar)
|
||||
data object Map : Screen("map", R.drawable.ic_map, R.string.nav_map)
|
||||
data object Settings : Screen("settings", R.drawable.ic_settings, R.string.nav_settings)
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ private fun TopBarPreview() = MainTheme {
|
||||
TopBar {
|
||||
IconCard(action = {}, resId = R.drawable.ic_filter)
|
||||
TimerRow(timeString = "88:88:88", isTimeAos = true)
|
||||
IconCard(action = {}, resId = R.drawable.ic_satellite)
|
||||
IconCard(action = {}, resId = R.drawable.ic_radios)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -85,7 +85,7 @@ fun PassesDialog(hours: Int, elevation: Double, cancel: () -> Unit, accept: (Int
|
||||
title = "Show passes within",
|
||||
value = hoursValue.intValue.toDouble(),
|
||||
valuePostfix = "h",
|
||||
valueResId = R.drawable.ic_time,
|
||||
valueResId = R.drawable.ic_clock,
|
||||
valueRange = 1f..240f
|
||||
) { hoursValue.intValue = it.toInt() }
|
||||
}
|
||||
|
||||
@@ -116,7 +116,7 @@ private fun PassesScreen(uiState: PassesState, navigateToRadar: (Int, Long) -> U
|
||||
NextPassRow(pass = uiState.nextPass)
|
||||
},
|
||||
endAction = {
|
||||
IconCard(action = showRadiosDialog, resId = R.drawable.ic_satellite)
|
||||
IconCard(action = showRadiosDialog, resId = R.drawable.ic_radios)
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
@@ -160,7 +160,7 @@ private fun RadarScreen(uiState: RadarState, navigateUp: () -> Unit) {
|
||||
verticalArrangement = Arrangement.Center
|
||||
) {
|
||||
Icon(
|
||||
painter = painterResource(R.drawable.ic_satellite),
|
||||
painter = painterResource(R.drawable.ic_radios),
|
||||
contentDescription = null,
|
||||
modifier = Modifier.size(64.dp)
|
||||
)
|
||||
@@ -245,7 +245,7 @@ private fun RadarScreen(uiState: RadarState, navigateUp: () -> Unit) {
|
||||
verticalArrangement = Arrangement.Center
|
||||
) {
|
||||
Icon(
|
||||
painter = painterResource(R.drawable.ic_satellite),
|
||||
painter = painterResource(R.drawable.ic_radios),
|
||||
contentDescription = null,
|
||||
modifier = Modifier.size(64.dp)
|
||||
)
|
||||
|
||||
@@ -6,10 +6,10 @@ 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.fillMaxSize
|
||||
import androidx.compose.foundation.layout.height
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.layout.size
|
||||
import androidx.compose.foundation.layout.width
|
||||
import androidx.compose.foundation.lazy.grid.GridCells
|
||||
import androidx.compose.foundation.lazy.grid.LazyVerticalGrid
|
||||
@@ -186,15 +186,10 @@ private fun TypeCard(types: List<String>, onClick: () -> Unit, modifier: Modifie
|
||||
modifier = Modifier
|
||||
.height(48.dp)
|
||||
.clickable { onClick() }) {
|
||||
Icon(
|
||||
painter = painterResource(id = R.drawable.ic_arrow),
|
||||
contentDescription = null,
|
||||
modifier = Modifier
|
||||
.size(36.dp)
|
||||
.padding(start = 6.dp)
|
||||
)
|
||||
Spacer(Modifier)
|
||||
Icon(painter = painterResource(id = R.drawable.ic_tags), contentDescription = null)
|
||||
Text(
|
||||
text = "Types: $typesText",
|
||||
text = "Tags: $typesText",
|
||||
fontSize = 16.sp,
|
||||
fontWeight = FontWeight.Medium,
|
||||
modifier = Modifier
|
||||
|
||||
@@ -180,7 +180,7 @@ private fun CardAbout(version: String, sendUrlAction: (SystemAction) -> Unit = {
|
||||
verticalAlignment = Alignment.CenterVertically
|
||||
) {
|
||||
Icon(
|
||||
painter = painterResource(id = R.drawable.ic_sputnik),
|
||||
painter = painterResource(id = R.drawable.ic_satellites),
|
||||
tint = MaterialTheme.colorScheme.primary,
|
||||
contentDescription = null,
|
||||
modifier = Modifier.size(72.dp)
|
||||
|
||||
Reference in new issue
Block a user