Search in sources :

Example 1 with ShadowInputMethodManager

use of org.robolectric.shadows.ShadowInputMethodManager in project android_packages_apps_Settings by omnirom.

the class SetupChooseLockPasswordTest method createActivity_skipButtonInIntroductionStage_shouldBeVisible.

@Test
public void createActivity_skipButtonInIntroductionStage_shouldBeVisible() {
    SetupChooseLockPassword activity = createSetupChooseLockPassword();
    final InputMethodManager inputMethodManager = activity.getSystemService(InputMethodManager.class);
    final ShadowInputMethodManager shadowImm = Shadows.shadowOf(inputMethodManager);
    final PartnerCustomizationLayout layout = activity.findViewById(R.id.setup_wizard_layout);
    final Button skipOrClearButton = layout.getMixin(FooterBarMixin.class).getSecondaryButtonView();
    assertThat(skipOrClearButton).isNotNull();
    assertThat(skipOrClearButton.getVisibility()).isEqualTo(View.VISIBLE);
    skipOrClearButton.performClick();
    final AlertDialog chooserDialog = ShadowAlertDialogCompat.getLatestAlertDialog();
    assertThat(chooserDialog).isNotNull();
    assertThat(shadowImm.isSoftInputVisible()).isFalse();
}
Also used : AlertDialog(androidx.appcompat.app.AlertDialog) PartnerCustomizationLayout(com.google.android.setupcompat.PartnerCustomizationLayout) Button(android.widget.Button) ShadowInputMethodManager(org.robolectric.shadows.ShadowInputMethodManager) FooterBarMixin(com.google.android.setupcompat.template.FooterBarMixin) InputMethodManager(android.view.inputmethod.InputMethodManager) ShadowInputMethodManager(org.robolectric.shadows.ShadowInputMethodManager) Test(org.junit.Test)

Example 2 with ShadowInputMethodManager

use of org.robolectric.shadows.ShadowInputMethodManager in project android_packages_apps_Settings by omnirom.

the class WifiConfigControllerTest method checkImeStatus_whenAdvancedToggled_shouldBeHide.

@Test
public void checkImeStatus_whenAdvancedToggled_shouldBeHide() {
    final InputMethodManager inputMethodManager = mContext.getSystemService(InputMethodManager.class);
    final ShadowInputMethodManager shadowImm = Shadows.shadowOf(inputMethodManager);
    final CheckBox advButton = mView.findViewById(R.id.wifi_advanced_togglebox);
    inputMethodManager.showSoftInput(null, /* view */
    0);
    advButton.performClick();
    assertThat(shadowImm.isSoftInputVisible()).isFalse();
}
Also used : CheckBox(android.widget.CheckBox) ShadowInputMethodManager(org.robolectric.shadows.ShadowInputMethodManager) InputMethodManager(android.view.inputmethod.InputMethodManager) ShadowInputMethodManager(org.robolectric.shadows.ShadowInputMethodManager) Test(org.junit.Test)

Example 3 with ShadowInputMethodManager

use of org.robolectric.shadows.ShadowInputMethodManager in project android_packages_apps_Settings by omnirom.

the class WifiConfigController2Test method checkImeStatus_whenAdvancedToggled_shouldBeHide.

@Test
public void checkImeStatus_whenAdvancedToggled_shouldBeHide() {
    final InputMethodManager inputMethodManager = mContext.getSystemService(InputMethodManager.class);
    final ShadowInputMethodManager shadowImm = Shadows.shadowOf(inputMethodManager);
    final CheckBox advButton = mView.findViewById(R.id.wifi_advanced_togglebox);
    inputMethodManager.showSoftInput(null, /* view */
    0);
    advButton.performClick();
    assertThat(shadowImm.isSoftInputVisible()).isFalse();
}
Also used : CheckBox(android.widget.CheckBox) ShadowInputMethodManager(org.robolectric.shadows.ShadowInputMethodManager) ShadowInputMethodManager(org.robolectric.shadows.ShadowInputMethodManager) InputMethodManager(android.view.inputmethod.InputMethodManager) Test(org.junit.Test)

Aggregations

InputMethodManager (android.view.inputmethod.InputMethodManager)3 Test (org.junit.Test)3 ShadowInputMethodManager (org.robolectric.shadows.ShadowInputMethodManager)3 CheckBox (android.widget.CheckBox)2 Button (android.widget.Button)1 AlertDialog (androidx.appcompat.app.AlertDialog)1 PartnerCustomizationLayout (com.google.android.setupcompat.PartnerCustomizationLayout)1 FooterBarMixin (com.google.android.setupcompat.template.FooterBarMixin)1