categorize source files

This commit is contained in:
Andrew Dolgov 2012-06-19 14:18:00 +04:00
parent 01151df966
commit 08397a47af
39 changed files with 189 additions and 91 deletions

View File

@ -24,7 +24,7 @@
</activity>
<activity
android:label="@string/app_name"
android:name=".OfflineActivity" >
android:name=".offline.OfflineActivity" >
</activity>
<activity
android:label="@string/app_name"
@ -42,15 +42,15 @@
<service
android:enabled="true"
android:name=".OfflineDownloadService" />
android:name=".org.fox.ttrss.offline.OfflineDownloadServicedService" />
<service
android:enabled="true"
android:name=".OfflineUploadService" />
android:name=".org.fox.ttrss.offline.OfflineUploadServiceineUploadService" />
<service
android:enabled="true"
android:name=".ImageCacheService" />
android:name=".util.ImageCacheService" />
<service android:name="BillingService" />
<service android:name=".billing.BillingService" />
<meta-data
android:name="com.google.android.backup.api_key"

View File

@ -1,4 +1,4 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/main"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
@ -21,7 +21,6 @@
android:id="@+id/loading_progress"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
<FrameLayout
@ -48,4 +47,4 @@
android:layout_height="match_parent" >
</FrameLayout>
</FrameLayout>
</LinearLayout>

View File

@ -20,6 +20,7 @@ import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.BasicCredentialsProvider;
import org.apache.http.protocol.BasicHttpContext;
import org.apache.http.protocol.HttpContext;
import org.fox.ttrss.util.EasySSLSocketFactory;
import android.content.Context;
import android.content.SharedPreferences;

View File

@ -6,6 +6,8 @@ import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import org.fox.ttrss.types.Article;
import org.fox.ttrss.types.Attachment;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;

View File

@ -2,6 +2,8 @@ package org.fox.ttrss;
import java.util.ArrayList;
import org.fox.ttrss.types.Article;
import android.os.Parcel;
import android.os.Parcelable;

View File

@ -1,5 +1,8 @@
package org.fox.ttrss;
import org.fox.ttrss.types.Article;
import org.fox.ttrss.util.FragmentStatePagerAdapter;
import android.app.Activity;
import android.app.Fragment;
import android.app.FragmentManager;

View File

@ -7,6 +7,8 @@ import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import org.fox.ttrss.types.FeedCategory;
import android.app.Activity;
import android.app.Fragment;
import android.content.Context;

View File

@ -2,6 +2,9 @@ package org.fox.ttrss;
import java.util.ArrayList;
import org.fox.ttrss.types.Feed;
import org.fox.ttrss.types.FeedCategory;
import android.os.Parcel;
import android.os.Parcelable;

View File

@ -2,6 +2,8 @@ package org.fox.ttrss;
import java.util.ArrayList;
import org.fox.ttrss.types.Feed;
import android.os.Parcel;
import android.os.Parcelable;

View File

@ -24,6 +24,9 @@ import org.apache.http.conn.scheme.Scheme;
import org.apache.http.impl.client.BasicCredentialsProvider;
import org.apache.http.protocol.BasicHttpContext;
import org.apache.http.protocol.HttpContext;
import org.fox.ttrss.types.Feed;
import org.fox.ttrss.types.FeedCategory;
import org.fox.ttrss.util.EasySSLSocketFactory;
import android.app.Activity;
import android.app.Fragment;

View File

@ -11,6 +11,9 @@ import java.util.HashMap;
import java.util.List;
import java.util.TimeZone;
import org.fox.ttrss.types.Article;
import org.fox.ttrss.types.Attachment;
import org.fox.ttrss.types.Feed;
import org.jsoup.Jsoup;
import android.app.Activity;

View File

@ -1,9 +0,0 @@
package org.fox.ttrss;
public class Label {
int id;
String caption;
String fg_color;
String bg_color;
boolean checked;
}

View File

@ -6,6 +6,18 @@ import java.util.List;
import java.util.Timer;
import java.util.TimerTask;
import org.fox.ttrss.billing.BillingHelper;
import org.fox.ttrss.billing.BillingService;
import org.fox.ttrss.offline.OfflineActivity;
import org.fox.ttrss.offline.OfflineDownloadService;
import org.fox.ttrss.offline.OfflineUploadService;
import org.fox.ttrss.types.Article;
import org.fox.ttrss.types.Feed;
import org.fox.ttrss.types.FeedCategory;
import org.fox.ttrss.types.Label;
import org.fox.ttrss.util.AppRater;
import org.fox.ttrss.util.DatabaseHelper;
import android.animation.LayoutTransition;
import android.app.Activity;
import android.app.AlertDialog;

View File

@ -1,5 +1,9 @@
package org.fox.ttrss;
import org.fox.ttrss.types.Article;
import org.fox.ttrss.types.Feed;
import org.fox.ttrss.types.FeedCategory;
public interface OnlineServices {
public enum RelativeArticle { BEFORE, AFTER };

View File

@ -1,4 +1,4 @@
package org.fox.ttrss;
package org.fox.ttrss.billing;
public class BillingConstants {

View File

@ -1,4 +1,4 @@
package org.fox.ttrss;
package org.fox.ttrss.billing;
import java.util.ArrayList;
@ -12,8 +12,9 @@ import android.os.RemoteException;
import android.util.Log;
import com.android.vending.billing.IMarketBillingService;
import org.fox.ttrss.BillingSecurity.VerifiedPurchase;
import org.fox.ttrss.BillingConstants.ResponseCode;
import org.fox.ttrss.billing.BillingConstants.ResponseCode;
import org.fox.ttrss.billing.BillingSecurity.VerifiedPurchase;
public class BillingHelper {
@ -34,7 +35,7 @@ public class BillingHelper {
mCompletedHandler = handler;
}
protected static boolean isBillingSupported() {
public static boolean isBillingSupported() {
if (amIDead()) {
return false;
}
@ -67,7 +68,7 @@ public class BillingHelper {
* @param activityContext
* @param itemId
*/
protected static void requestPurchase(Context activityContext, String itemId){
public static void requestPurchase(Context activityContext, String itemId){
if (amIDead()) {
return;
}

View File

@ -1,13 +1,13 @@
package org.fox.ttrss;
package org.fox.ttrss.billing;
import static org.fox.ttrss.BillingConstants.ACTION_NOTIFY;
import static org.fox.ttrss.BillingConstants.ACTION_PURCHASE_STATE_CHANGED;
import static org.fox.ttrss.BillingConstants.ACTION_RESPONSE_CODE;
import static org.fox.ttrss.BillingConstants.INAPP_REQUEST_ID;
import static org.fox.ttrss.BillingConstants.INAPP_RESPONSE_CODE;
import static org.fox.ttrss.BillingConstants.INAPP_SIGNATURE;
import static org.fox.ttrss.BillingConstants.INAPP_SIGNED_DATA;
import static org.fox.ttrss.BillingConstants.NOTIFICATION_ID;
import static org.fox.ttrss.billing.BillingConstants.ACTION_NOTIFY;
import static org.fox.ttrss.billing.BillingConstants.ACTION_PURCHASE_STATE_CHANGED;
import static org.fox.ttrss.billing.BillingConstants.ACTION_RESPONSE_CODE;
import static org.fox.ttrss.billing.BillingConstants.INAPP_REQUEST_ID;
import static org.fox.ttrss.billing.BillingConstants.INAPP_RESPONSE_CODE;
import static org.fox.ttrss.billing.BillingConstants.INAPP_SIGNATURE;
import static org.fox.ttrss.billing.BillingConstants.INAPP_SIGNED_DATA;
import static org.fox.ttrss.billing.BillingConstants.NOTIFICATION_ID;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

View File

@ -1,6 +1,6 @@
// Copyright 2010 Google Inc. All Rights Reserved.
package org.fox.ttrss;
package org.fox.ttrss.billing;
import java.security.InvalidKeyException;
import java.security.KeyFactory;
@ -21,7 +21,7 @@ import org.json.JSONObject;
import android.text.TextUtils;
import android.util.Log;
import org.fox.ttrss.BillingConstants.PurchaseState;
import org.fox.ttrss.billing.BillingConstants.PurchaseState;
import org.fox.ttrss.util.Base64;
import org.fox.ttrss.util.Base64DecoderException;

View File

@ -1,4 +1,4 @@
package org.fox.ttrss;
package org.fox.ttrss.billing;
import android.app.Service;
import android.content.ComponentName;

View File

@ -1,6 +1,18 @@
package org.fox.ttrss;
package org.fox.ttrss.offline;
import org.fox.ttrss.DummyFragment;
import org.fox.ttrss.MainActivity;
import org.fox.ttrss.OnlineServices;
import org.fox.ttrss.PreferencesActivity;
import org.fox.ttrss.R;
import org.fox.ttrss.OnlineServices.RelativeArticle;
import org.fox.ttrss.R.anim;
import org.fox.ttrss.R.id;
import org.fox.ttrss.R.layout;
import org.fox.ttrss.R.menu;
import org.fox.ttrss.R.string;
import org.fox.ttrss.R.style;
import org.fox.ttrss.util.DatabaseHelper;
import android.animation.LayoutTransition;
import android.app.Activity;

View File

@ -1,8 +1,14 @@
package org.fox.ttrss;
package org.fox.ttrss.offline;
import java.text.SimpleDateFormat;
import java.util.Date;
import org.fox.ttrss.R;
import org.fox.ttrss.R.attr;
import org.fox.ttrss.R.id;
import org.fox.ttrss.R.layout;
import org.fox.ttrss.R.menu;
import org.fox.ttrss.util.ImageCacheService;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;

View File

@ -1,4 +1,9 @@
package org.fox.ttrss;
package org.fox.ttrss.offline;
import org.fox.ttrss.R;
import org.fox.ttrss.R.id;
import org.fox.ttrss.R.layout;
import org.fox.ttrss.util.FragmentStatePagerAdapter;
import android.app.Activity;
import android.app.Fragment;

View File

@ -1,9 +1,18 @@
package org.fox.ttrss;
package org.fox.ttrss.offline;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.List;
import org.fox.ttrss.ApiRequest;
import org.fox.ttrss.MainActivity;
import org.fox.ttrss.R;
import org.fox.ttrss.R.drawable;
import org.fox.ttrss.R.string;
import org.fox.ttrss.types.Article;
import org.fox.ttrss.types.Feed;
import org.fox.ttrss.util.DatabaseHelper;
import org.fox.ttrss.util.ImageCacheService;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;

View File

@ -1,7 +1,13 @@
package org.fox.ttrss;
package org.fox.ttrss.offline;
import java.io.File;
import org.fox.ttrss.R;
import org.fox.ttrss.R.drawable;
import org.fox.ttrss.R.id;
import org.fox.ttrss.R.layout;
import org.fox.ttrss.R.menu;
import android.app.Activity;
import android.app.Fragment;
import android.content.Context;

View File

@ -1,10 +1,16 @@
package org.fox.ttrss;
package org.fox.ttrss.offline;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.TimeZone;
import org.fox.ttrss.R;
import org.fox.ttrss.R.drawable;
import org.fox.ttrss.R.id;
import org.fox.ttrss.R.layout;
import org.fox.ttrss.R.menu;
import org.fox.ttrss.R.string;
import org.jsoup.Jsoup;
import android.app.Activity;

View File

@ -1,4 +1,7 @@
package org.fox.ttrss;
package org.fox.ttrss.offline;
import org.fox.ttrss.OnlineServices;
import org.fox.ttrss.OnlineServices.RelativeArticle;
import android.database.sqlite.SQLiteDatabase;

View File

@ -1,7 +1,14 @@
package org.fox.ttrss;
package org.fox.ttrss.offline;
import java.util.HashMap;
import org.fox.ttrss.ApiRequest;
import org.fox.ttrss.MainActivity;
import org.fox.ttrss.R;
import org.fox.ttrss.R.drawable;
import org.fox.ttrss.R.string;
import org.fox.ttrss.util.DatabaseHelper;
import com.google.gson.JsonElement;
import android.app.IntentService;

View File

@ -1,25 +1,26 @@
package org.fox.ttrss;
package org.fox.ttrss.types;
import java.util.ArrayList;
import java.util.List;
import android.os.Parcel;
import android.os.Parcelable;
// TODO: serialize Labels
public class Article implements Parcelable {
int id;
boolean unread;
boolean marked;
boolean published;
int updated;
boolean is_updated;
String title;
String link;
int feed_id;
List<String> tags;
List<Attachment> attachments;
String content;
List<List<String>> labels;
public int id;
public boolean unread;
public boolean marked;
public boolean published;
public int updated;
public boolean is_updated;
public String title;
public String link;
public int feed_id;
public List<String> tags;
public List<Attachment> attachments;
public String content;
public List<List<String>> labels;
public Article(Parcel in) {
readFromParcel(in);

View File

@ -1,4 +1,4 @@
package org.fox.ttrss;
package org.fox.ttrss.types;
import java.io.File;
import java.net.MalformedURLException;
@ -8,12 +8,12 @@ import android.os.Parcel;
import android.os.Parcelable;
public class Attachment implements Parcelable {
int id;
String content_url;
String content_type;
String title;
String duration;
int post_id;
public int id;
public String content_url;
public String content_type;
public String title;
public String duration;
public int post_id;
public Attachment(Parcel in) {
readFromParcel(in);

View File

@ -1,18 +1,18 @@
package org.fox.ttrss;
package org.fox.ttrss.types;
import android.os.Parcel;
import android.os.Parcelable;
public class Feed implements Comparable<Feed>, Parcelable {
String feed_url;
String title;
int id;
int unread;
boolean has_icon;
int cat_id;
int last_updated;
int order_id;
boolean is_cat;
public String feed_url;
public String title;
public int id;
public int unread;
public boolean has_icon;
public int cat_id;
public int last_updated;
public int order_id;
public boolean is_cat;
public Feed(int id, String title, boolean is_cat) {
this.id = id;

View File

@ -1,13 +1,13 @@
package org.fox.ttrss;
package org.fox.ttrss.types;
import android.os.Parcel;
import android.os.Parcelable;
public class FeedCategory implements Parcelable {
int id;
String title;
int unread;
int order_id;
public int id;
public String title;
public int unread;
public int order_id;
public FeedCategory(Parcel in) {
readFromParcel(in);

View File

@ -0,0 +1,9 @@
package org.fox.ttrss.types;
public class Label {
public int id;
public String caption;
public String fg_color;
public String bg_color;
public boolean checked;
}

View File

@ -1,4 +1,4 @@
package org.fox.ttrss;
package org.fox.ttrss.util;
// From http://androidsnippets.com/prompt-engaged-users-to-rate-your-app-in-the-android-market-appirater

View File

@ -1,4 +1,4 @@
package org.fox.ttrss;
package org.fox.ttrss.util;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

View File

@ -1,4 +1,4 @@
package org.fox.ttrss;
package org.fox.ttrss.util;
import java.io.IOException;
import java.net.InetAddress;

View File

@ -1,5 +1,5 @@
package org.fox.ttrss;
package org.fox.ttrss.util;
import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;

View File

@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.fox.ttrss;
package org.fox.ttrss.util;
import android.app.Fragment;
import android.app.FragmentManager;

View File

@ -1,4 +1,4 @@
package org.fox.ttrss;
package org.fox.ttrss.util;
import java.io.File;
import java.io.FileOutputStream;
@ -10,6 +10,12 @@ import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.Date;
import org.fox.ttrss.MainActivity;
import org.fox.ttrss.R;
import org.fox.ttrss.R.drawable;
import org.fox.ttrss.R.string;
import org.fox.ttrss.offline.OfflineDownloadService;
import android.app.ActivityManager;
import android.app.IntentService;
import android.app.Notification;
@ -53,7 +59,7 @@ public class ImageCacheService extends IntentService {
m_nmgr = (NotificationManager)getSystemService(NOTIFICATION_SERVICE);
}
protected static boolean isUrlCached(String url) {
public static boolean isUrlCached(String url) {
String hashedUrl = md5(url);
File storage = Environment.getExternalStorageDirectory();
@ -63,7 +69,7 @@ public class ImageCacheService extends IntentService {
return file.exists();
}
protected static String getCacheFileName(String url) {
public static String getCacheFileName(String url) {
String hashedUrl = md5(url);
File storage = Environment.getExternalStorageDirectory();
@ -73,7 +79,7 @@ public class ImageCacheService extends IntentService {
return file.getAbsolutePath();
}
protected static void cleanupCache(boolean deleteAll) {
public static void cleanupCache(boolean deleteAll) {
if (Environment.MEDIA_MOUNTED.equals(Environment.getExternalStorageState())) {
File storage = Environment.getExternalStorageDirectory();
File cachePath = new File(storage.getAbsolutePath() + CACHE_PATH);

View File

@ -1,4 +1,4 @@
package org.fox.ttrss;
package org.fox.ttrss.util;
import android.app.backup.BackupAgentHelper;
import android.app.backup.SharedPreferencesBackupHelper;