[Android] Extract hardcoded strings

Geoffrey Métais git at videolan.org
Mon Apr 18 16:52:44 CEST 2016


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Mon Apr 18 16:52:25 2016 +0200| [19fb64cb514c5513604ea85fed30e5c78812a02f] | committer: Geoffrey Métais

Extract hardcoded strings

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

 vlc-android/res/values/strings.xml                                | 2 ++
 .../src/org/videolan/vlc/gui/tv/MediaItemDetailsFragment.java     | 8 ++++----
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/vlc-android/res/values/strings.xml b/vlc-android/res/values/strings.xml
index 892ccdd..22fc1dc 100644
--- a/vlc-android/res/values/strings.xml
+++ b/vlc-android/res/values/strings.xml
@@ -628,6 +628,8 @@
     <string name="list_languages_download_title">Subtitles download languages</string>
     <string name="service_unavailable">Service unavailable</string>
     <string name="downloading_subtitles">Downloading subtitles</string>
+    <string name="browse_folder">Browse folder</string>
+    <string name="listen">Listen</string>
 
     <string-array name="chroma_formats" translatable="false">
         <item>RGB 32-bit</item>
diff --git a/vlc-android/src/org/videolan/vlc/gui/tv/MediaItemDetailsFragment.java b/vlc-android/src/org/videolan/vlc/gui/tv/MediaItemDetailsFragment.java
index 1899e37..9178535 100644
--- a/vlc-android/src/org/videolan/vlc/gui/tv/MediaItemDetailsFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/tv/MediaItemDetailsFragment.java
@@ -156,7 +156,7 @@ public class MediaItemDetailsFragment extends DetailsFragment implements Playbac
                     ? R.drawable.ic_menu_folder_big
                     : R.drawable.ic_menu_network_big));
             detailsOverview.setImageScaleUpAllowed(true);
-            detailsOverview.addAction(new Action(ID_BROWSE, "Browse folder"));
+            detailsOverview.addAction(new Action(ID_BROWSE, getString(R.string.browse_folder)));
             if (mDb.networkFavExists(Uri.parse(mMedia.getLocation())))
                 detailsOverview.addAction(actionDelete);
             else
@@ -170,8 +170,8 @@ public class MediaItemDetailsFragment extends DetailsFragment implements Playbac
             else
                 detailsOverview.setImageBitmap(getActivity(), cover);
 
-            detailsOverview.addAction(new Action(ID_PLAY, "Play"));
-            detailsOverview.addAction(new Action(ID_LISTEN, "Listen"));
+            detailsOverview.addAction(new Action(ID_PLAY, getString(R.string.play)));
+            detailsOverview.addAction(new Action(ID_LISTEN, getString(R.string.listen)));
         } else if (media.getType() == MediaWrapper.TYPE_VIDEO) {
             // Add images and action buttons to the details view
             Bitmap cover = BitmapUtil.getPicture(media);
@@ -182,7 +182,7 @@ public class MediaItemDetailsFragment extends DetailsFragment implements Playbac
 
             detailsOverview.addAction(new Action(ID_PLAY, "Play"));
             if (FileUtils.canWrite(media.getUri()))
-                detailsOverview.addAction(new Action(ID_DL_SUBS, "Download Subtitles"));
+                detailsOverview.addAction(new Action(ID_DL_SUBS, getString(R.string.download_subtitles)));
         }
         mRowsAdapter.add(detailsOverview);
 



More information about the Android mailing list