[Android] TV: Update items to show parsing results

Geoffrey Métais git at videolan.org
Thu Feb 7 15:26:10 CET 2019


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Thu Feb  7 11:46:25 2019 +0100| [d14b4bd4490143b4c78c7300466df40868a09ece] | committer: Geoffrey Métais

TV: Update items to show parsing results

> https://code.videolan.org/videolan/vlc-android/commit/d14b4bd4490143b4c78c7300466df40868a09ece
---

 .../org/videolan/vlc/gui/tv/browser/DirectoryBrowserFragment.java  | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/vlc-android/src/org/videolan/vlc/gui/tv/browser/DirectoryBrowserFragment.java b/vlc-android/src/org/videolan/vlc/gui/tv/browser/DirectoryBrowserFragment.java
index c66dcaf3c..693062752 100644
--- a/vlc-android/src/org/videolan/vlc/gui/tv/browser/DirectoryBrowserFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/tv/browser/DirectoryBrowserFragment.java
@@ -45,6 +45,7 @@ import androidx.leanback.widget.Row;
 import androidx.leanback.widget.RowPresenter;
 import androidx.lifecycle.Observer;
 import androidx.lifecycle.ViewModelProviders;
+import kotlin.Pair;
 
 @TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1)
 public class DirectoryBrowserFragment extends MediaSortedFragment<BrowserModel> {
@@ -74,6 +75,12 @@ public class DirectoryBrowserFragment extends MediaSortedFragment<BrowserModel>
                 }
             }
         });
+         viewModel.getDescriptionUpdate().observe(this, new Observer<Pair<Integer, String>>() {
+             @Override
+             public void onChanged(Pair<Integer, String> pair) {
+                 if (pair != null) getAdapter().notifyItemRangeChanged(0, getAdapter().size());
+             }
+         });
     }
 
     @Override



More information about the Android mailing list