Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
seldon1000 committed Aug 22, 2021
1 parent 84543b6 commit b8d8b58
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,29 +22,24 @@ import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.BottomAppBar
import androidx.compose.material.BottomNavigationItem
import androidx.compose.material.Icon
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.getValue
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import androidx.navigation.compose.currentBackStackEntryAsState
import eu.seldon1000.nextpass.R
import eu.seldon1000.nextpass.MainViewModel
import eu.seldon1000.nextpass.R
import eu.seldon1000.nextpass.ui.theme.NextcloudBlue
import eu.seldon1000.nextpass.ui.theme.colors
import kotlinx.coroutines.launch

@Composable
fun DefaultBottomBar(lazyListState: LazyListState, viewModel: MainViewModel) {
val context = LocalContext.current

val coroutineScope = rememberCoroutineScope()

val currentScreen by viewModel.navController.collectAsState().value.currentBackStackEntryAsState()
Expand All @@ -55,7 +50,6 @@ fun DefaultBottomBar(lazyListState: LazyListState, viewModel: MainViewModel) {
modifier = Modifier.clip(shape = RoundedCornerShape(topStart = 16.dp, topEnd = 16.dp))
) {
BottomNavigationItem(
label = { Text(text = context.getString(R.string.favorites), fontSize = 10.sp) },
selected = currentScreen?.destination?.route == Routes.Favorites.route,
onClick = {
if (currentScreen?.destination?.route != Routes.Favorites.route)
Expand All @@ -72,7 +66,6 @@ fun DefaultBottomBar(lazyListState: LazyListState, viewModel: MainViewModel) {
unselectedContentColor = colors!!.onBackground
)
BottomNavigationItem(
label = { Text(text = context.getString(R.string.passwords), fontSize = 10.sp) },
selected = currentScreen?.destination?.route == Routes.Passwords.route,
onClick = {
if (currentScreen?.destination?.route != Routes.Passwords.route)
Expand All @@ -93,7 +86,6 @@ fun DefaultBottomBar(lazyListState: LazyListState, viewModel: MainViewModel) {
)
BottomNavigationItem(selected = false, onClick = {}, enabled = false, icon = {})
BottomNavigationItem(
label = { Text(text = context.getString(R.string.search), fontSize = 10.sp) },
selected = currentScreen?.destination?.route == Routes.Search.route,
onClick = {
if (currentScreen?.destination?.route != Routes.Search.route)
Expand All @@ -109,7 +101,6 @@ fun DefaultBottomBar(lazyListState: LazyListState, viewModel: MainViewModel) {
unselectedContentColor = colors!!.onBackground
)
BottomNavigationItem(
label = { Text(text = context.getString(R.string.settings), fontSize = 10.sp) },
selected = currentScreen?.destination?.route == Routes.Settings.route,
onClick = {
if (currentScreen?.destination?.route != Routes.Settings.route)
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
<string name="danger_zone">Danger zone</string>
<string name="nextpass_autofill_service">NextPass Autofill Service</string>
<string name="reset_preferences">Reset preferences</string>
<string name="reset_preferences_tip">Click here to reset your preferences to defaults. This will not log you out from NextPass. If you log out manually, preferences will be reset automatically.</string>
<string name="reset_preferences_tip">Click here to reset your preferences to defaults. This won\'t log you out from NextPass.</string>
<string name="timeout_expired">Timeout expired</string>
<string name="timeout_expired_body">NextPass waits approximately 60 seconds for you to complete login. Time\'s up, try again.</string>
<string name="tag_created_snack">Tag created</string>
Expand Down

0 comments on commit b8d8b58

Please sign in to comment.