@@ -23,6 +23,7 @@ import android.content.Intent
2323import android.content.pm.PackageManager
2424import android.content.res.AssetFileDescriptor
2525import android.database.Cursor
26+ import android.graphics.drawable.ColorDrawable
2627import android.graphics.drawable.Drawable
2728import android.location.LocationManager
2829import android.net.Uri
@@ -66,8 +67,11 @@ import androidx.cardview.widget.CardView
6667import androidx.compose.foundation.gestures.scrollBy
6768import androidx.compose.foundation.lazy.LazyListState
6869import androidx.compose.foundation.lazy.rememberLazyListState
70+ import androidx.compose.foundation.background
71+ import androidx.compose.foundation.layout.Box
6972import androidx.compose.foundation.layout.fillMaxWidth
70- import androidx.compose.material3.HorizontalDivider
73+ import androidx.compose.foundation.layout.height
74+ import androidx.compose.ui.unit.dp
7175import androidx.compose.material3.LinearProgressIndicator
7276import androidx.compose.material3.MaterialTheme
7377import androidx.compose.runtime.Composable
@@ -84,6 +88,7 @@ import androidx.compose.runtime.produceState
8488import androidx.compose.runtime.remember
8589import androidx.compose.runtime.rememberCoroutineScope
8690import androidx.compose.runtime.setValue
91+ import androidx.compose.ui.graphics.Color
8792import androidx.compose.ui.platform.ComposeView
8893import androidx.coordinatorlayout.widget.CoordinatorLayout
8994import androidx.core.content.ContextCompat
@@ -1816,16 +1821,24 @@ class ChatActivity :
18161821 supportActionBar?.setIcon(resources!! .getColor(R .color.transparent, null ).toDrawable())
18171822 setActionBarTitle()
18181823 viewThemeUtils.material.themeToolbar(binding.chatToolbar)
1824+ val toolbarBackgroundColorInt = (binding.chatToolbar.background as ? ColorDrawable )?.color
18191825 binding.searchLoadingIndicatorComposeView.setContent {
18201826 MaterialTheme (colorScheme = viewThemeUtils.getColorScheme(this @ChatActivity)) {
18211827 val isLoading by searchLoadingState
1822- if (isLoading) {
1823- LinearProgressIndicator (
1824- modifier = Modifier .fillMaxWidth(),
1825- color = MaterialTheme .colorScheme.primary
1826- )
1827- } else {
1828- HorizontalDivider ()
1828+ val appBarBackgroundColor = toolbarBackgroundColorInt?.let (::Color ) ? : MaterialTheme .colorScheme.surface
1829+ Box (
1830+ modifier = Modifier
1831+ .fillMaxWidth()
1832+ .height(4 .dp)
1833+ .background(appBarBackgroundColor)
1834+ ) {
1835+ if (isLoading) {
1836+ LinearProgressIndicator (
1837+ modifier = Modifier .fillMaxWidth(),
1838+ color = MaterialTheme .colorScheme.primary,
1839+ trackColor = appBarBackgroundColor
1840+ )
1841+ }
18291842 }
18301843 }
18311844 }
0 commit comments