package com.example.memosystem.activity.listen;

import android.text.Editable;
import android.text.TextWatcher;
import android.widget.EditText;

import com.example.memosystem.R;

public class ChangeListen implements TextWatcher {

    private  EditText ed=null;

    public  ChangeListen(EditText ed){
        this.ed=ed;
    }


    @Override
    public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {

    }

    @Override
    public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {

    }

    @Override
    public void afterTextChanged(Editable editable) {

        if(editable.length()>0){

            ed.setCompoundDrawablesRelativeWithIntrinsicBounds(0,0,R.drawable.x,0);
        }else{
            ed.setCompoundDrawablesRelativeWithIntrinsicBounds(0,0,0,0);
        }
    }
}
