Rename UndoItem to UndoToken
This commit is contained in:
parent
a66d225b9f
commit
b11654fa02
|
@ -91,7 +91,7 @@ public class OrganizeQueueActivity extends SherlockListActivity implements UndoB
|
||||||
FeedItem item = (FeedItem) getListAdapter().getItem(which);
|
FeedItem item = (FeedItem) getListAdapter().getItem(which);
|
||||||
manager.removeQueueItem(OrganizeQueueActivity.this, item);
|
manager.removeQueueItem(OrganizeQueueActivity.this, item);
|
||||||
undoBarController.showUndoBar(false, getString(R.string.removed_from_queue),
|
undoBarController.showUndoBar(false, getString(R.string.removed_from_queue),
|
||||||
new UndoItem(item, which));
|
new UndoToken(item, which));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -121,9 +121,9 @@ public class OrganizeQueueActivity extends SherlockListActivity implements UndoB
|
||||||
@Override
|
@Override
|
||||||
public void onUndo(Parcelable token) {
|
public void onUndo(Parcelable token) {
|
||||||
// Perform the undo
|
// Perform the undo
|
||||||
UndoItem undoItem = (UndoItem) token;
|
UndoToken undoToken = (UndoToken) token;
|
||||||
FeedItem feedItem = undoItem.getFeedItem();
|
FeedItem feedItem = undoToken.getFeedItem();
|
||||||
int position = undoItem.getPosition();
|
int position = undoToken.getPosition();
|
||||||
|
|
||||||
FeedManager manager = FeedManager.getInstance();
|
FeedManager manager = FeedManager.getInstance();
|
||||||
manager.addQueueItemAt(OrganizeQueueActivity.this, feedItem, position, false);
|
manager.addQueueItemAt(OrganizeQueueActivity.this, feedItem, position, false);
|
||||||
|
@ -204,32 +204,32 @@ public class OrganizeQueueActivity extends SherlockListActivity implements UndoB
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class UndoItem implements Parcelable {
|
private static class UndoToken implements Parcelable {
|
||||||
private long itemId;
|
private long itemId;
|
||||||
private long feedId;
|
private long feedId;
|
||||||
private int position;
|
private int position;
|
||||||
|
|
||||||
public UndoItem(FeedItem item, int position) {
|
public UndoToken(FeedItem item, int position) {
|
||||||
FeedManager manager = FeedManager.getInstance();
|
FeedManager manager = FeedManager.getInstance();
|
||||||
this.itemId = item.getId();
|
this.itemId = item.getId();
|
||||||
this.feedId = item.getFeed().getId();
|
this.feedId = item.getFeed().getId();
|
||||||
this.position = position;
|
this.position = position;
|
||||||
}
|
}
|
||||||
|
|
||||||
private UndoItem(Parcel in) {
|
private UndoToken(Parcel in) {
|
||||||
itemId = in.readLong();
|
itemId = in.readLong();
|
||||||
feedId = in.readLong();
|
feedId = in.readLong();
|
||||||
position = in.readInt();
|
position = in.readInt();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final Parcelable.Creator<UndoItem> CREATOR
|
public static final Parcelable.Creator<UndoToken> CREATOR
|
||||||
= new Parcelable.Creator<UndoItem>() {
|
= new Parcelable.Creator<UndoToken>() {
|
||||||
public UndoItem createFromParcel(Parcel in) {
|
public UndoToken createFromParcel(Parcel in) {
|
||||||
return new UndoItem(in);
|
return new UndoToken(in);
|
||||||
}
|
}
|
||||||
|
|
||||||
public UndoItem[] newArray(int size) {
|
public UndoToken[] newArray(int size) {
|
||||||
return new UndoItem[size];
|
return new UndoToken[size];
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue