compatibility fixes for ICS (galaxy nexus)

This commit is contained in:
Andrew Dolgov 2012-01-17 12:54:52 +03:00
parent 87e736462a
commit 70da910846
4 changed files with 46 additions and 49 deletions

View File

@ -1,5 +1,5 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/main_flipper"
android:id="@+id/main"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
@ -12,22 +12,15 @@
<ProgressBar
android:id="@+id/loading_progress"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
</ProgressBar>
android:layout_height="wrap_content" />
<TextView
android:id="@+id/loading_message"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/loading_message" >
</TextView>
android:text="@string/loading_message" />
</LinearLayout>
<LinearLayout
android:id="@+id/main"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<FrameLayout
android:id="@+id/feeds_fragment"
android:layout_width="match_parent"
@ -51,6 +44,5 @@
android:layout_width="match_parent"
android:layout_height="match_parent" >
</FrameLayout>
</LinearLayout>
</FrameLayout>

View File

@ -38,6 +38,7 @@ import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.AnimationUtils;
import android.widget.AdapterView.AdapterContextMenuInfo;
import android.widget.LinearLayout;
@ -474,11 +475,13 @@ public class MainActivity extends FragmentActivity implements OnlineServices {
int width = display.getWidth();
int height = display.getHeight();
if (height > width) {
Log.d(TAG, "WxH=" + width + "x" + height);
/* if (height > width) {
int tmp = width;
width = height;
height = tmp;
}
} */
m_smallScreenMode = m_compatMode || (width < 960 || height < 720);
@ -500,8 +503,7 @@ public class MainActivity extends FragmentActivity implements OnlineServices {
Log.d(TAG, "m_compatMode=" + m_compatMode);
if (!m_compatMode) {
new TransitionHelper((LinearLayout) findViewById(R.id.main));
new TransitionHelper((ViewGroup) findViewById(R.id.main));
m_headlinesActionModeCallback = new HeadlinesActionModeCallback();
}
@ -522,10 +524,6 @@ public class MainActivity extends FragmentActivity implements OnlineServices {
}
}
if (!m_compatMode && !m_smallScreenMode) {
// getActionBar().setDisplayHomeAsUpEnabled(true); TODO
}
if (m_smallScreenMode) {
if (m_selectedArticle != null) {
findViewById(R.id.feeds_fragment).setVisibility(View.GONE);
@ -538,9 +536,10 @@ public class MainActivity extends FragmentActivity implements OnlineServices {
.setVisibility(View.GONE);
findViewById(R.id.cats_fragment).setVisibility(View.GONE);
} else {
findViewById(R.id.headlines_fragment).setVisibility(
View.GONE);
// findViewById(R.id.article_fragment).setVisibility(View.GONE);
//findViewById(R.id.headlines_fragment).setVisibility(
// View.GONE);
//findViewById(R.id.article_fragment).setVisibility(View.GONE);
if (m_enableCats && m_activeCategory == null) {
findViewById(R.id.feeds_fragment).setVisibility(
@ -550,6 +549,8 @@ public class MainActivity extends FragmentActivity implements OnlineServices {
} else {
findViewById(R.id.cats_fragment).setVisibility(
View.GONE);
//findViewById(R.id.feeds_fragment).setVisibility(
// View.VISIBLE);
}
}
} else {

View File

@ -26,6 +26,7 @@ import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.AnimationUtils;
import android.widget.AdapterView.AdapterContextMenuInfo;
import android.widget.LinearLayout;
@ -124,11 +125,13 @@ public class OfflineActivity extends FragmentActivity implements
int width = display.getWidth();
int height = display.getHeight();
if (height > width) {
Log.d(TAG, "WxH=" + width + "x" + height);
/* if (height > width) {
int tmp = width;
width = height;
height = tmp;
}
} */
m_smallScreenMode = m_compatMode || (width < 960 || height < 720);
@ -138,7 +141,7 @@ public class OfflineActivity extends FragmentActivity implements
Log.d(TAG, "m_compatMode=" + m_compatMode);
if (!m_compatMode) {
new TransitionHelper((LinearLayout) findViewById(R.id.main));
new TransitionHelper((ViewGroup) findViewById(R.id.main));
m_headlinesActionModeCallback = new HeadlinesActionModeCallback();
}
@ -158,7 +161,7 @@ public class OfflineActivity extends FragmentActivity implements
findViewById(R.id.article_fragment).setVisibility(View.GONE);
findViewById(R.id.cats_fragment).setVisibility(View.GONE);
} else {
findViewById(R.id.headlines_fragment).setVisibility(View.GONE);
//findViewById(R.id.headlines_fragment).setVisibility(View.GONE);
// findViewById(R.id.article_fragment).setVisibility(View.GONE);
/*

View File

@ -1,10 +1,11 @@
package org.fox.ttrss;
import android.animation.LayoutTransition;
import android.view.ViewGroup;
import android.widget.LinearLayout;
public class TransitionHelper {
public TransitionHelper(LinearLayout layout) {
public TransitionHelper(ViewGroup layout) {
LayoutTransition transitioner = new LayoutTransition();
layout.setLayoutTransition(transitioner);
}