Compare commits
7 Commits
b16f86dda1
...
v122092701
Author | SHA1 | Date | |
---|---|---|---|
|
ad279c6683 | ||
|
5f0817ddb7 | ||
|
7124cbcacd | ||
|
2a710a1a08 | ||
|
82ec2445a1 | ||
|
cabb6d494d | ||
|
5c12481813 |
11
.drone.yml
11
.drone.yml
@@ -3,14 +3,23 @@ type: docker
|
|||||||
name: test
|
name: test
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: AnylyseBuildTest
|
- name: Anylyse
|
||||||
image: mingc/android-build-box:latest
|
image: mingc/android-build-box:latest
|
||||||
failure: ignore
|
failure: ignore
|
||||||
|
detach: true
|
||||||
commands:
|
commands:
|
||||||
- echo "---------------------------------------------------------"
|
- echo "---------------------------------------------------------"
|
||||||
- echo "Analysing..."
|
- echo "Analysing..."
|
||||||
- ./gradlew sonarqube -Dsonar.projectKey=RFS2 -Dsonar.host.url=$SONAR_HOST_URL -Dsonar.login=$SONAR_LOGIN -PignoreGitVersion=true -P appLoginUrl="\"URL\"" -P appLoginUsername="\"LOGIN\"" -P appLoginPassword="\"PASS\""
|
- ./gradlew sonarqube -Dsonar.projectKey=RFS2 -Dsonar.host.url=$SONAR_HOST_URL -Dsonar.login=$SONAR_LOGIN -PignoreGitVersion=true -P appLoginUrl="\"URL\"" -P appLoginUsername="\"LOGIN\"" -P appLoginPassword="\"PASS\""
|
||||||
- echo "---------------------------------------------------------"
|
- echo "---------------------------------------------------------"
|
||||||
|
environment:
|
||||||
|
SONAR_HOST_URL:
|
||||||
|
from_secret: sonarScannerHostUrl
|
||||||
|
SONAR_LOGIN:
|
||||||
|
from_secret: sonarScannerLogin
|
||||||
|
- name: BuildAndTest
|
||||||
|
image: mingc/android-build-box:latest
|
||||||
|
commands:
|
||||||
- echo "Building..."
|
- echo "Building..."
|
||||||
- ./gradlew :androidApp:build -PignoreGitVersion=true -P appLoginUrl="\"URL\"" -P appLoginUsername="\"LOGIN\"" -P appLoginPassword="\"PASS\"" -P pushCache=false
|
- ./gradlew :androidApp:build -PignoreGitVersion=true -P appLoginUrl="\"URL\"" -P appLoginUsername="\"LOGIN\"" -P appLoginPassword="\"PASS\"" -P pushCache=false
|
||||||
- echo "---------------------------------------------------------"
|
- echo "---------------------------------------------------------"
|
||||||
|
@@ -92,7 +92,6 @@ class HomeActivity : AppCompatActivity(), SearchView.OnQueryTextListener, DIAwar
|
|||||||
|
|
||||||
private val settingsLauncher = registerForActivityResult(ActivityResultContracts.StartActivityForResult()) {
|
private val settingsLauncher = registerForActivityResult(ActivityResultContracts.StartActivityForResult()) {
|
||||||
appSettingsService.refreshUserSettings()
|
appSettingsService.refreshUserSettings()
|
||||||
AppCompatDelegate.setDefaultNightMode(if (appSettingsService.isDarkThemeEnabled()) MODE_NIGHT_YES else MODE_NIGHT_NO)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override val di by closestDI()
|
override val di by closestDI()
|
||||||
|
@@ -38,7 +38,7 @@ class LoginActivity : AppCompatActivity(), DIAware {
|
|||||||
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
AppCompatDelegate.setDefaultNightMode(if (appSettingsService.isDarkThemeEnabled()) AppCompatDelegate.MODE_NIGHT_YES else AppCompatDelegate.MODE_NIGHT_NO)
|
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM)
|
||||||
|
|
||||||
binding = ActivityLoginBinding.inflate(layoutInflater)
|
binding = ActivityLoginBinding.inflate(layoutInflater)
|
||||||
val view = binding.root
|
val view = binding.root
|
||||||
|
@@ -8,6 +8,7 @@ import android.graphics.Typeface
|
|||||||
import android.graphics.drawable.ColorDrawable
|
import android.graphics.drawable.ColorDrawable
|
||||||
import android.net.Uri
|
import android.net.Uri
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
|
import android.util.TypedValue
|
||||||
import android.view.*
|
import android.view.*
|
||||||
import android.webkit.WebResourceResponse
|
import android.webkit.WebResourceResponse
|
||||||
import android.webkit.WebSettings
|
import android.webkit.WebSettings
|
||||||
@@ -56,6 +57,7 @@ import java.net.URL
|
|||||||
import java.util.*
|
import java.util.*
|
||||||
import java.util.concurrent.ExecutionException
|
import java.util.concurrent.ExecutionException
|
||||||
|
|
||||||
|
|
||||||
class ArticleFragment : Fragment(), DIAware {
|
class ArticleFragment : Fragment(), DIAware {
|
||||||
private var fontSize: Int = 16
|
private var fontSize: Int = 16
|
||||||
private lateinit var item: SelfossModel.Item
|
private lateinit var item: SelfossModel.Item
|
||||||
@@ -333,7 +335,6 @@ class ArticleFragment : Fragment(), DIAware {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun htmlToWebview() {
|
private fun htmlToWebview() {
|
||||||
val stringColor = String.format("#%06X", 0xFFFFFF and resources.getColor(R.color.colorAccent))
|
|
||||||
|
|
||||||
val attrs: IntArray = intArrayOf(android.R.attr.fontFamily)
|
val attrs: IntArray = intArrayOf(android.R.attr.fontFamily)
|
||||||
val a: TypedArray = requireContext().obtainStyledAttributes(resId, attrs)
|
val a: TypedArray = requireContext().obtainStyledAttributes(resId, attrs)
|
||||||
@@ -342,12 +343,11 @@ class ArticleFragment : Fragment(), DIAware {
|
|||||||
binding.webcontent.settings.standardFontFamily = a.getString(0)
|
binding.webcontent.settings.standardFontFamily = a.getString(0)
|
||||||
binding.webcontent.visibility = View.VISIBLE
|
binding.webcontent.visibility = View.VISIBLE
|
||||||
|
|
||||||
// TODO: Set the color strings programmatically
|
val colorOnSurface = TypedValue()
|
||||||
val (stringTextColor, stringBackgroundColor) = if (appSettingsService.isDarkThemeEnabled()) {
|
requireContext().theme.resolveAttribute(R.attr.colorOnSurface, colorOnSurface, true)
|
||||||
Pair("#FFFFFF", "#303030")
|
|
||||||
} else {
|
val colorSurface = TypedValue()
|
||||||
Pair("#212121", "#FAFAFA")
|
requireContext().theme.resolveAttribute(R.attr.colorSurface, colorSurface, true)
|
||||||
}
|
|
||||||
|
|
||||||
binding.webcontent.settings.useWideViewPort = true
|
binding.webcontent.settings.useWideViewPort = true
|
||||||
binding.webcontent.settings.loadWithOverviewMode = true
|
binding.webcontent.settings.loadWithOverviewMode = true
|
||||||
@@ -436,10 +436,10 @@ class ArticleFragment : Fragment(), DIAware {
|
|||||||
| max-width: 100%;
|
| max-width: 100%;
|
||||||
| }
|
| }
|
||||||
| a {
|
| a {
|
||||||
| color: $stringColor !important;
|
| color: ${String.format("#%06X", 0xFFFFFF and resources.getColor(R.color.colorAccent))} !important;
|
||||||
| }
|
| }
|
||||||
| *:not(a) {
|
| *:not(a) {
|
||||||
| color: $stringTextColor;
|
| color: ${String.format("#%06X", 0xFFFFFF and colorOnSurface.data)};
|
||||||
| }
|
| }
|
||||||
| * {
|
| * {
|
||||||
| font-size: ${fontSize}px;
|
| font-size: ${fontSize}px;
|
||||||
@@ -447,11 +447,11 @@ class ArticleFragment : Fragment(), DIAware {
|
|||||||
| word-break: break-word;
|
| word-break: break-word;
|
||||||
| overflow:hidden;
|
| overflow:hidden;
|
||||||
| line-height: 1.5em;
|
| line-height: 1.5em;
|
||||||
| background-color: $stringBackgroundColor;
|
| background-color: ${String.format("#%06X", 0xFFFFFF and colorSurface.data)};
|
||||||
| }
|
| }
|
||||||
| body, html {
|
| body, html {
|
||||||
| background-color: $stringBackgroundColor !important;
|
| background-color: ${String.format("#%06X", 0xFFFFFF and colorSurface.data)} !important;
|
||||||
| border-color: $stringBackgroundColor !important;
|
| border-color: ${String.format("#%06X", 0xFFFFFF and colorSurface.data)} !important;
|
||||||
| padding: 0 !important;
|
| padding: 0 !important;
|
||||||
| margin: 0 !important;
|
| margin: 0 !important;
|
||||||
| }
|
| }
|
||||||
@@ -461,7 +461,7 @@ class ArticleFragment : Fragment(), DIAware {
|
|||||||
| pre, code {
|
| pre, code {
|
||||||
| white-space: pre-wrap;
|
| white-space: pre-wrap;
|
||||||
| width:100%;
|
| width:100%;
|
||||||
| background-color: $stringBackgroundColor;
|
| background-color: ${String.format("#%06X", 0xFFFFFF and colorSurface.data)};
|
||||||
| }
|
| }
|
||||||
| </style>
|
| </style>
|
||||||
| $fontLinkAndStyle
|
| $fontLinkAndStyle
|
||||||
|
@@ -9,6 +9,7 @@ import android.text.InputType
|
|||||||
import android.text.TextWatcher
|
import android.text.TextWatcher
|
||||||
import android.widget.Toast
|
import android.widget.Toast
|
||||||
import androidx.appcompat.app.AppCompatActivity
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
|
import androidx.appcompat.app.AppCompatDelegate
|
||||||
import androidx.core.widget.addTextChangedListener
|
import androidx.core.widget.addTextChangedListener
|
||||||
import androidx.preference.EditTextPreference
|
import androidx.preference.EditTextPreference
|
||||||
import androidx.preference.Preference
|
import androidx.preference.Preference
|
||||||
@@ -155,7 +156,11 @@ class SettingsActivity : AppCompatActivity(),
|
|||||||
class ThemePreferenceFragment : PreferenceFragmentCompat() {
|
class ThemePreferenceFragment : PreferenceFragmentCompat() {
|
||||||
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
|
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
|
||||||
setPreferencesFromResource(R.xml.pref_theme, rootKey)
|
setPreferencesFromResource(R.xml.pref_theme, rootKey)
|
||||||
setHasOptionsMenu(true)
|
|
||||||
|
preferenceManager.findPreference<Preference>("currentMode")?.onPreferenceChangeListener = Preference.OnPreferenceChangeListener { _, newValue ->
|
||||||
|
AppCompatDelegate.setDefaultNightMode(newValue.toString().toInt()) // ListPreference Only takes string-arrays ¯\_(ツ)_/¯
|
||||||
|
true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -16,8 +16,7 @@
|
|||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
card_view:cardElevation="2dp"
|
card_view:cardElevation="2dp"
|
||||||
card_view:cardUseCompatPadding="true"
|
card_view:cardUseCompatPadding="true"
|
||||||
card_view:layout_constraintBottom_toBottomOf="parent"
|
card_view:layout_constraintBottom_toBottomOf="parent">
|
||||||
app:cardBackgroundColor="?cardBackgroundColor">
|
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
@@ -66,7 +66,7 @@
|
|||||||
android:layout_marginRight="16dp"
|
android:layout_marginRight="16dp"
|
||||||
android:layout_marginTop="24dp"
|
android:layout_marginTop="24dp"
|
||||||
android:paddingBottom="48dp"
|
android:paddingBottom="48dp"
|
||||||
android:background="?android:colorBackground"
|
android:background="?attr/webviewBackground"
|
||||||
app:layout_constraintHorizontal_bias="0.0"
|
app:layout_constraintHorizontal_bias="0.0"
|
||||||
app:layout_constraintLeft_toLeftOf="parent"
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
app:layout_constraintRight_toRightOf="parent"
|
app:layout_constraintRight_toRightOf="parent"
|
||||||
|
@@ -128,4 +128,8 @@
|
|||||||
<string name="reader_static_bar_on">The bottom bar will always be displayed</string>
|
<string name="reader_static_bar_on">The bottom bar will always be displayed</string>
|
||||||
<string name="reader_static_bar_off">The bottom bar can be shown through the floating button</string>
|
<string name="reader_static_bar_off">The bottom bar can be shown through the floating button</string>
|
||||||
<string name="remove_source">Remove source</string>
|
<string name="remove_source">Remove source</string>
|
||||||
|
<string name="pref_theme_title">Light/Dark mode</string>
|
||||||
|
<string name="mode_dark">Dark mode</string>
|
||||||
|
<string name="mode_system">Follow the system setting</string>
|
||||||
|
<string name="mode_light">Light mode</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@@ -128,4 +128,8 @@
|
|||||||
<string name="reader_static_bar_on">The bottom bar will always be displayed</string>
|
<string name="reader_static_bar_on">The bottom bar will always be displayed</string>
|
||||||
<string name="reader_static_bar_off">The bottom bar can be shown through the floating button</string>
|
<string name="reader_static_bar_off">The bottom bar can be shown through the floating button</string>
|
||||||
<string name="remove_source">Remove source</string>
|
<string name="remove_source">Remove source</string>
|
||||||
|
<string name="pref_theme_title">Light/Dark mode</string>
|
||||||
|
<string name="mode_dark">Dark mode</string>
|
||||||
|
<string name="mode_system">Follow the system setting</string>
|
||||||
|
<string name="mode_light">Light mode</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@@ -128,4 +128,8 @@
|
|||||||
<string name="reader_static_bar_on">The bottom bar will always be displayed</string>
|
<string name="reader_static_bar_on">The bottom bar will always be displayed</string>
|
||||||
<string name="reader_static_bar_off">The bottom bar can be shown through the floating button</string>
|
<string name="reader_static_bar_off">The bottom bar can be shown through the floating button</string>
|
||||||
<string name="remove_source">Remove source</string>
|
<string name="remove_source">Remove source</string>
|
||||||
|
<string name="pref_theme_title">Light/Dark mode</string>
|
||||||
|
<string name="mode_dark">Dark mode</string>
|
||||||
|
<string name="mode_system">Follow the system setting</string>
|
||||||
|
<string name="mode_light">Light mode</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@@ -128,4 +128,8 @@
|
|||||||
<string name="reader_static_bar_on">The bottom bar will always be displayed</string>
|
<string name="reader_static_bar_on">The bottom bar will always be displayed</string>
|
||||||
<string name="reader_static_bar_off">The bottom bar can be shown through the floating button</string>
|
<string name="reader_static_bar_off">The bottom bar can be shown through the floating button</string>
|
||||||
<string name="remove_source">Remove source</string>
|
<string name="remove_source">Remove source</string>
|
||||||
|
<string name="pref_theme_title">Light/Dark mode</string>
|
||||||
|
<string name="mode_dark">Dark mode</string>
|
||||||
|
<string name="mode_system">Follow the system setting</string>
|
||||||
|
<string name="mode_light">Light mode</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@@ -8,7 +8,7 @@
|
|||||||
<string name="error_field_required">"Champ requis"</string>
|
<string name="error_field_required">"Champ requis"</string>
|
||||||
<string name="prompt_url">"Url Selfoss"</string>
|
<string name="prompt_url">"Url Selfoss"</string>
|
||||||
<string name="withLoginSwitch">"Avec login ?"</string>
|
<string name="withLoginSwitch">"Avec login ?"</string>
|
||||||
<string name="login_url_problem">"Petit souci. Il manque peut être un / à la fin ?"</string>
|
<string name="login_url_problem">"Petit souci. Il manque peut-être un / à la fin ?"</string>
|
||||||
<string name="prompt_login">"Utilisateur"</string>
|
<string name="prompt_login">"Utilisateur"</string>
|
||||||
<string name="label_share">"Partager"</string>
|
<string name="label_share">"Partager"</string>
|
||||||
<string name="readAll">"Tout lire"</string>
|
<string name="readAll">"Tout lire"</string>
|
||||||
@@ -128,4 +128,8 @@
|
|||||||
<string name="reader_static_bar_on">La barre sera affichée</string>
|
<string name="reader_static_bar_on">La barre sera affichée</string>
|
||||||
<string name="reader_static_bar_off">La barre sera affichée grâce au bouton</string>
|
<string name="reader_static_bar_off">La barre sera affichée grâce au bouton</string>
|
||||||
<string name="remove_source">Supprimer la source</string>
|
<string name="remove_source">Supprimer la source</string>
|
||||||
|
<string name="pref_theme_title">Thème Clair/Sombre</string>
|
||||||
|
<string name="mode_dark">Thème sombre</string>
|
||||||
|
<string name="mode_system">Utiliser les paramètres système</string>
|
||||||
|
<string name="mode_light">Thème clair</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@@ -128,4 +128,8 @@
|
|||||||
<string name="reader_static_bar_on">A barra inferior mostrarase sempre</string>
|
<string name="reader_static_bar_on">A barra inferior mostrarase sempre</string>
|
||||||
<string name="reader_static_bar_off">A barra inferior pode mostrarse a través do botón flotante</string>
|
<string name="reader_static_bar_off">A barra inferior pode mostrarse a través do botón flotante</string>
|
||||||
<string name="remove_source">Eliminar fonte</string>
|
<string name="remove_source">Eliminar fonte</string>
|
||||||
|
<string name="pref_theme_title">Light/Dark mode</string>
|
||||||
|
<string name="mode_dark">Dark mode</string>
|
||||||
|
<string name="mode_system">Follow the system setting</string>
|
||||||
|
<string name="mode_light">Light mode</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@@ -128,4 +128,8 @@
|
|||||||
<string name="reader_static_bar_on">The bottom bar will always be displayed</string>
|
<string name="reader_static_bar_on">The bottom bar will always be displayed</string>
|
||||||
<string name="reader_static_bar_off">The bottom bar can be shown through the floating button</string>
|
<string name="reader_static_bar_off">The bottom bar can be shown through the floating button</string>
|
||||||
<string name="remove_source">Remove source</string>
|
<string name="remove_source">Remove source</string>
|
||||||
|
<string name="pref_theme_title">Light/Dark mode</string>
|
||||||
|
<string name="mode_dark">Dark mode</string>
|
||||||
|
<string name="mode_system">Follow the system setting</string>
|
||||||
|
<string name="mode_light">Light mode</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@@ -128,4 +128,8 @@
|
|||||||
<string name="reader_static_bar_on">The bottom bar will always be displayed</string>
|
<string name="reader_static_bar_on">The bottom bar will always be displayed</string>
|
||||||
<string name="reader_static_bar_off">The bottom bar can be shown through the floating button</string>
|
<string name="reader_static_bar_off">The bottom bar can be shown through the floating button</string>
|
||||||
<string name="remove_source">Remove source</string>
|
<string name="remove_source">Remove source</string>
|
||||||
|
<string name="pref_theme_title">Light/Dark mode</string>
|
||||||
|
<string name="mode_dark">Dark mode</string>
|
||||||
|
<string name="mode_system">Follow the system setting</string>
|
||||||
|
<string name="mode_light">Light mode</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@@ -128,4 +128,8 @@
|
|||||||
<string name="reader_static_bar_on">The bottom bar will always be displayed</string>
|
<string name="reader_static_bar_on">The bottom bar will always be displayed</string>
|
||||||
<string name="reader_static_bar_off">The bottom bar can be shown through the floating button</string>
|
<string name="reader_static_bar_off">The bottom bar can be shown through the floating button</string>
|
||||||
<string name="remove_source">Remove source</string>
|
<string name="remove_source">Remove source</string>
|
||||||
|
<string name="pref_theme_title">Light/Dark mode</string>
|
||||||
|
<string name="mode_dark">Dark mode</string>
|
||||||
|
<string name="mode_system">Follow the system setting</string>
|
||||||
|
<string name="mode_light">Light mode</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@@ -4,10 +4,10 @@
|
|||||||
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
|
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
|
||||||
<item name="colorAccent">@color/colorAccent</item>
|
<item name="colorAccent">@color/colorAccent</item>
|
||||||
<item name="colorAccentDark">@color/colorAccentDark</item>
|
<item name="colorAccentDark">@color/colorAccentDark</item>
|
||||||
<item name="cardBackgroundColor">@color/white</item>
|
|
||||||
<item name="preferenceTheme">@style/PreferenceStyle</item>
|
<item name="preferenceTheme">@style/PreferenceStyle</item>
|
||||||
<item name="android:statusBarColor">@color/dark</item>
|
<item name="android:statusBarColor">@color/dark</item>
|
||||||
<item name="bottomBarBackground">@color/dark</item>
|
<item name="bottomBarBackground">@color/dark</item>
|
||||||
<item name="toolbarPopupTheme">@style/ThemeOverlay.AppCompat.Dark</item>
|
<item name="toolbarPopupTheme">@style/ThemeOverlay.AppCompat.Dark</item>
|
||||||
|
<item name="webviewBackground">@color/dark</item>
|
||||||
</style>
|
</style>
|
||||||
</resources>
|
</resources>
|
||||||
|
@@ -128,4 +128,8 @@
|
|||||||
<string name="reader_static_bar_on">The bottom bar will always be displayed</string>
|
<string name="reader_static_bar_on">The bottom bar will always be displayed</string>
|
||||||
<string name="reader_static_bar_off">The bottom bar can be shown through the floating button</string>
|
<string name="reader_static_bar_off">The bottom bar can be shown through the floating button</string>
|
||||||
<string name="remove_source">Remove source</string>
|
<string name="remove_source">Remove source</string>
|
||||||
|
<string name="pref_theme_title">Light/Dark mode</string>
|
||||||
|
<string name="mode_dark">Dark mode</string>
|
||||||
|
<string name="mode_system">Follow the system setting</string>
|
||||||
|
<string name="mode_light">Light mode</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@@ -128,4 +128,8 @@
|
|||||||
<string name="reader_static_bar_on">The bottom bar will always be displayed</string>
|
<string name="reader_static_bar_on">The bottom bar will always be displayed</string>
|
||||||
<string name="reader_static_bar_off">The bottom bar can be shown through the floating button</string>
|
<string name="reader_static_bar_off">The bottom bar can be shown through the floating button</string>
|
||||||
<string name="remove_source">Remove source</string>
|
<string name="remove_source">Remove source</string>
|
||||||
|
<string name="pref_theme_title">Light/Dark mode</string>
|
||||||
|
<string name="mode_dark">Dark mode</string>
|
||||||
|
<string name="mode_system">Follow the system setting</string>
|
||||||
|
<string name="mode_light">Light mode</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@@ -128,4 +128,8 @@
|
|||||||
<string name="reader_static_bar_on">The bottom bar will always be displayed</string>
|
<string name="reader_static_bar_on">The bottom bar will always be displayed</string>
|
||||||
<string name="reader_static_bar_off">The bottom bar can be shown through the floating button</string>
|
<string name="reader_static_bar_off">The bottom bar can be shown through the floating button</string>
|
||||||
<string name="remove_source">Remove source</string>
|
<string name="remove_source">Remove source</string>
|
||||||
|
<string name="pref_theme_title">Light/Dark mode</string>
|
||||||
|
<string name="mode_dark">Dark mode</string>
|
||||||
|
<string name="mode_system">Follow the system setting</string>
|
||||||
|
<string name="mode_light">Light mode</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@@ -128,4 +128,8 @@
|
|||||||
<string name="reader_static_bar_on">The bottom bar will always be displayed</string>
|
<string name="reader_static_bar_on">The bottom bar will always be displayed</string>
|
||||||
<string name="reader_static_bar_off">The bottom bar can be shown through the floating button</string>
|
<string name="reader_static_bar_off">The bottom bar can be shown through the floating button</string>
|
||||||
<string name="remove_source">Remove source</string>
|
<string name="remove_source">Remove source</string>
|
||||||
|
<string name="pref_theme_title">Light/Dark mode</string>
|
||||||
|
<string name="mode_dark">Dark mode</string>
|
||||||
|
<string name="mode_system">Follow the system setting</string>
|
||||||
|
<string name="mode_light">Light mode</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@@ -128,4 +128,8 @@
|
|||||||
<string name="reader_static_bar_on">The bottom bar will always be displayed</string>
|
<string name="reader_static_bar_on">The bottom bar will always be displayed</string>
|
||||||
<string name="reader_static_bar_off">The bottom bar can be shown through the floating button</string>
|
<string name="reader_static_bar_off">The bottom bar can be shown through the floating button</string>
|
||||||
<string name="remove_source">Remove source</string>
|
<string name="remove_source">Remove source</string>
|
||||||
|
<string name="pref_theme_title">Light/Dark mode</string>
|
||||||
|
<string name="mode_dark">Dark mode</string>
|
||||||
|
<string name="mode_system">Follow the system setting</string>
|
||||||
|
<string name="mode_light">Light mode</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@@ -47,7 +47,7 @@
|
|||||||
<string name="switch_unread_count_title">"显示未读数"</string>
|
<string name="switch_unread_count_title">"显示未读数"</string>
|
||||||
<string name="display_all_counts_title">"显示收藏和已读的计数"</string>
|
<string name="display_all_counts_title">"显示收藏和已读的计数"</string>
|
||||||
<string name="text_wrong_url">"您似乎试图使用无效的 URL。确保它是正确的,如果问题仍然存在,请与我联系 (通过商店的联系链接)。请注意,该应用程序需要您使用 Selfoss。没有它,您无法访问 RSS 源。"</string>
|
<string name="text_wrong_url">"您似乎试图使用无效的 URL。确保它是正确的,如果问题仍然存在,请与我联系 (通过商店的联系链接)。请注意,该应用程序需要您使用 Selfoss。没有它,您无法访问 RSS 源。"</string>
|
||||||
<string name="pref_article_viewer_title">"打开应用程序中的链接"</string>
|
<string name="pref_article_viewer_title">"在应用内打开链接"</string>
|
||||||
<string name="pref_article_viewer_on">"文章将在应用程序内打开"</string>
|
<string name="pref_article_viewer_on">"文章将在应用程序内打开"</string>
|
||||||
<string name="pref_article_viewer_off">"文章将使用默认浏览器打开"</string>
|
<string name="pref_article_viewer_off">"文章将使用默认浏览器打开"</string>
|
||||||
<string name="pref_general_category_links">"链接处理"</string>
|
<string name="pref_general_category_links">"链接处理"</string>
|
||||||
@@ -128,4 +128,8 @@
|
|||||||
<string name="reader_static_bar_on">底部栏将始终显示</string>
|
<string name="reader_static_bar_on">底部栏将始终显示</string>
|
||||||
<string name="reader_static_bar_off">底部栏可以通过浮动按钮显示</string>
|
<string name="reader_static_bar_off">底部栏可以通过浮动按钮显示</string>
|
||||||
<string name="remove_source">删除源</string>
|
<string name="remove_source">删除源</string>
|
||||||
|
<string name="pref_theme_title">浅色/深色模式</string>
|
||||||
|
<string name="mode_dark">深色模式</string>
|
||||||
|
<string name="mode_system">遵循系统设置</string>
|
||||||
|
<string name="mode_light">浅色模式</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@@ -128,4 +128,8 @@
|
|||||||
<string name="reader_static_bar_on">The bottom bar will always be displayed</string>
|
<string name="reader_static_bar_on">The bottom bar will always be displayed</string>
|
||||||
<string name="reader_static_bar_off">The bottom bar can be shown through the floating button</string>
|
<string name="reader_static_bar_off">The bottom bar can be shown through the floating button</string>
|
||||||
<string name="remove_source">Remove source</string>
|
<string name="remove_source">Remove source</string>
|
||||||
|
<string name="pref_theme_title">Light/Dark mode</string>
|
||||||
|
<string name="mode_dark">Dark mode</string>
|
||||||
|
<string name="mode_system">Follow the system setting</string>
|
||||||
|
<string name="mode_light">Light mode</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@@ -4,5 +4,6 @@
|
|||||||
<attr name="colorAccentDark" format="reference|color" />
|
<attr name="colorAccentDark" format="reference|color" />
|
||||||
<attr name="bottomBarBackground" format="reference|color" />
|
<attr name="bottomBarBackground" format="reference|color" />
|
||||||
<attr name="toolbarPopupTheme" format="reference|color" />
|
<attr name="toolbarPopupTheme" format="reference|color" />
|
||||||
|
<attr name="webviewBackground" format="reference|color" />
|
||||||
</declare-styleable>
|
</declare-styleable>
|
||||||
</resources>
|
</resources>
|
32
androidApp/src/main/res/values/mode_settings.xml
Normal file
32
androidApp/src/main/res/values/mode_settings.xml
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
<string-array name="ModeTitles">
|
||||||
|
<item>@string/mode_light</item>
|
||||||
|
<item>@string/mode_dark</item>
|
||||||
|
<item>@string/mode_system</item>
|
||||||
|
</string-array>
|
||||||
|
|
||||||
|
<string-array name="ModeValues">
|
||||||
|
<item>1</item> <!--MODE_NIGHT_NO-->
|
||||||
|
<item>2</item> <!--MODE_NIGHT_YES-->
|
||||||
|
<item>0</item> <!--MODE_NIGHT_AUTO_TIME-->
|
||||||
|
</string-array>
|
||||||
|
|
||||||
|
<string-array name="Voice">
|
||||||
|
<item>Male</item>
|
||||||
|
<item>Female</item>
|
||||||
|
</string-array>
|
||||||
|
|
||||||
|
<string-array name="VoiceAlias">
|
||||||
|
<item>"usenglishmale"</item>
|
||||||
|
<item>"usenglishfemale"</item>
|
||||||
|
<item>"ukenglishmale"</item>
|
||||||
|
<item>"ukenglishfemale"</item>
|
||||||
|
<item>"eurfrenchmale"</item>
|
||||||
|
<item>"eurfrenchfemale"</item>
|
||||||
|
<item>"eurspanishmale"</item>
|
||||||
|
<item>"eurspanishfemale"</item>
|
||||||
|
<item>"euritalianmale"</item>
|
||||||
|
<item>"euritalianfemale"</item>
|
||||||
|
</string-array>
|
||||||
|
</resources>
|
@@ -130,4 +130,8 @@
|
|||||||
<string name="reader_static_bar_on">The bottom bar will always be displayed</string>
|
<string name="reader_static_bar_on">The bottom bar will always be displayed</string>
|
||||||
<string name="reader_static_bar_off">The bottom bar can be shown through the floating button</string>
|
<string name="reader_static_bar_off">The bottom bar can be shown through the floating button</string>
|
||||||
<string name="remove_source">Remove source</string>
|
<string name="remove_source">Remove source</string>
|
||||||
|
<string name="pref_theme_title">Light/Dark mode</string>
|
||||||
|
<string name="mode_dark">Dark mode</string>
|
||||||
|
<string name="mode_system">Follow the system setting</string>
|
||||||
|
<string name="mode_light">Light mode</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@@ -9,11 +9,11 @@
|
|||||||
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
|
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
|
||||||
<item name="colorAccent">@color/colorAccent</item>
|
<item name="colorAccent">@color/colorAccent</item>
|
||||||
<item name="colorAccentDark">@color/colorAccentDark</item>
|
<item name="colorAccentDark">@color/colorAccentDark</item>
|
||||||
<item name="cardBackgroundColor">@color/white</item>
|
|
||||||
<item name="preferenceTheme">@style/PreferenceStyle</item>
|
<item name="preferenceTheme">@style/PreferenceStyle</item>
|
||||||
<item name="android:statusBarColor">?attr/colorPrimary</item>
|
<item name="android:statusBarColor">?attr/colorPrimary</item>
|
||||||
<item name="bottomBarBackground">@color/white</item>
|
<item name="bottomBarBackground">@color/white</item>
|
||||||
<item name="toolbarPopupTheme">@style/ThemeOverlay.AppCompat.Light</item>
|
<item name="toolbarPopupTheme">@style/ThemeOverlay.AppCompat.Light</item>
|
||||||
|
<item name="webviewBackground">@color/white</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<!-- Preference Theme -->
|
<!-- Preference Theme -->
|
||||||
|
@@ -1,11 +1,13 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
|
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||||
<!-- TODO translate this file -->
|
|
||||||
|
|
||||||
<SwitchPreference
|
<ListPreference
|
||||||
android:defaultValue="false"
|
android:defaultValue="0"
|
||||||
android:key="dark_theme"
|
android:entries="@array/ModeTitles"
|
||||||
|
android:entryValues="@array/ModeValues"
|
||||||
|
android:key="currentMode"
|
||||||
app:iconSpaceReserved="false"
|
app:iconSpaceReserved="false"
|
||||||
android:title="Dark theme" />
|
android:title="@string/pref_theme_title"
|
||||||
|
app:useSimpleSummaryProvider="false" />
|
||||||
</PreferenceScreen>
|
</PreferenceScreen>
|
@@ -34,7 +34,6 @@ class AppSettingsService {
|
|||||||
|
|
||||||
private var _fontSize: Int? = null
|
private var _fontSize: Int? = null
|
||||||
private var _staticBar: Boolean? = null
|
private var _staticBar: Boolean? = null
|
||||||
private var _darkTheme: Boolean? = null
|
|
||||||
private var _font: String = ""
|
private var _font: String = ""
|
||||||
|
|
||||||
|
|
||||||
@@ -308,17 +307,6 @@ class AppSettingsService {
|
|||||||
return _staticBar == true
|
return _staticBar == true
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun refreshDarkThemeEnabled() {
|
|
||||||
_darkTheme = settings.getBoolean("dark_theme", false)
|
|
||||||
}
|
|
||||||
|
|
||||||
fun isDarkThemeEnabled(): Boolean {
|
|
||||||
if (_darkTheme != null) {
|
|
||||||
refreshDarkThemeEnabled()
|
|
||||||
}
|
|
||||||
return _darkTheme == true
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun refreshFont() {
|
private fun refreshFont() {
|
||||||
_font = settings.getString("reader_font", "")
|
_font = settings.getString("reader_font", "")
|
||||||
}
|
}
|
||||||
@@ -358,7 +346,6 @@ class AppSettingsService {
|
|||||||
refreshFontSize()
|
refreshFontSize()
|
||||||
refreshFont()
|
refreshFont()
|
||||||
refreshStaticBarEnabled()
|
refreshStaticBarEnabled()
|
||||||
refreshDarkThemeEnabled()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun refreshLoginInformation(
|
fun refreshLoginInformation(
|
||||||
|
Reference in New Issue
Block a user