kopia lustrzana https://github.com/ryukoposting/Signal-Android
Adjust tap area on forwarding fab.
rodzic
33d28c4359
commit
cd10aa90cc
|
@ -1,9 +1,11 @@
|
||||||
package org.thoughtcrime.securesms.conversation.mutiselect.forward
|
package org.thoughtcrime.securesms.conversation.mutiselect.forward
|
||||||
|
|
||||||
|
import android.graphics.Rect
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.os.Handler
|
import android.os.Handler
|
||||||
import android.os.Looper
|
import android.os.Looper
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
|
import android.view.TouchDelegate
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import android.view.animation.AnimationUtils
|
import android.view.animation.AnimationUtils
|
||||||
|
@ -11,6 +13,7 @@ import android.widget.EditText
|
||||||
import android.widget.TextView
|
import android.widget.TextView
|
||||||
import android.widget.Toast
|
import android.widget.Toast
|
||||||
import androidx.annotation.PluralsRes
|
import androidx.annotation.PluralsRes
|
||||||
|
import androidx.core.view.doOnNextLayout
|
||||||
import androidx.core.view.isVisible
|
import androidx.core.view.isVisible
|
||||||
import androidx.fragment.app.DialogFragment
|
import androidx.fragment.app.DialogFragment
|
||||||
import androidx.fragment.app.Fragment
|
import androidx.fragment.app.Fragment
|
||||||
|
@ -125,6 +128,7 @@ class MultiselectForwardFragment :
|
||||||
val bottomBar = LayoutInflater.from(requireContext()).inflate(R.layout.multiselect_forward_fragment_bottom_bar, container, false)
|
val bottomBar = LayoutInflater.from(requireContext()).inflate(R.layout.multiselect_forward_fragment_bottom_bar, container, false)
|
||||||
val shareSelectionRecycler: RecyclerView = bottomBar.findViewById(R.id.selected_list)
|
val shareSelectionRecycler: RecyclerView = bottomBar.findViewById(R.id.selected_list)
|
||||||
val shareSelectionAdapter = ShareSelectionAdapter()
|
val shareSelectionAdapter = ShareSelectionAdapter()
|
||||||
|
val sendButtonFrame: View = bottomBar.findViewById(R.id.share_confirm_frame)
|
||||||
val sendButton: View = bottomBar.findViewById(R.id.share_confirm)
|
val sendButton: View = bottomBar.findViewById(R.id.share_confirm)
|
||||||
val backgroundHelper: View = bottomBar.findViewById(R.id.background_helper)
|
val backgroundHelper: View = bottomBar.findViewById(R.id.background_helper)
|
||||||
|
|
||||||
|
@ -134,6 +138,16 @@ class MultiselectForwardFragment :
|
||||||
|
|
||||||
addMessage = bottomBar.findViewById(R.id.add_message)
|
addMessage = bottomBar.findViewById(R.id.add_message)
|
||||||
|
|
||||||
|
sendButton.doOnNextLayout {
|
||||||
|
val rect = Rect()
|
||||||
|
sendButton.getHitRect(rect)
|
||||||
|
rect.top -= sendButtonFrame.paddingTop
|
||||||
|
rect.left -= sendButtonFrame.paddingStart
|
||||||
|
rect.right += sendButtonFrame.paddingEnd
|
||||||
|
rect.bottom += sendButtonFrame.paddingBottom
|
||||||
|
sendButtonFrame.touchDelegate = TouchDelegate(rect, sendButton)
|
||||||
|
}
|
||||||
|
|
||||||
sendButton.setOnClickListener {
|
sendButton.setOnClickListener {
|
||||||
sendButton.isEnabled = false
|
sendButton.isEnabled = false
|
||||||
|
|
||||||
|
|
|
@ -20,8 +20,8 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="1dp"
|
android:layout_height="1dp"
|
||||||
android:background="@color/signal_divider_major"
|
android:background="@color/signal_divider_major"
|
||||||
app:layout_constraintBottom_toBottomOf="@id/share_confirm"
|
app:layout_constraintBottom_toBottomOf="@id/share_confirm_frame"
|
||||||
app:layout_constraintTop_toTopOf="@id/share_confirm" />
|
app:layout_constraintTop_toTopOf="@id/share_confirm_frame" />
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
android:id="@+id/selected_list"
|
android:id="@+id/selected_list"
|
||||||
|
@ -62,17 +62,25 @@
|
||||||
android:textAppearance="@style/Signal.Text.Body" />
|
android:textAppearance="@style/Signal.Text.Body" />
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
|
|
||||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
<FrameLayout
|
||||||
android:id="@+id/share_confirm"
|
android:id="@+id/share_confirm_frame"
|
||||||
android:layout_width="56dp"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="56dp"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginEnd="16dp"
|
android:clipChildren="false"
|
||||||
android:layout_marginBottom="16dp"
|
android:clipToPadding="false"
|
||||||
android:contentDescription="@string/ShareActivity__share"
|
android:padding="16dp"
|
||||||
app:backgroundTint="@color/signal_accent_primary"
|
|
||||||
app:layout_constraintBottom_toBottomOf="@id/divider"
|
app:layout_constraintBottom_toBottomOf="@id/divider"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
app:srcCompat="@drawable/ic_send_24" />
|
|
||||||
|
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||||
|
android:id="@+id/share_confirm"
|
||||||
|
android:layout_width="56dp"
|
||||||
|
android:layout_height="56dp"
|
||||||
|
android:contentDescription="@string/ShareActivity__share"
|
||||||
|
app:backgroundTint="@color/signal_accent_primary"
|
||||||
|
app:srcCompat="@drawable/ic_send_24" />
|
||||||
|
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
Ładowanie…
Reference in New Issue