MaterialChipsInput icon indicating copy to clipboard operation
MaterialChipsInput copied to clipboard

Disabling chipsInput

Open UnchainedKing opened this issue 8 years ago • 6 comments

Good Day! I'd like to disable the chipsInput. Is there any method to do that? Thank you in advance!

UnchainedKing avatar Nov 09 '17 14:11 UnchainedKing

I would like to know this too

ohpoloha avatar Jan 21 '18 07:01 ohpoloha

i agree, is there anyway to do this? i cannot find how to do it.

potter777 avatar Jan 24 '18 05:01 potter777

I want the same! is it possible? I can't find a way.

ernestovega avatar Jan 31 '18 20:01 ernestovega

You can create your own ChipsInput class, and use it in your layout.xml: ` public class MyChipsInput extends ChipsInput {

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

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

@Override
public void onTextChanged(CharSequence text) {}

@Override
public ChipsInputEditText getEditText() {
    ChipsInputEditText editText = new ChipsInputEditText(getContext());
    editText.setHintTextColor(getContext().getResources().getColor(R.color.transparent));
    editText.clearFocus();
    editText.setFocusable(false);
    editText.setFocusableInTouchMode(false);
    return editText;
}

} `

tkrpan avatar Mar 04 '18 11:03 tkrpan

setFocusable doesn't work.

Harsha-Mahadev avatar Mar 07 '18 06:03 Harsha-Mahadev

You can create your own ChipsInput class, and use it in your layout.xml: ` public class MyChipsInput extends ChipsInput {

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

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

@Override
public void onTextChanged(CharSequence text) {}

@Override
public ChipsInputEditText getEditText() {
    ChipsInputEditText editText = new ChipsInputEditText(getContext());
    editText.setHintTextColor(getContext().getResources().getColor(R.color.transparent));
    editText.clearFocus();
    editText.setFocusable(false);
    editText.setFocusableInTouchMode(false);
    return editText;
}

} `

thank you man, its worked for me

jsaman19 avatar Jun 17 '19 11:06 jsaman19