Skip to content

Commit

Permalink
refactor: remove deprecated AppCompatTheme
Browse files Browse the repository at this point in the history
  • Loading branch information
andrekir committed Jan 6, 2025
1 parent 7bb0d42 commit 0635b25
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 96 deletions.
1 change: 0 additions & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,6 @@ dependencies {
implementation 'androidx.compose.material:material-icons-extended'
implementation 'androidx.activity:activity-compose'
implementation 'androidx.compose.runtime:runtime-livedata'
implementation "com.google.accompanist:accompanist-themeadapter-appcompat:0.36.0"

// Android Studio Preview support
implementation 'androidx.compose.ui:ui-tooling-preview'
Expand Down
11 changes: 8 additions & 3 deletions app/src/main/java/com/geeksville/mesh/ui/ChannelFragment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ import androidx.compose.material.icons.twotone.Check
import androidx.compose.material.icons.twotone.Close
import androidx.compose.material.icons.twotone.ContentCopy
import androidx.compose.runtime.Composable
import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateListOf
Expand Down Expand Up @@ -109,7 +110,7 @@ import com.geeksville.mesh.ui.components.config.EditChannelDialog
import com.geeksville.mesh.ui.components.dragContainer
import com.geeksville.mesh.ui.components.dragDropItemsIndexed
import com.geeksville.mesh.ui.components.rememberDragDropState
import com.google.accompanist.themeadapter.appcompat.AppCompatTheme
import com.geeksville.mesh.ui.theme.AppTheme
import com.google.android.material.dialog.MaterialAlertDialogBuilder
import com.journeyapps.barcodescanner.ScanContract
import com.journeyapps.barcodescanner.ScanOptions
Expand All @@ -128,8 +129,12 @@ class ChannelFragment : ScreenFragment("Channel"), Logging {
return ComposeView(requireContext()).apply {
setViewCompositionStrategy(ViewCompositionStrategy.DisposeOnViewTreeLifecycleDestroyed)
setContent {
AppCompatTheme {
ChannelScreen(model)
AppTheme {
CompositionLocalProvider(
LocalContentColor provides MaterialTheme.colors.onSurface
) {
ChannelScreen(model)
}
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions app/src/main/java/com/geeksville/mesh/ui/NavGraph.kt
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ import com.geeksville.mesh.ui.components.NodeMapScreen
import com.geeksville.mesh.ui.components.PositionLogScreen
import com.geeksville.mesh.ui.components.SignalMetricsScreen
import com.geeksville.mesh.ui.components.TracerouteLogScreen
import com.geeksville.mesh.util.UiText
import com.geeksville.mesh.ui.components.config.AmbientLightingConfigScreen
import com.geeksville.mesh.ui.components.config.AudioConfigScreen
import com.geeksville.mesh.ui.components.config.BluetoothConfigScreen
Expand All @@ -106,7 +105,8 @@ import com.geeksville.mesh.ui.components.config.SerialConfigScreen
import com.geeksville.mesh.ui.components.config.StoreForwardConfigScreen
import com.geeksville.mesh.ui.components.config.TelemetryConfigScreen
import com.geeksville.mesh.ui.components.config.UserConfigScreen
import com.google.accompanist.themeadapter.appcompat.AppCompatTheme
import com.geeksville.mesh.ui.theme.AppTheme
import com.geeksville.mesh.util.UiText
import dagger.hilt.android.AndroidEntryPoint
import kotlinx.serialization.Serializable

Expand Down Expand Up @@ -146,7 +146,7 @@ class NavGraphFragment : ScreenFragment("NavGraph"), Logging {
setContent {
val node by model.destNode.collectAsStateWithLifecycle()

AppCompatTheme {
AppTheme {
val navController: NavHostController = rememberNavController()
Scaffold(
topBar = {
Expand Down
28 changes: 0 additions & 28 deletions app/src/main/java/com/geeksville/mesh/ui/theme/Shape.kt

This file was deleted.

4 changes: 1 addition & 3 deletions app/src/main/java/com/geeksville/mesh/ui/theme/Theme.kt
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,6 @@ fun AppTheme(

MaterialTheme(
colors = colors,
typography = Typography,
shapes = Shapes,
content = content
)
}
}
58 changes: 0 additions & 58 deletions app/src/main/java/com/geeksville/mesh/ui/theme/Type.kt

This file was deleted.

0 comments on commit 0635b25

Please sign in to comment.