Example usage for android.view KeyEvent KEYCODE_MUSIC

List of usage examples for android.view KeyEvent KEYCODE_MUSIC

Introduction

In this page you can find the example usage for android.view KeyEvent KEYCODE_MUSIC.

Prototype

int KEYCODE_MUSIC

To view the source code for android.view KeyEvent KEYCODE_MUSIC.

Click Source Link

Document

Key code constant: Music special function key.

Usage

From source file:com.google.android.car.kitchensink.input.InputTestFragment.java

@Nullable
@Override//  w  w  w . j a v  a 2 s. c  om
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container,
        @Nullable Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.input_test, container, false);

    Collections.addAll(mButtons, BREAK_LINE, createButton(R.string.home, KeyEvent.KEYCODE_HOME),
            createButton(R.string.volume_up, KeyEvent.KEYCODE_VOLUME_UP),
            createButton(R.string.volume_down, KeyEvent.KEYCODE_VOLUME_DOWN),
            createButton(R.string.volume_mute, KeyEvent.KEYCODE_VOLUME_MUTE),
            createButton(R.string.voice, KeyEvent.KEYCODE_VOICE_ASSIST), BREAK_LINE,
            createButton(R.string.music, KeyEvent.KEYCODE_MUSIC),
            createButton(R.string.music_play, KeyEvent.KEYCODE_MEDIA_PLAY),
            createButton(R.string.music_stop, KeyEvent.KEYCODE_MEDIA_STOP),
            createButton(R.string.next_song, KeyEvent.KEYCODE_MEDIA_NEXT),
            createButton(R.string.prev_song, KeyEvent.KEYCODE_MEDIA_PREVIOUS),
            createButton(R.string.tune_right, KeyEvent.KEYCODE_CHANNEL_UP),
            createButton(R.string.tune_left, KeyEvent.KEYCODE_CHANNEL_DOWN), BREAK_LINE,
            createButton(R.string.call_send, KeyEvent.KEYCODE_CALL),
            createButton(R.string.call_end, KeyEvent.KEYCODE_ENDCALL));

    mCarEmulator = CarEmulator.create(getContext());
    addButtonsToPanel((LinearLayout) view.findViewById(R.id.input_buttons), mButtons);

    return view;
}