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"
|
<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_width="fill_parent"
|
||||||
android:layout_height="fill_parent" >
|
android:layout_height="fill_parent" >
|
||||||
|
|
||||||
@ -12,22 +12,15 @@
|
|||||||
<ProgressBar
|
<ProgressBar
|
||||||
android:id="@+id/loading_progress"
|
android:id="@+id/loading_progress"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content" >
|
android:layout_height="wrap_content" />
|
||||||
</ProgressBar>
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/loading_message"
|
android:id="@+id/loading_message"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/loading_message" >
|
android:text="@string/loading_message" />
|
||||||
</TextView>
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/main"
|
|
||||||
android:layout_width="fill_parent"
|
|
||||||
android:layout_height="fill_parent" >
|
|
||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
android:id="@+id/feeds_fragment"
|
android:id="@+id/feeds_fragment"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@ -51,6 +44,5 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent" >
|
android:layout_height="match_parent" >
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
</FrameLayout>
|
</FrameLayout>
|
@ -38,6 +38,7 @@ import android.view.Menu;
|
|||||||
import android.view.MenuInflater;
|
import android.view.MenuInflater;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
import android.view.animation.AnimationUtils;
|
import android.view.animation.AnimationUtils;
|
||||||
import android.widget.AdapterView.AdapterContextMenuInfo;
|
import android.widget.AdapterView.AdapterContextMenuInfo;
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
@ -474,11 +475,13 @@ public class MainActivity extends FragmentActivity implements OnlineServices {
|
|||||||
int width = display.getWidth();
|
int width = display.getWidth();
|
||||||
int height = display.getHeight();
|
int height = display.getHeight();
|
||||||
|
|
||||||
if (height > width) {
|
Log.d(TAG, "WxH=" + width + "x" + height);
|
||||||
|
|
||||||
|
/* if (height > width) {
|
||||||
int tmp = width;
|
int tmp = width;
|
||||||
width = height;
|
width = height;
|
||||||
height = tmp;
|
height = tmp;
|
||||||
}
|
} */
|
||||||
|
|
||||||
m_smallScreenMode = m_compatMode || (width < 960 || height < 720);
|
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);
|
Log.d(TAG, "m_compatMode=" + m_compatMode);
|
||||||
|
|
||||||
if (!m_compatMode) {
|
if (!m_compatMode) {
|
||||||
new TransitionHelper((LinearLayout) findViewById(R.id.main));
|
new TransitionHelper((ViewGroup) findViewById(R.id.main));
|
||||||
|
|
||||||
m_headlinesActionModeCallback = new HeadlinesActionModeCallback();
|
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_smallScreenMode) {
|
||||||
if (m_selectedArticle != null) {
|
if (m_selectedArticle != null) {
|
||||||
findViewById(R.id.feeds_fragment).setVisibility(View.GONE);
|
findViewById(R.id.feeds_fragment).setVisibility(View.GONE);
|
||||||
@ -538,9 +536,10 @@ public class MainActivity extends FragmentActivity implements OnlineServices {
|
|||||||
.setVisibility(View.GONE);
|
.setVisibility(View.GONE);
|
||||||
findViewById(R.id.cats_fragment).setVisibility(View.GONE);
|
findViewById(R.id.cats_fragment).setVisibility(View.GONE);
|
||||||
} else {
|
} else {
|
||||||
findViewById(R.id.headlines_fragment).setVisibility(
|
//findViewById(R.id.headlines_fragment).setVisibility(
|
||||||
View.GONE);
|
// View.GONE);
|
||||||
// findViewById(R.id.article_fragment).setVisibility(View.GONE);
|
|
||||||
|
//findViewById(R.id.article_fragment).setVisibility(View.GONE);
|
||||||
|
|
||||||
if (m_enableCats && m_activeCategory == null) {
|
if (m_enableCats && m_activeCategory == null) {
|
||||||
findViewById(R.id.feeds_fragment).setVisibility(
|
findViewById(R.id.feeds_fragment).setVisibility(
|
||||||
@ -550,6 +549,8 @@ public class MainActivity extends FragmentActivity implements OnlineServices {
|
|||||||
} else {
|
} else {
|
||||||
findViewById(R.id.cats_fragment).setVisibility(
|
findViewById(R.id.cats_fragment).setVisibility(
|
||||||
View.GONE);
|
View.GONE);
|
||||||
|
//findViewById(R.id.feeds_fragment).setVisibility(
|
||||||
|
// View.VISIBLE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -26,6 +26,7 @@ import android.view.Menu;
|
|||||||
import android.view.MenuInflater;
|
import android.view.MenuInflater;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
import android.view.animation.AnimationUtils;
|
import android.view.animation.AnimationUtils;
|
||||||
import android.widget.AdapterView.AdapterContextMenuInfo;
|
import android.widget.AdapterView.AdapterContextMenuInfo;
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
@ -124,11 +125,13 @@ public class OfflineActivity extends FragmentActivity implements
|
|||||||
int width = display.getWidth();
|
int width = display.getWidth();
|
||||||
int height = display.getHeight();
|
int height = display.getHeight();
|
||||||
|
|
||||||
if (height > width) {
|
Log.d(TAG, "WxH=" + width + "x" + height);
|
||||||
|
|
||||||
|
/* if (height > width) {
|
||||||
int tmp = width;
|
int tmp = width;
|
||||||
width = height;
|
width = height;
|
||||||
height = tmp;
|
height = tmp;
|
||||||
}
|
} */
|
||||||
|
|
||||||
m_smallScreenMode = m_compatMode || (width < 960 || height < 720);
|
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);
|
Log.d(TAG, "m_compatMode=" + m_compatMode);
|
||||||
|
|
||||||
if (!m_compatMode) {
|
if (!m_compatMode) {
|
||||||
new TransitionHelper((LinearLayout) findViewById(R.id.main));
|
new TransitionHelper((ViewGroup) findViewById(R.id.main));
|
||||||
|
|
||||||
m_headlinesActionModeCallback = new HeadlinesActionModeCallback();
|
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.article_fragment).setVisibility(View.GONE);
|
||||||
findViewById(R.id.cats_fragment).setVisibility(View.GONE);
|
findViewById(R.id.cats_fragment).setVisibility(View.GONE);
|
||||||
} else {
|
} 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);
|
// findViewById(R.id.article_fragment).setVisibility(View.GONE);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -1,10 +1,11 @@
|
|||||||
package org.fox.ttrss;
|
package org.fox.ttrss;
|
||||||
|
|
||||||
import android.animation.LayoutTransition;
|
import android.animation.LayoutTransition;
|
||||||
|
import android.view.ViewGroup;
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
|
|
||||||
public class TransitionHelper {
|
public class TransitionHelper {
|
||||||
public TransitionHelper(LinearLayout layout) {
|
public TransitionHelper(ViewGroup layout) {
|
||||||
LayoutTransition transitioner = new LayoutTransition();
|
LayoutTransition transitioner = new LayoutTransition();
|
||||||
layout.setLayoutTransition(transitioner);
|
layout.setLayoutTransition(transitioner);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user