notify to configure application when needed

rebuild with ACP
update ADT
This commit is contained in:
Andrew Dolgov 2011-11-25 21:37:02 +03:00
parent e7a78d9a7a
commit a0753dd5df
8 changed files with 43 additions and 32 deletions

View File

@ -5,5 +5,6 @@
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
<classpathentry kind="lib" path="lib/gson-1.7.1.jar"/>
<classpathentry kind="lib" path="lib/jsoup-1.6.1.jar"/>
<classpathentry kind="lib" path="libs/android-support-v4.jar"/>
<classpathentry kind="output" path="bin/classes"/>
</classpath>

View File

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.fox.ttrss"
android:versionCode="1"
android:versionName="0.1">
<uses-sdk android:minSdkVersion="11" />
android:versionCode="2"
android:versionName="0.1.1">
<uses-sdk android:minSdkVersion="10" />
<supports-screens android:smallScreens="false" android:normalScreens="false" />
<uses-permission android:name="android.permission.INTERNET" />

2
default.properties Normal file
View File

@ -0,0 +1,2 @@
# Project target.
target=android-10

BIN
libs/android-support-v4.jar Normal file

Binary file not shown.

View File

@ -6,10 +6,10 @@ import java.text.SimpleDateFormat;
import java.util.Date;
import android.app.Activity;
import android.app.Fragment;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.support.v4.app.Fragment;
import android.text.Html;
import android.text.method.LinkMovementMethod;
import android.view.LayoutInflater;

View File

@ -7,14 +7,13 @@ import java.util.HashMap;
import java.util.List;
import android.app.Activity;
import android.app.Fragment;
import android.content.Context;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.os.Parcel;
import android.os.Parcelable;
import android.preference.PreferenceManager;
import android.util.Log;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

View File

@ -12,13 +12,13 @@ import java.util.TimeZone;
import org.jsoup.Jsoup;
import android.app.Activity;
import android.app.Fragment;
import android.content.Context;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.os.Parcel;
import android.os.Parcelable;
import android.preference.PreferenceManager;
import android.support.v4.app.Fragment;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;

View File

@ -5,13 +5,12 @@ import java.util.Timer;
import java.util.TimerTask;
import android.animation.LayoutTransition;
import android.app.Activity;
import android.app.FragmentTransaction;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.text.method.HideReturnsTransformationMethod;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentTransaction;
import android.util.Log;
import android.view.KeyEvent;
import android.view.Menu;
@ -20,12 +19,11 @@ import android.view.MenuItem;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
public class MainActivity extends Activity implements FeedsFragment.OnFeedSelectedListener, HeadlinesFragment.OnArticleSelectedListener {
public class MainActivity extends FragmentActivity implements FeedsFragment.OnFeedSelectedListener, HeadlinesFragment.OnArticleSelectedListener {
private final String TAG = this.getClass().getSimpleName();
private SharedPreferences m_prefs;
@ -47,7 +45,7 @@ public class MainActivity extends Activity implements FeedsFragment.OnFeedSelect
}
public synchronized void refreshFeeds() {
FeedsFragment frag = (FeedsFragment) getFragmentManager().findFragmentById(R.id.feeds_fragment);
FeedsFragment frag = (FeedsFragment) getSupportFragmentManager().findFragmentById(R.id.feeds_fragment);
Log.d(TAG, "Refreshing feeds..." + frag);
@ -96,9 +94,11 @@ public class MainActivity extends Activity implements FeedsFragment.OnFeedSelect
setContentView(R.layout.main);
LayoutTransition transitioner = new LayoutTransition();
LinearLayout layout = (LinearLayout)findViewById(R.id.main);
layout.setLayoutTransition(transitioner);
if (android.os.Build.VERSION.SDK_INT > 10) {
LayoutTransition transitioner = new LayoutTransition();
LinearLayout layout = (LinearLayout)findViewById(R.id.main);
layout.setLayoutTransition(transitioner);
}
if (m_selectedArticle == null)
findViewById(R.id.article_fragment).setVisibility(View.GONE);
@ -334,7 +334,7 @@ public class MainActivity extends Activity implements FeedsFragment.OnFeedSelect
FeedsFragment frag = new FeedsFragment();
FragmentTransaction ft = getFragmentManager().beginTransaction();
FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
ft.replace(R.id.feeds_fragment, frag);
ft.commit();
@ -382,7 +382,7 @@ public class MainActivity extends Activity implements FeedsFragment.OnFeedSelect
HeadlinesFragment hf = new HeadlinesFragment();
FragmentTransaction ft = getFragmentManager().beginTransaction();
FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
ft.replace(R.id.headlines_fragment, hf);
ft.commit();
}
@ -394,7 +394,7 @@ public class MainActivity extends Activity implements FeedsFragment.OnFeedSelect
ArticleFragment frag = new ArticleFragment();
FragmentTransaction ft = getFragmentManager().beginTransaction();
FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
ft.replace(R.id.article_fragment, frag);
ft.commit();
@ -443,19 +443,28 @@ public class MainActivity extends Activity implements FeedsFragment.OnFeedSelect
logout();
LoginRequest ar = new LoginRequest();
ar.setApi(m_prefs.getString("ttrss_url", null));
if (m_prefs.getString("ttrss_url", null) == null ||
m_prefs.getString("login", null) == null ||
m_prefs.getString("password", null) == null) {
HashMap<String,String> map = new HashMap<String,String>() {
{
put("op", "login");
put("user", m_prefs.getString("login", null));
put("password", m_prefs.getString("password", null));
}
};
setLoadingStatus(R.string.login_need_configure, false);
ar.execute(map);
} else {
setLoadingStatus(R.string.login_in_progress, true);
LoginRequest ar = new LoginRequest();
ar.setApi(m_prefs.getString("ttrss_url", null));
HashMap<String,String> map = new HashMap<String,String>() {
{
put("op", "login");
put("user", m_prefs.getString("login", null));
put("password", m_prefs.getString("password", null));
}
};
ar.execute(map);
setLoadingStatus(R.string.login_in_progress, true);
}
}
}