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"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
<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" />
|
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||||
</component>
|
</component>
|
||||||
<component name="ProjectType">
|
<component name="ProjectType">
|
||||||
|
|||||||
@@ -93,4 +93,7 @@ dependencies {
|
|||||||
implementation(libs.jsoup)
|
implementation(libs.jsoup)
|
||||||
|
|
||||||
implementation(libs.retrofit.scalars)
|
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.foundation.shape.RoundedCornerShape
|
||||||
import androidx.compose.material.icons.Icons
|
import androidx.compose.material.icons.Icons
|
||||||
import androidx.compose.material.icons.filled.Build
|
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.filled.Search
|
||||||
import androidx.compose.material.icons.rounded.Refresh
|
import androidx.compose.material.icons.rounded.Refresh
|
||||||
import androidx.compose.material3.Icon
|
import androidx.compose.material3.Icon
|
||||||
@@ -42,9 +44,9 @@ import androidx.navigation.compose.currentBackStackEntryAsState
|
|||||||
fun BottomBar(navController: NavHostController) {
|
fun BottomBar(navController: NavHostController) {
|
||||||
|
|
||||||
val items = listOf(
|
val items = listOf(
|
||||||
Triple("home", "دارو", Icons.Default.Search),
|
Triple("home", "عمومی", Icons.Filled.LocalPharmacy),
|
||||||
Triple("search", "سرچ", Icons.Rounded.Refresh),
|
Triple("search", "جستجو",Icons.Filled.Search),
|
||||||
Triple("lab", "آزمایش", Icons.Default.Build)
|
Triple("lab", "آزمایش", Icons.Filled.Science)
|
||||||
)
|
)
|
||||||
|
|
||||||
val navBackStackEntry by navController.currentBackStackEntryAsState()
|
val navBackStackEntry by navController.currentBackStackEntryAsState()
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ fun CustomTextFilled(
|
|||||||
showClearButton: Boolean = true,
|
showClearButton: Boolean = true,
|
||||||
showSearchButton: Boolean = true,
|
showSearchButton: Boolean = true,
|
||||||
autoSearch: Boolean = false,
|
autoSearch: Boolean = false,
|
||||||
searchDelay: Long = 500L,
|
searchDelay: Long = 1200L,
|
||||||
keyboardOptions: KeyboardOptions = KeyboardOptions(
|
keyboardOptions: KeyboardOptions = KeyboardOptions(
|
||||||
imeAction = ImeAction.Search
|
imeAction = ImeAction.Search
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -140,32 +140,32 @@ fun HomeContent(
|
|||||||
Column (
|
Column (
|
||||||
verticalArrangement = Arrangement.Center
|
verticalArrangement = Arrangement.Center
|
||||||
){
|
){
|
||||||
CustomTextFilled(
|
// CustomTextFilled(
|
||||||
value = searchText,
|
// value = searchText,
|
||||||
onValueChange = { searchText = it },
|
// onValueChange = { searchText = it },
|
||||||
onSearch = { query ->
|
// onSearch = { query ->
|
||||||
if (query.isNotBlank()) {
|
// if (query.isNotBlank()) {
|
||||||
onSearch(query)
|
// onSearch(query)
|
||||||
}
|
// }
|
||||||
},
|
// },
|
||||||
placeholder = "جستجوی دارو",
|
// placeholder = "جستجوی دارو",
|
||||||
showClearButton = true,
|
// showClearButton = true,
|
||||||
showSearchButton = true,
|
// showSearchButton = true,
|
||||||
autoSearch = false, // Set to true if you want search while typing
|
// autoSearch = false, // Set to true if you want search while typing
|
||||||
height = 45
|
// height = 45
|
||||||
)
|
// )
|
||||||
Spacer(modifier = Modifier.height(MaterialTheme.dime.xs))
|
// Spacer(modifier = Modifier.height(MaterialTheme.dime.xs))
|
||||||
PrimaryButton(
|
// PrimaryButton(
|
||||||
text = "جستجو",
|
// text = "جستجو",
|
||||||
height = 40,
|
// height = 40,
|
||||||
isLoading = state.drugSearchState.isLoading,
|
// isLoading = state.drugSearchState.isLoading,
|
||||||
onClick = {
|
// onClick = {
|
||||||
if (searchText.isNotBlank()) {
|
// if (searchText.isNotBlank()) {
|
||||||
onSearch(searchText)
|
// onSearch(searchText)
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
)
|
// )
|
||||||
Spacer(modifier = Modifier.height(MaterialTheme.dime.xs))
|
// Spacer(modifier = Modifier.height(MaterialTheme.dime.xs))
|
||||||
Box(modifier = Modifier.fillMaxSize()) {
|
Box(modifier = Modifier.fillMaxSize()) {
|
||||||
|
|
||||||
// Always draw the data if available
|
// Always draw the data if available
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ fun SearchScreen(
|
|||||||
placeholder = "جستجوی دارو",
|
placeholder = "جستجوی دارو",
|
||||||
showClearButton = true,
|
showClearButton = true,
|
||||||
showSearchButton = true,
|
showSearchButton = true,
|
||||||
autoSearch = false,
|
autoSearch = true,
|
||||||
height = 45
|
height = 45
|
||||||
)
|
)
|
||||||
Spacer(modifier = Modifier.height(MaterialTheme.dime.xs))
|
Spacer(modifier = Modifier.height(MaterialTheme.dime.xs))
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ navigationCompose = "2.8.5"
|
|||||||
material3 = "1.4.0"
|
material3 = "1.4.0"
|
||||||
jsoup = "1.18.3"
|
jsoup = "1.18.3"
|
||||||
scalars = "2.11.0"
|
scalars = "2.11.0"
|
||||||
|
iconExtend="1.7.8"
|
||||||
[libraries]
|
[libraries]
|
||||||
jsoup = { module = "org.jsoup:jsoup", version.ref = "jsoup" }
|
jsoup = { module = "org.jsoup:jsoup", version.ref = "jsoup" }
|
||||||
androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" }
|
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-ui-test-junit4 = { group = "androidx.compose.ui", name = "ui-test-junit4" }
|
||||||
androidx-compose-material3 = { group = "androidx.compose.material3", name = "material3" }
|
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-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" }
|
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-android = { module = "io.insert-koin:koin-android", version.ref = "koinAndroid" }
|
||||||
koin-androidx-compose-v410 = { module = "io.insert-koin:koin-androidx-compose", version.ref = "koinAndroidxCompose" }
|
koin-androidx-compose-v410 = { module = "io.insert-koin:koin-androidx-compose", version.ref = "koinAndroidxCompose" }
|
||||||
|
|||||||
Reference in New Issue
Block a user