add ability to toggle headlines activity sidebar manually in landscape
on tablets
This commit is contained in:
parent
f0a29f9bcb
commit
7bbbadee1e
@ -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="226"
|
||||
android:versionName="1.30" >
|
||||
android:versionCode="227"
|
||||
android:versionName="1.31" >
|
||||
|
||||
<uses-sdk
|
||||
android:minSdkVersion="8"
|
||||
|
@ -65,6 +65,10 @@
|
||||
android:showAsAction=""
|
||||
android:title="@string/headlines_view_mode"/>
|
||||
|
||||
<item
|
||||
android:id="@+id/headlines_toggle_sidebar"
|
||||
android:showAsAction=""
|
||||
android:title="@string/toggle_sidebar"/>
|
||||
|
||||
<!--
|
||||
<item
|
||||
|
@ -34,6 +34,11 @@
|
||||
android:id="@+id/headlines_view_mode"
|
||||
android:showAsAction=""
|
||||
android:title="@string/headlines_view_mode"/>
|
||||
|
||||
<item
|
||||
android:id="@+id/headlines_toggle_sidebar"
|
||||
android:showAsAction=""
|
||||
android:title="@string/toggle_sidebar"/>
|
||||
</group>
|
||||
<!--
|
||||
<group android:id="@+id/menu_group_headlines_selection" >
|
||||
|
@ -215,4 +215,5 @@
|
||||
<string name="server_function_not_available">Sorry, this function is not available on your tt-rss version.</string>
|
||||
<string name="unsubscribe">Unsubscribe</string>
|
||||
<string name="unsubscribe_from_prompt">Unsubscribe from %1$s?</string>
|
||||
<string name="toggle_sidebar">Toggle sidebar</string>
|
||||
</resources>
|
||||
|
@ -194,6 +194,8 @@ public class FeedsActivity extends OnlineActivity implements HeadlinesEventListe
|
||||
m_menu.findItem(R.id.update_headlines).setVisible(false);
|
||||
}
|
||||
|
||||
m_menu.findItem(R.id.headlines_toggle_sidebar).setVisible(false);
|
||||
|
||||
MenuItem item = m_menu.findItem(R.id.show_feeds);
|
||||
|
||||
if (getUnreadOnly()) {
|
||||
|
@ -39,7 +39,7 @@ public class HeadlinesActivity extends OnlineActivity implements HeadlinesEventL
|
||||
|
||||
GlobalState.getInstance().load(savedInstanceState);
|
||||
|
||||
if (isPortrait()) {
|
||||
if (isPortrait() || m_prefs.getBoolean("headlines_hide_sidebar", false)) {
|
||||
findViewById(R.id.headlines_fragment).setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
@ -162,6 +162,7 @@ public class HeadlinesActivity extends OnlineActivity implements HeadlinesEventL
|
||||
//HeadlinesFragment hf = (HeadlinesFragment)getSupportFragmentManager().findFragmentByTag(FRAG_HEADLINES);
|
||||
|
||||
m_menu.setGroupVisible(R.id.menu_group_headlines, !isPortrait() && !isSmallScreen());
|
||||
m_menu.findItem(R.id.headlines_toggle_sidebar).setVisible(!isPortrait() && !isSmallScreen());
|
||||
|
||||
ArticlePager af = (ArticlePager) getSupportFragmentManager().findFragmentByTag(FRAG_ARTICLE);
|
||||
|
||||
|
@ -18,6 +18,7 @@ import org.jsoup.nodes.Document;
|
||||
import org.jsoup.select.Elements;
|
||||
|
||||
import uk.co.senab.actionbarpulltorefresh.extras.actionbarsherlock.PullToRefreshAttacher;
|
||||
import android.animation.ObjectAnimator;
|
||||
import android.annotation.TargetApi;
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Dialog;
|
||||
@ -36,11 +37,13 @@ import android.database.Cursor;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.support.v4.app.FragmentTransaction;
|
||||
import android.util.Log;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.View;
|
||||
import android.view.Window;
|
||||
import android.widget.EditText;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.SearchView;
|
||||
import android.widget.TextView;
|
||||
|
||||
@ -641,6 +644,19 @@ public class OnlineActivity extends CommonActivity {
|
||||
/* case android.R.id.home:
|
||||
finish();
|
||||
return true; */
|
||||
case R.id.headlines_toggle_sidebar:
|
||||
if (true && !isSmallScreen()) {
|
||||
View v = findViewById(R.id.headlines_fragment);
|
||||
|
||||
if (v != null) {
|
||||
SharedPreferences.Editor editor = m_prefs.edit();
|
||||
editor.putBoolean("headlines_hide_sidebar", !m_prefs.getBoolean("headlines_hide_sidebar", false));
|
||||
editor.commit();
|
||||
|
||||
v.setVisibility(m_prefs.getBoolean("headlines_hide_sidebar", false) ? View.GONE : View.VISIBLE);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
case R.id.subscribe_to_feed:
|
||||
Intent subscribe = new Intent(OnlineActivity.this, SubscribeActivity.class);
|
||||
startActivityForResult(subscribe, 0);
|
||||
|
@ -267,6 +267,17 @@ public class OfflineActivity extends CommonActivity {
|
||||
/* case android.R.id.home:
|
||||
finish();
|
||||
return true; */
|
||||
case R.id.headlines_toggle_sidebar:
|
||||
if (true && !isSmallScreen()) {
|
||||
SharedPreferences.Editor editor = m_prefs.edit();
|
||||
editor.putBoolean("headlines_hide_sidebar", !m_prefs.getBoolean("headlines_hide_sidebar", false));
|
||||
editor.commit();
|
||||
|
||||
if (ohf != null && ohf.isAdded()) {
|
||||
ohf.getView().setVisibility(m_prefs.getBoolean("headlines_hide_sidebar", false) ? View.GONE : View.VISIBLE);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
case R.id.go_online:
|
||||
switchOnline();
|
||||
return true;
|
||||
|
@ -215,6 +215,8 @@ public class OfflineFeedsActivity extends OfflineActivity implements OfflineHead
|
||||
m_menu.setGroupVisible(R.id.menu_group_headlines, hf != null && hf.isAdded());
|
||||
}
|
||||
|
||||
m_menu.findItem(R.id.headlines_toggle_sidebar).setVisible(false);
|
||||
|
||||
MenuItem item = m_menu.findItem(R.id.show_feeds);
|
||||
|
||||
if (getUnreadOnly()) {
|
||||
|
@ -39,7 +39,7 @@ public class OfflineHeadlinesActivity extends OfflineActivity implements Offline
|
||||
|
||||
setSmallScreen(findViewById(R.id.sw600dp_anchor) == null);
|
||||
|
||||
if (isPortrait()) {
|
||||
if (isPortrait() || m_prefs.getBoolean("headlines_hide_sidebar", false)) {
|
||||
findViewById(R.id.headlines_fragment).setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
@ -144,6 +144,7 @@ public class OfflineHeadlinesActivity extends OfflineActivity implements Offline
|
||||
//OfflineHeadlinesFragment hf = (OfflineHeadlinesFragment)getSupportFragmentManager().findFragmentByTag(FRAG_HEADLINES);
|
||||
|
||||
m_menu.setGroupVisible(R.id.menu_group_headlines, !isPortrait() && !isSmallScreen());
|
||||
m_menu.findItem(R.id.headlines_toggle_sidebar).setVisible(!isPortrait() && !isSmallScreen());
|
||||
|
||||
Fragment af = getSupportFragmentManager().findFragmentByTag(FRAG_ARTICLE);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user