项目:Rx_java2_soussidev
文件:VerifyCompacResultHelper.java
public static RxVerifyCompacResult<AppCompatEditText> getFirstBadResultOrSuccess(
List<RxVerifyCompacResult<AppCompatEditText>> results) {
RxVerifyCompacResult<AppCompatEditText> firstBadResult = null;
for (RxVerifyCompacResult<AppCompatEditText> result : results) {
if (!result.isProper()) {
firstBadResult = result;
break;
}
}
if (firstBadResult == null) {
// if there is no bad result,then return first success
return results.get(0);
} else {
return firstBadResult;
}
}
项目:MTweaks-KernelAdiutorMOD
文件:BuildpropFragment.java
@Nullable
@Override
public View onCreateView(LayoutInflater inflater,@Nullable ViewGroup container,@Nullable Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_buildprop_search,container,false);
AppCompatEditText keyEdit = (AppCompatEditText) rootView.findViewById(R.id.key_edittext);
AppCompatEditText valueEdit = (AppCompatEditText) rootView.findViewById(R.id.value_edittext);
keyEdit.addTextChangedListener(mKeyWatcher);
valueEdit.addTextChangedListener(mValueWatcher);
if (mKeyText != null) {
keyEdit.append(mKeyText);
}
if (mValueText != null) {
valueEdit.append(mValueText);
}
mItemsText = (TextView) rootView.findViewById(R.id.found_text);
setCount(mItemsCount);
return rootView;
}
项目:MTweaks-KernelAdiutorMOD
文件:EditorActivity.java
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_editor);
initToolBar();
String title = getIntent().getStringExtra(TITLE_INTENT);
if (title != null) {
getSupportActionBar().setTitle(title);
}
CharSequence text = getIntent().getCharSequenceExtra(TEXT_INTENT);
mEditText = (AppCompatEditText) findViewById(R.id.edittext);
if (text != null) {
mEditText.append(text);
}
}
项目:KernelAdiutor-Mod
文件:BuildpropFragment.java
@Nullable
@Override
public View onCreateView(LayoutInflater inflater,false);
AppCompatEditText keyEdit = (AppCompatEditText) rootView.findViewById(R.id.key_edittext);
AppCompatEditText valueEdit = (AppCompatEditText) rootView.findViewById(R.id.value_edittext);
keyEdit.addTextChangedListener(mKeyWatcher);
valueEdit.addTextChangedListener(mValueWatcher);
if (mKeyText != null) {
keyEdit.append(mKeyText);
}
if (mValueText != null) {
valueEdit.append(mValueText);
}
mItemsText = (TextView) rootView.findViewById(R.id.found_text);
setCount(mItemsCount);
return rootView;
}
项目:KernelAdiutor-Mod
文件:EditorActivity.java
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_editor);
initToolBar();
String title = getIntent().getStringExtra(TITLE_INTENT);
if (title != null) {
getSupportActionBar().setTitle(title);
}
CharSequence text = getIntent().getCharSequenceExtra(TEXT_INTENT);
mEditText = (AppCompatEditText) findViewById(R.id.edittext);
if (text != null) {
mEditText.append(text);
}
}
项目:android-geohash
文件:ConverterFragment.java
@Override
public void onViewCreated(View view,@Nullable Bundle savedInstanceState) {
super.onViewCreated(view,savedInstanceState);
editGeohash = (AppCompatEditText) view.findViewById(R.id.edit_hash);
editLat = (AppCompatEditText) view.findViewById(R.id.edit_lat);
editLon = (AppCompatEditText) view.findViewById(R.id.edit_lon);
textPrecision = (AppCompatTextView) view.findViewById(R.id.text_precision);
seekPrecision = (AppCompatSeekBar) view.findViewById(R.id.seek_precision);
editGeohash.addTextChangedListener(hashTextWatcher);
editLat.addTextChangedListener(locationTextWatcher);
editLon.addTextChangedListener(locationTextWatcher);
seekPrecision.setonSeekBarchangelistener(this);
location = new Location("geohash_example");
textPrecision.setText("Precision: " + 1);
}
项目:OSchina_resources_android
文件:DialogHelper.java
/**
* 获取一个输入对话框
*/
public static AlertDialog.Builder getInputDialog(
Context context,String title,AppCompatEditText editText,String positiveText,String negativeText,boolean cancelable,DialogInterface.OnClickListener positiveListener,DialogInterface.OnClickListener negativeListener) {
return getDialog(context)
.setCancelable(cancelable)
.setTitle(title)
.setView(editText)
.setPositiveButton(positiveText,positiveListener)
.setNegativeButton(negativeText,negativeListener);
}
项目:OSchina_resources_android
文件:DialogHelper.java
public static void setTint(@NonNull EditText editText,@ColorInt int color,boolean useDarker) {
final ColorStateList editTextColorStateList = new ColorStateList(new int[][]{
new int[]{-android.R.attr.state_enabled},new int[]{android.R.attr.state_enabled,-android.R.attr.state_pressed,-android.R.attr.state_focused},new int[]{}
},new int[]{
ContextCompat.getColor(editText.getContext(),useDarker ? R.color.ate_text_disabled_dark : R.color.ate_text_disabled_light),ContextCompat.getColor(editText.getContext(),useDarker ? R.color.ate_control_normal_dark : R.color.ate_control_normal_light),color
});
if (editText instanceof AppCompatEditText) {
((AppCompatEditText) editText).setSupportBackgroundTintList(editTextColorStateList);
} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
editText.setBackgroundTintList(editTextColorStateList);
}
setCursorTint(editText,color);
}
项目:SelectName
文件:SelectActivity.java
private void initView() {
btnSave = (Button) findViewById(R.id.btnSave);
btnSave.setonClickListener(this);
btndel = (Button) findViewById(R.id.btndel);
btndel.setonClickListener(this);
btnupdate = (Button) findViewById(R.id.btnupdate);
btnupdate.setonClickListener(this);
btnQuery = (Button) findViewById(R.id.btnQuery);
btnQuery.setonClickListener(this);
tvTextView = (TextView) findViewById(R.id.tv);
tvTextView.setFocusable(true);
etFirstName = (AppCompatEditText) findViewById(R.id.etFirstName);
etFirstName.setonClickListener(this);
btn_back = (ImageView) findViewById(R.id.btn_back);
btn_back.setonClickListener(this);
}
项目:weixzz-app
文件:NewStatusActivity.java
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.status_add_new);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
toolbar.setTitle("发送微博");
final AppCompatEditText editText = (AppCompatEditText) findViewById(R.id.inputText);
findViewById(R.id.send).setonClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String status = editText.getText().toString();
new UpdateStatusAsync().execute(status);
}
});
}
项目:GestureFun
文件:DeleteOnSwipeEditText.java
protected void init(Context context,AttributeSet attrs) {
setorientation(VERTICAL);
inflate(context,R.layout.layout_delete_on_swipe_edit_text,this);
editText = (AppCompatEditText) getChildAt(0);
//Threshold cannot be bigger than EditText itself
if (attrs != null) {
TypedArray ta = context.obtainStyledAttributes(attrs,R.styleable.DeleteOnSwipeEditText);
setHint(ta.getString(R.styleable.DeleteOnSwipeEditText_android_hint));
int threshold = ta.getInt(R.styleable.DeleteOnSwipeEditText_hrskrs_threshold,INVALID);
if (threshold > MIN_THRESHOLD) {
DEFAULT_THRESHOLD = threshold;
}
int swipeMode = ta.getInt(R.styleable.DeleteOnSwipeEditText_hrskrs_swipe_mode,INVALID);
if (swipeMode == 1) {
DEFAULT_SWIPE = SINGLE_FINGER_SWIPE;
}
ta.recycle();
}
//EditText touch listener
editText.setonTouchListener(this);
}
项目:ProjectTemplate
文件:DialogHelper.java
项目:ProjectTemplate
文件:DialogHelper.java
项目:AidlBestPractice
文件:MainActivity.java
private void showAddDialog() {
View customView = LayoutInflater.from(this).inflate(R.layout.dialog_book_add,null);
final AppCompatEditText editText = ButterKnife.findById(customView,R.id.inputEditText);
materialDialog = new MaterialDialog.Builder(this)
.customView(customView,false)
.positiveColorRes(R.color.positive_color)
.negativeColorRes(R.color.positive_color)
.positiveText(R.string.action_sure)
.negativeText(R.string.action_cancel)
.onPositive(new MaterialDialog.SingleButtonCallback() {
@Override
public void onClick(@NonNull MaterialDialog dialog,@NonNull DialogAction which) {
String name = editText.getText().toString();
addBook(name);
}
})
.build();
materialDialog.show();
}
项目:AidlBestPractice
文件:MainActivity.java
private void showFilterDialog() {
View customView = LayoutInflater.from(this).inflate(R.layout.dialog_book_filter,@NonNull DialogAction which) {
String filter = editText.getText().toString();
filterBookList(filter);
}
})
.build();
materialDialog.show();
}
项目:EasyUtils
文件:TestETBActivity.java
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_edit_text_block);
ButterKnife.bind(this);
mTextBlock.setonUpdateViewListener(new EditTextBlock.UpdateViewListener() {
@Override
public void onRemove(EditTextBlock editTextBlock) {
mLayout.removeView(editTextBlock);
}
@Override
public void onEditTextFocusChange(AppCompatEditText v,boolean hasFocus,EditTextBlock textBlock) {
Snackbar.make(mLayout,"焦点改变",Snackbar.LENGTH_SHORT).show();
}
});
}
项目:ESeal
文件:LoginFragment.java
@Override
public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState) {
// Inflate the layout for this fragment
View view = inflater.inflate(R.layout.fragment_login,false);
loginName = (AppCompatEditText) view.findViewById(R.id.login_name);
loginPassword = (AppCompatEditText) view.findViewById(R.id.login_password);
AppCompatButton signInButton = (AppCompatButton) view.findViewById(R.id.sign_in_button);
signInButton.setonClickListener(__ -> {
if (isInputDataValid()) {
String name = loginName.getText().toString();
String password = loginPassword.getText().toString();
mPresenter.saveUser(name,password);
mPresenter.attemptLogin(name,password,false);
} else {
showInputDataError();
}
});
return view;
}
项目:app-theme-engine-master
文件:TintHelper.java
public static void setTint(@NonNull EditText editText,useDarker ? R.color.ate_disabled_edittext_dark : R.color.ate_disabled_edittext_light),Util.resolveColor(editText.getContext(),R.attr.colorControlnormal),color
});
if (editText instanceof AppCompatEditText) {
((AppCompatEditText) editText).setSupportBackgroundTintList(editTextColorStateList);
} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
editText.setBackgroundTintList(editTextColorStateList);
}
}
private void showEditDialog(TodoItem item) {
View customView = LayoutInflater.from(this).inflate(R.layout.dialog_todo_edit,null);
final AppCompatEditText editText = ButterKnife.findById(customView,R.id.inputEditText);
editText.setText(item.getDescription());
editText.setSelection(item.getDescription().length());
materialDialog = new MaterialDialog.Builder(this)
.customView(customView,false)
.positiveColorRes(R.color.positive_color)
.negativeColorRes(R.color.positive_color)
.positiveText(R.string.action_sure)
.negativeText(R.string.action_cancel)
.onPositive((dialog,which) -> {
String text = editText.getText().toString();
if (!TextUtils.isEmpty(text)) {
actionCreator.createItemEditaction(item.getId(),text,item.isCompleted(),item.isstared());
dialog.dismiss();
}
})
.build();
materialDialog.show();
}
项目:deathly_adiutor_free
文件:MainActivity.java
/**
* Dialog which asks the user to enter his password
*
* @param password current encoded password
*/
private void askPassword(final String password) {
LinearLayout linearLayout = new LinearLayout(this);
linearLayout.setorientation(LinearLayout.VERTICAL);
linearLayout.setGravity(Gravity.CENTER);
linearLayout.setPadding(30,20,30,20);
final AppCompatEditText mPassword = new AppCompatEditText(this);
mPassword.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD);
mPassword.setHint(getString(R.string.password));
linearLayout.addView(mPassword);
new AlertDialog.Builder(this).setView(linearLayout).setCancelable(false)
.setPositiveButton(getString(R.string.ok),new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface,int i) {
if (mPassword.getText().toString().equals(Utils.decodeString(password)))
new Task().execute();
else {
Utils.toast(getString(R.string.password_wrong),MainActivity.this);
finish();
}
}
}).show();
}
项目:KA27
文件:MainActivity.java
/**
* Dialog which asks the user to enter his password
*
* @param password current encoded password
*/
private void askPassword(final String password) {
LinearLayout linearLayout = new LinearLayout(this);
linearLayout.setorientation(LinearLayout.VERTICAL);
linearLayout.setGravity(Gravity.CENTER);
linearLayout.setPadding(30,MainActivity.this);
finish();
}
}
}).show();
}
项目:kernel_adiutor
文件:MainActivity.java
/**
* Dialog which asks the user to enter his password
*
* @param password current encoded password
*/
private void askPassword(final String password) {
LinearLayout linearLayout = new LinearLayout(this);
linearLayout.setorientation(LinearLayout.VERTICAL);
linearLayout.setGravity(Gravity.CENTER);
linearLayout.setPadding(30,MainActivity.this);
finish();
}
}
}).show();
}
项目:nono-android
文件:MarkdownEditText.java
private void addLink(){
AlertDialog.Builder builder=new AlertDialog.Builder(getContext());
final View view= LayoutInflater.from(getContext()).inflate(R.layout.dialog_link,null);
builder.setView(view);
builder.setCancelable(false);
builder.setPositiveButton(getContext().getString(android.R.string.ok),new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog,int which) {
String text=((AppCompatEditText)view.findViewById(R.id.text)).getText().toString().trim();
String link=((AppCompatEditText)view.findViewById(R.id.link)).getText().toString().trim();
if(link.isEmpty()){
return;
}else {
text=text.isEmpty()?"link":text;
addMarkAtCursor("["+text+"]("+link+")");
}
}
});
builder.setNegativeButton(getContext().getString(android.R.string.cancel),null);
builder.show();
}
项目:nono-android
文件:PhotoLayout.java
private void initImgContainer(){
LinearLayout linearLayout=new LinearLayout(getContext());
linearLayout.setorientation(LinearLayout.VERTICAL);
linearLayout.setLayoutParams(new LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,ViewGroup.LayoutParams.WRAP_CONTENT));
imageView=new AppCompatimageView(getContext());
LinearLayout.LayoutParams lp=new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,ViewGroup.LayoutParams.WRAP_CONTENT);
imageView.setLayoutParams(lp);
linearLayout.addView(imageView);
imageView.setonClickListener(this);
editText=new AppCompatEditText(getContext());
linearLayout.addView(editText);
editText.setVisibility(GONE);
editText.setTextAppearance(getContext(),R.style.NoteTextAppearance);
editText.setGravity(Gravity.CENTER);
editText.setonKeyListener(new OnKeyListener() {
@Override
public boolean onKey(View v,int keyCode,KeyEvent event) {
if(keyCode==KeyEvent.KEYCODE_DEL&&editText.getText().toString().isEmpty()){
editText.setVisibility(GONE);
}
return false;
}
});
this.addView(linearLayout);
}
项目:Superuser-UI
文件:TintHelper.java
public static void setTint(@NonNull EditText editText,color);
}
private ArrayList<UniversalButton> getCurrentUniversalButtons() {
ArrayList<UniversalButton> buttons = new ArrayList<>();
for (int i = 0; i < buttonsList.getChildCount(); i++) {
LinearLayout universalButtonLayout = (LinearLayout) buttonsList.getChildAt(i);
LinearLayout nameLayout = (LinearLayout) universalButtonLayout.getChildAt(0);
AppCompatEditText nameEditText = (AppCompatEditText) nameLayout.getChildAt(0);
AppCompatEditText signalEditText = (AppCompatEditText) universalButtonLayout.getChildAt(1);
buttons.add(new UniversalButton(null,nameEditText.getText().toString(),null,signalEditText.getText()
.toString()));
}
return buttons;
}
项目:mage-android
文件:MageNumberControl.java
public MageNumberControl(Context context,AttributeSet attrs,double min,double max) {
super(context,attrs);
this.min = min;
this.max = max;
this.propertyType = MagePropertyType.NUMBER;
AppCompatEditText editText = new AppCompatEditText(context,attrs);
editText.setInputType(InputType.TYPE_CLASS_NUMBER | InputType.TYPE_NUMBER_FLAG_DECIMAL);
editText.addTextChangedListener(this);
addView(editText);
TypedArray typedArray = context.obtainStyledAttributes(attrs,R.styleable.MageFormElement);
setPropertyKey(typedArray.getString(R.styleable.MageFormElement_propertyKey));
setPropertyType(MagePropertyType.getPropertyType(typedArray.getInt(R.styleable.MageFormElement_propertyType,0)));
typedArray.recycle();
}
项目:mage-android
文件:MageSelectView.java
public MageSelectView(Context context,JsonObject jsonObject,Boolean isMultiSelect) {
super(context,attrs);
this.jsonObject = jsonObject;
this.isMultiSelect = isMultiSelect;
AppCompatEditText editText = new AppCompatEditText(context,attrs);
editText.setFocusableInTouchMode(false);
editText.setFocusable(true);
editText.setTextIsSelectable(false);
editText.setCursorVisible(false);
editText.setClickable(false);
editText.addTextChangedListener(this);
addView(editText);
TypedArray typedArray = context.obtainStyledAttributes(attrs,0)));
typedArray.recycle();
}
private void initViewElements(View view) {
cancelButton = (ImageButton) view.findViewById(R.id.applivery_Feedback_cancel_button);
okButton = (ImageButton) view.findViewById(R.id.applivery_Feedback_ok_button);
sendButton = (ImageButton) view.findViewById(R.id.applivery_Feedback_send_button);
FeedbackButton = (LinearLayout) view.findViewById(R.id.applivery_tab_button_selector_Feedback);
bugButton = (LinearLayout) view.findViewById(R.id.applivery_tab_button_selector_bug);
screenshot = (DrawingImageView) view.findViewById(R.id.appliveryScreenShot);
FeedbackImage = (ImageView) view.findViewById(R.id.applivery_Feedback_image);
FeedbackMessage = (AppCompatEditText) view.findViewById(R.id.applivery_Feedback_description);
FeedbackFormContainer = (LinearLayout) view.findViewById(R.id.applivery_Feedback_form);
screenShotSwitch = (SwitchCompat) view.findViewById(R.id.attach_screenshot_switch);
initViewState();
initElementActions();
}
项目:AwesomeSplash
文件:UIUtil.java
public static void hideSoftKeyOutsideET(final Activity a,View view) {
// if the view is not instance of AutoResizeEditText
// i.e. if the user taps outside of the Box
if (!(view instanceof AppCompatEditText)) {
view.setonTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View v,MotionEvent event) {
//hide the keyboard
hideKeyboard(a);
return false;
}
});
}
// If a layout container,iterate over children and seed recursion.
if (view instanceof ViewGroup) {
for (int i = 0; i < ((ViewGroup) view).getChildCount(); i++) {
View innerView = ((ViewGroup) view).getChildAt(i);
hideSoftKeyOutsideET(a,innerView);
}
}
}
项目:FRC-Krawler
文件:EventInfoFragment.java
private AlertDialog buildEditDialog() {
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
AppCompatEditText name = new AppCompatEditText(getActivity());
name.setText(mEvent.getName());
int padding = Util.getPixelsFromDp(getActivity(),16);
name.setPadding(padding,padding,padding);
builder.setView(name);
builder.setTitle("Edit Event");
builder.setPositiveButton("Ok",(dialog,which) -> {
mEvent.setName(name.getText().toString());
mEvent.update();
((BaseActivity) getActivity()).setActionBarSubtitle(mEvent.getName());
});
builder.setNegativeButton("Cancel",null);
return builder.create();
}
项目:4pdaClient-plus
文件:BasePreferencesActivity.java
@Override
public View onCreateView(String name,Context context,AttributeSet attrs) {
// Allow super to try and create a view first
final View result = super.onCreateView(name,context,attrs);
if (result != null) {
return result;
}
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
switch (name) {
case "EditText":
return new AppCompatEditText(this,attrs);
case "Spinner":
return new AppCompatSpinner(this,attrs);
case "CheckBox":
return new AppCompatCheckBox(this,attrs);
case "RadioButton":
return new AppCompaTradioButton(this,attrs);
case "CheckedTextView":
return new AppCompatCheckedTextView(this,attrs);
}
}
return null;
}
项目:KernelAdiutor
文件:EditorActivity.java
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_editor);
initToolBar();
String title = getIntent().getStringExtra(TITLE_INTENT);
if (title != null) {
getSupportActionBar().setTitle(title);
}
CharSequence text = getIntent().getCharSequenceExtra(TEXT_INTENT);
mEditText = (AppCompatEditText) findViewById(R.id.edittext);
if (text != null) {
mEditText.append(text);
}
}
项目:Ansole
文件:Term.java
private void doRenameWindow() {
final AppCompatEditText editText = new AppCompatEditText(this);
editText.setText(getCurrentTermSession().getTitle());
final AlertDialog.Builder b = new AlertDialog.Builder(this);
b.setTitle(R.string.input_window_title);
b.setView(editText);
b.setPositiveButton(android.R.string.yes,new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface arg0,int arg1) {
doChangeWindowTitle(editText.getText().toString());
}
});
b.setNegativeButton(android.R.string.no,null);
b.show();
}
项目:WeatherDoge
文件:OptionsActivity.java
@Nullable
@Override
public View onCreateView(String name,AttributeSet attrs) {
final View result = super.onCreateView(name,attrs);
if (result != null) {
return result;
}
// Provide colorized/tinted widgets on non-Material devices
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
switch (name) {
case "EditText":
return new AppCompatEditText(this,attrs);
}
}
return null;
}
项目:MaterialPreferenceLibrary
文件:EditTextPreference.java
@Override
protected void init(final Context context,final AttributeSet attrs,final int defStyleAttr,final int defStyleRes) {
super.init(context,attrs,defStyleAttr,defStyleRes);
mEditText = new AppCompatEditText(context,attrs);
// Give it an ID so it can be saved/restored
mEditText.setId(android.R.id.edit);
/*
* The preference framework and view framework both have an 'enabled'
* attribute. Most likely,the 'enabled' specified in this XML is for
* the preference framework,but it was also given to the view framework.
* We reset the enabled state.
*/
mEditText.setEnabled(true);
setDialogLayoutResource(R.layout.mpl__edittext_dialog_preference);
}
项目:material-dialogs
文件:MaterialEditTextPreference.java
private void init(Context context,AttributeSet attrs) {
PrefUtil.setLayoutResource(context,this,attrs);
int fallback;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
fallback = DialogUtils.resolveColor(context,android.R.attr.colorAccent);
} else {
fallback = 0;
}
fallback = DialogUtils.resolveColor(context,R.attr.colorAccent,fallback);
color = DialogUtils.resolveColor(context,R.attr.md_widget_color,fallback);
editText = new AppCompatEditText(context,attrs);
// Give it an ID so it can be saved/restored
editText.setId(android.R.id.edit);
editText.setEnabled(true);
}
项目:tiempobus
文件:MainActivity.java
/**
* Cargar al pulsar boton o otra accion
*/
private void accionCargar() {
AppCompatEditText txtPoste = (AppCompatEditText) findViewById(R.id.campo_poste);
try {
int tmpPoste = Integer.parseInt(txtPoste.getText().toString());
if (tmpPoste > 0 && tmpPoste < 9999) {
paradaActual = tmpPoste;
SharedPreferences.Editor editor = preferencias.edit();
editor.putInt("parada_inicio",paradaActual);
editor.commit();
handler.sendEmptyMessageDelayed(MSG_RECARGA,DELAY_RECARGA);
}
} catch (NumberFormatException e) {
// Si no ha metido un numero correcto no hacemos nada
}
}
项目:tiempobus
文件:MainActivity.java
/**
* Pulsar recarga de tiempos
*/
private void recargarTiempos() {
AppCompatEditText txtPoste = (AppCompatEditText) findViewById(R.id.campo_poste);
try {
int tmpPoste = Integer.parseInt(txtPoste.getText().toString());
if (tmpPoste > 0 && tmpPoste < 9999) {
paradaActual = tmpPoste;
handler.sendEmptyMessageDelayed(MSG_RECARGA,DELAY_RECARGA);
}
} catch (NumberFormatException e) {
// No hay numero. Recargar con el ultimo usado
handler.sendEmptyMessageDelayed(MSG_RECARGA,DELAY_RECARGA);
}
}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。