|
@@ -51,7 +51,7 @@ class MainFragment : Fragment() {
|
|
|
super.onActivityCreated(savedInstanceState)
|
|
super.onActivityCreated(savedInstanceState)
|
|
|
sheetBehavior = BottomSheetBehavior.from(bottomSheet)
|
|
sheetBehavior = BottomSheetBehavior.from(bottomSheet)
|
|
|
optionsView.alpha = 0.0f
|
|
optionsView.alpha = 0.0f
|
|
|
- viewModel = ViewModelProviders.of(activity!!).get(MainViewModel::class.java)
|
|
|
|
|
|
|
+ viewModel = ViewModelProviders.of(this).get(MainViewModel::class.java)
|
|
|
adapter = MainAppsAdapter(mutableSetOf(), InteractionHandler())
|
|
adapter = MainAppsAdapter(mutableSetOf(), InteractionHandler())
|
|
|
mainAppsList.adapter = adapter
|
|
mainAppsList.adapter = adapter
|
|
|
viewModel.homeApps.observe(this, Observer {
|
|
viewModel.homeApps.observe(this, Observer {
|
|
@@ -149,7 +149,7 @@ class MainFragment : Fragment() {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private fun rateApp() {
|
|
private fun rateApp() {
|
|
|
- val uri = Uri.parse("market://details?id=" + context!!.packageName)
|
|
|
|
|
|
|
+ val uri = Uri.parse("market://details?id=" + context?.packageName)
|
|
|
val goToMarket = Intent(Intent.ACTION_VIEW, uri)
|
|
val goToMarket = Intent(Intent.ACTION_VIEW, uri)
|
|
|
goToMarket.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY or
|
|
goToMarket.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY or
|
|
|
Intent.FLAG_ACTIVITY_MULTIPLE_TASK)
|
|
Intent.FLAG_ACTIVITY_MULTIPLE_TASK)
|
|
@@ -161,7 +161,7 @@ class MainFragment : Fragment() {
|
|
|
Log.d(TAG, goToMarket.data?.query)
|
|
Log.d(TAG, goToMarket.data?.query)
|
|
|
} catch (e: ActivityNotFoundException) {
|
|
} catch (e: ActivityNotFoundException) {
|
|
|
startActivity(Intent(Intent.ACTION_VIEW,
|
|
startActivity(Intent(Intent.ACTION_VIEW,
|
|
|
- Uri.parse("http://play.google.com/store/apps/details?id=" + context!!.packageName)))
|
|
|
|
|
|
|
+ Uri.parse("http://play.google.com/store/apps/details?id=" + context?.packageName)))
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|