├── .gitignore ├── .idea ├── .name ├── compiler.xml ├── copyright │ └── profiles_settings.xml ├── encodings.xml ├── gradle.xml ├── misc.xml ├── modules.xml ├── scopes │ └── scope_settings.xml └── vcs.xml ├── MaterialColorPicker.iml ├── README.md ├── app ├── .gitignore ├── app.iml ├── build.gradle ├── manifest-merger-release-report.txt ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── anjithsasindran │ │ └── materialcolorpicker │ │ └── ApplicationTest.java │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── com │ │ └── anjithsasindran │ │ └── materialcolorpicker │ │ └── ColorPickerActivity.java │ └── res │ ├── drawable-hdpi │ ├── blue_thumb_default.png │ ├── blue_thumb_pressed.png │ ├── green_thumb_default.png │ ├── green_thumb_pressed.png │ ├── ic_launcher.png │ ├── red_thumb_default.png │ └── red_thumb_pressed.png │ ├── drawable-mdpi │ ├── blue_thumb_default.png │ ├── blue_thumb_pressed.png │ ├── green_thumb_default.png │ ├── green_thumb_pressed.png │ ├── ic_launcher.png │ ├── red_thumb_default.png │ └── red_thumb_pressed.png │ ├── drawable-xhdpi │ ├── blue_thumb_default.png │ ├── blue_thumb_pressed.png │ ├── green_thumb_default.png │ ├── green_thumb_pressed.png │ ├── ic_launcher.png │ ├── red_thumb_default.png │ └── red_thumb_pressed.png │ ├── drawable-xxhdpi │ ├── blue_thumb_default.png │ ├── blue_thumb_pressed.png │ ├── green_thumb_default.png │ ├── green_thumb_pressed.png │ ├── ic_launcher.png │ ├── red_thumb_default.png │ └── red_thumb_pressed.png │ ├── drawable-xxxhdpi │ └── ic_launcher.png │ ├── drawable │ ├── about_16.xml │ ├── about_button.xml │ ├── blue_progress.xml │ ├── blue_thumb_drawable.xml │ ├── color_button.xml │ ├── color_button_16.xml │ ├── green_progress.xml │ ├── green_thumb_drawable.xml │ ├── red_progress.xml │ └── red_thumb_drawable.xml │ ├── layout-land │ ├── layout_16.xml │ └── layout_color_picker.xml │ ├── layout │ ├── dialog.xml │ ├── dialog_16.xml │ ├── layout_16.xml │ └── layout_color_picker.xml │ ├── menu │ └── menu_color_picker.xml │ ├── values-v19 │ └── styles.xml │ ├── values-v21 │ └── styles.xml │ ├── values-w820dp │ └── dimens.xml │ └── values │ ├── colors.xml │ ├── dimens.xml │ ├── strings.xml │ └── styles.xml ├── build.gradle ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── screenshots ├── about.jpg ├── main.jpg └── main_land.jpg └── settings.gradle /.gitignore: -------------------------------------------------------------------------------- 1 | .gradle 2 | /local.properties 3 | /.idea/workspace.xml 4 | /.idea/libraries 5 | .DS_Store 6 | /build 7 | -------------------------------------------------------------------------------- /.idea/.name: -------------------------------------------------------------------------------- 1 | MaterialColorPicker -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 39 | 40 | 41 | 42 | 43 | 44 | 51 | 52 | 65 | 66 | 67 | 85 | 92 | 93 | 94 | 102 | 103 | 105 | 106 | localhost 107 | 5050 108 | 109 | 110 | 111 | 112 | 113 | 114 | 1.8 115 | 116 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/scopes/scope_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /MaterialColorPicker.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Material Color Picker [![Google Play](http://developer.android.com/images/brand/en_generic_rgb_wo_45.png)](https://play.google.com/store/apps/details?id=com.anjithsasindran.materialcolorpicker) 2 | A simple, minimalistic and beautiful color picker for Android 4.1+ devices. App is intended for Web Designers and Developers, who works with colors. 3 | 4 | Features 5 | - Get Hex & RGB color codes 6 | - Set color using RGB values and get HEX codes 7 | - Uses Android Lollipop's setStatusBarColor() to set color of status bar (Notification bar) which changes with change in color palette 8 | - Separate UI for portrait and landscape devices 9 | - Support for pre-lollipop devices 10 | 11 | Download the app from playstore: [Material Color Picker](https://play.google.com/store/apps/details?id=com.anjithsasindran.materialcolorpicker) 12 | 13 | Design inspired from [Dribbble](https://dribbble.com/shots/1858968-Material-Design-colorpicker?list=following&offset=4) by [Lucas Bonomi](http://lucasbonomi.com/) 14 | 15 | Portrait 16 | 17 | ![portrait](/screenshots/main.jpg) 18 | 19 | Landscape 20 | 21 | ![landscape](/screenshots/main_land.jpg) 22 | 23 | #### Author 24 | **Anjith Sasindran** 25 | - https://twitter.com/anjithsasindran 26 | - https://instagram.com/anjithsasindran/ 27 | - https://github.com/4k3R 28 | -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /app/app.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 8 | 9 | 10 | 11 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 21 5 | buildToolsVersion "21.1.2" 6 | 7 | defaultConfig { 8 | applicationId "com.anjithsasindran.materialcolorpicker" 9 | minSdkVersion 16 10 | targetSdkVersion 21 11 | versionCode 3 12 | versionName "1.5.1" 13 | } 14 | buildTypes { 15 | release { 16 | minifyEnabled false 17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 18 | } 19 | } 20 | } 21 | 22 | dependencies { 23 | compile fileTree(dir: 'libs', include: ['*.jar']) 24 | compile 'com.android.support:appcompat-v7:21.0.3' 25 | compile 'com.afollestad:material-dialogs:0.6.2.3' 26 | compile 'com.wefika:flowlayout:0.3.0' 27 | compile "com.mixpanel.android:mixpanel-android:4.5.3" 28 | compile "com.google.android.gms:play-services:6.5.87" 29 | } 30 | -------------------------------------------------------------------------------- /app/manifest-merger-release-report.txt: -------------------------------------------------------------------------------- 1 | -- Merging decision tree log --- 2 | manifest 3 | ADDED from AndroidManifest.xml:2:1 4 | package 5 | ADDED from AndroidManifest.xml:3:5 6 | INJECTED from AndroidManifest.xml:0:0 7 | INJECTED from AndroidManifest.xml:0:0 8 | android:versionName 9 | INJECTED from AndroidManifest.xml:0:0 10 | INJECTED from AndroidManifest.xml:0:0 11 | xmlns:android 12 | ADDED from AndroidManifest.xml:2:11 13 | android:versionCode 14 | INJECTED from AndroidManifest.xml:0:0 15 | INJECTED from AndroidManifest.xml:0:0 16 | uses-permission#android.permission.INTERNET 17 | ADDED from AndroidManifest.xml:9:9 18 | MERGED from com.mixpanel.android:mixpanel-android:4.5.3:17:5 19 | android:name 20 | ADDED from AndroidManifest.xml:10:13 21 | uses-permission#android.permission.ACCESS_NETWORK_STATE 22 | ADDED from AndroidManifest.xml:15:9 23 | android:name 24 | ADDED from AndroidManifest.xml:16:13 25 | application 26 | ADDED from AndroidManifest.xml:18:5 27 | MERGED from com.android.support:appcompat-v7:21.0.3:16:5 28 | MERGED from com.android.support:support-v4:21.0.3:16:5 29 | MERGED from com.afollestad:material-dialogs:0.6.2.3:12:5 30 | MERGED from com.android.support:appcompat-v7:21.0.3:16:5 31 | MERGED from com.android.support:support-v4:21.0.3:16:5 32 | MERGED from com.wefika:flowlayout:0.3.0:5:5 33 | MERGED from com.mixpanel.android:mixpanel-android:4.5.3:44:5 34 | MERGED from com.google.android.gms:play-services:6.5.87:20:5 35 | MERGED from com.android.support:support-v4:21.0.3:16:5 36 | android:label 37 | ADDED from AndroidManifest.xml:21:9 38 | tools:ignore 39 | ADDED from com.mixpanel.android:mixpanel-android:4.5.3:44:18 40 | android:allowBackup 41 | ADDED from AndroidManifest.xml:19:9 42 | android:icon 43 | ADDED from AndroidManifest.xml:20:9 44 | android:theme 45 | ADDED from AndroidManifest.xml:22:9 46 | activity#com.anjithsasindran.materialcolorpicker.ColorPickerActivity 47 | ADDED from AndroidManifest.xml:23:9 48 | android:label 49 | ADDED from AndroidManifest.xml:25:13 50 | android:name 51 | ADDED from AndroidManifest.xml:24:13 52 | intent-filter#android.intent.action.MAIN+android.intent.category.LAUNCHER 53 | ADDED from AndroidManifest.xml:26:13 54 | action#android.intent.action.MAIN 55 | ADDED from AndroidManifest.xml:27:17 56 | android:name 57 | ADDED from AndroidManifest.xml:27:25 58 | category#android.intent.category.LAUNCHER 59 | ADDED from AndroidManifest.xml:29:17 60 | android:name 61 | ADDED from AndroidManifest.xml:29:27 62 | uses-sdk 63 | INJECTED from AndroidManifest.xml:0:0 reason: use-sdk injection requested 64 | MERGED from com.android.support:appcompat-v7:21.0.3:15:5 65 | MERGED from com.android.support:support-v4:21.0.3:15:5 66 | MERGED from com.afollestad:material-dialogs:0.6.2.3:8:5 67 | MERGED from com.android.support:appcompat-v7:21.0.3:15:5 68 | MERGED from com.android.support:support-v4:21.0.3:15:5 69 | MERGED from com.wefika:flowlayout:0.3.0:3:5 70 | MERGED from com.mixpanel.android:mixpanel-android:4.5.3:11:5 71 | MERGED from com.google.android.gms:play-services:6.5.87:18:5 72 | MERGED from com.android.support:support-v4:21.0.3:15:5 73 | android:targetSdkVersion 74 | INJECTED from AndroidManifest.xml:0:0 75 | INJECTED from AndroidManifest.xml:0:0 76 | tools:ignore 77 | ADDED from com.mixpanel.android:mixpanel-android:4.5.3:14:9 78 | android:minSdkVersion 79 | INJECTED from AndroidManifest.xml:0:0 80 | INJECTED from AndroidManifest.xml:0:0 81 | meta-data#com.google.android.gms.version 82 | ADDED from com.google.android.gms:play-services:6.5.87:21:9 83 | android:value 84 | ADDED from com.google.android.gms:play-services:6.5.87:23:13 85 | android:name 86 | ADDED from com.google.android.gms:play-services:6.5.87:22:13 87 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in C:\Users\Anjith Sasindran\AppData\Local\Android\sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /app/src/androidTest/java/com/anjithsasindran/materialcolorpicker/ApplicationTest.java: -------------------------------------------------------------------------------- 1 | package com.anjithsasindran.materialcolorpicker; 2 | 3 | import android.app.Application; 4 | import android.test.ApplicationTestCase; 5 | 6 | /** 7 | * Testing Fundamentals 8 | */ 9 | public class ApplicationTest extends ApplicationTestCase { 10 | public ApplicationTest() { 11 | super(Application.class); 12 | } 13 | } -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 9 | 11 | 15 | 17 | 18 | 23 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /app/src/main/java/com/anjithsasindran/materialcolorpicker/ColorPickerActivity.java: -------------------------------------------------------------------------------- 1 | package com.anjithsasindran.materialcolorpicker; 2 | 3 | import android.app.Activity; 4 | import android.app.AlertDialog; 5 | import android.content.ClipData; 6 | import android.content.ClipboardManager; 7 | import android.content.Context; 8 | import android.content.DialogInterface; 9 | import android.content.Intent; 10 | import android.content.SharedPreferences; 11 | import android.content.pm.PackageManager; 12 | import android.content.pm.ResolveInfo; 13 | import android.graphics.Color; 14 | import android.graphics.Rect; 15 | import android.net.Uri; 16 | import android.os.Build; 17 | import android.os.Bundle; 18 | import android.view.Display; 19 | import android.view.Surface; 20 | import android.view.View; 21 | import android.view.Window; 22 | import android.view.WindowManager; 23 | import android.widget.Button; 24 | import android.widget.SeekBar; 25 | import android.widget.TextView; 26 | import android.widget.Toast; 27 | 28 | import com.afollestad.materialdialogs.MaterialDialog; 29 | import com.mixpanel.android.mpmetrics.MixpanelAPI; 30 | 31 | import org.json.JSONException; 32 | import org.json.JSONObject; 33 | 34 | import java.util.List; 35 | 36 | public class ColorPickerActivity extends Activity implements SeekBar.OnSeekBarChangeListener { 37 | 38 | public static final String MIXPANEL_TOKEN = "8df466c6bae9ae3c3117de78e1af819d"; 39 | 40 | View colorView; 41 | SeekBar redSeekBar, greenSeekBar, blueSeekBar; 42 | TextView redToolTip, greenToolTip, blueToolTip; 43 | Button buttonSelector; 44 | ClipboardManager clipBoard; 45 | ClipData clip; 46 | Window window; 47 | Display display; 48 | int red, green, blue, seekBarLeft; 49 | Rect thumbRect; 50 | AlertDialog alertDialog; 51 | MixpanelAPI mixpanel; 52 | JSONObject props; 53 | 54 | @Override 55 | protected void onCreate(Bundle savedInstanceState) { 56 | super.onCreate(savedInstanceState); 57 | 58 | mixpanel = MixpanelAPI.getInstance(this, MIXPANEL_TOKEN); 59 | props = new JSONObject(); 60 | 61 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { 62 | setContentView(R.layout.layout_color_picker); 63 | } else { 64 | setContentView(R.layout.layout_16); 65 | } 66 | 67 | display = ((WindowManager) this.getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay(); 68 | 69 | SharedPreferences settings = getSharedPreferences("COLOR_SETTINGS", 0); 70 | red = settings.getInt("RED_COLOR", 0); 71 | green = settings.getInt("GREEN_COLOR", 0); 72 | blue = settings.getInt("BLUE_COLOR", 0); 73 | 74 | clipBoard = (ClipboardManager)getSystemService(Context.CLIPBOARD_SERVICE); 75 | colorView = findViewById(R.id.colorView); 76 | window = getWindow(); 77 | 78 | redSeekBar = (SeekBar)findViewById(R.id.redSeekBar); 79 | greenSeekBar = (SeekBar)findViewById(R.id.greenSeekBar); 80 | blueSeekBar = (SeekBar)findViewById(R.id.blueSeekBar); 81 | 82 | seekBarLeft = redSeekBar.getPaddingLeft(); 83 | 84 | redToolTip = (TextView)findViewById(R.id.redToolTip); 85 | greenToolTip = (TextView)findViewById(R.id.greenToolTip); 86 | blueToolTip = (TextView)findViewById(R.id.blueToolTip); 87 | 88 | buttonSelector = (Button)findViewById(R.id.buttonSelector); 89 | 90 | redSeekBar.setOnSeekBarChangeListener(this); 91 | greenSeekBar.setOnSeekBarChangeListener(this); 92 | blueSeekBar.setOnSeekBarChangeListener(this); 93 | 94 | redSeekBar.setProgress(red); 95 | greenSeekBar.setProgress(green); 96 | blueSeekBar.setProgress(blue); 97 | 98 | //Setting View, Status bar & button color & hex codes 99 | 100 | colorView.setBackgroundColor(Color.rgb(red, green, blue)); 101 | 102 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { 103 | 104 | if (display.getRotation() != Surface.ROTATION_90 && display.getRotation() != Surface.ROTATION_270) 105 | window.setStatusBarColor(Color.rgb(red, green, blue)); 106 | 107 | } 108 | 109 | //Set's color hex on Button 110 | buttonSelector.setText(String.format("#%02x%02x%02x", red, green, blue)); 111 | 112 | } 113 | 114 | @Override 115 | public void onWindowFocusChanged(boolean hasFocus) { 116 | 117 | thumbRect = redSeekBar.getThumb().getBounds(); 118 | 119 | redToolTip.setX(seekBarLeft + thumbRect.left); 120 | if (red<10) 121 | redToolTip.setText(" "+red); 122 | else if (red<100) 123 | redToolTip.setText(" "+red); 124 | else 125 | redToolTip.setText(red+""); 126 | 127 | thumbRect = greenSeekBar.getThumb().getBounds(); 128 | 129 | greenToolTip.setX(seekBarLeft + thumbRect.left); 130 | if (green<10) 131 | greenToolTip.setText(" "+green); 132 | else if (red<100) 133 | greenToolTip.setText(" "+green); 134 | else 135 | greenToolTip.setText(green+""); 136 | 137 | thumbRect = blueSeekBar.getThumb().getBounds(); 138 | 139 | blueToolTip.setX(seekBarLeft + thumbRect.left); 140 | if (blue<10) 141 | blueToolTip.setText(" "+blue); 142 | else if (blue<100) 143 | blueToolTip.setText(" "+blue); 144 | else 145 | blueToolTip.setText(blue+""); 146 | 147 | } 148 | 149 | @Override 150 | public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) { 151 | 152 | if (seekBar.getId() == R.id.redSeekBar) { 153 | 154 | red = progress; 155 | thumbRect = seekBar.getThumb().getBounds(); 156 | 157 | redToolTip.setX(seekBarLeft + thumbRect.left); 158 | 159 | if (progress<10) 160 | redToolTip.setText(" " + red); 161 | else if (progress<100) 162 | redToolTip.setText(" "+red); 163 | else 164 | redToolTip.setText(red+""); 165 | 166 | } 167 | else if (seekBar.getId() == R.id.greenSeekBar) { 168 | 169 | green = progress; 170 | thumbRect = seekBar.getThumb().getBounds(); 171 | 172 | greenToolTip.setX(seekBar.getPaddingLeft()+thumbRect.left); 173 | if (progress<10) 174 | greenToolTip.setText(" "+green); 175 | else if (progress<100) 176 | greenToolTip.setText(" "+green); 177 | else 178 | greenToolTip.setText(green+""); 179 | 180 | } 181 | else if (seekBar.getId() == R.id.blueSeekBar) { 182 | 183 | blue = progress; 184 | thumbRect = seekBar.getThumb().getBounds(); 185 | 186 | blueToolTip.setX(seekBarLeft + thumbRect.left); 187 | if (progress<10) 188 | blueToolTip.setText(" "+blue); 189 | else if (progress<100) 190 | blueToolTip.setText(" "+blue); 191 | else 192 | blueToolTip.setText(blue+""); 193 | 194 | } 195 | 196 | colorView.setBackgroundColor(Color.rgb(red, green, blue)); 197 | 198 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { 199 | 200 | if (display.getRotation() == Surface.ROTATION_0) 201 | window.setStatusBarColor(Color.rgb(red, green, blue)); 202 | 203 | } 204 | 205 | //Setting the button hex color 206 | buttonSelector.setText(String.format("#%02x%02x%02x", red, green, blue)); 207 | 208 | } 209 | 210 | @Override 211 | public void onStopTrackingTouch(SeekBar seekBar) { 212 | 213 | } 214 | 215 | @Override 216 | public void onStartTrackingTouch(SeekBar seekBar) { 217 | 218 | } 219 | 220 | public void colorSelect(View view) { 221 | 222 | //Copies color to Clipboard 223 | clip = ClipData.newPlainText("clip", buttonSelector.getText()); 224 | clipBoard.setPrimaryClip(clip); 225 | 226 | //Mixpanel event tracker 227 | try { 228 | props.put("Color", buttonSelector.getText()); 229 | } 230 | catch(JSONException e) { 231 | e.printStackTrace(); 232 | } 233 | mixpanel.track("Color Selected", props); 234 | 235 | Toast.makeText(this, "Color " + buttonSelector.getText() + " copied to clipboard", Toast.LENGTH_SHORT).show(); 236 | 237 | } 238 | 239 | public void showDetails(View view) { 240 | 241 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { 242 | 243 | View dialogLayout = View.inflate(this, R.layout.dialog, null); 244 | 245 | alertDialog = new AlertDialog.Builder(this) 246 | .setTitle("Material Color Picker") 247 | 248 | .setView(dialogLayout) 249 | .setPositiveButton(android.R.string.yes, new DialogInterface.OnClickListener() { 250 | public void onClick(DialogInterface dialog, int which) { 251 | 252 | } 253 | }) 254 | .show(); 255 | 256 | alertDialog.findViewById(R.id.website).setOnClickListener(new View.OnClickListener(){ 257 | public void onClick(View view) { 258 | startActivity(new Intent(Intent.ACTION_VIEW) 259 | .setData(Uri.parse("http://www.anjithsasindran.in"))); 260 | } 261 | }); 262 | 263 | alertDialog.findViewById(R.id.github).setOnClickListener(new View.OnClickListener(){ 264 | public void onClick(View view) { 265 | startActivity(new Intent(Intent.ACTION_VIEW) 266 | .setData(Uri.parse("https://github.com/4k3R/material-color-picker"))); 267 | } 268 | }); 269 | 270 | alertDialog.findViewById(R.id.instagram).setOnClickListener(new View.OnClickListener(){ 271 | public void onClick(View view) { 272 | Uri uri = Uri.parse("http://instagram.com/_u/anjithsasindran"); 273 | Intent insta = new Intent(Intent.ACTION_VIEW, uri); 274 | insta.setPackage("com.instagram.android"); 275 | 276 | PackageManager packageManager = getBaseContext().getPackageManager(); 277 | List list = packageManager.queryIntentActivities(insta, PackageManager.MATCH_DEFAULT_ONLY); 278 | 279 | if (list.size()>0) { 280 | startActivity(insta); 281 | } 282 | else { 283 | startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("http://instagram.com/anjithsasindran"))); 284 | } 285 | 286 | } 287 | }); 288 | 289 | alertDialog.findViewById(R.id.dribbble).setOnClickListener(new View.OnClickListener(){ 290 | public void onClick(View view) { 291 | startActivity(new Intent(Intent.ACTION_VIEW) 292 | .setData(Uri.parse("https://dribbble.com/shots/1858968-Material-Design-colorpicker?list=users&offset=2"))); 293 | } 294 | }); 295 | 296 | } 297 | else { 298 | 299 | MaterialDialog.Builder materialDialog = new MaterialDialog.Builder(this); 300 | View dialogLayout = View.inflate(this, R.layout.dialog_16, null); 301 | 302 | 303 | materialDialog.title(R.string.app_name); 304 | materialDialog.customView(dialogLayout, false); 305 | materialDialog.positiveText("OK"); 306 | materialDialog.show(); 307 | 308 | dialogLayout.findViewById(R.id.website).setOnClickListener(new View.OnClickListener() { 309 | public void onClick(View view) { 310 | startActivity(new Intent(Intent.ACTION_VIEW) 311 | .setData(Uri.parse("http://www.anjithsasindran.in"))); 312 | } 313 | }); 314 | 315 | dialogLayout.findViewById(R.id.github).setOnClickListener(new View.OnClickListener() { 316 | public void onClick(View view) { 317 | startActivity(new Intent(Intent.ACTION_VIEW) 318 | .setData(Uri.parse("https://github.com/4k3R/material-color-picker"))); 319 | } 320 | }); 321 | 322 | dialogLayout.findViewById(R.id.instagram).setOnClickListener(new View.OnClickListener() { 323 | public void onClick(View view) { 324 | Uri uri = Uri.parse("http://instagram.com/_u/anjithsasindran"); 325 | Intent insta = new Intent(Intent.ACTION_VIEW, uri); 326 | insta.setPackage("com.instagram.android"); 327 | 328 | PackageManager packageManager = getBaseContext().getPackageManager(); 329 | List list = packageManager.queryIntentActivities(insta, PackageManager.MATCH_DEFAULT_ONLY); 330 | 331 | if (list.size() > 0) { 332 | startActivity(insta); 333 | } else { 334 | startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("http://instagram.com/anjithsasindran"))); 335 | } 336 | 337 | } 338 | }); 339 | 340 | dialogLayout.findViewById(R.id.dribbble).setOnClickListener(new View.OnClickListener() { 341 | public void onClick(View view) { 342 | startActivity(new Intent(Intent.ACTION_VIEW) 343 | .setData(Uri.parse("https://dribbble.com/shots/1858968-Material-Design-colorpicker?list=users&offset=2"))); 344 | } 345 | }); 346 | 347 | } 348 | 349 | } 350 | 351 | @Override 352 | protected void onDestroy() { 353 | super.onDestroy(); 354 | 355 | //Manually flushing selected colors to mixpanel server 356 | mixpanel.flush(); 357 | 358 | //Storing values of red, green & blue in SharedPreferences 359 | SharedPreferences settings = getSharedPreferences("COLOR_SETTINGS", 0); 360 | SharedPreferences.Editor editor = settings.edit(); 361 | editor.putInt("RED_COLOR", redSeekBar.getProgress()); 362 | editor.putInt("GREEN_COLOR", greenSeekBar.getProgress()); 363 | editor.putInt("BLUE_COLOR", blueSeekBar.getProgress()); 364 | editor.apply(); 365 | 366 | //Properly dismissing dialog to prevent errors while changing orientation 367 | try { 368 | if (alertDialog.isShowing()) { 369 | alertDialog.dismiss(); 370 | } 371 | } 372 | catch (NullPointerException e) { 373 | //do nothing 374 | } 375 | 376 | } 377 | } -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/blue_thumb_default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/captswag/material-color-picker/a98e1f94e0a68150fdb61cada330b7a32c6f4ec5/app/src/main/res/drawable-hdpi/blue_thumb_default.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/blue_thumb_pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/captswag/material-color-picker/a98e1f94e0a68150fdb61cada330b7a32c6f4ec5/app/src/main/res/drawable-hdpi/blue_thumb_pressed.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/green_thumb_default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/captswag/material-color-picker/a98e1f94e0a68150fdb61cada330b7a32c6f4ec5/app/src/main/res/drawable-hdpi/green_thumb_default.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/green_thumb_pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/captswag/material-color-picker/a98e1f94e0a68150fdb61cada330b7a32c6f4ec5/app/src/main/res/drawable-hdpi/green_thumb_pressed.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/captswag/material-color-picker/a98e1f94e0a68150fdb61cada330b7a32c6f4ec5/app/src/main/res/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/red_thumb_default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/captswag/material-color-picker/a98e1f94e0a68150fdb61cada330b7a32c6f4ec5/app/src/main/res/drawable-hdpi/red_thumb_default.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/red_thumb_pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/captswag/material-color-picker/a98e1f94e0a68150fdb61cada330b7a32c6f4ec5/app/src/main/res/drawable-hdpi/red_thumb_pressed.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/blue_thumb_default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/captswag/material-color-picker/a98e1f94e0a68150fdb61cada330b7a32c6f4ec5/app/src/main/res/drawable-mdpi/blue_thumb_default.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/blue_thumb_pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/captswag/material-color-picker/a98e1f94e0a68150fdb61cada330b7a32c6f4ec5/app/src/main/res/drawable-mdpi/blue_thumb_pressed.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/green_thumb_default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/captswag/material-color-picker/a98e1f94e0a68150fdb61cada330b7a32c6f4ec5/app/src/main/res/drawable-mdpi/green_thumb_default.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/green_thumb_pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/captswag/material-color-picker/a98e1f94e0a68150fdb61cada330b7a32c6f4ec5/app/src/main/res/drawable-mdpi/green_thumb_pressed.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/captswag/material-color-picker/a98e1f94e0a68150fdb61cada330b7a32c6f4ec5/app/src/main/res/drawable-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/red_thumb_default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/captswag/material-color-picker/a98e1f94e0a68150fdb61cada330b7a32c6f4ec5/app/src/main/res/drawable-mdpi/red_thumb_default.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/red_thumb_pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/captswag/material-color-picker/a98e1f94e0a68150fdb61cada330b7a32c6f4ec5/app/src/main/res/drawable-mdpi/red_thumb_pressed.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/blue_thumb_default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/captswag/material-color-picker/a98e1f94e0a68150fdb61cada330b7a32c6f4ec5/app/src/main/res/drawable-xhdpi/blue_thumb_default.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/blue_thumb_pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/captswag/material-color-picker/a98e1f94e0a68150fdb61cada330b7a32c6f4ec5/app/src/main/res/drawable-xhdpi/blue_thumb_pressed.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/green_thumb_default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/captswag/material-color-picker/a98e1f94e0a68150fdb61cada330b7a32c6f4ec5/app/src/main/res/drawable-xhdpi/green_thumb_default.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/green_thumb_pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/captswag/material-color-picker/a98e1f94e0a68150fdb61cada330b7a32c6f4ec5/app/src/main/res/drawable-xhdpi/green_thumb_pressed.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/captswag/material-color-picker/a98e1f94e0a68150fdb61cada330b7a32c6f4ec5/app/src/main/res/drawable-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/red_thumb_default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/captswag/material-color-picker/a98e1f94e0a68150fdb61cada330b7a32c6f4ec5/app/src/main/res/drawable-xhdpi/red_thumb_default.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/red_thumb_pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/captswag/material-color-picker/a98e1f94e0a68150fdb61cada330b7a32c6f4ec5/app/src/main/res/drawable-xhdpi/red_thumb_pressed.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/blue_thumb_default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/captswag/material-color-picker/a98e1f94e0a68150fdb61cada330b7a32c6f4ec5/app/src/main/res/drawable-xxhdpi/blue_thumb_default.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/blue_thumb_pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/captswag/material-color-picker/a98e1f94e0a68150fdb61cada330b7a32c6f4ec5/app/src/main/res/drawable-xxhdpi/blue_thumb_pressed.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/green_thumb_default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/captswag/material-color-picker/a98e1f94e0a68150fdb61cada330b7a32c6f4ec5/app/src/main/res/drawable-xxhdpi/green_thumb_default.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/green_thumb_pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/captswag/material-color-picker/a98e1f94e0a68150fdb61cada330b7a32c6f4ec5/app/src/main/res/drawable-xxhdpi/green_thumb_pressed.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/captswag/material-color-picker/a98e1f94e0a68150fdb61cada330b7a32c6f4ec5/app/src/main/res/drawable-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/red_thumb_default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/captswag/material-color-picker/a98e1f94e0a68150fdb61cada330b7a32c6f4ec5/app/src/main/res/drawable-xxhdpi/red_thumb_default.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/red_thumb_pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/captswag/material-color-picker/a98e1f94e0a68150fdb61cada330b7a32c6f4ec5/app/src/main/res/drawable-xxhdpi/red_thumb_pressed.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/captswag/material-color-picker/a98e1f94e0a68150fdb61cada330b7a32c6f4ec5/app/src/main/res/drawable-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/about_16.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/about_button.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/blue_progress.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/blue_thumb_drawable.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/color_button.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/color_button_16.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/green_progress.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/green_thumb_drawable.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/red_progress.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/red_thumb_drawable.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/layout-land/layout_16.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | 10 | 15 | 16 | 22 | 23 | 31 | 32 | 41 | 42 | 52 | 53 | 63 | 64 | 74 | 75 | 85 | 86 | 96 | 97 |