Merge pull request #115 from suraj0208/bugfix/fix-full-screen-button

Fix fullscreen button and keyboard search button
This commit is contained in:
alefvanoon 2022-04-02 20:34:49 +04:30 committed by GitHub
commit aa6762b1d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 1 deletions

View File

@ -192,7 +192,6 @@ class PlayerFragment : Fragment() {
view.findViewById<LinearLayout>(R.id.linLayout).visibility=View.GONE view.findViewById<LinearLayout>(R.id.linLayout).visibility=View.GONE
val mainActivity = activity as MainActivity val mainActivity = activity as MainActivity
mainActivity.requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_USER_LANDSCAPE mainActivity.requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_USER_LANDSCAPE
mainActivity.requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED
isFullScreen=true isFullScreen=true
}else{ }else{

View File

@ -9,9 +9,11 @@ import android.view.LayoutInflater
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import android.view.WindowManager import android.view.WindowManager
import android.view.inputmethod.EditorInfo
import android.view.inputmethod.InputMethodManager import android.view.inputmethod.InputMethodManager
import android.widget.ArrayAdapter import android.widget.ArrayAdapter
import android.widget.AutoCompleteTextView import android.widget.AutoCompleteTextView
import android.widget.TextView.OnEditorActionListener
import androidx.fragment.app.Fragment import androidx.fragment.app.Fragment
import androidx.lifecycle.lifecycleScope import androidx.lifecycle.lifecycleScope
import androidx.recyclerview.widget.GridLayoutManager 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){ private fun fetchSuggestions(query: String, autoTextView: AutoCompleteTextView){