Fixes a bug when coming from notifications and the toot is displayed twice.
This commit is contained in:
parent
1cc9df1de1
commit
55cdb41780
|
@ -253,9 +253,16 @@ public class DisplayNotificationsFragment extends Fragment implements OnRetrieve
|
|||
lv_notifications.setAdapter(notificationsListAdapter);
|
||||
swiped = false;
|
||||
}
|
||||
ArrayList<String> added = new ArrayList<>();
|
||||
for(Notification notification : this.notifications){
|
||||
added.add(notification.getId());
|
||||
}
|
||||
if( notifications != null && notifications.size() > 0) {
|
||||
for(Notification tmpNotification: notifications){
|
||||
this.notifications.add(tmpNotification);
|
||||
if( !added.contains(tmpNotification.getId())) {
|
||||
this.notifications.add(tmpNotification);
|
||||
added.add(tmpNotification.getId());
|
||||
}
|
||||
}
|
||||
notificationsListAdapter.notifyDataSetChanged();
|
||||
}
|
||||
|
|
|
@ -25,7 +25,6 @@ import android.support.v4.app.Fragment;
|
|||
import android.support.v4.content.LocalBroadcastManager;
|
||||
import android.support.v4.view.ViewCompat;
|
||||
import android.support.v4.widget.SwipeRefreshLayout;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
@ -331,9 +330,16 @@ public class DisplayStatusFragment extends Fragment implements OnRetrieveFeedsIn
|
|||
lv_status.setAdapter(statusListAdapter);
|
||||
swiped = false;
|
||||
}
|
||||
ArrayList<String> added = new ArrayList<>();
|
||||
for(Status status : this.statuses){
|
||||
added.add(status.getId());
|
||||
}
|
||||
if( statuses != null && statuses.size() > 0) {
|
||||
for(Status tmpStatus: statuses){
|
||||
this.statuses.add(tmpStatus);
|
||||
if( !added.contains(tmpStatus.getId())) {
|
||||
this.statuses.add(tmpStatus);
|
||||
added.add(tmpStatus.getId());
|
||||
}
|
||||
}
|
||||
statusListAdapter.notifyDataSetChanged();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue