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
@@ -87,8 +87,9 @@ class DrugDetailParser {
private fun extractPersianName(document: Document): String {
val titleElement = document.select("h1.EnglishNumericFont").first()
val fullText = titleElement?.text() ?: ""
// Remove the suffix "چیست و برای چه مواردی استفاده می شود؟"
return fullText.replace(Regex("\\s*چیست و برای چه مواردی استفاده می شود\\?\\s*"), "").trim()
val regexFullText = fullText.replace(Regex("\\s*چیست و برای چه مواردی استفاده می شود؟\\s*"), "").trim()
println("regexFullText: $regexFullText")
return regexFullText
}
private fun extractEnglishName(document: Document): String {
@@ -1,5 +1,6 @@
package com.approagency.drug.presentation.screens
import android.R
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
@@ -83,10 +84,8 @@ fun DrugDetailScreen(
is DrugDetailYabState.Success -> {
Column {
Text(
text = state.drugDetail.persianName.take(25),
fontSize = 16.sp,
fontWeight = FontWeight.Medium,
maxLines = 1
text = state.drugDetail.persianName,
style = MaterialTheme.typography.titleMedium
)
if (state.drugDetail.englishName.isNotEmpty()) {
Text(