mirror of
https://github.com/Julow/Unexpected-Keyboard.git
synced 2025-06-24 03:31:26 +02:00
launcher: Remove intro video when not supported
Previously, this would trigger an error popup and make the activity unresponsive.
This commit is contained in:
parent
c524caa6f1
commit
409362ddb4
@ -48,7 +48,7 @@ public class LauncherActivity extends Activity
|
|||||||
imm.showInputMethodPicker();
|
imm.showInputMethodPicker();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void setup_intro_video(VideoView v)
|
static void setup_intro_video(final VideoView v)
|
||||||
{
|
{
|
||||||
if (VERSION.SDK_INT >= 26)
|
if (VERSION.SDK_INT >= 26)
|
||||||
v.setAudioFocusRequest(AudioManager.AUDIOFOCUS_NONE);
|
v.setAudioFocusRequest(AudioManager.AUDIOFOCUS_NONE);
|
||||||
@ -57,10 +57,21 @@ public class LauncherActivity extends Activity
|
|||||||
v.setOnPreparedListener(new MediaPlayer.OnPreparedListener()
|
v.setOnPreparedListener(new MediaPlayer.OnPreparedListener()
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
public void onPrepared(MediaPlayer mp) {
|
public void onPrepared(MediaPlayer mp)
|
||||||
|
{
|
||||||
mp.setLooping(true);
|
mp.setLooping(true);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
v.setOnErrorListener(new MediaPlayer.OnErrorListener()
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public boolean onError(MediaPlayer mp, int what, int extra)
|
||||||
|
{
|
||||||
|
v.stopPlayback();
|
||||||
|
v.setVisibility(View.GONE);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
});
|
||||||
v.start();
|
v.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user