Skip to content

Commit

Permalink
Add toast and loading indicator
Browse files Browse the repository at this point in the history
  • Loading branch information
wateralsie committed Aug 10, 2024
1 parent a4e997c commit fcdc6be
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ import androidx.recyclerview.widget.LinearLayoutManager
import dagger.hilt.android.AndroidEntryPoint
import `in`.koreatech.koin.R
import `in`.koreatech.koin.core.activity.ActivityBase
import `in`.koreatech.koin.core.toast.ToastUtil
import `in`.koreatech.koin.databinding.ActivityDiningNoticeBinding
import `in`.koreatech.koin.ui.dining.adapter.DiningNoticeAdapter
import `in`.koreatech.koin.ui.dining.viewmodel.DiningNoticeViewModel
import `in`.koreatech.koin.util.ext.observeLiveData
import `in`.koreatech.koin.util.ext.withLoading

@AndroidEntryPoint
class DiningNoticeActivity : ActivityBase() {
Expand All @@ -37,6 +39,8 @@ class DiningNoticeActivity : ActivityBase() {

initView()
initViewModel()

withLoading(this, viewModel)
}

private fun initView() {
Expand Down Expand Up @@ -64,5 +68,8 @@ class DiningNoticeActivity : ActivityBase() {
}
diningNoticeAdapter.submitList(it.opens)
}
observeLiveData(toastErrorMessage) {
ToastUtil.getInstance().makeShort(it)
}
}
}

0 comments on commit fcdc6be

Please sign in to comment.