diff options
Diffstat (limited to 'app/src/main')
25 files changed, 54 insertions, 23 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/SubredditDao.java b/app/src/main/java/SubredditDatabase/SubredditDao.java index 2e1b0bb7..9b2fcabb 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/SubredditDao.java +++ b/app/src/main/java/SubredditDatabase/SubredditDao.java @@ -1,4 +1,4 @@ -package ml.docilealligator.infinityforreddit; +package SubredditDatabase; import android.arch.lifecycle.LiveData; import android.arch.persistence.room.Dao; diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/SubredditData.java b/app/src/main/java/SubredditDatabase/SubredditData.java index 59b8e6b8..bbd9f7d8 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/SubredditData.java +++ b/app/src/main/java/SubredditDatabase/SubredditData.java @@ -1,4 +1,4 @@ -package ml.docilealligator.infinityforreddit; +package SubredditDatabase; import android.arch.persistence.room.ColumnInfo; import android.arch.persistence.room.Entity; @@ -6,7 +6,7 @@ import android.arch.persistence.room.PrimaryKey; import android.support.annotation.NonNull; @Entity(tableName = "subreddits") -class SubredditData { +public class SubredditData { @PrimaryKey @NonNull @ColumnInfo(name = "id") @@ -27,7 +27,7 @@ class SubredditData { @ColumnInfo(name = "subscribers_count") private int nSubscribers; - SubredditData(@NonNull String id, String name, String iconUrl, String bannerUrl, String description, int nSubscribers) { + public SubredditData(@NonNull String id, String name, String iconUrl, String bannerUrl, String description, int nSubscribers) { this.id = id; this.name = name; this.iconUrl = iconUrl; diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/SubredditRepository.java b/app/src/main/java/SubredditDatabase/SubredditRepository.java index deb68806..20eb617a 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/SubredditRepository.java +++ b/app/src/main/java/SubredditDatabase/SubredditRepository.java @@ -1,4 +1,4 @@ -package ml.docilealligator.infinityforreddit; +package SubredditDatabase; import android.app.Application; import android.arch.lifecycle.LiveData; diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/SubredditRoomDatabase.java b/app/src/main/java/SubredditDatabase/SubredditRoomDatabase.java index 16affad3..764a3741 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/SubredditRoomDatabase.java +++ b/app/src/main/java/SubredditDatabase/SubredditRoomDatabase.java @@ -1,4 +1,4 @@ -package ml.docilealligator.infinityforreddit; +package SubredditDatabase; import android.arch.persistence.room.Database; import android.arch.persistence.room.Room; diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/SubredditViewModel.java b/app/src/main/java/SubredditDatabase/SubredditViewModel.java index ee636b43..10135401 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/SubredditViewModel.java +++ b/app/src/main/java/SubredditDatabase/SubredditViewModel.java @@ -1,4 +1,4 @@ -package ml.docilealligator.infinityforreddit; +package SubredditDatabase; import android.app.Application; import android.arch.lifecycle.AndroidViewModel; diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/SubscribedSubredditDao.java b/app/src/main/java/SubscribedSubredditDatabase/SubscribedSubredditDao.java index 9ced85c1..7837aa42 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/SubscribedSubredditDao.java +++ b/app/src/main/java/SubscribedSubredditDatabase/SubscribedSubredditDao.java @@ -1,4 +1,4 @@ -package ml.docilealligator.infinityforreddit; +package SubscribedSubredditDatabase; import android.arch.lifecycle.LiveData; import android.arch.persistence.room.Dao; diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/SubscribedSubredditData.java b/app/src/main/java/SubscribedSubredditDatabase/SubscribedSubredditData.java index 10b2c8e0..c6812768 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/SubscribedSubredditData.java +++ b/app/src/main/java/SubscribedSubredditDatabase/SubscribedSubredditData.java @@ -1,4 +1,4 @@ -package ml.docilealligator.infinityforreddit; +package SubscribedSubredditDatabase; import android.arch.persistence.room.ColumnInfo; import android.arch.persistence.room.Entity; @@ -6,7 +6,7 @@ import android.arch.persistence.room.PrimaryKey; import android.support.annotation.NonNull; @Entity(tableName = "subscribed_subreddits") -class SubscribedSubredditData { +public class SubscribedSubredditData { @PrimaryKey @NonNull @@ -17,7 +17,7 @@ class SubscribedSubredditData { @ColumnInfo(name = "icon") private String iconUrl; - SubscribedSubredditData(@NonNull String id, String name, String iconUrl) { + public SubscribedSubredditData(@NonNull String id, String name, String iconUrl) { this.id = id; this.name = name; this.iconUrl = iconUrl; diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/SubscribedSubredditRepository.java b/app/src/main/java/SubscribedSubredditDatabase/SubscribedSubredditRepository.java index 3173bba4..54b2ddfa 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/SubscribedSubredditRepository.java +++ b/app/src/main/java/SubscribedSubredditDatabase/SubscribedSubredditRepository.java @@ -1,4 +1,4 @@ -package ml.docilealligator.infinityforreddit; +package SubscribedSubredditDatabase; import android.app.Application; import android.arch.lifecycle.LiveData; diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/SubscribedSubredditRoomDatabase.java b/app/src/main/java/SubscribedSubredditDatabase/SubscribedSubredditRoomDatabase.java index d4b1f710..abde79b4 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/SubscribedSubredditRoomDatabase.java +++ b/app/src/main/java/SubscribedSubredditDatabase/SubscribedSubredditRoomDatabase.java @@ -1,4 +1,4 @@ -package ml.docilealligator.infinityforreddit; +package SubscribedSubredditDatabase; import android.arch.persistence.room.Database; import android.arch.persistence.room.Room; diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/SubscribedSubredditViewModel.java b/app/src/main/java/SubscribedSubredditDatabase/SubscribedSubredditViewModel.java index bd092640..8598dd55 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/SubscribedSubredditViewModel.java +++ b/app/src/main/java/SubscribedSubredditDatabase/SubscribedSubredditViewModel.java @@ -1,4 +1,4 @@ -package ml.docilealligator.infinityforreddit; +package SubscribedSubredditDatabase; import android.app.Application; import android.arch.lifecycle.AndroidViewModel; diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/SubscribedUserDao.java b/app/src/main/java/SubscribedUserDatabase/SubscribedUserDao.java index a2979dcd..2b61a666 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/SubscribedUserDao.java +++ b/app/src/main/java/SubscribedUserDatabase/SubscribedUserDao.java @@ -1,4 +1,4 @@ -package ml.docilealligator.infinityforreddit; +package SubscribedUserDatabase; import android.arch.lifecycle.LiveData; import android.arch.persistence.room.Dao; diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/SubscribedUserData.java b/app/src/main/java/SubscribedUserDatabase/SubscribedUserData.java index 9bf58700..8494e784 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/SubscribedUserData.java +++ b/app/src/main/java/SubscribedUserDatabase/SubscribedUserData.java @@ -1,4 +1,4 @@ -package ml.docilealligator.infinityforreddit; +package SubscribedUserDatabase; import android.arch.persistence.room.ColumnInfo; import android.arch.persistence.room.Entity; @@ -6,7 +6,7 @@ import android.arch.persistence.room.PrimaryKey; import android.support.annotation.NonNull; @Entity(tableName = "subscribed_users") -class SubscribedUserData { +public class SubscribedUserData { @PrimaryKey @NonNull @ColumnInfo(name = "id") @@ -16,7 +16,7 @@ class SubscribedUserData { @ColumnInfo(name = "icon") private String iconUrl; - SubscribedUserData(@NonNull String id, String name, String iconUrl) { + public SubscribedUserData(@NonNull String id, String name, String iconUrl) { this.id = id; this.name = name; this.iconUrl = iconUrl; diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/SubscribedUserRepository.java b/app/src/main/java/SubscribedUserDatabase/SubscribedUserRepository.java index 8dfc4204..5cab5fa8 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/SubscribedUserRepository.java +++ b/app/src/main/java/SubscribedUserDatabase/SubscribedUserRepository.java @@ -1,4 +1,4 @@ -package ml.docilealligator.infinityforreddit; +package SubscribedUserDatabase; import android.app.Application; import android.arch.lifecycle.LiveData; diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/SubscribedUserRoomDatabase.java b/app/src/main/java/SubscribedUserDatabase/SubscribedUserRoomDatabase.java index 0f6575d7..cf3ea59d 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/SubscribedUserRoomDatabase.java +++ b/app/src/main/java/SubscribedUserDatabase/SubscribedUserRoomDatabase.java @@ -1,4 +1,4 @@ -package ml.docilealligator.infinityforreddit; +package SubscribedUserDatabase; import android.arch.persistence.room.Database; import android.arch.persistence.room.Room; diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/SubscribedUserViewModel.java b/app/src/main/java/SubscribedUserDatabase/SubscribedUserViewModel.java index 44e40fe5..858fac48 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/SubscribedUserViewModel.java +++ b/app/src/main/java/SubscribedUserDatabase/SubscribedUserViewModel.java @@ -1,4 +1,4 @@ -package ml.docilealligator.infinityforreddit; +package SubscribedUserDatabase; import android.app.Application; import android.arch.lifecycle.AndroidViewModel; diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/FetchSubscribedThing.java b/app/src/main/java/ml/docilealligator/infinityforreddit/FetchSubscribedThing.java index cfda92de..691d170b 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/FetchSubscribedThing.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/FetchSubscribedThing.java @@ -6,6 +6,9 @@ import android.util.Log; import java.util.ArrayList; +import SubredditDatabase.SubredditData; +import SubscribedSubredditDatabase.SubscribedSubredditData; +import SubscribedUserDatabase.SubscribedUserData; import retrofit2.Call; import retrofit2.Callback; import retrofit2.Response; diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/LoadSubredditIconAsyncTask.java b/app/src/main/java/ml/docilealligator/infinityforreddit/LoadSubredditIconAsyncTask.java index 957e52ab..f7f0fdcd 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/LoadSubredditIconAsyncTask.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/LoadSubredditIconAsyncTask.java @@ -2,6 +2,8 @@ package ml.docilealligator.infinityforreddit; import android.os.AsyncTask; +import SubredditDatabase.SubredditDao; + class LoadSubredditIconAsyncTask extends AsyncTask<Void, Void, Void> { interface LoadSubredditIconAsyncTaskListener { void loadIconSuccess(String iconImageUrl); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/MainActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/MainActivity.java index 5f559aa1..00ca7f15 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/MainActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/MainActivity.java @@ -31,6 +31,17 @@ import java.util.List; import javax.inject.Inject; import javax.inject.Named; +import SubredditDatabase.SubredditDao; +import SubredditDatabase.SubredditData; +import SubredditDatabase.SubredditRoomDatabase; +import SubscribedSubredditDatabase.SubscribedSubredditDao; +import SubscribedSubredditDatabase.SubscribedSubredditData; +import SubscribedSubredditDatabase.SubscribedSubredditRoomDatabase; +import SubscribedSubredditDatabase.SubscribedSubredditViewModel; +import SubscribedUserDatabase.SubscribedUserDao; +import SubscribedUserDatabase.SubscribedUserData; +import SubscribedUserDatabase.SubscribedUserRoomDatabase; +import SubscribedUserDatabase.SubscribedUserViewModel; import butterknife.BindView; import butterknife.ButterKnife; import de.hdodenhof.circleimageview.CircleImageView; diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/ParseSubredditData.java b/app/src/main/java/ml/docilealligator/infinityforreddit/ParseSubredditData.java index 1f9b4a9e..5292a976 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/ParseSubredditData.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/ParseSubredditData.java @@ -6,6 +6,8 @@ import android.util.Log; import org.json.JSONException; import org.json.JSONObject; +import SubredditDatabase.SubredditData; + class ParseSubredditData { interface ParseSubredditDataListener { void onParseSubredditDataSuccess(SubredditData subredditData, int nCurrentOnlineSubscribers); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/ParseSubscribedThing.java b/app/src/main/java/ml/docilealligator/infinityforreddit/ParseSubscribedThing.java index 2cddfc2f..a69d0c22 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/ParseSubscribedThing.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/ParseSubscribedThing.java @@ -9,6 +9,10 @@ import org.json.JSONObject; import java.util.ArrayList; +import SubredditDatabase.SubredditData; +import SubscribedSubredditDatabase.SubscribedSubredditData; +import SubscribedUserDatabase.SubscribedUserData; + class ParseSubscribedThing { interface ParseSubscribedSubredditsListener { void onParseSubscribedSubredditsSuccess(ArrayList<SubscribedSubredditData> subscribedSubredditData, diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/PostRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/PostRecyclerViewAdapter.java index 2d6f54aa..9ec8b83b 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/PostRecyclerViewAdapter.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/PostRecyclerViewAdapter.java @@ -39,6 +39,8 @@ import com.bumptech.glide.request.target.Target; import java.util.List; import CustomView.AspectRatioGifImageView; +import SubredditDatabase.SubredditDao; +import SubredditDatabase.SubredditRoomDatabase; import butterknife.BindView; import butterknife.ButterKnife; import jp.wasabeef.glide.transformations.BlurTransformation; diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/SubscribedSubredditRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/SubscribedSubredditRecyclerViewAdapter.java index 87c679cd..9bc4f5e7 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/SubscribedSubredditRecyclerViewAdapter.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/SubscribedSubredditRecyclerViewAdapter.java @@ -23,6 +23,7 @@ import com.felipecsl.gifimageview.library.GifImageView; import java.util.List; +import SubscribedSubredditDatabase.SubscribedSubredditData; import jp.wasabeef.glide.transformations.RoundedCornersTransformation; class SubscribedSubredditRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> { diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/SubscribedUserRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/SubscribedUserRecyclerViewAdapter.java index e36dea17..013d75c1 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/SubscribedUserRecyclerViewAdapter.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/SubscribedUserRecyclerViewAdapter.java @@ -22,14 +22,15 @@ import com.felipecsl.gifimageview.library.GifImageView; import java.util.List; +import SubscribedUserDatabase.SubscribedUserData; import jp.wasabeef.glide.transformations.RoundedCornersTransformation; -class SubscribedUserRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> { +public class SubscribedUserRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> { private List<SubscribedUserData> mSubscribedUserData; private RequestManager glide; private OnItemClickListener mOnItemClickListener; - interface OnItemClickListener { + public interface OnItemClickListener { void onClick(); } diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/ViewPostDetailActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/ViewPostDetailActivity.java index 6c8f209e..5140ac94 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/ViewPostDetailActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/ViewPostDetailActivity.java @@ -42,6 +42,7 @@ import java.util.List; import javax.inject.Inject; import javax.inject.Named; +import SubredditDatabase.SubredditRoomDatabase; import butterknife.BindView; import butterknife.ButterKnife; import de.hdodenhof.circleimageview.CircleImageView; diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/ViewSubredditDetailActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/ViewSubredditDetailActivity.java index cc7bb742..1c63ffac 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/ViewSubredditDetailActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/ViewSubredditDetailActivity.java @@ -33,6 +33,10 @@ import com.felipecsl.gifimageview.library.GifImageView; import javax.inject.Inject; import javax.inject.Named; +import SubredditDatabase.SubredditDao; +import SubredditDatabase.SubredditData; +import SubredditDatabase.SubredditRoomDatabase; +import SubredditDatabase.SubredditViewModel; import butterknife.BindView; import butterknife.ButterKnife; import jp.wasabeef.glide.transformations.RoundedCornersTransformation; |