本文整理汇总了Java中android.text.method.DialerKeyListener类的典型用法代码示例。如果您正苦于以下问题:Java DialerKeyListener类的具体用法?Java DialerKeyListener怎么用?Java DialerKeyListener使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DialerKeyListener类属于android.text.method包,在下文中一共展示了DialerKeyListener类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: initButtons
import android.text.method.DialerKeyListener; //导入依赖的package包/类
private void initButtons(View v) {
/*
for (int buttonId : buttonsToAttach) {
attachButtonListener(v, buttonId, false);
}
*/
for (int buttonId : buttonsToLongAttach) {
attachButtonListener(v, buttonId, true);
}
digits.setOnClickListener(this);
digits.setKeyListener(DialerKeyListener.getInstance());
digits.addTextChangedListener(this);
digits.setCursorVisible(false);
afterTextChanged(digits.getText());
}
开发者ID:treasure-lau,项目名称:CSipSimple,代码行数:17,代码来源:DialerFragment.java
示例2: getKeyListenerForType
import android.text.method.DialerKeyListener; //导入依赖的package包/类
/** gets the key listener by type */
private static KeyListener getKeyListenerForType(NumericType type) {
switch (type) {
case DIALPAD:
return new DialerKeyListener();
case INTEGER:
return new DigitsKeyListener();
case SIGNED:
return new DigitsKeyListener(true, false);
case DECIMAL:
return new DigitsKeyListener(true, true);
case NONE:
default:
return null;
}
}
开发者ID:SahilArora92,项目名称:vit-04,代码行数:17,代码来源:TextEntryElement.java
示例3: getKeyListenerForType
import android.text.method.DialerKeyListener; //导入依赖的package包/类
/** gets the key listener by type */
protected static KeyListener getKeyListenerForType(NumericType type) {
switch (type) {
case DIALPAD:
return new DialerKeyListener();
case INTEGER:
return new DigitsKeyListener();
case SIGNED:
return new DigitsKeyListener(true, false);
case DECIMAL:
return new DigitsKeyListener(true, true);
case NONE:
default:
return null;
}
}
开发者ID:SanaMobile,项目名称:sana.mobile,代码行数:17,代码来源:TextEntryElement.java
示例4: createView
import android.text.method.DialerKeyListener; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
protected View createView(Context c) {
et = new EditText(c);
et.setText(answer);
et.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT,
LayoutParams.WRAP_CONTENT));
et.setGravity(Gravity.CENTER_HORIZONTAL);
et.setKeyListener(new DialerKeyListener());
LinearLayout ll = new LinearLayout(c);
ll.setOrientation(LinearLayout.VERTICAL);
ll.addView(et, new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT,
LayoutParams.WRAP_CONTENT));
ll.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,
LayoutParams.WRAP_CONTENT));
//SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(c);
boolean barcodeEnable = true; //sp.getBoolean(Constants.PREFERENCE_BARCODE_ENABLED, false);
if (barcodeEnable) {
barcodeButton = new Button(c);
barcodeButton.setText(c.getResources().getString(
R.string.procedurerunner_scan_id));
barcodeButton.setOnClickListener(this);
barcodeButton.setGravity(Gravity.CENTER_HORIZONTAL);
ll.addView(barcodeButton, new LinearLayout.LayoutParams(
LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));
}
return encapsulateQuestion(c, ll);
}
开发者ID:SahilArora92,项目名称:vit-04,代码行数:34,代码来源:PatientIdElement.java
示例5: createView
import android.text.method.DialerKeyListener; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
protected View createView(Context c) {
et = new EditText(c);
et.setPadding(10,5,10,5);
et.setText(answer);
et.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT,
LayoutParams.WRAP_CONTENT));
et.setGravity(Gravity.CENTER_HORIZONTAL);
et.setKeyListener(new DialerKeyListener());
LinearLayout ll = new LinearLayout(c);
ll.setOrientation(LinearLayout.VERTICAL);
ll.addView(et, new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT,
LayoutParams.WRAP_CONTENT));
ll.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,
LayoutParams.WRAP_CONTENT));
//SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(c);
boolean barcodeEnable = true; //sp.getBoolean(Constants.PREFERENCE_BARCODE_ENABLED, false);
if (barcodeEnable) {
barcodeButton = new Button(c);
barcodeButton.setText(c.getResources().getString(
R.string.procedurerunner_scan_id));
barcodeButton.setOnClickListener(this);
barcodeButton.setGravity(Gravity.CENTER_HORIZONTAL);
ll.addView(barcodeButton, new LinearLayout.LayoutParams(
LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));
}
return encapsulateQuestion(c, ll);
}
开发者ID:SanaMobile,项目名称:sana.mobile,代码行数:35,代码来源:PatientIdElement.java
示例6: setInputType
import android.text.method.DialerKeyListener; //导入依赖的package包/类
private void setInputType(int type, boolean direct) {
final int cls = type & EditorInfo.TYPE_MASK_CLASS;
KeyListener input;
if (cls == EditorInfo.TYPE_CLASS_TEXT) {
boolean autotext = (type & EditorInfo.TYPE_TEXT_FLAG_AUTO_CORRECT) != 0;
TextKeyListener.Capitalize cap;
if ((type & EditorInfo.TYPE_TEXT_FLAG_CAP_CHARACTERS) != 0) {
cap = TextKeyListener.Capitalize.CHARACTERS;
} else if ((type & EditorInfo.TYPE_TEXT_FLAG_CAP_WORDS) != 0) {
cap = TextKeyListener.Capitalize.WORDS;
} else if ((type & EditorInfo.TYPE_TEXT_FLAG_CAP_SENTENCES) != 0) {
cap = TextKeyListener.Capitalize.SENTENCES;
} else {
cap = TextKeyListener.Capitalize.NONE;
}
input = TextKeyListener.getInstance(autotext, cap);
} else if (cls == EditorInfo.TYPE_CLASS_NUMBER) {
input = DigitsKeyListener.getInstance(
(type & EditorInfo.TYPE_NUMBER_FLAG_SIGNED) != 0,
(type & EditorInfo.TYPE_NUMBER_FLAG_DECIMAL) != 0);
} else if (cls == EditorInfo.TYPE_CLASS_DATETIME) {
switch (type & EditorInfo.TYPE_MASK_VARIATION) {
case EditorInfo.TYPE_DATETIME_VARIATION_DATE:
input = DateKeyListener.getInstance();
break;
case EditorInfo.TYPE_DATETIME_VARIATION_TIME:
input = TimeKeyListener.getInstance();
break;
default:
input = DateTimeKeyListener.getInstance();
break;
}
} else if (cls == EditorInfo.TYPE_CLASS_PHONE) {
input = DialerKeyListener.getInstance();
} else {
input = TextKeyListener.getInstance();
}
setRawInputType(type);
if (direct) {
createEditorIfNeeded();
mEditor.mKeyListener = input;
} else {
setKeyListenerOnly(input);
}
}
开发者ID:AungThiha,项目名称:Tada,代码行数:46,代码来源:TextView.java
示例7: setInputType
import android.text.method.DialerKeyListener; //导入依赖的package包/类
private void setInputType(int type, boolean direct) {
final int cls = type & EditorInfo.TYPE_MASK_CLASS;
KeyListener input;
if (cls == EditorInfo.TYPE_CLASS_TEXT) {
boolean autotext = (type & EditorInfo.TYPE_TEXT_FLAG_AUTO_CORRECT) != 0;
TextKeyListener.Capitalize cap;
if ((type & EditorInfo.TYPE_TEXT_FLAG_CAP_CHARACTERS) != 0) {
cap = TextKeyListener.Capitalize.CHARACTERS;
} else if ((type & EditorInfo.TYPE_TEXT_FLAG_CAP_WORDS) != 0) {
cap = TextKeyListener.Capitalize.WORDS;
} else if ((type & EditorInfo.TYPE_TEXT_FLAG_CAP_SENTENCES) != 0) {
cap = TextKeyListener.Capitalize.SENTENCES;
} else {
cap = TextKeyListener.Capitalize.NONE;
}
input = JotaTextKeyListener.getInstance(autotext, cap);
} else if (cls == EditorInfo.TYPE_CLASS_NUMBER) {
input = DigitsKeyListener.getInstance(
(type & EditorInfo.TYPE_NUMBER_FLAG_SIGNED) != 0,
(type & EditorInfo.TYPE_NUMBER_FLAG_DECIMAL) != 0);
} else if (cls == EditorInfo.TYPE_CLASS_DATETIME) {
switch (type & EditorInfo.TYPE_MASK_VARIATION) {
case EditorInfo.TYPE_DATETIME_VARIATION_DATE:
input = DateKeyListener.getInstance();
break;
case EditorInfo.TYPE_DATETIME_VARIATION_TIME:
input = TimeKeyListener.getInstance();
break;
default:
input = DateTimeKeyListener.getInstance();
break;
}
} else if (cls == EditorInfo.TYPE_CLASS_PHONE) {
input = DialerKeyListener.getInstance();
} else {
input = JotaTextKeyListener.getInstance();
}
setRawInputType(type);
if (direct) mInput = input;
else {
setKeyListenerOnly(input);
}
}
开发者ID:jiro-aqua,项目名称:JotaTextEditor,代码行数:44,代码来源:TextView.java
示例8: setEditTextOptions
import android.text.method.DialerKeyListener; //导入依赖的package包/类
@Override
protected void setEditTextOptions() {
text.setImeOptions(InputType.TYPE_CLASS_PHONE | EditorInfo.IME_ACTION_NEXT);
text.setKeyListener(new DialerKeyListener());
}
开发者ID:Polidea,项目名称:android-menu-navigator,代码行数:6,代码来源:PhoneNumberFragment.java
注:本文中的android.text.method.DialerKeyListener类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论