Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 03fe0cf4 authored by Tadashi G. Takaoka's avatar Tadashi G. Takaoka Committed by Android Git Automerger
Browse files

am 3b892164: am 7b2114a4: Display still image when device can\'t play welcome video

* commit '3b892164':
  Display still image when device can't play welcome video
parents a10c80fe 3b892164
Loading
Loading
Loading
Loading
+6 −0
Original line number Original line Diff line number Diff line
@@ -35,6 +35,12 @@
            android:layout_weight="@integer/setup_welcome_video_weight_in_screen"
            android:layout_weight="@integer/setup_welcome_video_weight_in_screen"
            android:layout_width="0dp"
            android:layout_width="0dp"
            android:layout_height="wrap_content" />
            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
        <View
            android:layout_weight="@integer/setup_welcome_video_right_padding_weight_in_screen"
            android:layout_weight="@integer/setup_welcome_video_right_padding_weight_in_screen"
            android:layout_width="0dp"
            android:layout_width="0dp"
+47.9 KiB
Loading image diff...
+4 −0
Original line number Original line Diff line number Diff line
@@ -30,6 +30,7 @@ import android.util.Log;
import android.view.View;
import android.view.View;
import android.view.inputmethod.InputMethodInfo;
import android.view.inputmethod.InputMethodInfo;
import android.view.inputmethod.InputMethodManager;
import android.view.inputmethod.InputMethodManager;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.TextView;
import android.widget.VideoView;
import android.widget.VideoView;


@@ -201,11 +202,14 @@ public final class SetupActivity extends Activity implements View.OnClickListene
                mWelcomeVideoView.setBackgroundResource(0);
                mWelcomeVideoView.setBackgroundResource(0);
            }
            }
        });
        });
        final ImageView welcomeImageView = (ImageView)findViewById(R.id.setup_welcome_image);
        mWelcomeVideoView.setOnErrorListener(new MediaPlayer.OnErrorListener() {
        mWelcomeVideoView.setOnErrorListener(new MediaPlayer.OnErrorListener() {
            @Override
            @Override
            public boolean onError(final MediaPlayer mp, final int what, final int extra) {
            public boolean onError(final MediaPlayer mp, final int what, final int extra) {
                Log.e(TAG, "Playing welcome video causes error: what=" + what + " extra=" + extra);
                Log.e(TAG, "Playing welcome video causes error: what=" + what + " extra=" + extra);
                mWelcomeVideoView.setVisibility(View.GONE);
                mWelcomeVideoView.setVisibility(View.GONE);
                welcomeImageView.setImageResource(R.raw.setup_welcome_image);
                welcomeImageView.setVisibility(View.VISIBLE);
                return true;
                return true;
            }
            }
        });
        });