Move several classes to other packages.

This commit is contained in:
Alex Ning 2018-12-27 13:54:19 +08:00
parent 5603df7546
commit 807ddf5a6e
25 changed files with 54 additions and 23 deletions

View File

@ -1,4 +1,4 @@
package ml.docilealligator.infinityforreddit;
package SubredditDatabase;
import android.arch.lifecycle.LiveData;
import android.arch.persistence.room.Dao;

View File

@ -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;

View File

@ -1,4 +1,4 @@
package ml.docilealligator.infinityforreddit;
package SubredditDatabase;
import android.app.Application;
import android.arch.lifecycle.LiveData;

View File

@ -1,4 +1,4 @@
package ml.docilealligator.infinityforreddit;
package SubredditDatabase;
import android.arch.persistence.room.Database;
import android.arch.persistence.room.Room;

View File

@ -1,4 +1,4 @@
package ml.docilealligator.infinityforreddit;
package SubredditDatabase;
import android.app.Application;
import android.arch.lifecycle.AndroidViewModel;

View File

@ -1,4 +1,4 @@
package ml.docilealligator.infinityforreddit;
package SubscribedSubredditDatabase;
import android.arch.lifecycle.LiveData;
import android.arch.persistence.room.Dao;

View File

@ -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;

View File

@ -1,4 +1,4 @@
package ml.docilealligator.infinityforreddit;
package SubscribedSubredditDatabase;
import android.app.Application;
import android.arch.lifecycle.LiveData;

View File

@ -1,4 +1,4 @@
package ml.docilealligator.infinityforreddit;
package SubscribedSubredditDatabase;
import android.arch.persistence.room.Database;
import android.arch.persistence.room.Room;

View File

@ -1,4 +1,4 @@
package ml.docilealligator.infinityforreddit;
package SubscribedSubredditDatabase;
import android.app.Application;
import android.arch.lifecycle.AndroidViewModel;

View File

@ -1,4 +1,4 @@
package ml.docilealligator.infinityforreddit;
package SubscribedUserDatabase;
import android.arch.lifecycle.LiveData;
import android.arch.persistence.room.Dao;

View File

@ -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;

View File

@ -1,4 +1,4 @@
package ml.docilealligator.infinityforreddit;
package SubscribedUserDatabase;
import android.app.Application;
import android.arch.lifecycle.LiveData;

View File

@ -1,4 +1,4 @@
package ml.docilealligator.infinityforreddit;
package SubscribedUserDatabase;
import android.arch.persistence.room.Database;
import android.arch.persistence.room.Room;

View File

@ -1,4 +1,4 @@
package ml.docilealligator.infinityforreddit;
package SubscribedUserDatabase;
import android.app.Application;
import android.arch.lifecycle.AndroidViewModel;

View File

@ -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;

View File

@ -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);

View File

@ -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;

View File

@ -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);

View File

@ -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,

View File

@ -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;

View File

@ -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> {

View File

@ -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();
}

View File

@ -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;

View File

@ -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;