Skip to content

Commit

Permalink
✨ progress before app list load
Browse files Browse the repository at this point in the history
  • Loading branch information
Yanren1225 committed Mar 5, 2022
1 parent 6485785 commit bd137a2
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
/build
/build
/release
/proguard
2 changes: 2 additions & 0 deletions app/src/main/java/ren/imyan/app_tracker/ui/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import android.view.Menu
import android.view.MenuItem
import android.widget.Toast
import androidx.activity.viewModels
import androidx.core.view.isGone
import androidx.core.view.updatePadding
import androidx.core.widget.doOnTextChanged
import androidx.lifecycle.lifecycleScope
Expand Down Expand Up @@ -153,6 +154,7 @@ class MainActivity : BaseActivity() {

}
is BaseLoad.Success -> {
binding.progress.isGone = true
binding.appList.models =
it.data.toMutableList()
}
Expand Down
9 changes: 9 additions & 0 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,15 @@
app:layout_constraintTop_toBottomOf="@id/toolbar"
android:inputType="text" />

<ProgressBar
android:id="@+id/progress"
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" />

<androidx.recyclerview.widget.RecyclerView
android:id="@+id/app_list"
android:layout_width="match_parent"
Expand Down

0 comments on commit bd137a2

Please sign in to comment.