remove some bad weightsum stuff for landscape layout

properly set feed title on tablets if needed
This commit is contained in:
Andrew Dolgov 2014-10-31 01:20:48 +03:00
parent 8d886c41ce
commit 424970d191
4 changed files with 6 additions and 83 deletions

View File

@ -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() {

View File

@ -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() {

View File

@ -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" >
<FrameLayout

View File

@ -1,41 +0,0 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/main"
android:fitsSystemWindows="true"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<FrameLayout
android:id="@+id/sw600dp_anchor"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone" >
</FrameLayout>
<LinearLayout
android:id="@+id/fragment_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:baselineAligned="false"
android:weightSum="1.1"
android:orientation="horizontal" >
<FrameLayout
android:id="@+id/feeds_fragment"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="?feedlistBackground" >
</FrameLayout>
<FrameLayout
android:id="@+id/headlines_fragment"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="2"
android:background="?headlinesBackground" >
</FrameLayout>
</LinearLayout>
</LinearLayout>