Skip to content

Commit

Permalink
clean up main activity
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasBernard03 committed Mar 10, 2024
1 parent 985e48d commit cbae6a7
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package fr.thomasbernard03.rickandmorty.commons.extensions

import androidx.navigation.NavBackStackEntry
import androidx.navigation.NavDestination
import fr.thomasbernard03.rickandmorty.R
import fr.thomasbernard03.rickandmorty.commons.helpers.ResourcesHelper
import org.koin.java.KoinJavaComponent.get
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package fr.thomasbernard03.rickandmorty.presentation
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.compose.foundation.layout.WindowInsets
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.BottomAppBar
Expand All @@ -20,7 +19,6 @@ import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
Expand All @@ -33,7 +31,6 @@ import fr.thomasbernard03.rickandmorty.commons.extensions.getSubtitle
import fr.thomasbernard03.rickandmorty.commons.extensions.getTitle
import fr.thomasbernard03.rickandmorty.commons.helpers.ErrorHelper
import fr.thomasbernard03.rickandmorty.commons.helpers.NavigationHelper
import fr.thomasbernard03.rickandmorty.commons.helpers.ResourcesHelper
import fr.thomasbernard03.rickandmorty.domain.models.BottomBarItem
import fr.thomasbernard03.rickandmorty.presentation.navigation.navigationGraph
import fr.thomasbernard03.rickandmorty.presentation.theme.RickAndMortyTheme
Expand All @@ -44,8 +41,7 @@ import org.koin.java.KoinJavaComponent.get

class MainActivity(
private val navigationHelper: NavigationHelper = get(NavigationHelper::class.java),
private val errorHelper: ErrorHelper = get(ErrorHelper::class.java),
private val resourcesHelper: ResourcesHelper = get(ResourcesHelper::class.java)
private val errorHelper: ErrorHelper = get(ErrorHelper::class.java)
) : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
Expand Down Expand Up @@ -85,6 +81,7 @@ class MainActivity(
val selected = navController.currentBackStackEntryAsState().value?.destination?.route == it.route
NavigationBarItem(
selected = selected,
alwaysShowLabel = false,
icon = {
Icon(painter = painterResource(id = it.icon), contentDescription = stringResource(id = it.label))
},
Expand Down Expand Up @@ -120,8 +117,6 @@ class MainActivity(
}
}
}.launchIn(this)


}

LaunchedEffect(Unit){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ package fr.thomasbernard03.rickandmorty.presentation.theme

import androidx.compose.ui.graphics.Color

val Dark100 = Color(0xFF34363B)
val Dark100 = Color(0xFF34363B)
val Dark200 = Color(0xFF2D2F33)
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import androidx.core.view.WindowCompat

private val LightColorScheme = lightColorScheme(
primary = Dark100,
secondary = Dark200,
)

@Composable
Expand Down

0 comments on commit cbae6a7

Please sign in to comment.