Hide bottom bar on scroll for Emoji pager.

This commit is contained in:
Alex Hart
2021-06-03 15:27:29 -03:00
committed by Cody Henthorne
parent c202f97088
commit 262b4e7d62
8 changed files with 92 additions and 142 deletions

View File

@@ -9,16 +9,16 @@ import org.thoughtcrime.securesms.util.MappingViewHolder
class EmojiKeyboardPageAdapter(
private val emojiSelectionListener: EmojiKeyboardProvider.EmojiEventListener,
private val variationSelectorListener: EmojiPageViewGridAdapter.VariationSelectorListener,
private val searchCallbacks: KeyboardPageSearchView.Callbacks
private val variationSelectorListener: EmojiPageViewGridAdapter.VariationSelectorListener
) : MappingAdapter() {
init {
registerFactory(EmojiPageMappingModel::class.java) { parent ->
val pageView = EmojiPageView(parent.context, emojiSelectionListener, variationSelectorListener, true, searchCallbacks)
val pageView = EmojiPageView(parent.context, emojiSelectionListener, variationSelectorListener, true)
val layoutParams = ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT)
pageView.layoutParams = layoutParams
pageView.presentForEmojiKeyboard()
ViewHolder(pageView)
}

View File

@@ -27,6 +27,7 @@ class EmojiKeyboardPageFragment : Fragment(R.layout.keyboard_pager_emoji_page_fr
private lateinit var callback: Callback
private lateinit var pagesAdapter: EmojiKeyboardPageAdapter
private lateinit var categoriesAdapter: EmojiKeyboardPageCategoriesAdapter
private lateinit var searchBar: KeyboardPageSearchView
override fun onAttach(context: Context) {
super.onAttach(context)
@@ -38,6 +39,7 @@ class EmojiKeyboardPageFragment : Fragment(R.layout.keyboard_pager_emoji_page_fr
super.onViewCreated(view, savedInstanceState)
emojiPager = view.findViewById(R.id.emoji_pager)
searchView = view.findViewById(R.id.emoji_search)
searchBar = view.findViewById(R.id.emoji_keyboard_search_text)
emojiCategoriesRecycler = view.findViewById(R.id.emoji_categories_recycler)
backspaceView = view.findViewById(R.id.emoji_backspace)
}
@@ -47,7 +49,7 @@ class EmojiKeyboardPageFragment : Fragment(R.layout.keyboard_pager_emoji_page_fr
viewModel = ViewModelProviders.of(requireActivity()).get(EmojiKeyboardPageViewModel::class.java)
pagesAdapter = EmojiKeyboardPageAdapter(this, this, EmojiKeyboardPageSearchViewCallbacks())
pagesAdapter = EmojiKeyboardPageAdapter(this, this)
categoriesAdapter = EmojiKeyboardPageCategoriesAdapter { key ->
viewModel.onKeySelected(key)
@@ -64,6 +66,8 @@ class EmojiKeyboardPageFragment : Fragment(R.layout.keyboard_pager_emoji_page_fr
emojiPager.adapter = pagesAdapter
emojiCategoriesRecycler.adapter = categoriesAdapter
searchBar.callbacks = EmojiKeyboardPageSearchViewCallbacks()
searchView.setOnClickListener {
callback.openEmojiSearch()
}

View File

@@ -40,7 +40,7 @@ class EmojiSearchFragment : Fragment(R.layout.emoji_search_fragment), EmojiPageV
val searchBar: KeyboardPageSearchView = view.findViewById(R.id.emoji_search_view)
val resultsContainer: FrameLayout = view.findViewById(R.id.emoji_search_results_container)
val noResults: TextView = view.findViewById(R.id.emoji_search_empty)
val emojiPageView = EmojiPageView(requireContext(), eventListener, this, true, null, LinearLayoutManager(requireContext(), RecyclerView.HORIZONTAL, false), R.layout.emoji_search_result_display_item)
val emojiPageView = EmojiPageView(requireContext(), eventListener, this, true, LinearLayoutManager(requireContext(), RecyclerView.HORIZONTAL, false), R.layout.emoji_search_result_display_item)
resultsContainer.addView(emojiPageView)