<?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android" > <item android:state_focused="true" android:drawable="@drawable/et_focus"/> <item android:state_focused="false" android:drawable="@drawable/et_unfocus"/> </selector>
<?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" > <corners android:radius="2dp"/> <stroke android:width="1px" android:color="#f85355" /> </shape>
<?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" > <corners android:radius="2dp"/> <stroke android:width="1px" android:color="#c9caca" /> </shape>
<?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android" > <item android:state_enabled="true" android:drawable="@drawable/btn_enable"/> <item android:state_enabled="false" android:drawable="@drawable/btn_unenable"/> </selector>
<?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" > <corners android:radius="5dp"/> <solid android:color="#f85355"/> </shape>
<?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" > <corners android:radius="5dp"/> <solid android:color="#c9caca"/> </shape>
<?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android" > <item android:state_checked="true" android:drawable="@drawable/icon_shopping_selected"/> <item android:state_checked="false" android:drawable="@drawable/icon_shopping_unselected"/> </selector>
<CheckBox
android:id="@+id/cb"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:checked="true"
android:button="@null"
android:drawableLeft="@drawable/cb_agree"
android:padding="20dp" />
<CheckBox
android:id="@+id/cb"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:checked="true"
android:button="@drawable/cb_agree"
android:padding="20dp"
android:background="#00ff00"/>
public class StateListDrawableActivity extends Activity{
private TextView mSubmit;
private EditText mPhoneView;
private EditText mPassword;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_state_list_drawable);
mPhoneView = (EditText) findViewById(R.id.et_phone);
mPassword = (EditText) findViewById(R.id.et_password);
BaseTextWatcher watcher = new BaseTextWatcher();
watcher.addEditText(mPhoneView,mPassword);
mSubmit = (TextView) findViewById(R.id.tv_state_list_drawable);
}
class BaseTextWatcher implements TextWatcher{
private ArrayList<EditText> list = new ArrayList<EditText>();
public void addEditText(EditText...ets){
for(int i=0;i<ets.length;i++){
ets[i].addTextChangedListener(this);
list.add(ets[i]);
}
}
@Override
public void beforeTextChanged(CharSequence s, int start, int count,
int after) {
// TODO Auto-generated method stub
}
@Override
public void onTextChanged(CharSequence s, int start, int before,
int count) {
// TODO Auto-generated method stub
}
@Override
public void afterTextChanged(Editable s) {
for(EditText et:list){
String text = et.getText().toString().trim();
if(TextUtils.isEmpty(text)){
return;
}
}
mSubmit.setEnabled(true);
}
}
}
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有