[Android] Fix chromecast warning dialog and extract string

Geoffrey Métais git at videolan.org
Fri Jan 26 15:16:37 CET 2018


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Mon Jan 22 16:11:35 2018 +0100| [ac67de8e7d663d26589ca668435e8818456886a6] | committer: Geoffrey Métais

Fix chromecast warning dialog and extract string

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

 vlc-android/res/values/strings.xml              | 1 +
 vlc-android/src/org/videolan/vlc/util/Util.java | 4 +++-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/vlc-android/res/values/strings.xml b/vlc-android/res/values/strings.xml
index 231065992..213514ca1 100644
--- a/vlc-android/res/values/strings.xml
+++ b/vlc-android/res/values/strings.xml
@@ -378,6 +378,7 @@
     <string name="casting_quality_medium">Medium</string>
     <string name="casting_quality_low">Low</string>
     <string name="casting_quality_lowcpu">Lowest</string>
+    <string name="cast_performance_warning">Casting this video requires conversion. This conversion can use all the available power and could quickly drain your battery.</string>
 
     <string name="extensions_prefs_category">Extensions</string>
     <string name="extensions_enable_category">Chose extensions to enable</string>
diff --git a/vlc-android/src/org/videolan/vlc/util/Util.java b/vlc-android/src/org/videolan/vlc/util/Util.java
index 5992a7c41..12dfb3900 100644
--- a/vlc-android/src/org/videolan/vlc/util/Util.java
+++ b/vlc-android/src/org/videolan/vlc/util/Util.java
@@ -33,6 +33,7 @@ import org.videolan.libvlc.Dialog;
 import org.videolan.libvlc.util.AndroidUtil;
 import org.videolan.medialibrary.Tools;
 import org.videolan.medialibrary.media.MediaLibraryItem;
+import org.videolan.vlc.R;
 import org.videolan.vlc.VLCApplication;
 
 import java.io.BufferedReader;
@@ -195,7 +196,8 @@ public class Util {
             dialog.dismiss();
             return true;
         } else if ("Performance warning".equals(dialog.getTitle())) {
-            Toast.makeText(VLCApplication.getAppContext(), dialog.getText(), Toast.LENGTH_LONG).show();
+            Toast.makeText(VLCApplication.getAppContext(), R.string.cast_performance_warning, Toast.LENGTH_LONG).show();
+            dialog.postAction(1);
             dialog.dismiss();
             return true;
         }



More information about the Android mailing list