mardi 26 janvier 2016

disabling edittext android using if else in view holder

Please help me in succeeding my nightmare regarding on how to disable the editext using viewholder or other way on how to do it using if and else statement ,

I do have a recycler view and it lists all names and their messages. (Messenger be like). Somehow the recycler view is consist of name ,message and a small tag textview “customer closed” if they will going to click the recycler view that consist of tag “customer closed” they will not be able to send messages because its already closed. Otherwise all recycler view that consist of a tag “customer closed” it’s editext is set in to false.

this.customerclosed = (TextView) itemView.findViewById(R.id.customer_closed);
        this.customerclosed.setVisibility(customerInfo.isClosed() ? View.GONE : View.VISIBLE);
        this.message_editext = (EditText)itemView.findViewById(R.id.message_editext);



        if(customerInfo.isClosed){

            message_editext.setEnabled(false);
        }

Aucun commentaire:

Enregistrer un commentaire