[
  {
    "path": ".gitignore",
    "content": ".gradle\n/local.properties\n/.idea/workspace.xml\n/.idea/libraries\n.DS_Store\n/build\n/captures\n\n# Built application files\n/*/build/\n\n# Crashlytics configuations\ncom_crashlytics_export_strings.xml\n\n# Local configuration file (sdk path, etc)\nlocal.properties\n\n# Gradle generated files\n.gradle/\n\n# Signing files\n.signing/\n\n# User-specific configurations\n.idea/libraries/\n.idea/workspace.xml\n.idea/tasks.xml\n.idea/.name\n.idea/compiler.xml\n.idea/copyright/profiles_settings.xml\n.idea/encodings.xml\n.idea/misc.xml\n.idea/modules.xml\n.idea/scopes/scope_settings.xml\n.idea/vcs.xml\n.idea/*\n*.iml\n\n# OS-specific files\n.DS_Store\n.DS_Store?\n._*\n.Spotlight-V100\n.Trashes\nehthumbs.db\nThumbs.db"
  },
  {
    "path": "LICENSE",
    "content": "                                 Apache License\n                           Version 2.0, January 2004\n                        http://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n   APPENDIX: How to apply the Apache License to your work.\n\n      To apply the Apache License to your work, attach the following\n      boilerplate notice, with the fields enclosed by brackets \"{}\"\n      replaced with your own identifying information. (Don't include\n      the brackets!)  The text should be enclosed in the appropriate\n      comment syntax for the file format. We also recommend that a\n      file or class name and description of purpose be included on the\n      same \"printed page\" as the copyright notice for easier\n      identification within third-party archives.\n\n   Copyright {yyyy} {name of copyright owner}\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n"
  },
  {
    "path": "README.md",
    "content": "[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-DrawMe-green.svg?style=true)](https://android-arsenal.com/details/1/3355)\n[![](https://jitpack.io/v/rafakob/DrawMe.svg)](https://jitpack.io/#rafakob/DrawMe)\n# DrawMe #\nWith **DrawMe** you can easily create views with custom background shapes using only XML layout files. Quick example:\n\n_Standard way:_\n```xml\n<!--drawable/back.xml-->\n<shape \n    xmlns:android=\"http://schemas.android.com/apk/res/android\" \n    android:shape=\"rectangle\">\n\n    <corners android:radius=\"5dp\" />\n    <solid android:color=\"@android:color/white\" />\n    <stroke\n        android:width=\"3dp\"\n        android:color=\"@android:color/black\" />\n</shape>\n\n\n<!--layout/activity_main.xml-->\n<FrameLayout\n    android:layout_width=\"100dp\"\n    android:layout_height=\"100dp\"\n    android:background=\"@drawable/back.xml\"/>\n```\n\n**_With DrawMe:_**\n```xml\n<com.rafakob.drawme.DrawMeFrameLayout\n    android:layout_width=\"100dp\"\n    android:layout_height=\"100dp\"\n    drawme:dm_backColor=\"@android:color/white\"\n    drawme:dm_strokeColor=\"@android:color/black\"\n    drawme:dm_radius=\"5dp\"\n    drawme:dm_stroke=\"3dp\"/>\n```\n\n\nLibrary also supports different states: **normal**, **pressed**, **disabled**. \nIt means that you can define different background and stroke colors for each state. The best thing about it is that **DrawMe** is \"compatible\" with pre and post Lollipop. On API +21 it uses **native** ripple press effect, and below it uses standard StateListDrawable. Here's example:\n\n_Standard way:_\n```xml\n<!--drawable/custom_button.xml-->\n<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <item android:state_enabled=\"false\">\n        <shape android:shape=\"rectangle\">\n            <solid android:color=\"@color/colorDarkGray\"/>\n        </shape>\n    </item>\n    <item android:state_pressed=\"false\">\n        <shape android:shape=\"rectangle\">\n            <solid android:color=\"@color/colorButtonGreen\"/>\n        </shape>\n    </item>\n    <item android:state_pressed=\"true\">\n        <shape android:shape=\"rectangle\">\n            <solid android:color=\"@color/colorButtonGreenFocused\"/>\n        </shape>\n    </item>\n</selector>\n\n\n<!--drawable-v21/custom_button.xml-->\n<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <item android:state_enabled=\"false\">\n        <shape android:shape=\"rectangle\">\n            <solid android:color=\"@color/colorDarkGray\"/>\n        </shape>\n    </item>\n    <item android:state_enabled=\"true\">\n        <ripple\n            xmlns:android=\"http://schemas.android.com/apk/res/android\"\n            android:color=\"@color/colorButtonGreenFocused\">\n            <item>\n                <color android:color=\"@color/colorButtonGreen\"/>\n            </item>\n        </ripple>\n    </item>\n</selector>\n\n\n<!--layout/activity_main.xml-->\n<Button\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"50dp\"\n    android:background=\"@drawable/custom_button.xml\"/>\n```\n\n**_With DrawMe:_**\n```xml\n<com.rafakob.drawme.DrawMeButton\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"50dp\"\n    drawme:dm_backColor=\"@color/colorButtonGreen\"\n    drawme:dm_backColorPressed=\"@color/colorButtonGreenFocused\"\n    drawme:dm_backColorDisabled=\"@color/colorDarkGray\"\n    drawme:dm_shapeRadiusHalfHeight=\"true\"/>\n```\n**_Result_**\n\n_Pre Lollipop_\n\n![](http://i.imgur.com/mOYsFsu.gif)\n\n_API +21_\n\n![](http://i.imgur.com/NgFrb78.gif)\n\n\n\n\n## Install ##\nAdd it in your root build.gradle at the end of repositories:\n```java\nallprojects {\n\trepositories {\n\t\t...\n\t\tmaven { url \"https://jitpack.io\" }\n\t}\n}\n```\nAdd the dependency:\n\n[![](https://jitpack.io/v/rafakob/DrawMe.svg)](https://jitpack.io/#rafakob/DrawMe)\n```java\ndependencies {\n        compile 'com.github.rafakob:DrawMe:VERSION'\n}\n```\n\n\n## Features ##\nProvided attributes are only accessiable from XML, you can't modify them from JAVA code (at least for now).\n\nI tried to use as many default values as possible, so that user wouldn't have to specify too many attributes and colors. For instance you can define background color only for a normal state - pressed and disabled will be generated.\n\nTo fully understand everything just play around with it for a while. No rocket science here :)\n\n[**EXAMPLES**](https://github.com/rafakob/DrawMe/blob/master/app/src/main/res/layout/activity_main.xml)\n\n### Background shape ###\n \n| Attribute      \t  | Format            | Default | Description     |\n| :---           \t  | :---:             | :---:   | :---            |\n| `dm_stroke`   \t\t  | dimension         | 0       | Stroke width. |\n| `dm_radius`     \t\t  | dimension         | 0       | Corner radius. |\n| `dm_radiusBottomLeft`      | dimension         | -1      | \"-1\" means that attribute will be ignored. |\n| `dm_radiusBottomRight`     | dimension         | -1      | as above |\n| `dm_radiusTopLeft`     \t  | dimension         | -1      | as above |\n| `dm_radiusTopRight`     \t  | dimension         | -1      | as above |\n| `dm_shapeRadiusHalfHeight` | boolean           | false   | True - use \"full radius\", other radius dimensions will be ignored. |\n| `dm_shapeEqualWidthHeight` | boolean           | false   | True - shape will have equal height and width. |\n\n\n- Set `dm_shapeRadiusHalfHeight` and `dm_shapeEqualWidthHeight` in order to create a circle.\n- You can combine `dm_radius` with other radius dimensions, it works just like padding.\n \n![](https://i.imgur.com/3ABA2jL.png)\n\n![](https://i.imgur.com/ng0cCDm.png)\n\n### States and ripple ###\n \n| Attribute      \t      | Format   | Default | Description     |\n| :---           \t      | :---:    | :---:   | :---            |\n| `dm_rippleEffect`              | boolean  | true    | True - use ripple effect on API +21. False - use standard StateListDrawable on all devices. |\n| `dm_rippleUseControlHighlight` | boolean  | true    | Use theme attribute `R.attr.colorControlHighlight` as a ripple color. It's avaiable only on +21, and it's basically a `1F000000` color. On lower API \"mimic\" this highlight by mixing background color with a black mask (it should look almost the same as on +21).  Matters only when pressed background color hasn't been specified. |\n| `dm_statePressed`              | boolean  | true    | True - create pressed state. False - ignore it. |\n| `dm_stateDisabled`             | boolean  | true    | True - create disabled state. False - ignore it. |\n\nFirst button is in normal state. Second is pressed with default ripple highlight. Third one uses custom color as pressed ripple effect:\n\n![](https://i.imgur.com/seixdeQ.png)\n\n### Colors ###\n \n| Attribute      \t  | Format | Default | Description     |\n| :---           \t  | :---:  | :---:   | :---            |\n| `dm_backColor`             | color  | `Color.TRANSPARENT`       | Background color - default state. |\n| `dm_backColorPressed`      | color  | Dark highlight (like ripple)       | Background color - pressed state. |\n| `dm_backColorDisabled`     | color  | Grayed out `backColor`      | Background color - disabled state. |\n| `dm_strokeColor`           | color  | `Color.GRAY`     | Stroke color - default state. |\n| `dm_strokeColorPressed`    | color  | Dark highlight (like ripple)      | Stroke color - pressed state. |\n| `dm_strokeColorDisabled`   | color  | Grayed out `strokeColor`      | Stroke color - disabled state. |\n\n- If you're not gonna define any attribute, view will have transaprent borderless background with pressed state like ripple effect.\n- Use `android:stateListAnimator=\"@null\"` to disable default press shadow/elevation on +21.\n\n![](https://i.imgur.com/qFn0Uh3.png)\n\n![](https://i.imgur.com/FsLaN9M.png)\n\n### Layouts ###\nAvaiable layouts:\n- `DrawMeFrameLayout`\n- `DrawMeLinearLayout`\n- `DrawMeRelativeLayout`\n- `DrawMeImageButton`\n\nAll above attributes can be applied to them.\n\n![](https://i.imgur.com/vRxvTaj.png)\n\n### TextViews ###\nAvaiable views:\n- `DrawMeButton`\n- `DrawMeTextView`\n- `DrawMeEditText`\n\n| Attribute      \t  | Format | Default | Description     |\n| :---           \t  | :---:  | :---:   | :---            |\n| `dm_font`                  | string | null    | Name of a custom font, eg. `Lato-Regular.ttf`.|\n| `dm_textColor`             | color  | System default       | Text color - default state. Same as `android:textColor`. |\n| `dm_textColorPressed`      | color  | `textColor`       | Text color - pressed state. |\n| `dm_textColorDisabled`     | color  | `textColor`       | Text color - disabled state. |\n| `dm_drawableTint`          | color  | none       | Equivalent to `android:drawableTint` but it's compatible with preLollipop devices.  |\n| `dm_drawableTintMode`      | enum   | none       | Equivalent to `android:drawableTintMode` but it's compatible with preLollipop devices. |\n\n- Custom fonts has to be put in `assets/fonts`. Library uses font caching.\n- Tintintg is performed using `DrawableCompat.wrap()` method. \n\n![](https://i.imgur.com/V7oOMCb.png)\n\n\n### Advanced - mask, adaptive highlight ###\n\n| Attribute      \t  | Format | Default |\n| :---           \t  | :---:  | :---:   |\n| `dm_maskColorPressed`             | color  | `#1F00000`       |\n| `dm_maskColorPressedInverse`      | color  | `#1DFFFFFF`       |\n| `dm_maskColorDisabled`     | color  | `#6DFFFFFF`      |\n| `dm_maskBrightnessThreshold`           | float [0 - 1]  | 0     |\n\nBy default ripple color is just a blackish shadow over normal state color. I've added an option to adjust that shadow mask. Same applies to disabled color. Just modify `dm_maskColorPressed` and `dm_maskColorDisabled`:\n\n![](https://i.imgur.com/S4Cehtx.png)\n\n\n\nBut what when I have a black or very dark buttons? Ripple effect won't be visiable. In that case you have three options:\n- leave it as is\n- change `dm_maskColorPressed` to a lighter color\n- use an adaptive method by modifing `dm_maskBrightnessThreshold`\n\nSo how the adaption works?\n- Library calculates background color brightness: 0.0 means that background is black, 1.0 means it's white.\n- Compare background brightness with `dm_maskBrightnessThreshold`. If it's lower than use `dm_maskColorPressedInverse` instead of `dm_maskColorPressed`.\n\nExample:\n- `maskBrightnessThreshold = 0.2`\n- Button X has background brightness `0.8` -> use `dm_maskColorPressed` -> ripple will be darker than background color \n- Button Y has background brightness `0.1` -> use `dm_maskColorPressedInverse` -> ripple will be lighter than background color\n\n![](https://i.imgur.com/JXAUpVX.png)\n\n## About ##\n\n> If you find any bugs feel free to report an issue or create a pull request. Suggestions and feature requestes are very welcome.\n\n> Use it wherever and however you want.\n\n\n## Changelog ##\n##### `0.1.6` (2016-04-04):#####\n - Support for theme `buttonStyle`.\n#####`0.1.5` (2016-04-01):#####\n - Added `dm_` prefix for all attributes.\n\n\n## License ##\n```\nCopyright 2016 Rafał Kobyłko\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n   http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n```\n"
  },
  {
    "path": "app/.gitignore",
    "content": "/build\n"
  },
  {
    "path": "app/build.gradle",
    "content": "apply plugin: 'com.android.application'\n\ngroup = 'com.github.rafakob'\n\nandroid {\n    compileSdkVersion 23\n    buildToolsVersion \"23.0.2\"\n\n    defaultConfig {\n        applicationId \"com.rafakob.example.drawme\"\n        minSdkVersion 10\n        targetSdkVersion 23\n        versionCode 1\n        versionName \"1.0.0\"\n    }\n    buildTypes {\n        release {\n            minifyEnabled false\n            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'\n        }\n    }\n}\n\ndependencies {\n    compile fileTree(dir: 'libs', include: ['*.jar'])\n    testCompile 'junit:junit:4.12'\n    compile 'com.android.support:appcompat-v7:23.2.1'\n\n    compile project(':library')\n}\n"
  },
  {
    "path": "app/proguard-rules.pro",
    "content": "# Add project specific ProGuard rules here.\n# By default, the flags in this file are appended to flags specified\n# in /Users/rafakob/Library/Android/sdk/tools/proguard/proguard-android.txt\n# You can edit the include path and order by changing the proguardFiles\n# directive in build.gradle.\n#\n# For more details, see\n#   http://developer.android.com/guide/developing/tools/proguard.html\n\n# Add any project specific keep options here:\n\n# If your project uses WebView with JS, uncomment the following\n# and specify the fully qualified class name to the JavaScript interface\n# class:\n#-keepclassmembers class fqcn.of.javascript.interface.for.webview {\n#   public *;\n#}\n"
  },
  {
    "path": "app/src/main/AndroidManifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<manifest package=\"com.rafakob.example.drawme\"\n          xmlns:android=\"http://schemas.android.com/apk/res/android\">\n\n    <application\n        android:allowBackup=\"true\"\n        android:icon=\"@mipmap/ic_launcher\"\n        android:label=\"DrawMe\"\n        android:supportsRtl=\"true\"\n        android:theme=\"@style/AppTheme\">\n        <activity android:name=\"com.rafakob.example.drawme.MainActivity\">\n            <intent-filter>\n                <action android:name=\"android.intent.action.MAIN\"/>\n\n                <category android:name=\"android.intent.category.LAUNCHER\"/>\n            </intent-filter>\n        </activity>\n    </application>\n\n</manifest>"
  },
  {
    "path": "app/src/main/java/com/rafakob/example/drawme/MainActivity.java",
    "content": "package com.rafakob.example.drawme;\n\nimport android.os.Bundle;\nimport android.support.v7.app.AppCompatActivity;\n\npublic class MainActivity extends AppCompatActivity {\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_main);\n\n        findViewById(R.id.transparent_pressed).setPressed(true);\n        findViewById(R.id.transparent_disabled).setEnabled(false);\n\n        findViewById(R.id.colored_pressed1).setPressed(true);\n        findViewById(R.id.colored_pressed2).setPressed(true);\n        findViewById(R.id.colored_disabled).setEnabled(false);\n\n        findViewById(R.id.rounded_pressed).setPressed(true);\n        findViewById(R.id.rounded_disabled).setEnabled(false);\n\n        findViewById(R.id.ctrl_pressed1).setPressed(true);\n        findViewById(R.id.ctrl_pressed2).setPressed(true);\n\n        findViewById(R.id.mask_def).setPressed(true);\n        findViewById(R.id.mask_dark).setPressed(true);\n        findViewById(R.id.mask_light).setPressed(true);\n\n        findViewById(R.id.ada1).setPressed(true);\n        findViewById(R.id.ada2).setPressed(true);\n        findViewById(R.id.ada3).setPressed(true);\n        findViewById(R.id.ada4).setPressed(true);\n    }\n}\n"
  },
  {
    "path": "app/src/main/res/drawable/ic_vector_cloud.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n        android:width=\"24dp\"\n        android:height=\"24dp\"\n        android:viewportHeight=\"24\"\n        android:viewportWidth=\"24\">\n    <path\n        android:fillColor=\"#000\"\n        android:pathData=\"M19,18H6A4,4 0 0,1 2,14A4,4 0 0,1 6,10H6.71C7.37,7.69 9.5,6 12,6A5.5,5.5 0 0,1 17.5,11.5V12H19A3,3 0 0,1 22,15A3,3 0 0,1 19,18M19.35,10.03C18.67,6.59 15.64,4 12,4C9.11,4 6.6,5.64 5.35,8.03C2.34,8.36 0,10.9 0,14A6,6 0 0,0 6,20H19A5,5 0 0,0 24,15C24,12.36 21.95,10.22 19.35,10.03Z\"/>\n</vector>"
  },
  {
    "path": "app/src/main/res/layout/activity_main.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<ScrollView\n    xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:drawme=\"http://schemas.android.com/apk/res-auto\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\">\n\n    <LinearLayout\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:background=\"@android:color/white\"\n        android:orientation=\"vertical\"\n        android:paddingBottom=\"16dp\"\n        android:paddingLeft=\"16dp\"\n        android:paddingRight=\"16dp\">\n\n        <TextView\n            style=\"@style/TextDivider\"\n            android:text=\"#01: Transparent borderless button\"/>\n\n        <com.rafakob.drawme.DrawMeButton\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"50dp\"\n            android:text=\"Normal\"/>\n\n        <com.rafakob.drawme.DrawMeButton\n            android:id=\"@+id/transparent_pressed\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"50dp\"\n            android:text=\"Pressed\"/>\n\n        <com.rafakob.drawme.DrawMeButton\n            android:id=\"@+id/transparent_disabled\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"50dp\"\n            android:text=\"Disabled\"/>\n\n        <TextView\n            style=\"@style/TextDivider\"\n            android:text=\"#02: Colored button\"/>\n\n        <com.rafakob.drawme.DrawMeButton\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"50dp\"\n            android:text=\"Normal\"\n            drawme:dm_backColor=\"@color/colorAccent\"/>\n\n        <com.rafakob.drawme.DrawMeButton\n            android:id=\"@+id/colored_pressed1\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"50dp\"\n            android:stateListAnimator=\"@null\"\n            android:text=\"Pressed without animator\"\n\n            drawme:dm_backColor=\"@color/colorAccent\"/>\n\n        <com.rafakob.drawme.DrawMeButton\n            android:id=\"@+id/colored_pressed2\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"50dp\"\n            android:text=\"Pressed\"\n            drawme:dm_backColor=\"@color/colorAccent\"/>\n\n        <com.rafakob.drawme.DrawMeButton\n            android:id=\"@+id/colored_disabled\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"50dp\"\n            android:text=\"Disabled\"\n            drawme:dm_backColor=\"@color/colorAccent\"/>\n\n\n        <TextView\n            style=\"@style/TextDivider\"\n            android:text=\"#03: Rounded button with style\"/>\n\n        <com.rafakob.drawme.DrawMeButton\n            style=\"@style/RoundedButton\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"50dp\"\n            android:text=\"Normal\"/>\n\n        <com.rafakob.drawme.DrawMeButton\n            android:id=\"@+id/rounded_pressed\"\n            style=\"@style/RoundedButton\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"50dp\"\n            android:layout_marginBottom=\"8dp\"\n            android:layout_marginTop=\"8dp\"\n            android:text=\"Pressed\"/>\n\n        <com.rafakob.drawme.DrawMeButton\n            android:id=\"@+id/rounded_disabled\"\n            style=\"@style/RoundedButton\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"50dp\"\n            android:text=\"Disabled\"/>\n\n        <TextView\n            style=\"@style/TextDivider\"\n            android:text=\"#04: Shape and font\"/>\n\n        <com.rafakob.drawme.DrawMeButton\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"50dp\"\n            android:layout_marginBottom=\"8dp\"\n            android:text=\"Rounded\"\n            drawme:dm_backColor=\"@color/colorGreen\"\n            drawme:dm_font=\"Lato-Bold.ttf\"\n            drawme:dm_shapeRadiusHalfHeight=\"true\"\n            drawme:dm_textColor=\"@android:color/white\"/>\n\n        <com.rafakob.drawme.DrawMeButton\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:layout_gravity=\"center_horizontal\"\n            android:text=\"Circle\"\n            drawme:dm_backColor=\"@color/colorGreen\"\n            drawme:dm_font=\"Lato-Bold.ttf\"\n            drawme:dm_shapeEqualWidthHeight=\"true\"\n            drawme:dm_shapeRadiusHalfHeight=\"true\"\n            drawme:dm_textColor=\"@android:color/white\"/>\n\n        <TextView\n            style=\"@style/TextDivider\"\n            android:text=\"#05: Ripple - control highlight vs generated dim color\"/>\n\n        <com.rafakob.drawme.DrawMeButton\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"60dp\"\n            android:layout_marginBottom=\"8dp\"\n            android:text=\"Control highlight\"\n            drawme:dm_backColor=\"@color/colorBlue\"\n            drawme:dm_shapeRadiusHalfHeight=\"true\"\n            drawme:dm_stroke=\"12dp\"\n            drawme:dm_strokeColor=\"@color/colorYellow\"\n            drawme:dm_textColor=\"@android:color/white\"/>\n\n        <com.rafakob.drawme.DrawMeButton\n            android:id=\"@+id/ctrl_pressed1\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"60dp\"\n            android:layout_marginBottom=\"8dp\"\n            android:text=\"Control highlight\"\n            drawme:dm_backColor=\"@color/colorBlue\"\n            drawme:dm_shapeRadiusHalfHeight=\"true\"\n            drawme:dm_stroke=\"12dp\"\n            drawme:dm_strokeColor=\"@color/colorYellow\"\n            drawme:dm_textColor=\"@android:color/white\"/>\n\n        <com.rafakob.drawme.DrawMeButton\n            android:id=\"@+id/ctrl_pressed2\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"60dp\"\n            android:text=\"Dim background color\"\n            drawme:dm_backColor=\"@color/colorBlue\"\n            drawme:dm_rippleUseControlHighlight=\"false\"\n            drawme:dm_shapeRadiusHalfHeight=\"true\"\n            drawme:dm_stroke=\"12dp\"\n            drawme:dm_strokeColor=\"@color/colorYellow\"\n            drawme:dm_textColor=\"@android:color/white\"/>\n\n        <TextView\n            style=\"@style/TextDivider\"\n            android:text=\"#06: Textviews\"/>\n\n        <com.rafakob.drawme.DrawMeTextView\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"wrap_content\"\n            android:layout_marginBottom=\"8dp\"\n            android:clickable=\"true\"\n            android:gravity=\"center_horizontal\"\n            android:padding=\"12dp\"\n            android:text=\"My text\"\n            drawme:dm_stroke=\"2dp\"/>\n\n        <com.rafakob.drawme.DrawMeTextView\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:layout_gravity=\"center_horizontal\"\n            android:layout_marginBottom=\"8dp\"\n            android:clickable=\"true\"\n            android:gravity=\"center_horizontal\"\n            android:padding=\"12dp\"\n            android:text=\"My text\"\n\n            android:textAllCaps=\"true\"\n            android:textSize=\"18sp\"\n            drawme:dm_font=\"Lato-Bold.ttf\"\n            drawme:dm_radius=\"16dp\"\n            drawme:dm_stateDisabled=\"false\"\n            drawme:dm_statePressed=\"false\"\n            drawme:dm_stroke=\"4dp\"\n            drawme:dm_strokeColor=\"@color/colorAccent\"/>\n\n        <com.rafakob.drawme.DrawMeEditText\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"wrap_content\"\n            android:layout_marginBottom=\"8dp\"\n            android:drawableLeft=\"@drawable/ic_vector_cloud\"\n            android:drawablePadding=\"16dp\"\n            android:hint=\"EditText with tinted icon\"\n            android:padding=\"8dp\"\n            drawme:dm_drawableTint=\"@color/colorAccent\"/>\n\n        <TextView\n            style=\"@style/TextDivider\"\n            android:text=\"#07: Layouts\"/>\n\n        <com.rafakob.drawme.DrawMeRelativeLayout\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:clickable=\"true\"\n            android:padding=\"16dp\"\n            drawme:dm_radius=\"16dp\"\n            drawme:dm_stroke=\"4dp\"\n            drawme:dm_strokeColor=\"@color/colorGreen\">\n\n            <ImageView\n                android:layout_width=\"wrap_content\"\n                android:layout_height=\"wrap_content\"\n                android:layout_alignParentLeft=\"true\"\n                android:layout_alignParentTop=\"true\"\n                android:src=\"@mipmap/ic_launcher\"/>\n\n            <com.rafakob.drawme.DrawMeFrameLayout\n                android:layout_width=\"100dp\"\n                android:layout_height=\"100dp\"\n                android:layout_centerInParent=\"true\"\n                android:clickable=\"true\"\n                drawme:dm_backColor=\"@color/colorAccent\"\n                drawme:dm_shapeRadiusHalfHeight=\"true\"/>\n\n            <ImageView\n                android:layout_width=\"wrap_content\"\n                android:layout_height=\"wrap_content\"\n                android:layout_alignParentBottom=\"true\"\n                android:layout_alignParentRight=\"true\"\n                android:src=\"@mipmap/ic_launcher\"/>\n        </com.rafakob.drawme.DrawMeRelativeLayout>\n\n        <TextView\n            style=\"@style/TextDivider\"\n            android:text=\"#08: Highlight and disabled mask\"/>\n\n        <com.rafakob.drawme.DrawMeButton\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"50dp\"\n            android:layout_marginBottom=\"8dp\"\n            android:text=\"Normal\"\n            drawme:dm_backColor=\"@color/colorAccent\"\n            drawme:dm_rippleUseControlHighlight=\"false\"\n            drawme:dm_textColor=\"@android:color/white\"/>\n\n        <com.rafakob.drawme.DrawMeButton\n            android:id=\"@+id/mask_def\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"50dp\"\n            android:layout_marginBottom=\"8dp\"\n            android:text=\"Pressed - Default mask\"\n            drawme:dm_backColor=\"@color/colorAccent\"\n            drawme:dm_rippleUseControlHighlight=\"false\"\n            drawme:dm_textColor=\"@android:color/white\"/>\n\n        <com.rafakob.drawme.DrawMeButton\n            android:id=\"@+id/mask_dark\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"50dp\"\n            android:layout_marginBottom=\"8dp\"\n            android:text=\"Pressed - Darker\"\n            drawme:dm_backColor=\"@color/colorAccent\"\n            drawme:dm_maskColorPressed=\"#8D000000\"\n            drawme:dm_rippleUseControlHighlight=\"false\"\n            drawme:dm_textColor=\"@android:color/white\"/>\n\n        <com.rafakob.drawme.DrawMeButton\n            android:id=\"@+id/mask_light\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"50dp\"\n            android:layout_marginBottom=\"8dp\"\n            android:text=\"Pressed - Lighter\"\n            drawme:dm_backColor=\"@color/colorAccent\"\n            drawme:dm_maskColorPressed=\"#8DFFFFFF\"\n            drawme:dm_rippleUseControlHighlight=\"false\"\n            drawme:dm_textColor=\"@android:color/white\"/>\n\n        <com.rafakob.drawme.DrawMeButton\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"50dp\"\n            android:layout_marginBottom=\"8dp\"\n            android:enabled=\"false\"\n            android:text=\"Disabled - Default\"\n            drawme:dm_backColor=\"@color/colorAccent\"\n            drawme:dm_rippleUseControlHighlight=\"false\"\n            drawme:dm_textColor=\"@android:color/white\"/>\n\n        <com.rafakob.drawme.DrawMeButton\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"50dp\"\n            android:layout_marginBottom=\"8dp\"\n            android:enabled=\"false\"\n            android:text=\"Disabled - Custom\"\n            drawme:dm_backColor=\"@color/colorAccent\"\n            drawme:dm_maskColorDisabled=\"#CCFFFFFF\"\n            drawme:dm_rippleUseControlHighlight=\"false\"\n            drawme:dm_textColor=\"@android:color/white\"/>\n\n        <TextView\n            style=\"@style/TextDivider\"\n            android:text=\"#09: Adaptive mask\"/>\n\n        <com.rafakob.drawme.DrawMeButton\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"50dp\"\n            android:layout_marginBottom=\"8dp\"\n            android:text=\"Normal\"\n            drawme:dm_backColor=\"@color/colorGreen\"\n            drawme:dm_rippleUseControlHighlight=\"false\"\n            drawme:dm_textColor=\"@android:color/white\"/>\n\n        <com.rafakob.drawme.DrawMeButton\n            android:id=\"@+id/ada1\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"50dp\"\n            android:layout_marginBottom=\"8dp\"\n            android:text=\"Normal pressed - default\"\n            drawme:dm_backColor=\"@color/colorGreen\"\n            drawme:dm_rippleUseControlHighlight=\"false\"\n            drawme:dm_textColor=\"@android:color/white\"/>\n\n\n        <com.rafakob.drawme.DrawMeButton\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"50dp\"\n            android:layout_marginBottom=\"8dp\"\n            android:text=\"Dark normal\"\n            drawme:dm_backColor=\"@color/colorGreenDark\"\n            drawme:dm_rippleUseControlHighlight=\"false\"\n            drawme:dm_textColor=\"@android:color/white\"/>\n\n        <com.rafakob.drawme.DrawMeButton\n            android:id=\"@+id/ada2\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"50dp\"\n            android:layout_marginBottom=\"8dp\"\n            android:text=\"Dark normal pressed - Default\"\n            drawme:dm_backColor=\"@color/colorGreenDark\"\n            drawme:dm_rippleUseControlHighlight=\"false\"\n            drawme:dm_textColor=\"@android:color/white\"/>\n\n        <com.rafakob.drawme.DrawMeButton\n            android:id=\"@+id/ada3\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"50dp\"\n            android:layout_marginBottom=\"8dp\"\n            android:text=\"Dark normal pressed - Adaptive\"\n            drawme:dm_backColor=\"@color/colorGreenDark\"\n            drawme:dm_maskBrightnessThreshold=\"0.2\"\n            drawme:dm_rippleUseControlHighlight=\"false\"\n            drawme:dm_textColor=\"@android:color/white\"/>\n\n        <com.rafakob.drawme.DrawMeButton\n            android:id=\"@+id/ada4\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"50dp\"\n            android:layout_marginBottom=\"8dp\"\n            android:text=\"Dark pressed dark - Lighter\"\n            drawme:dm_backColor=\"@color/colorGreenDark\"\n            drawme:dm_maskBrightnessThreshold=\"0.2\"\n            drawme:dm_maskColorPressedInverse=\"#9DFFFFFF\"\n            drawme:dm_rippleUseControlHighlight=\"false\"\n            drawme:dm_textColor=\"@android:color/white\"/>\n\n        <TextView\n            style=\"@style/TextDivider\"\n            android:text=\"#09: Other\"/>\n\n        <FrameLayout\n            android:theme=\"@style/AppTheme.ThemeButton\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"wrap_content\"\n            android:layout_marginBottom=\"8dp\">\n\n            <com.rafakob.drawme.DrawMeButton\n                android:layout_width=\"match_parent\"\n                android:layout_height=\"50dp\"\n                android:text=\"Style from theme\"/>\n\n        </FrameLayout>\n\n    </LinearLayout>\n</ScrollView>"
  },
  {
    "path": "app/src/main/res/values/colors.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n    <color name=\"colorPrimary\">#3F51B5</color>\n    <color name=\"colorPrimaryDark\">#303F9F</color>\n    <color name=\"colorAccent\">#FF4081</color>\n    <color name=\"colorGreen\">#80B52B</color>\n    <color name=\"colorGreenDark\">#162303</color>\n    <color name=\"colorBlue\">#1089ec</color>\n    <color name=\"colorYellow\">#f5e100</color>\n\n</resources>\n"
  },
  {
    "path": "app/src/main/res/values/strings.xml",
    "content": "<resources>\n    <string name=\"app_name\">DrawMe</string>\n</resources>\n"
  },
  {
    "path": "app/src/main/res/values/styles.xml",
    "content": "<resources>\n\n    <style name=\"AppTheme\" parent=\"Theme.AppCompat.Light.DarkActionBar\">\n        <item name=\"colorPrimary\">@color/colorPrimary</item>\n        <item name=\"colorPrimaryDark\">@color/colorPrimaryDark</item>\n        <item name=\"colorAccent\">@color/colorAccent</item>\n    </style>\n\n    <style name=\"TextDivider\">\n        <item name=\"android:layout_width\">match_parent</item>\n        <item name=\"android:layout_height\">wrap_content</item>\n        <item name=\"android:paddingTop\">24dp</item>\n        <item name=\"android:paddingBottom\">8dp</item>\n        <item name=\"android:textColor\">#DD000000</item>\n        <item name=\"android:textSize\">16sp</item>\n    </style>\n\n\n    <style name=\"RoundedButton\">\n        <item name=\"android:textAllCaps\">true</item>\n        <item name=\"dm_backColor\">@color/colorAccent</item>\n        <item name=\"dm_backColorDisabled\">@android:color/darker_gray</item>\n        <item name=\"dm_backColorPressed\">@color/colorPrimary</item>\n        <item name=\"dm_radius\">24dp</item>\n        <item name=\"dm_radiusTopRight\">48dp</item>\n        <item name=\"dm_stroke\">4dp</item>\n        <item name=\"dm_strokeColor\">@color/colorPrimary</item>\n        <item name=\"dm_strokeColorDisabled\">@android:color/darker_gray</item>\n        <item name=\"dm_strokeColorPressed\">@color/colorPrimaryDark</item>\n    </style>\n\n    <style name=\"AppTheme.ThemeButton\">\n        <item name=\"buttonStyle\">@style/ThemeButton</item>\n    </style>\n\n    <style name=\"ThemeButton\" parent=\"@style/Widget.AppCompat.Button\">\n        <item name=\"dm_backColor\">@color/colorPrimary</item>\n        <item name=\"dm_backColorPressed\">@color/colorPrimaryDark</item>\n    </style>\n\n</resources>\n"
  },
  {
    "path": "build.gradle",
    "content": "buildscript {\n    repositories {\n        jcenter()\n    }\n    dependencies {\n        classpath 'com.android.tools.build:gradle:2.0.0-rc1'\n        classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3'\n    }\n}\n\nallprojects {\n    repositories {\n        jcenter()\n    }\n}\n\ntask clean(type: Delete) {\n    delete rootProject.buildDir\n}\n"
  },
  {
    "path": "gradle/wrapper/gradle-wrapper.properties",
    "content": "#Mon Dec 28 10:00:20 PST 2015\ndistributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\nzipStoreBase=GRADLE_USER_HOME\nzipStorePath=wrapper/dists\ndistributionUrl=https\\://services.gradle.org/distributions/gradle-2.10-all.zip\n"
  },
  {
    "path": "gradle.properties",
    "content": "# Project-wide Gradle settings.\n\n# IDE (e.g. Android Studio) users:\n# Gradle settings configured through the IDE *will override*\n# any settings specified in this file.\n\n# For more details on how to configure your build environment visit\n# http://www.gradle.org/docs/current/userguide/build_environment.html\n\n# Specifies the JVM arguments used for the daemon process.\n# The setting is particularly useful for tweaking memory settings.\n# Default value: -Xmx10248m -XX:MaxPermSize=256m\n# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8\n\n# When configured, Gradle will run in incubating parallel mode.\n# This option should only be used with decoupled projects. More details, visit\n# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects\n# org.gradle.parallel=true"
  },
  {
    "path": "gradlew",
    "content": "#!/usr/bin/env bash\n\n##############################################################################\n##\n##  Gradle start up script for UN*X\n##\n##############################################################################\n\n# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\nDEFAULT_JVM_OPTS=\"\"\n\nAPP_NAME=\"Gradle\"\nAPP_BASE_NAME=`basename \"$0\"`\n\n# Use the maximum available, or set MAX_FD != -1 to use that value.\nMAX_FD=\"maximum\"\n\nwarn ( ) {\n    echo \"$*\"\n}\n\ndie ( ) {\n    echo\n    echo \"$*\"\n    echo\n    exit 1\n}\n\n# OS specific support (must be 'true' or 'false').\ncygwin=false\nmsys=false\ndarwin=false\ncase \"`uname`\" in\n  CYGWIN* )\n    cygwin=true\n    ;;\n  Darwin* )\n    darwin=true\n    ;;\n  MINGW* )\n    msys=true\n    ;;\nesac\n\n# Attempt to set APP_HOME\n# Resolve links: $0 may be a link\nPRG=\"$0\"\n# Need this for relative symlinks.\nwhile [ -h \"$PRG\" ] ; do\n    ls=`ls -ld \"$PRG\"`\n    link=`expr \"$ls\" : '.*-> \\(.*\\)$'`\n    if expr \"$link\" : '/.*' > /dev/null; then\n        PRG=\"$link\"\n    else\n        PRG=`dirname \"$PRG\"`\"/$link\"\n    fi\ndone\nSAVED=\"`pwd`\"\ncd \"`dirname \\\"$PRG\\\"`/\" >/dev/null\nAPP_HOME=\"`pwd -P`\"\ncd \"$SAVED\" >/dev/null\n\nCLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar\n\n# Determine the Java command to use to start the JVM.\nif [ -n \"$JAVA_HOME\" ] ; then\n    if [ -x \"$JAVA_HOME/jre/sh/java\" ] ; then\n        # IBM's JDK on AIX uses strange locations for the executables\n        JAVACMD=\"$JAVA_HOME/jre/sh/java\"\n    else\n        JAVACMD=\"$JAVA_HOME/bin/java\"\n    fi\n    if [ ! -x \"$JAVACMD\" ] ; then\n        die \"ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\n    fi\nelse\n    JAVACMD=\"java\"\n    which java >/dev/null 2>&1 || die \"ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\nfi\n\n# Increase the maximum file descriptors if we can.\nif [ \"$cygwin\" = \"false\" -a \"$darwin\" = \"false\" ] ; then\n    MAX_FD_LIMIT=`ulimit -H -n`\n    if [ $? -eq 0 ] ; then\n        if [ \"$MAX_FD\" = \"maximum\" -o \"$MAX_FD\" = \"max\" ] ; then\n            MAX_FD=\"$MAX_FD_LIMIT\"\n        fi\n        ulimit -n $MAX_FD\n        if [ $? -ne 0 ] ; then\n            warn \"Could not set maximum file descriptor limit: $MAX_FD\"\n        fi\n    else\n        warn \"Could not query maximum file descriptor limit: $MAX_FD_LIMIT\"\n    fi\nfi\n\n# For Darwin, add options to specify how the application appears in the dock\nif $darwin; then\n    GRADLE_OPTS=\"$GRADLE_OPTS \\\"-Xdock:name=$APP_NAME\\\" \\\"-Xdock:icon=$APP_HOME/media/gradle.icns\\\"\"\nfi\n\n# For Cygwin, switch paths to Windows format before running java\nif $cygwin ; then\n    APP_HOME=`cygpath --path --mixed \"$APP_HOME\"`\n    CLASSPATH=`cygpath --path --mixed \"$CLASSPATH\"`\n    JAVACMD=`cygpath --unix \"$JAVACMD\"`\n\n    # We build the pattern for arguments to be converted via cygpath\n    ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`\n    SEP=\"\"\n    for dir in $ROOTDIRSRAW ; do\n        ROOTDIRS=\"$ROOTDIRS$SEP$dir\"\n        SEP=\"|\"\n    done\n    OURCYGPATTERN=\"(^($ROOTDIRS))\"\n    # Add a user-defined pattern to the cygpath arguments\n    if [ \"$GRADLE_CYGPATTERN\" != \"\" ] ; then\n        OURCYGPATTERN=\"$OURCYGPATTERN|($GRADLE_CYGPATTERN)\"\n    fi\n    # Now convert the arguments - kludge to limit ourselves to /bin/sh\n    i=0\n    for arg in \"$@\" ; do\n        CHECK=`echo \"$arg\"|egrep -c \"$OURCYGPATTERN\" -`\n        CHECK2=`echo \"$arg\"|egrep -c \"^-\"`                                 ### Determine if an option\n\n        if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then                    ### Added a condition\n            eval `echo args$i`=`cygpath --path --ignore --mixed \"$arg\"`\n        else\n            eval `echo args$i`=\"\\\"$arg\\\"\"\n        fi\n        i=$((i+1))\n    done\n    case $i in\n        (0) set -- ;;\n        (1) set -- \"$args0\" ;;\n        (2) set -- \"$args0\" \"$args1\" ;;\n        (3) set -- \"$args0\" \"$args1\" \"$args2\" ;;\n        (4) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" ;;\n        (5) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" ;;\n        (6) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" ;;\n        (7) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" ;;\n        (8) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" \"$args7\" ;;\n        (9) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" \"$args7\" \"$args8\" ;;\n    esac\nfi\n\n# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules\nfunction splitJvmOpts() {\n    JVM_OPTS=(\"$@\")\n}\neval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS\nJVM_OPTS[${#JVM_OPTS[*]}]=\"-Dorg.gradle.appname=$APP_BASE_NAME\"\n\nexec \"$JAVACMD\" \"${JVM_OPTS[@]}\" -classpath \"$CLASSPATH\" org.gradle.wrapper.GradleWrapperMain \"$@\"\n"
  },
  {
    "path": "gradlew.bat",
    "content": "@if \"%DEBUG%\" == \"\" @echo off\r\n@rem ##########################################################################\r\n@rem\r\n@rem  Gradle startup script for Windows\r\n@rem\r\n@rem ##########################################################################\r\n\r\n@rem Set local scope for the variables with windows NT shell\r\nif \"%OS%\"==\"Windows_NT\" setlocal\r\n\r\n@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\r\nset DEFAULT_JVM_OPTS=\r\n\r\nset DIRNAME=%~dp0\r\nif \"%DIRNAME%\" == \"\" set DIRNAME=.\r\nset APP_BASE_NAME=%~n0\r\nset APP_HOME=%DIRNAME%\r\n\r\n@rem Find java.exe\r\nif defined JAVA_HOME goto findJavaFromJavaHome\r\n\r\nset JAVA_EXE=java.exe\r\n%JAVA_EXE% -version >NUL 2>&1\r\nif \"%ERRORLEVEL%\" == \"0\" goto init\r\n\r\necho.\r\necho ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\r\necho.\r\necho Please set the JAVA_HOME variable in your environment to match the\r\necho location of your Java installation.\r\n\r\ngoto fail\r\n\r\n:findJavaFromJavaHome\r\nset JAVA_HOME=%JAVA_HOME:\"=%\r\nset JAVA_EXE=%JAVA_HOME%/bin/java.exe\r\n\r\nif exist \"%JAVA_EXE%\" goto init\r\n\r\necho.\r\necho ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%\r\necho.\r\necho Please set the JAVA_HOME variable in your environment to match the\r\necho location of your Java installation.\r\n\r\ngoto fail\r\n\r\n:init\r\n@rem Get command-line arguments, handling Windowz variants\r\n\r\nif not \"%OS%\" == \"Windows_NT\" goto win9xME_args\r\nif \"%@eval[2+2]\" == \"4\" goto 4NT_args\r\n\r\n:win9xME_args\r\n@rem Slurp the command line arguments.\r\nset CMD_LINE_ARGS=\r\nset _SKIP=2\r\n\r\n:win9xME_args_slurp\r\nif \"x%~1\" == \"x\" goto execute\r\n\r\nset CMD_LINE_ARGS=%*\r\ngoto execute\r\n\r\n:4NT_args\r\n@rem Get arguments from the 4NT Shell from JP Software\r\nset CMD_LINE_ARGS=%$\r\n\r\n:execute\r\n@rem Setup the command line\r\n\r\nset CLASSPATH=%APP_HOME%\\gradle\\wrapper\\gradle-wrapper.jar\r\n\r\n@rem Execute Gradle\r\n\"%JAVA_EXE%\" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% \"-Dorg.gradle.appname=%APP_BASE_NAME%\" -classpath \"%CLASSPATH%\" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%\r\n\r\n:end\r\n@rem End local scope for the variables with windows NT shell\r\nif \"%ERRORLEVEL%\"==\"0\" goto mainEnd\r\n\r\n:fail\r\nrem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of\r\nrem the _cmd.exe /c_ return code!\r\nif  not \"\" == \"%GRADLE_EXIT_CONSOLE%\" exit 1\r\nexit /b 1\r\n\r\n:mainEnd\r\nif \"%OS%\"==\"Windows_NT\" endlocal\r\n\r\n:omega\r\n"
  },
  {
    "path": "library/.gitignore",
    "content": "/build\n"
  },
  {
    "path": "library/build.gradle",
    "content": "apply plugin: 'com.android.library'\napply plugin: 'com.github.dcendents.android-maven'\n\ndef versionMajor = 0\ndef versionMinor = 1\ndef versionPatch = 6\n\nandroid {\n    compileSdkVersion 23\n    buildToolsVersion \"23.0.2\"\n\n    defaultConfig {\n        minSdkVersion 10\n        targetSdkVersion 23\n        versionCode versionMajor * 1000000 + versionMinor * 1000 + versionPatch\n        versionName \"${versionMajor}.${versionMinor}.${versionPatch}\"\n    }\n    buildTypes {\n        release {\n            minifyEnabled false\n            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'\n        }\n    }\n}\n\ndependencies {\n    compile fileTree(dir: 'libs', include: ['*.jar'])\n    testCompile 'junit:junit:4.12'\n    compile 'com.android.support:appcompat-v7:23.2.1'\n}\n\n// build a jar with source files\ntask sourcesJar(type: Jar) {\n    from android.sourceSets.main.java.srcDirs\n    classifier = 'sources'\n}\n\ntask javadoc(type: Javadoc) {\n    failOnError false\n    source = android.sourceSets.main.java.sourceFiles\n    classpath += project.files(android.getBootClasspath().join(File.pathSeparator))\n}\n\n// build a jar with javadoc\ntask javadocJar(type: Jar, dependsOn: javadoc) {\n    classifier = 'javadoc'\n    from javadoc.destinationDir\n}"
  },
  {
    "path": "library/proguard-rules.pro",
    "content": "# Add project specific ProGuard rules here.\n# By default, the flags in this file are appended to flags specified\n# in /Users/rafakob/Library/Android/sdk/tools/proguard/proguard-android.txt\n# You can edit the include path and order by changing the proguardFiles\n# directive in build.gradle.\n#\n# For more details, see\n#   http://developer.android.com/guide/developing/tools/proguard.html\n\n# Add any project specific keep options here:\n\n# If your project uses WebView with JS, uncomment the following\n# and specify the fully qualified class name to the JavaScript interface\n# class:\n#-keepclassmembers class fqcn.of.javascript.interface.for.webview {\n#   public *;\n#}\n"
  },
  {
    "path": "library/src/main/AndroidManifest.xml",
    "content": "<manifest package=\"com.rafakob.drawme\">\n\n    <application/>\n\n</manifest>\n"
  },
  {
    "path": "library/src/main/java/com/rafakob/drawme/DrawMeButton.java",
    "content": "package com.rafakob.drawme;\n\nimport android.content.Context;\nimport android.support.v7.widget.AppCompatButton;\nimport android.util.AttributeSet;\n\nimport com.rafakob.drawme.delegate.DrawMe;\nimport com.rafakob.drawme.delegate.DrawMeShapeText;\n\npublic class DrawMeButton extends AppCompatButton {\n\n    private final DrawMe drawMe;\n\n    public DrawMeButton(Context context) {\n        this(context, null);\n    }\n\n    public DrawMeButton(Context context, AttributeSet attrs) {\n        this(context, attrs, R.attr.buttonStyle);\n    }\n\n    public DrawMeButton(Context context, AttributeSet attrs, int defStyleAttr) {\n        super(context, attrs, defStyleAttr);\n        drawMe = new DrawMeShapeText(context, this, attrs, defStyleAttr);\n    }\n\n    @Override\n    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {\n        int[] size = drawMe.onMeasure(widthMeasureSpec, heightMeasureSpec);\n        super.onMeasure(size[0], size[1]);\n    }\n\n    @Override\n    protected void onLayout(boolean changed, int left, int top, int right, int bottom) {\n        super.onLayout(changed, left, top, right, bottom);\n        drawMe.onLayout(changed, left, top, right, bottom);\n    }\n}"
  },
  {
    "path": "library/src/main/java/com/rafakob/drawme/DrawMeEditText.java",
    "content": "package com.rafakob.drawme;\n\nimport android.content.Context;\nimport android.util.AttributeSet;\nimport android.widget.EditText;\nimport com.rafakob.drawme.delegate.DrawMe;\nimport com.rafakob.drawme.delegate.DrawMeShapeText;\n\npublic class DrawMeEditText extends EditText {\n  private final DrawMe drawMe;\n\n  public DrawMeEditText(Context context) {\n    super(context);\n    drawMe = new DrawMeShapeText(context, this, null);\n  }\n\n  public DrawMeEditText(Context context, AttributeSet attrs) {\n    super(context, attrs);\n    drawMe = new DrawMeShapeText(context, this, attrs);\n  }\n\n  @Override\n  protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {\n    int[] size = drawMe.onMeasure(widthMeasureSpec, heightMeasureSpec);\n    super.onMeasure(size[0], size[1]);\n  }\n\n  @Override\n  protected void onLayout(boolean changed, int left, int top, int right, int bottom) {\n    super.onLayout(changed, left, top, right, bottom);\n    drawMe.onLayout(changed, left, top, right, bottom);\n  }\n}\n"
  },
  {
    "path": "library/src/main/java/com/rafakob/drawme/DrawMeFrameLayout.java",
    "content": "package com.rafakob.drawme;\n\nimport android.content.Context;\nimport android.util.AttributeSet;\nimport android.widget.FrameLayout;\n\nimport com.rafakob.drawme.delegate.DrawMe;\nimport com.rafakob.drawme.delegate.DrawMeShape;\n\npublic class DrawMeFrameLayout extends FrameLayout {\n    private final DrawMe drawMe;\n\n    public DrawMeFrameLayout(Context context) {\n        super(context);\n        drawMe = new DrawMeShape(context, this, null);\n    }\n\n    public DrawMeFrameLayout(Context context, AttributeSet attrs) {\n        super(context, attrs);\n        drawMe = new DrawMeShape(context, this, attrs);\n    }\n\n    @Override\n    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {\n        int[] size = drawMe.onMeasure(widthMeasureSpec, heightMeasureSpec);\n        super.onMeasure(size[0], size[1]);\n    }\n\n    @Override\n    protected void onLayout(boolean changed, int left, int top, int right, int bottom) {\n        super.onLayout(changed, left, top, right, bottom);\n        drawMe.onLayout(changed, left, top, right, bottom);\n    }\n}"
  },
  {
    "path": "library/src/main/java/com/rafakob/drawme/DrawMeImageButton.java",
    "content": "package com.rafakob.drawme;\n\nimport android.content.Context;\nimport android.util.AttributeSet;\nimport android.widget.ImageButton;\n\nimport com.rafakob.drawme.delegate.DrawMe;\nimport com.rafakob.drawme.delegate.DrawMeShape;\n\npublic class DrawMeImageButton extends ImageButton {\n    private final DrawMe drawMe;\n\n    public DrawMeImageButton(Context context) {\n        super(context);\n        drawMe = new DrawMeShape(context, this, null);\n    }\n\n    public DrawMeImageButton(Context context, AttributeSet attrs) {\n        super(context, attrs);\n        drawMe = new DrawMeShape(context, this, attrs);\n    }\n\n    @Override\n    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {\n        int[] size = drawMe.onMeasure(widthMeasureSpec, heightMeasureSpec);\n        super.onMeasure(size[0], size[1]);\n    }\n\n    @Override\n    protected void onLayout(boolean changed, int left, int top, int right, int bottom) {\n        super.onLayout(changed, left, top, right, bottom);\n        drawMe.onLayout(changed, left, top, right, bottom);\n    }\n}"
  },
  {
    "path": "library/src/main/java/com/rafakob/drawme/DrawMeLinearLayout.java",
    "content": "package com.rafakob.drawme;\n\nimport android.content.Context;\nimport android.util.AttributeSet;\nimport android.widget.LinearLayout;\n\nimport com.rafakob.drawme.delegate.DrawMe;\nimport com.rafakob.drawme.delegate.DrawMeShape;\n\npublic class DrawMeLinearLayout extends LinearLayout {\n    private final DrawMe drawMe;\n\n    public DrawMeLinearLayout(Context context) {\n        super(context);\n        drawMe = new DrawMeShape(context, this, null);\n    }\n\n    public DrawMeLinearLayout(Context context, AttributeSet attrs) {\n        super(context, attrs);\n        drawMe = new DrawMeShape(context, this, attrs);\n    }\n\n    @Override\n    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {\n        int[] size = drawMe.onMeasure(widthMeasureSpec, heightMeasureSpec);\n        super.onMeasure(size[0], size[1]);\n    }\n\n    @Override\n    protected void onLayout(boolean changed, int left, int top, int right, int bottom) {\n        super.onLayout(changed, left, top, right, bottom);\n        drawMe.onLayout(changed, left, top, right, bottom);\n    }\n}\n"
  },
  {
    "path": "library/src/main/java/com/rafakob/drawme/DrawMeRelativeLayout.java",
    "content": "package com.rafakob.drawme;\n\nimport android.content.Context;\nimport android.util.AttributeSet;\nimport android.widget.RelativeLayout;\n\nimport com.rafakob.drawme.delegate.DrawMe;\nimport com.rafakob.drawme.delegate.DrawMeShape;\n\npublic class DrawMeRelativeLayout extends RelativeLayout {\n    private final DrawMe drawMe;\n\n    public DrawMeRelativeLayout(Context context) {\n        super(context);\n        drawMe = new DrawMeShape(context, this, null);\n    }\n\n    public DrawMeRelativeLayout(Context context, AttributeSet attrs) {\n        super(context, attrs);\n        drawMe = new DrawMeShape(context, this, attrs);\n    }\n\n    @Override\n    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {\n        int[] size = drawMe.onMeasure(widthMeasureSpec, heightMeasureSpec);\n        super.onMeasure(size[0], size[1]);\n    }\n\n    @Override\n    protected void onLayout(boolean changed, int left, int top, int right, int bottom) {\n        super.onLayout(changed, left, top, right, bottom);\n        drawMe.onLayout(changed, left, top, right, bottom);\n    }\n}\n"
  },
  {
    "path": "library/src/main/java/com/rafakob/drawme/DrawMeTextView.java",
    "content": "package com.rafakob.drawme;\n\nimport android.content.Context;\nimport android.util.AttributeSet;\nimport android.widget.TextView;\n\nimport com.rafakob.drawme.delegate.DrawMe;\nimport com.rafakob.drawme.delegate.DrawMeShapeText;\n\npublic class DrawMeTextView extends TextView {\n    private final DrawMe drawMe;\n\n    public DrawMeTextView(Context context) {\n        super(context);\n        drawMe = new DrawMeShapeText(context, this, null);\n    }\n\n    public DrawMeTextView(Context context, AttributeSet attrs) {\n        super(context, attrs);\n        drawMe = new DrawMeShapeText(context, this, attrs);\n    }\n\n    @Override\n    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {\n        int[] size = drawMe.onMeasure(widthMeasureSpec, heightMeasureSpec);\n        super.onMeasure(size[0], size[1]);\n    }\n\n    @Override\n    protected void onLayout(boolean changed, int left, int top, int right, int bottom) {\n        super.onLayout(changed, left, top, right, bottom);\n        drawMe.onLayout(changed, left, top, right, bottom);\n    }\n}\n"
  },
  {
    "path": "library/src/main/java/com/rafakob/drawme/delegate/DrawMe.java",
    "content": "package com.rafakob.drawme.delegate;\n\npublic interface DrawMe {\n    void updateLayout();\n\n    void onLayout(boolean changed, int left, int top, int right, int bottom);\n\n    int[] onMeasure(int widthMeasureSpec, int heightMeasureSpec);\n}\n"
  },
  {
    "path": "library/src/main/java/com/rafakob/drawme/delegate/DrawMeShape.java",
    "content": "package com.rafakob.drawme.delegate;\n\nimport android.annotation.TargetApi;\nimport android.content.Context;\nimport android.content.res.ColorStateList;\nimport android.content.res.TypedArray;\nimport android.graphics.Color;\nimport android.graphics.drawable.Drawable;\nimport android.graphics.drawable.GradientDrawable;\nimport android.graphics.drawable.RippleDrawable;\nimport android.graphics.drawable.StateListDrawable;\nimport android.os.Build;\nimport android.support.annotation.AttrRes;\nimport android.support.annotation.ColorInt;\nimport android.util.AttributeSet;\nimport android.view.View;\n\nimport com.rafakob.drawme.R;\nimport com.rafakob.drawme.util.Coloring;\n\nimport java.util.Arrays;\n\n\n/**\n * Base delegate that holds all shape attributes and accessors.\n */\npublic class DrawMeShape implements DrawMe {\n    /* Widget */\n    protected final View mView;\n    /* Background color */\n    protected int backColor;\n    protected int backColorPressed;\n    protected int backColorDisabled;\n    /* Stroke */\n    protected int stroke;\n    protected int strokeColor;\n    protected int strokeColorPressed;\n    protected int strokeColorDisabled;\n    /* Corner radius */\n    protected int radius;\n    protected int radiusBottomLeft;\n    protected int radiusBottomRight;\n    protected int radiusTopLeft;\n    protected int radiusTopRight;\n    /* Mask */\n    protected float maskBrightnessThreshold;\n    protected int maskColorPressed;\n    protected int maskColorPressedInverse;\n    protected int maskColorDisabled;\n    /* Params */\n    protected boolean rippleEffect;\n    protected boolean rippleUseControlHighlight;\n    protected boolean statePressed;\n    protected boolean stateDisabled;\n    protected boolean shapeEqualWidthHeight;\n    protected boolean shapeRadiusHalfHeight;\n\n    public DrawMeShape(Context context, View view) {\n        this(context, view, null);\n    }\n\n    public DrawMeShape(Context context, View view, AttributeSet attrs) {\n        this(context, view, attrs, 0);\n    }\n\n    public DrawMeShape(Context context, View view, AttributeSet attrs, @AttrRes int defStyleAttr) {\n        this.mView = view;\n        obtainAttributes(context, attrs, defStyleAttr);\n    }\n\n    public void obtainAttributes(Context context, AttributeSet attrs, @AttrRes int defStyleAttr) {\n        TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.DrawMe, defStyleAttr, 0);\n        obtainShapeAttributes(typedArray);\n        typedArray.recycle();\n    }\n\n    protected void obtainShapeAttributes(TypedArray a) {\n        rippleEffect = a.getBoolean(R.styleable.DrawMe_dm_rippleEffect, true);\n        rippleUseControlHighlight = a.getBoolean(R.styleable.DrawMe_dm_rippleUseControlHighlight, true);\n        statePressed = a.getBoolean(R.styleable.DrawMe_dm_statePressed, true);\n        stateDisabled = a.getBoolean(R.styleable.DrawMe_dm_stateDisabled, true);\n        shapeEqualWidthHeight = a.getBoolean(R.styleable.DrawMe_dm_shapeEqualWidthHeight, false);\n        shapeRadiusHalfHeight = a.getBoolean(R.styleable.DrawMe_dm_shapeRadiusHalfHeight, false);\n\n        maskBrightnessThreshold = a.getFloat(R.styleable.DrawMe_dm_maskBrightnessThreshold, 0);\n        maskColorPressed = a.getColor(R.styleable.DrawMe_dm_maskColorPressed, Color.parseColor(\"#1F000000\"));\n        maskColorPressedInverse = a.getColor(R.styleable.DrawMe_dm_maskColorPressedInverse, Color.parseColor(\"#1DFFFFFF\"));\n        maskColorDisabled = a.getColor(R.styleable.DrawMe_dm_maskColorDisabled, Color.parseColor(\"#6DFFFFFF\"));\n\n        stroke = a.getDimensionPixelSize(R.styleable.DrawMe_dm_stroke, 0);\n        radius = a.getDimensionPixelSize(R.styleable.DrawMe_dm_radius, 0);\n        radiusBottomLeft = a.getDimensionPixelSize(R.styleable.DrawMe_dm_radiusBottomLeft, -1);\n        radiusBottomRight = a.getDimensionPixelSize(R.styleable.DrawMe_dm_radiusBottomRight, -1);\n        radiusTopLeft = a.getDimensionPixelSize(R.styleable.DrawMe_dm_radiusTopLeft, -1);\n        radiusTopRight = a.getDimensionPixelSize(R.styleable.DrawMe_dm_radiusTopRight, -1);\n\n        backColor = a.getColor(R.styleable.DrawMe_dm_backColor, Color.TRANSPARENT);\n        backColorPressed = a.getColor(R.styleable.DrawMe_dm_backColorPressed, defaultPressedColor(backColor));\n        backColorDisabled = a.getColor(R.styleable.DrawMe_dm_backColorDisabled, defaultDisabledColor(backColor));\n\n        strokeColor = a.getColor(R.styleable.DrawMe_dm_strokeColor, Color.GRAY);\n        strokeColorPressed = a.getColor(R.styleable.DrawMe_dm_strokeColorPressed, defaultPressedColor(strokeColor));\n        strokeColorDisabled = a.getColor(R.styleable.DrawMe_dm_strokeColorDisabled, defaultDisabledColor(strokeColor));\n    }\n\n    @Override\n    public void onLayout(boolean changed, int left, int top, int right, int bottom) {\n        if (shapeRadiusHalfHeight) {\n            radius = mView.getHeight() / 2;\n        }\n        updateLayout();\n    }\n\n    @Override\n    public int[] onMeasure(int widthMeasureSpec, int heightMeasureSpec) {\n        int[] size = new int[2];\n        if (shapeEqualWidthHeight && mView.getWidth() > 0 && mView.getHeight() > 0) {\n            int max = Math.max(mView.getWidth(), mView.getHeight());\n            int measureSpec = View.MeasureSpec.makeMeasureSpec(max, View.MeasureSpec.EXACTLY);\n            size[0] = measureSpec;\n            size[1] = measureSpec;\n            return size;\n        }\n        size[0] = widthMeasureSpec;\n        size[1] = heightMeasureSpec;\n        return size;\n    }\n\n    @Override\n    public void updateLayout() {\n        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {\n            mView.setBackground(createBackground());\n        } else {\n            mView.setBackgroundDrawable(createBackground());\n        }\n    }\n\n    private Drawable createBackground() {\n        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP && rippleEffect) {\n            return createRippleDrawable();\n        } else {\n            return createStateListDrawable();\n        }\n    }\n\n    /**\n     * Creates background shape - setups background, stroke and radius.\n     *\n     * @param backgroundColor Background color.\n     * @param strokeColor     Stroke color.\n     * @return Shape drawable.\n     */\n    private Drawable createShape(int backgroundColor, int strokeColor) {\n        GradientDrawable shape = new GradientDrawable();\n        shape.setColor(backgroundColor);\n\n        final float[] radiusArray = new float[8];\n        Arrays.fill(radiusArray, radius);\n\n        if (radiusTopLeft >= 0) {\n            radiusArray[0] = radiusTopLeft;\n            radiusArray[1] = radiusTopLeft;\n        }\n\n        if (radiusTopRight >= 0) {\n            radiusArray[2] = radiusTopRight;\n            radiusArray[3] = radiusTopRight;\n        }\n\n        if (radiusBottomRight >= 0) {\n            radiusArray[4] = radiusBottomRight;\n            radiusArray[5] = radiusBottomRight;\n        }\n\n        if (radiusBottomLeft >= 0) {\n            radiusArray[6] = radiusBottomLeft;\n            radiusArray[7] = radiusBottomLeft;\n        }\n        shape.setCornerRadii(radiusArray);\n        shape.setStroke(stroke, strokeColor);\n        return shape;\n    }\n\n\n    private StateListDrawable createStateListDrawable() {\n        StateListDrawable states = new StateListDrawable();\n        if (stateDisabled) {\n            states.addState(new int[]{-android.R.attr.state_enabled}, createShape(backColorDisabled, strokeColorDisabled));\n        }\n        if (statePressed) {\n            states.addState(new int[]{android.R.attr.state_pressed}, createShape(backColorPressed, strokeColorPressed));\n        }\n        states.addState(new int[]{}, createShape(backColor, strokeColor));\n        return states;\n    }\n\n    @TargetApi(Build.VERSION_CODES.LOLLIPOP)\n    private Drawable createRippleDrawable() {\n        if (!statePressed) {\n            return getRippleContentDrawable();\n        } else if (backColorPressed == Color.TRANSPARENT && strokeColorPressed != Color.TRANSPARENT) {\n            // highlight only stroke\n            return new RippleDrawable(ColorStateList.valueOf(strokeColorPressed), getRippleContentDrawable(), createShape(Color.TRANSPARENT, Color.WHITE));\n\n        } else {\n            return new RippleDrawable(ColorStateList.valueOf(backColorPressed), getRippleContentDrawable(), createShape(Color.WHITE, Color.WHITE));\n        }\n    }\n\n    /**\n     * Creates content drawable for a RippleDrawable.\n     *\n     * @return\n     */\n    private Drawable getRippleContentDrawable() {\n        if (!stateDisabled) {\n            return createShape(backColor, strokeColor);\n        } else {\n            StateListDrawable states = new StateListDrawable();\n            states.addState(new int[]{-android.R.attr.state_enabled}, createShape(backColorDisabled, strokeColorDisabled));\n            states.addState(new int[]{}, createShape(backColor, strokeColor));\n            return states;\n        }\n    }\n\n    /**\n     * Calculates default color value for pressed color.\n     * On PreL mixes normal state color with a \"shadow mask\", on L uses theme attribute colorControlHighlight.\n     *\n     * @param normalColor\n     * @return\n     */\n    @ColorInt\n    private int defaultPressedColor(int normalColor) {\n        if (maskBrightnessThreshold > 0 && Coloring.getColorBrightness(normalColor) < maskBrightnessThreshold) {\n            return Coloring.mix(maskColorPressedInverse, normalColor);\n        }\n\n        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP && rippleUseControlHighlight) {\n            return Coloring.getThemeColor(mView.getContext(), R.attr.colorControlHighlight);\n        } else {\n            return Coloring.mix(maskColorPressed, normalColor);\n        }\n    }\n\n    /**\n     * Calculates default color value for disabled color.\n     * Mixes state color with a \"lighter mask\".\n     *\n     * @param normalColor\n     * @return\n     */\n    @ColorInt\n    private int defaultDisabledColor(int normalColor) {\n        return Coloring.mix(maskColorDisabled, normalColor);\n    }\n}"
  },
  {
    "path": "library/src/main/java/com/rafakob/drawme/delegate/DrawMeShapeText.java",
    "content": "package com.rafakob.drawme.delegate;\n\nimport android.content.Context;\nimport android.content.res.ColorStateList;\nimport android.content.res.TypedArray;\nimport android.graphics.PorterDuff;\nimport android.graphics.drawable.Drawable;\nimport android.os.Build;\nimport android.support.annotation.AttrRes;\nimport android.support.v4.graphics.drawable.DrawableCompat;\nimport android.text.TextUtils;\nimport android.util.AttributeSet;\nimport android.view.View;\nimport android.widget.TextView;\n\nimport com.rafakob.drawme.R;\nimport com.rafakob.drawme.util.FontCache;\n\npublic class DrawMeShapeText extends DrawMeShape {\n    protected String font;\n    protected int textColor;\n    protected int textColorPressed;\n    protected int textColorDisabled;\n    protected int tintColor;\n    protected int tintMode;\n\n    public DrawMeShapeText(Context context, View view) {\n        super(context, view);\n    }\n\n    public DrawMeShapeText(Context context, View view, AttributeSet attrs) {\n        super(context, view, attrs);\n    }\n\n    public DrawMeShapeText(Context context, View view, AttributeSet attrs, @AttrRes int defStyleAttr) {\n        super(context, view, attrs, defStyleAttr);\n    }\n\n    protected void obtainTextAttributes(TypedArray a) {\n        font = a.getString(R.styleable.DrawMeText_dm_font);\n        textColor = a.getColor(R.styleable.DrawMeText_dm_textColor, ((TextView) mView).getTextColors().getDefaultColor());\n        textColorPressed = a.getColor(R.styleable.DrawMeText_dm_textColorPressed, textColor);\n        textColorDisabled = a.getColor(R.styleable.DrawMeText_dm_textColorDisabled, textColor);\n\n        tintColor = a.getColor(R.styleable.DrawMeText_dm_drawableTint, 0);\n        tintMode = a.getInt(R.styleable.DrawMeText_dm_drawableTintMode, 0);\n\n        Drawable left = tintDrawable(a.getDrawable(R.styleable.DrawMeText_android_drawableLeft));\n        Drawable start = tintDrawable(a.getDrawable(R.styleable.DrawMeText_android_drawableStart));\n        Drawable top = tintDrawable(a.getDrawable(R.styleable.DrawMeText_android_drawableTop));\n        Drawable right = tintDrawable(a.getDrawable(R.styleable.DrawMeText_android_drawableRight));\n        Drawable end = tintDrawable(a.getDrawable(R.styleable.DrawMeText_android_drawableEnd));\n        Drawable bottom = tintDrawable(a.getDrawable(R.styleable.DrawMeText_android_drawableBottom));\n\n        ((TextView) mView).setCompoundDrawablesWithIntrinsicBounds(left == null ? start : left, top, right == null ? end : right, bottom);\n    }\n\n    @Override\n    public void obtainAttributes(Context context, AttributeSet attrs, @AttrRes int defStyleAttr) {\n        super.obtainAttributes(context, attrs, defStyleAttr);\n        TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.DrawMeText, defStyleAttr, 0);\n        obtainTextAttributes(typedArray);\n        typedArray.recycle();\n\n        if (!TextUtils.isEmpty(font))\n            applyFont();\n    }\n\n    private void applyFont() {\n        ((TextView) mView).setTypeface(FontCache.get(mView.getContext(), font));\n    }\n\n    private Drawable tintDrawable(Drawable drawable) {\n        return tintDrawable(drawable, tintColor, tintMode);\n    }\n\n    private Drawable tintDrawable(Drawable drawable, int tintColor, int tintMode) {\n        if (drawable == null || tintColor == 0) return drawable;\n\n        Drawable wrapDrawable = DrawableCompat.wrap(drawable).mutate();\n        DrawableCompat.setTint(wrapDrawable, tintColor);\n\n        PorterDuff.Mode mode = intToMode(tintMode);\n        if (mode != null && mode != PorterDuff.Mode.CLEAR)\n            DrawableCompat.setTintMode(wrapDrawable, mode);\n        return wrapDrawable;\n    }\n\n    private PorterDuff.Mode intToMode(int val) {\n        switch (val) {\n            default:\n            case 0:\n                return PorterDuff.Mode.CLEAR;\n            case 1:\n                return PorterDuff.Mode.SRC;\n            case 2:\n                return PorterDuff.Mode.DST;\n            case 3:\n                return PorterDuff.Mode.SRC_OVER;\n            case 4:\n                return PorterDuff.Mode.DST_OVER;\n            case 5:\n                return PorterDuff.Mode.SRC_IN;\n            case 6:\n                return PorterDuff.Mode.DST_IN;\n            case 7:\n                return PorterDuff.Mode.SRC_OUT;\n            case 8:\n                return PorterDuff.Mode.DST_OUT;\n            case 9:\n                return PorterDuff.Mode.SRC_ATOP;\n            case 10:\n                return PorterDuff.Mode.DST_ATOP;\n            case 11:\n                return PorterDuff.Mode.XOR;\n            case 16:\n                return PorterDuff.Mode.DARKEN;\n            case 17:\n                return PorterDuff.Mode.LIGHTEN;\n            case 13:\n                return PorterDuff.Mode.MULTIPLY;\n            case 14:\n                return PorterDuff.Mode.SCREEN;\n            case 12:\n                if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {\n                    return PorterDuff.Mode.ADD;\n                }\n                break;\n            case 15:\n                return PorterDuff.Mode.OVERLAY;\n        }\n        return PorterDuff.Mode.CLEAR;\n    }\n\n    @Override\n    public void updateLayout() {\n        super.updateLayout();\n        if (textColorPressed != Integer.MAX_VALUE) {\n            ColorStateList textColors = ((TextView) mView).getTextColors();\n\n            ColorStateList colorStateList = new ColorStateList(\n                    new int[][]{\n                            new int[]{-android.R.attr.state_enabled},\n                            new int[]{android.R.attr.state_pressed},\n                            new int[]{},\n                    },\n                    new int[]{\n                            textColorDisabled,\n                            textColorPressed,\n                            textColor});\n\n            ((TextView) mView).setTextColor(colorStateList);\n        }\n    }\n}\n"
  },
  {
    "path": "library/src/main/java/com/rafakob/drawme/util/Coloring.java",
    "content": "package com.rafakob.drawme.util;\n\nimport android.content.Context;\nimport android.content.res.ColorStateList;\nimport android.graphics.Bitmap;\nimport android.graphics.Canvas;\nimport android.graphics.Color;\nimport android.graphics.drawable.ColorDrawable;\nimport android.os.Build;\nimport android.support.annotation.AttrRes;\nimport android.support.annotation.ColorInt;\nimport android.support.annotation.NonNull;\nimport android.util.TypedValue;\n\npublic class Coloring {\n    public static String intToHex(@ColorInt int color) {\n        return String.format(\"#%06X\", color);\n    }\n\n    @ColorInt\n    public static int mix(int A, int B) {\n        int rA = Color.red(A);\n        int gA = Color.green(A);\n        int bA = Color.blue(A);\n        int aA = Color.alpha(A);\n\n        int rB = Color.red(B);\n        int gB = Color.green(B);\n        int bB = Color.blue(B);\n        int aB = Color.alpha(B);\n\n\n        int rOut = (rA * aA / 255) + (rB * aB * (255 - aA) / (255 * 255));\n        int gOut = (gA * aA / 255) + (gB * aB * (255 - aA) / (255 * 255));\n        int bOut = (bA * aA / 255) + (bB * aB * (255 - aA) / (255 * 255));\n        int aOut = aA + (aB * (255 - aA) / 255);\n\n        return Color.argb(aOut, rOut, gOut, bOut);\n    }\n\n    @ColorInt\n    public static int getThemeColor(@NonNull Context context, @AttrRes int attributeColor) {\n        TypedValue typedValue = new TypedValue();\n        if (context.getTheme().resolveAttribute(attributeColor, typedValue, true)) {\n            return typedValue.data;\n        }\n        return 0;\n    }\n\n    public static float getColorBrightness(int normalColor) {\n        int r = Color.red(normalColor);\n        int g = Color.green(normalColor);\n        int b = Color.blue(normalColor);\n        return ((b + r + r + g + g + g) / 6 / 255f);\n    }\n\n    @ColorInt\n    public static int getDrawableColor(ColorDrawable colorDrawable) {\n        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {\n            return colorDrawable.getColor();\n        } else {\n            // http://stackoverflow.com/questions/15982044/get-activity-background-color-in-android-api-level-8\n            Bitmap bitmap = Bitmap.createBitmap(1, 1, Bitmap.Config.ARGB_4444);\n            Canvas canvas = new Canvas(bitmap);\n            colorDrawable.draw(canvas);\n            final int color = bitmap.getPixel(0, 0);\n            bitmap.recycle();\n            return color;\n        }\n    }\n\n    public static ColorStateList getColorStateList(int normalColor, int pressedColor, int disabledColor) {\n        return new ColorStateList(\n                new int[][]{\n                        new int[]{-android.R.attr.state_enabled,\n                                -android.R.attr.state_pressed,\n                                -android.R.attr.state_selected,\n                                -android.R.attr.state_focused},\n                        new int[]{android.R.attr.state_pressed},\n                        new int[]{}\n                },\n                new int[]{\n                        disabledColor,\n                        pressedColor,\n                        normalColor}\n        );\n    }\n}\n"
  },
  {
    "path": "library/src/main/java/com/rafakob/drawme/util/FontCache.java",
    "content": "package com.rafakob.drawme.util;\n\nimport android.content.Context;\nimport android.graphics.Typeface;\nimport android.support.v4.util.SimpleArrayMap;\n\npublic class FontCache {\n    private static final SimpleArrayMap<String, Typeface> cache = new SimpleArrayMap<>();\n\n    public static Typeface get(Context c, String name) {\n        synchronized (cache) {\n            if (!cache.containsKey(name)) {\n                try {\n                    Typeface t = Typeface.createFromAsset(c.getAssets(), String.format(\"fonts/%s\", name));\n                    cache.put(name, t);\n                    return t;\n                } catch (RuntimeException e) {\n                    return null;\n                }\n            }\n            return cache.get(name);\n        }\n    }\n}\n"
  },
  {
    "path": "library/src/main/res/values/attrs.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n    <declare-styleable name=\"DrawMe\">\n        <attr name=\"dm_backColor\" format=\"color\"/>\n        <attr name=\"dm_backColorDisabled\" format=\"color\"/>\n        <attr name=\"dm_backColorPressed\" format=\"color\"/>\n        <attr name=\"dm_maskBrightnessThreshold\" format=\"float\"/>\n        <attr name=\"dm_maskColorPressed\" format=\"color\"/>\n        <attr name=\"dm_maskColorPressedInverse\" format=\"color\"/>\n        <attr name=\"dm_maskColorDisabled\" format=\"color\"/>\n        <attr name=\"dm_radius\" format=\"dimension\"/>\n        <attr name=\"dm_radiusBottomLeft\" format=\"dimension\"/>\n        <attr name=\"dm_radiusBottomRight\" format=\"dimension\"/>\n        <attr name=\"dm_radiusTopLeft\" format=\"dimension\"/>\n        <attr name=\"dm_radiusTopRight\" format=\"dimension\"/>\n        <attr name=\"dm_rippleEffect\" format=\"boolean\"/>\n        <attr name=\"dm_rippleUseControlHighlight\" format=\"boolean\"/>\n        <attr name=\"dm_shapeEqualWidthHeight\" format=\"boolean\"/>\n        <attr name=\"dm_shapeRadiusHalfHeight\" format=\"boolean\"/>\n        <attr name=\"dm_stateDisabled\" format=\"boolean\"/>\n        <attr name=\"dm_statePressed\" format=\"boolean\"/>\n        <attr name=\"dm_stroke\" format=\"dimension\"/>\n        <attr name=\"dm_strokeColor\" format=\"color\"/>\n        <attr name=\"dm_strokeColorDisabled\" format=\"color\"/>\n        <attr name=\"dm_strokeColorPressed\" format=\"color\"/>\n    </declare-styleable>\n\n    <declare-styleable name=\"DrawMeText\">\n        <attr name=\"android:drawableLeft\"/>\n        <attr name=\"android:drawableStart\"/>\n        <attr name=\"android:drawableEnd\"/>\n        <attr name=\"android:drawableRight\"/>\n        <attr name=\"android:drawableTop\"/>\n        <attr name=\"android:drawableBottom\"/>\n        <attr name=\"dm_drawableTint\" format=\"color\"/>\n        <attr name=\"dm_drawableTintMode\" format=\"integer\">\n            <enum name=\"clear\" value=\"0\"/>\n            <enum name=\"src\" value=\"1\"/>\n            <enum name=\"dst\" value=\"2\"/>\n            <enum name=\"src_over\" value=\"3\"/>\n            <enum name=\"dst_over\" value=\"4\"/>\n            <enum name=\"src_in\" value=\"5\"/>\n            <enum name=\"dst_in\" value=\"6\"/>\n            <enum name=\"src_out\" value=\"7\"/>\n            <enum name=\"dst_out\" value=\"8\"/>\n            <enum name=\"src_atop\" value=\"9\"/>\n            <enum name=\"dst_atop\" value=\"10\"/>\n            <enum name=\"xor\" value=\"11\"/>\n            <enum name=\"darken\" value=\"16\"/>\n            <enum name=\"lighten\" value=\"17\"/>\n            <enum name=\"multiply\" value=\"13\"/>\n            <enum name=\"screen\" value=\"14\"/>\n            <enum name=\"add\" value=\"12\"/>\n            <enum name=\"overlay\" value=\"15\"/>\n        </attr>\n        <attr name=\"dm_font\" format=\"string\"/>\n        <attr name=\"dm_textColor\" format=\"color\"/>\n        <attr name=\"dm_textColorDisabled\" format=\"color\"/>\n        <attr name=\"dm_textColorPressed\" format=\"color\"/>\n    </declare-styleable>\n</resources>\n\n"
  },
  {
    "path": "settings.gradle",
    "content": "include ':app', ':library'\n"
  }
]