mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-21 00:59:49 +01:00
Add banner warning about API 19 deprecation.
This commit is contained in:
committed by
Alex Hart
parent
7617a164fc
commit
564b9f47ee
@@ -1936,6 +1936,8 @@ public class ConversationParentFragment extends Fragment
|
||||
InsightsLauncher.showInsightsDashboard(getChildFragmentManager());
|
||||
} else if (reminderActionId == R.id.reminder_action_update_now) {
|
||||
PlayStoreUtil.openPlayStoreOrOurApkDownloadPage(requireContext());
|
||||
} else if (reminderActionId == R.id.reminder_action_api_19_learn_more) {
|
||||
CommunicationActions.openBrowserLink(requireContext(), "https://support.signal.org/hc/articles/5109141421850");
|
||||
} else {
|
||||
throw new IllegalArgumentException("Unknown ID: " + reminderActionId);
|
||||
}
|
||||
@@ -2974,6 +2976,11 @@ public class ConversationParentFragment extends Fragment
|
||||
}
|
||||
|
||||
private void sendMediaMessage(@NonNull MediaSendActivityResult result) {
|
||||
if (ExpiredBuildReminder.isEligible()) {
|
||||
showExpiredDialog();
|
||||
return;
|
||||
}
|
||||
|
||||
long thread = this.threadId;
|
||||
long expiresIn = TimeUnit.SECONDS.toMillis(recipient.get().getExpiresInSeconds());
|
||||
QuoteModel quote = result.isViewOnce() ? null : inputPanel.getQuote().orElse(null);
|
||||
@@ -3052,6 +3059,11 @@ public class ConversationParentFragment extends Fragment
|
||||
final boolean clearComposeBox,
|
||||
final @Nullable String metricId)
|
||||
{
|
||||
if (ExpiredBuildReminder.isEligible()) {
|
||||
showExpiredDialog();
|
||||
return new SettableFuture<>(null);
|
||||
}
|
||||
|
||||
if (!viewModel.isDefaultSmsApplication() && sendType.usesSmsTransport() && recipient.get().hasSmsAddress()) {
|
||||
showDefaultSmsPrompt();
|
||||
return new SettableFuture<>(null);
|
||||
@@ -3130,6 +3142,11 @@ public class ConversationParentFragment extends Fragment
|
||||
private void sendTextMessage(@NonNull MessageSendType sendType, final long expiresIn, final boolean initiating, final @Nullable String metricId)
|
||||
throws InvalidMessageException
|
||||
{
|
||||
if (ExpiredBuildReminder.isEligible()) {
|
||||
showExpiredDialog();
|
||||
return;
|
||||
}
|
||||
|
||||
if (!viewModel.isDefaultSmsApplication() && sendType.usesSmsTransport() && recipient.get().hasSmsAddress()) {
|
||||
showDefaultSmsPrompt();
|
||||
return;
|
||||
@@ -3172,6 +3189,29 @@ public class ConversationParentFragment extends Fragment
|
||||
.show();
|
||||
}
|
||||
|
||||
private void showExpiredDialog() {
|
||||
Reminder reminder = new ExpiredBuildReminder(requireContext());
|
||||
|
||||
MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(requireContext())
|
||||
.setMessage(reminder.getText())
|
||||
.setPositiveButton(android.R.string.ok, (d, w) -> d.dismiss());
|
||||
|
||||
List<Reminder.Action> actions = reminder.getActions();
|
||||
if (actions.size() == 1) {
|
||||
Reminder.Action action = actions.get(0);
|
||||
|
||||
builder.setNeutralButton(action.getTitle(), (d, i) -> {
|
||||
if (action.getActionId() == R.id.reminder_action_update_now) {
|
||||
PlayStoreUtil.openPlayStoreOrOurApkDownloadPage(requireContext());
|
||||
} else if (action.getActionId() == R.id.reminder_action_api_19_learn_more) {
|
||||
CommunicationActions.openBrowserLink(requireContext(), "https://support.signal.org/hc/articles/5109141421850");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
builder.show();
|
||||
}
|
||||
|
||||
private void updateToggleButtonState() {
|
||||
if (inputPanel.isRecordingInLockedMode()) {
|
||||
buttonToggle.display(sendButton);
|
||||
|
||||
Reference in New Issue
Block a user