mirror of
https://github.com/oxen-io/session-android.git
synced 2025-08-11 17:57:47 +00:00
New app theming (#913)
* feat: start new app theming feature * feat: add some theming colours * refactor: start refactoring themes and colours to use dynamic attributes * feat: adding more colours and switching over default colours to be theme based instead of hard-coded or day/night specific * refactor: take a look at ocean light and logo colour * feat: global search colours for light and dark ocean * feat: more styling * feat: adding themes to conversation activity and refactoring the base theme to apply over the top of the activity's theme so it retains noActionBar etc * feat: add dynamic accent color * docs: add todo for changing how accent colour is applied * feat: update new theming to use override primary style so that the regular colorAccent attribute can be used in existing layouts * feat: coordinating styles across layouts, fixing up pinned icons and naming for conversation list items * refactor: re-styling layouts to match new themes and attributes. Need to figure out action mode close button * refactor: remove @color/text and replace with ?android:textColorPrimary to override in themes * refactor: add context theme wrapper to bottom sheet dialog that references accent color * fix: input bar bug fix and preference activity themes * refactor: new settings menu options * fix: crash for PNModeActivity.kt refactor: move ordering in seed dialog to match designs, copy changes to match new settings menu * feat: add new appearance settings activity * refactor: title and VM changes * fix: correct override * feat: add theme appearance screen UI features and start VM implementation. re-add legacy theme utils to get default for migration * fix: compile errors and missing themes from emoji features * refactor: remove background shape alteration and old bottom sheet styles, re-add the theme mode attr * feat: appearance screen wired up, just need to refresh theme * feat: add theme state recreation and fix match system settings option * refactor: add bottom margin * feat: explore custom preference category * feat: add the customized session theme for CorrectedPreferenceFragment * feat: replace AppProtectionPreferenceFragment to extend ListSummaryPreferenceFragment * refactor: change drawable style and remove explicit dividers * refactor: remove divider in CorrectedPreferenceFragment * feat: add theme state check on resume, might be jarring currently * feat: add preference divider elements for settings menu * refactor: settings menu redesigns * refactor: change led preference to integer and refactor TextSecurePreferences.kt * feat: add scroll parcel to save/restore hierarchy on restart with appearance changes * feat: add the conversations blocked contacts and refactor preference order and copy * feat: add blocked contacts activity, basic layout and vm * feat: add unblock DB functions and storage protocol, start working on the DB query state flow, might have to just implement recipient on modified listener * feat: add blocked contacts and notif recipient listeners * feat: add recipient db reader * feat: add blocked contact interactions and fix a theming crash for notifications * feat: introduce better equals and hashcode implementations to recipient, replace home diff util content check with hashcode-based comparison * feat: add settings menu vectors * fix: preview compile error * refactor: migrating settings menu to new designs * feat: help menu * refactor: simplify link opening * refactor: remove space * feat: refactor preferences and start theming for light mode options * refactor: fixing dark and light modes with dialogs * refactor: popup dialogs use proper themes now * refactor: alert dialogs and media edit fragments use attribute references * refactor: use input bar button attribute instead color control normal in vector tint * refactor: transparency, dialog fixes, notification fix * refactor: attrs and styles for buttons * fix: use prominent button color on the outline button's border * fix: fix the trash * refactor: remove the appearance * refactor: avatar placeholder generation, chips and element border styles * refactor: use colors instead of style references * refactor: theming changes to match designs and feedback * refactor: the titles are bold and the categories are tertiary coloured now * fix: appearance settings match preferences, search bottom bar uses themed attributes * refactor: increase setting button height * Update clear all data dialog * Update seed dialog * refactor: more qa feedback changes * feat: add new TLs and fa-rIR TLs * Update notification content dialog * Fix message requests clear all button text color * feat: re-add screenshot observer * refactor: make send tint accent color * feat: add unread background differences * fix: change unread count indicator * build: upgrade build numbers * Fix message requests popupmenu background color * fix: crash from attr reference in color attribute * build: upgrade build number * fix: message bubbles, thumbnail backgrounds, search bar visibility with input bar, attachment buttons * fix: tertiary text for keyboard page search view * fix: emoji overflow colour differences * fix: reaction pill dialog background is now correct colour * Add style to reactions tab layout * fix: appearance activity reverting primary color at correct time * fix: show call privacy warning every time instead of just once * fix: gradient background(?) and audio autoplay disable * fix: crash in all media containing documents * fix: reaction dialog heading fixes * Add style to reactions tab layout * fix: remove gradient backgrounds * fix: adding new reaction normal text attribute to try correct the tab layout * fix: ocean dark unread/read colours * build; update build number * build: update build number Co-authored-by: charles <charles@oxen.io>
This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
package org.session.libsession.avatars
|
||||
|
||||
import android.content.Context
|
||||
import com.bumptech.glide.load.Key
|
||||
import java.security.MessageDigest
|
||||
|
||||
class PlaceholderAvatarPhoto(val hashString: String,
|
||||
class PlaceholderAvatarPhoto(val context: Context,
|
||||
val hashString: String,
|
||||
val displayName: String): Key {
|
||||
|
||||
override fun updateDiskCacheKey(messageDigest: MessageDigest) {
|
||||
|
@@ -196,4 +196,6 @@ interface StorageProtocol {
|
||||
fun removeReaction(emoji: String, messageTimestamp: Long, author: String, notifyUnread: Boolean)
|
||||
fun updateReactionIfNeeded(message: Message, sender: String, openGroupSentTimestamp: Long)
|
||||
fun deleteReactions(messageId: Long, mms: Boolean)
|
||||
fun unblock(toUnblock: List<Recipient>)
|
||||
fun blockedContacts(): List<Recipient>
|
||||
}
|
||||
|
@@ -56,7 +56,7 @@ class JobQueue : JobDelegate {
|
||||
handleJobFailedPermanently(job, NullPointerException("Open Group ID was null"))
|
||||
} else {
|
||||
val groupChannel = if (!openGroupChannels.containsKey(openGroupId)) {
|
||||
Log.d("OpenGroupDispatcher", "Creating $openGroupId channel")
|
||||
Log.d("OpenGroupDispatcher", "Creating ${openGroupId.hashCode()} channel")
|
||||
val newGroupChannel = Channel<Job>(UNLIMITED)
|
||||
launch(dispatcher) {
|
||||
for (groupJob in newGroupChannel) {
|
||||
|
@@ -5,6 +5,7 @@ import android.hardware.Camera
|
||||
import android.net.Uri
|
||||
import android.provider.Settings
|
||||
import androidx.annotation.ArrayRes
|
||||
import androidx.annotation.StyleRes
|
||||
import androidx.core.app.NotificationCompat
|
||||
import androidx.preference.PreferenceManager.getDefaultSharedPreferences
|
||||
import dagger.hilt.android.qualifiers.ApplicationContext
|
||||
@@ -13,8 +14,16 @@ import kotlinx.coroutines.flow.MutableSharedFlow
|
||||
import kotlinx.coroutines.flow.asSharedFlow
|
||||
import org.session.libsession.BuildConfig
|
||||
import org.session.libsession.R
|
||||
import org.session.libsession.utilities.TextSecurePreferences.Companion.AUTOPLAY_AUDIO_MESSAGES
|
||||
import org.session.libsession.utilities.TextSecurePreferences.Companion.CALL_NOTIFICATIONS_ENABLED
|
||||
import org.session.libsession.utilities.TextSecurePreferences.Companion.CLASSIC_DARK
|
||||
import org.session.libsession.utilities.TextSecurePreferences.Companion.CLASSIC_LIGHT
|
||||
import org.session.libsession.utilities.TextSecurePreferences.Companion.FOLLOW_SYSTEM_SETTINGS
|
||||
import org.session.libsession.utilities.TextSecurePreferences.Companion.LAST_VACUUM_TIME
|
||||
import org.session.libsession.utilities.TextSecurePreferences.Companion.LEGACY_PREF_KEY_SELECTED_UI_MODE
|
||||
import org.session.libsession.utilities.TextSecurePreferences.Companion.OCEAN_DARK
|
||||
import org.session.libsession.utilities.TextSecurePreferences.Companion.OCEAN_LIGHT
|
||||
import org.session.libsession.utilities.TextSecurePreferences.Companion.SELECTED_STYLE
|
||||
import org.session.libsession.utilities.TextSecurePreferences.Companion.SHOWN_CALL_NOTIFICATION
|
||||
import org.session.libsession.utilities.TextSecurePreferences.Companion.SHOWN_CALL_WARNING
|
||||
import org.session.libsignal.utilities.Log
|
||||
@@ -113,9 +122,7 @@ interface TextSecurePreferences {
|
||||
fun setNotificationRingtone(ringtone: String?)
|
||||
fun setNotificationVibrateEnabled(enabled: Boolean)
|
||||
fun isNotificationVibrateEnabled(): Boolean
|
||||
fun getNotificationLedColor(): String?
|
||||
fun getNotificationLedPattern(): String?
|
||||
fun getNotificationLedPatternCustom(): String?
|
||||
fun getNotificationLedColor(): Int
|
||||
fun isThreadLengthTrimmingEnabled(): Boolean
|
||||
fun isSystemEmojiPreferred(): Boolean
|
||||
fun getMobileMediaDownloadAllowed(): Set<String>?
|
||||
@@ -164,6 +171,14 @@ interface TextSecurePreferences {
|
||||
fun setLastVacuumNow()
|
||||
fun getFingerprintKeyGenerated(): Boolean
|
||||
fun setFingerprintKeyGenerated()
|
||||
@StyleRes fun getAccentColorStyle(): Int?
|
||||
fun setAccentColorStyle(@StyleRes newColorStyle: Int?)
|
||||
fun getThemeStyle(): String
|
||||
fun getFollowSystemSettings(): Boolean
|
||||
fun setThemeStyle(themeStyle: String)
|
||||
fun setFollowSystemSettings(followSystemSettings: Boolean)
|
||||
fun autoplayAudioMessages(): Boolean
|
||||
fun hasPreference(key: String): Boolean
|
||||
fun clearAll()
|
||||
|
||||
companion object {
|
||||
@@ -180,6 +195,7 @@ interface TextSecurePreferences {
|
||||
const val VIBRATE_PREF = "pref_key_vibrate"
|
||||
const val NOTIFICATION_PREF = "pref_key_enable_notifications"
|
||||
const val LED_COLOR_PREF = "pref_led_color"
|
||||
const val LED_COLOR_PREF_PRIMARY = "pref_led_color_primary"
|
||||
const val LED_BLINK_PREF = "pref_led_blink"
|
||||
const val LED_BLINK_PREF_CUSTOM = "pref_led_blink_custom"
|
||||
const val PASSPHRASE_TIMEOUT_INTERVAL_PREF = "pref_timeout_interval"
|
||||
@@ -194,6 +210,7 @@ interface TextSecurePreferences {
|
||||
const val UPDATE_APK_DOWNLOAD_ID = "pref_update_apk_download_id"
|
||||
const val UPDATE_APK_DIGEST = "pref_update_apk_digest"
|
||||
const val IN_THREAD_NOTIFICATION_PREF = "pref_key_inthread_notifications"
|
||||
const val IN_APP_NOTIFICATION_SOUNDS = "pref_sound_when_app_open"
|
||||
const val MESSAGE_BODY_TEXT_SIZE_PREF = "pref_message_body_text_size"
|
||||
const val LOCAL_REGISTRATION_ID_PREF = "pref_local_registration_id"
|
||||
const val REPEAT_ALERTS_PREF = "pref_repeat_alerts"
|
||||
@@ -242,9 +259,27 @@ interface TextSecurePreferences {
|
||||
const val HAS_HIDDEN_MESSAGE_REQUESTS = "pref_message_requests_hidden"
|
||||
const val CALL_NOTIFICATIONS_ENABLED = "pref_call_notifications_enabled"
|
||||
const val SHOWN_CALL_WARNING = "pref_shown_call_warning" // call warning is user-facing warning of enabling calls
|
||||
const val SHOWN_CALL_NOTIFICATION = "pref_shown_call_notification" // call notification is a promp to check privacy settings
|
||||
const val SHOWN_CALL_NOTIFICATION = "pref_shown_call_notification" // call notification is a prompt to check privacy settings
|
||||
const val LAST_VACUUM_TIME = "pref_last_vacuum_time"
|
||||
const val AUTOPLAY_AUDIO_MESSAGES = "pref_autoplay_audio"
|
||||
const val FINGERPRINT_KEY_GENERATED = "fingerprint_key_generated"
|
||||
const val SELECTED_ACCENT_COLOR = "selected_accent_color"
|
||||
const val GREEN_ACCENT = "accent_green"
|
||||
const val BLUE_ACCENT = "accent_blue"
|
||||
const val PURPLE_ACCENT = "accent_purple"
|
||||
const val PINK_ACCENT = "accent_pink"
|
||||
const val RED_ACCENT = "accent_red"
|
||||
const val ORANGE_ACCENT = "accent_orange"
|
||||
const val YELLOW_ACCENT = "accent_yellow"
|
||||
|
||||
const val SELECTED_STYLE = "pref_selected_style" // classic_dark/light, ocean_dark/light
|
||||
const val FOLLOW_SYSTEM_SETTINGS = "pref_follow_system" // follow system day/night
|
||||
|
||||
const val LEGACY_PREF_KEY_SELECTED_UI_MODE = "SELECTED_UI_MODE" // this will be cleared upon launching app, for users migrating to theming build
|
||||
const val CLASSIC_DARK = "classic.dark"
|
||||
const val CLASSIC_LIGHT = "classic.light"
|
||||
const val OCEAN_DARK = "ocean.dark"
|
||||
const val OCEAN_LIGHT = "ocean.light"
|
||||
|
||||
@JvmStatic
|
||||
fun getLastConfigurationSyncTime(context: Context): Long {
|
||||
@@ -687,18 +722,8 @@ interface TextSecurePreferences {
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun getNotificationLedColor(context: Context): String? {
|
||||
return getStringPreference(context, LED_COLOR_PREF, "blue")
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun getNotificationLedPattern(context: Context): String? {
|
||||
return getStringPreference(context, LED_BLINK_PREF, "500,2000")
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun getNotificationLedPatternCustom(context: Context): String? {
|
||||
return getStringPreference(context, LED_BLINK_PREF_CUSTOM, "500,2000")
|
||||
fun getNotificationLedColor(context: Context): Int {
|
||||
return getIntegerPreference(context, LED_COLOR_PREF_PRIMARY, ThemeUtil.getThemedColor(context, R.attr.colorAccent))
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
@@ -929,6 +954,34 @@ interface TextSecurePreferences {
|
||||
setBooleanPreference(context, FINGERPRINT_KEY_GENERATED, true)
|
||||
}
|
||||
|
||||
@JvmStatic @StyleRes
|
||||
fun getAccentColorStyle(context: Context): Int? {
|
||||
return when (getStringPreference(context, SELECTED_ACCENT_COLOR, ORANGE_ACCENT)) {
|
||||
GREEN_ACCENT -> R.style.PrimaryGreen
|
||||
BLUE_ACCENT -> R.style.PrimaryBlue
|
||||
PURPLE_ACCENT -> R.style.PrimaryPurple
|
||||
PINK_ACCENT -> R.style.PrimaryPink
|
||||
RED_ACCENT -> R.style.PrimaryRed
|
||||
ORANGE_ACCENT -> R.style.PrimaryOrange
|
||||
YELLOW_ACCENT -> R.style.PrimaryYellow
|
||||
else -> null
|
||||
}
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun setAccentColorStyle(context: Context, @StyleRes newColor: Int?) {
|
||||
setStringPreference(context, SELECTED_ACCENT_COLOR, when (newColor) {
|
||||
R.style.PrimaryGreen -> GREEN_ACCENT
|
||||
R.style.PrimaryBlue -> BLUE_ACCENT
|
||||
R.style.PrimaryPurple -> PURPLE_ACCENT
|
||||
R.style.PrimaryPink -> PINK_ACCENT
|
||||
R.style.PrimaryRed -> RED_ACCENT
|
||||
R.style.PrimaryOrange -> ORANGE_ACCENT
|
||||
R.style.PrimaryYellow -> YELLOW_ACCENT
|
||||
else -> null
|
||||
})
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun clearAll(context: Context) {
|
||||
getDefaultSharedPreferences(context).edit().clear().commit()
|
||||
@@ -1309,16 +1362,8 @@ class AppTextSecurePreferences @Inject constructor(
|
||||
return getBooleanPreference(TextSecurePreferences.VIBRATE_PREF, true)
|
||||
}
|
||||
|
||||
override fun getNotificationLedColor(): String? {
|
||||
return getStringPreference(TextSecurePreferences.LED_COLOR_PREF, "blue")
|
||||
}
|
||||
|
||||
override fun getNotificationLedPattern(): String? {
|
||||
return getStringPreference(TextSecurePreferences.LED_BLINK_PREF, "500,2000")
|
||||
}
|
||||
|
||||
override fun getNotificationLedPatternCustom(): String? {
|
||||
return getStringPreference(TextSecurePreferences.LED_BLINK_PREF_CUSTOM, "500,2000")
|
||||
override fun getNotificationLedColor(): Int {
|
||||
return getIntegerPreference(TextSecurePreferences.LED_COLOR_PREF_PRIMARY, context.getColor(R.color.accent_green))
|
||||
}
|
||||
|
||||
override fun isThreadLengthTrimmingEnabled(): Boolean {
|
||||
@@ -1413,6 +1458,10 @@ class AppTextSecurePreferences @Inject constructor(
|
||||
getDefaultSharedPreferences(context).edit().putLong(key, value).apply()
|
||||
}
|
||||
|
||||
override fun hasPreference(key: String): Boolean {
|
||||
return getDefaultSharedPreferences(context).contains(key)
|
||||
}
|
||||
|
||||
override fun removePreference(key: String) {
|
||||
getDefaultSharedPreferences(context).edit().remove(key).apply()
|
||||
}
|
||||
@@ -1533,6 +1582,92 @@ class AppTextSecurePreferences @Inject constructor(
|
||||
setBooleanPreference(TextSecurePreferences.FINGERPRINT_KEY_GENERATED, true)
|
||||
}
|
||||
|
||||
@StyleRes
|
||||
override fun getAccentColorStyle(): Int? {
|
||||
val prefColor = getStringPreference(
|
||||
TextSecurePreferences.SELECTED_ACCENT_COLOR,
|
||||
null
|
||||
)
|
||||
return when (prefColor) {
|
||||
TextSecurePreferences.GREEN_ACCENT -> R.style.PrimaryGreen
|
||||
TextSecurePreferences.BLUE_ACCENT -> R.style.PrimaryBlue
|
||||
TextSecurePreferences.PURPLE_ACCENT -> R.style.PrimaryPurple
|
||||
TextSecurePreferences.PINK_ACCENT -> R.style.PrimaryPink
|
||||
TextSecurePreferences.RED_ACCENT -> R.style.PrimaryRed
|
||||
TextSecurePreferences.ORANGE_ACCENT -> R.style.PrimaryOrange
|
||||
TextSecurePreferences.YELLOW_ACCENT -> R.style.PrimaryYellow
|
||||
else -> null
|
||||
}
|
||||
}
|
||||
|
||||
override fun setAccentColorStyle(@StyleRes newColorStyle: Int?) {
|
||||
setStringPreference(
|
||||
TextSecurePreferences.SELECTED_ACCENT_COLOR, when (newColorStyle) {
|
||||
R.style.PrimaryGreen -> TextSecurePreferences.GREEN_ACCENT
|
||||
R.style.PrimaryBlue -> TextSecurePreferences.BLUE_ACCENT
|
||||
R.style.PrimaryPurple -> TextSecurePreferences.PURPLE_ACCENT
|
||||
R.style.PrimaryPink -> TextSecurePreferences.PINK_ACCENT
|
||||
R.style.PrimaryRed -> TextSecurePreferences.RED_ACCENT
|
||||
R.style.PrimaryOrange -> TextSecurePreferences.ORANGE_ACCENT
|
||||
R.style.PrimaryYellow -> TextSecurePreferences.YELLOW_ACCENT
|
||||
else -> null
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
override fun getThemeStyle(): String {
|
||||
val hasLegacy = getStringPreference(LEGACY_PREF_KEY_SELECTED_UI_MODE, null)
|
||||
if (!hasLegacy.isNullOrEmpty()) {
|
||||
migrateLegacyUiPref()
|
||||
}
|
||||
|
||||
return getStringPreference(SELECTED_STYLE, CLASSIC_DARK)!!
|
||||
}
|
||||
|
||||
override fun setThemeStyle(themeStyle: String) {
|
||||
val safeTheme = if (themeStyle !in listOf(CLASSIC_DARK, CLASSIC_LIGHT, OCEAN_DARK, OCEAN_LIGHT)) CLASSIC_DARK else themeStyle
|
||||
setStringPreference(SELECTED_STYLE, safeTheme)
|
||||
}
|
||||
|
||||
override fun getFollowSystemSettings(): Boolean {
|
||||
val hasLegacy = getStringPreference(LEGACY_PREF_KEY_SELECTED_UI_MODE, null)
|
||||
if (!hasLegacy.isNullOrEmpty()) {
|
||||
migrateLegacyUiPref()
|
||||
}
|
||||
|
||||
return getBooleanPreference(FOLLOW_SYSTEM_SETTINGS, false)
|
||||
}
|
||||
|
||||
private fun migrateLegacyUiPref() {
|
||||
val legacy = getStringPreference(LEGACY_PREF_KEY_SELECTED_UI_MODE, null) ?: return
|
||||
val (mode, followSystem) = when (legacy) {
|
||||
"DAY" -> {
|
||||
CLASSIC_LIGHT to false
|
||||
}
|
||||
"NIGHT" -> {
|
||||
CLASSIC_DARK to false
|
||||
}
|
||||
"SYSTEM_DEFAULT" -> {
|
||||
CLASSIC_DARK to true
|
||||
}
|
||||
else -> {
|
||||
CLASSIC_DARK to false
|
||||
}
|
||||
}
|
||||
if (!hasPreference(FOLLOW_SYSTEM_SETTINGS) && !hasPreference(SELECTED_STYLE)) {
|
||||
setThemeStyle(mode)
|
||||
setFollowSystemSettings(followSystem)
|
||||
}
|
||||
removePreference(LEGACY_PREF_KEY_SELECTED_UI_MODE)
|
||||
}
|
||||
|
||||
override fun setFollowSystemSettings(followSystemSettings: Boolean) {
|
||||
setBooleanPreference(FOLLOW_SYSTEM_SETTINGS, followSystemSettings)
|
||||
}
|
||||
|
||||
override fun autoplayAudioMessages(): Boolean {
|
||||
return getBooleanPreference(AUTOPLAY_AUDIO_MESSAGES, false)
|
||||
}
|
||||
|
||||
override fun clearAll() {
|
||||
getDefaultSharedPreferences(context).edit().clear().commit()
|
||||
|
@@ -0,0 +1,16 @@
|
||||
package org.session.libsession.utilities
|
||||
|
||||
import android.content.Context
|
||||
import android.util.TypedValue
|
||||
import androidx.annotation.AttrRes
|
||||
import androidx.annotation.ColorInt
|
||||
|
||||
@ColorInt
|
||||
fun Context.getColorFromAttr(
|
||||
@AttrRes attrColor: Int,
|
||||
typedValue: TypedValue = TypedValue(),
|
||||
resolveRefs: Boolean = true
|
||||
): Int {
|
||||
theme.resolveAttribute(attrColor, typedValue, resolveRefs)
|
||||
return typedValue.data
|
||||
}
|
@@ -50,10 +50,12 @@ import org.session.libsession.utilities.recipients.RecipientProvider.RecipientDe
|
||||
import org.session.libsignal.utilities.Log;
|
||||
import org.session.libsignal.utilities.guava.Optional;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
import java.util.WeakHashMap;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
@@ -732,20 +734,19 @@ public class Recipient implements RecipientModifiedListener {
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || !(o instanceof Recipient)) return false;
|
||||
|
||||
Recipient that = (Recipient) o;
|
||||
|
||||
return this.address.equals(that.address);
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
Recipient recipient = (Recipient) o;
|
||||
return resolving == recipient.resolving && mutedUntil == recipient.mutedUntil && notifyType == recipient.notifyType && blocked == recipient.blocked && approved == recipient.approved && approvedMe == recipient.approvedMe && expireMessages == recipient.expireMessages && address.equals(recipient.address) && Objects.equals(name, recipient.name) && Objects.equals(customLabel, recipient.customLabel) && Objects.equals(groupAvatarId, recipient.groupAvatarId) && Arrays.equals(profileKey, recipient.profileKey) && Objects.equals(profileName, recipient.profileName) && Objects.equals(profileAvatar, recipient.profileAvatar);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return this.address.hashCode();
|
||||
int result = Objects.hash(address, name, customLabel, resolving, groupAvatarId, mutedUntil, notifyType, blocked, approved, approvedMe, expireMessages, profileName, profileAvatar);
|
||||
result = 31 * result + Arrays.hashCode(profileKey);
|
||||
return result;
|
||||
}
|
||||
|
||||
public void notifyListeners() {
|
||||
|
@@ -1,8 +1,5 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<resources>
|
||||
<color name="accent">#00F782</color>
|
||||
<color name="accent_alpha50">#8000F782</color>
|
||||
<color name="text">#FFFFFF</color>
|
||||
<color name="destructive">#FF453A</color>
|
||||
<color name="unimportant">#D8D8D8</color>
|
||||
<color name="profile_picture_background">#353535</color>
|
||||
@@ -18,10 +15,6 @@
|
||||
<color name="compose_view_background">#1B1B1B</color>
|
||||
<color name="compose_text_view_background">#141414</color>
|
||||
<color name="quote_not_found_background">#80FFFFFF</color>
|
||||
<color name="new_conversation_button_collapsed_background">#1F1F1F</color>
|
||||
<color name="new_conversation_button_shadow">#077C44</color>
|
||||
<color name="pn_option_background">#1B1B1B</color>
|
||||
<color name="pn_option_border">#212121</color>
|
||||
<color name="paths_building">#FFCE3A</color>
|
||||
|
||||
<array name="profile_picture_placeholder_colors">
|
||||
@@ -33,8 +26,8 @@
|
||||
|
||||
<color name="loki_darkest_gray">#0a0a0a</color>
|
||||
|
||||
<color name="signal_primary">@color/accent</color>
|
||||
<color name="signal_primary_dark">@color/accent</color>
|
||||
<color name="signal_primary">@color/accent_green</color>
|
||||
<color name="signal_primary_dark">@color/accent_green</color>
|
||||
|
||||
<color name="textsecure_primary">@color/signal_primary</color>
|
||||
<color name="textsecure_primary_dark">@color/signal_primary_dark</color>
|
||||
@@ -75,4 +68,13 @@
|
||||
|
||||
<color name="default_background_start">#121212</color>
|
||||
<color name="default_background_end">#171717</color>
|
||||
|
||||
<color name="accent_green">#ff31F196</color>
|
||||
<color name="accent_blue">#ff57C9FA</color>
|
||||
<color name="accent_purple">#ffC993FF</color>
|
||||
<color name="accent_pink">#ffFF95EF</color>
|
||||
<color name="accent_red">#ffFF9C8E</color>
|
||||
<color name="accent_orange">#ffFCB159</color>
|
||||
<color name="accent_yellow">#ffFAD657</color>
|
||||
|
||||
</resources>
|
||||
|
24
libsession/src/main/res/values/themes.xml
Normal file
24
libsession/src/main/res/values/themes.xml
Normal file
@@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<style name="PrimaryGreen">
|
||||
<item name="colorAccent">@color/accent_green</item>
|
||||
</style>
|
||||
<style name="PrimaryBlue">
|
||||
<item name="colorAccent">@color/accent_blue</item>
|
||||
</style>
|
||||
<style name="PrimaryPurple">
|
||||
<item name="colorAccent">@color/accent_purple</item>
|
||||
</style>
|
||||
<style name="PrimaryPink">
|
||||
<item name="colorAccent">@color/accent_pink</item>
|
||||
</style>
|
||||
<style name="PrimaryRed">
|
||||
<item name="colorAccent">@color/accent_red</item>
|
||||
</style>
|
||||
<style name="PrimaryOrange">
|
||||
<item name="colorAccent">@color/accent_orange</item>
|
||||
</style>
|
||||
<style name="PrimaryYellow">
|
||||
<item name="colorAccent">@color/accent_yellow</item>
|
||||
</style>
|
||||
</resources>
|
Reference in New Issue
Block a user