[Android] VideoPlayerActivity: add a loading text

Edward Wang git at videolan.org
Thu Mar 27 15:04:08 CET 2014


vlc-ports/android | branch: master | Edward Wang <edward.c.wang at compdigitec.com> | Thu Mar 27 09:53:21 2014 -0400| [d432117e8c8708a83bb686be18325d283fccd704] | committer: Edward Wang

VideoPlayerActivity: add a loading text

Complement to 2e3ea4d8cb37b705363fd2065e32a9a287ef9d89

> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=d432117e8c8708a83bb686be18325d283fccd704
---

 vlc-android/res/layout/player.xml                             |    9 +++++++++
 .../src/org/videolan/vlc/gui/video/VideoPlayerActivity.java   |    8 +++++++-
 2 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/vlc-android/res/layout/player.xml b/vlc-android/res/layout/player.xml
index cad86d7..1d8fba2 100644
--- a/vlc-android/res/layout/player.xml
+++ b/vlc-android/res/layout/player.xml
@@ -53,6 +53,15 @@
             android:src="@drawable/icon" />
 
         <TextView
+            android:id="@+id/player_overlay_loading_text"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_below="@+id/player_overlay_loading"
+            android:layout_centerHorizontal="true"
+            android:textSize="20sp"
+            android:text="@string/please_wait" />
+
+        <TextView
             android:id="@+id/player_overlay_info"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
diff --git a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
index 490f996..b2783ee 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
@@ -1,7 +1,7 @@
 /*****************************************************************************
  * VideoPlayerActivity.java
  *****************************************************************************
- * Copyright © 2011-2013 VLC authors and VideoLAN
+ * Copyright © 2011-2014 VLC authors and VideoLAN
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -158,6 +158,7 @@ public class VideoPlayerActivity extends Activity implements IVideoPlayer {
     private TextView mLength;
     private TextView mInfo;
     private ImageView mLoading;
+    private TextView mLoadingText;
     private ImageButton mPlayPause;
     private ImageButton mBackward;
     private ImageButton mForward;
@@ -312,9 +313,12 @@ public class VideoPlayerActivity extends Activity implements IVideoPlayer {
         mSeekbar = (SeekBar) findViewById(R.id.player_overlay_seekbar);
         mSeekbar.setOnSeekBarChangeListener(mSeekListener);
 
+        /* Loading view */
         mLoading = (ImageView) findViewById(R.id.player_overlay_loading);
+        mLoadingText = (TextView) findViewById(R.id.player_overlay_loading_text);
         startLoadingAnimation();
 
+        /* Services and miscellaneous */
         mAudioManager = (AudioManager) getSystemService(AUDIO_SERVICE);
         mAudioMax = mAudioManager.getStreamMaxVolume(AudioManager.STREAM_MUSIC);
 
@@ -2064,6 +2068,7 @@ public class VideoPlayerActivity extends Activity implements IVideoPlayer {
         rotate.setRepeatCount(RotateAnimation.INFINITE);
         anim.addAnimation(rotate);
         mLoading.startAnimation(anim);
+        mLoadingText.setVisibility(View.VISIBLE);
     }
 
     /**
@@ -2072,5 +2077,6 @@ public class VideoPlayerActivity extends Activity implements IVideoPlayer {
     private void stopLoadingAnimation() {
         mLoading.setVisibility(View.INVISIBLE);
         mLoading.clearAnimation();
+        mLoadingText.setVisibility(View.GONE);
     }
 }



More information about the Android mailing list