add basic fullscreen mode, move preferences a bit

This commit is contained in:
Andrew Dolgov 2013-01-05 12:33:06 +04:00
parent 479d1f0a6c
commit 8f912ab8a8
6 changed files with 44 additions and 23 deletions

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.fox.ttrss" package="org.fox.ttrss"
android:versionCode="130" android:versionCode="131"
android:versionName="1.8" > android:versionName="1.9" >
<uses-sdk <uses-sdk
android:minSdkVersion="8" android:minSdkVersion="8"

View File

@ -153,4 +153,6 @@
<string name="trial_expired_message">To continue using Tiny Tiny RSS please unlock the full version by purchasing the key.</string> <string name="trial_expired_message">To continue using Tiny Tiny RSS please unlock the full version by purchasing the key.</string>
<string name="theme_sepia">Sepia</string> <string name="theme_sepia">Sepia</string>
<string name="trial_thanks">Full version, thank you for support!</string> <string name="trial_thanks">Full version, thank you for support!</string>
<string name="prefs_fullscreen_mode">Fullscreen mode</string>
<string name="reading">Reading</string>
</resources> </resources>

View File

@ -59,12 +59,6 @@
android:key="theme" android:key="theme"
android:summary="@string/pref_theme_long" android:summary="@string/pref_theme_long"
android:title="@string/pref_theme" /> android:title="@string/pref_theme" />
<ListPreference
android:defaultValue="0"
android:entries="@array/pref_font_size_names"
android:entryValues="@array/pref_font_size_values"
android:key="font_size"
android:title="@string/pref_font_size" />
<CheckBoxPreference <CheckBoxPreference
android:defaultValue="false" android:defaultValue="false"
@ -85,19 +79,6 @@
android:summary="@string/browse_cats_like_feeds_summary" android:summary="@string/browse_cats_like_feeds_summary"
android:title="@string/browse_cats_like_feeds" /> 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="true"
android:key="justify_article_text"
android:title="@string/justify_article_text" />
<ListPreference <ListPreference
android:defaultValue="HEADLINES" android:defaultValue="HEADLINES"
android:entries="@array/pref_view_mode_names" android:entries="@array/pref_view_mode_names"
@ -105,7 +86,19 @@
android:key="default_view_mode" android:key="default_view_mode"
android:summary="@string/pref_default_view_mode_long" android:summary="@string/pref_default_view_mode_long"
android:title="@string/pref_default_view_mode" /> android:title="@string/pref_default_view_mode" />
</PreferenceCategory>
<PreferenceCategory android:title="@string/reading" >
<ListPreference
android:defaultValue="0"
android:entries="@array/pref_font_size_names"
android:entryValues="@array/pref_font_size_values"
android:key="font_size"
android:title="@string/pref_font_size" />
<CheckBoxPreference
android:defaultValue="true"
android:key="justify_article_text"
android:title="@string/justify_article_text" />
<CheckBoxPreference <CheckBoxPreference
android:defaultValue="false" android:defaultValue="false"
android:key="use_volume_keys" android:key="use_volume_keys"
@ -116,6 +109,10 @@
android:key="dim_status_bar" android:key="dim_status_bar"
android:summary="@string/prefs_dim_status_bar_long" android:summary="@string/prefs_dim_status_bar_long"
android:title="@string/prefs_dim_status_bar" /> android:title="@string/prefs_dim_status_bar" />
<CheckBoxPreference
android:defaultValue="false"
android:key="full_screen_mode"
android:title="@string/prefs_fullscreen_mode" />
</PreferenceCategory> </PreferenceCategory>
<PreferenceCategory android:title="@string/offline_mode" > <PreferenceCategory android:title="@string/offline_mode" >
<ListPreference <ListPreference
@ -125,6 +122,7 @@
android:key="offline_sync_max" android:key="offline_sync_max"
android:summary="How many articles to download (newest first)" android:summary="How many articles to download (newest first)"
android:title="Download articles" /> android:title="Download articles" />
<CheckBoxPreference <CheckBoxPreference
android:defaultValue="false" android:defaultValue="false"
android:key="offline_image_cache_enabled" android:key="offline_image_cache_enabled"

View File

@ -13,6 +13,7 @@ import org.jsoup.nodes.Element;
import org.jsoup.select.Elements; import org.jsoup.select.Elements;
import android.annotation.SuppressLint; import android.annotation.SuppressLint;
import android.app.ActionBar;
import android.app.Activity; import android.app.Activity;
import android.content.Intent; import android.content.Intent;
import android.content.SharedPreferences; import android.content.SharedPreferences;

View File

@ -21,6 +21,7 @@ import android.util.Log;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.view.WindowManager;
import com.google.gson.JsonElement; import com.google.gson.JsonElement;
@ -263,9 +264,18 @@ public class ArticlePager extends Fragment {
m_activity.initMenu(); m_activity.initMenu();
if (!m_activity.isCompatMode() && m_prefs.getBoolean("dim_status_bar", false) && !m_activity.isCompatMode()) { if (!m_activity.isCompatMode() && m_prefs.getBoolean("dim_status_bar", false)) {
getView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE); getView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE);
} }
if (m_prefs.getBoolean("full_screen_mode", false)) {
m_activity.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
/* if (!m_activity.isCompatMode()) {
m_activity.getActionBar().hide();
} */
}
} }
public Article getSelectedArticle() { public Article getSelectedArticle() {

View File

@ -16,6 +16,7 @@ import android.util.Log;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.view.WindowManager;
public class OfflineArticlePager extends Fragment { public class OfflineArticlePager extends Fragment {
private final String TAG = this.getClass().getSimpleName(); private final String TAG = this.getClass().getSimpleName();
@ -99,9 +100,18 @@ public class OfflineArticlePager extends Fragment {
public void onResume() { public void onResume() {
super.onResume(); super.onResume();
if (!m_activity.isCompatMode() && m_prefs.getBoolean("dim_status_bar", false) && !m_activity.isCompatMode()) { if (!m_activity.isCompatMode() && m_prefs.getBoolean("dim_status_bar", false)) {
getView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE); getView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE);
} }
if (m_prefs.getBoolean("full_screen_mode", false)) {
m_activity.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
/* if (!m_activity.isCompatMode()) {
m_activity.getActionBar().hide();
} */
}
} }
public OfflineArticlePager() { public OfflineArticlePager() {