diff --git a/mastodon/src/main/java/org/joinmastodon/android/api/requests/tags/GetTag.java b/mastodon/src/main/java/org/joinmastodon/android/api/requests/tags/GetTag.java new file mode 100644 index 000000000..06b90b183 --- /dev/null +++ b/mastodon/src/main/java/org/joinmastodon/android/api/requests/tags/GetTag.java @@ -0,0 +1,10 @@ +package org.joinmastodon.android.api.requests.tags; + +import org.joinmastodon.android.api.MastodonAPIRequest; +import org.joinmastodon.android.model.Hashtag; + +public class GetTag extends MastodonAPIRequest{ + public GetTag(String tag){ + super(HttpMethod.GET, "/tags/"+tag, Hashtag.class); + } +} diff --git a/mastodon/src/main/java/org/joinmastodon/android/api/requests/tags/SetTagFollowed.java b/mastodon/src/main/java/org/joinmastodon/android/api/requests/tags/SetTagFollowed.java new file mode 100644 index 000000000..4ecf6e739 --- /dev/null +++ b/mastodon/src/main/java/org/joinmastodon/android/api/requests/tags/SetTagFollowed.java @@ -0,0 +1,11 @@ +package org.joinmastodon.android.api.requests.tags; + +import org.joinmastodon.android.api.MastodonAPIRequest; +import org.joinmastodon.android.model.Hashtag; + +public class SetTagFollowed extends MastodonAPIRequest{ + public SetTagFollowed(String tag, boolean followed){ + super(HttpMethod.POST, "/tags/"+tag+(followed ? "/follow" : "/unfollow"), Hashtag.class); + setRequestBody(new Object()); + } +} diff --git a/mastodon/src/main/java/org/joinmastodon/android/fragments/onboarding/SignupFragment.java b/mastodon/src/main/java/org/joinmastodon/android/fragments/onboarding/SignupFragment.java index 8455100c6..b0bf6d215 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/onboarding/SignupFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/onboarding/SignupFragment.java @@ -271,7 +271,7 @@ public class SignupFragment extends ToolbarFragment{ @Override public void tail(Node node, int depth){ if(node instanceof Element){ - ssb.setSpan(new LinkSpan("", SignupFragment.this::onGoBackLinkClick, LinkSpan.Type.CUSTOM, null), spanStart, ssb.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); + ssb.setSpan(new LinkSpan("", SignupFragment.this::onGoBackLinkClick, LinkSpan.Type.CUSTOM, null, null), spanStart, ssb.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); ssb.setSpan(new TypefaceSpan("sans-serif-medium"), spanStart, ssb.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); } } diff --git a/mastodon/src/main/java/org/joinmastodon/android/model/Hashtag.java b/mastodon/src/main/java/org/joinmastodon/android/model/Hashtag.java index 35db8a208..92c56ea5f 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/model/Hashtag.java +++ b/mastodon/src/main/java/org/joinmastodon/android/model/Hashtag.java @@ -14,6 +14,7 @@ public class Hashtag extends BaseModel implements DisplayItemsParent{ public boolean following; public List history; public int statusesCount; + public boolean following; @Override public String toString(){ @@ -23,6 +24,7 @@ public class Hashtag extends BaseModel implements DisplayItemsParent{ ", following="+following+ ", history="+history+ ", statusesCount="+statusesCount+ + ", following="+following+ '}'; } diff --git a/mastodon/src/main/java/org/joinmastodon/android/model/Translation.java b/mastodon/src/main/java/org/joinmastodon/android/model/Translation.java new file mode 100644 index 000000000..68487451d --- /dev/null +++ b/mastodon/src/main/java/org/joinmastodon/android/model/Translation.java @@ -0,0 +1,10 @@ +package org.joinmastodon.android.model; + +import org.joinmastodon.android.api.AllFieldsAreRequired; + +@AllFieldsAreRequired +public class Translation extends BaseModel{ + public String content; + public String detectedSourceLanguage; + public String provider; +} diff --git a/mastodon/src/main/res/layout/footer_text_translation.xml b/mastodon/src/main/res/layout/footer_text_translation.xml new file mode 100644 index 000000000..b80e730f8 --- /dev/null +++ b/mastodon/src/main/res/layout/footer_text_translation.xml @@ -0,0 +1,44 @@ + + + + + + + + + +