diff options
author | Andrew Dolgov <[email protected]> | 2015-02-07 16:35:44 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2015-02-07 16:35:44 +0300 |
commit | df0c03abd8c30e70bcb5b79167f0919faefad0bf (patch) | |
tree | 4b2e717eb2854a12f1f679390ce3b04cb33f379a /org.fox.ttrss/src/main | |
parent | 183079172df6c8152b5da0574bbc04ed7462e836 (diff) |
add fix for sidebar not showing/hiding properly on tablets because of activity not being recreated on orientation change (this is needed to restore webview/fsview state)
Diffstat (limited to 'org.fox.ttrss/src/main')
-rw-r--r-- | org.fox.ttrss/src/main/java/org/fox/ttrss/HeadlinesActivity.java | 16 | ||||
-rw-r--r-- | org.fox.ttrss/src/main/res/layout-sw600dp-port/headlines.xml | 36 | ||||
-rw-r--r-- | org.fox.ttrss/src/main/res/layout-sw600dp-port/headlines_articles.xml (renamed from org.fox.ttrss/src/main/res/layout-sw700dp-port/headlines_articles.xml) | 31 |
3 files changed, 33 insertions, 50 deletions
diff --git a/org.fox.ttrss/src/main/java/org/fox/ttrss/HeadlinesActivity.java b/org.fox.ttrss/src/main/java/org/fox/ttrss/HeadlinesActivity.java index 4773535d..eef2fa08 100644 --- a/org.fox.ttrss/src/main/java/org/fox/ttrss/HeadlinesActivity.java +++ b/org.fox.ttrss/src/main/java/org/fox/ttrss/HeadlinesActivity.java @@ -3,6 +3,7 @@ package org.fox.ttrss; import android.annotation.SuppressLint; import android.content.Intent; import android.content.SharedPreferences; +import android.content.res.Configuration; import android.os.Bundle; import android.os.Handler; import android.preference.PreferenceManager; @@ -39,6 +40,10 @@ public class HeadlinesActivity extends OnlineActivity implements HeadlinesEventL GlobalState.getInstance().load(savedInstanceState); + if (isPortrait() && !isSmallScreen()) { + findViewById(R.id.headlines_fragment).setVisibility(View.GONE); + } + if (savedInstanceState == null) { Intent i = getIntent(); @@ -99,6 +104,15 @@ public class HeadlinesActivity extends OnlineActivity implements HeadlinesEventL } } + @Override + public void onConfigurationChanged(Configuration newConfig) { + super.onConfigurationChanged(newConfig); + + if (!isSmallScreen()) { + findViewById(R.id.headlines_fragment).setVisibility(isPortrait() ? View.GONE : View.VISIBLE); + } + } + @Override protected void refresh() { super.refresh(); @@ -223,7 +237,7 @@ public class HeadlinesActivity extends OnlineActivity implements HeadlinesEventL } public void showSidebar(boolean show) { - if (!isSmallScreen()) { + if (!isSmallScreen() && !isPortrait()) { findViewById(R.id.headlines_fragment).setVisibility(show ? View.VISIBLE : View.GONE); invalidateOptionsMenu(); } diff --git a/org.fox.ttrss/src/main/res/layout-sw600dp-port/headlines.xml b/org.fox.ttrss/src/main/res/layout-sw600dp-port/headlines.xml deleted file mode 100644 index 01737c68..00000000 --- a/org.fox.ttrss/src/main/res/layout-sw600dp-port/headlines.xml +++ /dev/null @@ -1,36 +0,0 @@ -<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_width="fill_parent" - android:layout_height="fill_parent" - android:fitsSystemWindows="true"> - - <FrameLayout - android:id="@+id/sw600dp_port_anchor" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:visibility="gone" > - </FrameLayout> - - <android.support.v4.widget.DrawerLayout - android:id="@+id/headlines_drawer" - android:layout_width="match_parent" - android:layout_height="match_parent"> - - <FrameLayout - android:id="@+id/headlines_fragment" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:background="?headlinesBackground"> - </FrameLayout> - - <FrameLayout - android:id="@+id/feeds_fragment" - android:layout_width="300dp" - android:layout_gravity="start" - android:background="?feedlistBackground" - android:layout_height="match_parent" > - </FrameLayout> - - </android.support.v4.widget.DrawerLayout> - - -</FrameLayout>
\ No newline at end of file diff --git a/org.fox.ttrss/src/main/res/layout-sw700dp-port/headlines_articles.xml b/org.fox.ttrss/src/main/res/layout-sw600dp-port/headlines_articles.xml index 7ed80c18..f4ff2c59 100644 --- a/org.fox.ttrss/src/main/res/layout-sw700dp-port/headlines_articles.xml +++ b/org.fox.ttrss/src/main/res/layout-sw600dp-port/headlines_articles.xml @@ -1,9 +1,9 @@ <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" - android:id="@+id/main" + android:id="@+id/headlines" android:fitsSystemWindows="true" android:layout_width="fill_parent" android:layout_height="fill_parent" - android:orientation="vertical"> + android:orientation="vertical" > <FrameLayout android:id="@+id/sw600dp_anchor" @@ -12,25 +12,30 @@ android:visibility="gone" > </FrameLayout> - <android.support.v4.widget.DrawerLayout - android:id="@+id/headlines_drawer" + <LinearLayout + android:id="@+id/fragment_container" android:layout_width="match_parent" - android:layout_height="match_parent"> + android:layout_height="match_parent" + android:baselineAligned="false" + android:orientation="horizontal" > <FrameLayout - android:id="@+id/article_fragment" - android:layout_width="match_parent" + android:paddingRight="4dp" + android:id="@+id/headlines_fragment" + android:layout_width="0dp" android:layout_height="match_parent" - android:background="?articleBackground"> + android:layout_weight="0.4" + android:background="?headlinesBackground" > </FrameLayout> <FrameLayout - android:id="@+id/headlines_fragment" + android:id="@+id/article_fragment" + android:layout_width="0dp" android:layout_height="match_parent" - android:layout_width="500dp" - android:layout_gravity="start" - android:background="?headlinesBackground"> + android:layout_weight="0.6" + android:elevation="4dp" + android:background="?articleBackground" > </FrameLayout> - </android.support.v4.widget.DrawerLayout> + </LinearLayout> </LinearLayout>
\ No newline at end of file |