reorganize responses
This commit is contained in:
parent
aca44f0ab9
commit
1dd78b7d91
@ -16,7 +16,7 @@ import java.util.stream.Collectors;
|
|||||||
import awais.instagrabber.adapters.viewholder.NotificationViewHolder;
|
import awais.instagrabber.adapters.viewholder.NotificationViewHolder;
|
||||||
import awais.instagrabber.databinding.ItemNotificationBinding;
|
import awais.instagrabber.databinding.ItemNotificationBinding;
|
||||||
import awais.instagrabber.models.enums.NotificationType;
|
import awais.instagrabber.models.enums.NotificationType;
|
||||||
import awais.instagrabber.repositories.responses.Notification;
|
import awais.instagrabber.repositories.responses.notification.Notification;
|
||||||
|
|
||||||
public final class NotificationsAdapter extends ListAdapter<Notification, NotificationViewHolder> {
|
public final class NotificationsAdapter extends ListAdapter<Notification, NotificationViewHolder> {
|
||||||
private final OnNotificationClickListener notificationClickListener;
|
private final OnNotificationClickListener notificationClickListener;
|
||||||
|
@ -9,8 +9,8 @@ import awais.instagrabber.R;
|
|||||||
import awais.instagrabber.adapters.NotificationsAdapter.OnNotificationClickListener;
|
import awais.instagrabber.adapters.NotificationsAdapter.OnNotificationClickListener;
|
||||||
import awais.instagrabber.databinding.ItemNotificationBinding;
|
import awais.instagrabber.databinding.ItemNotificationBinding;
|
||||||
import awais.instagrabber.models.enums.NotificationType;
|
import awais.instagrabber.models.enums.NotificationType;
|
||||||
import awais.instagrabber.repositories.responses.Notification;
|
import awais.instagrabber.repositories.responses.notification.Notification;
|
||||||
import awais.instagrabber.repositories.responses.NotificationArgs;
|
import awais.instagrabber.repositories.responses.notification.NotificationArgs;
|
||||||
|
|
||||||
public final class NotificationViewHolder extends RecyclerView.ViewHolder {
|
public final class NotificationViewHolder extends RecyclerView.ViewHolder {
|
||||||
private final ItemNotificationBinding binding;
|
private final ItemNotificationBinding binding;
|
||||||
|
@ -2,7 +2,6 @@ package awais.instagrabber.fragments;
|
|||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
import android.os.AsyncTask;
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.text.SpannableString;
|
import android.text.SpannableString;
|
||||||
import android.text.Spanned;
|
import android.text.Spanned;
|
||||||
@ -37,9 +36,9 @@ import awais.instagrabber.models.enums.NotificationType;
|
|||||||
import awais.instagrabber.repositories.requests.StoryViewerOptions;
|
import awais.instagrabber.repositories.requests.StoryViewerOptions;
|
||||||
import awais.instagrabber.repositories.responses.FriendshipChangeResponse;
|
import awais.instagrabber.repositories.responses.FriendshipChangeResponse;
|
||||||
import awais.instagrabber.repositories.responses.Media;
|
import awais.instagrabber.repositories.responses.Media;
|
||||||
import awais.instagrabber.repositories.responses.Notification;
|
import awais.instagrabber.repositories.responses.notification.Notification;
|
||||||
import awais.instagrabber.repositories.responses.NotificationArgs;
|
import awais.instagrabber.repositories.responses.notification.NotificationArgs;
|
||||||
import awais.instagrabber.repositories.responses.NotificationImage;
|
import awais.instagrabber.repositories.responses.notification.NotificationImage;
|
||||||
import awais.instagrabber.utils.Constants;
|
import awais.instagrabber.utils.Constants;
|
||||||
import awais.instagrabber.utils.CookieUtils;
|
import awais.instagrabber.utils.CookieUtils;
|
||||||
import awais.instagrabber.utils.TextUtils;
|
import awais.instagrabber.utils.TextUtils;
|
||||||
|
@ -2,7 +2,7 @@ package awais.instagrabber.repositories;
|
|||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import awais.instagrabber.repositories.responses.FeedFetchResponse;
|
import awais.instagrabber.repositories.responses.feed.FeedFetchResponse;
|
||||||
import retrofit2.Call;
|
import retrofit2.Call;
|
||||||
import retrofit2.http.FieldMap;
|
import retrofit2.http.FieldMap;
|
||||||
import retrofit2.http.FormUrlEncoded;
|
import retrofit2.http.FormUrlEncoded;
|
||||||
|
@ -9,6 +9,7 @@ import java.util.Map;
|
|||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
import awais.instagrabber.models.enums.MediaItemType;
|
import awais.instagrabber.models.enums.MediaItemType;
|
||||||
|
import awais.instagrabber.repositories.responses.feed.EndOfFeedDemarcator;
|
||||||
import awais.instagrabber.utils.Utils;
|
import awais.instagrabber.utils.Utils;
|
||||||
|
|
||||||
public class Media implements Serializable {
|
public class Media implements Serializable {
|
||||||
|
@ -2,6 +2,9 @@ package awais.instagrabber.repositories.responses;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import awais.instagrabber.repositories.responses.notification.Notification;
|
||||||
|
import awais.instagrabber.repositories.responses.notification.NotificationCounts;
|
||||||
|
|
||||||
public class NewsInboxResponse {
|
public class NewsInboxResponse {
|
||||||
private final NotificationCounts counts;
|
private final NotificationCounts counts;
|
||||||
private final List<Notification> newStories;
|
private final List<Notification> newStories;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
package awais.instagrabber.repositories.responses;
|
package awais.instagrabber.repositories.responses.feed;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
@ -1,9 +1,11 @@
|
|||||||
package awais.instagrabber.repositories.responses;
|
package awais.instagrabber.repositories.responses.feed;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
|
import awais.instagrabber.repositories.responses.Media;
|
||||||
|
|
||||||
public class EndOfFeedGroup implements Serializable {
|
public class EndOfFeedGroup implements Serializable {
|
||||||
private final String id;
|
private final String id;
|
||||||
private final String title;
|
private final String title;
|
@ -1,4 +1,4 @@
|
|||||||
package awais.instagrabber.repositories.responses;
|
package awais.instagrabber.repositories.responses.feed;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.List;
|
import java.util.List;
|
@ -1,7 +1,9 @@
|
|||||||
package awais.instagrabber.repositories.responses;
|
package awais.instagrabber.repositories.responses.feed;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import awais.instagrabber.repositories.responses.Media;
|
||||||
|
|
||||||
public class FeedFetchResponse {
|
public class FeedFetchResponse {
|
||||||
private final List<Media> items;
|
private final List<Media> items;
|
||||||
private final int numResults;
|
private final int numResults;
|
@ -1,4 +1,4 @@
|
|||||||
package awais.instagrabber.repositories.responses;
|
package awais.instagrabber.repositories.responses.notification;
|
||||||
|
|
||||||
import awais.instagrabber.models.enums.NotificationType;
|
import awais.instagrabber.models.enums.NotificationType;
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
package awais.instagrabber.repositories.responses;
|
package awais.instagrabber.repositories.responses.notification;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
@ -7,8 +7,6 @@ import java.util.List;
|
|||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
import android.util.Log;
|
|
||||||
|
|
||||||
import awais.instagrabber.utils.Utils;
|
import awais.instagrabber.utils.Utils;
|
||||||
|
|
||||||
public class NotificationArgs {
|
public class NotificationArgs {
|
@ -1,4 +1,4 @@
|
|||||||
package awais.instagrabber.repositories.responses;
|
package awais.instagrabber.repositories.responses.notification;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
package awais.instagrabber.repositories.responses;
|
package awais.instagrabber.repositories.responses.notification;
|
||||||
|
|
||||||
public class NotificationImage {
|
public class NotificationImage {
|
||||||
private final String id;
|
private final String id;
|
@ -18,13 +18,11 @@ import java.util.List;
|
|||||||
|
|
||||||
import awais.instagrabber.R;
|
import awais.instagrabber.R;
|
||||||
import awais.instagrabber.activities.MainActivity;
|
import awais.instagrabber.activities.MainActivity;
|
||||||
import awais.instagrabber.repositories.responses.NotificationCounts;
|
import awais.instagrabber.repositories.responses.notification.NotificationCounts;
|
||||||
import awais.instagrabber.utils.Constants;
|
import awais.instagrabber.utils.Constants;
|
||||||
import awais.instagrabber.webservices.NewsService;
|
import awais.instagrabber.webservices.NewsService;
|
||||||
import awais.instagrabber.webservices.ServiceCallback;
|
import awais.instagrabber.webservices.ServiceCallback;
|
||||||
|
|
||||||
import static awais.instagrabber.utils.Utils.settingsHelper;
|
|
||||||
|
|
||||||
public class ActivityCheckerService extends Service {
|
public class ActivityCheckerService extends Service {
|
||||||
private static final String TAG = "ActivityCheckerService";
|
private static final String TAG = "ActivityCheckerService";
|
||||||
private static final int INITIAL_DELAY_MILLIS = 200;
|
private static final int INITIAL_DELAY_MILLIS = 200;
|
||||||
|
@ -5,7 +5,7 @@ import androidx.lifecycle.ViewModel;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import awais.instagrabber.repositories.responses.Notification;
|
import awais.instagrabber.repositories.responses.notification.Notification;
|
||||||
|
|
||||||
public class NotificationViewModel extends ViewModel {
|
public class NotificationViewModel extends ViewModel {
|
||||||
private MutableLiveData<List<Notification>> list;
|
private MutableLiveData<List<Notification>> list;
|
||||||
|
@ -12,10 +12,10 @@ import java.util.Map;
|
|||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
import awais.instagrabber.repositories.FeedRepository;
|
import awais.instagrabber.repositories.FeedRepository;
|
||||||
import awais.instagrabber.repositories.responses.EndOfFeedDemarcator;
|
import awais.instagrabber.repositories.responses.feed.EndOfFeedDemarcator;
|
||||||
import awais.instagrabber.repositories.responses.EndOfFeedGroup;
|
import awais.instagrabber.repositories.responses.feed.EndOfFeedGroup;
|
||||||
import awais.instagrabber.repositories.responses.EndOfFeedGroupSet;
|
import awais.instagrabber.repositories.responses.feed.EndOfFeedGroupSet;
|
||||||
import awais.instagrabber.repositories.responses.FeedFetchResponse;
|
import awais.instagrabber.repositories.responses.feed.FeedFetchResponse;
|
||||||
import awais.instagrabber.repositories.responses.Media;
|
import awais.instagrabber.repositories.responses.Media;
|
||||||
import awais.instagrabber.repositories.responses.PostsFetchResponse;
|
import awais.instagrabber.repositories.responses.PostsFetchResponse;
|
||||||
import awais.instagrabber.utils.TextUtils;
|
import awais.instagrabber.utils.TextUtils;
|
||||||
|
@ -1,35 +1,24 @@
|
|||||||
package awais.instagrabber.webservices;
|
package awais.instagrabber.webservices;
|
||||||
|
|
||||||
import android.util.Log;
|
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
import org.json.JSONArray;
|
|
||||||
import org.json.JSONException;
|
|
||||||
import org.json.JSONObject;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import awais.instagrabber.BuildConfig;
|
|
||||||
import awais.instagrabber.models.enums.NotificationType;
|
|
||||||
import awais.instagrabber.repositories.NewsRepository;
|
import awais.instagrabber.repositories.NewsRepository;
|
||||||
import awais.instagrabber.repositories.responses.AymlResponse;
|
import awais.instagrabber.repositories.responses.AymlResponse;
|
||||||
import awais.instagrabber.repositories.responses.AymlUser;
|
import awais.instagrabber.repositories.responses.AymlUser;
|
||||||
import awais.instagrabber.repositories.responses.NotificationCounts;
|
import awais.instagrabber.repositories.responses.notification.NotificationCounts;
|
||||||
import awais.instagrabber.repositories.responses.UserSearchResponse;
|
import awais.instagrabber.repositories.responses.UserSearchResponse;
|
||||||
import awais.instagrabber.repositories.responses.NewsInboxResponse;
|
import awais.instagrabber.repositories.responses.NewsInboxResponse;
|
||||||
import awais.instagrabber.repositories.responses.Notification;
|
import awais.instagrabber.repositories.responses.notification.Notification;
|
||||||
import awais.instagrabber.repositories.responses.NotificationArgs;
|
import awais.instagrabber.repositories.responses.notification.NotificationArgs;
|
||||||
import awais.instagrabber.repositories.responses.NotificationImage;
|
|
||||||
import awais.instagrabber.repositories.responses.User;
|
import awais.instagrabber.repositories.responses.User;
|
||||||
import awais.instagrabber.utils.Constants;
|
import awais.instagrabber.utils.Constants;
|
||||||
import awais.instagrabber.utils.Utils;
|
|
||||||
import retrofit2.Call;
|
import retrofit2.Call;
|
||||||
import retrofit2.Callback;
|
import retrofit2.Callback;
|
||||||
import retrofit2.Response;
|
import retrofit2.Response;
|
||||||
|
Loading…
Reference in New Issue
Block a user