mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-23 18:30:20 +01:00
Tweak emoji suggestions UX.
This commit is contained in:
committed by
Greyson Parrelli
parent
440d041402
commit
d7d923c820
@@ -2358,6 +2358,7 @@ public class ConversationParentFragment extends Fragment
|
||||
composeText,
|
||||
getViewLifecycleOwner()
|
||||
);
|
||||
inlineQueryResultsController.onOrientationChange(getResources().getConfiguration().orientation == ORIENTATION_LANDSCAPE);
|
||||
|
||||
recipient.observe(getViewLifecycleOwner(), r -> {
|
||||
if (r.isPushV2Group() && !mentionsSuggestions.resolved()) {
|
||||
|
||||
@@ -10,7 +10,7 @@ sealed class InlineQueryReplacement(@get:JvmName("isKeywordSearch") val keywordS
|
||||
|
||||
class Emoji(private val emoji: String, keywordSearch: Boolean) : InlineQueryReplacement(keywordSearch) {
|
||||
override fun toCharSequence(context: Context): CharSequence {
|
||||
return "$emoji "
|
||||
return emoji
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,6 @@ import io.reactivex.rxjava3.kotlin.subscribeBy
|
||||
import org.signal.core.util.DimensionUnit
|
||||
import org.thoughtcrime.securesms.components.ComposeText
|
||||
import org.thoughtcrime.securesms.util.LifecycleDisposable
|
||||
import org.thoughtcrime.securesms.util.VibrateUtil
|
||||
import org.thoughtcrime.securesms.util.adapter.mapping.AnyMappingModel
|
||||
import org.thoughtcrime.securesms.util.doOnEachLayout
|
||||
|
||||
@@ -30,6 +29,7 @@ class InlineQueryResultsController(
|
||||
private var popup: InlineQueryResultsPopup? = null
|
||||
private var previousResults: List<AnyMappingModel>? = null
|
||||
private var canShow: Boolean = false
|
||||
private var isLandscape: Boolean = false
|
||||
|
||||
init {
|
||||
lifecycleDisposable.bindTo(lifecycleOwner)
|
||||
@@ -61,6 +61,8 @@ class InlineQueryResultsController(
|
||||
}
|
||||
|
||||
fun onOrientationChange(isLandscape: Boolean) {
|
||||
this.isLandscape = isLandscape
|
||||
|
||||
if (isLandscape) {
|
||||
dismiss()
|
||||
} else {
|
||||
@@ -70,7 +72,7 @@ class InlineQueryResultsController(
|
||||
|
||||
private fun updateList(results: List<AnyMappingModel>) {
|
||||
previousResults = results
|
||||
if (results.isEmpty() || !canShow) {
|
||||
if (results.isEmpty() || !canShow || isLandscape) {
|
||||
dismiss()
|
||||
} else if (popup != null) {
|
||||
popup?.setResults(results)
|
||||
@@ -82,7 +84,6 @@ class InlineQueryResultsController(
|
||||
baseOffsetX = DimensionUnit.DP.toPixels(16f).toInt(),
|
||||
callback = this
|
||||
).show()
|
||||
VibrateUtil.vibrateTick(context)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -6,8 +6,8 @@ import android.os.Build
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.view.ViewOutlineProvider
|
||||
import android.widget.PopupWindow
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import org.thoughtcrime.securesms.R
|
||||
import org.thoughtcrime.securesms.util.ViewUtil
|
||||
@@ -34,7 +34,11 @@ class InlineQueryResultsPopup(
|
||||
private val adapter: MappingAdapter
|
||||
|
||||
init {
|
||||
setBackgroundDrawable(ContextCompat.getDrawable(context, R.drawable.signal_context_menu_background))
|
||||
if (Build.VERSION.SDK_INT >= 21) {
|
||||
contentView.outlineProvider = ViewOutlineProvider.BACKGROUND
|
||||
contentView.clipToOutline = true
|
||||
}
|
||||
|
||||
inputMethodMode = INPUT_METHOD_NOT_NEEDED
|
||||
|
||||
setOnDismissListener {
|
||||
|
||||
Reference in New Issue
Block a user