diff options
author | Andrew Dolgov <[email protected]> | 2015-06-05 20:01:27 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2015-06-05 20:01:27 +0300 |
commit | 99216872d0e0edf2085eef5bd95a038b9edb76aa (patch) | |
tree | 33befe825efdd09660f9ca853bb2c4d00c239810 /org.fox.ttrss | |
parent | cb0c9b06e02b5e8dbc099cf0b0dd8e6e16dadf4a (diff) |
do not show drawer header in tablet horizontal mode
Diffstat (limited to 'org.fox.ttrss')
5 files changed, 51 insertions, 41 deletions
diff --git a/org.fox.ttrss/src/main/java/org/fox/ttrss/BaseFeedlistFragment.java b/org.fox.ttrss/src/main/java/org/fox/ttrss/BaseFeedlistFragment.java index 4bab1f19..035f523a 100755 --- a/org.fox.ttrss/src/main/java/org/fox/ttrss/BaseFeedlistFragment.java +++ b/org.fox.ttrss/src/main/java/org/fox/ttrss/BaseFeedlistFragment.java @@ -28,33 +28,36 @@ public abstract class BaseFeedlistFragment extends Fragment { if (true /*m_activity.findViewById(R.id.headlines_drawer) != null*/) { try { - View layout = inflater.inflate(R.layout.drawer_header, list, false); - list.addHeaderView(layout, null, false); - TextView login = (TextView) view.findViewById(R.id.drawer_header_login); - TextView server = (TextView) view.findViewById(R.id.drawer_header_server); + if (activity.isSmallScreen()) { + View layout = inflater.inflate(R.layout.drawer_header, list, false); + list.addHeaderView(layout, null, false); - login.setText(prefs.getString("login", "")); - try { - server.setText(new URL(prefs.getString("ttrss_url", "")).getHost()); - } catch (MalformedURLException e) { - server.setText(""); - } + TextView login = (TextView) view.findViewById(R.id.drawer_header_login); + TextView server = (TextView) view.findViewById(R.id.drawer_header_server); - View account = view.findViewById(R.id.drawer_header_account); + login.setText(prefs.getString("login", "")); + try { + server.setText(new URL(prefs.getString("ttrss_url", "")).getHost()); + } catch (MalformedURLException e) { + server.setText(""); + } - account.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - try { - Intent intent = new Intent(Intent.ACTION_VIEW, - Uri.parse(prefs.getString("ttrss_url", ""))); - startActivity(intent); - } catch (Exception e) { + View account = view.findViewById(R.id.drawer_header_account); + + account.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + try { + Intent intent = new Intent(Intent.ACTION_VIEW, + Uri.parse(prefs.getString("ttrss_url", ""))); + startActivity(intent); + } catch (Exception e) { + } } - } - }); + }); + } /* deal with ~material~ footers */ diff --git a/org.fox.ttrss/src/main/java/org/fox/ttrss/FeedCategoriesFragment.java b/org.fox.ttrss/src/main/java/org/fox/ttrss/FeedCategoriesFragment.java index ef6dce88..08028297 100755 --- a/org.fox.ttrss/src/main/java/org/fox/ttrss/FeedCategoriesFragment.java +++ b/org.fox.ttrss/src/main/java/org/fox/ttrss/FeedCategoriesFragment.java @@ -225,7 +225,10 @@ public class FeedCategoriesFragment extends BaseFeedlistFragment implements OnIt registerForContextMenu(m_list); View loadingBar = (View) view.findViewById(R.id.feeds_loading_bar); - loadingBar.setVisibility(View.VISIBLE); + + if (loadingBar != null) { + loadingBar.setVisibility(View.VISIBLE); + } //m_activity.m_pullToRefreshAttacher.addRefreshableView(list, this); diff --git a/org.fox.ttrss/src/main/java/org/fox/ttrss/FeedsFragment.java b/org.fox.ttrss/src/main/java/org/fox/ttrss/FeedsFragment.java index 5a17f9f5..a8a71787 100755 --- a/org.fox.ttrss/src/main/java/org/fox/ttrss/FeedsFragment.java +++ b/org.fox.ttrss/src/main/java/org/fox/ttrss/FeedsFragment.java @@ -309,7 +309,10 @@ public class FeedsFragment extends BaseFeedlistFragment implements OnItemClickLi //m_enableFeedIcons = m_prefs.getBoolean("download_feed_icons", false); View loadingBar = (View) view.findViewById(R.id.feeds_loading_bar); - loadingBar.setVisibility(View.VISIBLE); + + if (loadingBar != null) { + loadingBar.setVisibility(View.VISIBLE); + } //Log.d(TAG, "mpTRA=" + m_activity.m_pullToRefreshAttacher); //m_activity.m_pullToRefreshAttacher.addRefreshableView(list, this); diff --git a/org.fox.ttrss/src/main/res/layout-sw600dp-land/headlines.xml b/org.fox.ttrss/src/main/res/layout-sw600dp-land/headlines.xml index 598fd987..88e84742 100755 --- a/org.fox.ttrss/src/main/res/layout-sw600dp-land/headlines.xml +++ b/org.fox.ttrss/src/main/res/layout-sw600dp-land/headlines.xml @@ -1,11 +1,18 @@ +<RelativeLayout + android:layout_width="fill_parent" + android:layout_height="fill_parent" + android:fitsSystemWindows="true" + xmlns:android="http://schemas.android.com/apk/res/android"> + + <include layout="@layout/actionbar_toolbar" android:id="@+id/actionbar_toolbar" /> + <LinearLayout - android:fitsSystemWindows="true" - xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/fragment_container" android:layout_width="fill_parent" android:layout_height="fill_parent" android:baselineAligned="false" - android:orientation="horizontal" > + android:orientation="horizontal" + android:layout_below="@+id/actionbar_toolbar"> <FrameLayout android:id="@+id/sw600dp_anchor" @@ -14,7 +21,6 @@ android:visibility="gone" > </FrameLayout> - <FrameLayout android:id="@+id/feeds_fragment" android:layout_width="0dp" @@ -23,21 +29,16 @@ android:background="?feedlistBackground" > </FrameLayout> - <RelativeLayout + <FrameLayout android:layout_width="0dp" android:layout_weight="0.75" + android:id="@+id/headlines_fragment" + android:background="?headlinesBackground" + android:elevation="4dp" android:layout_height="match_parent"> + </FrameLayout> - <include layout="@layout/actionbar_toolbar" android:id="@+id/actionbar_toolbar" /> - - <FrameLayout - android:id="@+id/headlines_fragment" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:background="?headlinesBackground" - android:layout_below="@+id/actionbar_toolbar"> - </FrameLayout> + </LinearLayout> - </RelativeLayout> - </LinearLayout> +</RelativeLayout> diff --git a/org.fox.ttrss/src/main/res/layout-sw600dp-land/headlines_articles.xml b/org.fox.ttrss/src/main/res/layout-sw600dp-land/headlines_articles.xml index 008efa4c..4067b7b4 100755 --- a/org.fox.ttrss/src/main/res/layout-sw600dp-land/headlines_articles.xml +++ b/org.fox.ttrss/src/main/res/layout-sw600dp-land/headlines_articles.xml @@ -26,7 +26,7 @@ android:id="@+id/headlines_fragment" android:layout_width="0dp" android:layout_height="match_parent" - android:layout_weight="0.4" + android:layout_weight="0.3" android:background="?headlinesBackground" > </FrameLayout> @@ -34,7 +34,7 @@ android:id="@+id/article_fragment" android:layout_width="0dp" android:layout_height="match_parent" - android:layout_weight="0.6" + android:layout_weight="0.7" android:elevation="4dp" android:background="?articleBackground" > </FrameLayout> |