From 9aefc0d2a8bebd59d776b7ba8679fb8033523fc2 Mon Sep 17 00:00:00 2001 From: sunil9211 Date: Sun, 20 Feb 2022 11:35:13 +0530 Subject: [PATCH] [fenix] For https://github.com/mozilla-mobile/fenix/issues/23841: Hide keyboard when selecting month or year --- .../creditcards/CreditCardEditorFragment.kt | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/org/mozilla/fenix/settings/creditcards/CreditCardEditorFragment.kt b/app/src/main/java/org/mozilla/fenix/settings/creditcards/CreditCardEditorFragment.kt index 36b5da0a68..b71f5a6315 100644 --- a/app/src/main/java/org/mozilla/fenix/settings/creditcards/CreditCardEditorFragment.kt +++ b/app/src/main/java/org/mozilla/fenix/settings/creditcards/CreditCardEditorFragment.kt @@ -4,6 +4,7 @@ package org.mozilla.fenix.settings.creditcards +import android.annotation.SuppressLint import android.content.DialogInterface import android.os.Bundle import android.view.Menu @@ -56,6 +57,7 @@ class CreditCardEditorFragment : private lateinit var interactor: CreditCardEditorInteractor + @SuppressLint("ClickableViewAccessibility") override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) @@ -81,10 +83,20 @@ class CreditCardEditorFragment : creditCardEditorView = CreditCardEditorView(binding, interactor) creditCardEditorView.bind(creditCardEditorState) - binding.cardNumberInput.apply { - requestFocus() - placeCursorAtEnd() - showKeyboard() + binding.apply { + cardNumberInput.apply { + requestFocus() + placeCursorAtEnd() + showKeyboard() + } + expiryMonthDropDown.setOnTouchListener { view, _ -> + view?.hideKeyboard() + false + } + expiryYearDropDown.setOnTouchListener { view, _ -> + view?.hideKeyboard() + false + } } } }