Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

is there any way to disable this materialchipsinput view? #20

Open
chnouman opened this issue May 11, 2017 · 3 comments
Open

is there any way to disable this materialchipsinput view? #20

chnouman opened this issue May 11, 2017 · 3 comments

Comments

@chnouman
Copy link

i'm having difficulty in disabling this view i also tried to diable parent view still it is not working.

@mstup
Copy link

mstup commented May 15, 2017

Hi,

I personally used such hack.

final RecyclerView recyclerView = (RecyclerView) chipsInput.findViewById(R.id.chips_recycler);
recyclerView.addOnChildAttachStateChangeListener(new RecyclerView.OnChildAttachStateChangeListener(){
	
	public void onChildViewAttachedToWindow(View view) {
		View v = recyclerView.getLayoutManager().findViewByPosition(tagsInput.getFilterableList().size()+1);
		if (v != null && v.getVisibility() == View.VISIBLE && v instanceof ChipsInputEditText) {
			ChipsInputEditText editor = (ChipsInputEditText) v;
			editor.setFocusable(false);
			editor.setVisibility(View.GONE);
		} else {
			if (view instanceof ChipsInputEditText) {
				ChipsInputEditText editor = (ChipsInputEditText) view;
				editor.setFocusable(false);
				editor.setVisibility(View.GONE);
			}
		}
	}
	
	public void onChildViewDetachedFromWindow(View view) {}
});

@pchmn
Copy link
Owner

pchmn commented May 18, 2017

I will test it as well.
Sorry for the late response

@chnouman
Copy link
Author

its ok plz test it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants