add menu item to toggle oldest first (refs #822)

demote select articles actionbar button into overflow
This commit is contained in:
Andrew Dolgov 2014-11-04 13:43:51 +03:00
parent a1ad7e0c41
commit fcbf300432
6 changed files with 33 additions and 5 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="265" android:versionCode="266"
android:versionName="1.60" > android:versionName="1.61" >
<uses-sdk <uses-sdk
android:minSdkVersion="9" android:minSdkVersion="9"

View File

@ -296,6 +296,12 @@ public class FeedsActivity extends OnlineActivity implements HeadlinesEventListe
case android.R.id.home: case android.R.id.home:
//getSupportFragmentManager().popBackStack(); //getSupportFragmentManager().popBackStack();
return true; return true;
case R.id.headlines_toggle_sort_order:
SharedPreferences.Editor editor = m_prefs.edit();
editor.putBoolean("oldest_first", !m_prefs.getBoolean("oldest_first", false));
editor.commit();
refresh();
return true;
case R.id.show_feeds: case R.id.show_feeds:
setUnreadOnly(!getUnreadOnly()); setUnreadOnly(!getUnreadOnly());
initMenu(); initMenu();

View File

@ -2,6 +2,7 @@ package org.fox.ttrss.offline;
import android.annotation.SuppressLint; import android.annotation.SuppressLint;
import android.content.Intent; import android.content.Intent;
import android.content.SharedPreferences;
import android.database.sqlite.SQLiteStatement; import android.database.sqlite.SQLiteStatement;
import android.os.Bundle; import android.os.Bundle;
import android.os.Handler; import android.os.Handler;
@ -131,6 +132,12 @@ public class OfflineFeedsActivity extends OfflineActivity implements OfflineHead
case android.R.id.home: case android.R.id.home:
//getSupportFragmentManager().popBackStack(); //getSupportFragmentManager().popBackStack();
return true; return true;
case R.id.headlines_toggle_sort_order:
SharedPreferences.Editor editor = m_prefs.edit();
editor.putBoolean("offline_oldest_first", !m_prefs.getBoolean("offline_oldest_first", false));
editor.commit();
refresh();
return true;
case R.id.show_feeds: case R.id.show_feeds:
setUnreadOnly(!getUnreadOnly()); setUnreadOnly(!getUnreadOnly());
initMenu(); initMenu();

View File

@ -55,10 +55,16 @@
android:title="@string/headlines_mark_as_read"/> android:title="@string/headlines_mark_as_read"/>
<item <item
android:id="@+id/headlines_select" android:id="@+id/headlines_select"
app:showAsAction="ifRoom" app:showAsAction=""
android:icon="@drawable/ic_select_all_light" android:icon="@drawable/ic_select_all_light"
android:title="@string/headlines_select"/> android:title="@string/headlines_select"/>
<item
android:id="@+id/headlines_toggle_sort_order"
android:icon="@drawable/ic_action_sort_by_size"
app:showAsAction="ifRoom"
android:title="@string/toggle_sort_order"/>
<item <item
android:id="@+id/headlines_view_mode" android:id="@+id/headlines_view_mode"
app:showAsAction="" app:showAsAction=""

View File

@ -16,6 +16,7 @@
<group android:id="@+id/menu_group_headlines" > <group android:id="@+id/menu_group_headlines" >
<item <item
android:id="@+id/search" android:id="@+id/search"
app:showAsAction="ifRoom"
android:icon="@drawable/ic_search_light" android:icon="@drawable/ic_search_light"
android:title="@string/search"/> android:title="@string/search"/>
<item <item
@ -26,8 +27,15 @@
<item <item
android:id="@+id/headlines_select" android:id="@+id/headlines_select"
android:icon="@drawable/ic_select_all_light" android:icon="@drawable/ic_select_all_light"
app:showAsAction="ifRoom" app:showAsAction=""
android:title="@string/headlines_select"/> android:title="@string/headlines_select"/>
<item
android:id="@+id/toggle_sort_order"
android:icon="@drawable/ic_action_sort_by_size"
app:showAsAction="ifRoom"
android:title="@string/toggle_sort_order"/>
<item <item
android:id="@+id/headlines_view_mode" android:id="@+id/headlines_view_mode"
app:showAsAction="" app:showAsAction=""

View File

@ -243,5 +243,6 @@
<string name="action_settings">Settings</string> <string name="action_settings">Settings</string>
<string name="error_loading_image">Error loading image.</string> <string name="error_loading_image">Error loading image.</string>
<string name="open_parent">Open parent</string> <string name="open_parent">Open parent</string>
<string name="toggle_sort_order">Toggle oldest first</string>
</resources> </resources>