From 424970d191d5ccda77b28255febfd70a3ae8d27b Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Fri, 31 Oct 2014 01:20:48 +0300 Subject: [PATCH] remove some bad weightsum stuff for landscape layout properly set feed title on tablets if needed --- .../java/org/fox/ttrss/FeedsActivity.java | 32 +-------------- .../ttrss/offline/OfflineFeedsActivity.java | 14 ++----- .../res/layout-sw600dp-land/headlines.xml | 2 +- .../src/main/res/layout-sw700dp/headlines.xml | 41 ------------------- 4 files changed, 6 insertions(+), 83 deletions(-) delete mode 100644 org.fox.ttrss/src/main/res/layout-sw700dp/headlines.xml diff --git a/org.fox.ttrss/src/main/java/org/fox/ttrss/FeedsActivity.java b/org.fox.ttrss/src/main/java/org/fox/ttrss/FeedsActivity.java index 1743a8a0..c8a6e341 100644 --- a/org.fox.ttrss/src/main/java/org/fox/ttrss/FeedsActivity.java +++ b/org.fox.ttrss/src/main/java/org/fox/ttrss/FeedsActivity.java @@ -1,7 +1,6 @@ package org.fox.ttrss; -import android.animation.ObjectAnimator; import android.annotation.SuppressLint; import android.content.Intent; import android.content.SharedPreferences; @@ -16,7 +15,6 @@ import android.util.Log; import android.view.Gravity; import android.view.MenuItem; import android.view.View; -import android.widget.LinearLayout; import com.google.gson.JsonElement; @@ -59,9 +57,8 @@ public class FeedsActivity extends OnlineActivity implements HeadlinesEventListe setContentView(R.layout.headlines); setStatusBarTint(); - setSmallScreen(findViewById(R.id.sw600dp_anchor) == null && - findViewById(R.id.sw600dp_port_anchor) == null); - + setSmallScreen(findViewById(R.id.sw600dp_anchor) == null); + GlobalState.getInstance().load(savedInstanceState); m_drawerLayout = (DrawerLayout) findViewById(R.id.headlines_drawer); @@ -161,21 +158,8 @@ public class FeedsActivity extends OnlineActivity implements HeadlinesEventListe m_drawerLayout.openDrawer(Gravity.START); } - if (!isSmallScreen()) { - // temporary hack because FeedsActivity doesn't track whether active feed is open - LinearLayout container = (LinearLayout) findViewById(R.id.fragment_container); - - if (container != null) - container.setWeightSum(3f); - } - } - /* if (!isCompatMode() && !isSmallScreen()) { - ((ViewGroup)findViewById(R.id.headlines_fragment)).setLayoutTransition(new LayoutTransition()); - ((ViewGroup)findViewById(R.id.feeds_fragment)).setLayoutTransition(new LayoutTransition()); - } */ - } protected void onPostCreate(Bundle savedInstanceState) { @@ -227,18 +211,6 @@ public class FeedsActivity extends OnlineActivity implements HeadlinesEventListe ft.replace(R.id.headlines_fragment, new LoadingFragment(), null); ft.commit(); - if (!isCompatMode() && !isSmallScreen()) { - LinearLayout container = (LinearLayout) findViewById(R.id.fragment_container); - if (container != null) { - float wSum = container.getWeightSum(); - if (wSum <= 2.0f) { - ObjectAnimator anim = ObjectAnimator.ofFloat(container, "weightSum", wSum, 3.0f); - anim.setDuration(200); - anim.start(); - } - } - } - final Feed fFeed = feed; new Handler().postDelayed(new Runnable() { diff --git a/org.fox.ttrss/src/main/java/org/fox/ttrss/offline/OfflineFeedsActivity.java b/org.fox.ttrss/src/main/java/org/fox/ttrss/offline/OfflineFeedsActivity.java index 19978bcc..2dca3c85 100644 --- a/org.fox.ttrss/src/main/java/org/fox/ttrss/offline/OfflineFeedsActivity.java +++ b/org.fox.ttrss/src/main/java/org/fox/ttrss/offline/OfflineFeedsActivity.java @@ -15,7 +15,6 @@ import android.util.Log; import android.view.Gravity; import android.view.MenuItem; import android.view.View; -import android.widget.LinearLayout; import org.fox.ttrss.GlobalState; import org.fox.ttrss.R; @@ -44,9 +43,8 @@ public class OfflineFeedsActivity extends OfflineActivity implements OfflineHead setContentView(R.layout.headlines); setStatusBarTint(); - setSmallScreen(findViewById(R.id.sw600dp_anchor) == null && - findViewById(R.id.sw600dp_port_anchor) == null); - + setSmallScreen(findViewById(R.id.sw600dp_anchor) == null); + GlobalState.getInstance().load(savedInstanceState); m_drawerLayout = (DrawerLayout) findViewById(R.id.headlines_drawer); @@ -254,13 +252,7 @@ public class OfflineFeedsActivity extends OfflineActivity implements OfflineHead public void onFeedSelected(final int feedId, final boolean isCat, boolean open) { if (open) { - if (!isSmallScreen()) { - LinearLayout container = (LinearLayout) findViewById(R.id.fragment_container); - if (container != null) { - container.setWeightSum(3f); - } - } - + new Handler().postDelayed(new Runnable() { @Override public void run() { 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 f2f431a3..445369b9 100644 --- a/org.fox.ttrss/src/main/res/layout-sw600dp-land/headlines.xml +++ b/org.fox.ttrss/src/main/res/layout-sw600dp-land/headlines.xml @@ -18,7 +18,7 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:baselineAligned="false" - android:weightSum="1.1" + android:weightSum="3" android:orientation="horizontal" > - - - - - - - - - - - - - - - \ No newline at end of file