-
-
Notifications
You must be signed in to change notification settings - Fork 6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0950235
commit 9d3764c
Showing
32 changed files
with
488 additions
and
283 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
app/src/main/java/org/thoughtcrime/securesms/keyvalue/EmojiValues.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package org.thoughtcrime.securesms.keyvalue; | ||
|
||
import androidx.annotation.NonNull; | ||
|
||
import org.thoughtcrime.securesms.components.emoji.EmojiUtil; | ||
|
||
public class EmojiValues extends SignalStoreValues { | ||
|
||
private static final String PREFIX = "emojiPref__"; | ||
|
||
EmojiValues(@NonNull KeyValueStore store) { | ||
super(store); | ||
} | ||
|
||
@Override | ||
void onFirstEverAppLaunch() { | ||
|
||
} | ||
|
||
public void setPreferredVariation(@NonNull String emoji) { | ||
String canonical = EmojiUtil.getCanonicalRepresentation(emoji); | ||
|
||
if (canonical.equals(emoji)) { | ||
getStore().beginWrite().remove(PREFIX + canonical).apply(); | ||
} else { | ||
putString(PREFIX + canonical, emoji); | ||
} | ||
} | ||
|
||
public @NonNull String getPreferredVariation(@NonNull String emoji) { | ||
String canonical = EmojiUtil.getCanonicalRepresentation(emoji); | ||
|
||
return getString(PREFIX + canonical, emoji); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
app/src/main/java/org/thoughtcrime/securesms/reactions/ReactionDetails.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package org.thoughtcrime.securesms.reactions; | ||
|
||
import androidx.annotation.NonNull; | ||
|
||
import org.thoughtcrime.securesms.recipients.Recipient; | ||
|
||
class ReactionDetails { | ||
private final Recipient sender; | ||
private final String baseEmoji; | ||
private final String displayEmoji; | ||
private final long timestamp; | ||
|
||
ReactionDetails(@NonNull Recipient sender, @NonNull String baseEmoji, @NonNull String displayEmoji, long timestamp) { | ||
this.sender = sender; | ||
this.baseEmoji = baseEmoji; | ||
this.displayEmoji = displayEmoji; | ||
this.timestamp = timestamp; | ||
} | ||
|
||
public @NonNull Recipient getSender() { | ||
return sender; | ||
} | ||
|
||
public @NonNull String getBaseEmoji() { | ||
return baseEmoji; | ||
} | ||
|
||
public @NonNull String getDisplayEmoji() { | ||
return displayEmoji; | ||
} | ||
|
||
public long getTimestamp() { | ||
return timestamp; | ||
} | ||
} |
Oops, something went wrong.