|
@ -192,7 +192,12 @@ public class PostsRecyclerView extends RecyclerView { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private void initSelf() { |
|
|
private void initSelf() { |
|
|
|
|
|
try { |
|
|
mediaViewModel = new ViewModelProvider(viewModelStoreOwner).get(MediaViewModel.class); |
|
|
mediaViewModel = new ViewModelProvider(viewModelStoreOwner).get(MediaViewModel.class); |
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
|
Log.e(TAG, "initSelf: ", e); |
|
|
|
|
|
} |
|
|
|
|
|
if (mediaViewModel == null) return; |
|
|
mediaViewModel.getList().observe(lifeCycleOwner, list -> { |
|
|
mediaViewModel.getList().observe(lifeCycleOwner, list -> { |
|
|
if (list.size() <= 0) return; |
|
|
if (list.size() <= 0) return; |
|
|
feedAdapter.submitList(list, () -> { |
|
|
feedAdapter.submitList(list, () -> { |
|
|