diff options
19 files changed, 172 insertions, 65 deletions
diff --git a/build.gradle b/build.gradle index a19d8d96..820d53f1 100755 --- a/build.gradle +++ b/build.gradle @@ -5,7 +5,7 @@ buildscript { google() } dependencies { - classpath 'com.android.tools.build:gradle:3.3.0' + classpath 'com.android.tools.build:gradle:3.5.2' } } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index ec8e2026..549b7fbf 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Wed Feb 13 14:58:58 MSK 2019
+#Wed Oct 30 14:09:16 MSK 2019
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
diff --git a/org.fox.ttrss/build.gradle b/org.fox.ttrss/build.gradle index c9f6a45d..2e8e7918 100755 --- a/org.fox.ttrss/build.gradle +++ b/org.fox.ttrss/build.gradle @@ -1,7 +1,7 @@ apply plugin: 'com.android.application' android { - compileSdkVersion 28 + compileSdkVersion 29 buildToolsVersion "28.0.3" defaultConfig { @@ -9,7 +9,7 @@ android { buildConfigField "long", "TIMESTAMP", System.currentTimeMillis() + "L" buildConfigField "boolean", "ENABLE_TRIAL", "true" minSdkVersion 16 - targetSdkVersion 28 // we're not targeting SDK 25 because of this: https://issuetracker.google.com/issues/37103380#makechanges + targetSdkVersion 29 } signingConfigs { @@ -48,7 +48,7 @@ android { dependencies { implementation files('libs/dashclock-api-r1.1.jar') - implementation 'com.squareup.okhttp3:okhttp:3.10.0' + implementation 'com.squareup.okhttp3:okhttp:3.12.5' implementation('com.github.bumptech.glide:okhttp3-integration:1.5.0') { exclude group: 'glide-parent' } @@ -56,12 +56,12 @@ dependencies { implementation 'com.bogdwellers:pinchtozoom:0.1' implementation 'com.github.bumptech.glide:glide:3.8.0' implementation 'jp.wasabeef:glide-transformations:2.0.2' - implementation 'androidx.recyclerview:recyclerview:1.0.0' + implementation 'androidx.recyclerview:recyclerview:1.1.0' implementation 'androidx.legacy:legacy-support-v4:1.0.0' - implementation 'androidx.appcompat:appcompat:1.0.2' + implementation 'androidx.appcompat:appcompat:1.1.0' implementation 'androidx.browser:browser:1.0.0' implementation 'com.google.android.material:material:1.0.0' - implementation 'com.google.code.gson:gson:2.8.2' + implementation 'com.google.code.gson:gson:2.8.5' implementation 'com.shamanland:fab:0.0.8' implementation 'com.ToxicBakery.viewpager.transforms:view-pager-transforms:1.2.32@aar' implementation 'me.relex:circleindicator:1.2.2@aar' diff --git a/org.fox.ttrss/src/main/AndroidManifest.xml b/org.fox.ttrss/src/main/AndroidManifest.xml index b73971d1..dc7ac3ac 100755 --- a/org.fox.ttrss/src/main/AndroidManifest.xml +++ b/org.fox.ttrss/src/main/AndroidManifest.xml @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="org.fox.ttrss" - android:versionCode="505" - android:versionName="1.271"> + android:versionCode="510" + android:versionName="1.276"> <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> diff --git a/org.fox.ttrss/src/main/java/org/fox/ttrss/ArticleFragment.java b/org.fox.ttrss/src/main/java/org/fox/ttrss/ArticleFragment.java index a6359086..7e320203 100755 --- a/org.fox.ttrss/src/main/java/org/fox/ttrss/ArticleFragment.java +++ b/org.fox.ttrss/src/main/java/org/fox/ttrss/ArticleFragment.java @@ -469,8 +469,7 @@ public class ArticleFragment extends StateSavedFragment { ws.setMediaPlaybackRequiresUserGesture(false); } - String theme = m_prefs.getString("theme", CommonActivity.THEME_DEFAULT); - if (CommonActivity.THEME_DARK.equals(theme) || CommonActivity.THEME_AMBER.equals(theme)) { + if (m_activity.isUiNightMode()) { m_web.setBackgroundColor(Color.BLACK); } diff --git a/org.fox.ttrss/src/main/java/org/fox/ttrss/ArticlePager.java b/org.fox.ttrss/src/main/java/org/fox/ttrss/ArticlePager.java index c885b732..e08934bd 100755 --- a/org.fox.ttrss/src/main/java/org/fox/ttrss/ArticlePager.java +++ b/org.fox.ttrss/src/main/java/org/fox/ttrss/ArticlePager.java @@ -13,6 +13,11 @@ import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; +import androidx.fragment.app.Fragment; +import androidx.fragment.app.FragmentManager; +import androidx.fragment.app.FragmentStatePagerAdapter; +import androidx.viewpager.widget.ViewPager; + import com.google.android.material.snackbar.Snackbar; import com.google.gson.JsonElement; import com.viewpagerindicator.UnderlinePageIndicator; @@ -24,10 +29,6 @@ import org.fox.ttrss.util.HeadlinesRequest; import java.util.HashMap; -import androidx.fragment.app.Fragment; -import androidx.fragment.app.FragmentManager; -import androidx.fragment.app.FragmentStatePagerAdapter; -import androidx.viewpager.widget.ViewPager; import icepick.State; public class ArticlePager extends StateSavedFragment { @@ -339,7 +340,7 @@ public class ArticlePager extends StateSavedFragment { } if (m_prefs.getBoolean("enable_image_downsampling", false)) { - if (!m_activity.isWifiConnected()) { + if (m_prefs.getBoolean("always_downsample_images", false) || !m_activity.isWifiConnected()) { put("resize_width", String.valueOf(m_activity.getResizeWidth())); } } diff --git a/org.fox.ttrss/src/main/java/org/fox/ttrss/CommonActivity.java b/org.fox.ttrss/src/main/java/org/fox/ttrss/CommonActivity.java index 493676d8..e639a825 100755 --- a/org.fox.ttrss/src/main/java/org/fox/ttrss/CommonActivity.java +++ b/org.fox.ttrss/src/main/java/org/fox/ttrss/CommonActivity.java @@ -15,9 +15,9 @@ import android.content.Intent; import android.content.SharedPreferences; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; +import android.content.res.Configuration; import android.database.sqlite.SQLiteDatabase; import android.graphics.BitmapFactory; -import android.graphics.Point; import android.net.ConnectivityManager; import android.net.NetworkInfo; import android.net.Uri; @@ -48,6 +48,7 @@ import java.util.Arrays; import java.util.List; import androidx.appcompat.app.AppCompatActivity; +import androidx.appcompat.app.AppCompatDelegate; import androidx.browser.customtabs.CustomTabsCallback; import androidx.browser.customtabs.CustomTabsClient; import androidx.browser.customtabs.CustomTabsIntent; @@ -65,11 +66,7 @@ public class CommonActivity extends AppCompatActivity implements SharedPreferenc public final static String FRAG_CATS = "cats"; public final static String FRAG_DIALOG = "dialog"; - public final static String THEME_DARK = "THEME_DARK"; - public final static String THEME_LIGHT = "THEME_LIGHT"; - //public final static String THEME_SEPIA = "THEME_SEPIA"; - public final static String THEME_AMBER = "THEME_AMBER"; - public final static String THEME_DEFAULT = CommonActivity.THEME_LIGHT; + public final static String THEME_DEFAULT = "THEME_FOLLOW_DEVICE"; public final static String NOTIFICATION_CHANNEL_NORMAL = "channel_normal"; public final static String NOTIFICATION_CHANNEL_PRIORITY = "channel_priority"; @@ -313,23 +310,41 @@ public class CommonActivity extends AppCompatActivity implements SharedPreferenc .show(); } + public boolean isUiNightMode() { + try { + int nightModeFlags = getResources().getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK; + + return Configuration.UI_MODE_NIGHT_YES == nightModeFlags; + } catch (Exception e) { + return false; + } + } + protected void setAppTheme(SharedPreferences prefs) { String theme = prefs.getString("theme", CommonActivity.THEME_DEFAULT); - - if (theme.equals(THEME_DARK)) { - setTheme(R.style.DarkTheme); - } else if (theme.equals(THEME_AMBER)) { - setTheme(R.style.AmberTheme); + + Log.d(TAG, "setting theme to: " + theme); + + if ("THEME_DARK".equals(theme)) { + AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES); + } else if ("THEME_LIGHT".equals(theme)) { + AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO); } else { - setTheme(R.style.LightTheme); + AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM); } + + setTheme(R.style.AppTheme); } @Override public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) { Log.d(TAG, "onSharedPreferenceChanged:" + key); - String[] filter = new String[] { "theme", "enable_cats", "headline_mode", "widget_update_interval", + if ("theme".equals(key)) { + setAppTheme(sharedPreferences); + } + + String[] filter = new String[] { "enable_cats", "headline_mode", "widget_update_interval", "headlines_swipe_to_dismiss", "headlines_mark_read_scroll", "headlines_request_size" }; m_needRestart = Arrays.asList(filter).indexOf(key) != -1; diff --git a/org.fox.ttrss/src/main/java/org/fox/ttrss/GalleryActivity.java b/org.fox.ttrss/src/main/java/org/fox/ttrss/GalleryActivity.java index ca2b6a47..0dfce8b2 100755 --- a/org.fox.ttrss/src/main/java/org/fox/ttrss/GalleryActivity.java +++ b/org.fox.ttrss/src/main/java/org/fox/ttrss/GalleryActivity.java @@ -26,6 +26,7 @@ import java.util.ArrayList; import java.util.List; import java.util.concurrent.ExecutionException; +import androidx.appcompat.app.AppCompatDelegate; import androidx.appcompat.widget.Toolbar; import androidx.core.app.ActivityCompat; import androidx.fragment.app.Fragment; @@ -225,7 +226,9 @@ public class GalleryActivity extends CommonActivity { m_prefs = PreferenceManager .getDefaultSharedPreferences(getApplicationContext()); - setTheme(R.style.DarkTheme); + + getDelegate().setLocalNightMode(AppCompatDelegate.MODE_NIGHT_YES); + setTheme(R.style.AppTheme); super.onCreate(savedInstanceState); @@ -296,7 +299,7 @@ public class GalleryActivity extends CommonActivity { MediaCheckTask mct = new MediaCheckTask() { @Override protected void onProgressUpdate(MediaProgressResult... result) { - m_items.add(result[0].item); + //m_items.add(result[0].item); m_adapter.notifyDataSetChanged(); if (result[0].position < result[0].count) { @@ -311,8 +314,8 @@ public class GalleryActivity extends CommonActivity { @Override protected void onPostExecute(List<GalleryEntry> result) { - //m_items.addAll(result); - //m_adapter.notifyDataSetChanged(); + m_items.addAll(result); + m_adapter.notifyDataSetChanged(); } }; diff --git a/org.fox.ttrss/src/main/java/org/fox/ttrss/HeadlinesFragment.java b/org.fox.ttrss/src/main/java/org/fox/ttrss/HeadlinesFragment.java index 933c4b28..ac94d420 100755 --- a/org.fox.ttrss/src/main/java/org/fox/ttrss/HeadlinesFragment.java +++ b/org.fox.ttrss/src/main/java/org/fox/ttrss/HeadlinesFragment.java @@ -50,6 +50,17 @@ import android.widget.ProgressBar; import android.widget.RelativeLayout; import android.widget.TextView; +import androidx.appcompat.app.ActionBar; +import androidx.core.app.ActivityCompat; +import androidx.core.app.ActivityOptionsCompat; +import androidx.core.view.ViewCompat; +import androidx.recyclerview.widget.DefaultItemAnimator; +import androidx.recyclerview.widget.DividerItemDecoration; +import androidx.recyclerview.widget.ItemTouchHelper; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; +import androidx.swiperefreshlayout.widget.SwipeRefreshLayout; + import com.amulyakhare.textdrawable.TextDrawable; import com.amulyakhare.textdrawable.util.ColorGenerator; import com.bumptech.glide.Glide; @@ -81,16 +92,6 @@ import java.util.HashMap; import java.util.List; import java.util.TimeZone; -import androidx.appcompat.app.ActionBar; -import androidx.core.app.ActivityCompat; -import androidx.core.app.ActivityOptionsCompat; -import androidx.core.view.ViewCompat; -import androidx.recyclerview.widget.DefaultItemAnimator; -import androidx.recyclerview.widget.DividerItemDecoration; -import androidx.recyclerview.widget.ItemTouchHelper; -import androidx.recyclerview.widget.LinearLayoutManager; -import androidx.recyclerview.widget.RecyclerView; -import androidx.swiperefreshlayout.widget.SwipeRefreshLayout; import icepick.State; import jp.wasabeef.glide.transformations.CropCircleTransformation; @@ -718,7 +719,7 @@ public class HeadlinesFragment extends StateSavedFragment { put("order_by", m_activity.getSortMode()); if (m_prefs.getBoolean("enable_image_downsampling", false)) { - if (!m_activity.isWifiConnected()) { + if (m_prefs.getBoolean("always_downsample_images", false) || !m_activity.isWifiConnected()) { put("resize_width", String.valueOf(m_activity.getResizeWidth())); } } diff --git a/org.fox.ttrss/src/main/java/org/fox/ttrss/LogcatActivity.java b/org.fox.ttrss/src/main/java/org/fox/ttrss/LogcatActivity.java index c845a1d7..c9cbcbf9 100755 --- a/org.fox.ttrss/src/main/java/org/fox/ttrss/LogcatActivity.java +++ b/org.fox.ttrss/src/main/java/org/fox/ttrss/LogcatActivity.java @@ -11,6 +11,7 @@ import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.ArrayList; +import androidx.appcompat.app.AppCompatDelegate; import androidx.appcompat.widget.Toolbar; import androidx.swiperefreshlayout.widget.SwipeRefreshLayout; import icepick.State; @@ -25,7 +26,8 @@ public class LogcatActivity extends CommonActivity { @Override public void onCreate(Bundle savedInstanceState) { - setTheme(R.style.DarkTheme); + getDelegate().setLocalNightMode(AppCompatDelegate.MODE_NIGHT_YES); + setTheme(R.style.AppTheme); super.onCreate(savedInstanceState); diff --git a/org.fox.ttrss/src/main/java/org/fox/ttrss/YoutubePlayerActivity.java b/org.fox.ttrss/src/main/java/org/fox/ttrss/YoutubePlayerActivity.java index 464684be..81afbf0e 100755 --- a/org.fox.ttrss/src/main/java/org/fox/ttrss/YoutubePlayerActivity.java +++ b/org.fox.ttrss/src/main/java/org/fox/ttrss/YoutubePlayerActivity.java @@ -13,6 +13,7 @@ import com.google.android.youtube.player.YouTubeInitializationResult; import com.google.android.youtube.player.YouTubePlayer; import com.google.android.youtube.player.YouTubePlayerSupportFragment; +import androidx.appcompat.app.AppCompatDelegate; import androidx.appcompat.widget.Toolbar; import icepick.State; @@ -28,7 +29,8 @@ public class YoutubePlayerActivity extends CommonActivity implements YouTubePlay @Override public void onCreate(Bundle savedInstanceState) { - setTheme(R.style.DarkTheme); + getDelegate().setLocalNightMode(AppCompatDelegate.MODE_NIGHT_YES); + setTheme(R.style.AppTheme); super.onCreate(savedInstanceState); setContentView(R.layout.activity_youtube_player); diff --git a/org.fox.ttrss/src/main/java/org/fox/ttrss/offline/OfflineArticleFragment.java b/org.fox.ttrss/src/main/java/org/fox/ttrss/offline/OfflineArticleFragment.java index a0d25be4..ff8c53d8 100755 --- a/org.fox.ttrss/src/main/java/org/fox/ttrss/offline/OfflineArticleFragment.java +++ b/org.fox.ttrss/src/main/java/org/fox/ttrss/offline/OfflineArticleFragment.java @@ -31,7 +31,6 @@ import android.widget.TextView; import com.shamanland.fab.ShowHideOnScroll; -import org.fox.ttrss.CommonActivity; import org.fox.ttrss.R; import org.fox.ttrss.util.ImageCacheService; import org.fox.ttrss.util.NotifyingScrollView; @@ -322,8 +321,7 @@ public class OfflineArticleFragment extends Fragment { if (m_web != null) { - String theme = m_prefs.getString("theme", CommonActivity.THEME_DEFAULT); - if (CommonActivity.THEME_DARK.equals(theme) || CommonActivity.THEME_AMBER.equals(theme)) { + if (m_activity.isUiNightMode()) { m_web.setBackgroundColor(Color.BLACK); } diff --git a/org.fox.ttrss/src/main/res/values-night-v21/style.xml b/org.fox.ttrss/src/main/res/values-night-v21/style.xml new file mode 100644 index 00000000..c154ed8a --- /dev/null +++ b/org.fox.ttrss/src/main/res/values-night-v21/style.xml @@ -0,0 +1,12 @@ +<resources xmlns:android="http://schemas.android.com/apk/res/android"> + <style name="AppTheme.Base" parent="Theme.AppCompat.DayNight.NoActionBar"> + <item name="android:windowDrawsSystemBarBackgrounds">true</item> + <item name="android:statusBarColor">@android:color/transparent</item> + <item name="android:windowBackground">@color/window_background_dark</item> + <item name="android:navigationBarColor">@android:color/black</item> + </style> + + <style name="DarkDialogTheme" parent="android:Theme.Material.Dialog"> + </style> + +</resources>
\ No newline at end of file diff --git a/org.fox.ttrss/src/main/res/values-night/style.xml b/org.fox.ttrss/src/main/res/values-night/style.xml new file mode 100644 index 00000000..c81d4b31 --- /dev/null +++ b/org.fox.ttrss/src/main/res/values-night/style.xml @@ -0,0 +1,63 @@ +<resources xmlns:android="http://schemas.android.com/apk/res/android"> + + <style name="AppTheme" parent="AppTheme.Base"> + <item name="windowActionModeOverlay">true</item> + + <!-- <item name="statusBarHintColor">?colorPrimary</item> --> + <item name="unreadCounterColor">#909090</item> + <item name="feedlistTextColor">@android:color/white</item> + <item name="headlineUnreadTextColor">@android:color/white</item> + <item name="headlineSelectedTextColor">@android:color/white</item> + <item name="headlineExcerptTextColor">#bebebe</item> + <item name="headlineSecondaryTextColor">#909090</item> + <item name="headlineTitleHighScoreUnreadTextColor">#00FF00</item> + <item name="headlineSelectedExcerptTextColor">#bebebe</item> + <item name="headlineSelectedSecondaryTextColor">?headlineSelectedExcerptTextColor</item> + <item name="headlineSelectedBackground">#1c1c1c</item> + <item name="headlineHeaderBackground">#99000000</item> + <item name="headlineUnreadBackground">#101010</item> + <item name="linkColor">#2d92c8</item> + <item name="loadingBackground">@android:color/black</item> + <item name="articleNoteTextColor">#bebebe</item> + <item name="articleNoteBackground">#303030</item> + <item name="parentBtnBackground">#101010</item> + <item name="ttrssHorizontalDivider">@android:drawable/divider_horizontal_dark</item> + <item name="feedlistBackground">#1c1d1e</item> + <item name="headlinesBackground">#1c1d1e</item> + <item name="articleBackground">@android:color/black</item> + <item name="feedsSelectedBackground">#1c1c1c</item> + <item name="feedlistSelectedTextColor">@android:color/white</item> + <item name="articleHeader">@android:color/transparent</item> + <item name="articleHeaderTextColor">@android:color/white</item> + <item name="floatingActionButtonStyle">@style/FabTheme</item> + <item name="articleTextColor">#e0e0e0</item> + <item name="headlineFooterColor">?colorPrimary</item> + <item name="articleHeaderSeparator">#303030</item> + + <item name="colorPrimary">#1e6286</item> + <item name="colorPrimaryDark">#18506e</item> + <item name="colorAccent">#D84315</item> + + <item name="ic_rss_box">@drawable/ic_rss_box</item> + <item name="ic_checkbox_marked">@drawable/ic_checkbox_marked</item> + <item name="ic_star">@drawable/ic_star</item> + <item name="ic_star_outline">@drawable/ic_star_outline</item> + <item name="ic_share">@drawable/ic_share</item> + <item name="ic_inbox">@drawable/ic_inbox</item> + <item name="ic_go_back">@drawable/ic_go_back</item> + <item name="ic_settings">@drawable/ic_settings</item> + <item name="ic_filter_variant">@drawable/ic_filter_variant</item> + <item name="ic_cloud_download">@drawable/ic_cloud_download</item> + <item name="ic_cloud_upload">@drawable/ic_cloud_upload</item> + <item name="ic_archive">@drawable/ic_archive</item> + <item name="ic_fresh">@drawable/ic_fresh</item> + <item name="ic_restore">@drawable/ic_restore</item> + <item name="ic_folder_outline">@drawable/ic_folder_outline</item> + <item name="ic_dots_vertical">@drawable/ic_dots_vertical</item> + <item name="ic_dots_vertical_circle">@drawable/ic_dots_vertical_circle</item> + <item name="ic_attachment">@drawable/ic_attachment</item> + <item name="ic_attachment_vert">@drawable/ic_attachment_vert</item> + + <item name="drawer_header">@drawable/drawer_header_dark</item> + </style> +</resources>
\ No newline at end of file diff --git a/org.fox.ttrss/src/main/res/values-v21/style.xml b/org.fox.ttrss/src/main/res/values-v21/style.xml index 1e5a366a..17484a87 100755 --- a/org.fox.ttrss/src/main/res/values-v21/style.xml +++ b/org.fox.ttrss/src/main/res/values-v21/style.xml @@ -1,16 +1,16 @@ <resources xmlns:android="http://schemas.android.com/apk/res/android"> - <style name="LightTheme.Base" parent="Theme.AppCompat.Light.NoActionBar"> + <style name="AppTheme.Base" parent="Theme.AppCompat.DayNight.NoActionBar"> <item name="android:windowDrawsSystemBarBackgrounds">true</item> <item name="android:statusBarColor">@android:color/transparent</item> <item name="android:windowBackground">@color/window_background</item> </style> - <style name="DarkTheme.Base" parent="Theme.AppCompat.NoActionBar"> + <!-- <style name="DarkTheme.Base" parent="Theme.AppCompat.NoActionBar"> <item name="android:windowDrawsSystemBarBackgrounds">true</item> <item name="android:statusBarColor">@android:color/transparent</item> <item name="android:windowBackground">@color/window_background_dark</item> <item name="android:navigationBarColor">@android:color/black</item> - </style> + </style> --> <style name="DarkDialogTheme" parent="android:Theme.Material.Dialog"> </style> diff --git a/org.fox.ttrss/src/main/res/values/arrays.xml b/org.fox.ttrss/src/main/res/values/arrays.xml index 25b2bd58..d2df646a 100644 --- a/org.fox.ttrss/src/main/res/values/arrays.xml +++ b/org.fox.ttrss/src/main/res/values/arrays.xml @@ -1,13 +1,13 @@ <resources> <string-array name="pref_theme_names"> + <item>@string/theme_follow_device</item> <item>@string/theme_light</item> <item>@string/theme_dark</item> - <item>@string/theme_amber</item> </string-array> <string-array name="pref_theme_values" translatable="false"> + <item>THEME_FOLLOW_DEVICE</item> <item>THEME_LIGHT</item> <item>THEME_DARK</item> - <item>THEME_AMBER</item> </string-array> <string-array name="headline_mode_names"> <item>@string/headline_display_mode_default</item> @@ -52,4 +52,5 @@ <item>30</item> <item>45</item> </string-array> + <string name="theme_follow_device">Same as device</string> </resources>
\ No newline at end of file diff --git a/org.fox.ttrss/src/main/res/values/strings.xml b/org.fox.ttrss/src/main/res/values/strings.xml index 4cf36455..a0b0f0b4 100755 --- a/org.fox.ttrss/src/main/res/values/strings.xml +++ b/org.fox.ttrss/src/main/res/values/strings.xml @@ -278,5 +278,8 @@ <string name="prefs_headline_images_wifi_only_long">Overrides previous setting</string> <string name="prefs_inline_video_player">Experimental. Long tap to open separate player</string> <string name="prefs_enable_image_downsampling">Auto-resize images</string> - <string name="prefs_enable_image_downsampling_long">Asks backend to downsample images if not on Wi-Fi. Needs a plugin (ttrss-api-resize).</string> + <string name="prefs_enable_image_downsampling_long">Asks backend to downsample images if not on Wi-Fi. Needs a plugin (ttrss-api-resize)</string> + <string name="prefs_always_downsample_images">Always resize images</string> + <string name="prefs_always_downsample_images_long">Even on Wi-Fi</string> + <string name="prefs_inline_video_player_title">Inline video player</string> </resources> diff --git a/org.fox.ttrss/src/main/res/values/style.xml b/org.fox.ttrss/src/main/res/values/style.xml index 9121638c..711b62a7 100755 --- a/org.fox.ttrss/src/main/res/values/style.xml +++ b/org.fox.ttrss/src/main/res/values/style.xml @@ -1,11 +1,10 @@ <resources xmlns:android="http://schemas.android.com/apk/res/android"> - <style name="LightTheme.Base" parent="Theme.AppCompat.Light.NoActionBar"> + <style name="AppTheme.Base" parent="Theme.AppCompat.DayNight"> <item name="android:windowNoTitle">true</item> - </style> - <style name="LightTheme" parent="LightTheme.Base"> + <style name="AppTheme" parent="AppTheme.Base"> <item name="windowActionModeOverlay">true</item> <!-- <item name="statusBarHintColor">?colorPrimary</item> --> @@ -66,6 +65,7 @@ <item name="drawer_header">@drawable/drawer_header</item> </style> + <!-- <style name="DarkTheme.Base" parent="Theme.AppCompat.NoActionBar"> </style> @@ -78,10 +78,10 @@ </style> <style name="DarkTheme" parent="DarkTheme.Base"> - <item name="windowActionModeOverlay">true</item> + <item name="windowActionModeOverlay">true</item> --> <!-- <item name="statusBarHintColor">?colorPrimary</item> --> - <item name="unreadCounterColor">#909090</item> + <!-- <item name="unreadCounterColor">#909090</item> <item name="feedlistTextColor">@android:color/white</item> <item name="headlineUnreadTextColor">@android:color/white</item> <item name="headlineSelectedTextColor">@android:color/white</item> @@ -136,7 +136,7 @@ <item name="ic_attachment_vert">@drawable/ic_attachment_vert</item> <item name="drawer_header">@drawable/drawer_header_dark</item> - </style> + </style> --> <style name="DarkDialogTheme" parent="android:Theme"></style> diff --git a/org.fox.ttrss/src/main/res/xml/preferences.xml b/org.fox.ttrss/src/main/res/xml/preferences.xml index f6f9b9bc..93bc74fa 100755 --- a/org.fox.ttrss/src/main/res/xml/preferences.xml +++ b/org.fox.ttrss/src/main/res/xml/preferences.xml @@ -32,7 +32,7 @@ android:key="category_look_and_feel" android:title="@string/look_and_feel" > <ListPreference - android:defaultValue="THEME_LIGHT" + android:defaultValue="THEME_FOLLOW_DEVICE" android:entries="@array/pref_theme_names" android:entryValues="@array/pref_theme_values" android:key="theme" @@ -128,9 +128,16 @@ <org.fox.ttrss.util.LessBrokenSwitchPreference android:defaultValue="false" + android:key="always_downsample_images" + android:dependency="enable_image_downsampling" + android:title="@string/prefs_always_downsample_images" + android:summary="@string/prefs_always_downsample_images_long" /> + + <org.fox.ttrss.util.LessBrokenSwitchPreference + android:defaultValue="false" android:key="inline_video_player" android:summary="@string/prefs_inline_video_player" - android:title="Inline video player" /> + android:title="@string/prefs_inline_video_player_title" /> </PreferenceCategory> |