老套路,先看效果图
直接上代码:
package com.xiayiye.shopcarnumberadd.view;
import android.content.Context;
import android.text.Editable;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.util.AttributeSet;
import android.view.View;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;
import com.xiayiye.shopcarnumberadd.R;
/**
* @author Dell
*/
public class CustomizeGoodsAddView extends LinearLayout implements View.OnClickListener, TextWatcher {
private int value = 1;
private int minValue = 1;
private int maxValue = 10;
private EditText mCountET;
private Context mContext;
public CustomizeGoodsAddView(Context context) {
super(context);
init(context);
}
public CustomizeGoodsAddView(Context context, AttributeSet attrs) {
super(context, attrs);
init(context);
}
private void init(Context context) {
mContext = context;
View view = View.inflate(context, R.layout.number_adder_layout, this);
Te