[Android] Set observable string field to MediaLibraryItem

Geoffrey Métais git at videolan.org
Tue Nov 29 18:50:47 CET 2016


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Tue Nov 29 18:48:51 2016 +0100| [661f445e0a9d82ea85bfd23fb5d5a071478456e2] | committer: Geoffrey Métais

Set observable string field to MediaLibraryItem

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

 medialibrary/build.gradle                                            | 4 ++++
 .../src/org/videolan/medialibrary/media/MediaLibraryItem.java        | 5 +++--
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/medialibrary/build.gradle b/medialibrary/build.gradle
index d015a45..b802327 100644
--- a/medialibrary/build.gradle
+++ b/medialibrary/build.gradle
@@ -46,6 +46,10 @@ android {
             proguardFile 'proguard.cfg'
         }
     }
+
+    dataBinding {
+        enabled = true
+    }
 }
 
 dependencies {
diff --git a/medialibrary/src/org/videolan/medialibrary/media/MediaLibraryItem.java b/medialibrary/src/org/videolan/medialibrary/media/MediaLibraryItem.java
index 04bf381..91f48fa 100644
--- a/medialibrary/src/org/videolan/medialibrary/media/MediaLibraryItem.java
+++ b/medialibrary/src/org/videolan/medialibrary/media/MediaLibraryItem.java
@@ -1,5 +1,6 @@
 package org.videolan.medialibrary.media;
 
+import android.databinding.ObservableField;
 import android.os.Parcel;
 import android.os.Parcelable;
 
@@ -21,8 +22,8 @@ public abstract class MediaLibraryItem implements Parcelable {
     public abstract int getItemType();
 
     long mId;
-    protected String mTitle;
-    protected String mDescription;
+    protected String mTitle, mDescription;
+    public ObservableField<String> observableDescription = null;
 
     protected MediaLibraryItem() {}
 



More information about the Android mailing list