fix: title of app bar fixed

This commit is contained in:
2026-05-28 19:43:39 +03:30
parent c8044bfe42
commit 4a57954faf
6 changed files with 22 additions and 9 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="CompilerConfiguration"> <component name="CompilerConfiguration">
<bytecodeTargetLevel target="21" /> <bytecodeTargetLevel target="17" />
</component> </component>
</project> </project>
+1 -1
View File
@@ -4,7 +4,7 @@
<selectionStates> <selectionStates>
<SelectionState runConfigName="app"> <SelectionState runConfigName="app">
<option name="selectionMode" value="DROPDOWN" /> <option name="selectionMode" value="DROPDOWN" />
<DropdownSelection timestamp="2026-05-15T13:26:47.825150Z"> <DropdownSelection timestamp="2026-05-28T05:38:32.685363Z">
<Target type="DEFAULT_BOOT"> <Target type="DEFAULT_BOOT">
<handle> <handle>
<DeviceId pluginId="LocalEmulator" identifier="path=/Users/amirmahdi/.android/avd/Pixel_3a_API_33_arm64-v8a.avd" /> <DeviceId pluginId="LocalEmulator" identifier="path=/Users/amirmahdi/.android/avd/Pixel_3a_API_33_arm64-v8a.avd" />
+13
View File
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="DeviceTable">
<option name="columnSorters">
<list>
<ColumnSorterState>
<option name="column" value="Name" />
<option name="order" value="ASCENDING" />
</ColumnSorterState>
</list>
</option>
</component>
</project>
+1 -1
View File
@@ -1,6 +1,6 @@
<project version="4"> <project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" /> <component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="ProjectRootManager" version="2" languageLevel="JDK_21" default="true" project-jdk-name="jbr-21" project-jdk-type="JavaSDK"> <component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="17" 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">
@@ -87,8 +87,9 @@ class DrugDetailParser {
private fun extractPersianName(document: Document): String { private fun extractPersianName(document: Document): String {
val titleElement = document.select("h1.EnglishNumericFont").first() val titleElement = document.select("h1.EnglishNumericFont").first()
val fullText = titleElement?.text() ?: "" val fullText = titleElement?.text() ?: ""
// Remove the suffix "چیست و برای چه مواردی استفاده می شود؟" val regexFullText = fullText.replace(Regex("\\s*چیست و برای چه مواردی استفاده می شود؟\\s*"), "").trim()
return fullText.replace(Regex("\\s*چیست و برای چه مواردی استفاده می شود\\?\\s*"), "").trim() println("regexFullText: $regexFullText")
return regexFullText
} }
private fun extractEnglishName(document: Document): String { private fun extractEnglishName(document: Document): String {
@@ -1,5 +1,6 @@
package com.approagency.drug.presentation.screens package com.approagency.drug.presentation.screens
import android.R
import androidx.compose.foundation.background import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Box
@@ -83,10 +84,8 @@ fun DrugDetailScreen(
is DrugDetailYabState.Success -> { is DrugDetailYabState.Success -> {
Column { Column {
Text( Text(
text = state.drugDetail.persianName.take(25), text = state.drugDetail.persianName,
fontSize = 16.sp, style = MaterialTheme.typography.titleMedium
fontWeight = FontWeight.Medium,
maxLines = 1
) )
if (state.drugDetail.englishName.isNotEmpty()) { if (state.drugDetail.englishName.isNotEmpty()) {
Text( Text(