本文整理了Java中android.widget.TextView.getImeOptions()
方法的一些代码示例,展示了TextView.getImeOptions()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。TextView.getImeOptions()
方法的具体详情如下:
包路径:android.widget.TextView
类名称:TextView
方法名:getImeOptions
暂无
代码示例来源:origin: libgdx/libgdx
Dialog createDialog () {
textView = createView(context);
textView.setOnKeyListener(this);
FrameLayout.LayoutParams textBoxLayoutParams = new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT,
FrameLayout.LayoutParams.WRAP_CONTENT, Gravity.BOTTOM);
textView.setLayoutParams(textBoxLayoutParams);
textView.setFocusable(true);
textView.setFocusableInTouchMode(true);
textView.setImeOptions(textView.getImeOptions() | EditorInfo.IME_FLAG_NO_EXTRACT_UI);
final FrameLayout layout = new FrameLayout(context);
ViewGroup.LayoutParams layoutParams = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, 0);
layout.setLayoutParams(layoutParams);
layout.addView(textView);
layout.setOnTouchListener(this);
dialog = new Dialog(context, android.R.style.Theme_Translucent_NoTitleBar_Fullscreen);
dialog.setContentView(layout);
return dialog;
}
代码示例来源:origin: libgdx/libgdx
Dialog createDialog () {
textView = createView(context);
textView.setOnKeyListener(this);
FrameLayout.LayoutParams textBoxLayoutParams = new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT,
FrameLayout.LayoutParams.WRAP_CONTENT, Gravity.BOTTOM);
textView.setLayoutParams(textBoxLayoutParams);
textView.setFocusable(true);
textView.setFocusableInTouchMode(true);
textView.setImeOptions(textView.getImeOptions() | EditorInfo.IME_FLAG_NO_EXTRACT_UI);
final FrameLayout layout = new FrameLayout(context);
ViewGroup.LayoutParams layoutParams = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, 0);
layout.setLayoutParams(layoutParams);
layout.addView(textView);
layout.setOnTouchListener(this);
dialog = new Dialog(context, android.R.style.Theme_Translucent_NoTitleBar_Fullscreen);
dialog.setContentView(layout);
return dialog;
}
代码示例来源:origin: square/assertj-android
public S hasImeOptions(@TextViewImeOptions int options) {
isNotNull();
int actualOptions = actual.getImeOptions();
//noinspection ResourceType
assertThat(actualOptions) //
.overridingErrorMessage("Expected IME options <%s> but was <%s>.",
imeOptionsToString(options), imeOptionsToString(actualOptions)) //
.isEqualTo(options);
return myself;
}
代码示例来源:origin: willowtreeapps/Hyperion-Android
attributes.add(new ViewAttribute<>("ImeOptions", new ImeOptionsValue(view.getImeOptions())));
代码示例来源:origin: com.squareup.assertj/assertj-android
public S hasImeOptions(@TextViewImeOptions int options) {
isNotNull();
int actualOptions = actual.getImeOptions();
//noinspection ResourceType
assertThat(actualOptions) //
.overridingErrorMessage("Expected IME options <%s> but was <%s>.",
imeOptionsToString(options), imeOptionsToString(actualOptions)) //
.isEqualTo(options);
return myself;
}
代码示例来源:origin: braintree/android-card-form
@Test
public void setsIMEActionAsGoForPostalCodeIfCvvAndPostalArePresent() {
mCardForm.cardRequired(true)
.expirationRequired(true)
.cvvRequired(true)
.cardholderName(CardForm.FIELD_REQUIRED)
.postalCodeRequired(true)
.mobileNumberRequired(false)
.mobileNumberExplanation("Make sure SMS is supported")
.setup(mActivity);
assertEquals(EditorInfo.IME_ACTION_NEXT,
((TextView) mCardForm.findViewById(R.id.bt_card_form_expiration)).getImeOptions());
assertEquals(EditorInfo.IME_ACTION_NEXT,
((TextView) mCardForm.findViewById(R.id.bt_card_form_cvv)).getImeOptions());
assertEquals(EditorInfo.IME_ACTION_NEXT,
((TextView) mCardForm.findViewById(R.id.bt_card_form_cardholder_name)).getImeOptions());
assertEquals(EditorInfo.IME_ACTION_GO,
((TextView) mCardForm.findViewById(R.id.bt_card_form_postal_code)).getImeOptions());
}
代码示例来源:origin: braintree/android-card-form
@Test
public void setsIMEActionAsGoForPostalAndNextForExpirationIfCvvIsNotPresent() {
mCardForm.cardRequired(true)
.expirationRequired(true)
.cvvRequired(false)
.cardholderName(CardForm.FIELD_DISABLED)
.postalCodeRequired(true)
.mobileNumberRequired(false)
.mobileNumberExplanation("Make sure SMS is supported")
.setup(mActivity);
assertEquals(EditorInfo.IME_ACTION_NEXT,
((TextView) mCardForm.findViewById(R.id.bt_card_form_expiration)).getImeOptions());
assertEquals(EditorInfo.IME_ACTION_GO,
((TextView) mCardForm.findViewById(R.id.bt_card_form_postal_code)).getImeOptions());
}
代码示例来源:origin: braintree/android-card-form
@Test
public void setsIMEActionAsGoForCvvIfNoOtherFieldsAreRequired() {
mCardForm.cardRequired(true)
.expirationRequired(true)
.cvvRequired(true)
.cardholderName(CardForm.FIELD_DISABLED)
.postalCodeRequired(false)
.mobileNumberRequired(false)
.mobileNumberExplanation("Make sure SMS is supported")
.setup(mActivity);
assertEquals(EditorInfo.IME_ACTION_NEXT,
((TextView) mCardForm.findViewById(R.id.bt_card_form_expiration)).getImeOptions());
assertEquals(EditorInfo.IME_ACTION_GO,
((TextView) mCardForm.findViewById(R.id.bt_card_form_cvv)).getImeOptions());
}
代码示例来源:origin: braintree/android-card-form
@Test
public void repeatedCallsToSetupSetsIMEActionAsGoForPostalCodeIfCvvAndPostalArePresent() {
mCardForm.cardRequired(true)
.expirationRequired(true)
.cvvRequired(false)
.cardholderName(CardForm.FIELD_DISABLED)
.postalCodeRequired(false)
.mobileNumberRequired(false)
.mobileNumberExplanation("Make sure SMS is supported")
.setup(mActivity);
mCardForm.cardRequired(true)
.expirationRequired(true)
.cvvRequired(true)
.cardholderName(CardForm.FIELD_REQUIRED)
.postalCodeRequired(true)
.mobileNumberRequired(false)
.mobileNumberExplanation("Make sure SMS is supported")
.setup(mActivity);
assertEquals(EditorInfo.IME_ACTION_NEXT,
((TextView) mCardForm.findViewById(R.id.bt_card_form_expiration)).getImeOptions());
assertEquals(EditorInfo.IME_ACTION_NEXT,
((TextView) mCardForm.findViewById(R.id.bt_card_form_cvv)).getImeOptions());
assertEquals(EditorInfo.IME_ACTION_NEXT,
((TextView) mCardForm.findViewById(R.id.bt_card_form_cardholder_name)).getImeOptions());
assertEquals(EditorInfo.IME_ACTION_GO,
((TextView) mCardForm.findViewById(R.id.bt_card_form_postal_code)).getImeOptions());
}
代码示例来源:origin: braintree/android-card-form
@Test
public void repeatedCallsToSetupSetsIMEActionAsGoForPostalAndNextForExpirationIfCvvIsNotPresent() {
mCardForm.cardRequired(true)
.expirationRequired(true)
.cvvRequired(true)
.cardholderName(CardForm.FIELD_REQUIRED)
.postalCodeRequired(true)
.mobileNumberRequired(false)
.mobileNumberExplanation("Make sure SMS is supported")
.setup(mActivity);
mCardForm.cardRequired(true)
.expirationRequired(true)
.cvvRequired(false)
.cardholderName(CardForm.FIELD_REQUIRED)
.postalCodeRequired(true)
.mobileNumberRequired(false)
.mobileNumberExplanation("Make sure SMS is supported")
.setup(mActivity);
assertEquals(EditorInfo.IME_ACTION_NEXT,
((TextView) mCardForm.findViewById(R.id.bt_card_form_expiration)).getImeOptions());
assertEquals(EditorInfo.IME_ACTION_NEXT,
((TextView) mCardForm.findViewById(R.id.bt_card_form_cardholder_name)).getImeOptions());
assertEquals(EditorInfo.IME_ACTION_GO,
((TextView) mCardForm.findViewById(R.id.bt_card_form_postal_code)).getImeOptions());
}
代码示例来源:origin: braintree/android-card-form
@Test
public void repeatedCallsToSetupSetsIMEActionAsGoForMobileNumber() {
mCardForm.cardRequired(true)
.expirationRequired(true)
.cvvRequired(true)
.cardholderName(CardForm.FIELD_REQUIRED)
.postalCodeRequired(true)
.mobileNumberRequired(false)
.mobileNumberExplanation("Make sure SMS is supported")
.setup(mActivity);
mCardForm.cardRequired(true)
.expirationRequired(true)
.cvvRequired(true)
.cardholderName(CardForm.FIELD_REQUIRED)
.postalCodeRequired(true)
.mobileNumberRequired(true)
.mobileNumberExplanation("Make sure SMS is supported")
.setup(mActivity);
assertEquals(EditorInfo.IME_ACTION_NEXT,
((TextView) mCardForm.findViewById(R.id.bt_card_form_cardholder_name)).getImeOptions());
assertEquals(EditorInfo.IME_ACTION_NEXT,
((TextView) mCardForm.findViewById(R.id.bt_card_form_postal_code)).getImeOptions());
assertEquals(EditorInfo.IME_ACTION_GO,
((TextView) mCardForm.findViewById(R.id.bt_card_form_mobile_number)).getImeOptions());
}
代码示例来源:origin: braintree/android-card-form
@Test
public void setsIMEActionAsGoForMobileNumber() {
mCardForm.cardRequired(true)
.expirationRequired(true)
.cvvRequired(true)
.cardholderName(CardForm.FIELD_REQUIRED)
.postalCodeRequired(true)
.mobileNumberRequired(true)
.mobileNumberExplanation("Make sure SMS is supported")
.setup(mActivity);
assertEquals(EditorInfo.IME_ACTION_GO,
((TextView) mCardForm.findViewById(R.id.bt_card_form_mobile_number)).getImeOptions());
}
代码示例来源:origin: braintree/android-card-form
@Test
public void setsIMEActionAsGoForExpirationIfNoOtherFieldsRequired() {
mCardForm.cardRequired(true)
.expirationRequired(true)
.cvvRequired(false)
.cardholderName(CardForm.FIELD_DISABLED)
.postalCodeRequired(false)
.mobileNumberRequired(false)
.mobileNumberExplanation("Make sure SMS is supported")
.setup(mActivity);
assertEquals(EditorInfo.IME_ACTION_GO,
((TextView) mCardForm.findViewById(R.id.bt_card_form_expiration)).getImeOptions());
}
代码示例来源:origin: braintree/android-card-form
@Test
public void setsIMEActionAsGoForCardNumberIfNoOtherFieldsAreRequired() {
mCardForm.cardRequired(true)
.expirationRequired(false)
.cvvRequired(false)
.cardholderName(CardForm.FIELD_DISABLED)
.postalCodeRequired(false)
.mobileNumberRequired(false)
.mobileNumberExplanation("Make sure SMS is supported")
.setup(mActivity);
assertEquals(EditorInfo.IME_ACTION_GO,
((TextView) mCardForm.findViewById(R.id.bt_card_form_card_number)).getImeOptions());
}
代码示例来源:origin: braintree/android-card-form
@Test
public void setsIMEActionAsNextForCountryCode() {
mCardForm.cardRequired(true)
.expirationRequired(true)
.cvvRequired(true)
.cardholderName(CardForm.FIELD_REQUIRED)
.postalCodeRequired(true)
.mobileNumberRequired(true)
.mobileNumberExplanation("Make sure SMS is supported")
.setup(mActivity);
assertEquals(EditorInfo.IME_ACTION_NEXT,
((TextView) mCardForm.findViewById(R.id.bt_card_form_country_code)).getImeOptions());
}
代码示例来源:origin: braintree/android-card-form
@Test
public void repeatedCallsToSetupSetsIMEActionAsGoForCvvIfNoOtherFieldsAreRequired() {
mCardForm.cardRequired(true)
.expirationRequired(true)
.cvvRequired(true)
.cardholderName(CardForm.FIELD_REQUIRED)
.postalCodeRequired(true)
.mobileNumberRequired(false)
.mobileNumberExplanation("Make sure SMS is supported")
.setup(mActivity);
mCardForm.cardRequired(true)
.expirationRequired(true)
.cvvRequired(true)
.cardholderName(CardForm.FIELD_DISABLED)
.postalCodeRequired(false)
.mobileNumberRequired(false)
.mobileNumberExplanation("Make sure SMS is supported")
.setup(mActivity);
assertEquals(EditorInfo.IME_ACTION_NEXT,
((TextView) mCardForm.findViewById(R.id.bt_card_form_expiration)).getImeOptions());
assertEquals(EditorInfo.IME_ACTION_GO,
((TextView) mCardForm.findViewById(R.id.bt_card_form_cvv)).getImeOptions());
}
代码示例来源:origin: braintree/android-card-form
((TextView) mCardForm.findViewById(R.id.bt_card_form_card_number)).getImeOptions());
((TextView) mCardForm.findViewById(R.id.bt_card_form_card_number)).getImeOptions());
((TextView) mCardForm.findViewById(R.id.bt_card_form_card_number)).getImeOptions());
((TextView) mCardForm.findViewById(R.id.bt_card_form_card_number)).getImeOptions());
代码示例来源:origin: braintree/android-card-form
((TextView) mCardForm.findViewById(R.id.bt_card_form_cardholder_name)).getImeOptions());
((TextView) mCardForm.findViewById(R.id.bt_card_form_cardholder_name)).getImeOptions());
((TextView) mCardForm.findViewById(R.id.bt_card_form_cardholder_name)).getImeOptions());
((TextView) mCardForm.findViewById(R.id.bt_card_form_cardholder_name)).getImeOptions());
((TextView) mCardForm.findViewById(R.id.bt_card_form_cardholder_name)).getImeOptions());
代码示例来源:origin: braintree/android-card-form
@Test
public void repeatedCallsToSetupSetsIMEActionAsGoForExpirationIfNoOtherFieldsRequired() {
mCardForm.cardRequired(true)
.expirationRequired(true)
.cvvRequired(true)
.cardholderName(CardForm.FIELD_DISABLED)
.postalCodeRequired(false)
.mobileNumberRequired(false)
.mobileNumberExplanation("Make sure SMS is supported")
.setup(mActivity);
mCardForm.cardRequired(true)
.expirationRequired(true)
.cvvRequired(false)
.cardholderName(CardForm.FIELD_DISABLED)
.postalCodeRequired(false)
.mobileNumberRequired(false)
.mobileNumberExplanation("Make sure SMS is supported")
.setup(mActivity);
assertEquals(EditorInfo.IME_ACTION_GO,
((TextView) mCardForm.findViewById(R.id.bt_card_form_expiration)).getImeOptions());
}
代码示例来源:origin: braintree/android-card-form
@Test
public void repeatedCallsToSetupSetsIMEActionAsGoForCardNumberIfNoOtherFieldsAreRequired() {
mCardForm.cardRequired(true)
.expirationRequired(true)
.cvvRequired(false)
.cardholderName(CardForm.FIELD_DISABLED)
.postalCodeRequired(false)
.mobileNumberRequired(false)
.mobileNumberExplanation("Make sure SMS is supported")
.setup(mActivity);
mCardForm.cardRequired(true)
.expirationRequired(false)
.cvvRequired(false)
.cardholderName(CardForm.FIELD_DISABLED)
.postalCodeRequired(false)
.mobileNumberRequired(false)
.mobileNumberExplanation("Make sure SMS is supported")
.setup(mActivity);
assertEquals(EditorInfo.IME_ACTION_GO,
((TextView) mCardForm.findViewById(R.id.bt_card_form_card_number)).getImeOptions());
}
内容来源于网络,如有侵权,请联系作者删除!