mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-21 09:20:19 +01:00
Periodically fetch release notes.
This commit is contained in:
@@ -1828,7 +1828,11 @@ public class ConversationFragment extends LoggingFragment implements Multiselect
|
||||
|
||||
@Override
|
||||
public void onDonateClicked() {
|
||||
|
||||
if (SignalStore.donationsValues().isLikelyASustainer()) {
|
||||
startActivity(AppSettingsActivity.boost(requireContext()));
|
||||
} else {
|
||||
startActivity(AppSettingsActivity.subscriptions(requireContext()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1545,7 +1545,7 @@ public class ConversationParentFragment extends Fragment
|
||||
|
||||
sendButton.resetAvailableTransports(isMediaMessage);
|
||||
|
||||
if (!isSecureText && !isPushGroupConversation() && !recipient.get().isAciOnly()) {
|
||||
if (!isSecureText && !isPushGroupConversation() && !recipient.get().isAciOnly() && !recipient.get().isReleaseNotes()) {
|
||||
sendButton.disableTransport(Type.TEXTSECURE);
|
||||
}
|
||||
|
||||
@@ -1556,7 +1556,7 @@ public class ConversationParentFragment extends Fragment
|
||||
if (!recipient.get().isPushGroup() && recipient.get().isForceSmsSelection()) {
|
||||
sendButton.setDefaultTransport(Type.SMS);
|
||||
} else {
|
||||
if (isSecureText || isPushGroupConversation() || recipient.get().isAciOnly()) {
|
||||
if (isSecureText || isPushGroupConversation() || recipient.get().isAciOnly() || recipient.get().isReleaseNotes()) {
|
||||
sendButton.setDefaultTransport(Type.TEXTSECURE);
|
||||
} else {
|
||||
sendButton.setDefaultTransport(Type.SMS);
|
||||
|
||||
@@ -715,7 +715,14 @@ public final class ConversationReactionOverlay extends RelativeLayout {
|
||||
}
|
||||
|
||||
items.add(new ActionItem(R.drawable.ic_select_24_tinted, getResources().getString(R.string.conversation_selection__menu_multi_select), () -> handleActionItemClicked(Action.MULTISELECT)));
|
||||
items.add(new ActionItem(R.drawable.ic_info_tinted_24, getResources().getString(R.string.conversation_selection__menu_message_details), () -> handleActionItemClicked(Action.VIEW_INFO)));
|
||||
|
||||
if (menuState.shouldShowInfoAction()) {
|
||||
items.add(new ActionItem(R.drawable.ic_info_tinted_24, getResources().getString(R.string.conversation_selection__menu_message_details), () -> handleActionItemClicked(Action.VIEW_INFO)));
|
||||
}
|
||||
|
||||
backgroundView.setVisibility(menuState.shouldShowReactions() ? View.VISIBLE : View.INVISIBLE);
|
||||
foregroundView.setVisibility(menuState.shouldShowReactions() ? View.VISIBLE : View.INVISIBLE);
|
||||
|
||||
items.add(new ActionItem(R.drawable.ic_delete_tinted_24, getResources().getString(R.string.conversation_selection__menu_delete), () -> handleActionItemClicked(Action.DELETE)));
|
||||
|
||||
return items;
|
||||
|
||||
@@ -22,6 +22,8 @@ final class MenuState {
|
||||
private final boolean resend;
|
||||
private final boolean copy;
|
||||
private final boolean delete;
|
||||
private final boolean info;
|
||||
private final boolean reactions;
|
||||
|
||||
private MenuState(@NonNull Builder builder) {
|
||||
forward = builder.forward;
|
||||
@@ -31,6 +33,8 @@ final class MenuState {
|
||||
resend = builder.resend;
|
||||
copy = builder.copy;
|
||||
delete = builder.delete;
|
||||
info = builder.info;
|
||||
reactions = builder.reactions;
|
||||
}
|
||||
|
||||
boolean shouldShowForwardAction() {
|
||||
@@ -61,6 +65,14 @@ final class MenuState {
|
||||
return delete;
|
||||
}
|
||||
|
||||
boolean shouldShowInfoAction() {
|
||||
return info;
|
||||
}
|
||||
|
||||
boolean shouldShowReactions() {
|
||||
return reactions;
|
||||
}
|
||||
|
||||
static MenuState getMenuState(@NonNull Recipient conversationRecipient,
|
||||
@NonNull Set<MultiselectPart> selectedParts,
|
||||
boolean shouldShowMessageRequest,
|
||||
@@ -148,6 +160,8 @@ final class MenuState {
|
||||
|
||||
return builder.shouldShowCopyAction(!actionMessage && !remoteDelete && hasText)
|
||||
.shouldShowDeleteAction(!hasInMemory && onlyContainsCompleteMessages(selectedParts))
|
||||
.shouldShowInfoAction(!conversationRecipient.isReleaseNotes())
|
||||
.shouldShowReactions(!conversationRecipient.isReleaseNotes())
|
||||
.build();
|
||||
}
|
||||
|
||||
@@ -172,7 +186,8 @@ final class MenuState {
|
||||
!isDisplayingMessageRequest &&
|
||||
messageRecord.isSecure() &&
|
||||
(!conversationRecipient.isGroup() || conversationRecipient.isActiveGroup()) &&
|
||||
!messageRecord.getRecipient().isBlocked();
|
||||
!messageRecord.getRecipient().isBlocked() &&
|
||||
!conversationRecipient.isReleaseNotes();
|
||||
}
|
||||
|
||||
static boolean isActionMessage(@NonNull MessageRecord messageRecord) {
|
||||
@@ -188,7 +203,8 @@ final class MenuState {
|
||||
messageRecord.isGroupV1MigrationEvent() ||
|
||||
messageRecord.isChatSessionRefresh() ||
|
||||
messageRecord.isInMemoryMessageRecord() ||
|
||||
messageRecord.isChangeNumber();
|
||||
messageRecord.isChangeNumber() ||
|
||||
messageRecord.isBoostRequest();
|
||||
}
|
||||
|
||||
private final static class Builder {
|
||||
@@ -200,6 +216,8 @@ final class MenuState {
|
||||
private boolean resend;
|
||||
private boolean copy;
|
||||
private boolean delete;
|
||||
private boolean info;
|
||||
private boolean reactions;
|
||||
|
||||
@NonNull Builder shouldShowForwardAction(boolean forward) {
|
||||
this.forward = forward;
|
||||
@@ -236,6 +254,16 @@ final class MenuState {
|
||||
return this;
|
||||
}
|
||||
|
||||
@NonNull Builder shouldShowInfoAction(boolean info) {
|
||||
this.info = info;
|
||||
return this;
|
||||
}
|
||||
|
||||
@NonNull Builder shouldShowReactions(boolean reactions) {
|
||||
this.reactions = reactions;
|
||||
return this;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
MenuState build() {
|
||||
return new MenuState(this);
|
||||
|
||||
Reference in New Issue
Block a user