feat: add icons and btn nav
This commit is contained in:
@@ -93,4 +93,7 @@ dependencies {
|
||||
implementation(libs.jsoup)
|
||||
|
||||
implementation(libs.retrofit.scalars)
|
||||
|
||||
|
||||
implementation(libs.androidx.compose.material.icons.extended)
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,37 @@
|
||||
{
|
||||
"version": 3,
|
||||
"artifactType": {
|
||||
"type": "APK",
|
||||
"kind": "Directory"
|
||||
},
|
||||
"applicationId": "com.approagency.drug",
|
||||
"variantName": "release",
|
||||
"elements": [
|
||||
{
|
||||
"type": "SINGLE",
|
||||
"filters": [],
|
||||
"attributes": [],
|
||||
"versionCode": 1,
|
||||
"versionName": "1.0",
|
||||
"outputFile": "app-release.apk"
|
||||
}
|
||||
],
|
||||
"elementType": "File",
|
||||
"baselineProfiles": [
|
||||
{
|
||||
"minApi": 28,
|
||||
"maxApi": 30,
|
||||
"baselineProfiles": [
|
||||
"baselineProfiles/1/app-release.dm"
|
||||
]
|
||||
},
|
||||
{
|
||||
"minApi": 31,
|
||||
"maxApi": 2147483647,
|
||||
"baselineProfiles": [
|
||||
"baselineProfiles/0/app-release.dm"
|
||||
]
|
||||
}
|
||||
],
|
||||
"minSdkVersionForDexing": 24
|
||||
}
|
||||
Binary file not shown.
@@ -17,6 +17,8 @@ import androidx.compose.foundation.layout.width
|
||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||
import androidx.compose.material.icons.Icons
|
||||
import androidx.compose.material.icons.filled.Build
|
||||
import androidx.compose.material.icons.filled.LocalPharmacy
|
||||
import androidx.compose.material.icons.filled.Science
|
||||
import androidx.compose.material.icons.filled.Search
|
||||
import androidx.compose.material.icons.rounded.Refresh
|
||||
import androidx.compose.material3.Icon
|
||||
@@ -42,9 +44,9 @@ import androidx.navigation.compose.currentBackStackEntryAsState
|
||||
fun BottomBar(navController: NavHostController) {
|
||||
|
||||
val items = listOf(
|
||||
Triple("home", "دارو", Icons.Default.Search),
|
||||
Triple("search", "سرچ", Icons.Rounded.Refresh),
|
||||
Triple("lab", "آزمایش", Icons.Default.Build)
|
||||
Triple("home", "عمومی", Icons.Filled.LocalPharmacy),
|
||||
Triple("search", "جستجو",Icons.Filled.Search),
|
||||
Triple("lab", "آزمایش", Icons.Filled.Science)
|
||||
)
|
||||
|
||||
val navBackStackEntry by navController.currentBackStackEntryAsState()
|
||||
|
||||
@@ -47,7 +47,7 @@ fun CustomTextFilled(
|
||||
showClearButton: Boolean = true,
|
||||
showSearchButton: Boolean = true,
|
||||
autoSearch: Boolean = false,
|
||||
searchDelay: Long = 500L,
|
||||
searchDelay: Long = 1200L,
|
||||
keyboardOptions: KeyboardOptions = KeyboardOptions(
|
||||
imeAction = ImeAction.Search
|
||||
),
|
||||
|
||||
@@ -140,32 +140,32 @@ fun HomeContent(
|
||||
Column (
|
||||
verticalArrangement = Arrangement.Center
|
||||
){
|
||||
CustomTextFilled(
|
||||
value = searchText,
|
||||
onValueChange = { searchText = it },
|
||||
onSearch = { query ->
|
||||
if (query.isNotBlank()) {
|
||||
onSearch(query)
|
||||
}
|
||||
},
|
||||
placeholder = "جستجوی دارو",
|
||||
showClearButton = true,
|
||||
showSearchButton = true,
|
||||
autoSearch = false, // Set to true if you want search while typing
|
||||
height = 45
|
||||
)
|
||||
Spacer(modifier = Modifier.height(MaterialTheme.dime.xs))
|
||||
PrimaryButton(
|
||||
text = "جستجو",
|
||||
height = 40,
|
||||
isLoading = state.drugSearchState.isLoading,
|
||||
onClick = {
|
||||
if (searchText.isNotBlank()) {
|
||||
onSearch(searchText)
|
||||
}
|
||||
}
|
||||
)
|
||||
Spacer(modifier = Modifier.height(MaterialTheme.dime.xs))
|
||||
// CustomTextFilled(
|
||||
// value = searchText,
|
||||
// onValueChange = { searchText = it },
|
||||
// onSearch = { query ->
|
||||
// if (query.isNotBlank()) {
|
||||
// onSearch(query)
|
||||
// }
|
||||
// },
|
||||
// placeholder = "جستجوی دارو",
|
||||
// showClearButton = true,
|
||||
// showSearchButton = true,
|
||||
// autoSearch = false, // Set to true if you want search while typing
|
||||
// height = 45
|
||||
// )
|
||||
// Spacer(modifier = Modifier.height(MaterialTheme.dime.xs))
|
||||
// PrimaryButton(
|
||||
// text = "جستجو",
|
||||
// height = 40,
|
||||
// isLoading = state.drugSearchState.isLoading,
|
||||
// onClick = {
|
||||
// if (searchText.isNotBlank()) {
|
||||
// onSearch(searchText)
|
||||
// }
|
||||
// }
|
||||
// )
|
||||
// Spacer(modifier = Modifier.height(MaterialTheme.dime.xs))
|
||||
Box(modifier = Modifier.fillMaxSize()) {
|
||||
|
||||
// Always draw the data if available
|
||||
|
||||
@@ -110,7 +110,7 @@ fun SearchScreen(
|
||||
placeholder = "جستجوی دارو",
|
||||
showClearButton = true,
|
||||
showSearchButton = true,
|
||||
autoSearch = false,
|
||||
autoSearch = true,
|
||||
height = 45
|
||||
)
|
||||
Spacer(modifier = Modifier.height(MaterialTheme.dime.xs))
|
||||
|
||||
Reference in New Issue
Block a user