From ae3cada1c7dcb853d7baa5c1865da16560b88cbc Mon Sep 17 00:00:00 2001 From: Amine Date: Mon, 13 Jan 2025 16:45:02 +0100 Subject: [PATCH] chore: changing actions in reader fragment. --- androidApp/build.gradle.kts | 2 +- .../android/SettingsActivityGeneralTest.kt | 26 --- .../android/fragments/ArticleFragment.kt | 171 ++++++++---------- .../android/utils/AppUtils.kt | 18 ++ .../android/utils/bottombar/BottomBarUtils.kt | 29 +++ .../src/main/res/layout/fragment_article.xml | 37 +--- .../src/main/res/menu/reader_toolbar.xml | 23 --- .../src/main/res/values-ca-rES/strings.xml | 5 +- .../src/main/res/values-de-rDE/strings.xml | 5 +- .../src/main/res/values-es-rES/strings.xml | 5 +- .../src/main/res/values-fr-rFR/strings.xml | 5 +- .../src/main/res/values-gl-rES/strings.xml | 5 +- .../src/main/res/values-in-rID/strings.xml | 5 +- .../src/main/res/values-it-rIT/strings.xml | 5 +- .../src/main/res/values-ko-rKR/strings.xml | 5 +- .../src/main/res/values-nl-rNL/strings.xml | 7 +- .../src/main/res/values-pt-rBR/strings.xml | 5 +- .../src/main/res/values-pt-rPT/strings.xml | 5 +- .../src/main/res/values-si-rLK/strings.xml | 5 +- .../src/main/res/values-tr-rTR/strings.xml | 5 +- .../src/main/res/values-zh-rCN/strings.xml | 5 +- .../src/main/res/values-zh-rTW/strings.xml | 5 +- androidApp/src/main/res/values/ids.xml | 6 + androidApp/src/main/res/values/strings.xml | 5 +- androidApp/src/main/res/xml/pref_general.xml | 8 - gradle.properties | 2 +- .../service/AppSettingsService.kt | 15 -- 27 files changed, 157 insertions(+), 262 deletions(-) delete mode 100644 androidApp/src/main/res/menu/reader_toolbar.xml create mode 100644 androidApp/src/main/res/values/ids.xml diff --git a/androidApp/build.gradle.kts b/androidApp/build.gradle.kts index ace0b01..a1e59a4 100644 --- a/androidApp/build.gradle.kts +++ b/androidApp/build.gradle.kts @@ -156,7 +156,7 @@ dependencies { implementation("com.github.bumptech.glide:okhttp3-integration:4.16.0") // Themes - implementation("com.github.rubensousa:floatingtoolbar:1.5.1") + implementation("com.leinardi.android:speed-dial:3.3.0") // Pager implementation("me.relex:circleindicator:2.1.6") diff --git a/androidApp/src/androidTest/kotlin/bou/amine/apps/readerforselfossv2/android/SettingsActivityGeneralTest.kt b/androidApp/src/androidTest/kotlin/bou/amine/apps/readerforselfossv2/android/SettingsActivityGeneralTest.kt index 80463c2..7aa60df 100644 --- a/androidApp/src/androidTest/kotlin/bou/amine/apps/readerforselfossv2/android/SettingsActivityGeneralTest.kt +++ b/androidApp/src/androidTest/kotlin/bou/amine/apps/readerforselfossv2/android/SettingsActivityGeneralTest.kt @@ -65,19 +65,6 @@ class SettingsActivityGeneralTest { ), ), ) - onView(withSettingsCheckboxWidget(R.string.reader_static_bar_title)).check( - matches( - allOf( - isDisplayed(), - not(isChecked()), - ), - ), - ) - onView(withSettingsCheckboxFrame(R.string.reader_static_bar_title)).check( - matches( - isEnabled(), - ), - ) onView(withText(R.string.pref_general_category_displaying)).check(matches(isDisplayed())) onView(withSettingsCheckboxWidget(R.string.pref_switch_card_view_title)).check( matches( @@ -161,19 +148,6 @@ class SettingsActivityGeneralTest { @Test fun testGeneralActionsCheckboxes() { - // article viewer settings - onView(withSettingsCheckboxFrame(R.string.reader_static_bar_title)).check( - matches( - isEnabled(), - ), - ) - onView(withSettingsCheckboxWidget(R.string.pref_article_viewer_title)).perform(click()) - onView(withSettingsCheckboxFrame(R.string.reader_static_bar_title)).check( - matches( - not(isEnabled()), - ), - ) - onView(withSettingsCheckboxFrame(R.string.card_height_title)).check(matches(not(isEnabled()))) onView(withSettingsCheckboxWidget(R.string.pref_switch_card_view_title)).perform(click()) onView(withSettingsCheckboxFrame(R.string.card_height_title)).check(matches(isEnabled())) diff --git a/androidApp/src/main/java/bou/amine/apps/readerforselfossv2/android/fragments/ArticleFragment.kt b/androidApp/src/main/java/bou/amine/apps/readerforselfossv2/android/fragments/ArticleFragment.kt index dba460a..7815052 100644 --- a/androidApp/src/main/java/bou/amine/apps/readerforselfossv2/android/fragments/ArticleFragment.kt +++ b/androidApp/src/main/java/bou/amine/apps/readerforselfossv2/android/fragments/ArticleFragment.kt @@ -2,18 +2,14 @@ package bou.amine.apps.readerforselfossv2.android.fragments import android.content.Context import android.content.Intent -import android.content.res.ColorStateList import android.content.res.TypedArray import android.graphics.Bitmap import android.graphics.Typeface -import android.graphics.drawable.ColorDrawable import android.os.Bundle -import android.util.TypedValue import android.util.TypedValue.DATA_NULL_UNDEFINED import android.view.GestureDetector import android.view.InflateException import android.view.LayoutInflater -import android.view.MenuItem import android.view.MotionEvent import android.view.View import android.view.ViewGroup @@ -23,7 +19,6 @@ import android.webkit.WebView import android.webkit.WebViewClient import android.widget.Toast import androidx.appcompat.app.AlertDialog -import androidx.core.widget.NestedScrollView import androidx.fragment.app.Fragment import bou.amine.apps.readerforselfossv2.android.ImageActivity import bou.amine.apps.readerforselfossv2.android.R @@ -32,6 +27,8 @@ import bou.amine.apps.readerforselfossv2.android.model.ParecelableItem import bou.amine.apps.readerforselfossv2.android.model.toModel import bou.amine.apps.readerforselfossv2.android.model.toParcelable import bou.amine.apps.readerforselfossv2.android.utils.acra.sendSilentlyWithAcraWithName +import bou.amine.apps.readerforselfossv2.android.utils.bottombar.addHomeMadeActionItem +import bou.amine.apps.readerforselfossv2.android.utils.getColorFromAttr import bou.amine.apps.readerforselfossv2.android.utils.glide.bitmapFitCenter import bou.amine.apps.readerforselfossv2.android.utils.glide.getBitmapInputStream import bou.amine.apps.readerforselfossv2.android.utils.glide.getGlideImageForResource @@ -48,8 +45,7 @@ import bou.amine.apps.readerforselfossv2.utils.getHtmlDecoded import bou.amine.apps.readerforselfossv2.utils.getImages import bou.amine.apps.readerforselfossv2.utils.getThumbnail import bou.amine.apps.readerforselfossv2.utils.isEmptyOrNullOrNullString -import com.github.rubensousa.floatingtoolbar.FloatingToolbar -import com.google.android.material.floatingactionbutton.FloatingActionButton +import com.leinardi.android.speeddial.SpeedDialView import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -74,6 +70,8 @@ private const val DEFAULT_FONT_SIZE = 16 class ArticleFragment : Fragment(), DIAware { + private var colorOnSurface: Int = 0 + private var colorSurface: Int = 0 private var fontSize: Int = DEFAULT_FONT_SIZE private lateinit var item: SelfossModel.Item private lateinit var url: String @@ -82,7 +80,7 @@ class ArticleFragment : private lateinit var contentImage: String private lateinit var contentTitle: String private lateinit var allImages: ArrayList - private lateinit var fab: FloatingActionButton + private lateinit var fab: SpeedDialView private lateinit var textAlignment: String private lateinit var binding: FragmentArticleBinding @@ -93,7 +91,6 @@ class ArticleFragment : private var typeface: Typeface? = null private var resId: Int = 0 private var font = "" - private var staticBar = false private val mercuryApi: MercuryApi by instance() @@ -120,6 +117,9 @@ class ArticleFragment : e.sendSilentlyWithAcra() } + colorOnSurface = requireContext().getColorFromAttr(R.attr.colorOnSurface) + colorSurface = requireContext().getColorFromAttr(R.attr.colorSurface) + contentText = item.content contentTitle = item.title.getHtmlDecoded() contentImage = item.getThumbnail(repository.baseUrl) @@ -133,23 +133,11 @@ class ArticleFragment : allImages = item.getImages() fontSize = appSettingsService.getFontSize() - staticBar = appSettingsService.isStaticBarEnabled() font = appSettingsService.getFont() refreshAlignment() - fab = binding.fab - - fab.backgroundTintList = ColorStateList.valueOf(resources.getColor(R.color.colorAccent)) - - fab.rippleColor = resources.getColor(R.color.colorAccentDark) - - val floatingToolbar: FloatingToolbar = handleFloatingToolbar() - - if (staticBar) { - fab.hide() - floatingToolbar.show() - } + handleFloatingToolbar() binding.source.text = contentSource if (typeface != null) { @@ -157,21 +145,6 @@ class ArticleFragment : } handleContent() - - binding.nestedScrollView.setOnScrollChangeListener( - NestedScrollView.OnScrollChangeListener { _, _, scrollY, _, oldScrollY -> - if (scrollY > oldScrollY) { - floatingToolbar.hide() - fab.hide() - } else { - if (staticBar) { - floatingToolbar.show() - } else { - if (floatingToolbar.isShowing) floatingToolbar.hide() else fab.show() - } - } - }, - ) } catch (e: InflateException) { e.sendSilentlyWithAcraWithName("webview not available") try { @@ -216,60 +189,77 @@ class ArticleFragment : } } - private fun handleFloatingToolbar(): FloatingToolbar { - val floatingToolbar: FloatingToolbar = binding.floatingToolbar - if (appSettingsService.getPublicAccess()) { - floatingToolbar.setMenu(R.menu.reader_toolbar_no_read) - } - floatingToolbar.attachFab(fab) + private fun handleFloatingToolbar() { + fab = binding.speedDial + fab.mainFabClosedIconColor = colorOnSurface + fab.mainFabOpenedIconColor = colorOnSurface - floatingToolbar.background = ColorDrawable(resources.getColor(R.color.colorAccent)) + handleFloatingToolbarActionItems() - floatingToolbar.setClickListener( - object : FloatingToolbar.ItemClickListener { - override fun onItemClick(item: MenuItem) { - when (item.itemId) { - R.id.share_action -> requireActivity().shareLink(url, contentTitle) - R.id.open_action -> requireActivity().openItemUrlInBrowserAsNewTask(this@ArticleFragment.item) - R.id.unread_action -> - try { - if (this@ArticleFragment.item.unread) { - CoroutineScope(Dispatchers.IO).launch { - repository.markAsRead(this@ArticleFragment.item) - } - this@ArticleFragment.item.unread = false - Toast - .makeText( - requireContext(), - R.string.marked_as_read, - Toast.LENGTH_LONG, - ).show() - } else { - CoroutineScope(Dispatchers.IO).launch { - repository.unmarkAsRead(this@ArticleFragment.item) - } - this@ArticleFragment.item.unread = true - Toast - .makeText( - context, - R.string.marked_as_unread, - Toast.LENGTH_LONG, - ).show() - } - } catch (e: IllegalStateException) { - e.sendSilentlyWithAcraWithName("Context required is null") + fab.setOnActionSelectedListener { actionItem -> + when (actionItem.id) { + R.id.share_action -> requireActivity().shareLink(url, contentTitle) + R.id.open_action -> requireActivity().openItemUrlInBrowserAsNewTask(this@ArticleFragment.item) + R.id.unread_action -> + try { + if (this@ArticleFragment.item.unread) { + CoroutineScope(Dispatchers.IO).launch { + repository.markAsRead(this@ArticleFragment.item) } - - else -> Unit + this@ArticleFragment.item.unread = false + Toast + .makeText( + requireContext(), + R.string.marked_as_read, + Toast.LENGTH_LONG, + ).show() + } else { + CoroutineScope(Dispatchers.IO).launch { + repository.unmarkAsRead(this@ArticleFragment.item) + } + this@ArticleFragment.item.unread = true + Toast + .makeText( + context, + R.string.marked_as_unread, + Toast.LENGTH_LONG, + ).show() + } + } catch (e: IllegalStateException) { + e.sendSilentlyWithAcraWithName("Context required is null") } - } - override fun onItemLongClick(item: MenuItem?) { - // We do nothing - } - }, + else -> Unit + } + false + } + } + + private fun handleFloatingToolbarActionItems() { + fab.addHomeMadeActionItem( + R.id.share_action, + resources.getDrawable(R.drawable.ic_share_white_24dp), + R.string.reader_action_share, + colorOnSurface, + colorSurface, + requireContext(), + ) + fab.addHomeMadeActionItem( + R.id.open_action, + resources.getDrawable(R.drawable.ic_open_in_browser_white_24dp), + R.string.reader_action_open, + colorOnSurface, + colorSurface, + requireContext(), + ) + fab.addHomeMadeActionItem( + R.id.unread_action, + resources.getDrawable(R.drawable.ic_baseline_white_eye_24dp), + R.string.unmark, + colorOnSurface, + colorSurface, + requireContext(), ) - return floatingToolbar } private fun refreshAlignment() { @@ -392,19 +382,12 @@ class ArticleFragment : return } - val colorOnSurface = TypedValue() - val colorSurface = TypedValue() - try { val attrs: IntArray = intArrayOf(android.R.attr.fontFamily) val a: TypedArray = context.obtainStyledAttributes(resId, attrs) binding.webcontent.settings.standardFontFamily = a.getString(0) binding.webcontent.visibility = View.VISIBLE - - context.theme.resolveAttribute(R.attr.colorOnSurface, colorOnSurface, true) - - context.theme.resolveAttribute(R.attr.colorSurface, colorSurface, true) } catch (e: IllegalStateException) { e.sendSilentlyWithAcraWithName("Context issue when setting attributes, but context wasn't null before") } @@ -412,13 +395,13 @@ class ArticleFragment : val colorSurfaceString = String.format( "#%06X", - WHITE_COLOR_HEX and (if (colorSurface.data != DATA_NULL_UNDEFINED) colorSurface.data else WHITE_COLOR_HEX), + WHITE_COLOR_HEX and (if (colorSurface != DATA_NULL_UNDEFINED) colorSurface else WHITE_COLOR_HEX), ) val colorOnSurfaceString = String.format( "#%06X", - WHITE_COLOR_HEX and (if (colorOnSurface.data != DATA_NULL_UNDEFINED) colorOnSurface.data else 0), + WHITE_COLOR_HEX and (if (colorOnSurface != DATA_NULL_UNDEFINED) colorOnSurface else 0), ) try { diff --git a/androidApp/src/main/java/bou/amine/apps/readerforselfossv2/android/utils/AppUtils.kt b/androidApp/src/main/java/bou/amine/apps/readerforselfossv2/android/utils/AppUtils.kt index 4bbeaa5..4f7bfce 100644 --- a/androidApp/src/main/java/bou/amine/apps/readerforselfossv2/android/utils/AppUtils.kt +++ b/androidApp/src/main/java/bou/amine/apps/readerforselfossv2/android/utils/AppUtils.kt @@ -2,7 +2,11 @@ package bou.amine.apps.readerforselfossv2.android.utils import android.content.Context import android.content.Intent +import android.util.TypedValue +import androidx.annotation.AttrRes +import androidx.annotation.ColorInt import bou.amine.apps.readerforselfossv2.android.R +import bou.amine.apps.readerforselfossv2.android.utils.acra.sendSilentlyWithAcraWithName import bou.amine.apps.readerforselfossv2.utils.toStringUriWithHttp fun Context.shareLink( @@ -23,3 +27,17 @@ fun Context.shareLink( ).setFlags(Intent.FLAG_ACTIVITY_NEW_TASK), ) } + +@ColorInt +fun Context.getColorFromAttr( + @AttrRes attrColor: Int, + resolveRefs: Boolean = true, +): Int { + val typedValue = TypedValue() + try { + this.theme.resolveAttribute(attrColor, typedValue, resolveRefs) + } catch (e: Throwable) { + e.sendSilentlyWithAcraWithName("ColorFromAttr") + } + return typedValue.data +} diff --git a/androidApp/src/main/java/bou/amine/apps/readerforselfossv2/android/utils/bottombar/BottomBarUtils.kt b/androidApp/src/main/java/bou/amine/apps/readerforselfossv2/android/utils/bottombar/BottomBarUtils.kt index 2d93d22..36f9fb5 100644 --- a/androidApp/src/main/java/bou/amine/apps/readerforselfossv2/android/utils/bottombar/BottomBarUtils.kt +++ b/androidApp/src/main/java/bou/amine/apps/readerforselfossv2/android/utils/bottombar/BottomBarUtils.kt @@ -1,6 +1,13 @@ package bou.amine.apps.readerforselfossv2.android.utils.bottombar +import android.content.Context +import android.graphics.drawable.Drawable +import androidx.annotation.IdRes +import androidx.annotation.StringRes +import bou.amine.apps.readerforselfossv2.android.R import com.ashokvarma.bottomnavigation.TextBadgeItem +import com.leinardi.android.speeddial.SpeedDialActionItem +import com.leinardi.android.speeddial.SpeedDialView fun TextBadgeItem.removeBadge(): TextBadgeItem { this.setText("") @@ -9,3 +16,25 @@ fun TextBadgeItem.removeBadge(): TextBadgeItem { } fun TextBadgeItem.maybeShow(): TextBadgeItem = if (this.isHidden) this.show() else this + +@Suppress("detekt:LongParameterList") +fun SpeedDialView.addHomeMadeActionItem( + @IdRes actionId: Int, + actionIcon: Drawable, + @StringRes labelId: Int, + colorOnSurface: Int, + colorSurface: Int, + context: Context, +) { + this.addActionItem( + SpeedDialActionItem + .Builder(actionId, actionIcon) + .setFabBackgroundColor(context.resources.getColor(R.color.colorAccent)) + .setFabImageTintColor(colorOnSurface) + .setLabel(context.getString(labelId)) + .setLabelClickable(false) + .setLabelBackgroundColor(colorOnSurface) + .setLabelColor(colorSurface) + .create(), + ) +} diff --git a/androidApp/src/main/res/layout/fragment_article.xml b/androidApp/src/main/res/layout/fragment_article.xml index bf8c67b..dadf229 100644 --- a/androidApp/src/main/res/layout/fragment_article.xml +++ b/androidApp/src/main/res/layout/fragment_article.xml @@ -71,35 +71,13 @@ - - - - - - + android:layout_gravity="bottom|end" + app:layout_behavior="@string/speeddial_scrolling_view_snackbar_behavior" + app:sdMainFabClosedSrc="@drawable/ic_add_white_24dp" /> - \ No newline at end of file + + diff --git a/androidApp/src/main/res/menu/reader_toolbar.xml b/androidApp/src/main/res/menu/reader_toolbar.xml deleted file mode 100644 index a66022c..0000000 --- a/androidApp/src/main/res/menu/reader_toolbar.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/androidApp/src/main/res/values-ca-rES/strings.xml b/androidApp/src/main/res/values-ca-rES/strings.xml index 69c9d49..b49b5ca 100644 --- a/androidApp/src/main/res/values-ca-rES/strings.xml +++ b/androidApp/src/main/res/values-ca-rES/strings.xml @@ -106,9 +106,6 @@ Align left Justify Reader font - Static bottom bar in the article viewer - The bottom bar will always be displayed - The bottom bar can be shown through the floating button Remove source Light/Dark mode Dark mode @@ -132,4 +129,4 @@ "Quant a" "Element llegit" "Item unread" - \ No newline at end of file + diff --git a/androidApp/src/main/res/values-de-rDE/strings.xml b/androidApp/src/main/res/values-de-rDE/strings.xml index fad991b..9e67230 100644 --- a/androidApp/src/main/res/values-de-rDE/strings.xml +++ b/androidApp/src/main/res/values-de-rDE/strings.xml @@ -106,9 +106,6 @@ Linksbündig Blocksatz Schriftgröße im Lesemodus - Statische untere Leiste im Lesemodus - Die untere Leiste wird dauerhaft angezeigt - Die untere Leiste kann über einen schwebenden Button angezeigt werden Quelle entfernen Heller/Dunkler Modus Dunkler Modus @@ -132,4 +129,4 @@ "Über" "Artikel gelesen" "Item unread" - \ No newline at end of file + diff --git a/androidApp/src/main/res/values-es-rES/strings.xml b/androidApp/src/main/res/values-es-rES/strings.xml index 84825c2..035c84d 100644 --- a/androidApp/src/main/res/values-es-rES/strings.xml +++ b/androidApp/src/main/res/values-es-rES/strings.xml @@ -106,9 +106,6 @@ Alinear a la izquierda Justificado Modo lectura - Static bottom bar in the article viewer - The bottom bar will always be displayed - The bottom bar can be shown through the floating button Remove source Light/Dark mode Dark mode @@ -132,4 +129,4 @@ "Acerca de" "Artículo leído" "Artículo no leído" - \ No newline at end of file + diff --git a/androidApp/src/main/res/values-fr-rFR/strings.xml b/androidApp/src/main/res/values-fr-rFR/strings.xml index 5148016..2fc0366 100644 --- a/androidApp/src/main/res/values-fr-rFR/strings.xml +++ b/androidApp/src/main/res/values-fr-rFR/strings.xml @@ -106,9 +106,6 @@ Aligner à gauche Justifier le texte Police du lecteur d\'articles - Barre statique pour le visionneur d\'articles - La barre sera affichée - La barre sera affichée grâce au bouton Supprimer la source Thème Clair/Sombre Thème sombre @@ -132,4 +129,4 @@ "À propos" "Marqué comme lu" "Marqué comme non lu" - \ No newline at end of file + diff --git a/androidApp/src/main/res/values-gl-rES/strings.xml b/androidApp/src/main/res/values-gl-rES/strings.xml index afe16ad..e3a3e38 100644 --- a/androidApp/src/main/res/values-gl-rES/strings.xml +++ b/androidApp/src/main/res/values-gl-rES/strings.xml @@ -106,9 +106,6 @@ Aliñar á esquerda Xustificado Modo lector - Barra inferior estática na vista de artigos - A barra inferior mostrarase sempre - A barra inferior pode mostrarse a través do botón flotante Eliminar fonte Modo Claro/Escuro Modo escuro @@ -132,4 +129,4 @@ "Acerca de" "Elemento lido" "Elemento non lido" - \ No newline at end of file + diff --git a/androidApp/src/main/res/values-in-rID/strings.xml b/androidApp/src/main/res/values-in-rID/strings.xml index df09a8e..8175827 100644 --- a/androidApp/src/main/res/values-in-rID/strings.xml +++ b/androidApp/src/main/res/values-in-rID/strings.xml @@ -106,9 +106,6 @@ Align left Justify Reader font - Static bottom bar in the article viewer - The bottom bar will always be displayed - The bottom bar can be shown through the floating button Remove source Light/Dark mode Dark mode @@ -132,4 +129,4 @@ "Tentang" "Membaca item" "Item unread" - \ No newline at end of file + diff --git a/androidApp/src/main/res/values-it-rIT/strings.xml b/androidApp/src/main/res/values-it-rIT/strings.xml index d23a504..8bb1749 100644 --- a/androidApp/src/main/res/values-it-rIT/strings.xml +++ b/androidApp/src/main/res/values-it-rIT/strings.xml @@ -106,9 +106,6 @@ Align left Justify Reader font - Static bottom bar in the article viewer - The bottom bar will always be displayed - The bottom bar can be shown through the floating button Remove source Light/Dark mode Dark mode @@ -132,4 +129,4 @@ "Informazioni" "Articolo letto" "Item unread" - \ No newline at end of file + diff --git a/androidApp/src/main/res/values-ko-rKR/strings.xml b/androidApp/src/main/res/values-ko-rKR/strings.xml index ef66805..6692066 100644 --- a/androidApp/src/main/res/values-ko-rKR/strings.xml +++ b/androidApp/src/main/res/values-ko-rKR/strings.xml @@ -106,9 +106,6 @@ Align left Justify Reader font - Static bottom bar in the article viewer - The bottom bar will always be displayed - The bottom bar can be shown through the floating button Remove source Light/Dark mode Dark mode @@ -132,4 +129,4 @@ "정보" "항목 읽기" "Item unread" - \ No newline at end of file + diff --git a/androidApp/src/main/res/values-nl-rNL/strings.xml b/androidApp/src/main/res/values-nl-rNL/strings.xml index 374a226..43da71b 100644 --- a/androidApp/src/main/res/values-nl-rNL/strings.xml +++ b/androidApp/src/main/res/values-nl-rNL/strings.xml @@ -23,6 +23,7 @@ "Controleer de gegevens nogmaals." "Fout bij markeren als gelezen" "Alle artikelen gemarkeerd als gelezen" + "Ongedaan maken" "Login om bronnen toe te voegen" "Kan de lijst met bronnen niet ophalen" "Kan bron niet creëeren" @@ -105,9 +106,6 @@ Align left Justify Reader font - Static bottom bar in the article viewer - The bottom bar will always be displayed - The bottom bar can be shown through the floating button Remove source Light/Dark mode Dark mode @@ -131,5 +129,4 @@ "Over" "Artikel gelezen" "Item unread" - "Ongedaan maken" - \ No newline at end of file + diff --git a/androidApp/src/main/res/values-pt-rBR/strings.xml b/androidApp/src/main/res/values-pt-rBR/strings.xml index be6b8ad..c847693 100644 --- a/androidApp/src/main/res/values-pt-rBR/strings.xml +++ b/androidApp/src/main/res/values-pt-rBR/strings.xml @@ -106,9 +106,6 @@ Align left Justify Reader font - Static bottom bar in the article viewer - The bottom bar will always be displayed - The bottom bar can be shown through the floating button Remove source Light/Dark mode Dark mode @@ -132,4 +129,4 @@ "Sobre" "Item lido" "Item unread" - \ No newline at end of file + diff --git a/androidApp/src/main/res/values-pt-rPT/strings.xml b/androidApp/src/main/res/values-pt-rPT/strings.xml index b532f49..41543a0 100644 --- a/androidApp/src/main/res/values-pt-rPT/strings.xml +++ b/androidApp/src/main/res/values-pt-rPT/strings.xml @@ -106,9 +106,6 @@ Align left Justify Reader font - Static bottom bar in the article viewer - The bottom bar will always be displayed - The bottom bar can be shown through the floating button Remove source Light/Dark mode Dark mode @@ -132,4 +129,4 @@ "Sobre" "Item lido" "Item unread" - \ No newline at end of file + diff --git a/androidApp/src/main/res/values-si-rLK/strings.xml b/androidApp/src/main/res/values-si-rLK/strings.xml index 508b07e..9ad0b91 100644 --- a/androidApp/src/main/res/values-si-rLK/strings.xml +++ b/androidApp/src/main/res/values-si-rLK/strings.xml @@ -106,9 +106,6 @@ Align left Justify Reader font - Static bottom bar in the article viewer - The bottom bar will always be displayed - The bottom bar can be shown through the floating button Remove source Light/Dark mode Dark mode @@ -132,4 +129,4 @@ "මේ ගැන" "Item read" "Item unread" - \ No newline at end of file + diff --git a/androidApp/src/main/res/values-tr-rTR/strings.xml b/androidApp/src/main/res/values-tr-rTR/strings.xml index d77b448..4925242 100644 --- a/androidApp/src/main/res/values-tr-rTR/strings.xml +++ b/androidApp/src/main/res/values-tr-rTR/strings.xml @@ -106,9 +106,6 @@ Align left Justify Reader font - Static bottom bar in the article viewer - The bottom bar will always be displayed - The bottom bar can be shown through the floating button Remove source Light/Dark mode Dark mode @@ -132,4 +129,4 @@ "Hakkında" "Öğeleri oku" "Item unread" - \ No newline at end of file + diff --git a/androidApp/src/main/res/values-zh-rCN/strings.xml b/androidApp/src/main/res/values-zh-rCN/strings.xml index 692f6b6..f8a132c 100644 --- a/androidApp/src/main/res/values-zh-rCN/strings.xml +++ b/androidApp/src/main/res/values-zh-rCN/strings.xml @@ -106,9 +106,6 @@ 左对齐 左右对齐 阅读器字体 - 文章查看器中的静态底部栏 - 底部栏将始终显示 - 底部栏可以通过浮动按钮显示 删除源 浅色/深色模式 深色模式 @@ -132,4 +129,4 @@ "关于我们" "已读" "未读条目" - \ No newline at end of file + diff --git a/androidApp/src/main/res/values-zh-rTW/strings.xml b/androidApp/src/main/res/values-zh-rTW/strings.xml index d259c26..108e15f 100644 --- a/androidApp/src/main/res/values-zh-rTW/strings.xml +++ b/androidApp/src/main/res/values-zh-rTW/strings.xml @@ -106,9 +106,6 @@ Align left Justify Reader font - Static bottom bar in the article viewer - The bottom bar will always be displayed - The bottom bar can be shown through the floating button Remove source Light/Dark mode Dark mode @@ -132,4 +129,4 @@ "关于我们" "已读" "未讀項目" - \ No newline at end of file + diff --git a/androidApp/src/main/res/values/ids.xml b/androidApp/src/main/res/values/ids.xml new file mode 100644 index 0000000..f1cec69 --- /dev/null +++ b/androidApp/src/main/res/values/ids.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/androidApp/src/main/res/values/strings.xml b/androidApp/src/main/res/values/strings.xml index d44675b..8698e41 100644 --- a/androidApp/src/main/res/values/strings.xml +++ b/androidApp/src/main/res/values/strings.xml @@ -108,9 +108,6 @@ source_code_pro_medium open_sans roboto - Static bottom bar in the article viewer - The bottom bar will always be displayed - The bottom bar can be shown through the floating button Remove source Light/Dark mode Dark mode @@ -134,4 +131,4 @@ "About" "Item read" "Item unread" - \ No newline at end of file + diff --git a/androidApp/src/main/res/xml/pref_general.xml b/androidApp/src/main/res/xml/pref_general.xml index fb128aa..7f4cb3e 100644 --- a/androidApp/src/main/res/xml/pref_general.xml +++ b/androidApp/src/main/res/xml/pref_general.xml @@ -30,14 +30,6 @@ android:summaryOn="@string/pref_article_viewer_on" android:title="@string/pref_article_viewer_title" app:iconSpaceReserved="false"/> - diff --git a/gradle.properties b/gradle.properties index c0d0157..e888182 100644 --- a/gradle.properties +++ b/gradle.properties @@ -18,7 +18,7 @@ kotlin.code.style=official #Android android.useAndroidX=true #android.nonTransitiveRClass=true -android.enableJetifier=true +android.enableJetifier=false android.nonTransitiveRClass=false #MPP kotlin.mpp.enableCInteropCommonization=true diff --git a/shared/src/commonMain/kotlin/bou/amine/apps/readerforselfossv2/service/AppSettingsService.kt b/shared/src/commonMain/kotlin/bou/amine/apps/readerforselfossv2/service/AppSettingsService.kt index 505ec74..8709e71 100644 --- a/shared/src/commonMain/kotlin/bou/amine/apps/readerforselfossv2/service/AppSettingsService.kt +++ b/shared/src/commonMain/kotlin/bou/amine/apps/readerforselfossv2/service/AppSettingsService.kt @@ -53,7 +53,6 @@ class AppSettingsService( private var activeAlignment: Int? = null private var fontSize: Int? = null - private var staticBar: Boolean? = null private var font: String = "" private var theme: Int? = null @@ -386,17 +385,6 @@ class AppSettingsService( return fontSize ?: DEFAULT_FONT_SIZE } - private fun refreshStaticBarEnabled() { - staticBar = settings.getBoolean(READER_STATIC_BAR, false) - } - - fun isStaticBarEnabled(): Boolean { - if (staticBar != null) { - refreshStaticBarEnabled() - } - return staticBar == true - } - private fun refreshFont() { font = settings.getString(READER_FONT, "") } @@ -449,7 +437,6 @@ class AppSettingsService( refreshActiveAllignment() refreshFontSize() refreshFont() - refreshStaticBarEnabled() refreshCurrentTheme() } @@ -547,8 +534,6 @@ class AppSettingsService( const val READER_FONT = "reader_font" - const val READER_STATIC_BAR = "reader_static_bar" - const val READER_FONT_SIZE = "reader_font_size" const val TEXT_ALIGN = "text_align"