Loading app/src/main/java/io/eelo/appinstaller/updates/UpdatesFragment.kt +8 −2 Original line number Diff line number Diff line Loading @@ -9,6 +9,7 @@ import android.support.v7.widget.RecyclerView import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import android.widget.ProgressBar import io.eelo.appinstaller.R import io.eelo.appinstaller.application.model.InstallManager import io.eelo.appinstaller.common.ApplicationListAdapter Loading @@ -27,13 +28,18 @@ class UpdatesFragment : Fragment() { updatesViewModel = ViewModelProviders.of(activity!!).get(UpdatesViewModel::class.java) val recyclerView = view.findViewById<RecyclerView>(R.id.app_list) val progressBar = view.findViewById<ProgressBar>(R.id.progress_bar) initializeRecyclerView(recyclerView) updatesViewModel.initialise(installManager!!) initializeRecyclerView(recyclerView) progressBar.visibility = View.VISIBLE // Bind recycler view adapter to search results list in view model updatesViewModel.getApplications().observe(this, Observer { if (it!!.isNotEmpty()) { recyclerView.adapter.notifyDataSetChanged() progressBar.visibility = View.GONE } }) updatesViewModel.loadApplicationList(context!!) Loading app/src/main/res/layout/fragment_updates.xml +11 −2 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" xmlns:app="http://schemas.android.com/apk/res-auto"> android:layout_height="match_parent"> <android.support.v7.widget.RecyclerView android:id="@+id/app_list" Loading @@ -12,4 +12,13 @@ app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintTop_toTopOf="parent" /> <ProgressBar android:id="@+id/progress_bar" android:layout_width="wrap_content" android:layout_height="wrap_content" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" /> </android.support.constraint.ConstraintLayout> Loading
app/src/main/java/io/eelo/appinstaller/updates/UpdatesFragment.kt +8 −2 Original line number Diff line number Diff line Loading @@ -9,6 +9,7 @@ import android.support.v7.widget.RecyclerView import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import android.widget.ProgressBar import io.eelo.appinstaller.R import io.eelo.appinstaller.application.model.InstallManager import io.eelo.appinstaller.common.ApplicationListAdapter Loading @@ -27,13 +28,18 @@ class UpdatesFragment : Fragment() { updatesViewModel = ViewModelProviders.of(activity!!).get(UpdatesViewModel::class.java) val recyclerView = view.findViewById<RecyclerView>(R.id.app_list) val progressBar = view.findViewById<ProgressBar>(R.id.progress_bar) initializeRecyclerView(recyclerView) updatesViewModel.initialise(installManager!!) initializeRecyclerView(recyclerView) progressBar.visibility = View.VISIBLE // Bind recycler view adapter to search results list in view model updatesViewModel.getApplications().observe(this, Observer { if (it!!.isNotEmpty()) { recyclerView.adapter.notifyDataSetChanged() progressBar.visibility = View.GONE } }) updatesViewModel.loadApplicationList(context!!) Loading
app/src/main/res/layout/fragment_updates.xml +11 −2 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" xmlns:app="http://schemas.android.com/apk/res-auto"> android:layout_height="match_parent"> <android.support.v7.widget.RecyclerView android:id="@+id/app_list" Loading @@ -12,4 +12,13 @@ app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintTop_toTopOf="parent" /> <ProgressBar android:id="@+id/progress_bar" android:layout_width="wrap_content" android:layout_height="wrap_content" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" /> </android.support.constraint.ConstraintLayout>