use of android.app.PictureInPictureArgs in project K6nele by Kaljurand.
the class AbstractRecognizerIntentActivity method getPictureInPictureArgs.
@TargetApi(26)
private PictureInPictureArgs getPictureInPictureArgs() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N_MR1) {
Intent thisIntent = getIntent();
ArrayList<RemoteAction> actions = new ArrayList<>();
// Action to start recognition
actions.add(new RemoteAction(Icon.createWithResource(this, R.drawable.ic_voice_search_api_material), "Recognize", "Tap & Speak", PendingIntent.getActivity(this, 10, thisIntent, 0)));
// Action to go to the settings
actions.add(new RemoteAction(Icon.createWithResource(this, R.drawable.ic_settings_24dp), "Settings", "Settings", PendingIntent.getActivity(this, 11, new Intent(getApplicationContext(), Preferences.class), 0)));
PictureInPictureArgs mPictureInPictureArgs = new PictureInPictureArgs();
mPictureInPictureArgs.setActions(actions);
return mPictureInPictureArgs;
}
return null;
}
Aggregations