diff --git a/app/src/main/java/com/lagradost/cloudstream3/ui/home/HomeFragment.kt b/app/src/main/java/com/lagradost/cloudstream3/ui/home/HomeFragment.kt index bb59235f..aea6d9dc 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/ui/home/HomeFragment.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/ui/home/HomeFragment.kt @@ -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) } diff --git a/app/src/main/java/com/lagradost/cloudstream3/ui/search/SearchFragment.kt b/app/src/main/java/com/lagradost/cloudstream3/ui/search/SearchFragment.kt index 0b7d2aa9..fdc2608a 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/ui/search/SearchFragment.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/ui/search/SearchFragment.kt @@ -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 = ParentItemAdapter(listOf(), { callback -> SearchHelper.handleSearchClickCallback(activity, callback)