// Path: app/src/main/java/cheetatech/com/colorhub/defines/BoardEditor.java
// public class BoardEditor {
//     private static BoardEditor ourInstance = null;
//     private Context context = null;
// 
//     public static BoardEditor getInstance()
//     {
//         if(ourInstance == null)
//             ourInstance = new BoardEditor();
//         return ourInstance;
//     }
// 
//     private BoardEditor() {
//     }
// 
//     public Context getContext()
//     {
//         return this.context;
//     }
// 
//     public void setContext(Context context)
//     {
//         this.context = context;
//     }
//     public void copyToClipBoard(String text)
//     {
//         ClipboardManager clipMan = (ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE);
//         ClipData clip = ClipData.newPlainText("text",text);
//         clipMan.setPrimaryClip(clip);
//     }
// }
// 
// Path: app/src/main/java/cheetatech/com/colorhub/listeners/IOnFocusListenable.java
// public interface IOnFocusListenable {
//     void onWindowFocusChanged(boolean hasFocus);
// }


import android.content.ClipboardManager;
import android.content.Context;
import android.graphics.Color;
import android.graphics.Rect;
import android.os.Build;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.util.Log;
import android.view.Display;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.Surface;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import android.widget.RelativeLayout;
import android.widget.SeekBar;
import android.widget.TextView;
import android.widget.Toast;
import java.math.BigInteger;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import cheetatech.com.colorhub.R;
import cheetatech.com.colorhub.defines.BoardEditor;
import cheetatech.com.colorhub.listeners.IOnFocusListenable;
import cheetatech.com.colorhub.listeners.OnItemSelect;
                return true;
            }
        });
        ButterKnife.bind(this,view);
        return view;
    }
    @Override
    public void onActivityCreated(Bundle savedInstanceState)
    {
        super.onActivityCreated(savedInstanceState);
        display = ((WindowManager) getActivity().getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay();

        red = green = blue = 120;
        opacity = 255;

        ClipboardManager clipBoard = (ClipboardManager) getActivity().getSystemService(Context.CLIPBOARD_SERVICE);
        window = getActivity().getWindow();

        seekBarLeft = redSeekBar.getPaddingLeft();
        textViewColor.setTextColor(Color.parseColor(inverseColor(red,green,blue)));

        colorViewLayout.setBackgroundColor(Color.argb(opacity,red, green, blue));

        textViewColor.setText(String.format("#%02x%02x%02x%02x", opacity, red, green, blue));
        textViewColor.setTextColor(Color.parseColor(inverseColor(red,green,blue)));

        textViewColor.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                BoardEditor.getInstance().copyToClipBoard(textViewColor.getText().toString());
// Path: app/src/main/java/cheetatech/com/colorhub/defines/BoardEditor.java
// public class BoardEditor {
//     private static BoardEditor ourInstance = null;
//     private Context context = null;
// 
//     public static BoardEditor getInstance()
//     {
//         if(ourInstance == null)
//             ourInstance = new BoardEditor();
//         return ourInstance;
//     }
// 
//     private BoardEditor() {
//     }
// 
//     public Context getContext()
//     {
//         return this.context;
//     }
// 
//     public void setContext(Context context)
//     {
//         this.context = context;
//     }
//     public void copyToClipBoard(String text)
//     {
//         ClipboardManager clipMan = (ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE);
//         ClipData clip = ClipData.newPlainText("text",text);
//         clipMan.setPrimaryClip(clip);
//     }
// }
// 
// Path: app/src/main/java/cheetatech/com/colorhub/listeners/IOnFocusListenable.java
// public interface IOnFocusListenable {
//     void onWindowFocusChanged(boolean hasFocus);
// }


// Path: app/src/main/java/layout/ColorPicker1.java
import android.content.ClipboardManager;
import android.content.Context;
import android.graphics.Color;
import android.graphics.Rect;
import android.os.Build;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.util.Log;
import android.view.Display;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.Surface;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import android.widget.RelativeLayout;
import android.widget.SeekBar;
import android.widget.TextView;
import android.widget.Toast;
import java.math.BigInteger;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import cheetatech.com.colorhub.R;
import cheetatech.com.colorhub.defines.BoardEditor;
import cheetatech.com.colorhub.listeners.IOnFocusListenable;
import cheetatech.com.colorhub.listeners.OnItemSelect;

                return true;
            }
        });
        ButterKnife.bind(this,view);
        return view;
    }
    @Override
    public void onActivityCreated(Bundle savedInstanceState)
    {
        super.onActivityCreated(savedInstanceState);
        display = ((WindowManager) getActivity().getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay();

        red = green = blue = 120;
        opacity = 255;

        ClipboardManager clipBoard = (ClipboardManager) getActivity().getSystemService(Context.CLIPBOARD_SERVICE);
        window = getActivity().getWindow();

        seekBarLeft = redSeekBar.getPaddingLeft();
        textViewColor.setTextColor(Color.parseColor(inverseColor(red,green,blue)));

        colorViewLayout.setBackgroundColor(Color.argb(opacity,red, green, blue));

        textViewColor.setText(String.format("#%02x%02x%02x%02x", opacity, red, green, blue));
        textViewColor.setTextColor(Color.parseColor(inverseColor(red,green,blue)));

        textViewColor.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                BoardEditor.getInstance().copyToClipBoard(textViewColor.getText().toString());
                Toast.makeText(BoardEditor.getInstance().getContext(), "Color " + textViewColor.getText().toString() +