// Path: app/src/main/java/com/livingstoneapp/helpers/RecyclerViewOnClickListener.java
// public interface RecyclerViewOnClickListener<T> {
//     void onItemClick(T item);
// }
// 
// Path: app/src/main/java/com/livingstoneapp/helpers/RecyclerViewOnClickListenerInternal.java
// public interface RecyclerViewOnClickListenerInternal {
//     void onItemClick(int position);
// }
// 
// Path: app/src/main/java/com/livingstoneapp/models/RequestedPermission.java
// public class RequestedPermission {
//     private String mName;
//     private boolean mGranted;
// 
//     public RequestedPermission(String mName, boolean mGranted) {
//         this.mGranted = mGranted;
//         this.mName = mName;
//     }
// 
//     public boolean isGranted() {
//         return mGranted;
//     }
// 
//     public String getName() {
//         return mName;
//     }
// }


import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import java.util.List;
import butterknife.Bind;
import butterknife.ButterKnife;
import com.livingstoneapp.R;
import com.livingstoneapp.helpers.RecyclerViewOnClickListener;
import com.livingstoneapp.helpers.RecyclerViewOnClickListenerInternal;
import com.livingstoneapp.models.RequestedPermission;
                new ViewHolder(
                        LayoutInflater.from(parent.getContext())
                                .inflate(R.layout.requested_permissions_adapter_layout, parent, false),
                        position -> {
                            if (mListener != null) {
                                mListener.onItemClick(mData.get(position));
                            }
                        });
    }

    @Override
    public void onBindViewHolder(ViewHolder holder, int position) {
        holder.tvName.setText(mData.get(position).getName());

        if (mData.get(position).isGranted()) {
            holder.tvGrantedHeader.setVisibility(View.VISIBLE);
            holder.tvDeniedHeader.setVisibility(View.GONE);
        } else {
            holder.tvGrantedHeader.setVisibility(View.GONE);
            holder.tvDeniedHeader.setVisibility(View.VISIBLE);
        }
    }

    @Override
    public int getItemCount() {
        return mData.size();
    }

    public static class ViewHolder extends RecyclerView.ViewHolder {

// Path: app/src/main/java/com/livingstoneapp/helpers/RecyclerViewOnClickListener.java
// public interface RecyclerViewOnClickListener<T> {
//     void onItemClick(T item);
// }
// 
// Path: app/src/main/java/com/livingstoneapp/helpers/RecyclerViewOnClickListenerInternal.java
// public interface RecyclerViewOnClickListenerInternal {
//     void onItemClick(int position);
// }
// 
// Path: app/src/main/java/com/livingstoneapp/models/RequestedPermission.java
// public class RequestedPermission {
//     private String mName;
//     private boolean mGranted;
// 
//     public RequestedPermission(String mName, boolean mGranted) {
//         this.mGranted = mGranted;
//         this.mName = mName;
//     }
// 
//     public boolean isGranted() {
//         return mGranted;
//     }
// 
//     public String getName() {
//         return mName;
//     }
// }


// Path: app/src/main/java/com/livingstoneapp/adapters/RequestedPermissionsAdapter.java
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import java.util.List;
import butterknife.Bind;
import butterknife.ButterKnife;
import com.livingstoneapp.R;
import com.livingstoneapp.helpers.RecyclerViewOnClickListener;
import com.livingstoneapp.helpers.RecyclerViewOnClickListenerInternal;
import com.livingstoneapp.models.RequestedPermission;

                new ViewHolder(
                        LayoutInflater.from(parent.getContext())
                                .inflate(R.layout.requested_permissions_adapter_layout, parent, false),
                        position -> {
                            if (mListener != null) {
                                mListener.onItemClick(mData.get(position));
                            }
                        });
    }

    @Override
    public void onBindViewHolder(ViewHolder holder, int position) {
        holder.tvName.setText(mData.get(position).getName());

        if (mData.get(position).isGranted()) {
            holder.tvGrantedHeader.setVisibility(View.VISIBLE);
            holder.tvDeniedHeader.setVisibility(View.GONE);
        } else {
            holder.tvGrantedHeader.setVisibility(View.GONE);
            holder.tvDeniedHeader.setVisibility(View.VISIBLE);
        }
    }

    @Override
    public int getItemCount() {
        return mData.size();
    }

    public static class ViewHolder extends RecyclerView.ViewHolder {

        private RecyclerViewOnClickListenerInternal mListener;