aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTadashi G. Takaoka <takaoka@google.com>2013-05-01 12:20:58 +0900
committerTadashi G. Takaoka <takaoka@google.com>2013-05-01 12:24:36 +0900
commit7b2114a4283ccd90a937b14145c11125824cd1bd (patch)
treed2820b4391e58079319cfbdc654737c998446378
parent019c38060d8479e26895f94e00fa53586ce28a70 (diff)
downloadlatinime-7b2114a4283ccd90a937b14145c11125824cd1bd.tar.gz
latinime-7b2114a4283ccd90a937b14145c11125824cd1bd.tar.xz
latinime-7b2114a4283ccd90a937b14145c11125824cd1bd.zip
Display still image when device can't play welcome video
Note that the still image in this change is a placeholder and must be replaced by final asset. Bug: 8159728 Change-Id: I4f5a28e0af711edacbc87c2ee64508f34f67f0da
-rw-r--r--java/res/layout/setup_welcome_video.xml6
-rw-r--r--java/res/raw/setup_welcome_image.pngbin0 -> 49087 bytes
-rw-r--r--java/src/com/android/inputmethod/latin/setup/SetupActivity.java4
3 files changed, 10 insertions, 0 deletions
diff --git a/java/res/layout/setup_welcome_video.xml b/java/res/layout/setup_welcome_video.xml
index 3cc5f2122..8c04e637e 100644
--- a/java/res/layout/setup_welcome_video.xml
+++ b/java/res/layout/setup_welcome_video.xml
@@ -35,6 +35,12 @@
android:layout_weight="@integer/setup_welcome_video_weight_in_screen"
android:layout_width="0dp"
android:layout_height="wrap_content" />
+ <ImageView
+ android:id="@+id/setup_welcome_image"
+ android:visibility="gone"
+ android:layout_weight="@integer/setup_welcome_video_weight_in_screen"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content" />
<View
android:layout_weight="@integer/setup_welcome_video_right_padding_weight_in_screen"
android:layout_width="0dp"
diff --git a/java/res/raw/setup_welcome_image.png b/java/res/raw/setup_welcome_image.png
new file mode 100644
index 000000000..17e31111f
--- /dev/null
+++ b/java/res/raw/setup_welcome_image.png
Binary files differ
diff --git a/java/src/com/android/inputmethod/latin/setup/SetupActivity.java b/java/src/com/android/inputmethod/latin/setup/SetupActivity.java
index 044180bd6..bf24b11eb 100644
--- a/java/src/com/android/inputmethod/latin/setup/SetupActivity.java
+++ b/java/src/com/android/inputmethod/latin/setup/SetupActivity.java
@@ -30,6 +30,7 @@ import android.util.Log;
import android.view.View;
import android.view.inputmethod.InputMethodInfo;
import android.view.inputmethod.InputMethodManager;
+import android.widget.ImageView;
import android.widget.TextView;
import android.widget.VideoView;
@@ -201,11 +202,14 @@ public final class SetupActivity extends Activity implements View.OnClickListene
mWelcomeVideoView.setBackgroundResource(0);
}
});
+ final ImageView welcomeImageView = (ImageView)findViewById(R.id.setup_welcome_image);
mWelcomeVideoView.setOnErrorListener(new MediaPlayer.OnErrorListener() {
@Override
public boolean onError(final MediaPlayer mp, final int what, final int extra) {
Log.e(TAG, "Playing welcome video causes error: what=" + what + " extra=" + extra);
mWelcomeVideoView.setVisibility(View.GONE);
+ welcomeImageView.setImageResource(R.raw.setup_welcome_image);
+ welcomeImageView.setVisibility(View.VISIBLE);
return true;
}
});