1
0
mirror of https://github.com/KokaKiwi/BarInsta synced 2024-12-23 05:16:58 +00:00

reorganize responses

This commit is contained in:
Austin Huang 2021-03-22 14:51:44 -04:00
parent aca44f0ab9
commit 1dd78b7d91
No known key found for this signature in database
GPG Key ID: 84C23AA04587A91F
18 changed files with 32 additions and 40 deletions

View File

@ -16,7 +16,7 @@ import java.util.stream.Collectors;
import awais.instagrabber.adapters.viewholder.NotificationViewHolder;
import awais.instagrabber.databinding.ItemNotificationBinding;
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> {
private final OnNotificationClickListener notificationClickListener;

View File

@ -9,8 +9,8 @@ import awais.instagrabber.R;
import awais.instagrabber.adapters.NotificationsAdapter.OnNotificationClickListener;
import awais.instagrabber.databinding.ItemNotificationBinding;
import awais.instagrabber.models.enums.NotificationType;
import awais.instagrabber.repositories.responses.Notification;
import awais.instagrabber.repositories.responses.NotificationArgs;
import awais.instagrabber.repositories.responses.notification.Notification;
import awais.instagrabber.repositories.responses.notification.NotificationArgs;
public final class NotificationViewHolder extends RecyclerView.ViewHolder {
private final ItemNotificationBinding binding;

View File

@ -2,7 +2,6 @@ package awais.instagrabber.fragments;
import android.content.Context;
import android.content.DialogInterface;
import android.os.AsyncTask;
import android.os.Bundle;
import android.text.SpannableString;
import android.text.Spanned;
@ -37,9 +36,9 @@ import awais.instagrabber.models.enums.NotificationType;
import awais.instagrabber.repositories.requests.StoryViewerOptions;
import awais.instagrabber.repositories.responses.FriendshipChangeResponse;
import awais.instagrabber.repositories.responses.Media;
import awais.instagrabber.repositories.responses.Notification;
import awais.instagrabber.repositories.responses.NotificationArgs;
import awais.instagrabber.repositories.responses.NotificationImage;
import awais.instagrabber.repositories.responses.notification.Notification;
import awais.instagrabber.repositories.responses.notification.NotificationArgs;
import awais.instagrabber.repositories.responses.notification.NotificationImage;
import awais.instagrabber.utils.Constants;
import awais.instagrabber.utils.CookieUtils;
import awais.instagrabber.utils.TextUtils;

View File

@ -2,7 +2,7 @@ package awais.instagrabber.repositories;
import java.util.Map;
import awais.instagrabber.repositories.responses.FeedFetchResponse;
import awais.instagrabber.repositories.responses.feed.FeedFetchResponse;
import retrofit2.Call;
import retrofit2.http.FieldMap;
import retrofit2.http.FormUrlEncoded;

View File

@ -9,6 +9,7 @@ import java.util.Map;
import java.util.Objects;
import awais.instagrabber.models.enums.MediaItemType;
import awais.instagrabber.repositories.responses.feed.EndOfFeedDemarcator;
import awais.instagrabber.utils.Utils;
public class Media implements Serializable {

View File

@ -2,6 +2,9 @@ package awais.instagrabber.repositories.responses;
import java.util.List;
import awais.instagrabber.repositories.responses.notification.Notification;
import awais.instagrabber.repositories.responses.notification.NotificationCounts;
public class NewsInboxResponse {
private final NotificationCounts counts;
private final List<Notification> newStories;

View File

@ -1,4 +1,4 @@
package awais.instagrabber.repositories.responses;
package awais.instagrabber.repositories.responses.feed;
import java.io.Serializable;
import java.util.Objects;

View File

@ -1,9 +1,11 @@
package awais.instagrabber.repositories.responses;
package awais.instagrabber.repositories.responses.feed;
import java.io.Serializable;
import java.util.List;
import java.util.Objects;
import awais.instagrabber.repositories.responses.Media;
public class EndOfFeedGroup implements Serializable {
private final String id;
private final String title;

View File

@ -1,4 +1,4 @@
package awais.instagrabber.repositories.responses;
package awais.instagrabber.repositories.responses.feed;
import java.io.Serializable;
import java.util.List;

View File

@ -1,7 +1,9 @@
package awais.instagrabber.repositories.responses;
package awais.instagrabber.repositories.responses.feed;
import java.util.List;
import awais.instagrabber.repositories.responses.Media;
public class FeedFetchResponse {
private final List<Media> items;
private final int numResults;

View File

@ -1,4 +1,4 @@
package awais.instagrabber.repositories.responses;
package awais.instagrabber.repositories.responses.notification;
import awais.instagrabber.models.enums.NotificationType;

View File

@ -1,4 +1,4 @@
package awais.instagrabber.repositories.responses;
package awais.instagrabber.repositories.responses.notification;
import androidx.annotation.NonNull;
@ -7,8 +7,6 @@ import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import android.util.Log;
import awais.instagrabber.utils.Utils;
public class NotificationArgs {

View File

@ -1,4 +1,4 @@
package awais.instagrabber.repositories.responses;
package awais.instagrabber.repositories.responses.notification;
import androidx.annotation.NonNull;

View File

@ -1,4 +1,4 @@
package awais.instagrabber.repositories.responses;
package awais.instagrabber.repositories.responses.notification;
public class NotificationImage {
private final String id;

View File

@ -18,13 +18,11 @@ import java.util.List;
import awais.instagrabber.R;
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.webservices.NewsService;
import awais.instagrabber.webservices.ServiceCallback;
import static awais.instagrabber.utils.Utils.settingsHelper;
public class ActivityCheckerService extends Service {
private static final String TAG = "ActivityCheckerService";
private static final int INITIAL_DELAY_MILLIS = 200;

View File

@ -5,7 +5,7 @@ import androidx.lifecycle.ViewModel;
import java.util.List;
import awais.instagrabber.repositories.responses.Notification;
import awais.instagrabber.repositories.responses.notification.Notification;
public class NotificationViewModel extends ViewModel {
private MutableLiveData<List<Notification>> list;

View File

@ -12,10 +12,10 @@ import java.util.Map;
import java.util.UUID;
import awais.instagrabber.repositories.FeedRepository;
import awais.instagrabber.repositories.responses.EndOfFeedDemarcator;
import awais.instagrabber.repositories.responses.EndOfFeedGroup;
import awais.instagrabber.repositories.responses.EndOfFeedGroupSet;
import awais.instagrabber.repositories.responses.FeedFetchResponse;
import awais.instagrabber.repositories.responses.feed.EndOfFeedDemarcator;
import awais.instagrabber.repositories.responses.feed.EndOfFeedGroup;
import awais.instagrabber.repositories.responses.feed.EndOfFeedGroupSet;
import awais.instagrabber.repositories.responses.feed.FeedFetchResponse;
import awais.instagrabber.repositories.responses.Media;
import awais.instagrabber.repositories.responses.PostsFetchResponse;
import awais.instagrabber.utils.TextUtils;

View File

@ -1,35 +1,24 @@
package awais.instagrabber.webservices;
import android.util.Log;
import androidx.annotation.NonNull;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import java.util.stream.Collectors;
import awais.instagrabber.BuildConfig;
import awais.instagrabber.models.enums.NotificationType;
import awais.instagrabber.repositories.NewsRepository;
import awais.instagrabber.repositories.responses.AymlResponse;
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.NewsInboxResponse;
import awais.instagrabber.repositories.responses.Notification;
import awais.instagrabber.repositories.responses.NotificationArgs;
import awais.instagrabber.repositories.responses.NotificationImage;
import awais.instagrabber.repositories.responses.notification.Notification;
import awais.instagrabber.repositories.responses.notification.NotificationArgs;
import awais.instagrabber.repositories.responses.User;
import awais.instagrabber.utils.Constants;
import awais.instagrabber.utils.Utils;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;