kopia lustrzana https://github.com/ryukoposting/Signal-Android
Inline the scheduled message feature flag.
rodzic
dc4eb7911d
commit
ca8755c6ad
|
@ -2082,26 +2082,24 @@ public class ConversationParentFragment extends Fragment
|
|||
attachButton.setOnClickListener(new AttachButtonListener());
|
||||
attachButton.setOnLongClickListener(new AttachButtonLongClickListener());
|
||||
sendButton.setOnClickListener(sendButtonListener);
|
||||
if (FeatureFlags.scheduledMessageSends()) {
|
||||
sendButton.setScheduledSendListener(new SendButton.ScheduledSendListener() {
|
||||
@Override
|
||||
public void onSendScheduled() {
|
||||
ScheduleMessageContextMenu.show(sendButton, (ViewGroup) requireView(), time -> {
|
||||
if (time == -1) {
|
||||
ScheduleMessageTimePickerBottomSheet.showSchedule(getChildFragmentManager());
|
||||
} else {
|
||||
sendMessage(null, time);
|
||||
}
|
||||
return Unit.INSTANCE;
|
||||
});
|
||||
}
|
||||
sendButton.setScheduledSendListener(new SendButton.ScheduledSendListener() {
|
||||
@Override
|
||||
public void onSendScheduled() {
|
||||
ScheduleMessageContextMenu.show(sendButton, (ViewGroup) requireView(), time -> {
|
||||
if (time == -1) {
|
||||
ScheduleMessageTimePickerBottomSheet.showSchedule(getChildFragmentManager());
|
||||
} else {
|
||||
sendMessage(null, time);
|
||||
}
|
||||
return Unit.INSTANCE;
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canSchedule() {
|
||||
return !(inputPanel.isRecordingInLockedMode() || draftViewModel.getVoiceNoteDraft() != null);
|
||||
}
|
||||
});
|
||||
}
|
||||
@Override
|
||||
public boolean canSchedule() {
|
||||
return !(inputPanel.isRecordingInLockedMode() || draftViewModel.getVoiceNoteDraft() != null);
|
||||
}
|
||||
});
|
||||
sendButton.setEnabled(true);
|
||||
sendButton.addOnSelectionChangedListener((newMessageSendType, manuallySelected) -> {
|
||||
if (getContext() == null) {
|
||||
|
|
|
@ -47,7 +47,6 @@ import org.thoughtcrime.securesms.mms.SentMediaQuality
|
|||
import org.thoughtcrime.securesms.permissions.Permissions
|
||||
import org.thoughtcrime.securesms.recipients.Recipient
|
||||
import org.thoughtcrime.securesms.scribbles.ImageEditorFragment
|
||||
import org.thoughtcrime.securesms.util.FeatureFlags
|
||||
import org.thoughtcrime.securesms.util.LifecycleDisposable
|
||||
import org.thoughtcrime.securesms.util.MediaUtil
|
||||
import org.thoughtcrime.securesms.util.SystemWindowInsetsSetter
|
||||
|
@ -219,7 +218,7 @@ class MediaReviewFragment : Fragment(R.layout.v2_media_review_fragment), Schedul
|
|||
performSend()
|
||||
}
|
||||
}
|
||||
if (FeatureFlags.scheduledMessageSends() && !sharedViewModel.isStory()) {
|
||||
if (!sharedViewModel.isStory()) {
|
||||
sendButton.setOnLongClickListener {
|
||||
ScheduleMessageContextMenu.show(it, (requireView() as ViewGroup)) { time: Long ->
|
||||
if (time == -1L) {
|
||||
|
|
|
@ -105,7 +105,6 @@ public final class FeatureFlags {
|
|||
private static final String PAYPAL_ONE_TIME_DONATIONS = "android.oneTimePayPalDonations.2";
|
||||
private static final String PAYPAL_RECURRING_DONATIONS = "android.recurringPayPalDonations.3";
|
||||
private static final String TEXT_FORMATTING = "android.textFormatting";
|
||||
private static final String SCHEDULED_MESSAGE_SENDS = "android.scheduledMessageSends.2";
|
||||
|
||||
/**
|
||||
* We will only store remote values for flags in this set. If you want a flag to be controllable
|
||||
|
@ -161,8 +160,7 @@ public final class FeatureFlags {
|
|||
CHAT_FILTERS,
|
||||
PAYPAL_ONE_TIME_DONATIONS,
|
||||
PAYPAL_RECURRING_DONATIONS,
|
||||
TEXT_FORMATTING,
|
||||
SCHEDULED_MESSAGE_SENDS
|
||||
TEXT_FORMATTING
|
||||
);
|
||||
|
||||
@VisibleForTesting
|
||||
|
@ -576,13 +574,6 @@ public final class FeatureFlags {
|
|||
return getBoolean(TEXT_FORMATTING, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether or not we allow the user to schedule message sends. This takes over the entry point for SMS message sends
|
||||
*/
|
||||
public static boolean scheduledMessageSends() {
|
||||
return getBoolean(SCHEDULED_MESSAGE_SENDS, false);
|
||||
}
|
||||
|
||||
/** Only for rendering debug info. */
|
||||
public static synchronized @NonNull Map<String, Object> getMemoryValues() {
|
||||
return new TreeMap<>(REMOTE_VALUES);
|
||||
|
|
Ładowanie…
Reference in New Issue