Merge remote-tracking branch 'megalodon_main/main'
# Conflicts: # mastodon/src/main/java/org/joinmastodon/android/GlobalUserPreferences.java # mastodon/src/main/java/org/joinmastodon/android/model/Account.java
This commit is contained in:
@@ -61,6 +61,7 @@ public class GlobalUserPreferences{
|
|||||||
public static boolean showNavigationLabels;
|
public static boolean showNavigationLabels;
|
||||||
public static boolean displayPronounsInTimelines, displayPronounsInThreads, displayPronounsInUserListings;
|
public static boolean displayPronounsInTimelines, displayPronounsInThreads, displayPronounsInUserListings;
|
||||||
public static boolean overlayMedia;
|
public static boolean overlayMedia;
|
||||||
|
public static boolean showSuicideHelp;
|
||||||
|
|
||||||
// MOSHIDON
|
// MOSHIDON
|
||||||
public static boolean showDividers;
|
public static boolean showDividers;
|
||||||
@@ -134,6 +135,7 @@ public class GlobalUserPreferences{
|
|||||||
displayPronounsInThreads=prefs.getBoolean("displayPronounsInThreads", true);
|
displayPronounsInThreads=prefs.getBoolean("displayPronounsInThreads", true);
|
||||||
displayPronounsInUserListings=prefs.getBoolean("displayPronounsInUserListings", true);
|
displayPronounsInUserListings=prefs.getBoolean("displayPronounsInUserListings", true);
|
||||||
overlayMedia=prefs.getBoolean("overlayMedia", false);
|
overlayMedia=prefs.getBoolean("overlayMedia", false);
|
||||||
|
showSuicideHelp=prefs.getBoolean("showSuicideHelp", true);
|
||||||
|
|
||||||
// MOSHIDON
|
// MOSHIDON
|
||||||
uniformNotificationIcon=prefs.getBoolean("uniformNotificationIcon", false);
|
uniformNotificationIcon=prefs.getBoolean("uniformNotificationIcon", false);
|
||||||
@@ -215,6 +217,7 @@ public class GlobalUserPreferences{
|
|||||||
.putBoolean("displayPronounsInThreads", displayPronounsInThreads)
|
.putBoolean("displayPronounsInThreads", displayPronounsInThreads)
|
||||||
.putBoolean("displayPronounsInUserListings", displayPronounsInUserListings)
|
.putBoolean("displayPronounsInUserListings", displayPronounsInUserListings)
|
||||||
.putBoolean("overlayMedia", overlayMedia)
|
.putBoolean("overlayMedia", overlayMedia)
|
||||||
|
.putBoolean("showSuicideHelp", showSuicideHelp)
|
||||||
|
|
||||||
// MOSHIDON
|
// MOSHIDON
|
||||||
.putBoolean("defaultToUnlistedReplies", defaultToUnlistedReplies)
|
.putBoolean("defaultToUnlistedReplies", defaultToUnlistedReplies)
|
||||||
|
|||||||
@@ -313,4 +313,10 @@ public class AccountSession{
|
|||||||
.authority(getInstance().map(i -> i.normalizedUri).orElse(domain))
|
.authority(getInstance().map(i -> i.normalizedUri).orElse(domain))
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getDefaultAvatarUrl() {
|
||||||
|
return getInstance()
|
||||||
|
.map(instance->"https://"+domain+(instance.isAkkoma() ? "/images/avi.png" : "/avatars/original/missing.png"))
|
||||||
|
.orElse("");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,8 +17,10 @@ import android.widget.TextView;
|
|||||||
import org.joinmastodon.android.R;
|
import org.joinmastodon.android.R;
|
||||||
import org.joinmastodon.android.api.requests.accounts.GetAccountRelationships;
|
import org.joinmastodon.android.api.requests.accounts.GetAccountRelationships;
|
||||||
import org.joinmastodon.android.api.requests.accounts.GetFollowRequests;
|
import org.joinmastodon.android.api.requests.accounts.GetFollowRequests;
|
||||||
|
import org.joinmastodon.android.api.session.AccountSessionManager;
|
||||||
import org.joinmastodon.android.model.Account;
|
import org.joinmastodon.android.model.Account;
|
||||||
import org.joinmastodon.android.model.HeaderPaginationList;
|
import org.joinmastodon.android.model.HeaderPaginationList;
|
||||||
|
import org.joinmastodon.android.model.Instance;
|
||||||
import org.joinmastodon.android.model.Relationship;
|
import org.joinmastodon.android.model.Relationship;
|
||||||
import org.joinmastodon.android.ui.OutlineProviders;
|
import org.joinmastodon.android.ui.OutlineProviders;
|
||||||
import org.joinmastodon.android.ui.text.HtmlParser;
|
import org.joinmastodon.android.ui.text.HtmlParser;
|
||||||
@@ -357,8 +359,9 @@ public class FollowRequestsListFragment extends MastodonRecyclerFragment<FollowR
|
|||||||
|
|
||||||
public AccountWrapper(Account account){
|
public AccountWrapper(Account account){
|
||||||
this.account=account;
|
this.account=account;
|
||||||
if(!TextUtils.isEmpty(account.avatar))
|
avaRequest=new UrlImageLoaderRequest(
|
||||||
avaRequest=new UrlImageLoaderRequest(account.avatar, V.dp(50), V.dp(50));
|
TextUtils.isEmpty(account.avatar) ? AccountSessionManager.get(getAccountID()).getDefaultAvatarUrl() : account.avatar,
|
||||||
|
V.dp(50), V.dp(50));
|
||||||
if(!TextUtils.isEmpty(account.header))
|
if(!TextUtils.isEmpty(account.header))
|
||||||
coverRequest=new UrlImageLoaderRequest(account.header, 1000, 1000);
|
coverRequest=new UrlImageLoaderRequest(account.header, 1000, 1000);
|
||||||
parsedBio=HtmlParser.parse(account.note, account.emojis, Collections.emptyList(), Collections.emptyList(), accountID);
|
parsedBio=HtmlParser.parse(account.note, account.emojis, Collections.emptyList(), Collections.emptyList(), accountID);
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ public class NotificationsListFragment extends BaseStatusListFragment<Notificati
|
|||||||
if (n.type == Notification.Type.FOLLOW_REQUEST) {
|
if (n.type == Notification.Type.FOLLOW_REQUEST) {
|
||||||
ArrayList<StatusDisplayItem> items = new ArrayList<>();
|
ArrayList<StatusDisplayItem> items = new ArrayList<>();
|
||||||
items.add(titleItem);
|
items.add(titleItem);
|
||||||
items.add(new AccountCardStatusDisplayItem(n.id, this, n.account, n));
|
items.add(new AccountCardStatusDisplayItem(n.id, this, accountID, n.account, n));
|
||||||
return items;
|
return items;
|
||||||
}
|
}
|
||||||
if(n.status!=null){
|
if(n.status!=null){
|
||||||
|
|||||||
@@ -439,7 +439,7 @@ public class ProfileFragment extends LoaderFragment implements OnBackPressedList
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
username.setOnLongClickListener(v->{
|
content.findViewById(R.id.username_wrap).setOnLongClickListener(v->{
|
||||||
String usernameString=account.acct;
|
String usernameString=account.acct;
|
||||||
if(!usernameString.contains("@")){
|
if(!usernameString.contains("@")){
|
||||||
usernameString+="@"+domain;
|
usernameString+="@"+domain;
|
||||||
@@ -687,7 +687,10 @@ public class ProfileFragment extends LoaderFragment implements OnBackPressedList
|
|||||||
private void bindHeaderView(){
|
private void bindHeaderView(){
|
||||||
setTitle(account.displayName);
|
setTitle(account.displayName);
|
||||||
setSubtitle(getResources().getQuantityString(R.plurals.x_posts, (int)(account.statusesCount%1000), account.statusesCount));
|
setSubtitle(getResources().getQuantityString(R.plurals.x_posts, (int)(account.statusesCount%1000), account.statusesCount));
|
||||||
ViewImageLoader.load(avatar, null, new UrlImageLoaderRequest(GlobalUserPreferences.playGifs ? account.avatar : account.avatarStatic, V.dp(100), V.dp(100)));
|
ViewImageLoader.load(avatar, null, new UrlImageLoaderRequest(
|
||||||
|
TextUtils.isEmpty(account.avatar) ? getSession().getDefaultAvatarUrl() :
|
||||||
|
GlobalUserPreferences.playGifs ? account.avatar : account.avatarStatic,
|
||||||
|
V.dp(100), V.dp(100)));
|
||||||
ViewImageLoader.load(cover, null, new UrlImageLoaderRequest(GlobalUserPreferences.playGifs ? account.header : account.headerStatic, 1000, 1000));
|
ViewImageLoader.load(cover, null, new UrlImageLoaderRequest(GlobalUserPreferences.playGifs ? account.header : account.headerStatic, 1000, 1000));
|
||||||
SpannableStringBuilder ssb=new SpannableStringBuilder(account.displayName);
|
SpannableStringBuilder ssb=new SpannableStringBuilder(account.displayName);
|
||||||
if(AccountSessionManager.get(accountID).getLocalPreferences().customEmojiInNames)
|
if(AccountSessionManager.get(accountID).getLocalPreferences().customEmojiInNames)
|
||||||
@@ -1327,7 +1330,7 @@ public class ProfileFragment extends LoaderFragment implements OnBackPressedList
|
|||||||
if(ava==null)
|
if(ava==null)
|
||||||
return;
|
return;
|
||||||
int radius=V.dp(25);
|
int radius=V.dp(25);
|
||||||
currentPhotoViewer=new PhotoViewer(getActivity(), createFakeAttachments(account.avatar, ava), 0,
|
currentPhotoViewer=new PhotoViewer(getActivity(), createFakeAttachments(TextUtils.isEmpty(account.avatar) ? getSession().getDefaultAvatarUrl() : account.avatar, ava), 0,
|
||||||
new SingleImagePhotoViewerListener(avatar, avatarBorder, new int[]{radius, radius, radius, radius}, this, ()->currentPhotoViewer=null, ()->ava, null, null));
|
new SingleImagePhotoViewerListener(avatar, avatarBorder, new int[]{radius, radius, radius, radius}, this, ()->currentPhotoViewer=null, ()->ava, null, null));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import org.joinmastodon.android.R;
|
|||||||
import org.joinmastodon.android.api.requests.statuses.GetStatusEditHistory;
|
import org.joinmastodon.android.api.requests.statuses.GetStatusEditHistory;
|
||||||
import org.joinmastodon.android.model.FilterContext;
|
import org.joinmastodon.android.model.FilterContext;
|
||||||
import org.joinmastodon.android.model.Status;
|
import org.joinmastodon.android.model.Status;
|
||||||
|
import org.joinmastodon.android.ui.displayitems.DummyStatusDisplayItem;
|
||||||
import org.joinmastodon.android.ui.displayitems.ReblogOrReplyLineStatusDisplayItem;
|
import org.joinmastodon.android.ui.displayitems.ReblogOrReplyLineStatusDisplayItem;
|
||||||
import org.joinmastodon.android.ui.displayitems.StatusDisplayItem;
|
import org.joinmastodon.android.ui.displayitems.StatusDisplayItem;
|
||||||
import org.joinmastodon.android.ui.utils.InsetStatusItemDecoration;
|
import org.joinmastodon.android.ui.utils.InsetStatusItemDecoration;
|
||||||
@@ -144,6 +145,7 @@ public class StatusEditHistoryFragment extends StatusListFragment{
|
|||||||
}
|
}
|
||||||
String sep = getString(R.string.sk_separator);
|
String sep = getString(R.string.sk_separator);
|
||||||
items.add(0, new ReblogOrReplyLineStatusDisplayItem(s.id, this, action+" "+sep+" "+date, Collections.emptyList(), 0, null, null));
|
items.add(0, new ReblogOrReplyLineStatusDisplayItem(s.id, this, action+" "+sep+" "+date, Collections.emptyList(), 0, null, null));
|
||||||
|
items.add(1, new DummyStatusDisplayItem(s.id, this));
|
||||||
}
|
}
|
||||||
return items;
|
return items;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ import android.widget.TextView;
|
|||||||
import org.joinmastodon.android.R;
|
import org.joinmastodon.android.R;
|
||||||
import org.joinmastodon.android.api.requests.accounts.GetAccountRelationships;
|
import org.joinmastodon.android.api.requests.accounts.GetAccountRelationships;
|
||||||
import org.joinmastodon.android.api.requests.accounts.GetFollowSuggestions;
|
import org.joinmastodon.android.api.requests.accounts.GetFollowSuggestions;
|
||||||
|
import org.joinmastodon.android.api.session.AccountSessionManager;
|
||||||
import org.joinmastodon.android.fragments.IsOnTop;
|
import org.joinmastodon.android.fragments.IsOnTop;
|
||||||
import org.joinmastodon.android.fragments.MastodonRecyclerFragment;
|
import org.joinmastodon.android.fragments.MastodonRecyclerFragment;
|
||||||
import org.joinmastodon.android.fragments.ProfileFragment;
|
import org.joinmastodon.android.fragments.ProfileFragment;
|
||||||
@@ -319,8 +320,9 @@ public class DiscoverAccountsFragment extends MastodonRecyclerFragment<DiscoverA
|
|||||||
|
|
||||||
public AccountWrapper(Account account){
|
public AccountWrapper(Account account){
|
||||||
this.account=account;
|
this.account=account;
|
||||||
if(!TextUtils.isEmpty(account.avatar))
|
avaRequest=new UrlImageLoaderRequest(
|
||||||
avaRequest=new UrlImageLoaderRequest(account.avatar, V.dp(50), V.dp(50));
|
TextUtils.isEmpty(account.avatar) ? AccountSessionManager.getInstance().getAccount(accountID).getDefaultAvatarUrl() : account.avatar,
|
||||||
|
V.dp(50), V.dp(50));
|
||||||
if(!TextUtils.isEmpty(account.header))
|
if(!TextUtils.isEmpty(account.header))
|
||||||
coverRequest=new UrlImageLoaderRequest(account.header, 1000, 1000);
|
coverRequest=new UrlImageLoaderRequest(account.header, 1000, 1000);
|
||||||
parsedBio=HtmlParser.parse(account.note, account.emojis, Collections.emptyList(), Collections.emptyList(), accountID);
|
parsedBio=HtmlParser.parse(account.note, account.emojis, Collections.emptyList(), Collections.emptyList(), accountID);
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ import android.graphics.Outline;
|
|||||||
import android.graphics.Rect;
|
import android.graphics.Rect;
|
||||||
import android.graphics.drawable.Drawable;
|
import android.graphics.drawable.Drawable;
|
||||||
import android.graphics.drawable.LayerDrawable;
|
import android.graphics.drawable.LayerDrawable;
|
||||||
import android.net.Uri;
|
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
@@ -26,7 +25,7 @@ import android.widget.TextView;
|
|||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
import android.widget.Toolbar;
|
import android.widget.Toolbar;
|
||||||
|
|
||||||
import org.joinmastodon.android.MainActivity;
|
import org.joinmastodon.android.GlobalUserPreferences;
|
||||||
import org.joinmastodon.android.R;
|
import org.joinmastodon.android.R;
|
||||||
import org.joinmastodon.android.api.requests.search.GetSearchResults;
|
import org.joinmastodon.android.api.requests.search.GetSearchResults;
|
||||||
import org.joinmastodon.android.api.session.AccountSessionManager;
|
import org.joinmastodon.android.api.session.AccountSessionManager;
|
||||||
@@ -38,19 +37,16 @@ import org.joinmastodon.android.model.SearchResults;
|
|||||||
import org.joinmastodon.android.model.viewmodel.ListItem;
|
import org.joinmastodon.android.model.viewmodel.ListItem;
|
||||||
import org.joinmastodon.android.model.viewmodel.SearchResultViewModel;
|
import org.joinmastodon.android.model.viewmodel.SearchResultViewModel;
|
||||||
import org.joinmastodon.android.ui.DividerItemDecoration;
|
import org.joinmastodon.android.ui.DividerItemDecoration;
|
||||||
|
import org.joinmastodon.android.ui.M3AlertDialogBuilder;
|
||||||
import org.joinmastodon.android.ui.SearchViewHelper;
|
import org.joinmastodon.android.ui.SearchViewHelper;
|
||||||
import org.joinmastodon.android.ui.adapters.GenericListItemsAdapter;
|
import org.joinmastodon.android.ui.adapters.GenericListItemsAdapter;
|
||||||
import org.joinmastodon.android.ui.utils.HideableSingleViewRecyclerAdapter;
|
import org.joinmastodon.android.ui.utils.HideableSingleViewRecyclerAdapter;
|
||||||
import org.joinmastodon.android.ui.utils.UiUtils;
|
import org.joinmastodon.android.ui.utils.UiUtils;
|
||||||
import org.joinmastodon.android.ui.viewholders.AccountViewHolder;
|
import org.joinmastodon.android.ui.viewholders.AccountViewHolder;
|
||||||
import org.joinmastodon.android.ui.viewholders.SimpleListItemViewHolder;
|
import org.joinmastodon.android.ui.viewholders.SimpleListItemViewHolder;
|
||||||
import org.parceler.Parcels;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
|
||||||
import java.util.function.BiConsumer;
|
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
@@ -381,16 +377,54 @@ public class SearchQueryFragment extends MastodonRecyclerFragment<SearchResultVi
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void openHashtag(SearchResult res){
|
private void openHashtag(SearchResult res){
|
||||||
|
wrapSuicideDialog(()->{
|
||||||
UiUtils.openHashtagTimeline(getActivity(), accountID, res.hashtag.name, res.hashtag.following);
|
UiUtils.openHashtagTimeline(getActivity(), accountID, res.hashtag.name, res.hashtag.following);
|
||||||
AccountSessionManager.getInstance().getAccount(accountID).getCacheController().putRecentSearch(res);
|
AccountSessionManager.getInstance().getAccount(accountID).getCacheController().putRecentSearch(res);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isInRecentMode(){
|
private boolean isInRecentMode(){
|
||||||
return TextUtils.isEmpty(currentQuery);
|
return TextUtils.isEmpty(currentQuery);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void wrapSuicideDialog(Runnable r){
|
||||||
|
if(!GlobalUserPreferences.showSuicideHelp){
|
||||||
|
r.run();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
String[] terms=getContext().getString(R.string.sk_suicide_search_terms).toLowerCase().split(",");
|
||||||
|
String query=currentQuery.trim().toLowerCase();
|
||||||
|
boolean termMatches=false;
|
||||||
|
for(String term : terms){
|
||||||
|
if(query.contains(term)){
|
||||||
|
termMatches=true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!termMatches){
|
||||||
|
r.run();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
String url=getContext().getString(R.string.sk_suicide_helplines_url);
|
||||||
|
new M3AlertDialogBuilder(getActivity())
|
||||||
|
.setTitle(R.string.sk_search_suicide_title)
|
||||||
|
.setMessage(R.string.sk_search_suicide_message)
|
||||||
|
.setNegativeButton(R.string.sk_do_not_show_again, (dialog, which)->{
|
||||||
|
GlobalUserPreferences.showSuicideHelp = false;
|
||||||
|
GlobalUserPreferences.save();
|
||||||
|
r.run();
|
||||||
|
})
|
||||||
|
.setNeutralButton(R.string.sk_search_suicide_hotlines, (dialog, which)->UiUtils.launchWebBrowser(getContext(), url))
|
||||||
|
.setPositiveButton(R.string.ok, (dialog, which)->r.run())
|
||||||
|
.setOnDismissListener((dialog)->{})
|
||||||
|
.show();
|
||||||
|
}
|
||||||
|
|
||||||
private void onSearchViewEnter(){
|
private void onSearchViewEnter(){
|
||||||
deliverResult(currentQuery, null);
|
wrapSuicideDialog(()->deliverResult(currentQuery, null));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onOpenURLClick(){
|
private void onOpenURLClick(){
|
||||||
@@ -398,10 +432,12 @@ public class SearchQueryFragment extends MastodonRecyclerFragment<SearchResultVi
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void onGoToHashtagClick(){
|
private void onGoToHashtagClick(){
|
||||||
|
wrapSuicideDialog(()->{
|
||||||
String q=searchViewHelper.getQuery();
|
String q=searchViewHelper.getQuery();
|
||||||
if(q.startsWith("#"))
|
if(q.startsWith("#"))
|
||||||
q=q.substring(1);
|
q=q.substring(1);
|
||||||
UiUtils.openHashtagTimeline(getActivity(), accountID, q, null);
|
UiUtils.openHashtagTimeline(getActivity(), accountID, q, null);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onGoToAccountClick(){
|
private void onGoToAccountClick(){
|
||||||
@@ -422,11 +458,11 @@ public class SearchQueryFragment extends MastodonRecyclerFragment<SearchResultVi
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void onGoToStatusSearchClick(){
|
private void onGoToStatusSearchClick(){
|
||||||
deliverResult(searchViewHelper.getQuery(), SearchResult.Type.STATUS);
|
wrapSuicideDialog(()->deliverResult(searchViewHelper.getQuery(), SearchResult.Type.STATUS));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onGoToAccountSearchClick(){
|
private void onGoToAccountSearchClick(){
|
||||||
deliverResult(searchViewHelper.getQuery(), SearchResult.Type.ACCOUNT);
|
wrapSuicideDialog(()->deliverResult(searchViewHelper.getQuery(), SearchResult.Type.ACCOUNT));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onClearRecentClick(){
|
private void onClearRecentClick(){
|
||||||
|
|||||||
@@ -7,12 +7,17 @@ import androidx.annotation.Nullable;
|
|||||||
|
|
||||||
import org.joinmastodon.android.api.ObjectValidationException;
|
import org.joinmastodon.android.api.ObjectValidationException;
|
||||||
import org.joinmastodon.android.api.RequiredField;
|
import org.joinmastodon.android.api.RequiredField;
|
||||||
|
import org.joinmastodon.android.api.requests.instance.GetInstance;
|
||||||
import org.parceler.Parcel;
|
import org.parceler.Parcel;
|
||||||
|
|
||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import me.grishka.appkit.api.Callback;
|
||||||
|
import me.grishka.appkit.api.ErrorResponse;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents a user of Mastodon and their associated profile.
|
* Represents a user of Mastodon and their associated profile.
|
||||||
*/
|
*/
|
||||||
@@ -23,22 +28,22 @@ public class Account extends BaseModel implements Searchable{
|
|||||||
/**
|
/**
|
||||||
* The account id
|
* The account id
|
||||||
*/
|
*/
|
||||||
@RequiredField
|
// @RequiredField
|
||||||
public String id;
|
public String id;
|
||||||
/**
|
/**
|
||||||
* The username of the account, not including domain.
|
* The username of the account, not including domain.
|
||||||
*/
|
*/
|
||||||
@RequiredField
|
// @RequiredField
|
||||||
public String username;
|
public String username;
|
||||||
/**
|
/**
|
||||||
* The Webfinger account URI. Equal to username for local users, or username@domain for remote users.
|
* The Webfinger account URI. Equal to username for local users, or username@domain for remote users.
|
||||||
*/
|
*/
|
||||||
@RequiredField
|
// @RequiredField
|
||||||
public String acct;
|
public String acct;
|
||||||
/**
|
/**
|
||||||
* The location of the user's profile page.
|
* The location of the user's profile page.
|
||||||
*/
|
*/
|
||||||
@RequiredField
|
// @RequiredField
|
||||||
public String url;
|
public String url;
|
||||||
|
|
||||||
// Display attributes
|
// Display attributes
|
||||||
@@ -51,12 +56,12 @@ public class Account extends BaseModel implements Searchable{
|
|||||||
/**
|
/**
|
||||||
* The profile's bio / description.
|
* The profile's bio / description.
|
||||||
*/
|
*/
|
||||||
|
// @RequiredField
|
||||||
public String note;
|
public String note;
|
||||||
/**
|
/**
|
||||||
* An image icon that is shown next to statuses and in the profile.
|
* An image icon that is shown next to statuses and in the profile.
|
||||||
*/
|
*/
|
||||||
@RequiredField
|
// @RequiredField
|
||||||
public String avatar;
|
public String avatar;
|
||||||
/**
|
/**
|
||||||
* A static version of the avatar. Equal to avatar if its value is a static image; different if avatar is an animated GIF.
|
* A static version of the avatar. Equal to avatar if its value is a static image; different if avatar is an animated GIF.
|
||||||
@@ -157,16 +162,26 @@ public class Account extends BaseModel implements Searchable{
|
|||||||
if(fields!=null){
|
if(fields!=null){
|
||||||
for(AccountField f:fields)
|
for(AccountField f:fields)
|
||||||
f.postprocess();
|
f.postprocess();
|
||||||
|
} else {
|
||||||
|
fields = Collections.emptyList();
|
||||||
}
|
}
|
||||||
if(emojis!=null){
|
if(emojis!=null){
|
||||||
for(Emoji e:emojis)
|
for(Emoji e:emojis)
|
||||||
e.postprocess();
|
e.postprocess();
|
||||||
|
} else {
|
||||||
|
emojis = Collections.emptyList();
|
||||||
}
|
}
|
||||||
if(moved!=null)
|
if(moved!=null)
|
||||||
moved.postprocess();
|
moved.postprocess();
|
||||||
if(TextUtils.isEmpty(displayName))
|
|
||||||
displayName=username;
|
|
||||||
if(fqn == null) fqn = getFullyQualifiedName();
|
if(fqn == null) fqn = getFullyQualifiedName();
|
||||||
|
if(id == null) id = "";
|
||||||
|
if(username == null) username = "";
|
||||||
|
if(TextUtils.isEmpty(displayName))
|
||||||
|
displayName = !TextUtils.isEmpty(username) ? username : "";
|
||||||
|
if(acct == null) acct = "";
|
||||||
|
if(url == null) url = "";
|
||||||
|
if(note == null) note = "";
|
||||||
|
if(avatar == null) avatar = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isLocal(){
|
public boolean isLocal(){
|
||||||
@@ -191,6 +206,8 @@ public class Account extends BaseModel implements Searchable{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public String getFullyQualifiedName() {
|
public String getFullyQualifiedName() {
|
||||||
|
if (TextUtils.isEmpty(acct))
|
||||||
|
return "";
|
||||||
return fqn != null ? fqn : acct.split("@")[0] + "@" + getDomainFromURL();
|
return fqn != null ? fqn : acct.split("@")[0] + "@" + getDomainFromURL();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
package org.joinmastodon.android.model.viewmodel;
|
package org.joinmastodon.android.model.viewmodel;
|
||||||
|
|
||||||
import android.text.SpannableStringBuilder;
|
import android.text.SpannableStringBuilder;
|
||||||
|
import android.text.TextUtils;
|
||||||
|
|
||||||
import org.joinmastodon.android.GlobalUserPreferences;
|
import org.joinmastodon.android.GlobalUserPreferences;
|
||||||
|
import org.joinmastodon.android.api.session.AccountSession;
|
||||||
import org.joinmastodon.android.api.session.AccountSessionManager;
|
import org.joinmastodon.android.api.session.AccountSessionManager;
|
||||||
import org.joinmastodon.android.model.Account;
|
import org.joinmastodon.android.model.Account;
|
||||||
import org.joinmastodon.android.model.AccountField;
|
import org.joinmastodon.android.model.AccountField;
|
||||||
@@ -24,9 +26,13 @@ public class AccountViewModel{
|
|||||||
|
|
||||||
public AccountViewModel(Account account, String accountID){
|
public AccountViewModel(Account account, String accountID){
|
||||||
this.account=account;
|
this.account=account;
|
||||||
avaRequest=new UrlImageLoaderRequest(GlobalUserPreferences.playGifs ? account.avatar : account.avatarStatic, V.dp(50), V.dp(50));
|
AccountSession session = AccountSessionManager.get(accountID);
|
||||||
|
avaRequest=new UrlImageLoaderRequest(
|
||||||
|
TextUtils.isEmpty(account.avatar) ? session.getDefaultAvatarUrl() :
|
||||||
|
GlobalUserPreferences.playGifs ? account.avatar : account.avatarStatic,
|
||||||
|
V.dp(50), V.dp(50));
|
||||||
emojiHelper=new CustomEmojiHelper();
|
emojiHelper=new CustomEmojiHelper();
|
||||||
if(AccountSessionManager.get(accountID).getLocalPreferences().customEmojiInNames)
|
if(session.getLocalPreferences().customEmojiInNames)
|
||||||
parsedName=HtmlParser.parseCustomEmoji(account.displayName, account.emojis);
|
parsedName=HtmlParser.parseCustomEmoji(account.displayName, account.emojis);
|
||||||
else
|
else
|
||||||
parsedName=account.displayName;
|
parsedName=account.displayName;
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import android.widget.TextView;
|
|||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
import org.joinmastodon.android.R;
|
import org.joinmastodon.android.R;
|
||||||
|
import org.joinmastodon.android.api.session.AccountSessionManager;
|
||||||
import org.joinmastodon.android.fragments.BaseStatusListFragment;
|
import org.joinmastodon.android.fragments.BaseStatusListFragment;
|
||||||
import org.joinmastodon.android.model.Account;
|
import org.joinmastodon.android.model.Account;
|
||||||
import org.joinmastodon.android.model.Notification;
|
import org.joinmastodon.android.model.Notification;
|
||||||
@@ -41,12 +42,13 @@ public class AccountCardStatusDisplayItem extends StatusDisplayItem{
|
|||||||
public CustomEmojiHelper emojiHelper=new CustomEmojiHelper();
|
public CustomEmojiHelper emojiHelper=new CustomEmojiHelper();
|
||||||
public CharSequence parsedName, parsedBio;
|
public CharSequence parsedName, parsedBio;
|
||||||
|
|
||||||
public AccountCardStatusDisplayItem(String parentID, BaseStatusListFragment parentFragment, Account account, Notification notification){
|
public AccountCardStatusDisplayItem(String parentID, BaseStatusListFragment parentFragment, String accountID, Account account, Notification notification){
|
||||||
super(parentID, parentFragment);
|
super(parentID, parentFragment);
|
||||||
this.account=account;
|
this.account=account;
|
||||||
this.notification=notification;
|
this.notification=notification;
|
||||||
if(!TextUtils.isEmpty(account.avatar))
|
avaRequest=new UrlImageLoaderRequest(
|
||||||
avaRequest=new UrlImageLoaderRequest(account.avatar, V.dp(50), V.dp(50));
|
TextUtils.isEmpty(account.avatar) ? AccountSessionManager.get(accountID).getDefaultAvatarUrl() : account.avatar,
|
||||||
|
V.dp(50), V.dp(50));
|
||||||
if(!TextUtils.isEmpty(account.header))
|
if(!TextUtils.isEmpty(account.header))
|
||||||
coverRequest=new UrlImageLoaderRequest(account.header, 1000, 1000);
|
coverRequest=new UrlImageLoaderRequest(account.header, 1000, 1000);
|
||||||
parsedBio=HtmlParser.parse(account.note, account.emojis, Collections.emptyList(), Collections.emptyList(), parentFragment.getAccountID());
|
parsedBio=HtmlParser.parse(account.note, account.emojis, Collections.emptyList(), Collections.emptyList(), parentFragment.getAccountID());
|
||||||
|
|||||||
@@ -86,10 +86,14 @@ public class HeaderStatusDisplayItem extends StatusDisplayItem{
|
|||||||
|
|
||||||
public HeaderStatusDisplayItem(String parentID, Account user, Instant createdAt, BaseStatusListFragment parentFragment, String accountID, Status status, CharSequence extraText, Notification notification, ScheduledStatus scheduledStatus){
|
public HeaderStatusDisplayItem(String parentID, Account user, Instant createdAt, BaseStatusListFragment parentFragment, String accountID, Status status, CharSequence extraText, Notification notification, ScheduledStatus scheduledStatus){
|
||||||
super(parentID, parentFragment);
|
super(parentID, parentFragment);
|
||||||
user=scheduledStatus != null ? AccountSessionManager.getInstance().getAccount(accountID).self : user;
|
AccountSession session = AccountSessionManager.get(accountID);
|
||||||
|
user=scheduledStatus != null ? session.self : user;
|
||||||
this.user=user;
|
this.user=user;
|
||||||
this.createdAt=createdAt;
|
this.createdAt=createdAt;
|
||||||
avaRequest=new UrlImageLoaderRequest(GlobalUserPreferences.playGifs ? user.avatar : user.avatarStatic, V.dp(50), V.dp(50));
|
avaRequest=new UrlImageLoaderRequest(
|
||||||
|
TextUtils.isEmpty(user.avatar) ? session.getDefaultAvatarUrl() :
|
||||||
|
GlobalUserPreferences.playGifs ? user.avatar : user.avatarStatic,
|
||||||
|
V.dp(50), V.dp(50));
|
||||||
this.accountID=accountID;
|
this.accountID=accountID;
|
||||||
parsedName=new SpannableStringBuilder(user.displayName);
|
parsedName=new SpannableStringBuilder(user.displayName);
|
||||||
this.status=status;
|
this.status=status;
|
||||||
@@ -430,6 +434,8 @@ public class HeaderStatusDisplayItem extends StatusDisplayItem{
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void onAvaClick(View v){
|
private void onAvaClick(View v){
|
||||||
|
if (TextUtils.isEmpty(item.user.url))
|
||||||
|
return;
|
||||||
if (item.announcement != null) {
|
if (item.announcement != null) {
|
||||||
UiUtils.openURL(item.parentFragment.getActivity(), item.parentFragment.getAccountID(), item.user.url);
|
UiUtils.openURL(item.parentFragment.getActivity(), item.parentFragment.getAccountID(), item.user.url);
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -20,6 +20,8 @@ import android.widget.TextView;
|
|||||||
|
|
||||||
import org.joinmastodon.android.GlobalUserPreferences;
|
import org.joinmastodon.android.GlobalUserPreferences;
|
||||||
import org.joinmastodon.android.R;
|
import org.joinmastodon.android.R;
|
||||||
|
import org.joinmastodon.android.api.session.AccountSession;
|
||||||
|
import org.joinmastodon.android.api.session.AccountSessionManager;
|
||||||
import org.joinmastodon.android.fragments.BaseStatusListFragment;
|
import org.joinmastodon.android.fragments.BaseStatusListFragment;
|
||||||
import org.joinmastodon.android.fragments.ProfileFragment;
|
import org.joinmastodon.android.fragments.ProfileFragment;
|
||||||
import org.joinmastodon.android.model.Emoji;
|
import org.joinmastodon.android.model.Emoji;
|
||||||
@@ -53,7 +55,11 @@ public class NotificationHeaderStatusDisplayItem extends StatusDisplayItem{
|
|||||||
if(notification.type==Notification.Type.POLL){
|
if(notification.type==Notification.Type.POLL){
|
||||||
text=parentFragment.getString(R.string.poll_ended);
|
text=parentFragment.getString(R.string.poll_ended);
|
||||||
}else{
|
}else{
|
||||||
avaRequest=new UrlImageLoaderRequest(GlobalUserPreferences.playGifs ? notification.account.avatar : notification.account.avatarStatic, V.dp(50), V.dp(50));
|
AccountSession session = AccountSessionManager.get(accountID);
|
||||||
|
avaRequest=new UrlImageLoaderRequest(
|
||||||
|
TextUtils.isEmpty(notification.account.avatar) ? session.getDefaultAvatarUrl() :
|
||||||
|
GlobalUserPreferences.playGifs ? notification.account.avatar : notification.account.avatarStatic,
|
||||||
|
V.dp(50), V.dp(50));
|
||||||
SpannableStringBuilder parsedName=new SpannableStringBuilder(notification.account.displayName);
|
SpannableStringBuilder parsedName=new SpannableStringBuilder(notification.account.displayName);
|
||||||
HtmlParser.parseCustomEmoji(parsedName, notification.account.emojis);
|
HtmlParser.parseCustomEmoji(parsedName, notification.account.emojis);
|
||||||
String str = parentFragment.getString(switch(notification.type){
|
String str = parentFragment.getString(switch(notification.type){
|
||||||
|
|||||||
@@ -6,9 +6,9 @@ import android.graphics.drawable.LayerDrawable;
|
|||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.ImageView;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import org.joinmastodon.android.GlobalUserPreferences;
|
|
||||||
import org.joinmastodon.android.R;
|
import org.joinmastodon.android.R;
|
||||||
import org.joinmastodon.android.fragments.BaseStatusListFragment;
|
import org.joinmastodon.android.fragments.BaseStatusListFragment;
|
||||||
import org.joinmastodon.android.model.Status;
|
import org.joinmastodon.android.model.Status;
|
||||||
@@ -29,11 +29,13 @@ public class SpoilerStatusDisplayItem extends StatusDisplayItem{
|
|||||||
private final CharSequence parsedTitle;
|
private final CharSequence parsedTitle;
|
||||||
private final CustomEmojiHelper emojiHelper;
|
private final CustomEmojiHelper emojiHelper;
|
||||||
private final Type type;
|
private final Type type;
|
||||||
|
private final int attachmentCount;
|
||||||
|
|
||||||
public SpoilerStatusDisplayItem(String parentID, BaseStatusListFragment<?> parentFragment, String title, Status statusForContent, Type type){
|
public SpoilerStatusDisplayItem(String parentID, BaseStatusListFragment<?> parentFragment, String title, Status statusForContent, Type type){
|
||||||
super(parentID, parentFragment);
|
super(parentID, parentFragment);
|
||||||
this.status=statusForContent;
|
this.status=statusForContent;
|
||||||
this.type=type;
|
this.type=type;
|
||||||
|
this.attachmentCount=statusForContent.mediaAttachments.size();
|
||||||
if(TextUtils.isEmpty(title)){
|
if(TextUtils.isEmpty(title)){
|
||||||
parsedTitle=HtmlParser.parseCustomEmoji(statusForContent.spoilerText, statusForContent.emojis);
|
parsedTitle=HtmlParser.parseCustomEmoji(statusForContent.spoilerText, statusForContent.emojis);
|
||||||
emojiHelper=new CustomEmojiHelper();
|
emojiHelper=new CustomEmojiHelper();
|
||||||
@@ -62,12 +64,14 @@ public class SpoilerStatusDisplayItem extends StatusDisplayItem{
|
|||||||
public static class Holder extends StatusDisplayItem.Holder<SpoilerStatusDisplayItem> implements ImageLoaderViewHolder{
|
public static class Holder extends StatusDisplayItem.Holder<SpoilerStatusDisplayItem> implements ImageLoaderViewHolder{
|
||||||
private final TextView title, action;
|
private final TextView title, action;
|
||||||
private final View button;
|
private final View button;
|
||||||
|
private final ImageView mediaIcon;
|
||||||
|
|
||||||
public Holder(Context context, ViewGroup parent, Type type){
|
public Holder(Context context, ViewGroup parent, Type type){
|
||||||
super(context, R.layout.display_item_spoiler, parent);
|
super(context, R.layout.display_item_spoiler, parent);
|
||||||
title=findViewById(R.id.spoiler_title);
|
title=findViewById(R.id.spoiler_title);
|
||||||
action=findViewById(R.id.spoiler_action);
|
action=findViewById(R.id.spoiler_action);
|
||||||
button=findViewById(R.id.spoiler_button);
|
button=findViewById(R.id.spoiler_button);
|
||||||
|
mediaIcon=findViewById(R.id.media_icon);
|
||||||
|
|
||||||
button.setOutlineProvider(OutlineProviders.roundedRect(8));
|
button.setOutlineProvider(OutlineProviders.roundedRect(8));
|
||||||
button.setClipToOutline(true);
|
button.setClipToOutline(true);
|
||||||
@@ -94,6 +98,10 @@ public class SpoilerStatusDisplayItem extends StatusDisplayItem{
|
|||||||
itemView.getPaddingRight(),
|
itemView.getPaddingRight(),
|
||||||
item.inset ? itemView.getPaddingTop() : 0
|
item.inset ? itemView.getPaddingTop() : 0
|
||||||
);
|
);
|
||||||
|
mediaIcon.setVisibility(item.attachmentCount > 0 ? View.VISIBLE : View.GONE);
|
||||||
|
mediaIcon.setImageResource(item.attachmentCount > 1
|
||||||
|
? R.drawable.ic_fluent_image_multiple_24_regular
|
||||||
|
: R.drawable.ic_fluent_image_24_regular);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -1715,7 +1715,9 @@ public class TabLayout extends HorizontalScrollView implements CustomViewHelper{
|
|||||||
child.getLayoutParams().height);
|
child.getLayoutParams().height);
|
||||||
|
|
||||||
int childWidthMeasureSpec =
|
int childWidthMeasureSpec =
|
||||||
MeasureSpec.makeMeasureSpec(getMeasuredWidth(), MeasureSpec.EXACTLY);
|
MeasureSpec.makeMeasureSpec(
|
||||||
|
getMeasuredWidth() - getPaddingLeft() - getPaddingRight(),
|
||||||
|
MeasureSpec.EXACTLY);
|
||||||
child.measure(childWidthMeasureSpec, childHeightMeasureSpec);
|
child.measure(childWidthMeasureSpec, childHeightMeasureSpec);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24">
|
||||||
|
<path android:pathData="M13.748 8.996c0.69 0 1.248-0.559 1.248-1.248 0-0.69-0.559-1.248-1.248-1.248-0.69 0-1.248 0.559-1.248 1.248 0 0.69 0.559 1.248 1.248 1.248zM6.25 3C4.455 3 3 4.455 3 6.25v9c0 1.795 1.455 3.25 3.25 3.25h9c1.795 0 3.25-1.455 3.25-3.25v-9C18.5 4.455 17.045 3 15.25 3h-9zM4.5 6.25c0-0.966 0.784-1.75 1.75-1.75h9C16.216 4.5 17 5.284 17 6.25v9c0 0.231-0.045 0.452-0.126 0.654l-4.587-4.291c-0.865-0.81-2.21-0.81-3.075 0l-4.586 4.29C4.545 15.701 4.5 15.481 4.5 15.25v-9zm6.762 6.458l4.505 4.214C15.604 16.972 15.43 17 15.25 17h-9c-0.18 0-0.354-0.027-0.518-0.078l4.505-4.214c0.289-0.27 0.737-0.27 1.025 0zM8.75 21c-1.15 0-2.162-0.598-2.74-1.5h9.74c2.071 0 3.75-1.679 3.75-3.75V6.011C20.402 6.59 21 7.6 21 8.751v7C21 18.65 18.65 21 15.75 21h-7z" android:fillColor="@color/fluent_default_icon_tint"/>
|
||||||
|
</vector>
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
android:layout_width="32dp"
|
android:layout_width="32dp"
|
||||||
android:layout_height="32dp"
|
android:layout_height="32dp"
|
||||||
android:layout_marginEnd="16dp"
|
android:layout_marginEnd="16dp"
|
||||||
android:tint="?colorM3OnPrimaryContainer"
|
android:tint="?colorM3Primary"
|
||||||
android:scaleType="center"
|
android:scaleType="center"
|
||||||
android:importantForAccessibility="no"
|
android:importantForAccessibility="no"
|
||||||
tools:src="@drawable/ic_fluent_arrow_trending_24_regular"/>
|
tools:src="@drawable/ic_fluent_arrow_trending_24_regular"/>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@@ -8,7 +8,7 @@
|
|||||||
android:paddingTop="16dp"
|
android:paddingTop="16dp"
|
||||||
android:paddingRight="16dp">
|
android:paddingRight="16dp">
|
||||||
|
|
||||||
<LinearLayout
|
<RelativeLayout
|
||||||
android:id="@+id/spoiler_button"
|
android:id="@+id/spoiler_button"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
@@ -19,11 +19,26 @@
|
|||||||
android:paddingRight="12dp"
|
android:paddingRight="12dp"
|
||||||
android:paddingBottom="8dp">
|
android:paddingBottom="8dp">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/media_icon"
|
||||||
|
android:layout_width="28dp"
|
||||||
|
android:layout_height="28dp"
|
||||||
|
android:layout_marginHorizontal="8dp"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:layout_alignParentEnd="true"
|
||||||
|
android:scaleType="center"
|
||||||
|
android:contentDescription="@string/sk_post_contains_media"
|
||||||
|
android:src="@drawable/ic_fluent_image_24_regular"
|
||||||
|
android:tint="?colorM3OnSecondaryContainer" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/spoiler_title"
|
android:id="@+id/spoiler_title"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginBottom="4dp"
|
android:layout_marginBottom="4dp"
|
||||||
|
android:layout_alignParentStart="true"
|
||||||
|
android:layout_alignParentTop="true"
|
||||||
|
android:layout_toStartOf="@id/media_icon"
|
||||||
android:textAppearance="@style/m3_body_large"
|
android:textAppearance="@style/m3_body_large"
|
||||||
android:textColor="?colorM3OnSecondaryContainer"
|
android:textColor="?colorM3OnSecondaryContainer"
|
||||||
tools:text="Spoilery stuff"/>
|
tools:text="Spoilery stuff"/>
|
||||||
@@ -32,21 +47,14 @@
|
|||||||
android:id="@+id/spoiler_action"
|
android:id="@+id/spoiler_action"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="20dp"
|
android:layout_height="20dp"
|
||||||
|
android:layout_below="@id/spoiler_title"
|
||||||
|
android:layout_toStartOf="@id/media_icon"
|
||||||
android:textAppearance="@style/m3_label_large"
|
android:textAppearance="@style/m3_label_large"
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:textColor="?colorM3Primary"
|
android:textColor="?colorM3Primary"
|
||||||
tools:text="Re-hide"/>
|
tools:text="Re-hide"/>
|
||||||
|
|
||||||
</LinearLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
<ImageView
|
</FrameLayout>
|
||||||
android:id="@+id/media_icon"
|
|
||||||
android:layout_width="36dp"
|
|
||||||
android:layout_height="36dp"
|
|
||||||
android:background="?android:actionBarItemBackground"
|
|
||||||
android:scaleType="center"
|
|
||||||
android:src="@drawable/ic_fluent_image_24_regular"
|
|
||||||
android:tint="?android:textColorSecondary" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
@@ -45,6 +45,7 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<org.joinmastodon.android.ui.tabs.TabLayout
|
<org.joinmastodon.android.ui.tabs.TabLayout
|
||||||
android:id="@+id/tabbar"
|
android:id="@+id/tabbar"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@@ -56,6 +57,8 @@
|
|||||||
app:tabIndicatorFullWidth="false"
|
app:tabIndicatorFullWidth="false"
|
||||||
app:tabMinWidth="90dp"
|
app:tabMinWidth="90dp"
|
||||||
app:tabMode="scrollable"
|
app:tabMode="scrollable"
|
||||||
|
android:clipToPadding="false"
|
||||||
|
android:paddingHorizontal="4dp"
|
||||||
android:background="?colorM3Surface"/>
|
android:background="?colorM3Surface"/>
|
||||||
|
|
||||||
<View
|
<View
|
||||||
|
|||||||
@@ -167,19 +167,21 @@
|
|||||||
|
|
||||||
</org.joinmastodon.android.ui.views.AutoOrientationLinearLayout>
|
</org.joinmastodon.android.ui.views.AutoOrientationLinearLayout>
|
||||||
|
|
||||||
<org.joinmastodon.android.ui.views.AutoOrientationLinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/username_wrap"
|
android:id="@+id/username_wrap"
|
||||||
|
android:orientation="horizontal"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="16dp"
|
android:layout_marginStart="16dp"
|
||||||
android:layout_marginEnd="12dp"
|
android:layout_marginEnd="12dp"
|
||||||
|
android:layout_marginTop="2dp"
|
||||||
android:layout_marginBottom="8dp">
|
android:layout_marginBottom="8dp">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/username"
|
android:id="@+id/username"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="2dp"
|
android:layout_weight="1"
|
||||||
android:layout_marginEnd="4dp"
|
android:layout_marginEnd="4dp"
|
||||||
android:maxLines="1"
|
android:maxLines="1"
|
||||||
android:ellipsize="end"
|
android:ellipsize="end"
|
||||||
@@ -187,11 +189,6 @@
|
|||||||
android:textColor="?colorM3OnSurfaceVariant"
|
android:textColor="?colorM3OnSurfaceVariant"
|
||||||
tools:text="\@Gargron" />
|
tools:text="\@Gargron" />
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:layout_marginTop="2dp">
|
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/lock_icon"
|
android:id="@+id/lock_icon"
|
||||||
android:layout_width="18sp"
|
android:layout_width="18sp"
|
||||||
@@ -216,8 +213,6 @@
|
|||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</org.joinmastodon.android.ui.views.AutoOrientationLinearLayout>
|
|
||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
@@ -443,11 +438,12 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="48dp"
|
android:layout_height="48dp"
|
||||||
android:background="@drawable/bg_onboarding_panel"
|
android:background="@drawable/bg_onboarding_panel"
|
||||||
|
android:clipToPadding="false"
|
||||||
|
android:paddingHorizontal="4dp"
|
||||||
app:tabGravity="start"
|
app:tabGravity="start"
|
||||||
app:tabIndicator="@drawable/tab_indicator_m3"
|
app:tabIndicator="@drawable/tab_indicator_m3"
|
||||||
app:tabIndicatorAnimationMode="elastic"
|
app:tabIndicatorAnimationMode="elastic"
|
||||||
app:tabIndicatorColor="?colorM3Primary"
|
app:tabIndicatorColor="?colorM3Primary"
|
||||||
android:paddingHorizontal="4dp"
|
|
||||||
app:tabIndicatorFullWidth="false"
|
app:tabIndicatorFullWidth="false"
|
||||||
app:tabMinWidth="0dp"
|
app:tabMinWidth="0dp"
|
||||||
app:tabMode="scrollable" />
|
app:tabMode="scrollable" />
|
||||||
|
|||||||
@@ -13,8 +13,6 @@
|
|||||||
android:id="@+id/tabbar"
|
android:id="@+id/tabbar"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:paddingTop="12dp"
|
|
||||||
android:paddingBottom="16dp"
|
|
||||||
android:paddingHorizontal="8dp">
|
android:paddingHorizontal="8dp">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
@@ -23,6 +21,8 @@
|
|||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:layout_marginEnd="8dp"
|
android:layout_marginEnd="8dp"
|
||||||
|
android:paddingTop="12dp"
|
||||||
|
android:paddingBottom="16dp"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
@@ -63,6 +63,8 @@
|
|||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:layout_marginEnd="8dp"
|
android:layout_marginEnd="8dp"
|
||||||
|
android:paddingTop="12dp"
|
||||||
|
android:paddingBottom="16dp"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
@@ -103,6 +105,8 @@
|
|||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:layout_marginEnd="8dp"
|
android:layout_marginEnd="8dp"
|
||||||
|
android:paddingTop="12dp"
|
||||||
|
android:paddingBottom="16dp"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
@@ -161,6 +165,8 @@
|
|||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:layout_marginEnd="8dp"
|
android:layout_marginEnd="8dp"
|
||||||
|
android:paddingTop="12dp"
|
||||||
|
android:paddingBottom="16dp"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
|
|||||||
@@ -374,8 +374,15 @@
|
|||||||
<string name="sk_duration_days_3">3 days</string>
|
<string name="sk_duration_days_3">3 days</string>
|
||||||
<string name="sk_duration_days_7">7 days</string>
|
<string name="sk_duration_days_7">7 days</string>
|
||||||
<string name="sk_notification_mention">You were mentioned by %s</string>
|
<string name="sk_notification_mention">You were mentioned by %s</string>
|
||||||
|
<string name="sk_suicide_search_terms">Suicide</string>
|
||||||
|
<string name="sk_search_suicide_title">In case you’re in distress…</string>
|
||||||
|
<string name="sk_search_suicide_message">If you’re looking for a sign not to commit suicide, this is it. Please consider reaching out to a local suicide hotline if you’re in distress.</string>
|
||||||
|
<string name="sk_search_suicide_hotlines">Find a helpline</string>
|
||||||
|
<string name="sk_do_not_show_again">Don’t show again</string>
|
||||||
|
<string name="sk_suicide_helplines_url">https://findahelpline.com</string>
|
||||||
<plurals name="sk_posts_count_label">
|
<plurals name="sk_posts_count_label">
|
||||||
<item quantity="one">post</item>
|
<item quantity="one">post</item>
|
||||||
<item quantity="other">posts</item>
|
<item quantity="other">posts</item>
|
||||||
</plurals>
|
</plurals>
|
||||||
|
<string name="sk_post_contains_media">Post contains media</string>
|
||||||
</resources>
|
</resources>
|
||||||
Reference in New Issue
Block a user