Browse Source

reorganize responses

renovate/org.robolectric-robolectric-4.x
Austin Huang 4 years ago
parent
commit
1dd78b7d91
No known key found for this signature in database GPG Key ID: 84C23AA04587A91F
  1. 2
      app/src/main/java/awais/instagrabber/adapters/NotificationsAdapter.java
  2. 4
      app/src/main/java/awais/instagrabber/adapters/viewholder/NotificationViewHolder.java
  3. 7
      app/src/main/java/awais/instagrabber/fragments/NotificationsViewerFragment.java
  4. 2
      app/src/main/java/awais/instagrabber/repositories/FeedRepository.java
  5. 1
      app/src/main/java/awais/instagrabber/repositories/responses/Media.java
  6. 3
      app/src/main/java/awais/instagrabber/repositories/responses/NewsInboxResponse.java
  7. 2
      app/src/main/java/awais/instagrabber/repositories/responses/feed/EndOfFeedDemarcator.java
  8. 4
      app/src/main/java/awais/instagrabber/repositories/responses/feed/EndOfFeedGroup.java
  9. 2
      app/src/main/java/awais/instagrabber/repositories/responses/feed/EndOfFeedGroupSet.java
  10. 4
      app/src/main/java/awais/instagrabber/repositories/responses/feed/FeedFetchResponse.java
  11. 2
      app/src/main/java/awais/instagrabber/repositories/responses/notification/Notification.java
  12. 4
      app/src/main/java/awais/instagrabber/repositories/responses/notification/NotificationArgs.java
  13. 2
      app/src/main/java/awais/instagrabber/repositories/responses/notification/NotificationCounts.java
  14. 2
      app/src/main/java/awais/instagrabber/repositories/responses/notification/NotificationImage.java
  15. 4
      app/src/main/java/awais/instagrabber/services/ActivityCheckerService.java
  16. 2
      app/src/main/java/awais/instagrabber/viewmodels/NotificationViewModel.java
  17. 8
      app/src/main/java/awais/instagrabber/webservices/FeedService.java
  18. 17
      app/src/main/java/awais/instagrabber/webservices/NewsService.java

2
app/src/main/java/awais/instagrabber/adapters/NotificationsAdapter.java

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

4
app/src/main/java/awais/instagrabber/adapters/viewholder/NotificationViewHolder.java

@ -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.NotificationArgs;
import awais.instagrabber.repositories.responses.notification.Notification;
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;

7
app/src/main/java/awais/instagrabber/fragments/NotificationsViewerFragment.java

@ -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.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.Constants;
import awais.instagrabber.utils.CookieUtils; import awais.instagrabber.utils.CookieUtils;
import awais.instagrabber.utils.TextUtils; import awais.instagrabber.utils.TextUtils;

2
app/src/main/java/awais/instagrabber/repositories/FeedRepository.java

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

1
app/src/main/java/awais/instagrabber/repositories/responses/Media.java

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

3
app/src/main/java/awais/instagrabber/repositories/responses/NewsInboxResponse.java

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

2
app/src/main/java/awais/instagrabber/repositories/responses/EndOfFeedDemarcator.java → app/src/main/java/awais/instagrabber/repositories/responses/feed/EndOfFeedDemarcator.java

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

4
app/src/main/java/awais/instagrabber/repositories/responses/EndOfFeedGroup.java → app/src/main/java/awais/instagrabber/repositories/responses/feed/EndOfFeedGroup.java

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

2
app/src/main/java/awais/instagrabber/repositories/responses/EndOfFeedGroupSet.java → app/src/main/java/awais/instagrabber/repositories/responses/feed/EndOfFeedGroupSet.java

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

4
app/src/main/java/awais/instagrabber/repositories/responses/FeedFetchResponse.java → app/src/main/java/awais/instagrabber/repositories/responses/feed/FeedFetchResponse.java

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

2
app/src/main/java/awais/instagrabber/repositories/responses/Notification.java → app/src/main/java/awais/instagrabber/repositories/responses/notification/Notification.java

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

4
app/src/main/java/awais/instagrabber/repositories/responses/NotificationArgs.java → app/src/main/java/awais/instagrabber/repositories/responses/notification/NotificationArgs.java

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

2
app/src/main/java/awais/instagrabber/repositories/responses/NotificationCounts.java → app/src/main/java/awais/instagrabber/repositories/responses/notification/NotificationCounts.java

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

2
app/src/main/java/awais/instagrabber/repositories/responses/NotificationImage.java → app/src/main/java/awais/instagrabber/repositories/responses/notification/NotificationImage.java

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

4
app/src/main/java/awais/instagrabber/services/ActivityCheckerService.java

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

2
app/src/main/java/awais/instagrabber/viewmodels/NotificationViewModel.java

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

8
app/src/main/java/awais/instagrabber/webservices/FeedService.java

@ -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.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.Media;
import awais.instagrabber.repositories.responses.PostsFetchResponse; import awais.instagrabber.repositories.responses.PostsFetchResponse;
import awais.instagrabber.utils.TextUtils; import awais.instagrabber.utils.TextUtils;

17
app/src/main/java/awais/instagrabber/webservices/NewsService.java

@ -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.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.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…
Cancel
Save