From 12138bd4f4d6e0199b6582209448f005fb208766 Mon Sep 17 00:00:00 2001 From: Surajkumar Gunjal Date: Sat, 2 Apr 2022 16:54:20 +0530 Subject: [PATCH 1/2] Fix fullscreen button --- app/src/main/java/com/github/libretube/PlayerFragment.kt | 1 - 1 file changed, 1 deletion(-) diff --git a/app/src/main/java/com/github/libretube/PlayerFragment.kt b/app/src/main/java/com/github/libretube/PlayerFragment.kt index fa4749513..cf94d899f 100644 --- a/app/src/main/java/com/github/libretube/PlayerFragment.kt +++ b/app/src/main/java/com/github/libretube/PlayerFragment.kt @@ -192,7 +192,6 @@ class PlayerFragment : Fragment() { view.findViewById(R.id.linLayout).visibility=View.GONE val mainActivity = activity as MainActivity mainActivity.requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_USER_LANDSCAPE - mainActivity.requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED isFullScreen=true }else{ From 89937f4ef6b1860ea8b215e42ebe70abf854cae2 Mon Sep 17 00:00:00 2001 From: Surajkumar Gunjal Date: Sat, 2 Apr 2022 16:50:58 +0530 Subject: [PATCH 2/2] close AutoCompleteTextView and keyboard for suggestions when search button is pressed --- .../java/com/github/libretube/SearchFragment.kt | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/app/src/main/java/com/github/libretube/SearchFragment.kt b/app/src/main/java/com/github/libretube/SearchFragment.kt index 5bafb6d9b..07031801d 100644 --- a/app/src/main/java/com/github/libretube/SearchFragment.kt +++ b/app/src/main/java/com/github/libretube/SearchFragment.kt @@ -9,9 +9,11 @@ import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import android.view.WindowManager +import android.view.inputmethod.EditorInfo import android.view.inputmethod.InputMethodManager import android.widget.ArrayAdapter import android.widget.AutoCompleteTextView +import android.widget.TextView.OnEditorActionListener import androidx.fragment.app.Fragment import androidx.lifecycle.lifecycleScope import androidx.recyclerview.widget.GridLayoutManager @@ -75,6 +77,17 @@ class SearchFragment : Fragment() { } }) + autoTextView.setOnEditorActionListener(OnEditorActionListener { _, actionId, _ -> + if (actionId == EditorInfo.IME_ACTION_SEARCH) { + hideKeyboard(); + autoTextView.dismissDropDown(); + return@OnEditorActionListener true + } + false + }) + autoTextView.setOnDismissListener { + hideKeyboard(); + } } private fun fetchSuggestions(query: String, autoTextView: AutoCompleteTextView){