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="dialog_close">Close</string>
<string name="donate_select">Please select the donation</string> <string name="donate_select">Please select the donation</string>
<string name="donate_do">Donate!</string> <string name="donate_do">Donate!</string>
<string name="tablet_article_swipe">Swipe between articles</string>
</resources> </resources>

View File

@ -92,6 +92,11 @@
android:key="combined_mode" android:key="combined_mode"
android:summary="@string/combined_mode_summary" android:summary="@string/combined_mode_summary"
android:title="@string/combined_mode" /> android:title="@string/combined_mode" />
<CheckBoxPreference
android:defaultValue="false"
android:key="tablet_article_swipe"
android:title="@string/tablet_article_swipe" />
</PreferenceCategory> </PreferenceCategory>
<PreferenceCategory android:title="@string/offline_mode" > <PreferenceCategory android:title="@string/offline_mode" >

View File

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

View File

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