Release 3.4.3

pull/434/head
Thomas 2 years ago
parent 50fca052b3
commit e8e5af7abe

@ -13,8 +13,8 @@ android {
defaultConfig {
minSdk 21
targetSdk 31
versionCode 415
versionName "3.4.2"
versionCode 416
versionName "3.4.3"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
flavorDimensions "default"

@ -1,7 +1,12 @@
[
{
"version": "3.4.3",
"code": "416",
"note": "Changed:\n- Swipe between timelines\n- Improve cache\n- Button sizes in messages follow defined scale\n\nFixed:\n- Pleroma: Emoji reactions\n- Sharing (several fixes)\n- Theme issues\n- Rendering issue for links\n- Notifications not removed from cache\n- Some crashes"
},
{
"version": "3.4.2",
"code": "412",
"code": "415",
"note": "Fixed:\n- Attach media to a reply"
},
{

@ -388,12 +388,12 @@ public class MediaActivity extends BaseActivity implements OnDownloadInterface {
}
} else {
binding.translate.setVisibility(View.GONE);
binding.originalMessage.setVisibility(View.GONE);
binding.originalMessage.setVisibility(View.INVISIBLE);
binding.mediaDescriptionTranslated.setVisibility(View.GONE);
binding.mediaDescription.setVisibility(View.GONE);
}
} else {
binding.originalMessage.setVisibility(View.GONE);
binding.originalMessage.setVisibility(View.INVISIBLE);
binding.translate.setVisibility(View.GONE);
binding.mediaDescriptionTranslated.setVisibility(View.GONE);
binding.mediaDescription.setVisibility(View.GONE);
@ -456,7 +456,7 @@ public class MediaActivity extends BaseActivity implements OnDownloadInterface {
} else {
binding.mediaDescription.setVisibility(View.GONE);
binding.translate.setVisibility(View.GONE);
binding.originalMessage.setVisibility(View.GONE);
binding.originalMessage.setVisibility(View.INVISIBLE);
hideSystemUI();
}
}

@ -33,6 +33,7 @@ import app.fedilab.android.client.entities.api.Reaction;
import app.fedilab.android.databinding.DrawerReactionBinding;
import app.fedilab.android.helper.Helper;
import app.fedilab.android.viewmodel.mastodon.AnnouncementsVM;
import app.fedilab.android.viewmodel.pleroma.ActionsVM;
/**
@ -44,10 +45,18 @@ public class ReactionAdapter extends RecyclerView.Adapter<ReactionAdapter.Reacti
private final List<Reaction> reactions;
private final String announcementId;
private Context context;
private final boolean statusReaction;
ReactionAdapter(String announcementId, List<Reaction> reactions, boolean statusReaction) {
this.reactions = reactions;
this.announcementId = announcementId;
this.statusReaction = statusReaction;
}
ReactionAdapter(String announcementId, List<Reaction> reactions) {
this.reactions = reactions;
this.announcementId = announcementId;
this.statusReaction = false;
}
@NonNull
@ -78,17 +87,33 @@ public class ReactionAdapter extends RecyclerView.Adapter<ReactionAdapter.Reacti
holder.binding.reactionName.setVisibility(View.VISIBLE);
holder.binding.reactionEmoji.setVisibility(View.GONE);
}
AnnouncementsVM announcementsVM = new ViewModelProvider((ViewModelStoreOwner) context).get(AnnouncementsVM.class);
holder.binding.reactionContainer.setOnClickListener(v -> {
if (reaction.me) {
announcementsVM.removeReaction(BaseMainActivity.currentInstance, BaseMainActivity.currentToken, announcementId, reaction.name);
reaction.me = false;
} else {
announcementsVM.addReaction(BaseMainActivity.currentInstance, BaseMainActivity.currentToken, announcementId, reaction.name);
reaction.me = true;
}
notifyItemChanged(position);
});
if (!statusReaction) {
AnnouncementsVM announcementsVM = new ViewModelProvider((ViewModelStoreOwner) context).get(AnnouncementsVM.class);
holder.binding.reactionContainer.setOnClickListener(v -> {
if (reaction.me) {
announcementsVM.removeReaction(BaseMainActivity.currentInstance, BaseMainActivity.currentToken, announcementId, reaction.name);
reaction.me = false;
} else {
announcementsVM.addReaction(BaseMainActivity.currentInstance, BaseMainActivity.currentToken, announcementId, reaction.name);
reaction.me = true;
}
notifyItemChanged(position);
});
} else {
ActionsVM actionVM = new ViewModelProvider((ViewModelStoreOwner) context).get(ActionsVM.class);
holder.binding.reactionContainer.setOnClickListener(v -> {
if (reaction.me) {
actionVM.removeReaction(BaseMainActivity.currentInstance, BaseMainActivity.currentToken, announcementId, reaction.name);
reaction.me = false;
reaction.count -= 1;
} else {
actionVM.addReaction(BaseMainActivity.currentInstance, BaseMainActivity.currentToken, announcementId, reaction.name);
reaction.me = true;
reaction.count += 1;
}
notifyItemChanged(position);
});
}
}
@Override

@ -348,7 +348,7 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
if (MainActivity.currentAccount != null && MainActivity.currentAccount.api == Account.API.PLEROMA) {
if (status.pleroma != null && status.pleroma.emoji_reactions != null && status.pleroma.emoji_reactions.size() > 0) {
holder.binding.layoutReactions.getRoot().setVisibility(View.VISIBLE);
ReactionAdapter reactionAdapter = new ReactionAdapter(status.id, status.pleroma.emoji_reactions);
ReactionAdapter reactionAdapter = new ReactionAdapter(status.id, status.pleroma.emoji_reactions, true);
holder.binding.layoutReactions.reactionsView.setAdapter(reactionAdapter);
LinearLayoutManager layoutManager
= new LinearLayoutManager(context, LinearLayoutManager.HORIZONTAL, false);
@ -369,7 +369,7 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
return;
}
for (Reaction reaction : status.pleroma.emoji_reactions) {
if (reaction.name.compareTo(emojiStr) == 0) {
if (reaction.name.compareTo(emojiStr) == 0 && reaction.me) {
alreadyAdded = true;
reaction.count = (reaction.count - 1);
if (reaction.count == 0) {
@ -405,6 +405,7 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
int paddingDp = (int) (paddingPixel * density);
builder.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss());
builder.setTitle(R.string.insert_emoji);
if (emojis != null && emojis.size() > 0 && emojis.get(BaseMainActivity.currentInstance) != null) {
GridView gridView = new GridView(context);
gridView.setAdapter(new EmojiAdapter(emojis.get(BaseMainActivity.currentInstance)));
@ -418,7 +419,7 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
return;
}
for (Reaction reaction : status.pleroma.emoji_reactions) {
if (reaction.name.compareTo(emojiStr) == 0) {
if (reaction.name.compareTo(emojiStr) == 0 && reaction.me) {
alreadyAdded = true;
reaction.count = (reaction.count - 1);
if (reaction.count == 0) {

@ -95,7 +95,7 @@
android:text="@string/view_the_original_message"
android:textColor="@color/cyanea_accent_dark_reference"
android:textSize="18sp"
android:visibility="gone"
android:visibility="invisible"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"

@ -247,7 +247,7 @@
android:text="@string/display_toot_truncate"
android:textAllCaps="false"
app:iconTint="@color/cyanea_accent_reference"
app:strokeColor="@color/cyanea_accent_dark_reference" />
app:strokeColor="@color/cyanea_accent_reference" />
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/container_trans"

@ -0,0 +1,12 @@
Changed:
- Swipe between timelines
- Improve cache
- Button sizes in messages follow defined scale
Fixed:
- Pleroma: Emoji reactions
- Sharing (several fixes)
- Theme issues
- Rendering issue for links
- Notifications not removed from cache
- Some crashes
Loading…
Cancel
Save