kopia lustrzana https://github.com/ryukoposting/Signal-Android
Add new background for tooltip and always display.
rodzic
d62ff6ca06
commit
ffd60af3ff
|
@ -360,18 +360,10 @@ class MultiselectForwardFragment :
|
||||||
@Suppress("NON_EXHAUSTIVE_WHEN_STATEMENT")
|
@Suppress("NON_EXHAUSTIVE_WHEN_STATEMENT")
|
||||||
when (storySendRequirements) {
|
when (storySendRequirements) {
|
||||||
Stories.MediaTransform.SendRequirements.REQUIRES_CLIP -> {
|
Stories.MediaTransform.SendRequirements.REQUIRES_CLIP -> {
|
||||||
if (!SignalStore.storyValues().videoTooltipSeen) {
|
displayTooltip(view, R.string.MultiselectForwardFragment__videos_will_be_trimmed)
|
||||||
displayTooltip(view, R.string.MultiselectForwardFragment__videos_will_be_trimmed) {
|
|
||||||
SignalStore.storyValues().videoTooltipSeen = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
Stories.MediaTransform.SendRequirements.CAN_NOT_SEND -> {
|
Stories.MediaTransform.SendRequirements.CAN_NOT_SEND -> {
|
||||||
if (!SignalStore.storyValues().cannotSendTooltipSeen) {
|
displayTooltip(view, R.string.MultiselectForwardFragment__videos_sent_to_stories_cant)
|
||||||
displayTooltip(view, R.string.MultiselectForwardFragment__videos_sent_to_stories_cant) {
|
|
||||||
SignalStore.storyValues().cannotSendTooltipSeen = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -379,15 +371,12 @@ class MultiselectForwardFragment :
|
||||||
return resultsSet.toSet()
|
return resultsSet.toSet()
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun displayTooltip(anchor: View, @StringRes text: Int, onDismiss: () -> Unit) {
|
private fun displayTooltip(anchor: View, @StringRes text: Int) {
|
||||||
TooltipPopup
|
TooltipPopup
|
||||||
.forTarget(anchor)
|
.forTarget(anchor)
|
||||||
.setText(text)
|
.setText(text)
|
||||||
.setTextColor(ContextCompat.getColor(requireContext(), R.color.signal_colorOnPrimary))
|
.setTextColor(ContextCompat.getColor(requireContext(), R.color.signal_colorOnPrimaryContainer))
|
||||||
.setBackgroundTint(ContextCompat.getColor(requireContext(), R.color.signal_colorPrimary))
|
.setBackgroundTint(ContextCompat.getColor(requireContext(), R.color.signal_colorPrimaryContainer))
|
||||||
.setOnDismissListener {
|
|
||||||
onDismiss()
|
|
||||||
}
|
|
||||||
.show(TooltipPopup.POSITION_BELOW)
|
.show(TooltipPopup.POSITION_BELOW)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -25,16 +25,6 @@ internal class StoryValues(store: KeyValueStore) : SignalStoreValues(store) {
|
||||||
*/
|
*/
|
||||||
private const val LATEST_STORY_SENDS = "latest.story.sends"
|
private const val LATEST_STORY_SENDS = "latest.story.sends"
|
||||||
|
|
||||||
/**
|
|
||||||
* Video Trim tooltip marker
|
|
||||||
*/
|
|
||||||
private const val VIDEO_TOOLTIP_SEEN_MARKER = "stories.video.will.be.trimmed.tooltip.seen"
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Cannot send to story tooltip marker
|
|
||||||
*/
|
|
||||||
private const val CANNOT_SEND_SEEN_MARKER = "stories.cannot.send.video.tooltip.seen"
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Whether or not the user has see the "Navigation education" view
|
* Whether or not the user has see the "Navigation education" view
|
||||||
*/
|
*/
|
||||||
|
@ -56,8 +46,6 @@ internal class StoryValues(store: KeyValueStore) : SignalStoreValues(store) {
|
||||||
override fun getKeysToIncludeInBackup(): MutableList<String> = mutableListOf(
|
override fun getKeysToIncludeInBackup(): MutableList<String> = mutableListOf(
|
||||||
MANUAL_FEATURE_DISABLE,
|
MANUAL_FEATURE_DISABLE,
|
||||||
USER_HAS_ADDED_TO_A_STORY,
|
USER_HAS_ADDED_TO_A_STORY,
|
||||||
VIDEO_TOOLTIP_SEEN_MARKER,
|
|
||||||
CANNOT_SEND_SEEN_MARKER,
|
|
||||||
USER_HAS_SEEN_FIRST_NAV_VIEW,
|
USER_HAS_SEEN_FIRST_NAV_VIEW,
|
||||||
HAS_DOWNLOADED_ONBOARDING_STORY
|
HAS_DOWNLOADED_ONBOARDING_STORY
|
||||||
)
|
)
|
||||||
|
@ -68,10 +56,6 @@ internal class StoryValues(store: KeyValueStore) : SignalStoreValues(store) {
|
||||||
|
|
||||||
var userHasBeenNotifiedAboutStories: Boolean by booleanValue(USER_HAS_ADDED_TO_A_STORY, false)
|
var userHasBeenNotifiedAboutStories: Boolean by booleanValue(USER_HAS_ADDED_TO_A_STORY, false)
|
||||||
|
|
||||||
var videoTooltipSeen by booleanValue(VIDEO_TOOLTIP_SEEN_MARKER, false)
|
|
||||||
|
|
||||||
var cannotSendTooltipSeen by booleanValue(CANNOT_SEND_SEEN_MARKER, false)
|
|
||||||
|
|
||||||
var userHasSeenFirstNavView: Boolean by booleanValue(USER_HAS_SEEN_FIRST_NAV_VIEW, false)
|
var userHasSeenFirstNavView: Boolean by booleanValue(USER_HAS_SEEN_FIRST_NAV_VIEW, false)
|
||||||
|
|
||||||
var hasDownloadedOnboardingStory: Boolean by booleanValue(HAS_DOWNLOADED_ONBOARDING_STORY, false)
|
var hasDownloadedOnboardingStory: Boolean by booleanValue(HAS_DOWNLOADED_ONBOARDING_STORY, false)
|
||||||
|
|
Ładowanie…
Reference in New Issue