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
|
@MainThread
|
||||||
public void remove(long id) {
|
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);
|
Tweet tweet = tweets.get(pos);
|
||||||
if (tweet != null && tweet.getId() == id) {
|
if (tweet != null) {
|
||||||
tweets.remove(pos);
|
Tweet embedded = tweet.getEmbeddedTweet();
|
||||||
notifyItemRemoved(pos);
|
// remove tweet and any retweet of it
|
||||||
break;
|
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
|
* remove user from adapter
|
||||||
*
|
*
|
||||||
* @param screenname User to remove
|
* @param name screen name of the user to remove
|
||||||
*/
|
*/
|
||||||
@MainThread
|
@MainThread
|
||||||
public void removeUser(String screenname) {
|
public void removeUser(String name) {
|
||||||
int pos = data.removeItem(screenname);
|
int pos = data.removeItem(name);
|
||||||
if (pos >= 0) {
|
if (pos >= 0) {
|
||||||
data.remove(pos);
|
|
||||||
notifyItemRemoved(pos);
|
notifyItemRemoved(pos);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -46,7 +46,7 @@ import static jp.wasabeef.picasso.transformations.CropTransformation.GravityHori
|
|||||||
import static jp.wasabeef.picasso.transformations.CropTransformation.GravityVertical.TOP;
|
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
|
* @author nuclearfog
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user