在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:AFormChange开源软件地址:https://gitee.com/quanke/AFormChange开源软件介绍:#AFormChange android表单值修改框架
AValidations使用
private TextView tvChange; private EditText editText1; private EditText editText2; private Button button1; private FormHandler formHandler; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); tvChange = (TextView) findViewById(R.id.tv_change); editText1 = (EditText) findViewById(R.id.editText1); editText2 = (EditText) findViewById(R.id.editText2); button1 = (Button) findViewById(R.id.button1); formHandler = new FormHandler(ViewsUtil.getAllEditTexts(this)); //初始化数据和文本改变监听器,必须放在赋值之后 formHandler.initTextAndTextChangedListener(); button1.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { if (formHandler.isTextChange()) {//isTextChange判断是否改变 tvChange.setText("Change"); } else { tvChange.setText("Not Change"); } } }); } Copyright 2014 ken.cai (http://www.shangpuyun.com) Licensed under the Apache License, Version 2.0 (the "License");you may not use this file except in compliance with the License.You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0Unless required by applicable law or agreed to in writing, softwaredistributed under the License is distributed on an "AS IS" BASIS,WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.See the License for the specific language governing permissions andlimitations under the License. |
请发表评论