Commit 65002bf2 authored by Thomas's avatar Thomas
Browse files

some changes

parent 8e0808dc
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -83,12 +83,12 @@ public class Account implements Serializable {
        if (display_name == null) {
            display_name = username;
        }
        return SpannableHelper.convert(context, display_name, null, this, true, viewWeakReference);
        return SpannableHelper.convert(context, display_name, null, this, null, true, viewWeakReference);
    }


    public synchronized Spannable getSpanNote(Context context, WeakReference<View> viewWeakReference) {
        return SpannableHelper.convert(context, note, null, this, true, viewWeakReference);
        return SpannableHelper.convert(context, note, null, this, null, true, viewWeakReference);
    }

    public transient RelationShip relationShip;
+10 −3
Original line number Diff line number Diff line
@@ -14,13 +14,18 @@ package app.fedilab.android.client.entities.api;
 * You should have received a copy of the GNU General Public License along with Fedilab; if not,
 * see <http://www.gnu.org/licenses>. */

import android.content.Context;
import android.text.Spannable;
import android.view.View;

import com.google.gson.annotations.SerializedName;

import java.lang.ref.WeakReference;
import java.util.Date;
import java.util.List;

import app.fedilab.android.helper.SpannableHelper;

public class Announcement {
    @SerializedName("id")
    public String id;
@@ -49,7 +54,9 @@ public class Announcement {
    @SerializedName("reactions")
    public List<Reaction> reactions;

    //Some extra spannable element - They will be filled automatically when fetching the status
    public transient Spannable span_content;
    public transient boolean emojiFetched = false;

    public synchronized Spannable getSpanContent(Context context, WeakReference<View> viewWeakReference) {
        return SpannableHelper.convert(context, content, null, null, this, true, viewWeakReference);
    }

}
+22 −1
Original line number Diff line number Diff line
@@ -14,13 +14,22 @@ package app.fedilab.android.client.entities.api;
 * You should have received a copy of the GNU General Public License along with Fedilab; if not,
 * see <http://www.gnu.org/licenses>. */

import android.content.Context;
import android.text.Spannable;
import android.text.style.ForegroundColorSpan;
import android.view.View;

import androidx.core.content.ContextCompat;

import com.google.gson.annotations.SerializedName;

import java.io.Serializable;
import java.lang.ref.WeakReference;
import java.util.Date;

import app.fedilab.android.R;
import app.fedilab.android.helper.SpannableHelper;

public class Field implements Serializable {
    @SerializedName("name")
    public String name;
@@ -30,7 +39,19 @@ public class Field implements Serializable {
    public Date verified_at;

    //Some extra spannable element - They will be filled automatically when fetching the account
    public transient Spannable value_span;
    private ForegroundColorSpan value_span;

    public synchronized Spannable getValueSpan(Context context, Account account, WeakReference<View> viewWeakReference) {

        if (verified_at != null && value != null) {
            value_span = new ForegroundColorSpan(ContextCompat.getColor(context, R.color.verified_text));
        }
        Spannable spannable = SpannableHelper.convert(context, value, null, account, null, true, viewWeakReference);
        if (value_span != null && spannable != null) {
            spannable.setSpan(value_span, 0, spannable.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
        }
        return spannable;
    }

    public static class FieldParams implements Serializable {
        @SerializedName("name")
+1 −1
Original line number Diff line number Diff line
@@ -61,7 +61,7 @@ public class Poll implements Serializable {
        public Spannable span_title;

        public Spannable getSpanTitle(Context context, Status status, WeakReference<View> viewWeakReference) {
            span_title = SpannableHelper.convert(context, title, status, null, true, viewWeakReference);
            span_title = SpannableHelper.convert(context, title, status, null, null, true, viewWeakReference);
            return span_title;
        }
    }
+3 −3
Original line number Diff line number Diff line
@@ -109,7 +109,7 @@ public class Status implements Serializable, Cloneable {
    //Some extra spannable element - They will be filled automatically when fetching the status

    public synchronized Spannable getSpanContent(Context context, WeakReference<View> viewWeakReference) {
        return SpannableHelper.convert(context, content, this, null, true, viewWeakReference);
        return SpannableHelper.convert(context, content, this, null, null, true, viewWeakReference);
    }


@@ -118,11 +118,11 @@ public class Status implements Serializable, Cloneable {
    }

    public synchronized Spannable getSpanSpoiler(Context context, WeakReference<View> viewWeakReference) {
        return SpannableHelper.convert(context, spoiler_text, this, null, true, viewWeakReference);
        return SpannableHelper.convert(context, spoiler_text, this, null, null, true, viewWeakReference);
    }

    public synchronized Spannable getSpanTranslate(Context context, WeakReference<View> viewWeakReference) {
        return SpannableHelper.convert(context, translationContent, this, null, true, viewWeakReference);
        return SpannableHelper.convert(context, translationContent, this, null, null, true, viewWeakReference);
    }

    @NonNull
Loading