Add group calling tooltip and megaphone.

This commit is contained in:
Alex Hart
2020-12-14 18:26:07 -04:00
committed by Greyson Parrelli
parent 7227b43bbe
commit fa7346f79b
12 changed files with 81 additions and 9 deletions

View File

@@ -4,12 +4,12 @@ import androidx.annotation.NonNull;
public final class MiscellaneousValues extends SignalStoreValues {
private static final String LAST_PREKEY_REFRESH_TIME = "last_prekey_refresh_time";
private static final String MESSAGE_REQUEST_ENABLE_TIME = "message_request_enable_time";
private static final String LAST_PROFILE_REFRESH_TIME = "misc.last_profile_refresh_time";
private static final String LAST_GV1_ROUTINE_MIGRATION_TIME = "misc.last_gv1_routine_migration_time";
private static final String USERNAME_SHOW_REMINDER = "username.show.reminder";
private static final String CLIENT_DEPRECATED = "misc.client_deprecated";
private static final String LAST_PREKEY_REFRESH_TIME = "last_prekey_refresh_time";
private static final String MESSAGE_REQUEST_ENABLE_TIME = "message_request_enable_time";
private static final String LAST_PROFILE_REFRESH_TIME = "misc.last_profile_refresh_time";
private static final String LAST_GV1_ROUTINE_MIGRATION_TIME = "misc.last_gv1_routine_migration_time";
private static final String USERNAME_SHOW_REMINDER = "username.show.reminder";
private static final String CLIENT_DEPRECATED = "misc.client_deprecated";
MiscellaneousValues(@NonNull KeyValueStore store) {
super(store);

View File

@@ -4,8 +4,12 @@ import androidx.annotation.NonNull;
public class TooltipValues extends SignalStoreValues {
private static final String BLUR_HUD_ICON = "tooltip.blur_hud_icon";
private static final String GROUP_CALL_SPEAKER_VIEW = "tooltip.group_call_speaker_view";
private static final int GROUP_CALLING_MAX_TOOLTIP_DISPLAY_COUNT = 3;
private static final String BLUR_HUD_ICON = "tooltip.blur_hud_icon";
private static final String GROUP_CALL_SPEAKER_VIEW = "tooltip.group_call_speaker_view";
private static final String GROUP_CALL_TOOLTIP_DISPLAY_COUNT = "tooltip.group_call_tooltip_display_count";
TooltipValues(@NonNull KeyValueStore store) {
super(store);
@@ -30,4 +34,16 @@ public class TooltipValues extends SignalStoreValues {
public void markGroupCallSpeakerViewSeen() {
putBoolean(GROUP_CALL_SPEAKER_VIEW, true);
}
public boolean shouldShowGroupCallingTooltip() {
return getInteger(GROUP_CALL_TOOLTIP_DISPLAY_COUNT, 0) < GROUP_CALLING_MAX_TOOLTIP_DISPLAY_COUNT;
}
public void markGroupCallingTooltipSeen() {
putInteger(GROUP_CALL_TOOLTIP_DISPLAY_COUNT, getInteger(GROUP_CALL_TOOLTIP_DISPLAY_COUNT, 0) + 1);
}
public void markGroupCallingLobbyEntered() {
putInteger(GROUP_CALL_TOOLTIP_DISPLAY_COUNT, Integer.MAX_VALUE);
}
}