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

Commit 26ce68c0 authored by Fan Zhang's avatar Fan Zhang
Browse files

Hide video preference when video is not avaiable.

Change-Id: Ic4efc21d41b328591f2146534b7edecd86cb83ac
Fix: 35855399
Test: manual
parent e0b65fce
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -62,6 +62,7 @@ public class VideoPreference extends Preference {
                    .build();
            mMediaPlayer = MediaPlayer.create(mContext, mVideoPath);
            if (mMediaPlayer != null && mMediaPlayer.getDuration() > 0) {
                setVisible(true);
                setLayoutResource(R.layout.video_preference);

                mPreviewResource = attributes.getResourceId(
@@ -71,6 +72,8 @@ public class VideoPreference extends Preference {

                mMediaPlayer.setOnPreparedListener(mediaPlayer -> mediaPlayer.setLooping(true));
                mAnimationAvailable = true;
            } else {
                setVisible(false);
            }
        } catch (Exception e) {
            Log.w(TAG, "Animation resource not found. Will not show animation.");