1
0
mirror of https://github.com/KokaKiwi/BarInsta synced 2024-11-04 14:17:30 +00:00

crash resolution

This commit is contained in:
Austin Huang 2020-09-09 15:59:16 -04:00
parent 3e7097ff6d
commit 1cc21896b7
No known key found for this signature in database
GPG Key ID: 84C23AA04587A91F
3 changed files with 4 additions and 4 deletions

View File

@ -68,8 +68,8 @@ public final class FeedAdapter extends ListAdapter<FeedModel, FeedItemViewHolder
final ItemFeedSliderBinding binding = ItemFeedSliderBinding.inflate(layoutInflater, parent, false); final ItemFeedSliderBinding binding = ItemFeedSliderBinding.inflate(layoutInflater, parent, false);
return new FeedSliderViewHolder(binding, mentionClickListener, clickListener, longClickListener); 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); final ItemFeedPhotoBinding binding = ItemFeedPhotoBinding.inflate(layoutInflater, parent, false);
return new FeedPhotoViewHolder(binding, mentionClickListener, clickListener, longClickListener); return new FeedPhotoViewHolder(binding, mentionClickListener, clickListener, longClickListener);
} }

View File

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

View File

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