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 android.widget.TextView
import androidx.core.view.isVisible import androidx.core.view.isVisible
import androidx.fragment.app.Fragment import androidx.fragment.app.Fragment
import androidx.fragment.app.activityViewModels import androidx.lifecycle.ViewModelProvider
import androidx.recyclerview.widget.GridLayoutManager import androidx.recyclerview.widget.GridLayoutManager
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import com.google.android.material.bottomsheet.BottomSheetDialog import com.google.android.material.bottomsheet.BottomSheetDialog
import com.lagradost.cloudstream3.* import com.lagradost.cloudstream3.*
import com.lagradost.cloudstream3.APIHolder.apis import com.lagradost.cloudstream3.APIHolder.apis
import com.lagradost.cloudstream3.MainActivity.Companion.backEvent
import com.lagradost.cloudstream3.mvvm.Resource import com.lagradost.cloudstream3.mvvm.Resource
import com.lagradost.cloudstream3.mvvm.observe import com.lagradost.cloudstream3.mvvm.observe
import com.lagradost.cloudstream3.ui.APIRepository.Companion.noneApi 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( override fun onCreateView(
inflater: LayoutInflater, inflater: LayoutInflater,
container: ViewGroup?, container: ViewGroup?,
savedInstanceState: Bundle? savedInstanceState: Bundle?
): View? { ): View? {
// homeViewModel = homeViewModel =
// ViewModelProvider(activity ?: this).get(HomeViewModel::class.java) ViewModelProvider(this).get(HomeViewModel::class.java)
return inflater.inflate(R.layout.fragment_home, container, false) return inflater.inflate(R.layout.fragment_home, container, false)
} }

View file

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