fixed crash on user list, added better tweet removing from tweet list, comment update
This commit is contained in:
parent
cb5cf885ac
commit
f1bfaff589
@ -141,12 +141,15 @@ public class TweetAdapter extends Adapter<ViewHolder> {
|
||||
*/
|
||||
@MainThread
|
||||
public void remove(long id) {
|
||||
for (int pos = 0; pos < tweets.size(); pos++) {
|
||||
for (int pos = tweets.size() - 1; pos >= 0; pos--) {
|
||||
Tweet tweet = tweets.get(pos);
|
||||
if (tweet != null && tweet.getId() == id) {
|
||||
tweets.remove(pos);
|
||||
notifyItemRemoved(pos);
|
||||
break;
|
||||
if (tweet != null) {
|
||||
Tweet embedded = tweet.getEmbeddedTweet();
|
||||
// remove tweet and any retweet of it
|
||||
if (tweet.getId() == id || (embedded != null && embedded.getId() == id)) {
|
||||
tweets.remove(pos);
|
||||
notifyItemRemoved(pos);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -120,13 +120,12 @@ public class UserAdapter extends Adapter<ViewHolder> {
|
||||
/**
|
||||
* remove user from adapter
|
||||
*
|
||||
* @param screenname User to remove
|
||||
* @param name screen name of the user to remove
|
||||
*/
|
||||
@MainThread
|
||||
public void removeUser(String screenname) {
|
||||
int pos = data.removeItem(screenname);
|
||||
public void removeUser(String name) {
|
||||
int pos = data.removeItem(name);
|
||||
if (pos >= 0) {
|
||||
data.remove(pos);
|
||||
notifyItemRemoved(pos);
|
||||
}
|
||||
}
|
||||
|
@ -46,7 +46,7 @@ import static jp.wasabeef.picasso.transformations.CropTransformation.GravityHori
|
||||
import static jp.wasabeef.picasso.transformations.CropTransformation.GravityVertical.TOP;
|
||||
|
||||
/**
|
||||
* Class to set up all TetView preferences
|
||||
* Theme class to set all view styles such as text or drawable color
|
||||
*
|
||||
* @author nuclearfog
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user