chore: make app compile again

This commit is contained in:
LucasGGamerM
2023-10-12 15:34:32 -03:00
parent ce3ca42c7a
commit d829c659bd
10 changed files with 45 additions and 23 deletions

View File

@@ -142,7 +142,9 @@ public class AccountLocalPreferences{
BLUE,
BROWN,
RED,
YELLOW;
YELLOW,
NORD,
WHITE;
public @StringRes int getName() {
return switch(this){
@@ -154,6 +156,8 @@ public class AccountLocalPreferences{
case BROWN -> R.string.sk_color_palette_brown;
case RED -> R.string.sk_color_palette_red;
case YELLOW -> R.string.sk_color_palette_yellow;
case NORD -> R.string.mo_color_palette_nord;
case WHITE -> R.string.mo_color_palette_black_and_white;
};
}
}

View File

@@ -138,7 +138,6 @@ public class ProfileFragment extends LoaderFragment implements OnBackPressedList
private ImageView avatar;
private CoverImageView cover;
private View avatarBorder;
private View usernameWrap;
private TextView name, username, bio, followersCount, followersLabel, followingCount, followingLabel;
private ImageView lockIcon, botIcon;
private ProgressBarButton actionButton, notifyButton;

View File

@@ -16,6 +16,7 @@ import org.joinmastodon.android.fragments.HasAccountID;
import org.joinmastodon.android.model.viewmodel.ListItem;
import org.joinmastodon.android.ui.utils.UiUtils;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Objects;
@@ -79,7 +80,7 @@ public class SettingsAboutAppFragment extends BaseSettingsFragment<Void> impleme
}
private void onClearRecentEmojisClick(){
getLocalPrefs().recentEmojis=new HashMap<>();
getLocalPrefs().recentCustomEmoji=new ArrayList<>();
getLocalPrefs().save();
Toast.makeText(getContext(), R.string.mo_recent_emoji_cleared, Toast.LENGTH_SHORT).show();
}

View File

@@ -109,10 +109,9 @@ public class SettingsDisplayFragment extends BaseSettingsFragment<Void>{
boolean restartPlease=
GlobalUserPreferences.disableM3PillActiveIndicator!=disablePillItem.checked ||
GlobalUserPreferences.showNavigationLabels!=showNavigationLabelsItem.checked ||
lp.likeIcon!=likeIconItem.checked;
GlobalUserPreferences.showNavigationLabels!=showNavigationLabelsItem.checked ||
GlobalUserPreferences.showMediaPreview !=showMediaPreviewItem.checked ||
GlobalUserPreferences.showDividers!=showPostDividersItem.checked;
GlobalUserPreferences.showDividers!=showPostDividersItem.checked ||
lp.likeIcon!=likeIconItem.checked;
lp.revealCWs=revealCWsItem.checked;
lp.hideSensitiveMedia=hideSensitiveMediaItem.checked;

View File

@@ -179,7 +179,7 @@ public class EmojiReactionsStatusDisplayItem extends StatusDisplayItem {
(Activity) item.parentFragment.getContext(),
item.accountID,
AccountSessionManager.getInstance().getCustomEmojis(session.domain),
session.domain, true, item.accountID);
session.domain, true);
emojiKeyboard.setListener(this);
space.setVisibility(View.GONE);
root.addView(emojiKeyboard.getView());

View File

@@ -65,7 +65,6 @@ public class FooterStatusDisplayItem extends StatusDisplayItem{
private final TextView replies, boosts, favorites;
private final View reply, boost, favorite, share, bookmark;
private final ImageView favIcon;
private static final Animation opacityOut, opacityIn;
private static AnimationSet animSet;
@@ -124,6 +123,27 @@ public class FooterStatusDisplayItem extends StatusDisplayItem{
share.setAccessibilityDelegate(buttonAccessibilityDelegate);
}
private static final float ALPHA_PRESSED=0.55f;
static {
AlphaAnimation opacityOut = new AlphaAnimation(1, ALPHA_PRESSED);
opacityOut.setDuration(300);
opacityOut.setInterpolator(CubicBezierInterpolator.DEFAULT);
opacityOut.setFillAfter(true);
AlphaAnimation opacityIn = new AlphaAnimation(ALPHA_PRESSED, 1);
opacityIn.setDuration(400);
opacityIn.setInterpolator(CubicBezierInterpolator.DEFAULT);
Animation spin = new RotateAnimation(0, 360,
Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF,
0.5f);
animSet = new AnimationSet(true);
animSet.setInterpolator(CubicBezierInterpolator.DEFAULT);
animSet.addAnimation(spin);
animSet.addAnimation(opacityIn);
animSet.setDuration(400);
}
@Override
public void onBind(FooterStatusDisplayItem item){
bindText(replies, item.status.repliesCount);
@@ -200,7 +220,7 @@ public class FooterStatusDisplayItem extends StatusDisplayItem{
UiUtils.lookupStatus(v.getContext(),
item.status, item.accountID, null,
status -> {
v.startAnimation(opacityIn);
UiUtils.opacityIn(v);
Bundle args=new Bundle();
args.putString("account", item.accountID);
args.putParcelable("replyTo", Parcels.wrap(status));
@@ -365,10 +385,10 @@ public class FooterStatusDisplayItem extends StatusDisplayItem{
favorite.setSelected(!status.favourited);
vibrateForAction(favorite, !status.favourited);
AccountSessionManager.getInstance().getAccount(item.accountID).getStatusInteractionController().setFavorited(status, !status.favourited, r->{
if (status.favourited) {
v.startAnimation(GlobalUserPreferences.reduceMotion ? opacityIn : animSet);
if (status.favourited && !GlobalUserPreferences.reduceMotion) {
v.startAnimation(animSet);
} else {
v.startAnimation(opacityIn);
UiUtils.opacityIn(v);
}
bindText(favorites, r.favouritesCount);
});
@@ -379,10 +399,10 @@ public class FooterStatusDisplayItem extends StatusDisplayItem{
favorite.setSelected(!item.status.favourited);
vibrateForAction(favorite, !item.status.favourited);
AccountSessionManager.getInstance().getAccount(item.accountID).getStatusInteractionController().setFavorited(item.status, !item.status.favourited, r->{
if (item.status.favourited) {
v.startAnimation(GlobalUserPreferences.reduceMotion ? opacityIn : animSet);
if (item.status.favourited && !GlobalUserPreferences.reduceMotion) {
v.startAnimation(animSet);
} else {
v.startAnimation(opacityIn);
UiUtils.opacityIn(v);
}
bindText(favorites, r.favouritesCount);
});
@@ -413,7 +433,7 @@ public class FooterStatusDisplayItem extends StatusDisplayItem{
bookmark.setSelected(!status.bookmarked);
vibrateForAction(bookmark, !status.bookmarked);
AccountSessionManager.getInstance().getAccount(item.accountID).getStatusInteractionController().setBookmarked(status, !status.bookmarked, r->{
v.startAnimation(opacityIn);
UiUtils.opacityIn(v);
});
}
);
@@ -430,7 +450,7 @@ public class FooterStatusDisplayItem extends StatusDisplayItem{
if (AccountSessionManager.getInstance().getLoggedInAccounts().size() < 2) return false;
UiUtils.pickInteractAs(v.getContext(),
item.accountID, item.status,
s -> s.bookmarked,w
s -> s.bookmarked,
(ic, status, consumer) -> ic.setBookmarked(status, true, consumer),
R.string.sk_bookmark_as,
R.string.sk_bookmarked_as,

View File

@@ -117,7 +117,6 @@ public class NotificationHeaderStatusDisplayItem extends StatusDisplayItem{
public static class Holder extends StatusDisplayItem.Holder<NotificationHeaderStatusDisplayItem> implements ImageLoaderViewHolder{
private final ImageView icon, avatar, deleteNotification;
private final TextView text, timestamp;
private final int selectableItemBackground;
public Holder(Activity activity, ViewGroup parent){
super(activity, R.layout.display_item_notification_header, parent);

View File

@@ -278,14 +278,14 @@ public abstract class StatusDisplayItem{
contentItems.add(new AudioStatusDisplayItem(parentID, fragment, statusForContent, att));
}
if(att.type==Attachment.Type.UNKNOWN){
contentItems.add(new FileStatusDisplayItem(parentID, fragment, att));
contentItems.add(new FileStatusDisplayItem(parentID, fragment, att, statusForContent));
}
}
if(statusForContent.poll!=null){
buildPollItems(parentID, fragment, statusForContent.poll, contentItems);
buildPollItems(parentID, fragment, statusForContent.poll, contentItems, statusForContent);
}
if(statusForContent.card!=null && statusForContent.mediaAttachments.isEmpty()){
contentItems.add(new LinkCardStatusDisplayItem(parentID, fragment, statusForContent));
contentItems.add(new LinkCardStatusDisplayItem(parentID, fragment, statusForContent, (flags & FLAG_NO_MEDIA_PREVIEW)==0));
}
if(contentItems!=items && statusForContent.spoilerRevealed){
items.addAll(contentItems);

View File

@@ -25,7 +25,7 @@ public class ColorPalette {
BLUE, new ColorPalette(R.style.ColorPalette_Blue),
BROWN, new ColorPalette(R.style.ColorPalette_Brown),
RED, new ColorPalette(R.style.ColorPalette_Red),
YELLOW, new ColorPalette(R.style.ColorPalette_Yellow)
YELLOW, new ColorPalette(R.style.ColorPalette_Yellow),
NORD, new ColorPalette(R.style.ColorPalette_Nord),
WHITE, new ColorPalette(R.style.ColorPalette_White)

View File

@@ -68,7 +68,7 @@
<item name="colorM3DarkOnSurface">?colorGray100</item>
<item name="colorM3PrimaryInverse">?colorPrimary200</item>
<item name="colorFavorite">@color/favorite_selected</item>
<item name="colorFavorite">@color/warning_500</item>
<item name="colorLike">@color/like_selected</item>
<item name="colorBoost">?colorM3Primary</item>
<item name="colorPoll">@color/bookmark_selected</item>