remove some bad weightsum stuff for landscape layout
properly set feed title on tablets if needed
This commit is contained in:
parent
8d886c41ce
commit
424970d191
@ -1,7 +1,6 @@
|
|||||||
package org.fox.ttrss;
|
package org.fox.ttrss;
|
||||||
|
|
||||||
|
|
||||||
import android.animation.ObjectAnimator;
|
|
||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
@ -16,7 +15,6 @@ import android.util.Log;
|
|||||||
import android.view.Gravity;
|
import android.view.Gravity;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.LinearLayout;
|
|
||||||
|
|
||||||
import com.google.gson.JsonElement;
|
import com.google.gson.JsonElement;
|
||||||
|
|
||||||
@ -59,9 +57,8 @@ public class FeedsActivity extends OnlineActivity implements HeadlinesEventListe
|
|||||||
setContentView(R.layout.headlines);
|
setContentView(R.layout.headlines);
|
||||||
|
|
||||||
setStatusBarTint();
|
setStatusBarTint();
|
||||||
setSmallScreen(findViewById(R.id.sw600dp_anchor) == null &&
|
setSmallScreen(findViewById(R.id.sw600dp_anchor) == null);
|
||||||
findViewById(R.id.sw600dp_port_anchor) == null);
|
|
||||||
|
|
||||||
GlobalState.getInstance().load(savedInstanceState);
|
GlobalState.getInstance().load(savedInstanceState);
|
||||||
|
|
||||||
m_drawerLayout = (DrawerLayout) findViewById(R.id.headlines_drawer);
|
m_drawerLayout = (DrawerLayout) findViewById(R.id.headlines_drawer);
|
||||||
@ -161,21 +158,8 @@ public class FeedsActivity extends OnlineActivity implements HeadlinesEventListe
|
|||||||
m_drawerLayout.openDrawer(Gravity.START);
|
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) {
|
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.replace(R.id.headlines_fragment, new LoadingFragment(), null);
|
||||||
ft.commit();
|
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;
|
final Feed fFeed = feed;
|
||||||
|
|
||||||
new Handler().postDelayed(new Runnable() {
|
new Handler().postDelayed(new Runnable() {
|
||||||
|
@ -15,7 +15,6 @@ import android.util.Log;
|
|||||||
import android.view.Gravity;
|
import android.view.Gravity;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.LinearLayout;
|
|
||||||
|
|
||||||
import org.fox.ttrss.GlobalState;
|
import org.fox.ttrss.GlobalState;
|
||||||
import org.fox.ttrss.R;
|
import org.fox.ttrss.R;
|
||||||
@ -44,9 +43,8 @@ public class OfflineFeedsActivity extends OfflineActivity implements OfflineHead
|
|||||||
setContentView(R.layout.headlines);
|
setContentView(R.layout.headlines);
|
||||||
|
|
||||||
setStatusBarTint();
|
setStatusBarTint();
|
||||||
setSmallScreen(findViewById(R.id.sw600dp_anchor) == null &&
|
setSmallScreen(findViewById(R.id.sw600dp_anchor) == null);
|
||||||
findViewById(R.id.sw600dp_port_anchor) == null);
|
|
||||||
|
|
||||||
GlobalState.getInstance().load(savedInstanceState);
|
GlobalState.getInstance().load(savedInstanceState);
|
||||||
|
|
||||||
m_drawerLayout = (DrawerLayout) findViewById(R.id.headlines_drawer);
|
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) {
|
public void onFeedSelected(final int feedId, final boolean isCat, boolean open) {
|
||||||
|
|
||||||
if (open) {
|
if (open) {
|
||||||
if (!isSmallScreen()) {
|
|
||||||
LinearLayout container = (LinearLayout) findViewById(R.id.fragment_container);
|
|
||||||
if (container != null) {
|
|
||||||
container.setWeightSum(3f);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
new Handler().postDelayed(new Runnable() {
|
new Handler().postDelayed(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:baselineAligned="false"
|
android:baselineAligned="false"
|
||||||
android:weightSum="1.1"
|
android:weightSum="3"
|
||||||
android:orientation="horizontal" >
|
android:orientation="horizontal" >
|
||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
|
@ -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>
|
|
Loading…
Reference in New Issue
Block a user