8000 change unselected color and remove tab bar animation by DeleMike · Pull Request #353 · scribe-org/Scribe-Android · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

change unselected color and remove tab bar animation #353

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 24 additions & 17 deletions app/src/main/java/be/scri/ui/common/bottombar/ScribeBottomBar.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,25 @@

package be.scri.ui.common.bottombar

import androidx.compose.foundation.interaction.Interaction
import androidx.compose.foundation.interaction.MutableInteractionSource
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.pager.PagerState
import androidx.compose.material.BottomNavigation
import androidx.compose.material.BottomNavigationItem
import androidx.compose.material.Icon
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.colorResource
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import be.scri.R
import kotlinx.coroutines.flow.MutableSharedFlow

@Composable
fun ScribeBottomBar(
Expand All @@ -37,25 +42,14 @@ fun Scri 8000 beBottomBar(
bottomBarScreens.forEachIndexed { index, item ->
val isSelected = pagerState.currentPage == index

val iconSize =
if (isSelected) {
26.dp
} else {
24.dp
}

val textSize =
if (isSelected) {
13.sp
} else {
12.sp
}

val iconSize = if (isSelected) 26.dp else 24.dp
val textSize = if (isSelected) 13.sp else 12.sp
val greyColor = colorResource(id = R.color.nav_item_grey)
val color =
if (isSelected) {
MaterialTheme.colorScheme.secondary
} else {
MaterialTheme.colorScheme.onSurface
greyColor
}

BottomNavigationItem(
Expand Down Expand Up @@ -88,7 +82,20 @@ fun ScribeBottomBar(
},
alwaysShowLabel = true,
selectedContentColor = MaterialTheme.colorScheme.secondary,
unselectedContentColor = MaterialTheme.colorScheme.onSurface,
unselectedContentColor = greyColor,
interactionSource =
remember {
object : MutableInteractionSource {
override val interactions =
MutableSharedFlow<Interaction>(
extraBufferCapacity = Int.MAX_VALUE,
)

override suspend fun emit(interaction: Interaction) = Unit

override fun tryEmit(interaction: Interaction): Boolean = true
}
},
)
}
}
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

<color name="nav_bar_selected_color_light">@color/dark_scribe_color</color>
<color name="nav_bar_selected_color_dark">@color/light_scribe_color</color>
<color name="nav_item_grey">#808080</color>

<!-- Light theme -->
<color name="light_key_color">#FFFFFFFF</color>
Expand Down
Loading
0