@@ -14,6 +14,8 @@ import org.parceler.Parcel;
|
||||
import org.parceler.ParcelConstructor;
|
||||
import org.parceler.ParcelProperty;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
@Parcel
|
||||
@@ -44,6 +46,16 @@ public class Attachment extends BaseModel{
|
||||
blurhashPlaceholder=new BlurHashDrawable(placeholder, getWidth(), getHeight());
|
||||
}
|
||||
}
|
||||
public static List<Attachment> createFakeAttachments(String url, Drawable drawable){
|
||||
Attachment att=new Attachment();
|
||||
att.type=Attachment.Type.IMAGE;
|
||||
att.url=url;
|
||||
att.meta=new Attachment.Metadata();
|
||||
att.meta.width=drawable.getIntrinsicWidth();
|
||||
att.meta.height=drawable.getIntrinsicHeight();
|
||||
return Collections.singletonList(att);
|
||||
}
|
||||
|
||||
|
||||
public int getWidth(){
|
||||
if(meta==null)
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
package org.joinmastodon.android.model;
|
||||
|
||||
import org.joinmastodon.android.api.RequiredField;
|
||||
import org.parceler.Parcel;
|
||||
|
||||
@Parcel
|
||||
public class DomainBlock extends BaseModel {
|
||||
@RequiredField
|
||||
public String domain;
|
||||
@RequiredField
|
||||
public String digest;
|
||||
@RequiredField
|
||||
public Severity severity;
|
||||
public String comment;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "DomainBlock{" +
|
||||
"domain='" + domain + '\'' +
|
||||
", digest='" + digest + '\'' +
|
||||
", severity='" + severity + '\'' +
|
||||
", comment='" + comment + '\'' +
|
||||
'}';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package org.joinmastodon.android.model;
|
||||
|
||||
import org.joinmastodon.android.api.RequiredField;
|
||||
import org.parceler.Parcel;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Parcel
|
||||
public class ExtendedDescription extends BaseModel{
|
||||
@RequiredField
|
||||
public String content;
|
||||
public String updatedAt;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ExtendedDescription{" +
|
||||
"content='" + content + '\'' +
|
||||
", updatedAt='" + updatedAt + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package org.joinmastodon.android.model;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
import org.parceler.Parcel;
|
||||
|
||||
public enum Severity {
|
||||
@SerializedName("silence")
|
||||
SILENCE,
|
||||
@SerializedName("suspend")
|
||||
SUSPEND
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package org.joinmastodon.android.model;
|
||||
|
||||
import org.joinmastodon.android.api.RequiredField;
|
||||
import org.parceler.Parcel;
|
||||
|
||||
@Parcel
|
||||
public class WeeklyActivity extends BaseModel {
|
||||
@RequiredField
|
||||
public String week;
|
||||
@RequiredField
|
||||
public int statuses;
|
||||
@RequiredField
|
||||
public int logins;
|
||||
@RequiredField
|
||||
public int registrations;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "WeeklyActivity{" +
|
||||
"week=" + week +
|
||||
", statuses=" + statuses +
|
||||
", logins=" + logins +
|
||||
", registrations=" + registrations +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user