fix compatibility with cupcake, fix selection menu being displayed

when logged out
This commit is contained in:
Andrew Dolgov 2011-12-03 17:22:06 +03:00
parent fcbdbf90b5
commit eae76193b4
3 changed files with 14 additions and 64 deletions

View File

@ -3,7 +3,7 @@
package="org.fox.ttrss" package="org.fox.ttrss"
android:versionCode="29" android:versionCode="29"
android:versionName="0.1.28"> android:versionName="0.1.28">
<uses-sdk android:minSdkVersion="7" /> <uses-sdk android:minSdkVersion="4" />
<uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

View File

@ -4,7 +4,6 @@ import java.util.HashMap;
import java.util.Timer; import java.util.Timer;
import java.util.TimerTask; import java.util.TimerTask;
import android.animation.LayoutTransition;
import android.app.AlertDialog; import android.app.AlertDialog;
import android.app.Dialog; import android.app.Dialog;
import android.content.Context; import android.content.Context;
@ -26,9 +25,7 @@ import android.view.MenuItem;
import android.view.View; import android.view.View;
import android.view.animation.AnimationUtils; import android.view.animation.AnimationUtils;
import android.widget.AdapterView.AdapterContextMenuInfo; import android.widget.AdapterView.AdapterContextMenuInfo;
import android.widget.ArrayAdapter;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.TextView; import android.widget.TextView;
import com.google.gson.JsonElement; import com.google.gson.JsonElement;
@ -324,9 +321,7 @@ public class MainActivity extends FragmentActivity implements FeedsFragment.OnFe
Log.d(TAG, "m_compatMode=" + m_compatMode); Log.d(TAG, "m_compatMode=" + m_compatMode);
if (!m_compatMode) { if (!m_compatMode) {
LayoutTransition transitioner = new LayoutTransition(); new TransitionHelper((LinearLayout)findViewById(R.id.main));
LinearLayout layout = (LinearLayout)findViewById(R.id.main);
layout.setLayoutTransition(transitioner);
} }
if (m_smallScreenMode) { if (m_smallScreenMode) {
@ -829,65 +824,9 @@ public class MainActivity extends FragmentActivity implements FeedsFragment.OnFe
m_menu.setGroupVisible(R.id.menu_group_feeds, false); m_menu.setGroupVisible(R.id.menu_group_feeds, false);
m_menu.setGroupVisible(R.id.menu_group_headlines, false); m_menu.setGroupVisible(R.id.menu_group_headlines, false);
m_menu.setGroupVisible(R.id.menu_group_article, false); m_menu.setGroupVisible(R.id.menu_group_article, false);
m_menu.setGroupVisible(R.id.menu_group_headlines_selection, false);
m_menu.setGroupVisible(R.id.menu_group_logged_out, true); m_menu.setGroupVisible(R.id.menu_group_logged_out, true);
} }
/* if (m_sessionId != null) {
m_menu.findItem(R.id.login).setVisible(false);
m_menu.findItem(R.id.logout).setVisible(m_activeFeed == null && m_selectedArticle == null);
if (m_selectedArticle != null) {
m_menu.findItem(R.id.close_article).setVisible(true);
m_menu.findItem(R.id.share_article).setVisible(true);
m_menu.findItem(R.id.toggle_marked).setVisible(true);
m_menu.findItem(R.id.toggle_published).setVisible(true);
m_menu.findItem(R.id.set_unread).setVisible(true);
m_menu.findItem(R.id.update_feeds).setVisible(false);
m_menu.findItem(R.id.show_feeds).setVisible(false);
m_menu.findItem(R.id.back_to_categories).setVisible(false);
} else {
m_menu.findItem(R.id.close_article).setVisible(false);
m_menu.findItem(R.id.share_article).setVisible(false);
m_menu.findItem(R.id.toggle_marked).setVisible(false);
m_menu.findItem(R.id.toggle_published).setVisible(false);
m_menu.findItem(R.id.set_unread).setVisible(false);
if (!m_smallScreenMode || m_activeFeed == null) {
m_menu.findItem(R.id.show_feeds).setVisible(true);
m_menu.findItem(R.id.update_feeds).setVisible(true);
} else {
m_menu.findItem(R.id.show_feeds).setVisible(false);
m_menu.findItem(R.id.update_feeds).setVisible(false);
}
m_menu.findItem(R.id.back_to_categories).setVisible(m_activeCategory != null);
}
if (!m_smallScreenMode) {
m_menu.findItem(R.id.load_more_articles).setVisible(m_activeFeed != null && m_canLoadMore);
m_menu.findItem(R.id.show_all_articles).setVisible(m_activeFeed != null);
} else {
m_menu.findItem(R.id.load_more_articles).setVisible(m_activeFeed != null && m_selectedArticle == null && m_canLoadMore &&
(!m_enableCats || m_activeCategory != null));
m_menu.findItem(R.id.show_all_articles).setVisible(m_activeFeed != null && m_selectedArticle == null);
}
} else {
m_menu.findItem(R.id.login).setVisible(true);
m_menu.findItem(R.id.logout).setVisible(false);
m_menu.findItem(R.id.close_article).setVisible(false);
m_menu.findItem(R.id.share_article).setVisible(false);
m_menu.findItem(R.id.load_more_articles).setVisible(false);
m_menu.findItem(R.id.back_to_categories).setVisible(false);
m_menu.findItem(R.id.update_feeds).setVisible(false);
m_menu.findItem(R.id.show_feeds).setVisible(false);
} */
} }
} }

View File

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