Skip to content

Commit

Permalink
little design changes
Browse files Browse the repository at this point in the history
  • Loading branch information
thatsmanmeet committed Dec 1, 2023
1 parent a4b71df commit 380bdcb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 23 deletions.
Original file line number Diff line number Diff line change
@@ -1,17 +1,8 @@
package com.thatsmanmeet.taskyapp.components

import android.annotation.SuppressLint
import androidx.compose.animation.AnimatedVisibility
import androidx.compose.animation.expandHorizontally
import androidx.compose.animation.fadeIn
import androidx.compose.animation.fadeOut
import androidx.compose.animation.shrinkHorizontally
import androidx.compose.animation.slideInHorizontally
import androidx.compose.animation.slideOutHorizontally
import androidx.compose.foundation.background

import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxHeight
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
Expand All @@ -20,10 +11,8 @@ import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Clear
import androidx.compose.material.icons.filled.Search
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
import androidx.compose.material3.SearchBar
import androidx.compose.material3.Text
import androidx.compose.material3.TextField
import androidx.compose.runtime.Composable
Expand All @@ -38,18 +27,13 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.focus.FocusRequester
import androidx.compose.ui.focus.focusRequester
import androidx.compose.ui.focus.onFocusChanged
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.platform.LocalDensity
import androidx.compose.ui.platform.LocalWindowInfo
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.text.font.FontFamily
import androidx.compose.ui.text.style.TextMotion
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import com.thatsmanmeet.taskyapp.R

@Composable
fun SearchBarTop(searchText: String, onValueChange: (String)->Unit) {
Expand Down Expand Up @@ -80,16 +64,16 @@ fun SearchBarTop(searchText: String, onValueChange: (String)->Unit) {
value = searchText,//searchText ,
onValueChange = onValueChange,
modifier = Modifier
.fillMaxWidth()
.fillMaxWidth(1f)
.align(Alignment.CenterVertically)
.padding(top = 10.dp, bottom = 10.dp)
.padding(top = 5.dp, bottom = 5.dp)
.focusRequester(focusRequester),
textStyle = TextStyle(
textMotion = TextMotion.Animated,
fontFamily = FontFamily.Monospace,
fontSize = 18.sp
),
shape = RoundedCornerShape(20.dp),
shape = RoundedCornerShape(30.dp),
leadingIcon = {
Icon(
Icons.Default.Search,
Expand Down Expand Up @@ -125,8 +109,8 @@ fun SearchBarTop(searchText: String, onValueChange: (String)->Unit) {
}
}
}
@Preview
@Preview(showBackground = true)
@Composable
fun SearchBarTopPreview() {
SearchBarTop(" ", {})
SearchBarTop(" ") {}
}
2 changes: 1 addition & 1 deletion app/src/main/java/com/thatsmanmeet/taskyapp/screens/App.kt
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ fun MyApp(
fontSize = 25.sp
)
SearchBarTop(searchText) { searchText = it }
Spacer(modifier = modifier.width(10.dp))
Spacer(modifier = modifier.width(0.dp))
IconButton(onClick = {
// Implement Navigation to settings
navHostController.navigate(route = Screen.SettingsScreen.route)
Expand Down

0 comments on commit 380bdcb

Please sign in to comment.