From 873e7c79ee9007beca75f58cb12029c6c43ecd14 Mon Sep 17 00:00:00 2001 From: Ahmed El-Helw Date: Sun, 1 Dec 2024 14:31:49 +0400 Subject: [PATCH] Make minor improvements to the ui --- .../labs/androidquran/ui/PagerActivity.kt | 6 ++-- .../main/res/layout/quran_page_activity.xml | 6 ---- app/src/main/res/values-night/colors.xml | 1 - app/src/main/res/values/colors.xml | 1 - .../feature/audiobar/AudioBarWrapper.kt | 2 ++ .../feature/audiobar/ui/LoadingAudioBar.kt | 28 ++++++++++--------- .../feature/linebyline/ui/QuranPageWrapper.kt | 2 +- 7 files changed, 20 insertions(+), 26 deletions(-) diff --git a/app/src/main/java/com/quran/labs/androidquran/ui/PagerActivity.kt b/app/src/main/java/com/quran/labs/androidquran/ui/PagerActivity.kt index 28af405882..cc3cb20bba 100644 --- a/app/src/main/java/com/quran/labs/androidquran/ui/PagerActivity.kt +++ b/app/src/main/java/com/quran/labs/androidquran/ui/PagerActivity.kt @@ -1063,10 +1063,8 @@ class PagerActivity : AppCompatActivity(), AudioBarListener, OnBookmarkTagsUpdat public override fun onPause() { foregroundDisposable.clear() - if (promptDialog != null) { - promptDialog!!.dismiss() - promptDialog = null - } + promptDialog?.dismiss() + promptDialog = null recentPagePresenter.unbind() quranSettings.wasShowingTranslation = pagerAdapter.isShowingTranslation diff --git a/app/src/main/res/layout/quran_page_activity.xml b/app/src/main/res/layout/quran_page_activity.xml index d07aaddbd6..ee629b78df 100644 --- a/app/src/main/res/layout/quran_page_activity.xml +++ b/app/src/main/res/layout/quran_page_activity.xml @@ -41,12 +41,6 @@ android:visibility="gone" /> - - #ffffffff #ffffffff #ffffffff - #ff36343a diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index aa669819cc..a94d8e3b0c 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -4,7 +4,6 @@ #ff44464e #ff44464e #ff44464e - #ffe4e4e7 #ff212121 #ff303030 diff --git a/feature/audiobar/src/main/kotlin/com/quran/mobile/feature/audiobar/AudioBarWrapper.kt b/feature/audiobar/src/main/kotlin/com/quran/mobile/feature/audiobar/AudioBarWrapper.kt index ecc9115a41..98a0000064 100644 --- a/feature/audiobar/src/main/kotlin/com/quran/mobile/feature/audiobar/AudioBarWrapper.kt +++ b/feature/audiobar/src/main/kotlin/com/quran/mobile/feature/audiobar/AudioBarWrapper.kt @@ -69,6 +69,8 @@ class AudioBarWrapper @JvmOverloads constructor( .only(WindowInsetsSides.Horizontal.plus(WindowInsetsSides.Bottom)) .asPaddingValues() ) + .padding(top = 8.dp) + .padding(horizontal = 16.dp) .height(dimensionResource(id = R.dimen.audiobar_height)) ) } diff --git a/feature/audiobar/src/main/kotlin/com/quran/mobile/feature/audiobar/ui/LoadingAudioBar.kt b/feature/audiobar/src/main/kotlin/com/quran/mobile/feature/audiobar/ui/LoadingAudioBar.kt index 76cd33b566..bb3f52c488 100644 --- a/feature/audiobar/src/main/kotlin/com/quran/mobile/feature/audiobar/ui/LoadingAudioBar.kt +++ b/feature/audiobar/src/main/kotlin/com/quran/mobile/feature/audiobar/ui/LoadingAudioBar.kt @@ -3,11 +3,10 @@ package com.quran.mobile.feature.audiobar.ui import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.IntrinsicSize import androidx.compose.foundation.layout.Row -import androidx.compose.foundation.layout.fillMaxHeight +import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height -import androidx.compose.foundation.layout.width +import androidx.compose.foundation.layout.padding import androidx.compose.material.icons.filled.Close -import androidx.compose.material3.Divider import androidx.compose.material3.Icon import androidx.compose.material3.IconButton import androidx.compose.material3.LinearProgressIndicator @@ -17,7 +16,7 @@ import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.res.stringResource import androidx.compose.ui.tooling.preview.Preview -import androidx.compose.ui.unit.Dp +import androidx.compose.ui.unit.dp import com.quran.labs.androidquran.common.ui.core.QuranIcons import com.quran.labs.androidquran.common.ui.core.QuranTheme import com.quran.mobile.feature.audiobar.state.AudioBarState @@ -66,17 +65,20 @@ internal fun ProgressAudioBar( Icon(QuranIcons.Close, contentDescription = stringResource(id = android.R.string.cancel)) } - Divider( - modifier = Modifier - .fillMaxHeight() - .width(Dp.Hairline) - ) - - Column { + Column(modifier = Modifier.weight(1f)) { if (progress == -1) { - LinearProgressIndicator() + LinearProgressIndicator( + modifier = Modifier.fillMaxWidth() + .padding(end = 8.dp) + ) } else { - LinearProgressIndicator(progress = progress.toFloat() / 100f) + LinearProgressIndicator( + progress = { progress.toFloat() / 100f }, + gapSize = 0.dp, + drawStopIndicator = {}, + modifier = Modifier.fillMaxWidth() + .padding(end = 8.dp) + ) } Text(text = stringResource(id = messageResource)) diff --git a/feature/linebyline/src/main/java/com/quran/labs/androidquran/extra/feature/linebyline/ui/QuranPageWrapper.kt b/feature/linebyline/src/main/java/com/quran/labs/androidquran/extra/feature/linebyline/ui/QuranPageWrapper.kt index c64c46d9a6..76bc644012 100644 --- a/feature/linebyline/src/main/java/com/quran/labs/androidquran/extra/feature/linebyline/ui/QuranPageWrapper.kt +++ b/feature/linebyline/src/main/java/com/quran/labs/androidquran/extra/feature/linebyline/ui/QuranPageWrapper.kt @@ -39,7 +39,7 @@ fun QuranPageWrapper( val adjustedBrightness = (50 * ln1p(backgroundBrightness.toDouble()) + originalTextBrightness).toInt() val textBrightness = min(adjustedBrightness.toFloat(), 255f) - val overlayColor = Color(0x50, 0x50, 0x50) + val overlayColor = Color(0x60, 0x60, 0x60) val displayInfo = pageInfo.displayText val showHeaderFooter = displaySettings.showHeaderFooter