Java Code Examples for com.google.android.car.kitchensink.input.InputTestFragment

Following code examples demonstrate how to use com.google.android.car.kitchensink.input.InputTestFragmentfrom android. These examples are extracted from various highly rated open source projects. You can directly use these code snippets or view their entire linked source code. These snippets are extracted to provide contextual information about how to use this class in the real world. These samples also let you understand some good practices on how to use com.google.android.car.kitchensink.input.InputTestFragmentand various code implementation of this class.

        public void onItemClicked(String id) {
            Log.d(TAG, "onItemClicked id=" + id);
            if (id.equals(MENU_AUDIO)) {
                if (mAudioTestFragment == null) {
                    mAudioTestFragment = new AudioTestFragment();
                }
                setContentFragment(mAudioTestFragment);
            } else if (id.equals(MENU_CAMERA)) {
                if (mCameraManager != null) {
                    if (mCameraTestFragment == null) {
                        mCameraTestFragment = new CameraTestFragment();
                        mCameraTestFragment.setCameraManager(mCameraManager);
                    }
                    setContentFragment(mCameraTestFragment);
                }
            } else if (id.equals(MENU_HVAC)) {
                if (mHvacManager != null) {
                    if (mHvacTestFragment == null) {
                        mHvacTestFragment = new HvacTestFragment();
                        mHvacTestFragment.setHvacManager(mHvacManager);
                    }
                    setContentFragment(mHvacTestFragment);
                }
            } else if (id.equals(MENU_JOB)) {
                if (mJobFragment == null) {
                    mJobFragment = new JobSchedulerFragment();
                }
                setContentFragment(mJobFragment);
            } else if (id.equals(MENU_KEYBOARD)) {
                if (mKeyboardFragment == null) {
                    mKeyboardFragment = new KeyboardFragment();
                }
                setContentFragment(mKeyboardFragment);
            } else if (id.equals(MENU_CLUSTER)) {
                if (mInstrumentClusterFragment == null) {
                    mInstrumentClusterFragment = new InstrumentClusterFragment();
                    mInstrumentClusterFragment.setCarNavigationManager(mCarNavigationManager);
                    mInstrumentClusterFragment.setCarAppContextManager(mCarAppContextManager);
                }
                setContentFragment(mInstrumentClusterFragment);
            } else if (id.equals(MENU_INPUT_TEST)) {
                if (mInputTestFragment == null) {
                    mInputTestFragment = new InputTestFragment();
                }
                setContentFragment(mInputTestFragment);
            } else if (id.equals(MENU_QUIT)) {
                finish();
            }
        } 


Advertisement
Javadoc
Test input event handling to system. vehicle hal should have VEHICLE_PROPERTY_HW_KEY_INPUT support f

or this to work.

Read More
Advertisement