// Path: materialAppBaseLibrary/src/main/java/com/daililol/material/appbase/utility/Converter.java
// public class Converter {
// 	
// 	public static int dp2px(Context context, float dp){
// 		return (int)(dp * context.getResources().getDisplayMetrics().density);
// 	}
// 
// 	public static int px2dp(Context context, float px){
// 		return (int)(px / context.getResources().getDisplayMetrics().density);
// 	}
// }
// 
// Path: materialAppBaseLibrary/src/main/java/com/daililol/material/appbase/utility/DeviceUtil.java
// public class DeviceUtil {
// 	
// 	public static Point getScreenSize(Context context){
// 		Point size = new Point();
// 		DisplayMetrics display = context.getResources().getDisplayMetrics();
// 		size.x = display.widthPixels;
// 		size.y = display.heightPixels;
// 
// 		return size;
// 	}
// 
// 	/**
// 	 * Return pseudo unique ID
// 	 * @return ID
// 	 */
// 	public static String getUniquePsuedoID() {
// 
// 		String m_szDevIDShort = "35" + (Build.BOARD.length() % 10)
// 				+ (Build.BRAND.length() % 10)
// 				+ (Build.CPU_ABI.length() % 10)
// 				+ (Build.DEVICE.length() % 10)
// 				+ (Build.MANUFACTURER.length() % 10)
// 				+ (Build.MODEL.length() % 10)
// 				+ (Build.PRODUCT.length() % 10);
// 
// 		String serial = null;
// 		try {
// 			serial = android.os.Build.class.getField("SERIAL").get(null).toString();
// 			return new UUID(m_szDevIDShort.hashCode(), serial.hashCode()).toString();
// 		} catch (Exception exception) {
// 			// String needs to be initialized
// 			serial = "serial"; // some value
// 		}
// 
// 		return new UUID(m_szDevIDShort.hashCode(), serial.hashCode()).toString();
// 	}
// 
// }


import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.Gravity;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.daililol.material.appbase.utility.Converter;
import com.daililol.material.appbase.utility.DeviceUtil;
import java.util.Vector;
        textView.setId(android.R.id.text1);


        RecyclerView.LayoutParams layoutParams =
                new RecyclerView.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, Converter.dp2px(itemView.getContext(), 56));

        itemView.setPadding(Converter.dp2px(itemView.getContext(), 16), 0,
                Converter.dp2px(itemView.getContext(), 16), 0);
        itemView.setGravity(Gravity.LEFT | Gravity.START | Gravity.CENTER);
        itemView.setBackgroundResource(R.drawable.touch_feedback_holo_light);
        itemView.addView(textView);
        itemView.setLayoutParams(layoutParams);
        if (this.layoutManager instanceof GridLayoutManager){
            calculateGridItemSize(itemView);
        }

        return new ViewHolder(itemView);
    }

    @Override
    public void onBindViewHolder(ViewHolder holder, int position) {
        holder.textView.setText(listItems.get(position));
    }

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

    private int calculateGridItemSize(View itemView){
// Path: materialAppBaseLibrary/src/main/java/com/daililol/material/appbase/utility/Converter.java
// public class Converter {
// 	
// 	public static int dp2px(Context context, float dp){
// 		return (int)(dp * context.getResources().getDisplayMetrics().density);
// 	}
// 
// 	public static int px2dp(Context context, float px){
// 		return (int)(px / context.getResources().getDisplayMetrics().density);
// 	}
// }
// 
// Path: materialAppBaseLibrary/src/main/java/com/daililol/material/appbase/utility/DeviceUtil.java
// public class DeviceUtil {
// 	
// 	public static Point getScreenSize(Context context){
// 		Point size = new Point();
// 		DisplayMetrics display = context.getResources().getDisplayMetrics();
// 		size.x = display.widthPixels;
// 		size.y = display.heightPixels;
// 
// 		return size;
// 	}
// 
// 	/**
// 	 * Return pseudo unique ID
// 	 * @return ID
// 	 */
// 	public static String getUniquePsuedoID() {
// 
// 		String m_szDevIDShort = "35" + (Build.BOARD.length() % 10)
// 				+ (Build.BRAND.length() % 10)
// 				+ (Build.CPU_ABI.length() % 10)
// 				+ (Build.DEVICE.length() % 10)
// 				+ (Build.MANUFACTURER.length() % 10)
// 				+ (Build.MODEL.length() % 10)
// 				+ (Build.PRODUCT.length() % 10);
// 
// 		String serial = null;
// 		try {
// 			serial = android.os.Build.class.getField("SERIAL").get(null).toString();
// 			return new UUID(m_szDevIDShort.hashCode(), serial.hashCode()).toString();
// 		} catch (Exception exception) {
// 			// String needs to be initialized
// 			serial = "serial"; // some value
// 		}
// 
// 		return new UUID(m_szDevIDShort.hashCode(), serial.hashCode()).toString();
// 	}
// 
// }


// Path: app/src/main/java/com/daililol/material/appbase/example/ExampleRecyclerViewAdapter.java
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.Gravity;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.daililol.material.appbase.utility.Converter;
import com.daililol.material.appbase.utility.DeviceUtil;
import java.util.Vector;

        textView.setId(android.R.id.text1);


        RecyclerView.LayoutParams layoutParams =
                new RecyclerView.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, Converter.dp2px(itemView.getContext(), 56));

        itemView.setPadding(Converter.dp2px(itemView.getContext(), 16), 0,
                Converter.dp2px(itemView.getContext(), 16), 0);
        itemView.setGravity(Gravity.LEFT | Gravity.START | Gravity.CENTER);
        itemView.setBackgroundResource(R.drawable.touch_feedback_holo_light);
        itemView.addView(textView);
        itemView.setLayoutParams(layoutParams);
        if (this.layoutManager instanceof GridLayoutManager){
            calculateGridItemSize(itemView);
        }

        return new ViewHolder(itemView);
    }

    @Override
    public void onBindViewHolder(ViewHolder holder, int position) {
        holder.textView.setText(listItems.get(position));
    }

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

    private int calculateGridItemSize(View itemView){
        int size = (DeviceUtil.getScreenSize(itemView.getContext()).x - Converter.dp2px(itemView.getContext(), 20)) / 2;