Browse Source

#583

renovate/org.robolectric-robolectric-4.x
Austin Huang 4 years ago
parent
commit
eba37705e2
No known key found for this signature in database GPG Key ID: 84C23AA04587A91F
  1. 3
      app/src/main/java/awais/instagrabber/fragments/CommentsViewerFragment.java
  2. 9
      app/src/main/java/awais/instagrabber/fragments/FollowViewerFragment.java
  3. 6
      app/src/main/java/awais/instagrabber/fragments/NotificationsViewerFragment.java
  4. 3
      app/src/main/java/awais/instagrabber/fragments/StoryViewerFragment.java
  5. 1
      app/src/main/java/awais/instagrabber/webservices/BaseService.java

3
app/src/main/java/awais/instagrabber/fragments/CommentsViewerFragment.java

@ -99,10 +99,13 @@ public final class CommentsViewerFragment extends BottomSheetDialogFragment impl
@Override @Override
public void onFailure(Throwable t) { public void onFailure(Throwable t) {
try {
Toast.makeText(getContext(), t.getMessage(), Toast.LENGTH_SHORT).show(); Toast.makeText(getContext(), t.getMessage(), Toast.LENGTH_SHORT).show();
binding.swipeRefreshLayout.setRefreshing(false); binding.swipeRefreshLayout.setRefreshing(false);
stopCurrentExecutor(); stopCurrentExecutor();
} }
catch(Throwable e) {}
}
}; };
private final CommentsAdapter.CommentCallback commentCallback = new CommentsAdapter.CommentCallback() { private final CommentsAdapter.CommentCallback commentCallback = new CommentsAdapter.CommentCallback() {

9
app/src/main/java/awais/instagrabber/fragments/FollowViewerFragment.java

@ -83,8 +83,11 @@ public final class FollowViewerFragment extends Fragment implements SwipeRefresh
@Override @Override
public void onFailure(final Throwable t) { public void onFailure(final Throwable t) {
try {
binding.swipeRefreshLayout.setRefreshing(false); binding.swipeRefreshLayout.setRefreshing(false);
Toast.makeText(getContext(), t.getMessage(), Toast.LENGTH_SHORT).show(); Toast.makeText(getContext(), t.getMessage(), Toast.LENGTH_SHORT).show();
}
catch(Throwable e) {}
Log.e(TAG, "Error fetching list (double, following)", t); Log.e(TAG, "Error fetching list (double, following)", t);
} }
}; };
@ -109,8 +112,11 @@ public final class FollowViewerFragment extends Fragment implements SwipeRefresh
@Override @Override
public void onFailure(final Throwable t) { public void onFailure(final Throwable t) {
try {
binding.swipeRefreshLayout.setRefreshing(false); binding.swipeRefreshLayout.setRefreshing(false);
Toast.makeText(getContext(), t.getMessage(), Toast.LENGTH_SHORT).show(); Toast.makeText(getContext(), t.getMessage(), Toast.LENGTH_SHORT).show();
}
catch(Throwable e) {}
Log.e(TAG, "Error fetching list (double, follower)", t); Log.e(TAG, "Error fetching list (double, follower)", t);
} }
}; };
@ -221,8 +227,11 @@ public final class FollowViewerFragment extends Fragment implements SwipeRefresh
@Override @Override
public void onFailure(final Throwable t) { public void onFailure(final Throwable t) {
try {
binding.swipeRefreshLayout.setRefreshing(false); binding.swipeRefreshLayout.setRefreshing(false);
Toast.makeText(getContext(), t.getMessage(), Toast.LENGTH_SHORT).show(); Toast.makeText(getContext(), t.getMessage(), Toast.LENGTH_SHORT).show();
}
catch(Throwable e) {}
Log.e(TAG, "Error fetching list (single)", t); Log.e(TAG, "Error fetching list (single)", t);
} }
}; };

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

@ -271,9 +271,12 @@ public final class NotificationsViewerFragment extends Fragment implements Swipe
@Override @Override
public void onFailure(Throwable t) { public void onFailure(Throwable t) {
try {
binding.swipeRefreshLayout.setRefreshing(false); binding.swipeRefreshLayout.setRefreshing(false);
Toast.makeText(getContext(), t.getMessage(), Toast.LENGTH_SHORT).show(); Toast.makeText(getContext(), t.getMessage(), Toast.LENGTH_SHORT).show();
} }
catch(Throwable e) {}
}
}).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR); }).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
break; break;
case "ayml": case "ayml":
@ -287,9 +290,12 @@ public final class NotificationsViewerFragment extends Fragment implements Swipe
@Override @Override
public void onFailure(final Throwable t) { public void onFailure(final Throwable t) {
try {
binding.swipeRefreshLayout.setRefreshing(false); binding.swipeRefreshLayout.setRefreshing(false);
Toast.makeText(getContext(), t.getMessage(), Toast.LENGTH_SHORT).show(); Toast.makeText(getContext(), t.getMessage(), Toast.LENGTH_SHORT).show();
} }
catch(Throwable e) {}
}
}); });
break; break;
} }

3
app/src/main/java/awais/instagrabber/fragments/StoryViewerFragment.java

@ -236,9 +236,12 @@ public class StoryViewerFragment extends Fragment {
@Override @Override
public void onFailure(@NonNull final Call<DirectThreadBroadcastResponse> call, @NonNull final Throwable t) { public void onFailure(@NonNull final Call<DirectThreadBroadcastResponse> call, @NonNull final Throwable t) {
try {
Toast.makeText(context, R.string.downloader_unknown_error, Toast.LENGTH_SHORT).show(); Toast.makeText(context, R.string.downloader_unknown_error, Toast.LENGTH_SHORT).show();
Log.e(TAG, "onFailure: ", t); Log.e(TAG, "onFailure: ", t);
} }
catch(Throwable e) {}
}
}); });
} catch (UnsupportedEncodingException e) { } catch (UnsupportedEncodingException e) {
Log.e(TAG, "Error", e); Log.e(TAG, "Error", e);

1
app/src/main/java/awais/instagrabber/webservices/BaseService.java

@ -35,6 +35,7 @@ public abstract class BaseService {
final Gson gson = new GsonBuilder() final Gson gson = new GsonBuilder()
.setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES) .setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES)
.registerTypeAdapter(Caption.class, new Caption.CaptionDeserializer()) .registerTypeAdapter(Caption.class, new Caption.CaptionDeserializer())
.setLenient()
.create(); .create();
builder = new Retrofit.Builder() builder = new Retrofit.Builder()
.addConverterFactory(ScalarsConverterFactory.create()) .addConverterFactory(ScalarsConverterFactory.create())

Loading…
Cancel
Save