Elements to display migration
This commit is contained in:
parent
5c8f10f806
commit
15fe273fb3
|
@ -1736,6 +1736,7 @@ public class API {
|
||||||
* @param resobj JSONObject
|
* @param resobj JSONObject
|
||||||
* @return Account
|
* @return Account
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("InfiniteRecursion")
|
||||||
private static Account parseAccountResponse(Context context, JSONObject resobj){
|
private static Account parseAccountResponse(Context context, JSONObject resobj){
|
||||||
|
|
||||||
Account account = new Account();
|
Account account = new Account();
|
||||||
|
@ -1750,6 +1751,9 @@ public class API {
|
||||||
account.setFollowing_count(Integer.valueOf(resobj.get("following_count").toString()));
|
account.setFollowing_count(Integer.valueOf(resobj.get("following_count").toString()));
|
||||||
account.setStatuses_count(Integer.valueOf(resobj.get("statuses_count").toString()));
|
account.setStatuses_count(Integer.valueOf(resobj.get("statuses_count").toString()));
|
||||||
account.setNote(resobj.get("note").toString());
|
account.setNote(resobj.get("note").toString());
|
||||||
|
try{
|
||||||
|
account.setMoved_to_account(parseAccountResponse(context, resobj.getJSONObject("moved_to_account")));
|
||||||
|
}catch (Exception ignored){}
|
||||||
account.setUrl(resobj.get("url").toString());
|
account.setUrl(resobj.get("url").toString());
|
||||||
account.setAvatar(resobj.get("avatar").toString());
|
account.setAvatar(resobj.get("avatar").toString());
|
||||||
account.setAvatar_static(resobj.get("avatar_static").toString());
|
account.setAvatar_static(resobj.get("avatar_static").toString());
|
||||||
|
|
|
@ -50,6 +50,7 @@ public class Account implements Parcelable {
|
||||||
private boolean isFollowing;
|
private boolean isFollowing;
|
||||||
private followAction followType = followAction.NOTHING;
|
private followAction followType = followAction.NOTHING;
|
||||||
private boolean isMakingAction = false;
|
private boolean isMakingAction = false;
|
||||||
|
private Account moved_to_account;
|
||||||
|
|
||||||
public followAction getFollowType() {
|
public followAction getFollowType() {
|
||||||
return followType;
|
return followType;
|
||||||
|
@ -67,6 +68,14 @@ public class Account implements Parcelable {
|
||||||
isMakingAction = makingAction;
|
isMakingAction = makingAction;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Account getMoved_to_account() {
|
||||||
|
return moved_to_account;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMoved_to_account(Account moved_to_account) {
|
||||||
|
this.moved_to_account = moved_to_account;
|
||||||
|
}
|
||||||
|
|
||||||
public enum followAction{
|
public enum followAction{
|
||||||
FOLLOW,
|
FOLLOW,
|
||||||
NOT_FOLLOW,
|
NOT_FOLLOW,
|
||||||
|
@ -83,6 +92,7 @@ public class Account implements Parcelable {
|
||||||
acct = in.readString();
|
acct = in.readString();
|
||||||
display_name = in.readString();
|
display_name = in.readString();
|
||||||
locked = in.readByte() != 0;
|
locked = in.readByte() != 0;
|
||||||
|
moved_to_account = in.readParcelable(Account.class.getClassLoader());
|
||||||
followers_count = in.readInt();
|
followers_count = in.readInt();
|
||||||
following_count = in.readInt();
|
following_count = in.readInt();
|
||||||
statuses_count = in.readInt();
|
statuses_count = in.readInt();
|
||||||
|
@ -257,6 +267,7 @@ public class Account implements Parcelable {
|
||||||
dest.writeString(username);
|
dest.writeString(username);
|
||||||
dest.writeString(acct);
|
dest.writeString(acct);
|
||||||
dest.writeString(display_name);
|
dest.writeString(display_name);
|
||||||
|
dest.writeParcelable(moved_to_account, flags);
|
||||||
dest.writeByte((byte) (locked ? 1 : 0));
|
dest.writeByte((byte) (locked ? 1 : 0));
|
||||||
dest.writeInt(followers_count);
|
dest.writeInt(followers_count);
|
||||||
dest.writeInt(following_count);
|
dest.writeInt(following_count);
|
||||||
|
|
|
@ -463,4 +463,7 @@
|
||||||
<string name="action_lists_title_placeholder">New list title</string>
|
<string name="action_lists_title_placeholder">New list title</string>
|
||||||
<string name="action_lists_search_users">Search among people you follow</string>
|
<string name="action_lists_search_users">Search among people you follow</string>
|
||||||
<string name="action_lists_owner">Your lists</string>
|
<string name="action_lists_owner">Your lists</string>
|
||||||
|
|
||||||
|
<!-- Migration -->
|
||||||
|
<string name="account_moved_to">%1$s has moved to: %2$s</string>
|
||||||
</resources>
|
</resources>
|
Loading…
Reference in New Issue