Crash fixes
This commit is contained in:
parent
162bc86ebe
commit
c60d06950f
|
@ -148,7 +148,7 @@ public class CacheController{
|
|||
.map(ng->{
|
||||
NotificationViewModel nvm=new NotificationViewModel();
|
||||
nvm.notification=ng;
|
||||
nvm.accounts=ng.sampleAccountIds.stream().map(accounts::get).collect(Collectors.toList());
|
||||
nvm.accounts=ng.sampleAccountIds.stream().map(accounts::get).filter(Objects::nonNull).collect(Collectors.toList());
|
||||
if(nvm.accounts.size()!=ng.sampleAccountIds.size())
|
||||
return null;
|
||||
if(ng.statusId!=null){
|
||||
|
|
|
@ -165,7 +165,10 @@ public class NotificationsListFragment extends BaseNotificationsListFragment{
|
|||
for(int i=0;i<parent.getChildCount();i++){
|
||||
View child=parent.getChildAt(i);
|
||||
if(parent.getChildViewHolder(child) instanceof StatusDisplayItem.Holder<?> holder){
|
||||
String itemID=getNotificationByID(holder.getItemID()).notification.pageMaxId;
|
||||
NotificationViewModel n=getNotificationByID(holder.getItemID());
|
||||
if(n==null)
|
||||
continue;
|
||||
String itemID=n.notification.pageMaxId;
|
||||
if(ObjectIdComparator.INSTANCE.compare(itemID, unreadMarker)>0){
|
||||
parent.getDecoratedBoundsWithMargins(child, tmpRect);
|
||||
c.drawRect(tmpRect, paint);
|
||||
|
|
|
@ -131,7 +131,7 @@ public class AccountActivationFragment extends ToolbarFragment{
|
|||
private void onOpenEmailClick(View v){
|
||||
try{
|
||||
startActivity(Intent.makeMainSelectorActivity(Intent.ACTION_MAIN, Intent.CATEGORY_APP_EMAIL).addFlags(Intent.FLAG_ACTIVITY_NEW_TASK));
|
||||
}catch(ActivityNotFoundException x){
|
||||
}catch(ActivityNotFoundException|IllegalArgumentException x){
|
||||
Toast.makeText(getActivity(), R.string.no_app_to_handle_action, Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -209,18 +209,22 @@ public class MediaGridStatusDisplayItem extends StatusDisplayItem{
|
|||
|
||||
@Override
|
||||
public void setImage(int index, Drawable drawable){
|
||||
controllers.get(index).setImage(drawable);
|
||||
if(index<controllers.size())
|
||||
controllers.get(index).setImage(drawable);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearImage(int index){
|
||||
controllers.get(index).clearImage();
|
||||
if(index<controllers.size())
|
||||
controllers.get(index).clearImage();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onImageLoadingFailed(int index, Throwable error){
|
||||
controllers.get(index).showFailedOverlay();
|
||||
thereAreFailedImages=true;
|
||||
if(index<controllers.size()){
|
||||
controllers.get(index).showFailedOverlay();
|
||||
thereAreFailedImages=true;
|
||||
}
|
||||
}
|
||||
|
||||
private void onViewClick(View v){
|
||||
|
|
Loading…
Reference in New Issue