add option to force small tablet mode, move tablet-specific options to
separate category, bump version
This commit is contained in:
parent
86a4f6c2de
commit
a7dd01131d
@ -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="97"
|
||||
android:versionName="0.7.5" >
|
||||
android:versionCode="98"
|
||||
android:versionName="0.7.6" >
|
||||
|
||||
<uses-sdk
|
||||
android:minSdkVersion="8"
|
||||
|
@ -128,4 +128,6 @@
|
||||
<string name="notify_article_published">Article published</string>
|
||||
<string name="notify_article_unpublished">Article unpublished</string>
|
||||
<string name="notify_article_note_set">Article note saved</string>
|
||||
<string name="force_small_tablet_ui">Force compact interface</string>
|
||||
<string name="prefs_for_tablets">Tablets</string>
|
||||
</resources>
|
@ -2,21 +2,18 @@
|
||||
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" >
|
||||
|
||||
<PreferenceCategory android:title="@string/connection" >
|
||||
|
||||
<EditTextPreference
|
||||
android:key="login"
|
||||
android:singleLine="true"
|
||||
android:summary="@string/login_summary"
|
||||
android:title="@string/login" >
|
||||
</EditTextPreference>
|
||||
|
||||
<EditTextPreference
|
||||
android:key="password"
|
||||
android:password="true"
|
||||
android:singleLine="true"
|
||||
android:title="@string/password" >
|
||||
</EditTextPreference>
|
||||
|
||||
<EditTextPreference
|
||||
android:hint="@string/default_url"
|
||||
android:inputType="textUri"
|
||||
@ -31,16 +28,13 @@
|
||||
android:key="ssl_trust_any"
|
||||
android:title="@string/ssl_trust_any" />
|
||||
</PreferenceCategory>
|
||||
|
||||
<PreferenceCategory android:title="@string/http_authentication" >
|
||||
|
||||
<EditTextPreference
|
||||
android:key="http_login"
|
||||
android:singleLine="true"
|
||||
android:summary="@string/http_login_summary"
|
||||
android:title="@string/login" >
|
||||
</EditTextPreference>
|
||||
|
||||
<EditTextPreference
|
||||
android:key="http_password"
|
||||
android:password="true"
|
||||
@ -48,9 +42,9 @@
|
||||
android:title="@string/password" >
|
||||
</EditTextPreference>
|
||||
</PreferenceCategory>
|
||||
|
||||
<PreferenceCategory android:key="category_look_and_feel" android:title="@string/look_and_feel" >
|
||||
|
||||
<PreferenceCategory
|
||||
android:key="category_look_and_feel"
|
||||
android:title="@string/look_and_feel" >
|
||||
<ListPreference
|
||||
android:defaultValue="THEME_DARK"
|
||||
android:entries="@array/pref_theme_names"
|
||||
@ -58,7 +52,6 @@
|
||||
android:key="theme"
|
||||
android:summary="@string/pref_theme_long"
|
||||
android:title="@string/pref_theme" />
|
||||
|
||||
<ListPreference
|
||||
android:defaultValue="0"
|
||||
android:entries="@array/pref_font_size_names"
|
||||
@ -70,52 +63,50 @@
|
||||
android:defaultValue="false"
|
||||
android:key="sort_feeds_by_unread"
|
||||
android:title="@string/sort_feeds_by_unread" />
|
||||
|
||||
<CheckBoxPreference
|
||||
android:defaultValue="false"
|
||||
android:key="download_feed_icons"
|
||||
android:title="@string/download_feed_icons" />
|
||||
|
||||
<CheckBoxPreference
|
||||
android:defaultValue="false"
|
||||
android:key="enable_cats"
|
||||
android:title="@string/enable_cats" />
|
||||
|
||||
<CheckBoxPreference
|
||||
android:defaultValue="false"
|
||||
android:key="browse_cats_like_feeds"
|
||||
android:dependency="enable_cats"
|
||||
android:key="browse_cats_like_feeds"
|
||||
android:summary="@string/browse_cats_like_feeds_summary"
|
||||
android:title="@string/browse_cats_like_feeds" />
|
||||
|
||||
<CheckBoxPreference
|
||||
android:defaultValue="false"
|
||||
android:key="combined_mode"
|
||||
android:summary="@string/combined_mode_summary"
|
||||
android:title="@string/combined_mode" />
|
||||
|
||||
<CheckBoxPreference
|
||||
android:defaultValue="false"
|
||||
android:key="tablet_article_swipe"
|
||||
android:title="@string/tablet_article_swipe" />
|
||||
|
||||
<CheckBoxPreference
|
||||
android:defaultValue="true"
|
||||
android:key="justify_article_text"
|
||||
android:title="@string/justify_article_text" />
|
||||
</PreferenceCategory>
|
||||
|
||||
<PreferenceCategory
|
||||
android:key="category_tablets"
|
||||
android:title="@string/prefs_for_tablets" >
|
||||
<CheckBoxPreference
|
||||
android:defaultValue="false"
|
||||
android:key="tablet_article_swipe"
|
||||
android:title="@string/tablet_article_swipe" />
|
||||
<CheckBoxPreference
|
||||
android:defaultValue="false"
|
||||
android:key="force_small_tablet_ui"
|
||||
android:title="@string/force_small_tablet_ui" />
|
||||
</PreferenceCategory>
|
||||
<PreferenceCategory android:title="@string/offline_mode" >
|
||||
|
||||
<CheckBoxPreference
|
||||
android:defaultValue="false"
|
||||
android:key="offline_image_cache_enabled"
|
||||
android:summary="@string/offline_image_cache_enabled_summary"
|
||||
android:title="@string/offline_image_cache_enabled" />
|
||||
</PreferenceCategory>
|
||||
|
||||
<PreferenceCategory android:title="@string/debugging" >
|
||||
|
||||
<CheckBoxPreference
|
||||
android:defaultValue="false"
|
||||
android:key="transport_debugging"
|
||||
|
@ -2,8 +2,10 @@ package org.fox.ttrss;
|
||||
|
||||
import org.fox.ttrss.util.DatabaseHelper;
|
||||
|
||||
import android.content.SharedPreferences;
|
||||
import android.database.sqlite.SQLiteDatabase;
|
||||
import android.os.Bundle;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.support.v4.app.FragmentActivity;
|
||||
import android.util.DisplayMetrics;
|
||||
import android.util.FloatMath;
|
||||
@ -19,6 +21,8 @@ public class CommonActivity extends FragmentActivity {
|
||||
public final static String FRAG_FEEDS = "feeds";
|
||||
public final static String FRAG_CATS = "cats";
|
||||
|
||||
private SharedPreferences m_prefs;
|
||||
|
||||
private SQLiteDatabase m_readableDb;
|
||||
private SQLiteDatabase m_writableDb;
|
||||
|
||||
@ -51,7 +55,7 @@ public class CommonActivity extends FragmentActivity {
|
||||
|
||||
float inDiag = FloatMath.sqrt(inHeight * inHeight + inWidth * inWidth);
|
||||
|
||||
if (inDiag < 9) {
|
||||
if (inDiag < 9 || m_prefs.getBoolean("force_small_tablet_ui", false)) {
|
||||
m_smallTablet = true;
|
||||
}
|
||||
|
||||
@ -88,6 +92,9 @@ public class CommonActivity extends FragmentActivity {
|
||||
|
||||
m_compatMode = android.os.Build.VERSION.SDK_INT <= 10;
|
||||
|
||||
m_prefs = PreferenceManager
|
||||
.getDefaultSharedPreferences(getApplicationContext());
|
||||
|
||||
Log.d(TAG, "m_compatMode=" + m_compatMode);
|
||||
|
||||
detectSmallTablet();
|
||||
|
@ -19,11 +19,6 @@ public class PreferencesActivity extends PreferenceActivity {
|
||||
.getDefaultSharedPreferences(getApplicationContext());
|
||||
|
||||
addPreferencesFromResource(R.xml.preferences);
|
||||
|
||||
if ((getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) != Configuration.SCREENLAYOUT_SIZE_XLARGE) {
|
||||
PreferenceCategory category = (PreferenceCategory)findPreference("category_look_and_feel");
|
||||
category.removePreference(findPreference("tablet_article_swipe"));
|
||||
}
|
||||
|
||||
findPreference("justify_article_text").setEnabled(!prefs.getBoolean("combined_mode", false));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user