Add progress for vod

pull/137/head
FongMi 4 years ago
parent 91b00e9548
commit ca4725dd5e
  1. 4
      app/src/leanback/java/com/fongmi/android/tv/ui/fragment/VodFragment.java
  2. 5
      app/src/leanback/res/layout/fragment_vod.xml

@ -77,9 +77,10 @@ public class VodFragment extends BaseFragment implements CustomScroller.Callback
@Override
protected void initView() {
mFilters = Filter.arrayFrom(getFilter());
mTypeIds = new ArrayList<>();
mExtend = new HashMap<>();
mFilters = Filter.arrayFrom(getFilter());
mBinding.progressLayout.showProgress();
setRecyclerView();
setViewModel();
getVideo();
@ -100,6 +101,7 @@ public class VodFragment extends BaseFragment implements CustomScroller.Callback
mViewModel = new ViewModelProvider(this).get(SiteViewModel.class);
mViewModel.result.observe(getViewLifecycleOwner(), result -> {
mScroller.endLoading(result.getList().isEmpty());
mBinding.progressLayout.showContent();
addVideo(result.getList());
checkPage();
});

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
<com.fongmi.android.tv.ui.custom.ProgressLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/progressLayout"
android:layout_width="match_parent"
android:layout_height="match_parent">
@ -17,4 +18,4 @@
app:focusOutEnd="true"
app:focusOutFront="true" />
</FrameLayout>
</com.fongmi.android.tv.ui.custom.ProgressLayout>
Loading…
Cancel
Save