kopia lustrzana https://github.com/ryukoposting/Signal-Android
Ensure only a single story is displayed above the fold in bottom sheets.
rodzic
320669c54e
commit
54d0df9a05
|
@ -410,7 +410,9 @@ class MultiselectForwardFragment :
|
||||||
val expandedConfig: ContactSearchConfiguration.ExpandConfig? = if (isSelectedMediaValidForNonStories()) {
|
val expandedConfig: ContactSearchConfiguration.ExpandConfig? = if (isSelectedMediaValidForNonStories()) {
|
||||||
ContactSearchConfiguration.ExpandConfig(
|
ContactSearchConfiguration.ExpandConfig(
|
||||||
isExpanded = contactSearchState.expandedSections.contains(ContactSearchConfiguration.SectionKey.STORIES),
|
isExpanded = contactSearchState.expandedSections.contains(ContactSearchConfiguration.SectionKey.STORIES),
|
||||||
maxCountWhenNotExpanded = { it + 1 }
|
maxCountWhenNotExpanded = {
|
||||||
|
if (args.isWrappedInBottomSheet) 1 else it + 1
|
||||||
|
}
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
null
|
null
|
||||||
|
@ -514,7 +516,7 @@ class MultiselectForwardFragment :
|
||||||
fun showBottomSheet(supportFragmentManager: FragmentManager, multiselectForwardFragmentArgs: MultiselectForwardFragmentArgs) {
|
fun showBottomSheet(supportFragmentManager: FragmentManager, multiselectForwardFragmentArgs: MultiselectForwardFragmentArgs) {
|
||||||
val fragment = MultiselectForwardBottomSheet()
|
val fragment = MultiselectForwardBottomSheet()
|
||||||
|
|
||||||
showDialogFragment(supportFragmentManager, fragment, multiselectForwardFragmentArgs)
|
showDialogFragment(supportFragmentManager, fragment, multiselectForwardFragmentArgs.copy(isWrappedInBottomSheet = true))
|
||||||
}
|
}
|
||||||
|
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
|
|
|
@ -35,6 +35,7 @@ import java.util.function.Consumer
|
||||||
* @param forceDisableAddMessage Hide the add message field even if it would normally be available.
|
* @param forceDisableAddMessage Hide the add message field even if it would normally be available.
|
||||||
* @param forceSelectionOnly Force the fragment to only select recipients, never actually performing the send.
|
* @param forceSelectionOnly Force the fragment to only select recipients, never actually performing the send.
|
||||||
* @param selectSingleRecipient Only allow the selection of a single recipient.
|
* @param selectSingleRecipient Only allow the selection of a single recipient.
|
||||||
|
* @param isWrappedInBottomSheet Whether the fragment is wrapped in a bottom sheet.
|
||||||
*/
|
*/
|
||||||
@Parcelize
|
@Parcelize
|
||||||
data class MultiselectForwardFragmentArgs @JvmOverloads constructor(
|
data class MultiselectForwardFragmentArgs @JvmOverloads constructor(
|
||||||
|
@ -47,7 +48,8 @@ data class MultiselectForwardFragmentArgs @JvmOverloads constructor(
|
||||||
val sendButtonColors: ViewColorSet = ViewColorSet.PRIMARY,
|
val sendButtonColors: ViewColorSet = ViewColorSet.PRIMARY,
|
||||||
val storySendRequirements: Stories.MediaTransform.SendRequirements = Stories.MediaTransform.SendRequirements.CAN_NOT_SEND,
|
val storySendRequirements: Stories.MediaTransform.SendRequirements = Stories.MediaTransform.SendRequirements.CAN_NOT_SEND,
|
||||||
val isSearchEnabled: Boolean = true,
|
val isSearchEnabled: Boolean = true,
|
||||||
val isViewOnce: Boolean = false
|
val isViewOnce: Boolean = false,
|
||||||
|
val isWrappedInBottomSheet: Boolean = false
|
||||||
) : Parcelable {
|
) : Parcelable {
|
||||||
|
|
||||||
fun withSendButtonTint(@ColorInt sendButtonTint: Int) = copy(sendButtonColors = ViewColorSet.forCustomColor(sendButtonTint))
|
fun withSendButtonTint(@ColorInt sendButtonTint: Int) = copy(sendButtonColors = ViewColorSet.forCustomColor(sendButtonTint))
|
||||||
|
|
Ładowanie…
Reference in New Issue