various lint-related stuff
This commit is contained in:
parent
9fb03a43f1
commit
797dbe2080
@ -25,6 +25,7 @@
|
|||||||
android:id="@+id/fragment_container"
|
android:id="@+id/fragment_container"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
android:baselineAligned="false"
|
||||||
android:orientation="horizontal" >
|
android:orientation="horizontal" >
|
||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
android:id="@+id/fragment_container"
|
android:id="@+id/fragment_container"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
android:baselineAligned="false"
|
||||||
android:orientation="horizontal" >
|
android:orientation="horizontal" >
|
||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
|
@ -286,6 +286,7 @@ public class ApiRequest extends AsyncTask<HashMap<String,String>, Integer, JsonE
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
private static void disableConnectionReuseIfNecessary() {
|
private static void disableConnectionReuseIfNecessary() {
|
||||||
// HTTP connection reuse which was buggy pre-froyo
|
// HTTP connection reuse which was buggy pre-froyo
|
||||||
if (Integer.parseInt(Build.VERSION.SDK) < Build.VERSION_CODES.FROYO) {
|
if (Integer.parseInt(Build.VERSION.SDK) < Build.VERSION_CODES.FROYO) {
|
||||||
|
@ -39,10 +39,8 @@ import android.widget.ArrayAdapter;
|
|||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
import android.widget.Spinner;
|
import android.widget.Spinner;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.widget.AdapterView.AdapterContextMenuInfo;
|
|
||||||
|
|
||||||
public class ArticleFragment extends Fragment {
|
public class ArticleFragment extends Fragment {
|
||||||
@SuppressWarnings("unused")
|
|
||||||
private final String TAG = this.getClass().getSimpleName();
|
private final String TAG = this.getClass().getSimpleName();
|
||||||
|
|
||||||
private SharedPreferences m_prefs;
|
private SharedPreferences m_prefs;
|
||||||
@ -65,8 +63,8 @@ public class ArticleFragment extends Fragment {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onContextItemSelected(MenuItem item) {
|
public boolean onContextItemSelected(MenuItem item) {
|
||||||
AdapterContextMenuInfo info = (AdapterContextMenuInfo) item
|
/* AdapterContextMenuInfo info = (AdapterContextMenuInfo) item
|
||||||
.getMenuInfo();
|
.getMenuInfo(); */
|
||||||
|
|
||||||
switch (item.getItemId()) {
|
switch (item.getItemId()) {
|
||||||
case R.id.article_link_share:
|
case R.id.article_link_share:
|
||||||
|
@ -2,7 +2,6 @@ package org.fox.ttrss;
|
|||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
||||||
import org.fox.ttrss.ApiRequest.ApiError;
|
|
||||||
import org.fox.ttrss.types.Article;
|
import org.fox.ttrss.types.Article;
|
||||||
import org.fox.ttrss.types.ArticleList;
|
import org.fox.ttrss.types.ArticleList;
|
||||||
import org.fox.ttrss.types.Feed;
|
import org.fox.ttrss.types.Feed;
|
||||||
|
@ -2,6 +2,7 @@ package org.fox.ttrss;
|
|||||||
|
|
||||||
import org.fox.ttrss.util.DatabaseHelper;
|
import org.fox.ttrss.util.DatabaseHelper;
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint;
|
||||||
import android.database.sqlite.SQLiteDatabase;
|
import android.database.sqlite.SQLiteDatabase;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.support.v4.app.FragmentActivity;
|
import android.support.v4.app.FragmentActivity;
|
||||||
@ -118,6 +119,7 @@ public class CommonActivity extends FragmentActivity {
|
|||||||
return m_compatMode;
|
return m_compatMode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public boolean isPortrait() {
|
public boolean isPortrait() {
|
||||||
Display display = getWindowManager().getDefaultDisplay();
|
Display display = getWindowManager().getDefaultDisplay();
|
||||||
|
|
||||||
@ -127,9 +129,10 @@ public class CommonActivity extends FragmentActivity {
|
|||||||
return width < height;
|
return width < height;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressLint("NewApi")
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public void copyToClipboard(String str) {
|
public void copyToClipboard(String str) {
|
||||||
if (android.os.Build.VERSION.SDK_INT < 11) {
|
if (android.os.Build.VERSION.SDK_INT < 11) {
|
||||||
@SuppressWarnings("deprecation")
|
|
||||||
android.text.ClipboardManager clipboard = (android.text.ClipboardManager) getSystemService(CLIPBOARD_SERVICE);
|
android.text.ClipboardManager clipboard = (android.text.ClipboardManager) getSystemService(CLIPBOARD_SERVICE);
|
||||||
clipboard.setText(str);
|
clipboard.setText(str);
|
||||||
} else {
|
} else {
|
||||||
|
@ -39,7 +39,6 @@ import com.google.gson.JsonElement;
|
|||||||
import com.google.gson.reflect.TypeToken;
|
import com.google.gson.reflect.TypeToken;
|
||||||
|
|
||||||
public class FeedCategoriesFragment extends Fragment implements OnItemClickListener, OnSharedPreferenceChangeListener {
|
public class FeedCategoriesFragment extends Fragment implements OnItemClickListener, OnSharedPreferenceChangeListener {
|
||||||
@SuppressWarnings("unused")
|
|
||||||
private final String TAG = this.getClass().getSimpleName();
|
private final String TAG = this.getClass().getSimpleName();
|
||||||
private SharedPreferences m_prefs;
|
private SharedPreferences m_prefs;
|
||||||
private FeedCategoryListAdapter m_adapter;
|
private FeedCategoryListAdapter m_adapter;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package org.fox.ttrss;
|
package org.fox.ttrss;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.Date;
|
||||||
|
|
||||||
import org.fox.ttrss.types.Article;
|
import org.fox.ttrss.types.Article;
|
||||||
import org.fox.ttrss.types.ArticleList;
|
import org.fox.ttrss.types.ArticleList;
|
||||||
@ -8,6 +8,7 @@ import org.fox.ttrss.types.Feed;
|
|||||||
import org.fox.ttrss.types.FeedCategory;
|
import org.fox.ttrss.types.FeedCategory;
|
||||||
import org.fox.ttrss.util.AppRater;
|
import org.fox.ttrss.util.AppRater;
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
@ -15,18 +16,16 @@ import android.preference.PreferenceManager;
|
|||||||
import android.support.v4.app.Fragment;
|
import android.support.v4.app.Fragment;
|
||||||
import android.support.v4.app.FragmentTransaction;
|
import android.support.v4.app.FragmentTransaction;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.Menu;
|
|
||||||
import android.view.MenuInflater;
|
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.Window;
|
|
||||||
import android.widget.ShareActionProvider;
|
|
||||||
|
|
||||||
public class FeedsActivity extends OnlineActivity implements HeadlinesEventListener {
|
public class FeedsActivity extends OnlineActivity implements HeadlinesEventListener {
|
||||||
private final String TAG = this.getClass().getSimpleName();
|
private final String TAG = this.getClass().getSimpleName();
|
||||||
|
|
||||||
protected SharedPreferences m_prefs;
|
protected SharedPreferences m_prefs;
|
||||||
|
protected long m_lastRefresh = 0;
|
||||||
|
|
||||||
|
@SuppressLint("NewApi")
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
m_prefs = PreferenceManager
|
m_prefs = PreferenceManager
|
||||||
@ -161,6 +160,13 @@ public class FeedsActivity extends OnlineActivity implements HeadlinesEventListe
|
|||||||
ft.replace(R.id.headlines_fragment, hf, FRAG_HEADLINES);
|
ft.replace(R.id.headlines_fragment, hf, FRAG_HEADLINES);
|
||||||
|
|
||||||
ft.commit();
|
ft.commit();
|
||||||
|
|
||||||
|
Date date = new Date();
|
||||||
|
|
||||||
|
if (date.getTime() - m_lastRefresh > 10000) {
|
||||||
|
m_lastRefresh = date.getTime();
|
||||||
|
refresh(false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -282,7 +288,6 @@ public class FeedsActivity extends OnlineActivity implements HeadlinesEventListe
|
|||||||
onArticleSelected(article, true);
|
onArticleSelected(article, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
public void catchupFeed(final Feed feed) {
|
public void catchupFeed(final Feed feed) {
|
||||||
super.catchupFeed(feed);
|
super.catchupFeed(feed);
|
||||||
refresh();
|
refresh();
|
||||||
|
@ -575,6 +575,7 @@ public class FeedsFragment extends Fragment implements OnItemClickListener, OnSh
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
private void disableConnectionReuseIfNecessary() {
|
private void disableConnectionReuseIfNecessary() {
|
||||||
// HTTP connection reuse which was buggy pre-froyo
|
// HTTP connection reuse which was buggy pre-froyo
|
||||||
if (Integer.parseInt(Build.VERSION.SDK) < Build.VERSION_CODES.FROYO) {
|
if (Integer.parseInt(Build.VERSION.SDK) < Build.VERSION_CODES.FROYO) {
|
||||||
|
@ -4,9 +4,7 @@ import org.fox.ttrss.types.Article;
|
|||||||
import org.fox.ttrss.types.ArticleList;
|
import org.fox.ttrss.types.ArticleList;
|
||||||
import org.fox.ttrss.types.Feed;
|
import org.fox.ttrss.types.Feed;
|
||||||
|
|
||||||
import android.app.Activity;
|
|
||||||
import android.app.Application;
|
import android.app.Application;
|
||||||
import android.os.Bundle;
|
|
||||||
|
|
||||||
public class GlobalState extends Application {
|
public class GlobalState extends Application {
|
||||||
private static GlobalState m_singleton;
|
private static GlobalState m_singleton;
|
||||||
|
@ -4,6 +4,7 @@ import org.fox.ttrss.types.Article;
|
|||||||
import org.fox.ttrss.types.ArticleList;
|
import org.fox.ttrss.types.ArticleList;
|
||||||
import org.fox.ttrss.types.Feed;
|
import org.fox.ttrss.types.Feed;
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
@ -19,6 +20,7 @@ public class HeadlinesActivity extends OnlineActivity implements HeadlinesEventL
|
|||||||
|
|
||||||
protected SharedPreferences m_prefs;
|
protected SharedPreferences m_prefs;
|
||||||
|
|
||||||
|
@SuppressLint("NewApi")
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
m_prefs = PreferenceManager
|
m_prefs = PreferenceManager
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
package org.fox.ttrss;
|
package org.fox.ttrss;
|
||||||
|
|
||||||
import java.lang.reflect.Type;
|
|
||||||
import java.net.MalformedURLException;
|
import java.net.MalformedURLException;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.text.DateFormat;
|
import java.text.DateFormat;
|
||||||
@ -8,10 +7,8 @@ import java.text.SimpleDateFormat;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
|
||||||
import java.util.TimeZone;
|
import java.util.TimeZone;
|
||||||
|
|
||||||
import org.fox.ttrss.ApiRequest.ApiError;
|
|
||||||
import org.fox.ttrss.types.Article;
|
import org.fox.ttrss.types.Article;
|
||||||
import org.fox.ttrss.types.ArticleList;
|
import org.fox.ttrss.types.ArticleList;
|
||||||
import org.fox.ttrss.types.Attachment;
|
import org.fox.ttrss.types.Attachment;
|
||||||
@ -54,10 +51,7 @@ import android.widget.ListView;
|
|||||||
import android.widget.Spinner;
|
import android.widget.Spinner;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import com.google.gson.Gson;
|
|
||||||
import com.google.gson.JsonArray;
|
|
||||||
import com.google.gson.JsonElement;
|
import com.google.gson.JsonElement;
|
||||||
import com.google.gson.reflect.TypeToken;
|
|
||||||
|
|
||||||
public class HeadlinesFragment extends Fragment implements OnItemClickListener, OnScrollListener {
|
public class HeadlinesFragment extends Fragment implements OnItemClickListener, OnScrollListener {
|
||||||
public static enum ArticlesSelection { ALL, NONE, UNREAD };
|
public static enum ArticlesSelection { ALL, NONE, UNREAD };
|
||||||
@ -83,6 +77,7 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener,
|
|||||||
|
|
||||||
private ImageGetter m_dummyGetter = new ImageGetter() {
|
private ImageGetter m_dummyGetter = new ImageGetter() {
|
||||||
|
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
@Override
|
@Override
|
||||||
public Drawable getDrawable(String source) {
|
public Drawable getDrawable(String source) {
|
||||||
return new BitmapDrawable();
|
return new BitmapDrawable();
|
||||||
|
@ -12,6 +12,7 @@ import org.fox.ttrss.types.ArticleList;
|
|||||||
import org.fox.ttrss.types.Feed;
|
import org.fox.ttrss.types.Feed;
|
||||||
import org.fox.ttrss.types.Label;
|
import org.fox.ttrss.types.Label;
|
||||||
|
|
||||||
|
import android.annotation.TargetApi;
|
||||||
import android.app.AlertDialog;
|
import android.app.AlertDialog;
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
import android.content.BroadcastReceiver;
|
import android.content.BroadcastReceiver;
|
||||||
@ -74,6 +75,7 @@ public class OnlineActivity extends CommonActivity {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@TargetApi(11)
|
||||||
private class HeadlinesActionModeCallback implements ActionMode.Callback {
|
private class HeadlinesActionModeCallback implements ActionMode.Callback {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -1157,7 +1159,7 @@ public class OnlineActivity extends CommonActivity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void refresh() {
|
protected void refresh(boolean includeHeadlines) {
|
||||||
FeedCategoriesFragment cf = (FeedCategoriesFragment) getSupportFragmentManager().findFragmentByTag(FRAG_CATS);
|
FeedCategoriesFragment cf = (FeedCategoriesFragment) getSupportFragmentManager().findFragmentByTag(FRAG_CATS);
|
||||||
|
|
||||||
if (cf != null) {
|
if (cf != null) {
|
||||||
@ -1170,12 +1172,18 @@ public class OnlineActivity extends CommonActivity {
|
|||||||
ff.refresh(false);
|
ff.refresh(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (includeHeadlines) {
|
||||||
HeadlinesFragment hf = (HeadlinesFragment) getSupportFragmentManager().findFragmentByTag(FRAG_HEADLINES);
|
HeadlinesFragment hf = (HeadlinesFragment) getSupportFragmentManager().findFragmentByTag(FRAG_HEADLINES);
|
||||||
|
|
||||||
if (hf != null) {
|
if (hf != null) {
|
||||||
hf.refresh(false);
|
hf.refresh(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void refresh() {
|
||||||
|
refresh(true);
|
||||||
|
}
|
||||||
|
|
||||||
private class LoginRequest extends ApiRequest {
|
private class LoginRequest extends ApiRequest {
|
||||||
public LoginRequest(Context context) {
|
public LoginRequest(Context context) {
|
||||||
|
@ -1,16 +1,14 @@
|
|||||||
package org.fox.ttrss;
|
package org.fox.ttrss;
|
||||||
|
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
import android.content.res.Configuration;
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.preference.Preference;
|
import android.preference.Preference;
|
||||||
import android.preference.Preference.OnPreferenceClickListener;
|
|
||||||
import android.preference.PreferenceActivity;
|
import android.preference.PreferenceActivity;
|
||||||
import android.preference.PreferenceCategory;
|
|
||||||
import android.preference.PreferenceManager;
|
import android.preference.PreferenceManager;
|
||||||
|
|
||||||
public class PreferencesActivity extends PreferenceActivity {
|
public class PreferencesActivity extends PreferenceActivity {
|
||||||
|
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
@ -4,6 +4,7 @@ import org.fox.ttrss.CommonActivity;
|
|||||||
import org.fox.ttrss.PreferencesActivity;
|
import org.fox.ttrss.PreferencesActivity;
|
||||||
import org.fox.ttrss.R;
|
import org.fox.ttrss.R;
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint;
|
||||||
import android.app.AlertDialog;
|
import android.app.AlertDialog;
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
@ -36,6 +37,7 @@ public class OfflineActivity extends CommonActivity {
|
|||||||
private ActionMode m_headlinesActionMode;
|
private ActionMode m_headlinesActionMode;
|
||||||
private HeadlinesActionModeCallback m_headlinesActionModeCallback;
|
private HeadlinesActionModeCallback m_headlinesActionModeCallback;
|
||||||
|
|
||||||
|
@SuppressLint("NewApi")
|
||||||
private class HeadlinesActionModeCallback implements ActionMode.Callback {
|
private class HeadlinesActionModeCallback implements ActionMode.Callback {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -161,11 +163,11 @@ public class OfflineActivity extends CommonActivity {
|
|||||||
final OfflineHeadlinesFragment ohf = (OfflineHeadlinesFragment) getSupportFragmentManager()
|
final OfflineHeadlinesFragment ohf = (OfflineHeadlinesFragment) getSupportFragmentManager()
|
||||||
.findFragmentByTag(FRAG_HEADLINES);
|
.findFragmentByTag(FRAG_HEADLINES);
|
||||||
|
|
||||||
final OfflineFeedsFragment off = (OfflineFeedsFragment) getSupportFragmentManager()
|
/* final OfflineFeedsFragment off = (OfflineFeedsFragment) getSupportFragmentManager()
|
||||||
.findFragmentByTag(FRAG_FEEDS);
|
.findFragmentByTag(FRAG_FEEDS); */
|
||||||
|
|
||||||
final OfflineFeedCategoriesFragment ocf = (OfflineFeedCategoriesFragment) getSupportFragmentManager()
|
/* final OfflineFeedCategoriesFragment ocf = (OfflineFeedCategoriesFragment) getSupportFragmentManager()
|
||||||
.findFragmentByTag(FRAG_CATS);
|
.findFragmentByTag(FRAG_CATS); */
|
||||||
|
|
||||||
final OfflineArticlePager oap = (OfflineArticlePager) getSupportFragmentManager()
|
final OfflineArticlePager oap = (OfflineArticlePager) getSupportFragmentManager()
|
||||||
.findFragmentByTag(FRAG_ARTICLE);
|
.findFragmentByTag(FRAG_ARTICLE);
|
||||||
@ -403,6 +405,7 @@ public class OfflineActivity extends CommonActivity {
|
|||||||
return m_unreadOnly;
|
return m_unreadOnly;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressLint("NewApi")
|
||||||
protected void initMenu() {
|
protected void initMenu() {
|
||||||
if (m_menu != null) {
|
if (m_menu != null) {
|
||||||
m_menu.setGroupVisible(R.id.menu_group_headlines, false);
|
m_menu.setGroupVisible(R.id.menu_group_headlines, false);
|
||||||
|
@ -10,6 +10,7 @@ import org.jsoup.nodes.Document;
|
|||||||
import org.jsoup.nodes.Element;
|
import org.jsoup.nodes.Element;
|
||||||
import org.jsoup.select.Elements;
|
import org.jsoup.select.Elements;
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint;
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
import android.database.Cursor;
|
import android.database.Cursor;
|
||||||
@ -30,11 +31,9 @@ import android.view.ViewGroup;
|
|||||||
import android.webkit.WebSettings;
|
import android.webkit.WebSettings;
|
||||||
import android.webkit.WebSettings.LayoutAlgorithm;
|
import android.webkit.WebSettings.LayoutAlgorithm;
|
||||||
import android.webkit.WebView;
|
import android.webkit.WebView;
|
||||||
import android.widget.AdapterView.AdapterContextMenuInfo;
|
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
public class OfflineArticleFragment extends Fragment {
|
public class OfflineArticleFragment extends Fragment {
|
||||||
@SuppressWarnings("unused")
|
|
||||||
private final String TAG = this.getClass().getSimpleName();
|
private final String TAG = this.getClass().getSimpleName();
|
||||||
|
|
||||||
private SharedPreferences m_prefs;
|
private SharedPreferences m_prefs;
|
||||||
@ -55,8 +54,8 @@ public class OfflineArticleFragment extends Fragment {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onContextItemSelected(MenuItem item) {
|
public boolean onContextItemSelected(MenuItem item) {
|
||||||
AdapterContextMenuInfo info = (AdapterContextMenuInfo) item
|
/* AdapterContextMenuInfo info = (AdapterContextMenuInfo) item
|
||||||
.getMenuInfo();
|
.getMenuInfo(); */
|
||||||
|
|
||||||
switch (item.getItemId()) {
|
switch (item.getItemId()) {
|
||||||
case R.id.article_link_share:
|
case R.id.article_link_share:
|
||||||
@ -89,6 +88,7 @@ public class OfflineArticleFragment extends Fragment {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressLint("NewApi")
|
||||||
@Override
|
@Override
|
||||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||||
|
|
||||||
|
@ -87,6 +87,7 @@ public class OfflineDownloadService extends Service {
|
|||||||
initDatabase();
|
initDatabase();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
private void updateNotification(String msg) {
|
private void updateNotification(String msg) {
|
||||||
Notification notification = new Notification(R.drawable.icon,
|
Notification notification = new Notification(R.drawable.icon,
|
||||||
getString(R.string.notify_downloading_title), System.currentTimeMillis());
|
getString(R.string.notify_downloading_title), System.currentTimeMillis());
|
||||||
@ -158,9 +159,9 @@ public class OfflineDownloadService extends Service {
|
|||||||
m_readableDb = dh.getReadableDatabase();
|
m_readableDb = dh.getReadableDatabase();
|
||||||
}
|
}
|
||||||
|
|
||||||
private synchronized SQLiteDatabase getReadableDb() {
|
/* private synchronized SQLiteDatabase getReadableDb() {
|
||||||
return m_readableDb;
|
return m_readableDb;
|
||||||
}
|
} */
|
||||||
|
|
||||||
private synchronized SQLiteDatabase getWritableDb() {
|
private synchronized SQLiteDatabase getWritableDb() {
|
||||||
return m_writableDb;
|
return m_writableDb;
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
package org.fox.ttrss.offline;
|
package org.fox.ttrss.offline;
|
||||||
|
|
||||||
import org.fox.ttrss.R;
|
import org.fox.ttrss.R;
|
||||||
import org.fox.ttrss.types.Feed;
|
|
||||||
import org.fox.ttrss.types.FeedCategory;
|
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
package org.fox.ttrss.offline;
|
package org.fox.ttrss.offline;
|
||||||
|
|
||||||
import org.fox.ttrss.HeadlinesFragment;
|
|
||||||
import org.fox.ttrss.R;
|
import org.fox.ttrss.R;
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.database.sqlite.SQLiteStatement;
|
import android.database.sqlite.SQLiteStatement;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
@ -17,6 +17,7 @@ import android.view.View;
|
|||||||
public class OfflineFeedsActivity extends OfflineActivity implements OfflineHeadlinesEventListener {
|
public class OfflineFeedsActivity extends OfflineActivity implements OfflineHeadlinesEventListener {
|
||||||
private final String TAG = this.getClass().getSimpleName();
|
private final String TAG = this.getClass().getSimpleName();
|
||||||
|
|
||||||
|
@SuppressLint("NewApi")
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
m_prefs = PreferenceManager
|
m_prefs = PreferenceManager
|
||||||
|
@ -3,7 +3,6 @@ package org.fox.ttrss.offline;
|
|||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
|
||||||
import org.fox.ttrss.R;
|
import org.fox.ttrss.R;
|
||||||
import org.fox.ttrss.types.Feed;
|
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
package org.fox.ttrss.offline;
|
package org.fox.ttrss.offline;
|
||||||
|
|
||||||
import org.fox.ttrss.GlobalState;
|
import org.fox.ttrss.GlobalState;
|
||||||
import org.fox.ttrss.HeadlinesFragment;
|
|
||||||
import org.fox.ttrss.R;
|
import org.fox.ttrss.R;
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
import android.database.Cursor;
|
import android.database.Cursor;
|
||||||
@ -16,10 +16,12 @@ import android.support.v4.app.FragmentTransaction;
|
|||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
|
||||||
public class OfflineHeadlinesActivity extends OfflineActivity implements OfflineHeadlinesEventListener {
|
public class OfflineHeadlinesActivity extends OfflineActivity implements OfflineHeadlinesEventListener {
|
||||||
|
@SuppressWarnings("unused")
|
||||||
private final String TAG = this.getClass().getSimpleName();
|
private final String TAG = this.getClass().getSimpleName();
|
||||||
|
|
||||||
protected SharedPreferences m_prefs;
|
protected SharedPreferences m_prefs;
|
||||||
|
|
||||||
|
@SuppressLint("NewApi")
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
m_prefs = PreferenceManager
|
m_prefs = PreferenceManager
|
||||||
@ -98,12 +100,9 @@ public class OfflineHeadlinesActivity extends OfflineActivity implements Offline
|
|||||||
stmt.close();
|
stmt.close();
|
||||||
|
|
||||||
if (open) {
|
if (open) {
|
||||||
OfflineHeadlinesFragment hf = (OfflineHeadlinesFragment) getSupportFragmentManager().findFragmentByTag(FRAG_HEADLINES);
|
|
||||||
|
|
||||||
OfflineArticlePager af = (OfflineArticlePager) getSupportFragmentManager().findFragmentByTag(FRAG_ARTICLE);
|
OfflineArticlePager af = (OfflineArticlePager) getSupportFragmentManager().findFragmentByTag(FRAG_ARTICLE);
|
||||||
|
|
||||||
af.setArticleId(articleId);
|
af.setArticleId(articleId);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
OfflineHeadlinesFragment hf = (OfflineHeadlinesFragment) getSupportFragmentManager().findFragmentByTag(FRAG_HEADLINES);
|
OfflineHeadlinesFragment hf = (OfflineHeadlinesFragment) getSupportFragmentManager().findFragmentByTag(FRAG_HEADLINES);
|
||||||
|
|
||||||
|
@ -62,6 +62,7 @@ public class OfflineHeadlinesFragment extends Fragment implements OnItemClickLis
|
|||||||
|
|
||||||
private ImageGetter m_dummyGetter = new ImageGetter() {
|
private ImageGetter m_dummyGetter = new ImageGetter() {
|
||||||
|
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
@Override
|
@Override
|
||||||
public Drawable getDrawable(String source) {
|
public Drawable getDrawable(String source) {
|
||||||
return new BitmapDrawable();
|
return new BitmapDrawable();
|
||||||
|
@ -48,6 +48,7 @@ public class OfflineUploadService extends IntentService {
|
|||||||
m_nmgr.cancel(NOTIFY_UPLOADING);
|
m_nmgr.cancel(NOTIFY_UPLOADING);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
private void updateNotification(String msg) {
|
private void updateNotification(String msg) {
|
||||||
Notification notification = new Notification(R.drawable.icon,
|
Notification notification = new Notification(R.drawable.icon,
|
||||||
getString(R.string.notify_uploading_title), System.currentTimeMillis());
|
getString(R.string.notify_uploading_title), System.currentTimeMillis());
|
||||||
|
@ -4,22 +4,19 @@ import java.lang.reflect.Type;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.fox.ttrss.ApiRequest;
|
import org.fox.ttrss.ApiRequest;
|
||||||
|
import org.fox.ttrss.GlobalState;
|
||||||
import org.fox.ttrss.OnlineActivity;
|
import org.fox.ttrss.OnlineActivity;
|
||||||
import org.fox.ttrss.R;
|
import org.fox.ttrss.R;
|
||||||
import org.fox.ttrss.GlobalState;
|
|
||||||
import org.fox.ttrss.ApiRequest.ApiError;
|
|
||||||
import org.fox.ttrss.types.Article;
|
import org.fox.ttrss.types.Article;
|
||||||
import org.fox.ttrss.types.ArticleList;
|
import org.fox.ttrss.types.ArticleList;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.google.gson.JsonArray;
|
import com.google.gson.JsonArray;
|
||||||
import com.google.gson.JsonElement;
|
import com.google.gson.JsonElement;
|
||||||
import com.google.gson.reflect.TypeToken;
|
import com.google.gson.reflect.TypeToken;
|
||||||
|
|
||||||
import android.content.Context;
|
|
||||||
import android.widget.Adapter;
|
|
||||||
import android.widget.ArrayAdapter;
|
|
||||||
|
|
||||||
public class HeadlinesRequest extends ApiRequest {
|
public class HeadlinesRequest extends ApiRequest {
|
||||||
public static final int HEADLINES_REQUEST_SIZE = 30;
|
public static final int HEADLINES_REQUEST_SIZE = 30;
|
||||||
public static final int HEADLINES_BUFFER_MAX = 500;
|
public static final int HEADLINES_BUFFER_MAX = 500;
|
||||||
|
@ -25,6 +25,7 @@ import android.os.Environment;
|
|||||||
|
|
||||||
public class ImageCacheService extends IntentService {
|
public class ImageCacheService extends IntentService {
|
||||||
|
|
||||||
|
@SuppressWarnings("unused")
|
||||||
private final String TAG = this.getClass().getSimpleName();
|
private final String TAG = this.getClass().getSimpleName();
|
||||||
|
|
||||||
public static final int NOTIFY_DOWNLOADING = 1;
|
public static final int NOTIFY_DOWNLOADING = 1;
|
||||||
@ -123,6 +124,7 @@ public class ImageCacheService extends IntentService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
private void updateNotification(String msg) {
|
private void updateNotification(String msg) {
|
||||||
Notification notification = new Notification(R.drawable.icon,
|
Notification notification = new Notification(R.drawable.icon,
|
||||||
getString(R.string.notify_downloading_title), System.currentTimeMillis());
|
getString(R.string.notify_downloading_title), System.currentTimeMillis());
|
||||||
|
Loading…
Reference in New Issue
Block a user