add optional article swiping for xlarge devices

This commit is contained in:
Andrew Dolgov 2012-03-01 11:30:54 +03:00
parent 8e45b14c61
commit 59a4d3d439
4 changed files with 19 additions and 7 deletions

View File

@ -126,4 +126,5 @@
<string name="dialog_close">Close</string>
<string name="donate_select">Please select the donation</string>
<string name="donate_do">Donate!</string>
<string name="tablet_article_swipe">Swipe between articles</string>
</resources>

View File

@ -92,6 +92,11 @@
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" />
</PreferenceCategory>
<PreferenceCategory android:title="@string/offline_mode" >

View File

@ -1709,7 +1709,7 @@ public class MainActivity extends FragmentActivity implements OnlineServices {
Fragment frag;
if (m_smallScreenMode) {
if (m_smallScreenMode || m_prefs.getBoolean("tablet_article_swipe", false)) {
frag = new ArticlePager(article);
} else {
frag = new ArticleFragment(article);

View File

@ -1,5 +1,6 @@
package org.fox.ttrss;
import android.content.res.Configuration;
import android.os.Bundle;
import android.preference.PreferenceActivity;
@ -10,5 +11,10 @@ public class PreferencesActivity extends PreferenceActivity {
super.onCreate(savedInstanceState);
addPreferencesFromResource(R.xml.preferences);
if ((getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) != Configuration.SCREENLAYOUT_SIZE_XLARGE) {
getPreferenceScreen().removePreference(
findPreference("tablet_article_swipe"));
}
}
}