diff --git a/src/org/fox/ttrss/Article.java b/src/org/fox/ttrss/Article.java index 1439416d..d6683f96 100644 --- a/src/org/fox/ttrss/Article.java +++ b/src/org/fox/ttrss/Article.java @@ -56,6 +56,7 @@ public class Article implements Parcelable { content = in.readString(); } + @SuppressWarnings("rawtypes") public static final Parcelable.Creator CREATOR = new Parcelable.Creator() { public Article createFromParcel(Parcel in) { diff --git a/src/org/fox/ttrss/ArticleFragment.java b/src/org/fox/ttrss/ArticleFragment.java index 205cfa5d..7297daa1 100644 --- a/src/org/fox/ttrss/ArticleFragment.java +++ b/src/org/fox/ttrss/ArticleFragment.java @@ -1,7 +1,5 @@ package org.fox.ttrss; -import java.io.UnsupportedEncodingException; -import java.net.URLEncoder; import java.text.SimpleDateFormat; import java.util.Date; @@ -19,6 +17,7 @@ import android.webkit.WebView; import android.widget.TextView; public class ArticleFragment extends Fragment { + @SuppressWarnings("unused") private final String TAG = this.getClass().getSimpleName(); private SharedPreferences m_prefs; diff --git a/src/org/fox/ttrss/ArticleList.java b/src/org/fox/ttrss/ArticleList.java index d09642c9..77024c74 100644 --- a/src/org/fox/ttrss/ArticleList.java +++ b/src/org/fox/ttrss/ArticleList.java @@ -5,6 +5,7 @@ import java.util.ArrayList; import android.os.Parcel; import android.os.Parcelable; +@SuppressWarnings("serial") public class ArticleList extends ArrayList
implements Parcelable { @Override public int describeContents() { @@ -34,6 +35,7 @@ public class ArticleList extends ArrayList
implements Parcelable { readFromParcel(in); } + @SuppressWarnings("rawtypes") public static final Parcelable.Creator CREATOR = new Parcelable.Creator() { public ArticleList createFromParcel(Parcel in) { diff --git a/src/org/fox/ttrss/DatabaseHelper.java b/src/org/fox/ttrss/DatabaseHelper.java deleted file mode 100644 index 2b0a1f70..00000000 --- a/src/org/fox/ttrss/DatabaseHelper.java +++ /dev/null @@ -1,62 +0,0 @@ -package org.fox.ttrss; -import android.content.Context; -import android.database.sqlite.SQLiteDatabase; -import android.database.sqlite.SQLiteOpenHelper; -import android.provider.BaseColumns; - - -public class DatabaseHelper extends SQLiteOpenHelper { - - private final String TAG = this.getClass().getSimpleName(); - public static final String DATABASE_NAME = "LocalStorage"; - public static final int DATABASE_VERSION = 7; - - public DatabaseHelper(Context context) { - super(context, DATABASE_NAME, null, DATABASE_VERSION); - } - - @Override - public void onCreate(SQLiteDatabase db) { - db.execSQL("DROP TABLE IF EXISTS feeds;"); - db.execSQL("DROP TABLE IF EXISTS articles;"); - db.execSQL("DROP VIEW IF EXISTS feeds_unread;"); - - db.execSQL("CREATE TABLE IF NOT EXISTS feeds (" + - BaseColumns._ID + " INTEGER PRIMARY KEY AUTOINCREMENT," + - "feed_url TEXT, " + - "title TEXT, " + - "unread INTEGER, " + - "has_icon BOOLEAN, " + - "cat_id INTEGER, " + - "last_updated INTEGER, " + - "count INTEGER" + - ");"); - - db.execSQL("CREATE TABLE IF NOT EXISTS articles (" + - BaseColumns._ID + " INTEGER PRIMARY KEY AUTOINCREMENT," + - "unread BOOLEAN, " + - "marked BOOLEAN, " + - "published BOOLEAN, " + - "updated INTEGER, " + - "is_updated BOOLEAN, " + - "title TEXT, " + - "link TEXT, " + - "feed_id INTEGER, " + - "tags TEXT, " + - "content TEXT, " + - "excerpt TEXT" + - ");"); - - db.execSQL("CREATE VIEW feeds_unread AS SELECT feeds."+BaseColumns._ID+" AS "+BaseColumns._ID+", " + - "feeds.title AS title, " + - "SUM(articles.unread) AS unread FROM feeds " + - "LEFT JOIN articles ON (articles.feed_id = feeds."+BaseColumns._ID+") " + - "GROUP BY feeds."+BaseColumns._ID+", feeds.title;"); - } - - @Override - public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { - onCreate(db); - } - -} diff --git a/src/org/fox/ttrss/Feed.java b/src/org/fox/ttrss/Feed.java index 75131938..de1e8602 100644 --- a/src/org/fox/ttrss/Feed.java +++ b/src/org/fox/ttrss/Feed.java @@ -50,6 +50,7 @@ public class Feed implements Comparable, Parcelable { last_updated = in.readInt(); } + @SuppressWarnings("rawtypes") public static final Parcelable.Creator CREATOR = new Parcelable.Creator() { public Feed createFromParcel(Parcel in) { diff --git a/src/org/fox/ttrss/FeedList.java b/src/org/fox/ttrss/FeedList.java index 035edf57..c54ef780 100644 --- a/src/org/fox/ttrss/FeedList.java +++ b/src/org/fox/ttrss/FeedList.java @@ -5,6 +5,7 @@ import java.util.ArrayList; import android.os.Parcel; import android.os.Parcelable; +@SuppressWarnings("serial") public class FeedList extends ArrayList implements Parcelable { public FeedList() { } @@ -36,6 +37,7 @@ public class FeedList extends ArrayList implements Parcelable { readFromParcel(in); } + @SuppressWarnings("rawtypes") public static final Parcelable.Creator CREATOR = new Parcelable.Creator() { public FeedList createFromParcel(Parcel in) { diff --git a/src/org/fox/ttrss/FeedsFragment.java b/src/org/fox/ttrss/FeedsFragment.java index a8278125..fbba2fce 100644 --- a/src/org/fox/ttrss/FeedsFragment.java +++ b/src/org/fox/ttrss/FeedsFragment.java @@ -29,6 +29,7 @@ import com.google.gson.JsonObject; import com.google.gson.reflect.TypeToken; public class FeedsFragment extends Fragment implements OnItemClickListener { + @SuppressWarnings("unused") private final String TAG = this.getClass().getSimpleName(); private SharedPreferences m_prefs; private FeedListAdapter m_adapter; @@ -62,17 +63,6 @@ public class FeedsFragment extends Fragment implements OnItemClickListener { } - /* public void showLoading(boolean show) { - View v = getView(); - - if (v != null) { - v = v.findViewById(R.id.loading_container); - - if (v != null) - v.setVisibility(show ? View.VISIBLE : View.GONE); - } - } */ - @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { @@ -129,6 +119,7 @@ public class FeedsFragment extends Fragment implements OnItemClickListener { } } + @SuppressWarnings({ "unchecked", "serial" }) public void refresh(boolean background) { FeedsRequest req = new FeedsRequest(getActivity().getApplicationContext()); diff --git a/src/org/fox/ttrss/HeadlinesFragment.java b/src/org/fox/ttrss/HeadlinesFragment.java index ec8216fd..ba53b3a4 100644 --- a/src/org/fox/ttrss/HeadlinesFragment.java +++ b/src/org/fox/ttrss/HeadlinesFragment.java @@ -13,11 +13,7 @@ import org.jsoup.Jsoup; import android.app.Activity; 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.text.Html; import android.util.Log; @@ -43,7 +39,6 @@ import com.google.gson.reflect.TypeToken; public class HeadlinesFragment extends Fragment implements OnItemClickListener { private final String TAG = this.getClass().getSimpleName(); - private SharedPreferences m_prefs; private Feed m_feed; private int m_activeArticleId; @@ -85,21 +80,9 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener { return view; } - /* public void showLoading(boolean show) { - View v = getView(); - - if (v != null) { - v = v.findViewById(R.id.loading_container); - - if (v != null) - v.setVisibility(show ? View.VISIBLE : View.GONE); - } - } */ - @Override public void onAttach(Activity activity) { super.onAttach(activity); - m_prefs = PreferenceManager.getDefaultSharedPreferences(getActivity().getApplicationContext()); m_feed = ((MainActivity)activity).getActiveFeed(); m_articleOps = (ArticleOps) activity; } @@ -122,12 +105,10 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener { } } + @SuppressWarnings({ "unchecked", "serial" }) public void refresh(boolean append) { HeadlinesRequest req = new HeadlinesRequest(getActivity().getApplicationContext()); - //req.setApi(m_prefs.getString("ttrss_url", null)); - //req.setTrustAny(m_prefs.getBoolean("ssl_trust_any", false)); - final String sessionId = ((MainActivity)getActivity()).getSessionId(); final boolean showUnread = ((MainActivity)getActivity()).getUnreadArticlesOnly(); int skip = 0; diff --git a/src/org/fox/ttrss/MainActivity.java b/src/org/fox/ttrss/MainActivity.java index 0d0fcb99..10eabc28 100644 --- a/src/org/fox/ttrss/MainActivity.java +++ b/src/org/fox/ttrss/MainActivity.java @@ -50,6 +50,7 @@ public class MainActivity extends FragmentActivity implements FeedsFragment.OnFe } } + @SuppressWarnings({ "unchecked", "serial" }) public void saveArticleUnread(final Article article) { ApiRequest req = new ApiRequest(getApplicationContext()); @@ -66,6 +67,7 @@ public class MainActivity extends FragmentActivity implements FeedsFragment.OnFe req.execute(map); } + @SuppressWarnings({ "unchecked", "serial" }) public void saveArticleMarked(final Article article) { ApiRequest req = new ApiRequest(getApplicationContext()); @@ -82,6 +84,7 @@ public class MainActivity extends FragmentActivity implements FeedsFragment.OnFe req.execute(map); } + @SuppressWarnings({ "unchecked", "serial" }) public void saveArticlePublished(final Article article) { ApiRequest req = new ApiRequest(getApplicationContext()); @@ -684,6 +687,7 @@ public class MainActivity extends FragmentActivity implements FeedsFragment.OnFe initMainMenu(); } + @SuppressWarnings({ "unchecked", "serial" }) public void login() { logout(); @@ -697,8 +701,6 @@ public class MainActivity extends FragmentActivity implements FeedsFragment.OnFe } else { LoginRequest ar = new LoginRequest(getApplicationContext()); - //ar.setApi(m_prefs.getString("ttrss_url", null)); - //ar.setTrustAny(m_prefs.getBoolean("ssl_trust_any", false)); HashMap map = new HashMap() { {