Browse Source

crash resolution

renovate/org.robolectric-robolectric-4.x
Austin Huang 4 years ago
parent
commit
1cc21896b7
No known key found for this signature in database GPG Key ID: 84C23AA04587A91F
  1. 4
      app/src/main/java/awais/instagrabber/adapters/FeedAdapter.java
  2. 2
      app/src/main/java/awais/instagrabber/customviews/RamboTextView.java
  3. 2
      app/src/main/java/awais/instagrabber/fragments/SavedViewerFragment.java

4
app/src/main/java/awais/instagrabber/adapters/FeedAdapter.java

@ -68,8 +68,8 @@ public final class FeedAdapter extends ListAdapter<FeedModel, FeedItemViewHolder
final ItemFeedSliderBinding binding = ItemFeedSliderBinding.inflate(layoutInflater, parent, false);
return new FeedSliderViewHolder(binding, mentionClickListener, clickListener, longClickListener);
}
default:
case MEDIA_TYPE_IMAGE: {
case MEDIA_TYPE_IMAGE:
default: {
final ItemFeedPhotoBinding binding = ItemFeedPhotoBinding.inflate(layoutInflater, parent, false);
return new FeedPhotoViewHolder(binding, mentionClickListener, clickListener, longClickListener);
}

2
app/src/main/java/awais/instagrabber/customviews/RamboTextView.java

@ -40,7 +40,7 @@ public final class RamboTextView extends AppCompatTextView {
private final Handler handler = new Handler();
private final Runnable longPressRunnable = () -> {
longClickListener.onLongClick(this);
if (longClickListener != null) longClickListener.onLongClick(this);
};
public RamboTextView(final Context context) {

2
app/src/main/java/awais/instagrabber/fragments/SavedViewerFragment.java

@ -106,7 +106,7 @@ public final class SavedViewerFragment extends Fragment implements SwipeRefreshL
@Override
public void onResult(final PostModel[] result) {
final List<PostModel> current = postsViewModel.getList().getValue();
if (result != null) {
if (result != null && result.length > 0) {
final List<PostModel> resultList = Arrays.asList(result);
if (current == null) {
postsViewModel.getList().postValue(resultList);

Loading…
Cancel
Save