mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-20 16:49:40 +01:00
Refactor app settings.
This commit is contained in:
committed by
Greyson Parrelli
parent
a94d77d81e
commit
f2d5ea0391
@@ -1,26 +0,0 @@
|
||||
package org.thoughtcrime.securesms.util;
|
||||
|
||||
import androidx.activity.ComponentActivity;
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import org.thoughtcrime.securesms.R;
|
||||
|
||||
public final class ActivityTransitionUtil {
|
||||
|
||||
private ActivityTransitionUtil() {}
|
||||
|
||||
/**
|
||||
* To be used with finish
|
||||
*/
|
||||
public static void setSlideOutTransition(@NonNull ComponentActivity activity) {
|
||||
activity.overridePendingTransition(R.anim.slide_from_start, R.anim.slide_to_end);
|
||||
}
|
||||
|
||||
/**
|
||||
* To be used with startActivity
|
||||
*/
|
||||
public static void setSlideInTransition(@NonNull ComponentActivity activity) {
|
||||
activity.overridePendingTransition(R.anim.slide_from_end, R.anim.slide_to_start);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -103,7 +103,7 @@ public class BackupUtil {
|
||||
|
||||
public static void disableBackups(@NonNull Context context) {
|
||||
BackupPassphrase.set(context, null);
|
||||
TextSecurePreferences.setBackupEnabled(context, false);
|
||||
SignalStore.settings().setBackupEnabled(false);
|
||||
BackupUtil.deleteAllBackups();
|
||||
|
||||
if (BackupUtil.isUserSelectionRequired(context)) {
|
||||
|
||||
@@ -17,6 +17,7 @@ import com.annimon.stream.Stream;
|
||||
import org.signal.core.util.concurrent.SignalExecutors;
|
||||
import org.signal.core.util.logging.Log;
|
||||
import org.thoughtcrime.securesms.dependencies.ApplicationDependencies;
|
||||
import org.thoughtcrime.securesms.keyvalue.SignalStore;
|
||||
import org.thoughtcrime.securesms.notifications.DefaultMessageNotifier;
|
||||
import org.thoughtcrime.securesms.notifications.NotificationIds;
|
||||
import org.thoughtcrime.securesms.notifications.SingleRecipientNotificationBuilder;
|
||||
@@ -51,7 +52,7 @@ public final class BubbleUtil {
|
||||
return false;
|
||||
}
|
||||
|
||||
NotificationPrivacyPreference privacyPreference = TextSecurePreferences.getNotificationPrivacy(context);
|
||||
NotificationPrivacyPreference privacyPreference = SignalStore.settings().getMessageNotificationsPrivacy();
|
||||
if (!privacyPreference.isDisplayContact()) {
|
||||
Log.i(TAG, "Bubbles are not available when notification privacy settings are enabled.");
|
||||
return false;
|
||||
@@ -90,7 +91,7 @@ public final class BubbleUtil {
|
||||
ApplicationDependencies.getMessageNotifier().updateNotification(context, threadId, BubbleState.SHOWN);
|
||||
} else {
|
||||
Recipient recipient = Recipient.resolved(recipientId);
|
||||
SingleRecipientNotificationBuilder builder = new SingleRecipientNotificationBuilder(context, TextSecurePreferences.getNotificationPrivacy(context));
|
||||
SingleRecipientNotificationBuilder builder = new SingleRecipientNotificationBuilder(context, SignalStore.settings().getMessageNotificationsPrivacy());
|
||||
|
||||
builder.addMessageBody(recipient, recipient, "", System.currentTimeMillis(), null);
|
||||
builder.setThread(recipient);
|
||||
|
||||
@@ -5,6 +5,7 @@ import android.app.Service;
|
||||
import android.content.Context;
|
||||
import android.content.res.Configuration;
|
||||
|
||||
import org.thoughtcrime.securesms.keyvalue.SignalStore;
|
||||
import org.thoughtcrime.securesms.util.dynamiclanguage.LanguageString;
|
||||
|
||||
import java.util.Locale;
|
||||
@@ -45,7 +46,7 @@ public class DynamicLanguage {
|
||||
}
|
||||
|
||||
private static Locale getSelectedLocale(Context context) {
|
||||
Locale locale = LanguageString.parseLocale(TextSecurePreferences.getLanguage(context));
|
||||
Locale locale = LanguageString.parseLocale(SignalStore.settings().getLanguage());
|
||||
if (locale == null) {
|
||||
return Locale.getDefault();
|
||||
} else {
|
||||
|
||||
@@ -11,6 +11,7 @@ import androidx.appcompat.app.AppCompatDelegate;
|
||||
|
||||
import org.signal.core.util.logging.Log;
|
||||
import org.thoughtcrime.securesms.R;
|
||||
import org.thoughtcrime.securesms.keyvalue.SignalStore;
|
||||
|
||||
public class DynamicTheme {
|
||||
|
||||
@@ -54,7 +55,7 @@ public class DynamicTheme {
|
||||
}
|
||||
|
||||
public static void setDefaultDayNightMode(@NonNull Context context) {
|
||||
String theme = TextSecurePreferences.getTheme(context);
|
||||
String theme = SignalStore.settings().getTheme();
|
||||
|
||||
if (theme.equals(SYSTEM)) {
|
||||
Log.d(TAG, "Setting to follow system expecting: " + ConfigurationUtil.getNightModeConfiguration(context.getApplicationContext()));
|
||||
@@ -74,7 +75,7 @@ public class DynamicTheme {
|
||||
* Takes the system theme into account.
|
||||
*/
|
||||
public static boolean isDarkTheme(@NonNull Context context) {
|
||||
String theme = TextSecurePreferences.getTheme(context);
|
||||
String theme = SignalStore.settings().getTheme();
|
||||
|
||||
if (theme.equals(SYSTEM) && systemThemeAvailable()) {
|
||||
return isSystemInDarkTheme(context);
|
||||
|
||||
@@ -3,6 +3,7 @@ package org.thoughtcrime.securesms.util;
|
||||
import android.app.Activity;
|
||||
import android.app.ActivityManager;
|
||||
import android.app.AlarmManager;
|
||||
import android.app.KeyguardManager;
|
||||
import android.app.NotificationManager;
|
||||
import android.app.job.JobScheduler;
|
||||
import android.content.ClipboardManager;
|
||||
@@ -27,6 +28,8 @@ import androidx.annotation.Nullable;
|
||||
import androidx.annotation.RequiresApi;
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class ServiceUtil {
|
||||
public static InputMethodManager getInputMethodManager(Context context) {
|
||||
return (InputMethodManager)context.getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||
@@ -106,4 +109,8 @@ public class ServiceUtil {
|
||||
public static LocationManager getLocationManager(@NonNull Context context) {
|
||||
return ContextCompat.getSystemService(context, LocationManager.class);
|
||||
}
|
||||
|
||||
public static KeyguardManager getKeyguardManager(@NotNull Context context) {
|
||||
return ContextCompat.getSystemService(context, KeyguardManager.class);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@ import android.text.style.RelativeSizeSpan;
|
||||
import android.text.style.StyleSpan;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.annotation.ColorInt;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.StringRes;
|
||||
import androidx.core.content.ContextCompat;
|
||||
@@ -98,13 +99,35 @@ public final class SpanUtil {
|
||||
return imageSpan;
|
||||
}
|
||||
|
||||
public static CharSequence clickSubstring(@NonNull Context context, @NonNull CharSequence fullString, @NonNull CharSequence substring, @NonNull View.OnClickListener clickListener) {
|
||||
public static CharSequence learnMore(@NonNull Context context,
|
||||
@ColorInt int color,
|
||||
@NonNull View.OnClickListener onLearnMoreClicked)
|
||||
{
|
||||
String learnMore = context.getString(R.string.LearnMoreTextView_learn_more);
|
||||
return clickSubstring(learnMore, learnMore, onLearnMoreClicked, color);
|
||||
}
|
||||
|
||||
public static CharSequence clickSubstring(@NonNull Context context,
|
||||
@NonNull CharSequence fullString,
|
||||
@NonNull CharSequence substring,
|
||||
@NonNull View.OnClickListener clickListener) {
|
||||
return clickSubstring(fullString,
|
||||
substring,
|
||||
clickListener,
|
||||
ContextCompat.getColor(context, R.color.signal_accent_primary));
|
||||
}
|
||||
|
||||
public static CharSequence clickSubstring(@NonNull CharSequence fullString,
|
||||
@NonNull CharSequence substring,
|
||||
@NonNull View.OnClickListener clickListener,
|
||||
@ColorInt int linkColor)
|
||||
{
|
||||
ClickableSpan clickable = new ClickableSpan() {
|
||||
@Override
|
||||
public void updateDrawState(@NonNull TextPaint ds) {
|
||||
super.updateDrawState(ds);
|
||||
ds.setUnderlineText(false);
|
||||
ds.setColor(ContextCompat.getColor(context, R.color.signal_accent_primary));
|
||||
ds.setColor(linkColor);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -20,6 +20,7 @@ import org.thoughtcrime.securesms.backup.BackupProtos;
|
||||
import org.thoughtcrime.securesms.dependencies.ApplicationDependencies;
|
||||
import org.thoughtcrime.securesms.jobmanager.impl.SqlCipherMigrationConstraintObserver;
|
||||
import org.thoughtcrime.securesms.keyvalue.SettingsValues;
|
||||
import org.thoughtcrime.securesms.keyvalue.SignalStore;
|
||||
import org.thoughtcrime.securesms.lock.RegistrationLockReminders;
|
||||
import org.thoughtcrime.securesms.notifications.NotificationChannels;
|
||||
import org.thoughtcrime.securesms.preferences.widgets.NotificationPrivacyPreference;
|
||||
@@ -122,7 +123,7 @@ public class TextSecurePreferences {
|
||||
public static final String SYSTEM_EMOJI_PREF = "pref_system_emoji";
|
||||
private static final String MULTI_DEVICE_PROVISIONED_PREF = "pref_multi_device";
|
||||
public static final String DIRECT_CAPTURE_CAMERA_ID = "pref_direct_capture_camera_id";
|
||||
private static final String ALWAYS_RELAY_CALLS_PREF = "pref_turn_only";
|
||||
public static final String ALWAYS_RELAY_CALLS_PREF = "pref_turn_only";
|
||||
private static final String PROFILE_NAME_PREF = "pref_profile_name";
|
||||
private static final String PROFILE_AVATAR_ID_PREF = "pref_profile_avatar_id";
|
||||
public static final String READ_RECEIPTS_PREF = "pref_read_receipts";
|
||||
@@ -283,8 +284,8 @@ public class TextSecurePreferences {
|
||||
}
|
||||
|
||||
public static void onPostBackupRestore(@NonNull Context context) {
|
||||
if (NotificationChannels.supported() && PreferenceManager.getDefaultSharedPreferences(context).contains(VIBRATE_PREF)) {
|
||||
NotificationChannels.updateMessageVibrate(context, isNotificationVibrateEnabled(context));
|
||||
if (NotificationChannels.supported()) {
|
||||
NotificationChannels.updateMessageVibrate(context, SignalStore.settings().isMessageVibrateEnabled());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -376,10 +377,7 @@ public class TextSecurePreferences {
|
||||
return getStringPreference(context, ENCRYPTED_BACKUP_PASSPHRASE, null);
|
||||
}
|
||||
|
||||
public static void setBackupEnabled(@NonNull Context context, boolean value) {
|
||||
setBooleanPreference(context, BACKUP_ENABLED, value);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static boolean isBackupEnabled(@NonNull Context context) {
|
||||
return getBooleanPreference(context, BACKUP_ENABLED, false);
|
||||
}
|
||||
@@ -506,6 +504,9 @@ public class TextSecurePreferences {
|
||||
return Integer.valueOf(getStringPreference(context, NOTIFICATION_PRIORITY_PREF, String.valueOf(NotificationCompat.PRIORITY_HIGH)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link SettingsValues#getMessageFontSize()} via {@link org.thoughtcrime.securesms.keyvalue.SignalStore} instead.
|
||||
*/
|
||||
public static int getMessageBodyTextSize(Context context) {
|
||||
return Integer.valueOf(getStringPreference(context, MESSAGE_BODY_TEXT_SIZE_PREF, "16"));
|
||||
}
|
||||
@@ -555,14 +556,11 @@ public class TextSecurePreferences {
|
||||
return getIntegerPreference(context, SIGNED_PREKEY_FAILURE_COUNT_PREF, 0);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static NotificationPrivacyPreference getNotificationPrivacy(Context context) {
|
||||
return new NotificationPrivacyPreference(getStringPreference(context, NOTIFICATION_PRIVACY_PREF, "all"));
|
||||
}
|
||||
|
||||
public static void setNewContactsNotificationEnabled(Context context, boolean isEnabled) {
|
||||
setBooleanPreference(context, NEW_CONTACTS_NOTIFICATIONS, isEnabled);
|
||||
}
|
||||
|
||||
public static boolean isNewContactsNotificationEnabled(Context context) {
|
||||
return getBooleanPreference(context, NEW_CONTACTS_NOTIFICATIONS, true);
|
||||
}
|
||||
@@ -591,10 +589,12 @@ public class TextSecurePreferences {
|
||||
setBooleanPreference(context, WEBSOCKET_REGISTERED_PREF, registered);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static boolean isWifiSmsEnabled(Context context) {
|
||||
return getBooleanPreference(context, WIFI_SMS_PREF, false);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static int getRepeatAlertsCount(Context context) {
|
||||
try {
|
||||
return Integer.parseInt(getStringPreference(context, REPEAT_ALERTS_PREF, "0"));
|
||||
@@ -604,10 +604,6 @@ public class TextSecurePreferences {
|
||||
}
|
||||
}
|
||||
|
||||
public static void setRepeatAlertsCount(Context context, int count) {
|
||||
setStringPreference(context, REPEAT_ALERTS_PREF, String.valueOf(count));
|
||||
}
|
||||
|
||||
public static boolean isSignedPreKeyRegistered(Context context) {
|
||||
return getBooleanPreference(context, SIGNED_PREKEY_REGISTERED_PREF, false);
|
||||
}
|
||||
@@ -639,10 +635,6 @@ public class TextSecurePreferences {
|
||||
setLongPreference(context, GCM_REGISTRATION_ID_TIME_PREF, timestamp);
|
||||
}
|
||||
|
||||
public static boolean isSmsEnabled(Context context) {
|
||||
return Util.isDefaultSmsProvider(context);
|
||||
}
|
||||
|
||||
public static int getLocalRegistrationId(Context context) {
|
||||
return getIntegerPreference(context, LOCAL_REGISTRATION_ID_PREF, 0);
|
||||
}
|
||||
@@ -651,6 +643,7 @@ public class TextSecurePreferences {
|
||||
setIntegerPrefrence(context, LOCAL_REGISTRATION_ID_PREF, registrationId);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static boolean isInThreadNotifications(Context context) {
|
||||
return getBooleanPreference(context, IN_THREAD_NOTIFICATION_PREF, true);
|
||||
}
|
||||
@@ -751,6 +744,7 @@ public class TextSecurePreferences {
|
||||
return getBooleanPreference(context, ENTER_PRESENT_PREF, false);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static boolean isEnterSendsEnabled(Context context) {
|
||||
return getBooleanPreference(context, ENTER_SENDS_PREF, false);
|
||||
}
|
||||
@@ -901,6 +895,9 @@ public class TextSecurePreferences {
|
||||
setIntegerPrefrence(context, EXPERIENCE_DISMISSED_PREF, versionCode);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link SettingsValues#getTheme()} via {@link org.thoughtcrime.securesms.keyvalue.SignalStore} instead.
|
||||
*/
|
||||
public static String getTheme(Context context) {
|
||||
return getStringPreference(context, THEME_PREF, DynamicTheme.systemThemeAvailable() ? DynamicTheme.SYSTEM : DynamicTheme.LIGHT);
|
||||
}
|
||||
@@ -931,14 +928,21 @@ public class TextSecurePreferences {
|
||||
setIntegerPrefrence(context, PASSPHRASE_TIMEOUT_INTERVAL_PREF, interval);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link SettingsValues#getLanguage()} via {@link org.thoughtcrime.securesms.keyvalue.SignalStore} instead.
|
||||
*/
|
||||
public static String getLanguage(Context context) {
|
||||
return getStringPreference(context, LANGUAGE_PREF, "zz");
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link SettingsValues#setLanguage(String)} via {@link org.thoughtcrime.securesms.keyvalue.SignalStore} instead.
|
||||
*/
|
||||
public static void setLanguage(Context context, String language) {
|
||||
setStringPreference(context, LANGUAGE_PREF, language);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static boolean isSmsDeliveryReportsEnabled(Context context) {
|
||||
return getBooleanPreference(context, SMS_DELIVERY_REPORT_PREF, false);
|
||||
}
|
||||
@@ -975,18 +979,17 @@ public class TextSecurePreferences {
|
||||
return getBooleanPreference(context, ALL_SMS_PREF, true);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static boolean isNotificationsEnabled(Context context) {
|
||||
return getBooleanPreference(context, NOTIFICATION_PREF, true);
|
||||
}
|
||||
|
||||
public static void setCallNotificationsEnabled(Context context, boolean enabled) {
|
||||
setBooleanPreference(context, CALL_NOTIFICATIONS_PREF, enabled);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static boolean isCallNotificationsEnabled(Context context) {
|
||||
return getBooleanPreference(context, CALL_NOTIFICATIONS_PREF, true);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static @NonNull Uri getNotificationRingtone(Context context) {
|
||||
String result = getStringPreference(context, RINGTONE_PREF, Settings.System.DEFAULT_NOTIFICATION_URI.toString());
|
||||
|
||||
@@ -997,6 +1000,7 @@ public class TextSecurePreferences {
|
||||
return Uri.parse(result);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static @NonNull Uri getCallNotificationRingtone(Context context) {
|
||||
String result = getStringPreference(context, CALL_RINGTONE_PREF, Settings.System.DEFAULT_RINGTONE_URI.toString());
|
||||
|
||||
@@ -1007,44 +1011,28 @@ public class TextSecurePreferences {
|
||||
return Uri.parse(result);
|
||||
}
|
||||
|
||||
public static void removeNotificationRingtone(Context context) {
|
||||
removePreference(context, RINGTONE_PREF);
|
||||
}
|
||||
|
||||
public static void removeCallNotificationRingtone(Context context) {
|
||||
removePreference(context, CALL_RINGTONE_PREF);
|
||||
}
|
||||
|
||||
public static void setNotificationRingtone(Context context, String ringtone) {
|
||||
setStringPreference(context, RINGTONE_PREF, ringtone);
|
||||
}
|
||||
|
||||
public static void setCallNotificationRingtone(Context context, String ringtone) {
|
||||
setStringPreference(context, CALL_RINGTONE_PREF, ringtone);
|
||||
}
|
||||
|
||||
public static void setNotificationVibrateEnabled(Context context, boolean enabled) {
|
||||
setBooleanPreference(context, VIBRATE_PREF, enabled);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static boolean isNotificationVibrateEnabled(Context context) {
|
||||
return getBooleanPreference(context, VIBRATE_PREF, true);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static boolean isCallNotificationVibrateEnabled(Context context) {
|
||||
boolean defaultValue = true;
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||
if (Build.VERSION.SDK_INT >= 23) {
|
||||
defaultValue = (Settings.System.getInt(context.getContentResolver(), Settings.System.VIBRATE_WHEN_RINGING, 1) == 1);
|
||||
}
|
||||
|
||||
return getBooleanPreference(context, CALL_VIBRATE_PREF, defaultValue);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static String getNotificationLedColor(Context context) {
|
||||
return getStringPreference(context, LED_COLOR_PREF, "blue");
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static String getNotificationLedPattern(Context context) {
|
||||
return getStringPreference(context, LED_BLINK_PREF, "500,2000");
|
||||
}
|
||||
@@ -1057,6 +1045,7 @@ public class TextSecurePreferences {
|
||||
setStringPreference(context, LED_BLINK_PREF_CUSTOM, pattern);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static boolean isSystemEmojiPreferred(Context context) {
|
||||
return getBooleanPreference(context, SYSTEM_EMOJI_PREF, false);
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import android.content.res.Configuration;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import org.thoughtcrime.securesms.keyvalue.SignalStore;
|
||||
import org.thoughtcrime.securesms.util.TextSecurePreferences;
|
||||
|
||||
import java.util.Locale;
|
||||
@@ -22,8 +23,9 @@ public final class DynamicLanguageContextWrapper {
|
||||
base.setLocale(newLocale);
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecated")
|
||||
public static @NonNull Locale getUsersSelectedLocale(@NonNull Context context) {
|
||||
String language = TextSecurePreferences.getLanguage(context);
|
||||
String language = TextSecurePreferences.getLanguage(context);
|
||||
return LocaleParser.findBestMatchingLocaleForLanguage(language);
|
||||
}
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ import android.text.style.ClickableSpan;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.annotation.ColorInt;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.annotation.StringRes;
|
||||
@@ -26,6 +27,7 @@ public class LearnMoreTextView extends AppCompatTextView {
|
||||
private Spannable link;
|
||||
private boolean visible;
|
||||
private CharSequence baseText;
|
||||
private int linkColor;
|
||||
|
||||
public LearnMoreTextView(Context context) {
|
||||
super(context);
|
||||
@@ -40,6 +42,7 @@ public class LearnMoreTextView extends AppCompatTextView {
|
||||
private void init() {
|
||||
setMovementMethod(LinkMovementMethod.getInstance());
|
||||
setLinkTextInternal(R.string.LearnMoreTextView_learn_more);
|
||||
setLinkColor(ThemeUtil.getThemedColor(getContext(), R.attr.colorAccent));
|
||||
visible = true;
|
||||
}
|
||||
|
||||
@@ -73,13 +76,17 @@ public class LearnMoreTextView extends AppCompatTextView {
|
||||
setOnLinkClickListener(new OpenUrlOnClickListener(url));
|
||||
}
|
||||
|
||||
public void setLinkColor(@ColorInt int linkColor) {
|
||||
this.linkColor = linkColor;
|
||||
}
|
||||
|
||||
private void setLinkTextInternal(@StringRes int linkText) {
|
||||
ClickableSpan clickable = new ClickableSpan() {
|
||||
@Override
|
||||
public void updateDrawState(@NonNull TextPaint ds) {
|
||||
super.updateDrawState(ds);
|
||||
ds.setUnderlineText(false);
|
||||
ds.setColor(ThemeUtil.getThemedColor(getContext(), R.attr.colorAccent));
|
||||
ds.setColor(linkColor);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user