keyboard and home hopefully fixed

This commit is contained in:
LagradOst 2021-09-26 14:31:48 +02:00
parent ef29d0efaa
commit f56b6c168d
2 changed files with 6 additions and 7 deletions

View file

@ -13,13 +13,12 @@ import android.widget.FrameLayout
import android.widget.TextView
import androidx.core.view.isVisible
import androidx.fragment.app.Fragment
import androidx.fragment.app.activityViewModels
import androidx.lifecycle.ViewModelProvider
import androidx.recyclerview.widget.GridLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.google.android.material.bottomsheet.BottomSheetDialog
import com.lagradost.cloudstream3.*
import com.lagradost.cloudstream3.APIHolder.apis
import com.lagradost.cloudstream3.MainActivity.Companion.backEvent
import com.lagradost.cloudstream3.mvvm.Resource
import com.lagradost.cloudstream3.mvvm.observe
import com.lagradost.cloudstream3.ui.APIRepository.Companion.noneApi
@ -92,15 +91,15 @@ class HomeFragment : Fragment() {
}
}
private val homeViewModel: HomeViewModel by activityViewModels()
private lateinit var homeViewModel: HomeViewModel
override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
// homeViewModel =
// ViewModelProvider(activity ?: this).get(HomeViewModel::class.java)
homeViewModel =
ViewModelProvider(this).get(HomeViewModel::class.java)
return inflater.inflate(R.layout.fragment_home, container, false)
}

View file

@ -370,7 +370,7 @@ class SearchFragment : Fragment() {
typesActive = it.getApiTypeSettings()
}
main_search.setOnQueryTextFocusChangeListener { searchView, b ->
/*main_search.setOnQueryTextFocusChangeListener { searchView, b ->
if (b) {
// https://stackoverflow.com/questions/12022715/unable-to-show-keyboard-automatically-in-the-searchview
searchView?.postDelayed({
@ -381,7 +381,7 @@ class SearchFragment : Fragment() {
}, 200)
}
}
main_search.onActionViewExpanded()
main_search.onActionViewExpanded()*/
val masterAdapter: RecyclerView.Adapter<RecyclerView.ViewHolder> = ParentItemAdapter(listOf(), { callback ->
SearchHelper.handleSearchClickCallback(activity, callback)