feat: add icons and btn nav
This commit is contained in:
Generated
+1
-1
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_21" project-jdk-name="jbr-21" project-jdk-type="JavaSDK">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_21" default="true" project-jdk-name="jbr-21" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||
</component>
|
||||
<component name="ProjectType">
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -22,6 +22,7 @@ navigationCompose = "2.8.5"
|
||||
material3 = "1.4.0"
|
||||
jsoup = "1.18.3"
|
||||
scalars = "2.11.0"
|
||||
iconExtend="1.7.8"
|
||||
[libraries]
|
||||
jsoup = { module = "org.jsoup:jsoup", version.ref = "jsoup" }
|
||||
androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" }
|
||||
@@ -39,7 +40,7 @@ androidx-compose-ui-test-manifest = { group = "androidx.compose.ui", name = "ui-
|
||||
androidx-compose-ui-test-junit4 = { group = "androidx.compose.ui", name = "ui-test-junit4" }
|
||||
androidx-compose-material3 = { group = "androidx.compose.material3", name = "material3" }
|
||||
androidx-compose-material-icons-core = { group = "androidx.compose.material", name = "material-icons-core" }
|
||||
|
||||
androidx-compose-material-icons-extended = {module ="androidx.compose.material:material-icons-extended", name="material-icons-extended" , version.ref = "iconExtend"}
|
||||
androidx-lifecycle-viewmodel-compose = { module = "androidx.lifecycle:lifecycle-viewmodel-compose", version.ref = "lifecycleRuntimeKtx" }
|
||||
koin-android = { module = "io.insert-koin:koin-android", version.ref = "koinAndroid" }
|
||||
koin-androidx-compose-v410 = { module = "io.insert-koin:koin-androidx-compose", version.ref = "koinAndroidxCompose" }
|
||||
|
||||
Reference in New Issue
Block a user