diff options
author | 2013-05-08 08:23:48 +0000 | |
---|---|---|
committer | 2013-05-08 08:23:49 +0000 | |
commit | 6435c80087b1c698e025b7be809d6236fcdd9e64 (patch) | |
tree | dd2e297f6d5921d6ef26f2847179ecd51c5ca35c /java/src | |
parent | f59c4f6840f82892397752b558251eb71f125d3a (diff) | |
parent | 331d256f2127e1145985c273e3bc61c6fad12361 (diff) | |
download | latinime-6435c80087b1c698e025b7be809d6236fcdd9e64.tar.gz latinime-6435c80087b1c698e025b7be809d6236fcdd9e64.tar.xz latinime-6435c80087b1c698e025b7be809d6236fcdd9e64.zip |
Merge "Fix an issue on the transition between the setup and the settings"
Diffstat (limited to 'java/src')
-rw-r--r-- | java/src/com/android/inputmethod/latin/setup/SetupActivity.java | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/java/src/com/android/inputmethod/latin/setup/SetupActivity.java b/java/src/com/android/inputmethod/latin/setup/SetupActivity.java index affe3a348..acb0766f2 100644 --- a/java/src/com/android/inputmethod/latin/setup/SetupActivity.java +++ b/java/src/com/android/inputmethod/latin/setup/SetupActivity.java @@ -190,18 +190,13 @@ public final class SetupActivity extends Activity implements View.OnClickListene .path(Integer.toString(R.raw.setup_welcome_video)) .build(); mWelcomeVideoView = (VideoView)findViewById(R.id.setup_welcome_video); - mWelcomeVideoView.setOnCompletionListener(new MediaPlayer.OnCompletionListener() { - @Override - public void onCompletion(final MediaPlayer mp) { - mp.start(); - } - }); mWelcomeVideoView.setOnPreparedListener(new MediaPlayer.OnPreparedListener() { @Override public void onPrepared(final MediaPlayer mp) { // Now VideoView has been laid-out and ready to play, remove background of it to // reveal the video. mWelcomeVideoView.setBackgroundResource(0); + mp.setLooping(true); } }); final ImageView welcomeImageView = (ImageView)findViewById(R.id.setup_welcome_image); @@ -365,9 +360,14 @@ public final class SetupActivity extends Activity implements View.OnClickListene super.onBackPressed(); } + private static void hideAndStopVideo(final VideoView videoView) { + videoView.stopPlayback(); + videoView.setVisibility(View.INVISIBLE); + } + @Override protected void onPause() { - mWelcomeVideoView.stopPlayback(); + hideAndStopVideo(mWelcomeVideoView); super.onPause(); } @@ -385,11 +385,12 @@ public final class SetupActivity extends Activity implements View.OnClickListene mWelcomeScreen.setVisibility(welcomeScreen ? View.VISIBLE : View.GONE); mSetupScreen.setVisibility(welcomeScreen ? View.GONE: View.VISIBLE); if (welcomeScreen) { + mWelcomeVideoView.setVisibility(View.VISIBLE); mWelcomeVideoView.setVideoURI(mWelcomeVideoUri); mWelcomeVideoView.start(); return; } - mWelcomeVideoView.stopPlayback(); + hideAndStopVideo(mWelcomeVideoView); final boolean isStepActionAlreadyDone = mStepNumber < determineSetupStepNumber(); mSetupStepGroup.enableStep(mStepNumber, isStepActionAlreadyDone); mActionNext.setVisibility(isStepActionAlreadyDone ? View.VISIBLE : View.GONE); |