Skip to content

Commit

Permalink
Installation screen spacing changed and linting errors fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
Saifuddin53 committed Jan 1, 2025
1 parent 5569c66 commit 2d4c8ef
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 59 deletions.
4 changes: 1 addition & 3 deletions app/src/main/java/be/scri/App.kt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ package be.scri
import android.annotation.SuppressLint
import android.content.Context
import androidx.activity.compose.BackHandler
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
Expand All @@ -34,7 +33,6 @@ import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.colorResource
import androidx.compose.ui.unit.dp
import androidx.navigation.NavHostController
import androidx.navigation.compose.NavHost
Expand Down Expand Up @@ -86,7 +84,7 @@ fun ScribeApp(
},
pagerState = pagerState,
modifier =
Modifier
Modifier,
)
},
modifier = modifier.fillMaxSize(),
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/be/scri/activities/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class MainActivity : ComponentActivity() {
},
context = context,
navController = navController,
modifier = Modifier.navigationBarsPadding()
modifier = Modifier.navigationBarsPadding(),
)
}
}
Expand Down
49 changes: 16 additions & 33 deletions app/src/main/java/be/scri/ui/common/bottombar/ScribeBottomBar.kt
Original file line number Diff line number Diff line change
@@ -1,50 +1,33 @@
package be.scri.ui.common.bottombar

import android.util.Log
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.WindowInsets
import androidx.compose.foundation.layout.asPaddingValues
import androidx.compose.foundation.layout.consumeWindowInsets
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.navigationBars
import androidx.compose.foundation.layout.offset
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.wrapContentHeight
import androidx.compose.foundation.pager.PagerState
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.BottomNavigation
import androidx.compose.material.BottomNavigationItem
import androidx.compose.material.Icon
import androidx.compose.material3.BottomAppBar
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.NavigationBar
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
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 com.google.android.material.bottomnavigation.BottomNavigationItemView

@Composable
fun ScribeBottomBar(
onItemClick: (Int) -> Unit,
pagerState: PagerState,
modifier: Modifier = Modifier,
) {
Column (
modifier = modifier
Column(
modifier = modifier,
) {
BottomNavigation(
backgroundColor = MaterialTheme.colorScheme.surface,
modifier = Modifier
modifier = Modifier,
) {
bottomBarScreens.forEachIndexed { index, item ->
val isSelected = pagerState.currentPage == index
Expand Down Expand Up @@ -76,32 +59,32 @@ fun ScribeBottomBar(
icon = {
androidx.compose.material3.Icon(
painter =
painterResource(
id = item.icon,
),
painterResource(
id = item.icon,
),
tint = color,
contentDescription = "Keyboard",
modifier =
Modifier
.clip(MaterialTheme.shapes.medium)
.size(iconSize),
Modifier
.clip(MaterialTheme.shapes.medium)
.size(iconSize),
)
},
label = {
Text(
text = item.label,
style =
MaterialTheme.typography.labelMedium.copy(
fontSize = textSize,
fontWeight = if (isSelected) FontWeight.ExtraBold else FontWeight.W600,
letterSpacing = (0).sp,
color = color
),
MaterialTheme.typography.labelMedium.copy(
fontSize = textSize,
fontWeight = if (isSelected) FontWeight.ExtraBold else FontWeight.W600,
letterSpacing = (0).sp,
color = color,
),
)
},
alwaysShowLabel = true,
selectedContentColor = MaterialTheme.colorScheme.secondary,
unselectedContentColor = MaterialTheme.colorScheme.onSurface
unselectedContentColor = MaterialTheme.colorScheme.onSurface,
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import be.scri.R
import be.scri.ui.models.ScribeItem
import be.scri.ui.models.ScribeItemList

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,32 +72,32 @@ fun SwitchableItemComp(
checked = isChecked,
onCheckedChange = onCheckedChange,
modifier =
Modifier
.width(51.dp)
.height(31.dp),
Modifier
.width(51.dp)
.height(31.dp),
thumbContent = {
Box(
modifier =
Modifier
.size(27.dp)
.background(
if (isChecked) {
checkedThumbColor
} else {
uncheckedThumbColor
},
shape = CircleShape,
),
Modifier
.size(27.dp)
.background(
if (isChecked) {
checkedThumbColor
} else {
uncheckedThumbColor
},
shape = CircleShape,
),
)
},
colors =
SwitchDefaults.colors(
checkedThumbColor = checkedThumbColor,
uncheckedThumbColor = uncheckedThumbColor,
checkedTrackColor = checkedTrackColor,
uncheckedTrackColor = uncheckedTrackColor,
uncheckedBorderColor = Color.Transparent,
),
SwitchDefaults.colors(
checkedThumbColor = checkedThumbColor,
uncheckedThumbColor = uncheckedThumbColor,
checkedTrackColor = checkedTrackColor,
uncheckedTrackColor = uncheckedTrackColor,
uncheckedBorderColor = Color.Transparent,
),
)
}
Text(
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/java/be/scri/ui/screens/InstallationScreen.kt
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxHeight
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
Expand Down Expand Up @@ -90,7 +91,7 @@ fun InstallationScreen(
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.Center,
) {
Spacer(modifier = Modifier.height(54.dp))
Spacer(modifier = Modifier.fillMaxHeight(0.4f))

Image(
painter = painterResource(id = R.drawable.scribe_logo),
Expand Down

0 comments on commit 2d4c8ef

Please sign in to comment.