|
@@ -27,6 +27,7 @@ import androidx.compose.runtime.mutableStateOf
|
|
|
import androidx.compose.runtime.remember
|
|
|
import androidx.compose.runtime.setValue
|
|
|
import androidx.compose.ui.Modifier
|
|
|
+import androidx.compose.ui.draw.alpha
|
|
|
import androidx.compose.ui.graphics.Color
|
|
|
import androidx.compose.ui.res.colorResource
|
|
|
import androidx.compose.ui.res.painterResource
|
|
@@ -41,6 +42,7 @@ import androidx.navigation.compose.rememberNavController
|
|
|
import com.vpn.fastestvpnservice.R
|
|
|
import com.vpn.fastestvpnservice.navigation.BottomBarNavGraph
|
|
|
import com.vpn.fastestvpnservice.sealedClass.BottomBarScreen
|
|
|
+import com.vpn.fastestvpnservice.ui.theme.customTypography2
|
|
|
|
|
|
@Composable
|
|
|
fun BottomBarMainScreen(navController: NavHostController, activity: ComponentActivity) {
|
|
@@ -61,9 +63,9 @@ fun BottomBarMainScreen(navController: NavHostController, activity: ComponentAct
|
|
|
|
|
|
Scaffold (
|
|
|
bottomBar = {
|
|
|
- if (isBottomBarVisible) {
|
|
|
- BottomBar(navController1, screens)
|
|
|
- }
|
|
|
+ if (isBottomBarVisible) {
|
|
|
+ BottomBar(navController1, screens)
|
|
|
+ }
|
|
|
},
|
|
|
content = { padding ->
|
|
|
Box(modifier = Modifier.padding(padding)) {
|
|
@@ -86,8 +88,9 @@ fun BottomBar(navHostController: NavHostController, screens: List<BottomBarScree
|
|
|
|
|
|
|
|
|
BottomNavigation (
|
|
|
- backgroundColor = MaterialTheme.colorScheme.onPrimary,
|
|
|
- contentColor = Color.Gray,
|
|
|
+ backgroundColor = MaterialTheme.colorScheme.onBackground,
|
|
|
+ elevation = 0.dp,
|
|
|
+// contentColor = Color.Gray,
|
|
|
modifier = Modifier.height(84.dp)
|
|
|
) {
|
|
|
screens.forEach { screen ->
|
|
@@ -112,14 +115,17 @@ fun RowScope.AddItem(
|
|
|
label = {
|
|
|
if (currentDestination?.route == screen.route) {
|
|
|
Text(text = screen.title,
|
|
|
- color = colorResource(id = R.color.blue_text),
|
|
|
+ style = MaterialTheme.typography.customTypography2.bodyLarge,
|
|
|
+ color = MaterialTheme.colorScheme.tertiary,
|
|
|
)
|
|
|
}
|
|
|
else {
|
|
|
Text(text = screen.title,
|
|
|
- color = Color.Gray)
|
|
|
+ style = MaterialTheme.typography.customTypography2.bodyLarge,
|
|
|
+ color = MaterialTheme.colorScheme.onTertiary,
|
|
|
+ modifier = Modifier.alpha(0.5F)
|
|
|
+ )
|
|
|
}
|
|
|
-
|
|
|
},
|
|
|
alwaysShowLabel = true,
|
|
|
selected = currentDestination?.hierarchy?.any{
|
|
@@ -150,10 +156,10 @@ fun RowScope.AddItem(
|
|
|
Icon(
|
|
|
painter = painterResource(id = screen.icon),
|
|
|
contentDescription = "Navigation Icon",
|
|
|
- tint = colorResource(id = R.color.dark_blue_icon),
|
|
|
+ tint = MaterialTheme.colorScheme.tertiary,
|
|
|
modifier = Modifier
|
|
|
.size(45.dp, 39.dp)
|
|
|
- .padding(top = 9.dp, bottom = 7.dp)
|
|
|
+ .padding(top = 9.dp, bottom = 4.dp)
|
|
|
|
|
|
)
|
|
|
}
|
|
@@ -161,16 +167,16 @@ fun RowScope.AddItem(
|
|
|
Icon(
|
|
|
painter = painterResource(id = screen.icon),
|
|
|
contentDescription = "Navigation Icon",
|
|
|
- tint = colorResource(id = R.color.gray_icon),
|
|
|
+ tint = MaterialTheme.colorScheme.onTertiary,
|
|
|
modifier = Modifier
|
|
|
.size(45.dp, 39.dp)
|
|
|
- .padding(top = 9.dp, bottom = 7.dp) )
|
|
|
+ .padding(top = 9.dp, bottom = 4.dp)
|
|
|
+ .alpha(0.5F))
|
|
|
}
|
|
|
|
|
|
},
|
|
|
- unselectedContentColor = LocalContentColor.current.copy(
|
|
|
- alpha = ContentAlpha.disabled
|
|
|
- )
|
|
|
+ unselectedContentColor = MaterialTheme.colorScheme.onBackground,
|
|
|
+ selectedContentColor = MaterialTheme.colorScheme.onBackground
|
|
|
)
|
|
|
}
|
|
|
|