-
- All Implemented Interfaces:
-
de.c1710.filemojicompat_ui.interfaces.EmojiPreferenceInterface
public class DelayedEmojiPreference implements EmojiPreferenceInterface
A "proxy" for EmojiPreference that does not immediately store changed preferences, but only when commitSelection is called.
-
-
Field Summary
Fields Modifier and Type Field Description private Stringselectedpublic final static DelayedEmojiPreferenceINSTANCE
-
Method Summary
Modifier and Type Method Description StringgetSelected(Context context)Returns the id/hash of the currently selected emoji pack, or a default value if there is none UnitsetSelected(Context context, String value)Stores the id/hash of the currently/newly selected emoji pack StringgetDefault(Context context)Returns the name of the default pack for this application. UnitsetDefault(Context context, String value)Sets the id/hash of the default emoji pack for this application. StringgetNameForCustom(Context context, String hash)The preference name/key for the custom names preference UnitsetNameForCustom(Context context, String name, String hash)Returns the name assigned for a certain custom/imported emoji pack. final UnitcommitSelection(Context context)Actually stores the preference (independently of whether it is different to the previous one or not) final UnitdismissSelection(Context context, EmojiPackList list)final StringgetSelected()final UnitsetSelected(String selected)-
-
Method Detail
-
getSelected
String getSelected(Context context)
Returns the id/hash of the currently selected emoji pack, or a default value if there is none
-
setSelected
Unit setSelected(Context context, String value)
Stores the id/hash of the currently/newly selected emoji pack
-
getDefault
String getDefault(Context context)
Returns the name of the default pack for this application. Note: Usually, this should be SYSTEM_DEFAULT, but it may be overridden, if the application e.g. comes with an Asset-based default pack.
-
setDefault
Unit setDefault(Context context, String value)
Sets the id/hash of the default emoji pack for this application. Note: You should <i>never</i> use a de.c1710.filemojicompat_ui.packs.FileBasedEmojiPack here, because it may be deleted by the user. If you want to update their choice, use setSelected instead. Usually you would use a de.c1710.filemojicompat_ui.packs.AssetEmojiPack here.
-
getNameForCustom
String getNameForCustom(Context context, String hash)
The preference name/key for the custom names preference
-
setNameForCustom
Unit setNameForCustom(Context context, String name, String hash)
Returns the name assigned for a certain custom/imported emoji pack. Note: You should only use this for display, internally, you should use the de.c1710.filemojicompat_ui.structures.EmojiPack.id/hash of the pack.
- Parameters:
hash- The file hash of the pack
-
commitSelection
final Unit commitSelection(Context context)
Actually stores the preference (independently of whether it is different to the previous one or not)
-
dismissSelection
final Unit dismissSelection(Context context, EmojiPackList list)
-
getSelected
final String getSelected()
-
setSelected
final Unit setSelected(String selected)
-
-
-
-