pchmn / MaterialChipsInput

Implementation of Material Design Chips component for Android
Apache License 2.0
2.63k stars 382 forks source link

com.pchmn.materialchips.ChipsInput.setEnable(false) does not work android #115

Open kiranNanda opened 6 years ago

kiranNanda commented 6 years ago

com.pchmn.materialchips.ChipsInput.setEnable(false) does not work android

jurestanic2 commented 5 years ago

I've solved this problem by creating my own ChipsInput class that extends ChipsInput. Just override getEditText and setEnabled methods. You can then use your new class in XML files just like the original one. Here is my example :

public class MyChipsInput extends ChipsInput {

private ChipsInputEditText editText;

public MyChipsInput(Context context) {
    super(context);
}

public MyChipsInput(Context context, AttributeSet attrs) {
    super(context, attrs);
}

@Override
public ChipsInputEditText getEditText() {
    editText = new ChipsInputEditText(getContext());
    return editText;
}

@Override
public void setEnabled(boolean b){
    editText.setEnabled(b);
}

}

FaridBen95 commented 4 years ago

@jurestanic it's not working could explain more ?