From a41046c59a1412a9e623e3e39b9759ad184a0479 Mon Sep 17 00:00:00 2001 From: Thomas Date: Wed, 27 Jan 2021 11:04:03 +0100 Subject: [PATCH] copy release notes --- .../client/Entities/PixelfedAttachment.java | 176 ++++++++++++++++++ 1 file changed, 176 insertions(+) create mode 100644 app/src/main/java/app/fedilab/android/client/Entities/PixelfedAttachment.java diff --git a/app/src/main/java/app/fedilab/android/client/Entities/PixelfedAttachment.java b/app/src/main/java/app/fedilab/android/client/Entities/PixelfedAttachment.java new file mode 100644 index 000000000..ca63af1bc --- /dev/null +++ b/app/src/main/java/app/fedilab/android/client/Entities/PixelfedAttachment.java @@ -0,0 +1,176 @@ +/* Copyright 2017 Thomas Schneider + * + * This file is a part of Fedilab + * + * This program is free software; you can redistribute it and/or modify it under the terms of the + * GNU General Public License as published by the Free Software Foundation; either version 3 of the + * License, or (at your option) any later version. + * + * Fedilab is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even + * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General + * Public License for more details. + * + * You should have received a copy of the GNU General Public License along with Fedilab; if not, + * see . */ +package app.fedilab.android.client.Entities; + +import android.os.Parcel; +import android.os.Parcelable; + +/** + * Created by Thomas on 23/04/2017. + * Manages Media + */ + + +public class Attachment implements Parcelable { + + public static final Creator CREATOR = new Creator() { + @Override + public Attachment createFromParcel(Parcel source) { + return new Attachment(source); + } + + @Override + public Attachment[] newArray(int size) { + return new Attachment[size]; + } + }; + private String id; + private int viewId; + private String type; + private String url; + private String remote_url; + private String preview_url; + private String meta; + private String text_url; + private String description; + private String local_path; + private boolean is_nsfw = false; + + public Attachment() { + + } + + protected Attachment(Parcel in) { + this.id = in.readString(); + this.viewId = in.readInt(); + this.type = in.readString(); + this.url = in.readString(); + this.remote_url = in.readString(); + this.preview_url = in.readString(); + this.meta = in.readString(); + this.text_url = in.readString(); + this.description = in.readString(); + this.local_path = in.readString(); + this.is_nsfw = in.readByte() != 0; + } + + public int getViewId() { + return viewId; + } + + public void setViewId(int viewId) { + this.viewId = viewId; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + public String getRemote_url() { + return remote_url; + } + + public void setRemote_url(String remote_url) { + this.remote_url = remote_url; + } + + public String getPreview_url() { + return preview_url; + } + + public void setPreview_url(String preview_url) { + this.preview_url = preview_url; + } + + public String getText_url() { + return text_url; + } + + public void setText_url(String text_url) { + this.text_url = text_url; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getMeta() { + return meta; + } + + public void setMeta(String meta) { + this.meta = meta; + } + + public String getLocal_path() { + return local_path; + } + + public void setLocal_path(String local_path) { + this.local_path = local_path; + } + + public boolean isIs_nsfw() { + return is_nsfw; + } + + public void setIs_nsfw(boolean is_nsfw) { + this.is_nsfw = is_nsfw; + } + + @Override + public int describeContents() { + return 0; + } + + @Override + public void writeToParcel(Parcel dest, int flags) { + dest.writeString(this.id); + dest.writeInt(this.viewId); + dest.writeString(this.type); + dest.writeString(this.url); + dest.writeString(this.remote_url); + dest.writeString(this.preview_url); + dest.writeString(this.meta); + dest.writeString(this.text_url); + dest.writeString(this.description); + dest.writeString(this.local_path); + dest.writeByte(this.is_nsfw ? (byte) 1 : (byte) 0); + } +}