// Path: slyce-messaging/src/main/java/it/slyce/messaging/message/MessageSource.java
// public enum MessageSource {
//     LOCAL_USER,
//     EXTERNAL_USER,
//     GENERAL
// }
// 
// Path: slyce-messaging/src/main/java/it/slyce/messaging/message/messageItem/MessageItemType.java
// public enum MessageItemType {
//     INCOMING_MEDIA,
//     INCOMING_TEXT,
//     OUTGOING_MEDIA,
//     OUTGOING_TEXT,
//     SPINNER,
//     GENERAL_TEXT,
//     GENERAL_OPTIONS;
// 
//     public static final MessageItemType values[] = values();
// }
// 
// Path: slyce-messaging/src/main/java/it/slyce/messaging/message/messageItem/MessageViewHolder.java
// public class MessageViewHolder extends RecyclerView.ViewHolder {
//     public ImageView avatar;
//     public TextView initials;
//     public TextView timestamp;
//     public ViewGroup avatarContainer;
//     public CustomSettings customSettings;
// 
//     public MessageViewHolder(View itemView, CustomSettings customSettings) {
//         super(itemView);
//         this.customSettings = customSettings;
//     }
// }


import android.content.Context;
import android.graphics.Color;
import android.graphics.PorterDuff;
import android.support.v4.content.ContextCompat;
import android.view.View;
import android.widget.Button;
import it.slyce.messaging.R;
import it.slyce.messaging.message.GeneralOptionsMessage;
import it.slyce.messaging.message.MessageSource;
import it.slyce.messaging.message.messageItem.MessageItem;
import it.slyce.messaging.message.messageItem.MessageItemType;
import it.slyce.messaging.message.messageItem.MessageViewHolder;
                String option = generalTextMessage.getOptions()[i];
                Button button = new Button(context);
                button.setText(option);
                button.getBackground().setColorFilter(ContextCompat.getColor(context, R.color.background_gray_light), PorterDuff.Mode.MULTIPLY);
                button.setTextColor(Color.BLUE);
                final int finalI = i;
                button.setOnClickListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View view) {
                        viewHolder.optionsLinearLayout.removeAllViews();
                        generalTextMessage.setSelected();
                        String text = generalTextMessage.getOnOptionSelectedListener().onOptionSelected(finalI);
                        viewHolder.titleTextView.setText(text);
                    }
                });
                viewHolder.optionsLinearLayout.addView(button);
            }
        } else {
            viewHolder.titleTextView.setText(generalTextMessage.getFinalText());
            viewHolder.optionsLinearLayout.removeAllViews();
        }
    }

    @Override
    public MessageItemType getMessageItemType() {
        return MessageItemType.GENERAL_OPTIONS;
    }

    @Override
    public MessageSource getMessageSource() {
// Path: slyce-messaging/src/main/java/it/slyce/messaging/message/MessageSource.java
// public enum MessageSource {
//     LOCAL_USER,
//     EXTERNAL_USER,
//     GENERAL
// }
// 
// Path: slyce-messaging/src/main/java/it/slyce/messaging/message/messageItem/MessageItemType.java
// public enum MessageItemType {
//     INCOMING_MEDIA,
//     INCOMING_TEXT,
//     OUTGOING_MEDIA,
//     OUTGOING_TEXT,
//     SPINNER,
//     GENERAL_TEXT,
//     GENERAL_OPTIONS;
// 
//     public static final MessageItemType values[] = values();
// }
// 
// Path: slyce-messaging/src/main/java/it/slyce/messaging/message/messageItem/MessageViewHolder.java
// public class MessageViewHolder extends RecyclerView.ViewHolder {
//     public ImageView avatar;
//     public TextView initials;
//     public TextView timestamp;
//     public ViewGroup avatarContainer;
//     public CustomSettings customSettings;
// 
//     public MessageViewHolder(View itemView, CustomSettings customSettings) {
//         super(itemView);
//         this.customSettings = customSettings;
//     }
// }


// Path: slyce-messaging/src/main/java/it/slyce/messaging/message/messageItem/general/generalOptions/MessageGeneralOptionsItem.java
import android.content.Context;
import android.graphics.Color;
import android.graphics.PorterDuff;
import android.support.v4.content.ContextCompat;
import android.view.View;
import android.widget.Button;
import it.slyce.messaging.R;
import it.slyce.messaging.message.GeneralOptionsMessage;
import it.slyce.messaging.message.MessageSource;
import it.slyce.messaging.message.messageItem.MessageItem;
import it.slyce.messaging.message.messageItem.MessageItemType;
import it.slyce.messaging.message.messageItem.MessageViewHolder;

                String option = generalTextMessage.getOptions()[i];
                Button button = new Button(context);
                button.setText(option);
                button.getBackground().setColorFilter(ContextCompat.getColor(context, R.color.background_gray_light), PorterDuff.Mode.MULTIPLY);
                button.setTextColor(Color.BLUE);
                final int finalI = i;
                button.setOnClickListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View view) {
                        viewHolder.optionsLinearLayout.removeAllViews();
                        generalTextMessage.setSelected();
                        String text = generalTextMessage.getOnOptionSelectedListener().onOptionSelected(finalI);
                        viewHolder.titleTextView.setText(text);
                    }
                });
                viewHolder.optionsLinearLayout.addView(button);
            }
        } else {
            viewHolder.titleTextView.setText(generalTextMessage.getFinalText());
            viewHolder.optionsLinearLayout.removeAllViews();
        }
    }

    @Override
    public MessageItemType getMessageItemType() {
        return MessageItemType.GENERAL_OPTIONS;
    }

    @Override
    public MessageSource getMessageSource() {
        return MessageSource.GENERAL;