mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-22 01:40:07 +01:00
Revert "Add more logging to forwarding bottom sheet."
This reverts commit 3fc26733ad.
This commit is contained in:
@@ -8,7 +8,6 @@ import android.view.ViewGroup
|
||||
import androidx.fragment.app.setFragmentResult
|
||||
import com.google.android.material.bottomsheet.BottomSheetBehavior
|
||||
import com.google.android.material.bottomsheet.BottomSheetDialog
|
||||
import org.signal.core.util.logging.Log
|
||||
import org.thoughtcrime.securesms.R
|
||||
import org.thoughtcrime.securesms.components.FixedRoundedCornerBottomSheetDialogFragment
|
||||
import org.thoughtcrime.securesms.stories.Stories
|
||||
@@ -20,17 +19,11 @@ class MultiselectForwardBottomSheet : FixedRoundedCornerBottomSheetDialogFragmen
|
||||
|
||||
private var callback: Callback? = null
|
||||
|
||||
companion object {
|
||||
private val TAG = Log.tag(MultiselectForwardBottomSheet::class.java)
|
||||
}
|
||||
|
||||
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
|
||||
return inflater.inflate(R.layout.multiselect_bottom_sheet, container, false)
|
||||
}
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
Log.d(TAG, "onViewCreated()")
|
||||
|
||||
callback = findListener<Callback>()
|
||||
|
||||
if (savedInstanceState == null) {
|
||||
@@ -60,22 +53,18 @@ class MultiselectForwardBottomSheet : FixedRoundedCornerBottomSheetDialogFragmen
|
||||
|
||||
override fun onDismiss(dialog: DialogInterface) {
|
||||
super.onDismiss(dialog)
|
||||
Log.d(TAG, "onDismiss()")
|
||||
callback?.onDismissForwardSheet()
|
||||
}
|
||||
|
||||
override fun onFinishForwardAction() {
|
||||
Log.d(TAG, "onFinishForwardAction()")
|
||||
callback?.onFinishForwardAction()
|
||||
}
|
||||
|
||||
override fun exitFlow() {
|
||||
Log.d(TAG, "exitFlow()")
|
||||
dismissAllowingStateLoss()
|
||||
}
|
||||
|
||||
override fun onSearchInputFocused() {
|
||||
Log.d(TAG, "onSearchInputFocused()")
|
||||
(requireDialog() as BottomSheetDialog).behavior.state = BottomSheetBehavior.STATE_EXPANDED
|
||||
}
|
||||
|
||||
|
||||
@@ -117,8 +117,6 @@ class MultiselectForwardFragment :
|
||||
}
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
Log.d(TAG, "onViewCreated()")
|
||||
|
||||
view.minimumHeight = resources.displayMetrics.heightPixels
|
||||
|
||||
contactSearchRecycler = view.findViewById(R.id.contact_selection_list)
|
||||
@@ -135,9 +133,7 @@ class MultiselectForwardFragment :
|
||||
this::getConfiguration,
|
||||
object : ContactSearchMediator.SimpleCallbacks() {
|
||||
override fun onBeforeContactsSelected(view: View?, contactSearchKeys: Set<ContactSearchKey>): Set<ContactSearchKey> {
|
||||
val filtered: Set<ContactSearchKey> = filterContacts(view, contactSearchKeys)
|
||||
Log.d(TAG, "onBeforeContactsSelected() Attempting to select: ${contactSearchKeys.map { it.toString() }}, Filtered selection: ${filtered.map { it.toString() } }")
|
||||
return filtered
|
||||
return filterContacts(view, contactSearchKeys)
|
||||
}
|
||||
}
|
||||
)
|
||||
@@ -228,6 +224,7 @@ class MultiselectForwardFragment :
|
||||
disposables += contactSearchMediator
|
||||
.getErrorEvents()
|
||||
.subscribe {
|
||||
@Suppress("WHEN_ENUM_CAN_BE_NULL_IN_JAVA")
|
||||
val message: Int = when (it) {
|
||||
ContactSearchError.CONTACT_NOT_SELECTABLE -> R.string.MultiselectForwardFragment__only_admins_can_send_messages_to_this_group
|
||||
ContactSearchError.RECOMMENDED_LIMIT_REACHED -> R.string.ContactSelectionListFragment_recommended_member_limit_reached
|
||||
@@ -238,8 +235,6 @@ class MultiselectForwardFragment :
|
||||
}
|
||||
|
||||
viewModel.state.observe(viewLifecycleOwner) {
|
||||
Log.d(TAG, "State change: ${it.stage.javaClass.simpleName}")
|
||||
|
||||
when (it.stage) {
|
||||
MultiselectForwardState.Stage.Selection -> {}
|
||||
MultiselectForwardState.Stage.FirstConfirmation -> displayFirstSendConfirmation()
|
||||
@@ -277,8 +272,6 @@ class MultiselectForwardFragment :
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
|
||||
Log.d(TAG, "onViewCreated()")
|
||||
|
||||
val now = System.currentTimeMillis()
|
||||
val expiringMessages = args.multiShareArgs.filter { it.expiresAt > 0L }
|
||||
val firstToExpire = expiringMessages.minByOrNull { it.expiresAt }
|
||||
@@ -338,8 +331,6 @@ class MultiselectForwardFragment :
|
||||
}
|
||||
|
||||
private fun dismissWithSuccess(@PluralsRes toastTextResId: Int) {
|
||||
Log.d(TAG, "dismissWithSuccess() Selected: ${contactSearchMediator.getSelectedContacts().map { it.toString() }}")
|
||||
|
||||
requireListener<Callback>().setResult(
|
||||
Bundle().apply {
|
||||
putBoolean(RESULT_SENT, true)
|
||||
@@ -350,7 +341,7 @@ class MultiselectForwardFragment :
|
||||
}
|
||||
|
||||
private fun dismissAndShowToast(@PluralsRes toastTextResId: Int) {
|
||||
Log.d(TAG, "dismissAndShowToast() Selected: ${contactSearchMediator.getSelectedContacts().map { it.toString() }}")
|
||||
Log.d(TAG, "dismissAndShowToast")
|
||||
|
||||
val argCount = getMessageCount()
|
||||
|
||||
@@ -372,7 +363,7 @@ class MultiselectForwardFragment :
|
||||
}
|
||||
|
||||
private fun dismissWithSelection(selectedContacts: Set<ContactSearchKey>) {
|
||||
Log.d(TAG, "dismissWithSelection() Selected: ${selectedContacts.map { it.toString() }}")
|
||||
Log.d(TAG, "dismissWithSelection")
|
||||
|
||||
callback.onFinishForwardAction()
|
||||
dismissibleDialog?.dismiss()
|
||||
|
||||
Reference in New Issue
Block a user