compatibility fixes for ICS (galaxy nexus)
This commit is contained in:
parent
87e736462a
commit
70da910846
@ -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,45 +12,37 @@
|
||||
<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"
|
||||
android:layout_height="match_parent" >
|
||||
</FrameLayout>
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/feeds_fragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" >
|
||||
</FrameLayout>
|
||||
<FrameLayout
|
||||
android:id="@+id/cats_fragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" >
|
||||
</FrameLayout>
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/cats_fragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" >
|
||||
</FrameLayout>
|
||||
<FrameLayout
|
||||
android:id="@+id/headlines_fragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" >
|
||||
</FrameLayout>
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/headlines_fragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" >
|
||||
</FrameLayout>
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/article_fragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" >
|
||||
</FrameLayout>
|
||||
</LinearLayout>
|
||||
<FrameLayout
|
||||
android:id="@+id/article_fragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" >
|
||||
</FrameLayout>
|
||||
|
||||
</FrameLayout>
|
@ -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;
|
||||
@ -473,12 +474,14 @@ public class MainActivity extends FragmentActivity implements OnlineServices {
|
||||
|
||||
int width = display.getWidth();
|
||||
int height = display.getHeight();
|
||||
|
||||
Log.d(TAG, "WxH=" + width + "x" + height);
|
||||
|
||||
if (height > width) {
|
||||
/* 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);
|
||||
@ -537,10 +535,11 @@ public class MainActivity extends FragmentActivity implements OnlineServices {
|
||||
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.article_fragment).setVisibility(View.GONE);
|
||||
} else {
|
||||
//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 {
|
||||
|
@ -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,12 +125,14 @@ 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);
|
||||
|
||||
setContentView(R.layout.main);
|
||||
@ -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);
|
||||
|
||||
/*
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user