mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-09-19 16:24:41 +01:00
Show deprecation notice for API 21.
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* Copyright 2024 Signal Messenger, LLC
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
package org.thoughtcrime.securesms.banner.banners
|
||||
|
||||
import android.os.Build
|
||||
import androidx.compose.foundation.layout.PaddingValues
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.unit.dp
|
||||
import kotlinx.coroutines.flow.Flow
|
||||
import kotlinx.coroutines.flow.flowOf
|
||||
import org.signal.core.ui.compose.DayNightPreviews
|
||||
import org.signal.core.ui.compose.Previews
|
||||
import org.thoughtcrime.securesms.R
|
||||
import org.thoughtcrime.securesms.banner.Banner
|
||||
import org.thoughtcrime.securesms.banner.ui.compose.DefaultBanner
|
||||
import org.thoughtcrime.securesms.banner.ui.compose.Importance
|
||||
|
||||
class DeprecatedSdkBanner() : Banner<Unit>() {
|
||||
|
||||
override val enabled: Boolean
|
||||
get() = Build.VERSION.SDK_INT < 23
|
||||
|
||||
override val dataFlow: Flow<Unit> = flowOf(Unit)
|
||||
|
||||
@Composable
|
||||
override fun DisplayBanner(model: Unit, contentPadding: PaddingValues) = Banner(contentPadding)
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun Banner(contentPadding: PaddingValues) {
|
||||
DefaultBanner(
|
||||
title = null,
|
||||
body = stringResource(id = R.string.DeprecatedSdkBanner_body),
|
||||
importance = Importance.ERROR,
|
||||
paddingValues = contentPadding
|
||||
)
|
||||
}
|
||||
|
||||
@DayNightPreviews
|
||||
@Composable
|
||||
private fun BannerPreview() {
|
||||
Previews.Preview {
|
||||
Banner(contentPadding = PaddingValues(0.dp))
|
||||
}
|
||||
}
|
||||
+2
@@ -89,6 +89,7 @@ import org.thoughtcrime.securesms.banner.BannerManager;
|
||||
import org.thoughtcrime.securesms.banner.banners.CdsPermanentErrorBanner;
|
||||
import org.thoughtcrime.securesms.banner.banners.CdsTemporaryErrorBanner;
|
||||
import org.thoughtcrime.securesms.banner.banners.DeprecatedBuildBanner;
|
||||
import org.thoughtcrime.securesms.banner.banners.DeprecatedSdkBanner;
|
||||
import org.thoughtcrime.securesms.banner.banners.DozeBanner;
|
||||
import org.thoughtcrime.securesms.banner.banners.MediaRestoreProgressBanner;
|
||||
import org.thoughtcrime.securesms.banner.banners.OutdatedBuildBanner;
|
||||
@@ -712,6 +713,7 @@ public class ConversationListFragment extends MainFragment implements Conversati
|
||||
|
||||
private void initializeBanners() {
|
||||
List<Banner<?>> bannerRepositories = List.of(
|
||||
new DeprecatedSdkBanner(),
|
||||
new DeprecatedBuildBanner(),
|
||||
new UnauthorizedBanner(requireContext()),
|
||||
new ServiceOutageBanner(requireContext()),
|
||||
|
||||
@@ -1170,6 +1170,9 @@
|
||||
<string name="ExpiredBuildReminder_this_version_of_signal_has_expired">This version of Signal has expired. Update now to send and receive messages.</string>
|
||||
<string name="ExpiredBuildReminder_update_now">Update now</string>
|
||||
|
||||
<!-- A message in a banner shown at the top of the screen indicating that the user must upgrade their device to use signal. -->
|
||||
<string name="DeprecatedSdkBanner_body">Signal no longer works on this device. To use Signal again, update your device to a newer version of Android or switch to a newer device.</string>
|
||||
|
||||
<!-- Title of notification telling users to update Signal -->
|
||||
<string name="DeprecatedNotificationJob_update_signal">Update Signal</string>
|
||||
<!-- Message body of notification telling users that this current version of Signal has expired. If pressed, we will direct them to the website APK or PlayStore page -->
|
||||
|
||||
Reference in New Issue
Block a user