[
  {
    "path": ".github/CONTRIBUTING.md",
    "content": "# Contributing to CFAlertDialog\n\nWe want to make contributing to this project as easy and transparent as possible. Here are a few guidelines for making all our lives easier.\n\n## Asking questions\n\nWe don't use GitHub as a support forum. For any usage questions that are not specific to the project itself, please ask on [Stack Overflow](https://stackoverflow.com/) instead. By doing so, you'll be more likely to quickly solve your problem, and you'll allow anyone else with the same question to find the answer. This also allows maintainers to focus on improving the project for others.\n\n## Reporting Issues\n\nA great way to contribute to the project is to send a detailed issue when you encounter an problem.\nIt is very important to check for the same problem or suggestion in the project's issue list first. If you find a match, just add a small comment there.\nDoing this helps prioritize the most common problems and requests.\n\nWhen reporting issues, please include the following:\n\n- The platform name and version (e.g. Android 6.0)\n- The library version\n- The integration method (e.g. gradle/manually)\n- The version of Android Studio you're using\n- The full output of any stack trace or compiler error\n- A small demo project that replicates the issue (especially if the way to reproduce the issue is not straight-forward)\n- Any other details that would be useful in understanding the problem\n\nThis information will help us review and fix your issue faster.\n\n\nPlease do not be offended if we close your issue and reference this document.\nIf you believe the issue is truly a fault in the project’s codebase, re-open it.\n\n## Pull Requests\n\nWe gladly accept any PR's assuming they are well written, documented ( if necessary ) and preferably have test code.\nIf you're unsure if we'll accept a new feature please open an issue requesting it and we can have a discussion before you code and submit a PR.\n\nChecklist:\n- Fork the repo and create your branch from the latest master (to minimize the conflicts)\n- If you've added code that should be tested, add tests.\n- If you've changed APIs, update the documentation.\n- Ensure the test suite passes.\n- Make sure your code lints\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE.md",
    "content": "### New Issue Checklist\n\n* [ ] I have read and understood the [CONTRIBUTING guide](https://github.com/Codigami/CFAlertDialog/blob/develop/.github/CONTRIBUTING.md)\n* [ ] I have read the [Documentation](https://github.com/Codigami/CFAlertDialog/blob/develop/README.md)\n* [ ] I have searched for a similar issue in the [project](https://github.com/Codigami/CFAlertDialog/issues) and found none\n\n### Issue Info\n\n Info                          | Value                               |\n-------------------------------|-------------------------------------|\n Platform Name                 | e.g. Android\n Platform Version              | e.g. 6.0\n CFAlertDialog Version         | e.g. 2.1.1\n Integration Method            | e.g. gradle / manually\n Xcode Version                 | e.g. Android Studio 2.3\n Repro rate                    | e.g. all the time (100%) / sometimes x% / only once\n Repro with our demo prj       | e.g. does it happen with our demo project?\n Demo project link             | e.g. link to a demo project that highlights the issue\n\n### Issue Description and Steps\n\nPlease fill in the detailed description of the issue (full output of any stack trace, compiler error, ...) and the steps to reproduce the issue.\n"
  },
  {
    "path": ".github/PULL_REQUEST_TEMPLATE.md",
    "content": "### New Pull Request Checklist\n\n* [ ] I have read and understood the [CONTRIBUTING guide](https://github.com/Codigami/CFAlertDialog/blob/develop/.github/CONTRIBUTING.md)\n* [ ] I have read the [Documentation](https://github.com/Codigami/CFAlertDialog/blob/develop/README.md)\n* [ ] I have searched for a similar pull request in the [project](https://github.com/Codigami/CFAlertDialog/pulls) and found none\n\n* [ ] I have updated this branch with the latest master to avoid conflicts (via merge from master or rebase)\n* [ ] I have added the required tests to prove the fix/feature I am adding\n* [ ] I have updated the documentation (if necessary)\n* [ ] I have run the tests and they pass\n* [ ] I have run the lint and it passes\n\nThis merge request fixes / refers to the following issues: ...\n\n### Pull Request Description\n\n...\n"
  },
  {
    "path": ".gitignore",
    "content": "# Built application files\n/*/build/\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.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*.iml\n\n# OS-specific files\n.DS_Store\n.DS_Store?\n._*\n.Spotlight-V100\n.Trashes\nehthumbs.db\nThumbs.db\n\n/.idea\n/examples/examples.iml\n/library/library.iml\nexamples/examples.iml\nlibrary/library.iml\nbuild/generated/mockable-android-25.jar\n\nlocal.properties\nbintray.properties\n"
  },
  {
    "path": "LICENSE.md",
    "content": "The MIT License (MIT)\n\nCopyright (c) 2017 Codigami Inc\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "README.md",
    "content": "# CFAlertDialog ![Android](/Resources/android_medium.png)\n\n[![Bintray](https://img.shields.io/bintray/v/crowdfire/releases/cfalertdialog.svg?maxAge=2592000)](https://bintray.com/crowdfire/cfalertdialog/cfalertdialog)\n[ ![Download](https://api.bintray.com/packages/crowdfire/cfalertdialog/cfalertdialog/images/download.svg) ](https://bintray.com/crowdfire/cfalertdialog/cfalertdialog/_latestVersion)\n[![Github All Releases](https://img.shields.io/github/downloads/codigami/cfalertdialog/total.svg)]()\n[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-CFAlertDialog-brightgreen.svg?style=flat)](https://android-arsenal.com/details/1/6252)\n[![license](https://img.shields.io/github/license/codigami/cfalertdialog.svg)]()\n[![Twitter URL](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://twitter.com/home?status=CFAlertDialog%20-%20Now%20display%20and%20customise%20dialogs%20on%20android%20like%20never%20before!%20%23OpenSource%20https%3A//github.com/Codigami/CFAlertDialog)\n\n`CFAlertDialog` is a library that helps you display and customise **alert dialogs** on Android. It offers an adaptive UI support. It’s functionality is almost similar to the native `AlertDialog`.\n\nYou can also check out this library for ** iOS** [here](https://github.com/Codigami/CFAlertViewController)\n\n#### Types of use cases:\n<img src=\"/Resources/Demo-1.gif\">\n\n#### Configuration options:\n<img src=\"/Resources/Demo-2.gif\">\n\n## Requirements :\n\n- CFAlertDialog works on any device with Android API level 14 and above. \n\n### Install using gradle\nIn your project's build.gradle add the following under dependencies\n```java \ncompile 'com.crowdfire.cfalertdialog:cfalertdialog:1.1.0'\n```\n\n\n## Usage :  \n<p>\n    <img src=\"/Resources/1.png\" style=\"width: 100%\" />\n</p>\n\nThe above shown alert types can easily be implemented using the code snippet given below by some small tweaks\n```android\n// Create Alert using Builder\nCFAlertDialog.Builder builder = new CFAlertDialog.Builder(this)\n    .setDialogStyle(CFAlertDialog.CFAlertStyle.ALERT)\n    .setTitle(\"You've hit the limit\")\n    .setMessage(\"Looks like you've hit your usage limit. Upgrade to our paid plan to continue without any limits.\")\n    .addButton(\"UPGRADE\", -1, -1, CFAlertActionStyle.POSITIVE, CFAlertActionAlignment.END, (dialog, which) -> {\n        Toast.makeText(BaseActivity.this, \"Upgrade tapped\", Toast.LENGTH_SHORT).show();\n        dialog.dismiss();\n    })\n        \n// Show the alert\nbuilder.show();\n```\n\n## Customisations :\n\n##### Alert Type\nThe alert type will determine the position and animation style for the dialog. You may set this by calling the `setAlertStyle` method with any of the following values.\n```java\nCFAlertStyle.NOTIFICATION,\nCFAlertStyle.ALERT,\nCFAlertStyle.BOTTOM_SHEET\n``` \nThe default type is `ALERT`.\n\n##### Title and Message\nYou can set a custom title and message text in the alert, using the `setTitle` method on the builder (pass `null` if you don’t need them).\n\n##### Title Color and Message Color\nYou can set a custom title and message text color in the alert, using the `setTextColor` on the builder.\n\n##### Text Alignment\nYou can customise alignment of the title and message. Use the  `setTextGravity` method on the builder with any of the following values: \n\n```java\nGravity.START,\nGravity.CENTER_HORIZONTAL,\nGravity.END\n```\n\n##### Background color\nYou can change the background (overlay) color of the alert using the method `setBackgroundColor` on the builder with the color of your choice.\n\n##### Dismiss on background tap\nThis determines whether the Alert dialog is dismissed when user taps on the background. Use the method `setCancelable` with a boolean value. By default it is set to true.\nThe user will be able to interactively swipe to dismiss the notification dialog if this field is true.\n\n##### Dismiss automatically\nThe alert dialog can be dismissed automatically using the method `setAutoDismissAfter(long duration)`.\n\n##### Header / Footer\n You can add header and footer to the dialog. Use the method `setHeaderView` and `setFooterView` with any custom View. You can also pass the layout resource directly into the header/footer. Pass `null` to remove any existing header/footer.\n \n 1) Some examples where you can make the use of header in alert (the dollar image is in header)\n<p>\n    <img src=\"/Resources/2.png\" style=\"width: 100%\" />\n</p>\n\n```java\nbuilder.setHeaderView(R.layout.dialog_header_layout);\nOR\nbuilder.setHeaderView(headerView);\n```\n\n2) Some examples where you can make the use of footer in alert\n<p>\n    <img src=\"/Resources/3.png\" style=\"width: 100%\" />\n</p>\n\n```java\nbuilder.setFooterView(R.layout.dialog_footer_layout);\nOR\nbuilder.setFooterView(footerView);\n```\n\n##### Dismiss Callback\nYou may set a callback when dialog is dismissed with the native `setOnDismissListener` on the alert object.\n```java\nCFAlertDialog alertDialog = builder.show();\nalertDialog.setOnDismissListener(new DialogInterface.OnDismissListener() {\n    @Override\n    public void onDismiss(DialogInterface dialog) {\n        \n        // Do something here when dialog dismissed.\n    }\n});\n```\n\n### Action Buttons\nYou may add as many action buttons with the required styles. Use the `addButton` method on the builder.\n```java\nbuilder.addButton(\"UPGRADE\", Color.parseColor(\"#FFFFFF\"), Color.parseColor(\"#429ef4\"), CFAlertActionStyle.POSITIVE, CFAlertActionAlignment.CENTER, new DialogInterface.OnClickListener() {\n    @Override\n    public void onClick(DialogInterface dialog, int which) {\n        Toast.makeText(context, \"Upgrade tapped\", Toast.LENGTH_SHORT).show();\n        dialog.dismiss();\n    }\n});\n```                           \n##### Title\nYou can set the title of action button to be added.\n\n##### Action Style\nConfigure the style of the action button that is to be added to alert view. Set `style` property of the above method with one of the following Action style  \n```java\nCFAlertActionStyle.DEFAULT,\nCFAlertActionStyle.POSITIVE,\nCFAlertActionStyle.NEGATIVE\n```\n\n###### Actions Alignment\nConfigure the alignment of the action button added to the alert view. Set `alignment` property of  CFAction constructor with one of the following action types\n```java\nCFAlertActionAlignment.START,   \nCFAlertActionAlignment.END,\nCFAlertActionAlignment.CENTER,\nCFAlertActionAlignment.JUSTIFIED   // Action Button occupies the full width\n```\n\n##### Callback\nPass an `onClickListener` to receive callbacks when the action buttons are tapped. \n\n### Items\nThere are 3 types of list supported by default.\n<p>\n    <img src=\"/Resources/4.png\" style=\"width: 100%\" />\n</p>\n\n##### Simple List\nThis will show a simple list view and give a callback when any of the item is tapped.\n```java\nCFAlertDialog.Builder builder = new CFAlertDialog.Builder(this);\nbuilder.setDialogStyle(CFAlertDialog.CFAlertStyle.ALERT);\nbuilder.setTitle(\"Select notification tone!\");\nbuilder.setItems(new String[]{\"None\", \"Alert\", \"Delight\", \"Guitar\", \"Marbles\", \"Prompt\"}, new OnClickListener() {\n    @Override\n    public void onClick(DialogInterface dialogInterface, int index) {\n        Toast.makeText(context, \"Selected:\"+index, Toast.LENGTH_SHORT).show();\n        dialogInterface.dismiss();\n    }\n});\nbuilder.show();\n```\n##### Single Choice\nThis will show a list view with single choice items. It will give a callback when any of the items is selected.\n```java\nCFAlertDialog.Builder builder = new CFAlertDialog.Builder(this);\nbuilder.setDialogStyle(CFAlertDialog.CFAlertStyle.ALERT);\nbuilder.setTitle(\"Select notification tone!\");\nbuilder.setSingleChoiceItems(new String[]{\"None\", \"Alert\", \"Delight\", \"Guitar\", \"Marbles\", \"Prompt\"}, 3, new OnClickListener() {\n    @Override\n    public void onClick(DialogInterface dialogInterface, int index) {\n        Toast.makeText(context, \"Selected:\"+index, Toast.LENGTH_SHORT).show();\n    }\n});\nbuilder.addButton(\"DONE\", -1, -1, CFAlertActionStyle.POSITIVE, CFAlertActionAlignment.END, new OnClickListener() {\n    @Override\n    public void onClick(DialogInterface dialogInterface, int i) {\n        dialogInterface.dismiss();\n    }\n});\nbuilder.show();\n```\n##### Multiple choice\nThis will show a list view with multi choice items. It will give a callback when any item is selected/unselected.\n```java\nCFAlertDialog.Builder builder = new CFAlertDialog.Builder(this);\nbuilder.setDialogStyle(CFAlertDialog.CFAlertStyle.ALERT);\nbuilder.setMessage(\"Select the topping for your pizza!!!\");\nbuilder.setMultiChoiceItems(new String[]{\"Spinach\", \"Red & Yellow pepper\", \"Baby corn\", \"Olives\", \"Chicken\"}, new boolean[]{false, false, false, false, false}, new DialogInterface.OnMultiChoiceClickListener() {\n    @Override\n    public void onClick(DialogInterface dialogInterface, int index, boolean b) {\n        Toast.makeText(context, \"Row:\"+index+\" \"+(b? \"Selected\":\"Unselected\"), Toast.LENGTH_SHORT).show();\n    }\n});\nbuilder.addButton(\"NEXT\", -1, -1, CFAlertActionStyle.POSITIVE, CFAlertActionAlignment.END, new OnClickListener() {\n    @Override\n    public void onClick(DialogInterface dialogInterface, int i) {\n        dialogInterface.dismiss();\n    }\n});\nbuilder.show();\n\n```\n\n## License\nThis code is distributed under the terms and conditions of the MIT license.\n"
  },
  {
    "path": "build.gradle",
    "content": "// Top-level build file where you can add configuration options common to all sub-projects/modules.\n\nbuildscript {\n    repositories {\n        jcenter()\n        maven {\n            url \"https://maven.google.com\"\n        }\n        google()\n    }\n    dependencies {\n        classpath 'com.android.tools.build:gradle:3.3.2'\n        classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'\n        classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7'\n\n        // NOTE: Do not place your application dependencies here; they belong\n        // in the individual module build.gradle files\n    }\n}\n\nallprojects {\n    repositories {\n        jcenter()\n        google()\n    }\n}\n"
  },
  {
    "path": "cfalertdialog/.gitignore",
    "content": "/build\n"
  },
  {
    "path": "cfalertdialog/build.gradle",
    "content": "apply plugin: 'com.android.library'\napply plugin: 'maven-publish'\napply plugin: 'com.jfrog.bintray'\napply plugin: 'com.github.dcendents.android-maven'\n\nbuildscript {\n    repositories {\n        jcenter()\n        maven {\n            url \"https://maven.google.com\"\n        }\n        google()\n    }\n    dependencies {\n        classpath 'com.android.tools.build:gradle:3.3.2'\n    }\n}\n\n// Variables\nint libraryVersionCode = 12\nString libraryVersion = '1.3.1'\nString libraryGroup = 'com.crowdfire.cfalertdialog'\n\nString gitUrl = 'https://github.com/Codigami/CFAlertDialog.git'\nString siteUrl = 'https://github.com/Codigami/CFAlertDialog'\n\n// Android settings\nandroid {\n    compileSdkVersion 28\n    buildToolsVersion '28.0.3'\n\n    defaultConfig {\n        minSdkVersion 14\n        targetSdkVersion 28\n        versionCode libraryVersionCode\n        versionName libraryVersion\n\n        testInstrumentationRunner \"androidx.test.runner.AndroidJUnitRunner\"\n    }\n    buildTypes {\n        release {\n            minifyEnabled false\n            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'\n        }\n    }\n}\n\n// Dependancies\ndependencies {\n    implementation fileTree(dir: 'libs', include: ['*.jar'])\n    androidTestImplementation('androidx.test.espresso:espresso-core:3.1.1-alpha01', {\n        exclude group: 'com.android.support', module: 'support-annotations'\n    })\n    implementation 'androidx.appcompat:appcompat:1.1.0-alpha04'\n    implementation 'androidx.cardview:cardview:1.0.0'\n    testImplementation 'junit:junit:4.12'\n}\n\n// Local properties\nProperties properties = new Properties()\nproperties.load(project.rootProject.file('bintray.properties').newDataInputStream())\n\ngroup = libraryGroup\nversion = libraryVersion\n\n// Bintray upload tasks\ntask sourcesJar(type: Jar) {\n    from android.sourceSets.main.java.srcDirs\n    classifier = 'sources'\n}\n\ntask javadoc(type: Javadoc) {\n    source = android.sourceSets.main.java.srcDirs\n    classpath += project.files(android.getBootClasspath().join(File.pathSeparator))\n}\n\ntask javadocJar(type: Jar, dependsOn: javadoc) {\n    classifier = 'javadoc'\n    from javadoc.destinationDir\n}\n\nartifacts {\n    archives javadocJar\n    archives sourcesJar\n}\n\nbintray {\n    user = properties.getProperty(\"bintray.user\")\n    key = properties.getProperty(\"bintray.apikey\")\n\n    configurations = ['archives']\n\n    pkg {\n        repo = 'cfalertdialog'\n        name = 'cfalertdialog'\n        userOrg = 'crowdfire'\n        licenses = ['Apache-2.0']\n        vcsUrl = gitUrl\n        publish = true\n        version{\n            name = libraryVersion\n            desc = 'Development release v0.9'\n            released  = new Date()\n            vcsTag = libraryVersion\n            gpg {\n                sign = true\n                passphrase = properties.getProperty(\"bintray.gpg.password\")\n            }\n        }\n    }\n}\n\ninstall {\n    repositories.mavenInstaller {\n        // This generates POM.xml with proper parameters\n        pom {\n            project {\n                packaging 'aar'\n                groupId libraryGroup\n                artifactId 'cfalertdialog'\n\n                name 'CFAlertDialog'\n                description 'A customisable alert dialog for Android'\n                url siteUrl\n\n                developers {\n                    developer {\n                        id properties.getProperty(\"bintray.developer.id\")\n                        name properties.getProperty(\"bintray.developer.name\")\n                    }\n                }\n\n                scm {\n                    url siteUrl\n                    connection gitUrl\n                    developerConnection gitUrl\n                }\n\n                licenses {\n                    license {\n                        name 'Apache-2.0'\n                        url 'http://www.apache.org/licenses/LICENSE-2.0.txt'\n                        distribution 'repo'\n                    }\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "cfalertdialog/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/rahul/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\n# Uncomment this to preserve the line number information for\n# debugging stack traces.\n#-keepattributes SourceFile,LineNumberTable\n\n# If you keep the line number information, uncomment this to\n# hide the original source file name.\n#-renamesourcefileattribute SourceFile\n"
  },
  {
    "path": "cfalertdialog/src/androidTest/java/com/crowdfire/cfalertdialog/ExampleInstrumentedTest.java",
    "content": "package com.crowdfire.cfalertdialog;\n\nimport android.content.Context;\nimport androidx.test.InstrumentationRegistry;\nimport androidx.test.runner.AndroidJUnit4;\n\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\n\nimport static org.junit.Assert.*;\n\n/**\n * Instrumentation test, which will execute on an Android device.\n *\n * @see <a href=\"http://d.android.com/tools/testing\">Testing documentation</a>\n */\n@RunWith(AndroidJUnit4.class)\npublic class ExampleInstrumentedTest {\n    @Test\n    public void useAppContext() throws Exception {\n        // Context of the app under test.\n        Context appContext = InstrumentationRegistry.getTargetContext();\n\n        assertEquals(\"com.crowdfire.cfalertdialog.test\", appContext.getPackageName());\n    }\n}\n"
  },
  {
    "path": "cfalertdialog/src/main/AndroidManifest.xml",
    "content": "<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n\n    package=\"com.crowdfire.cfalertdialog\">\n\n    <application android:allowBackup=\"true\" android:label=\"@string/app_name\"\n        android:supportsRtl=\"true\">\n\n    </application>\n\n</manifest>\n"
  },
  {
    "path": "cfalertdialog/src/main/java/com/crowdfire/cfalertdialog/CFAlertDialog.java",
    "content": "package com.crowdfire.cfalertdialog;\n\nimport android.animation.ArgbEvaluator;\nimport android.animation.ValueAnimator;\nimport android.content.Context;\nimport android.content.DialogInterface;\nimport android.graphics.Color;\nimport android.graphics.drawable.ColorDrawable;\nimport android.graphics.drawable.Drawable;\nimport android.graphics.drawable.GradientDrawable;\nimport android.os.Bundle;\nimport android.os.Handler;\nimport androidx.annotation.ColorInt;\nimport androidx.annotation.ColorRes;\nimport androidx.annotation.DrawableRes;\nimport androidx.annotation.LayoutRes;\nimport androidx.annotation.StringRes;\nimport androidx.annotation.StyleRes;\nimport androidx.core.content.ContextCompat;\nimport androidx.core.content.res.ResourcesCompat;\nimport androidx.core.view.ViewCompat;\nimport androidx.appcompat.app.AppCompatDialog;\nimport androidx.cardview.widget.CardView;\nimport android.text.TextUtils;\nimport android.view.Gravity;\nimport android.view.LayoutInflater;\nimport android.view.View;\nimport android.view.ViewGroup;\nimport android.view.Window;\nimport android.view.WindowManager;\nimport android.view.animation.Animation;\nimport android.view.animation.AnimationUtils;\nimport android.widget.CheckBox;\nimport android.widget.CompoundButton;\nimport android.widget.ImageView;\nimport android.widget.LinearLayout;\nimport android.widget.RadioButton;\nimport android.widget.RadioGroup;\nimport android.widget.RelativeLayout;\nimport android.widget.ScrollView;\nimport android.widget.TextView;\n\nimport com.crowdfire.cfalertdialog.utils.DeviceUtil;\nimport com.crowdfire.cfalertdialog.utils.SwipeToHideViewListener;\nimport com.crowdfire.cfalertdialog.views.CFPushButton;\n\nimport java.util.ArrayList;\nimport java.util.List;\n\npublic class CFAlertDialog extends AppCompatDialog {\n\n    // region Enums\n\n    public enum CFAlertStyle {\n        NOTIFICATION,\n        ALERT,\n        BOTTOM_SHEET\n    }\n\n    public enum CFAlertActionStyle{\n        DEFAULT,\n        NEGATIVE,\n        POSITIVE\n    }\n\n    public enum CFAlertActionAlignment {\n        START,\n        END,\n        CENTER,\n        JUSTIFIED\n    }\n    // endregion\n\n    // region Properties\n    private int style = -1;\n    private DialogParams params;\n\n    private RelativeLayout cfDialogBackground, cfDialogContainer;\n    private LinearLayout cfDialogHeaderLinearLayout, cfDialogBodyContainer, buttonContainerLinearLayout,\n            cfDialogFooterLinearLayout, iconTitleContainer, selectableItemsContainer;\n    private CardView dialogCardView;\n    private TextView dialogTitleTextView, dialogMessageTextView;\n    private ImageView cfDialogIconImageView;\n    private ScrollView cfDialogScrollView;\n\n    // endregion\n\n    // region Setup methods\n    private CFAlertDialog(Context context) {\n        super(context, R.style.CFDialog);\n    }\n\n    private CFAlertDialog(Context context, int theme) {\n        super(context, theme);\n        style = theme;\n    }\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n\n        // Inflate the view\n        LayoutInflater layoutInflater = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);\n        View view = layoutInflater.inflate(R.layout.cfalert_layout, null);\n        supportRequestWindowFeature(Window.FEATURE_NO_TITLE);\n        setContentView(view);\n\n        // Setup the dialog\n        setupSubviews(view);\n\n        // Set the size to adjust when keyboard shown\n        getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE|WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN);\n\n        // Disable the view initially\n        setEnabled(false);\n    }\n\n    private void setupSubviews(View view) {\n\n        cfDialogBackground = ((RelativeLayout) view.findViewById(R.id.cfdialog_background));\n        setupBackground();\n\n        cfDialogContainer = (RelativeLayout) view.findViewById(R.id.cfdialog_container);\n\n        // Card setup\n        createCardView();\n    }\n\n    private void setupBackground() {\n\n        // Background\n        getWindow().setBackgroundDrawableResource(android.R.color.transparent);\n\n        cfDialogBackground.setBackgroundColor(params.backgroundColor);\n\n        cfDialogBackground.setOnClickListener(new View.OnClickListener() {\n            @Override\n            public void onClick(View v) {\n\n                if (params.cancelable) {\n\n                    dismiss();\n                }\n            }\n        });\n\n        // Dialog position\n        adjustBackgroundGravity();\n    }\n\n    private void createCardView() {\n\n        dialogCardView = (CardView) findViewById(R.id.cfdialog_cardview);\n\n        bindCardSubviews();\n\n        cfDialogScrollView.setBackgroundColor(params.dialogBackgroundColor);\n\n        // Adjust the dialog width\n        adjustDialogLayoutParams();\n\n        populateCardView();\n        setupCardBehaviour();\n    }\n\n    private void bindCardSubviews() {\n        cfDialogScrollView = dialogCardView.findViewById(R.id.cfdialog_scrollview);\n        cfDialogBodyContainer = dialogCardView.findViewById(R.id.alert_body_container);\n        cfDialogHeaderLinearLayout = dialogCardView.findViewById(R.id.alert_header_container);\n        cfDialogHeaderLinearLayout.requestLayout();\n        cfDialogHeaderLinearLayout.setVisibility(View.GONE);\n        dialogTitleTextView = dialogCardView.findViewById(R.id.tv_dialog_title);\n        iconTitleContainer = dialogCardView.findViewById(R.id.icon_title_container);\n        cfDialogIconImageView = dialogCardView.findViewById(R.id.cfdialog_icon_imageview);\n        dialogMessageTextView = dialogCardView.findViewById(R.id.tv_dialog_content_desc);\n        buttonContainerLinearLayout = dialogCardView.findViewById(R.id.alert_buttons_container);\n        cfDialogFooterLinearLayout = dialogCardView.findViewById(R.id.alert_footer_container);\n        selectableItemsContainer = dialogCardView.findViewById(R.id.alert_selection_items_container);\n    }\n\n    private void populateCardView() {\n        // Icon\n        if (params.iconDrawableId != -1) {\n            setIcon(params.iconDrawableId);\n        } else if (params.iconDrawable != null) {\n            setIcon(params.iconDrawable);\n        } else { setIcon(null); }\n\n        // Title\n        setTitle(params.title);\n\n        // Message\n        setMessage(params.message);\n\n        // Text color\n        if (params.textColor != -1) {\n            setTitleColor(params.textColor);\n            setMessageColor(params.textColor);\n        }\n\n        // Cancel\n        setCancelable(params.cancelable);\n\n        // Buttons\n        populateButtons(params.context, params.buttons);\n\n        // Text gravity\n        setTextGravity(params.textGravity);\n\n        // Selection items\n        if (params.items != null && params.items.length > 0) {\n            setItems(params.items, params.onItemClickListener);\n        } else if (params.multiSelectItems != null && params.multiSelectItems.length > 0) {\n            setMultiSelectItems(params.multiSelectItems, params.multiSelectedItems, params.onMultiChoiceClickListener);\n        } else if (params.singleSelectItems != null && params.singleSelectItems.length > 0) {\n            setSingleSelectItems(params.singleSelectItems, params.singleSelectedItem, params.onSingleItemClickListener);\n        } else {\n            selectableItemsContainer.removeAllViews();\n        }\n\n        // Hide Body container if there is no content in the body\n        if (params.isDialogBodyEmpty()) {\n            cfDialogBodyContainer.setVisibility(View.GONE);\n        }\n\n        // Image/Header\n        if (params.contentImageDrawableId != -1) {\n            setContentImageDrawable(params.contentImageDrawableId);\n        } else if (params.contentImageDrawable != null) {\n            setContentImageDrawable(params.contentImageDrawable);\n        } else if (params.headerView != null) {\n            setHeaderView(params.headerView);\n        } else if (params.headerViewId != -1) {\n            setHeaderView(params.headerViewId);\n        }\n\n        // Footer\n        if (params.footerView != null) {\n            setFooterView(params.footerView);\n        } else if (params.footerViewId != -1) {\n            setFooterView(params.footerViewId);\n        }\n    }\n\n    private void setupCardBehaviour() {\n\n        // Style specific behaviour\n        switch (params.dialogStyle) {\n\n            case NOTIFICATION:\n                // Swipe to dismiss feature for notification type alerts\n                SwipeToHideViewListener cardSwipeListener = new SwipeToHideViewListener(dialogCardView, params.cancelable, new SwipeToHideViewListener.SwipeToHideCompletionListener() {\n                    @Override\n                    public void viewDismissed() {\n                        CFAlertDialog.super.dismiss();\n                    }\n                });\n                cfDialogScrollView.setOnTouchListener(cardSwipeListener);\n                break;\n\n            case ALERT:\n                // Behaviour specific to Alerts\n                break;\n\n            case BOTTOM_SHEET:\n                // Behaviour specific to Bottom sheets\n                break;\n        }\n    }\n    // endregion\n\n    @Override\n    public void show() {\n        super.show();\n\n        // Perform the present animation\n        startPresentAnimation();\n    }\n\n    @Override\n    public void dismiss() {\n\n        // Disable the view when being dismissed\n        setEnabled(false);\n\n        // perform the dismiss animation\n        startDismissAnimation();\n\n    }\n\n    private void alertPresented() {\n\n        setEnabled(true);\n\n        // Auto dismiss if needed\n        if (params.autoDismissDuration > 0) {\n            Handler handler = new Handler();\n            Runnable runnable = new Runnable() {\n                @Override\n                public void run() {\n                    dismiss();\n                }\n            };\n            handler.postDelayed(runnable, params.autoDismissDuration);\n        }\n    }\n\n    // region - Setters\n\n    private void setDialogParams(DialogParams params) {\n        this.params = params;\n    }\n\n    private void setEnabled(boolean enabled) {\n        setViewEnabled(cfDialogBackground, enabled);\n    }\n\n    public void setBackgroundColor(int color, boolean animated){\n\n        if (animated) {\n            int colorFrom = ((ColorDrawable)cfDialogBackground.getBackground()).getColor();\n            ValueAnimator colorAnimation = ValueAnimator.ofObject(new ArgbEvaluator(), colorFrom, color);\n            colorAnimation.setDuration(getContext().getResources().getInteger(R.integer.cfdialog_animation_duration)); // milliseconds\n            colorAnimation.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {\n\n                @Override\n                public void onAnimationUpdate(ValueAnimator animator) {\n                    cfDialogBackground.setBackgroundColor((int) animator.getAnimatedValue());\n                }\n\n            });\n            colorAnimation.start();\n        }\n        else {\n            cfDialogBackground.setBackgroundColor(color);\n        }\n    }\n\n    public void setDialogBackgroundColor(int color, boolean animated) {\n        if (animated) {\n            int colorFrom = ((ColorDrawable)dialogCardView.getBackground()).getColor();\n            ValueAnimator colorAnimation = ValueAnimator.ofObject(new ArgbEvaluator(), colorFrom, color);\n            colorAnimation.setDuration(getContext().getResources().getInteger(R.integer.cfdialog_animation_duration)); // milliseconds\n            colorAnimation.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {\n\n                @Override\n                public void onAnimationUpdate(ValueAnimator animator) {\n                    dialogCardView.setBackgroundColor((int) animator.getAnimatedValue());\n                }\n\n            });\n            colorAnimation.start();\n        }\n        else {\n            cfDialogScrollView.setBackgroundColor(color);\n        }\n    }\n\n    public void setCornerRadius(float radius) {\n        this.params.dialogCornerRadius = radius;\n\n        dialogCardView.setRadius(getCornerRadius());\n    }\n\n    public void setOuterMargin(int margin) {\n        this.params.dialogOuterMargin = margin;\n\n        adjustDialogLayoutParams();\n    }\n\n    @Override\n    public void setTitle(CharSequence title) {\n        if (TextUtils.isEmpty(title)) {\n            dialogTitleTextView.setVisibility(View.GONE);\n            if (cfDialogIconImageView.getVisibility() == View.GONE) {\n                iconTitleContainer.setVisibility(View.GONE);\n            }\n        } else {\n            dialogTitleTextView.setText(title);\n            dialogTitleTextView.setVisibility(View.VISIBLE);\n            iconTitleContainer.setVisibility(View.VISIBLE);\n        }\n    }\n\n    @Override\n    public void setTitle(int titleId) {\n        setTitle(getContext().getString(titleId));\n    }\n\n    public void setTitleColor (@ColorInt int color) {\n        dialogTitleTextView.setTextColor(color);\n    }\n\n    public void setMessage(CharSequence message) {\n        if (TextUtils.isEmpty(message)) {\n            dialogMessageTextView.setVisibility(View.GONE);\n        } else {\n            dialogMessageTextView.setText(message);\n            dialogMessageTextView.setVisibility(View.VISIBLE);\n        }\n    }\n\n    public void setMessage(int messageId) {\n        setMessage(getContext().getString(messageId));\n    }\n\n    public void setMessageColor(@ColorInt int color) {\n        dialogMessageTextView.setTextColor(color);\n    }\n\n    /**\n     * @param dialogStyle\n     */\n    public void setDialogStyle(CFAlertStyle dialogStyle) {\n        params.dialogStyle = dialogStyle;\n\n        adjustBackgroundGravity();\n        adjustDialogLayoutParams();\n    }\n\n    /**\n     * @param textGravity @see android.view.Gravity\n     */\n    public void setTextGravity(int textGravity) {\n        ((LinearLayout.LayoutParams) iconTitleContainer.getLayoutParams()).gravity = textGravity;\n        dialogMessageTextView.setGravity(textGravity);\n    }\n\n    /**\n     * @param headerView pass null to remove header\n     */\n    public void setHeaderView(View headerView) {\n        cfDialogHeaderLinearLayout.removeAllViews();\n        if (headerView != null) {\n            cfDialogHeaderLinearLayout.setVisibility(View.VISIBLE);\n            cfDialogHeaderLinearLayout.addView(headerView,\n                                               ViewGroup.LayoutParams.MATCH_PARENT,\n                                               ViewGroup.LayoutParams.WRAP_CONTENT);\n\n            // Allows the header view to overlap the alert content if needed\n            disableClipOnParents(headerView);\n        } else {\n            cfDialogHeaderLinearLayout.setVisibility(View.GONE);\n        }\n    }\n\n    public void setHeaderView(@LayoutRes int headerResId) {\n        LayoutInflater layoutInflater = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);\n        View view = layoutInflater.inflate(headerResId, null);\n        setHeaderView(view);\n    }\n\n    public void setIcon(@DrawableRes int iconDrawableId) {\n        setIcon(ContextCompat.getDrawable(getContext(), iconDrawableId));\n    }\n\n    public void setIcon(Drawable iconDrawable) {\n        if (iconDrawable == null) {\n            cfDialogIconImageView.setVisibility(View.GONE);\n            if (dialogTitleTextView.getVisibility() == View.GONE) {\n                iconTitleContainer.setVisibility(View.GONE);\n            }\n        } else {\n            cfDialogIconImageView.setVisibility(View.VISIBLE);\n            iconTitleContainer.setVisibility(View.VISIBLE);\n            cfDialogIconImageView.setImageDrawable(iconDrawable);\n        }\n    }\n\n    /**\n     * @param imageDrawableId value -1 will remove image\n     */\n    public void setContentImageDrawable(@DrawableRes int imageDrawableId) {\n        setContentImageDrawable(ContextCompat.getDrawable(getContext(), imageDrawableId));\n    }\n\n    public void setContentImageDrawable(Drawable imageDrawable) {\n        if (imageDrawable != null) {\n            LayoutInflater layoutInflater = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);\n            ImageView imageView = (ImageView) layoutInflater.inflate(R.layout.cfdialog_imageview_header, cfDialogHeaderLinearLayout).findViewById(R.id.cfdialog_imageview_content);\n            imageView.setImageDrawable(imageDrawable);\n            imageView.setTag(111);\n            cfDialogHeaderLinearLayout.setVisibility(View.VISIBLE);\n        } else {\n            for (int i = 0; i < cfDialogHeaderLinearLayout.getChildCount(); i++) {\n                View view = cfDialogHeaderLinearLayout.getChildAt(i);\n                if (view instanceof ImageView && (int) view.getTag() == 111) {\n                    cfDialogHeaderLinearLayout.removeView(view);\n                    cfDialogHeaderLinearLayout.setVisibility(View.GONE);\n                    break;\n                }\n            }\n        }\n    }\n\n    /**\n     * @param footerView pass null to remove footer\n     */\n    public void setFooterView(View footerView) {\n        cfDialogFooterLinearLayout.removeAllViews();\n        if (footerView != null) {\n            cfDialogFooterLinearLayout.addView(footerView,\n                                               ViewGroup.LayoutParams.MATCH_PARENT,\n                                               ViewGroup.LayoutParams.WRAP_CONTENT);\n            cfDialogFooterLinearLayout.setVisibility(View.VISIBLE);\n\n            // Allows the footer view to overlap the alert content if needed\n            disableClipOnParents(footerView);\n        } else {\n            cfDialogFooterLinearLayout.setVisibility(View.GONE);\n        }\n    }\n\n    public void setFooterView(@LayoutRes int footerResId) {\n        LayoutInflater layoutInflater = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);\n        View view = layoutInflater.inflate(footerResId, null);\n        setFooterView(view);\n    }\n\n    private void setViewEnabled(ViewGroup layout, boolean enabled) {\n        layout.setEnabled(enabled);\n        for (int i = 0; i < layout.getChildCount(); i++) {\n            View child = layout.getChildAt(i);\n            if (child instanceof ViewGroup) {\n                setViewEnabled((ViewGroup) child, enabled);\n            } else {\n                child.setEnabled(enabled);\n            }\n        }\n    }\n\n    private void disableClipOnParents(View v) {\n        if (v.getParent() == null) {\n            return;\n        }\n\n        if (v instanceof ViewGroup) {\n            ((ViewGroup) v).setClipChildren(false);\n        }\n\n        if (v.getParent() instanceof View) {\n            disableClipOnParents((View) v.getParent());\n        }\n    }\n\n    private void populateButtons(Context context, List<CFAlertActionButton> buttons) {\n        buttonContainerLinearLayout.removeAllViews();\n        if (buttons.size() > 0) {\n            for (int i = 0; i < buttons.size(); i++) {\n                View buttonView = createButton(context, buttons.get(i));\n                buttonContainerLinearLayout.addView(buttonView);\n            }\n            buttonContainerLinearLayout.setVisibility(View.VISIBLE);\n        } else {\n            buttonContainerLinearLayout.setVisibility(View.GONE);\n        }\n    }\n\n    private View createButton(Context context, final CFAlertActionButton actionButton) {\n        CFPushButton button = new CFPushButton(context, null, style != -1 ? style : R.style.CFDialog_Button);\n        button.setOnClickListener(new View.OnClickListener() {\n            @Override\n            public void onClick(View v) {\n                actionButton.onClickListener.onClick(CFAlertDialog.this, 0);\n            }\n        });\n\n        setButtonLayout(button, actionButton);\n\n        button.setText(actionButton.buttonText);\n\n        setButtonColors(button, actionButton);\n\n        return button;\n    }\n\n    private void setButtonLayout(View buttonView, CFAlertActionButton actionButton) {\n        LinearLayout.LayoutParams buttonParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);\n        ;\n\n        switch (actionButton.alignment) {\n            case JUSTIFIED:\n                buttonParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);\n                break;\n            case START:\n                buttonParams.gravity = Gravity.START;\n                break;\n            case CENTER:\n                buttonParams.gravity = Gravity.CENTER;\n                break;\n            case END:\n                buttonParams.gravity = Gravity.END;\n                break;\n        }\n\n        buttonView.setLayoutParams(buttonParams);\n\n        int padding = ((int) buttonView.getResources().getDimension(R.dimen.cfdialog_button_padding));\n        buttonView.setPadding(padding, padding, padding, padding);\n    }\n\n    private void setButtonColors(CFPushButton button, CFAlertActionButton actionButton) {\n\n        //Button background color\n        if (actionButton.backgroundColor != -1) {\n            GradientDrawable buttonDrawable = new GradientDrawable();\n            buttonDrawable.setColor(actionButton.backgroundColor);\n            buttonDrawable.setCornerRadius(getContext().getResources().getDimension(R.dimen.cfdialog_button_corner_radius));\n            ViewCompat.setBackground(button, buttonDrawable);\n        }\n        else if (actionButton.backgroundDrawableId != -1) {\n            ViewCompat.setBackground(button, ContextCompat.getDrawable(getContext(), actionButton.backgroundDrawableId));\n        }\n\n        // Button text colors\n        button.setTextColor(actionButton.textColor);\n    }\n\n    public void setItems(String[] items, final OnClickListener onClickListener) {\n\n        if (items != null && items.length > 0) {\n            selectableItemsContainer.removeAllViews();\n            selectableItemsContainer.setVisibility(View.VISIBLE);\n            for (int i = 0; i < items.length; i++) {\n                String item = items[i];\n                View view = getLayoutInflater().inflate(R.layout.cfdialog_selectable_item_layout, null);\n                TextView itemTextView = (TextView) view.findViewById(R.id.cfdialog_selectable_item_textview);\n                itemTextView.setText(item);\n                final int position = i;\n                view.setOnClickListener(new View.OnClickListener() {\n                    @Override\n                    public void onClick(View v) {\n                        if (onClickListener != null) {\n                            onClickListener.onClick(CFAlertDialog.this, position);\n                        }\n                    }\n                });\n                selectableItemsContainer.addView(view);\n            }\n        } else {\n            selectableItemsContainer.setVisibility(View.GONE);\n        }\n    }\n\n    public void setMultiSelectItems(String[] multiSelectItems, boolean[] selectedItems, final OnMultiChoiceClickListener onMultiChoiceClickListener) {\n        if (multiSelectItems != null && multiSelectItems.length > 0) {\n            if (selectedItems.length != multiSelectItems.length) {\n                throw new IllegalArgumentException(\"multi select items and boolean array size not equal\");\n            }\n            selectableItemsContainer.removeAllViews();\n            selectableItemsContainer.setVisibility(View.VISIBLE);\n            for (int i = 0; i < multiSelectItems.length; i++) {\n                String item = multiSelectItems[i];\n                View view = getLayoutInflater().inflate(R.layout.cfdialog_multi_select_item_layout, null);\n                CheckBox checkBox = (CheckBox) view.findViewById(R.id.cfdialog_multi_select_item_checkbox);\n                checkBox.setText(item);\n                checkBox.setChecked(selectedItems[i]);\n                final int position = i;\n                checkBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {\n                    @Override\n                    public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {\n                        if (onMultiChoiceClickListener != null) {\n                            onMultiChoiceClickListener.onClick(CFAlertDialog.this, position, isChecked);\n                        }\n                    }\n                });\n                selectableItemsContainer.addView(view);\n            }\n        } else {\n            selectableItemsContainer.setVisibility(View.GONE);\n        }\n    }\n\n    public void setSingleSelectItems(String[] singleSelectItems, int selectedItem, final OnClickListener onClickListener) {\n        if (singleSelectItems != null && singleSelectItems.length > 0) {\n            selectableItemsContainer.removeAllViews();\n            selectableItemsContainer.setVisibility(View.VISIBLE);\n            RadioGroup radioGroup = (RadioGroup) getLayoutInflater().inflate(R.layout.cfdialog_single_select_item_layout, selectableItemsContainer)\n                                                                    .findViewById(R.id.cfstage_single_select_radio_group);\n            radioGroup.removeAllViews();\n            for (int i = 0; i < singleSelectItems.length; i++) {\n                String item = singleSelectItems[i];\n                RadioButton radioButton = (RadioButton) getLayoutInflater().inflate(R.layout.cfdialog_single_select_radio_button_layout, null);\n                radioButton.setText(item);\n                radioButton.setId(i);\n                final int position = i;\n                if (position == selectedItem) {\n                    radioButton.setChecked(true);\n                }\n                radioButton.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {\n                    @Override\n                    public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {\n                        if (isChecked && onClickListener != null) {\n                            onClickListener.onClick(CFAlertDialog.this, position);\n                        }\n                    }\n                });\n                radioGroup.addView(radioButton);\n            }\n        } else {\n            selectableItemsContainer.setVisibility(View.GONE);\n        }\n    }\n\n    public void setElevation(float elevation) {\n        dialogCardView.setCardElevation(elevation);\n    }\n\n    // endregion\n\n    @Override\n    public void onDetachedFromWindow() {\n        super.onDetachedFromWindow();\n        //cfDialogFooterLinearLayout.removeAllViews();\n        //cfDialogHeaderLinearLayout.removeAllViews();\n\n    }\n\n    // region Animation helper methods\n\n    private void startPresentAnimation() {\n        Animation presentAnimation = getPresentAnimation(params.dialogStyle);\n        presentAnimation.setAnimationListener(new Animation.AnimationListener() {\n            @Override\n            public void onAnimationStart(Animation animation) {\n\n            }\n\n            @Override\n            public void onAnimationEnd(Animation animation) {\n                alertPresented();\n            }\n\n            @Override\n            public void onAnimationRepeat(Animation animation) {\n\n            }\n        });\n        dialogCardView.startAnimation(presentAnimation);\n    }\n\n    private void startDismissAnimation() {\n        // Perform the dismiss animation and after that dismiss the dialog\n        Animation dismissAnimation = getDismissAnimation(params.dialogStyle);\n        dismissAnimation.setAnimationListener(new Animation.AnimationListener() {\n            @Override\n            public void onAnimationStart(Animation animation) {\n\n            }\n\n            @Override\n            public void onAnimationEnd(Animation animation) {\n                Handler handler = new Handler();\n                handler.post(new Runnable() {\n                    @Override\n                    public void run() {\n                        CFAlertDialog.super.dismiss();\n                    }\n                });\n            }\n\n            @Override\n            public void onAnimationRepeat(Animation animation) {\n\n            }\n        });\n        dialogCardView.startAnimation(dismissAnimation);\n\n    }\n\n    private Animation getPresentAnimation(CFAlertStyle style) {\n        switch (style) {\n            case NOTIFICATION:\n                return AnimationUtils.loadAnimation(params.context, R.anim.dialog_present_top);\n            case ALERT:\n                return AnimationUtils.loadAnimation(params.context, R.anim.dialog_present_center);\n            case BOTTOM_SHEET:\n                return AnimationUtils.loadAnimation(params.context, R.anim.dialog_present_bottom);\n            default:\n                return AnimationUtils.loadAnimation(params.context, R.anim.dialog_present_center);\n        }\n    }\n\n    private Animation getDismissAnimation(CFAlertStyle style) {\n        switch (style) {\n            case NOTIFICATION:\n                return AnimationUtils.loadAnimation(params.context, R.anim.dialog_dismiss_top);\n            case ALERT:\n                return AnimationUtils.loadAnimation(params.context, R.anim.dialog_dismiss_center);\n            case BOTTOM_SHEET:\n                return AnimationUtils.loadAnimation(params.context, R.anim.dialog_dismiss_bottom);\n            default:\n                return AnimationUtils.loadAnimation(params.context, R.anim.dialog_dismiss_center);\n        }\n    }\n\n    // endregion\n\n    // region Layout helper methods\n\n    private void adjustBackgroundGravity() {\n        switch (params.dialogStyle) {\n            case NOTIFICATION:\n                cfDialogBackground.setGravity(Gravity.TOP);\n                break;\n            case ALERT:\n                cfDialogBackground.setGravity(Gravity.CENTER_VERTICAL);\n                break;\n            case BOTTOM_SHEET:\n                cfDialogBackground.setGravity(Gravity.BOTTOM);\n                break;\n        }\n    }\n\n    private void adjustDialogLayoutParams() {\n\n        // Corner radius\n        dialogCardView.setRadius(getCornerRadius());\n\n        // Layout params\n        RelativeLayout.LayoutParams cardContainerLayoutParams = (RelativeLayout.LayoutParams) cfDialogContainer.getLayoutParams();\n        int margin = getOuterMargin();\n\n        int horizontalMargin = margin;\n        int topMargin = margin;\n        int bottomMargin = margin;\n        int maxWidth = (int) getContext().getResources().getDimension(R.dimen.cfdialog_maxwidth);\n        int screenWidth = DeviceUtil.getScreenWidth(getContext());\n\n        // Special layout properties to be added here.\n        switch (params.dialogStyle) {\n            case NOTIFICATION:\n                horizontalMargin = 0;\n                topMargin = 0;\n                maxWidth = screenWidth;\n                break;\n        }\n\n        if (isCustomMargin()) {\n            maxWidth = screenWidth;     // Dialog can extend till the max screen width if custom margin is provided\n        }\n\n        int width = screenWidth - (2 * horizontalMargin);\n        width = Math.min(width, maxWidth);\n        cardContainerLayoutParams.width = width;\n\n        cardContainerLayoutParams.addRule(RelativeLayout.CENTER_HORIZONTAL, RelativeLayout.TRUE);\n        cardContainerLayoutParams.setMargins(horizontalMargin, topMargin, horizontalMargin, bottomMargin);\n\n        cfDialogContainer.setLayoutParams(cardContainerLayoutParams);\n    }\n\n    private float getCornerRadius(){\n        float cornerRadius = getContext().getResources().getDimension(R.dimen.cfdialog_card_corner_radius);\n\n        // Special layout properties to be added here.\n        switch (params.dialogStyle) {\n            case NOTIFICATION:\n                cornerRadius = 0;\n                break;\n        }\n\n        // Use the corner radius from params if provided.\n        if (params.dialogCornerRadius != -1) {\n            cornerRadius = params.dialogCornerRadius;\n        }\n\n        return cornerRadius;\n    }\n\n    private int getOuterMargin() {\n        int margin = (int)getContext().getResources().getDimension(R.dimen.cfdialog_outer_margin);\n\n        if (params.dialogOuterMargin != -1) {\n            margin = params.dialogOuterMargin;\n        }\n\n        return margin;\n    }\n\n    private boolean isCustomMargin() {\n        return params.dialogOuterMargin != -1;\n    }\n\n    // endregion\n\n    public static class Builder {\n\n        private DialogParams params;\n\n        public Builder(Context context) {\n            params = new DialogParams();\n            this.params.context = context;\n        }\n\n        public Builder(Context context, @StyleRes int theme) {\n            params = new DialogParams();\n            this.params.context = context;\n            this.params.theme = theme;\n        }\n\n        public Builder setBackgroundResource(@ColorRes int backgroundResource) {\n            this.params.backgroundColor = ResourcesCompat.getColor(this.params.context.getResources(), backgroundResource, null);\n            return this;\n        }\n\n        public Builder setBackgroundColor(@ColorInt int backgroundColor) {\n            this.params.backgroundColor = backgroundColor;\n            return this;\n        }\n\n        public Builder setDialogBackgroundResource(@ColorRes int backgroundResource) {\n            this.params.dialogBackgroundColor = ResourcesCompat.getColor(this.params.context.getResources(), backgroundResource, null);\n            return this;\n        }\n\n        public Builder setDialogBackgroundColor(@ColorInt int backgroundColor) {\n            this.params.dialogBackgroundColor = backgroundColor;\n            return this;\n        }\n\n        public Builder setCornerRadius(float cornerRadius) {\n            this.params.dialogCornerRadius = cornerRadius;\n            return this;\n        }\n\n        public Builder setOuterMargin(int margin) {\n            this.params.dialogOuterMargin = margin;\n            return this;\n        }\n\n        public Builder setMessage(CharSequence message) {\n            this.params.message = message;\n            return this;\n        }\n\n        public Builder setTitle(CharSequence title) {\n            this.params.title = title;\n            return this;\n        }\n\n        public Builder setMessage(@StringRes int messageId) {\n            this.params.message = params.context.getString(messageId);\n            return this;\n        }\n\n        public Builder setTitle(@StringRes int titleId) {\n            this.params.title = params.context.getString(titleId);\n            return this;\n        }\n\n        public Builder setTextColor(@ColorInt int color) {\n            this.params.textColor = color;\n            return this;\n        }\n\n        public Builder setContentImageDrawable(@DrawableRes int contentImageDrawableId) {\n            this.params.contentImageDrawableId = contentImageDrawableId;\n            this.params.contentImageDrawable = null;\n            return this;\n        }\n\n        public Builder setContentImageDrawable(Drawable contentImageDrawable) {\n            this.params.contentImageDrawable = contentImageDrawable;\n            this.params.contentImageDrawableId = -1;\n            return this;\n        }\n\n        public Builder setIcon(@DrawableRes int iconDrawableId) {\n            this.params.iconDrawableId = iconDrawableId;\n            this.params.iconDrawable = null;\n            return this;\n        }\n\n        public Builder setIcon(Drawable iconDrawable) {\n            this.params.iconDrawable = iconDrawable;\n            this.params.iconDrawableId = -1;\n            return this;\n        }\n\n        public Builder onDismissListener(OnDismissListener onDismissListener) {\n            this.params.onDismissListener = onDismissListener;\n            return this;\n        }\n\n        public Builder setDialogStyle(CFAlertStyle style) {\n            this.params.dialogStyle = style;\n            return this;\n        }\n\n        /**\n         * @param textGravity @see android.view.Gravity\n         */\n        public Builder setTextGravity(int textGravity) {\n            this.params.textGravity = textGravity;\n            return this;\n        }\n\n        public Builder addButton(String buttonText, @ColorInt int textColor, @ColorInt int backgroundColor, CFAlertActionStyle style, CFAlertActionAlignment alignment, OnClickListener onClickListener) {\n            CFAlertActionButton button = new CFAlertActionButton(this.params.context, buttonText, textColor, backgroundColor, style, alignment, onClickListener);\n            this.params.buttons.add(button);\n            return this;\n        }\n\n        public Builder setItems(String[] items, OnClickListener onItemClickListener) {\n            params.items = items;\n            params.onItemClickListener = onItemClickListener;\n            return this;\n        }\n\n        public Builder setMultiChoiceItems(String[] items, boolean[] selectedItems, OnMultiChoiceClickListener onMultiChoiceClickListener) {\n            params.multiSelectItems = items;\n            params.multiSelectedItems = selectedItems;\n            params.onMultiChoiceClickListener = onMultiChoiceClickListener;\n            return this;\n        }\n\n        public Builder setSingleChoiceItems(String[] items, int selectedItem, OnClickListener onItemClickListener) {\n            params.singleSelectItems = items;\n            params.singleSelectedItem = selectedItem;\n            params.onSingleItemClickListener = onItemClickListener;\n            return this;\n        }\n\n        public Builder setHeaderView(View headerView) {\n            this.params.headerView = headerView;\n            this.params.headerViewId = -1;\n            return this;\n        }\n\n        public Builder setHeaderView(@LayoutRes int headerViewId) {\n            this.params.headerViewId = headerViewId;\n            this.params.headerView = null;\n            return this;\n        }\n\n        public Builder setFooterView(View footerView) {\n            this.params.footerView = footerView;\n            this.params.footerViewId = -1;\n            return this;\n        }\n\n        public Builder setFooterView(@LayoutRes int footerViewId) {\n            this.params.footerViewId = footerViewId;\n            this.params.footerView = null;\n            return this;\n        }\n\n        /**\n         * default is true\n         *\n         * @param cancelable\n         */\n        public Builder setCancelable(boolean cancelable) {\n            this.params.cancelable = cancelable;\n            return this;\n        }\n\n        public Builder setAutoDismissAfter(long duration) {\n            this.params.autoDismissDuration = duration;\n            return this;\n        }\n\n        public CFAlertDialog create() {\n            CFAlertDialog cfAlertDialog;\n            if (params.theme == 0) {\n                cfAlertDialog = new CFAlertDialog(params.context);\n            } else {\n                cfAlertDialog = new CFAlertDialog(params.context, params.theme);\n            }\n\n            cfAlertDialog.setOnDismissListener(params.onDismissListener);\n            cfAlertDialog.setDialogParams(params);\n            return cfAlertDialog;\n        }\n\n        public CFAlertDialog show() {\n            final CFAlertDialog dialog = create();\n            dialog.show();\n            return dialog;\n        }\n    }\n\n    private static class DialogParams {\n\n        private Context context;\n        private @ColorInt int backgroundColor = Color.parseColor(\"#B3000000\");\n        private @ColorInt int dialogBackgroundColor = Color.parseColor(\"#FFFFFF\");\n        private float dialogCornerRadius = -1;\n        private int dialogOuterMargin = -1;\n        private CharSequence message, title;\n        private @ColorInt int textColor = -1;\n        private int theme = R.style.CFDialog,\n                textGravity = Gravity.LEFT,\n                iconDrawableId = -1,\n                contentImageDrawableId = -1;\n        private CFAlertStyle dialogStyle = CFAlertStyle.ALERT;\n        private View headerView, footerView;\n        private int headerViewId = -1, footerViewId = -1;\n        private Drawable contentImageDrawable, iconDrawable;\n        private List<CFAlertActionButton> buttons = new ArrayList<>();\n        private OnDismissListener onDismissListener;\n        private boolean cancelable = true;\n        private String[] multiSelectItems;\n        private String[] items;\n        private String[] singleSelectItems;\n        private boolean[] multiSelectedItems;\n        private int singleSelectedItem = -1;\n        private OnClickListener onItemClickListener;\n        private OnClickListener onSingleItemClickListener;\n        private OnMultiChoiceClickListener onMultiChoiceClickListener;\n        private long autoDismissDuration = -1;\n\n        public boolean isDialogBodyEmpty() {\n            if (!TextUtils.isEmpty(title)) return false;\n            if (!TextUtils.isEmpty(message)) return false;\n            if (buttons != null && buttons.size() > 0) return false;\n            if (items != null && items.length > 0) return false;\n            if (singleSelectItems != null && singleSelectItems.length != 0) return false;\n            if (multiSelectItems != null && multiSelectItems.length != 0) return false;\n\n            // The dialog body is empty if it doesn't contain any of the above items\n            return true;\n        }\n    }\n\n    private static class CFAlertActionButton {\n        private Context context;\n        private String buttonText;\n        private DialogInterface.OnClickListener onClickListener;\n        private int textColor = -1;\n        private CFAlertActionStyle style;\n        private CFAlertActionAlignment alignment = CFAlertActionAlignment.JUSTIFIED;\n        private int backgroundColor = -1;\n        private int backgroundDrawableId = -1;\n\n        public CFAlertActionButton(Context context, String buttonText, @ColorInt int textColor, @ColorInt int backgroundColor, CFAlertActionStyle style, CFAlertActionAlignment alignment, OnClickListener onClickListener) {\n            this.context = context;\n            this.buttonText = buttonText;\n            this.textColor = textColor;\n            this.backgroundColor = backgroundColor;\n            this.style = style;\n            this.backgroundDrawableId = getBackgroundDrawable(style);\n            this.alignment = alignment;\n            this.onClickListener = onClickListener;\n\n            // default textColor\n            if (textColor == -1) {\n                this.textColor = getTextColor(style);\n            }\n        }\n\n        private @DrawableRes int getBackgroundDrawable(CFAlertActionStyle style) {\n            @DrawableRes int backgroundDrawable = 0;\n            switch (style) {\n                case NEGATIVE:\n                    backgroundDrawable = R.drawable.cfdialog_negative_button_background_drawable;\n                    break;\n                case POSITIVE:\n                    backgroundDrawable = R.drawable.cfdialog_positive_button_background_drawable;\n                    break;\n                case DEFAULT:\n                    backgroundDrawable = R.drawable.cfdialog_default_button_background_drawable;\n                    break;\n            }\n            return backgroundDrawable;\n        }\n\n        private @ColorInt int getTextColor(CFAlertActionStyle style) {\n            @ColorInt int textColor = -1;\n            switch (style) {\n                case NEGATIVE:\n                    textColor = ContextCompat.getColor(context, R.color.cfdialog_button_white_text_color);\n                    break;\n                case POSITIVE:\n                    textColor = ContextCompat.getColor(context, R.color.cfdialog_button_white_text_color);\n                    break;\n                case DEFAULT:\n                    textColor = ContextCompat.getColor(context, R.color.cfdialog_default_button_text_color);\n                    break;\n            }\n            return textColor;\n        }\n    }\n}\n"
  },
  {
    "path": "cfalertdialog/src/main/java/com/crowdfire/cfalertdialog/utils/DeviceUtil.java",
    "content": "package com.crowdfire.cfalertdialog.utils;\n\nimport android.content.Context;\nimport android.content.res.Resources;\nimport android.graphics.Point;\nimport android.util.DisplayMetrics;\nimport android.view.Display;\nimport android.view.WindowManager;\n\npublic class DeviceUtil {\n\n    public static int getScreenWidth(Context context) {\n        Display display = ((WindowManager) context.getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay();\n        Point size = new Point();\n        display.getSize(size);\n        return size.x;\n    }\n\n    public static int getScreenHeight(Context context) {\n        Display display = ((WindowManager) context.getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay();\n        Point size = new Point();\n        display.getSize(size);\n        return size.y;\n    }\n\n    /**\n     * This method converts dp unit to equivalent pixels, depending on device density.\n     *\n     * @param dp A value in dp (density independent pixels) unit. Which we need to convert into pixels\n     * @return A float value to represent px equivalent to dp depending on device density\n     */\n    public static int convertDpToPixel(Context context, float dp) {\n        Resources resources = context.getResources();\n        DisplayMetrics metrics = resources.getDisplayMetrics();\n        int px = (int) dp * (metrics.densityDpi / DisplayMetrics.DENSITY_DEFAULT);\n        return px;\n    }\n\n    /**\n     * This method converts device specific pixels to density independent pixels.\n     *\n     * @param px A value in px (pixels) unit. Which we need to convert into db\n     * @return A float value to represent dp equivalent to px value\n     */\n    public static float convertPixelsToDp(Context context, float px) {\n        Resources resources = context.getResources();\n        DisplayMetrics metrics = resources.getDisplayMetrics();\n        float dp = px / (metrics.densityDpi / DisplayMetrics.DENSITY_DEFAULT);\n        return dp;\n    }\n\n    /**\n     * This method converts sp unit to equivalent pixels, depending on device density.\n     *\n     * @param sp A value in sp (scale independent pixels) unit. Which we need to convert into pixels\n     * @return A float value to represent px equivalent to sp depending on device scale\n     */\n    public static int convertSpToPixel(Context context, float sp) {\n        float scaledDensity = context.getResources().getDisplayMetrics().scaledDensity;\n        return (int) (sp * scaledDensity);\n    }\n\n    /**\n     * This method converts device specific pixels to scale independent pixels.\n     *\n     * @param px A value in px (pixels) unit. Which we need to convert into db\n     * @return A float value to represent sp equivalent to px value\n     */\n    public static float convertPixelsToSp(Context context, float px) {\n        float scaledDensity = context.getResources().getDisplayMetrics().scaledDensity;\n        return px / scaledDensity;\n    }\n}\n"
  },
  {
    "path": "cfalertdialog/src/main/java/com/crowdfire/cfalertdialog/utils/SwipeToHideViewListener.java",
    "content": "package com.crowdfire.cfalertdialog.utils;\n\nimport android.animation.Animator;\nimport android.view.MotionEvent;\nimport android.view.View;\nimport android.view.ViewPropertyAnimator;\n\n/**\n * Created by rahul on 31/08/17.\n */\n\npublic class SwipeToHideViewListener implements View.OnTouchListener {\n\n    private boolean isTouching;\n    private float swipeStartX;\n    private float swipeStartY;\n    private float viewStartX;\n    private float deltaX = 0;\n    private float deltaY = 0;\n    private boolean isSwipingHorizontal = false;\n\n    private View animatingView;\n    private boolean shouldDismissView;\n    private SwipeToHideCompletionListener listener;\n\n    private static final int SWIPE_TO_DISMISS_THRESHOLD = 150;\n    private static final int SWIPE_TO_DISMISS_ANIMATION_DURATION = 100;\n\n    public SwipeToHideViewListener(View animatingView, boolean shouldDismissView, SwipeToHideCompletionListener listener) {\n        this.animatingView = animatingView;\n        this.shouldDismissView = shouldDismissView;\n        this.listener = listener;\n    }\n\n    public void setAnimatingView(View animatingView) {\n        this.animatingView = animatingView;\n    }\n\n    public void setShouldDismissView(boolean shouldDismissView) {\n        this.shouldDismissView = shouldDismissView;\n    }\n\n    public void setListener(SwipeToHideCompletionListener listener) {\n        this.listener = listener;\n    }\n\n    @Override\n    public boolean onTouch(View view, MotionEvent motionEvent) {\n\n        switch (motionEvent.getAction()) {\n            case MotionEvent.ACTION_DOWN:\n\n                // Set Touched view as the animatingView if not set\n                if (animatingView == null) animatingView = view;\n\n                isTouching = true;\n                startSwipe(motionEvent);\n                break;\n\n            case MotionEvent.ACTION_MOVE:\n\n                if (!isTouching) break;\n                moveSwipe(motionEvent);\n                break;\n\n            case MotionEvent.ACTION_UP:\n\n                view.performClick();\n            case MotionEvent.ACTION_OUTSIDE:\n\n                isTouching = false;\n                isSwipingHorizontal = false;\n                endSwipe();\n                break;\n        }\n\n        return isSwipingHorizontal;\n    }\n\n    private void startSwipe(MotionEvent event) {\n\n        // Keep the initial swipe action position\n        swipeStartX = event.getRawX();\n        swipeStartY = event.getRawY();\n\n        viewStartX = animatingView.getX();\n    }\n\n    private void moveSwipe(MotionEvent event) {\n\n        // Check if the motion is horizontal\n        deltaX = event.getRawX() - swipeStartX;\n        deltaY = event.getRawY() - swipeStartY;\n\n        // Check Vertical Swipe\n        if (Math.abs(deltaY) > 0 && Math.abs(deltaY) > Math.abs(deltaX)) {\n\n            // Is swiping vertically\n            return;\n        }\n        // Check Horizontal swipe\n        if (Math.abs(deltaX) > 0) {\n            animateViewHorizontally(deltaX, 0, false, null);\n            isSwipingHorizontal = true;\n        }\n    }\n\n    private void endSwipe() {\n\n        if (shouldDismissView && Math.abs(deltaX) > SWIPE_TO_DISMISS_THRESHOLD) {\n\n            // Check whether view should animate left or right\n            float endPos = (deltaX > 0) ? animatingView.getWidth() : -animatingView.getWidth();\n            animateViewHorizontally(endPos, SWIPE_TO_DISMISS_ANIMATION_DURATION, true, new AnimatorCompletionListener() {\n                @Override\n                void onAnimationCompleted() {\n                    if (listener != null) listener.viewDismissed();\n                }\n            });\n        }\n        else {\n            animateViewHorizontally(0, SWIPE_TO_DISMISS_ANIMATION_DURATION, false, null);\n        }\n    }\n\n    private void animateViewHorizontally(float dX, int duration, boolean shouldHide, AnimatorCompletionListener listener) {\n\n        float animatingDistance = viewStartX + dX;\n\n        ViewPropertyAnimator animator = animatingView.animate()\n                .x(animatingDistance)\n                .setDuration(duration)\n                .setListener(listener);\n\n        if (shouldHide) {\n            animator.alpha(0);\n        }\n\n        animator.start();\n    }\n\n    private abstract class AnimatorCompletionListener implements Animator.AnimatorListener {\n        @Override\n        public void onAnimationStart(Animator animator) {\n\n        }\n\n        @Override\n        public void onAnimationEnd(Animator animator) {\n            onAnimationCompleted();\n        }\n\n        @Override\n        public void onAnimationCancel(Animator animator) {\n\n        }\n\n        @Override\n        public void onAnimationRepeat(Animator animator) {\n\n        }\n\n        abstract void onAnimationCompleted();\n    }\n\n    public interface SwipeToHideCompletionListener {\n        void viewDismissed();\n    }\n\n}\n"
  },
  {
    "path": "cfalertdialog/src/main/java/com/crowdfire/cfalertdialog/utils/ViewUtil.java",
    "content": "package com.crowdfire.cfalertdialog.utils;\n\nimport android.view.MotionEvent;\nimport android.view.View;\nimport android.view.animation.Animation;\nimport android.view.animation.DecelerateInterpolator;\nimport android.view.animation.ScaleAnimation;\n\npublic class ViewUtil {\n\n    public static void addBounceEffect(View view) {\n        view.setOnTouchListener(new View.OnTouchListener() {\n            @Override\n            public boolean onTouch(View v, MotionEvent event) {\n                return onButtonTouch(v, event);\n            }\n        });\n    }\n\n    private static boolean onButtonTouch(View button, MotionEvent event) {\n        if (event.getAction() == MotionEvent.ACTION_DOWN) {\n            onButtonPressed(button);\n        } else if (event.getAction() == MotionEvent.ACTION_UP\n                || event.getAction() == MotionEvent.ACTION_CANCEL\n                || event.getAction() == MotionEvent.ACTION_OUTSIDE) {\n            onButtonReleased(button);\n        }\n        return false;\n    }\n\n    private static void onButtonPressed(View button) {\n        ScaleAnimation scaleAnimation = new ScaleAnimation(1, 0.9f,\n                                                           1, 0.9f,\n                                                           Animation.RELATIVE_TO_SELF, 0.5f,\n                                                           Animation.RELATIVE_TO_SELF, 0.5f);\n        scaleAnimation.setInterpolator(new DecelerateInterpolator());\n        scaleAnimation.setDuration(100);\n        scaleAnimation.setFillAfter(true);\n        button.startAnimation(scaleAnimation);\n    }\n\n    private static void onButtonReleased(View button) {\n        ScaleAnimation scaleAnimation = new ScaleAnimation(0.9f, 1f,\n                                                           0.9f, 1f,\n                                                           Animation.RELATIVE_TO_SELF, 0.5f,\n                                                           Animation.RELATIVE_TO_SELF, 0.5f);\n        scaleAnimation.setInterpolator(new DecelerateInterpolator());\n        scaleAnimation.setDuration(100);\n        scaleAnimation.setFillAfter(true);\n        button.startAnimation(scaleAnimation);\n    }\n}\n"
  },
  {
    "path": "cfalertdialog/src/main/java/com/crowdfire/cfalertdialog/views/CFPushButton.java",
    "content": "package com.crowdfire.cfalertdialog.views;\n\nimport android.content.Context;\nimport android.graphics.Typeface;\nimport androidx.appcompat.widget.AppCompatButton;\nimport android.util.AttributeSet;\nimport android.view.Gravity;\n\nimport com.crowdfire.cfalertdialog.utils.ViewUtil;\n\n/**\n * Created by rahul on 29/06/17.\n */\n\npublic class CFPushButton extends AppCompatButton {\n\n    public CFPushButton(Context context) {\n        this(context, null, 0);\n    }\n\n    public CFPushButton(Context context, AttributeSet attrs) {\n        this(context,attrs, 0);\n    }\n\n    public CFPushButton(Context context, AttributeSet attrs, int defStyleAttr) {\n        super(context, attrs, defStyleAttr);\n\n        initButton(context, attrs, defStyleAttr);\n    }\n\n    void initButton(Context context, AttributeSet attributeSet, int defStyleAttr) {\n\n        // Set centered text alignment\n        setGravity(Gravity.CENTER);\n        ViewUtil.addBounceEffect(this);\n\n        setTypeface(getTypeface(), Typeface.BOLD);\n    }\n\n}\n"
  },
  {
    "path": "cfalertdialog/src/main/res/anim/alert_dismiss.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<set xmlns:android=\"http://schemas.android.com/apk/res/android\">\n\n    <alpha\n        android:duration=\"@integer/cfdialog_animation_duration_200\"\n        android:fromAlpha=\"1\"\n        android:interpolator=\"@anim/interpolator_acceleration_1_5\"\n        android:toAlpha=\"0\"/>\n</set>"
  },
  {
    "path": "cfalertdialog/src/main/res/anim/alert_present.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<set xmlns:android=\"http://schemas.android.com/apk/res/android\">\n\n    <alpha\n        android:duration=\"@integer/cfdialog_animation_duration_200\"\n        android:fromAlpha=\"0\"\n        android:interpolator=\"@anim/interpolator_acceleration_1_5\"\n        android:toAlpha=\"1\"/>\n</set>"
  },
  {
    "path": "cfalertdialog/src/main/res/anim/dialog_dismiss_bottom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<set xmlns:android=\"http://schemas.android.com/apk/res/android\"\n     android:interpolator=\"@android:interpolator/accelerate_decelerate\">\n    <translate\n        android:duration=\"@integer/cfdialog_animation_duration_200\"\n        android:fromXDelta=\"0\"\n        android:fromYDelta=\"0\"\n        android:toXDelta=\"0\"\n        android:toYDelta=\"150%\"/>\n</set>"
  },
  {
    "path": "cfalertdialog/src/main/res/anim/dialog_dismiss_center.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<set xmlns:android=\"http://schemas.android.com/apk/res/android\">\n\n    <alpha\n        android:duration=\"0\"\n        android:fromAlpha=\"1\"\n        android:interpolator=\"@android:anim/accelerate_decelerate_interpolator\"\n        android:toAlpha=\"1\"/>\n</set>"
  },
  {
    "path": "cfalertdialog/src/main/res/anim/dialog_dismiss_top.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<set xmlns:android=\"http://schemas.android.com/apk/res/android\"\n     android:interpolator=\"@android:interpolator/accelerate_decelerate\">\n\n    <translate\n        android:duration=\"@integer/cfdialog_animation_duration_200\"\n        android:fromXDelta=\"0\"\n        android:fromYDelta=\"0\"\n        android:toXDelta=\"0\"\n        android:toYDelta=\"-150%\"/>\n</set>"
  },
  {
    "path": "cfalertdialog/src/main/res/anim/dialog_present_bottom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<set xmlns:android=\"http://schemas.android.com/apk/res/android\"\n     android:interpolator=\"@anim/interpolator_deceleration_3\">\n\n    <translate\n        android:duration=\"@integer/cfdialog_animation_duration_500\"\n        android:fromXDelta=\"0\"\n        android:fromYDelta=\"100%\"\n        android:toXDelta=\"0\"\n        android:toYDelta=\"0\"/>\n</set>"
  },
  {
    "path": "cfalertdialog/src/main/res/anim/dialog_present_center.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<set xmlns:android=\"http://schemas.android.com/apk/res/android\"\n     android:interpolator=\"@anim/interpolator_overshoot_1_2\">\n\n    <scale\n        android:duration=\"@integer/cfdialog_animation_duration\"\n        android:fromXScale=\"1.4\"\n        android:fromYScale=\"1.4\"\n        android:pivotX=\"50%\"\n        android:pivotY=\"50%\"\n        android:toXScale=\"1.0\"\n        android:toYScale=\"1.0\"/>\n</set>"
  },
  {
    "path": "cfalertdialog/src/main/res/anim/dialog_present_top.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<set xmlns:android=\"http://schemas.android.com/apk/res/android\"\n     android:interpolator=\"@anim/interpolator_deceleration_1_5\">\n    <translate\n        android:duration=\"@integer/cfdialog_animation_duration_400\"\n        android:fromXDelta=\"0\"\n        android:fromYDelta=\"-100%\"\n        android:toXDelta=\"0\"\n        android:toYDelta=\"0\"/>\n</set>"
  },
  {
    "path": "cfalertdialog/src/main/res/anim/interpolator_acceleration_1_5.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<accelerateInterpolator\n    xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:factor=\"1.5\"/>"
  },
  {
    "path": "cfalertdialog/src/main/res/anim/interpolator_deceleration_1_5.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<decelerateInterpolator\n    xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:factor=\"1.5\" />"
  },
  {
    "path": "cfalertdialog/src/main/res/anim/interpolator_deceleration_3.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<decelerateInterpolator\n    xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:factor=\"3\" />"
  },
  {
    "path": "cfalertdialog/src/main/res/anim/interpolator_overshoot_1.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<overshootInterpolator\n    xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:tension=\"1\"/>"
  },
  {
    "path": "cfalertdialog/src/main/res/anim/interpolator_overshoot_1_2.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<overshootInterpolator\n    xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:tension=\"1.2\"/>"
  },
  {
    "path": "cfalertdialog/src/main/res/drawable/cfdialog_buttons_spacing.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\">\n\n    <size android:height=\"@dimen/cfdialog_internal_spacing\" android:width=\"0dp\" />\n</shape>"
  },
  {
    "path": "cfalertdialog/src/main/res/drawable/cfdialog_content_spacing_horizontal.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\">\n\n    <size android:width=\"@dimen/cfdialog_internal_spacing\" android:height=\"0dp\" />\n</shape>"
  },
  {
    "path": "cfalertdialog/src/main/res/drawable/cfdialog_content_spacing_vertical.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\">\n\n    <size android:width=\"0dp\" android:height=\"@dimen/cfdialog_internal_spacing\" />\n</shape>"
  },
  {
    "path": "cfalertdialog/src/main/res/drawable/cfdialog_default_button_background_drawable.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <item android:state_pressed=\"true\">\n        <shape android:shape=\"rectangle\">\n            <corners android:radius=\"@dimen/cfdialog_button_corner_radius\"/>\n            <stroke android:color=\"#90A4AE\" android:width=\"1dp\"/>\n            <solid android:color=\"#CFD8DC\"/>\n        </shape>\n    </item>\n    <item>\n        <shape android:shape=\"rectangle\">\n            <corners android:radius=\"@dimen/cfdialog_button_corner_radius\"/>\n            <stroke android:color=\"#CFD8DC\" android:width=\"1dp\"/>\n            <solid android:color=\"@android:color/white\"/>\n        </shape>\n    </item>\n</selector>"
  },
  {
    "path": "cfalertdialog/src/main/res/drawable/cfdialog_negative_button_background_drawable.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <item android:state_pressed=\"true\">\n        <shape android:shape=\"rectangle\">\n            <corners android:radius=\"@dimen/cfdialog_button_corner_radius\"/>\n            <stroke android:width=\"1dp\" android:color=\"@android:color/transparent\"/>\n            <solid android:color=\"@color/cfdialog_negative_button_pressed_color\"/>\n        </shape>\n    </item>\n    <item>\n        <shape android:shape=\"rectangle\">\n            <corners android:radius=\"@dimen/cfdialog_button_corner_radius\"/>\n            <stroke android:width=\"1dp\" android:color=\"@color/cfdialog_button_drawable_stroke\"/>\n            <solid android:color=\"@color/cfdialog_negative_button_color\"/>\n        </shape>\n    </item>\n</selector>"
  },
  {
    "path": "cfalertdialog/src/main/res/drawable/cfdialog_positive_button_background_drawable.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <item android:state_pressed=\"true\">\n        <shape android:shape=\"rectangle\">\n            <corners android:radius=\"@dimen/cfdialog_button_corner_radius\"/>\n            <stroke android:width=\"1dp\" android:color=\"@android:color/transparent\"/>\n            <solid android:color=\"@color/cfdialog_positive_button_pressed_color\"/>\n        </shape>\n    </item>\n    <item>\n        <shape android:shape=\"rectangle\">\n            <corners android:radius=\"@dimen/cfdialog_button_corner_radius\"/>\n            <stroke android:width=\"1dp\" android:color=\"@color/cfdialog_button_drawable_stroke\"/>\n            <solid android:color=\"@color/cfdialog_positive_button_color\"/>\n        </shape>\n    </item>\n</selector>"
  },
  {
    "path": "cfalertdialog/src/main/res/layout/cfalert_layout.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    xmlns:app=\"http://schemas.android.com/apk/res-auto\"\n    android:id=\"@+id/cfdialog_background\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:animateLayoutChanges=\"true\"\n    android:clickable=\"true\"\n    android:gravity=\"center\">\n\n    <RelativeLayout\n        android:id=\"@+id/cfdialog_container\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:gravity=\"center_horizontal\">\n\n        <androidx.cardview.widget.CardView\n            android:id=\"@+id/cfdialog_cardview\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"wrap_content\"\n            android:clipChildren=\"true\"\n            app:cardBackgroundColor=\"@android:color/transparent\"\n            app:cardElevation=\"0dp\"\n            android:animateLayoutChanges=\"true\">\n\n            <ScrollView\n                android:id=\"@+id/cfdialog_scrollview\"\n                android:layout_width=\"match_parent\"\n                android:layout_height=\"wrap_content\"\n                android:animateLayoutChanges=\"true\"\n                android:scrollbars=\"none\">\n\n                <LinearLayout\n                    android:layout_width=\"match_parent\"\n                    android:layout_height=\"wrap_content\"\n                    android:animateLayoutChanges=\"true\"\n                    android:orientation=\"vertical\">\n\n                    <!-- Header view container -->\n                    <LinearLayout\n                        android:id=\"@+id/alert_header_container\"\n                        android:layout_width=\"match_parent\"\n                        android:layout_height=\"wrap_content\"\n                        android:animateLayoutChanges=\"true\"\n                        android:orientation=\"vertical\" />\n\n                    <!-- Alert Content -->\n                    <LinearLayout\n                        android:id=\"@+id/alert_body_container\"\n                        android:layout_width=\"match_parent\"\n                        android:layout_height=\"wrap_content\"\n                        android:layout_margin=\"@dimen/cfdialog_padding\"\n                        android:divider=\"@drawable/cfdialog_content_spacing_vertical\"\n                        android:orientation=\"vertical\"\n                        android:showDividers=\"middle\">\n\n                        <!--Title and icon-->\n                        <LinearLayout\n                            android:id=\"@+id/icon_title_container\"\n                            android:layout_width=\"wrap_content\"\n                            android:layout_height=\"wrap_content\"\n                            android:animateLayoutChanges=\"true\"\n                            android:divider=\"@drawable/cfdialog_content_spacing_horizontal\"\n                            android:gravity=\"center_vertical\"\n                            android:orientation=\"horizontal\"\n                            android:showDividers=\"middle\">\n\n                            <ImageView\n                                android:id=\"@+id/cfdialog_icon_imageview\"\n                                style=\"@style/CFDialog.IconImage\"\n                                android:visibility=\"visible\"/>\n\n                            <TextView\n                                android:id=\"@+id/tv_dialog_title\"\n                                style=\"@style/CFDialog.Title\"\n                                tools:text=\"This is your title\"/>\n                        </LinearLayout>\n\n                        <!--Message-->\n                        <TextView\n                            android:id=\"@+id/tv_dialog_content_desc\"\n                            style=\"@style/CFDialog.Message\"\n                            android:animateLayoutChanges=\"true\"\n                            tools:text=\"This is your description\" />\n\n                        <!--Selection items-->\n                        <LinearLayout\n                            android:id=\"@+id/alert_selection_items_container\"\n                            style=\"@style/CFDialog.SelectionContainer\"\n                            android:animateLayoutChanges=\"true\"\n                            android:orientation=\"vertical\"\n                            android:visibility=\"gone\"\n                            tools:visibility=\"visible\">\n\n                            <include layout=\"@layout/cfdialog_selectable_item_layout\" />\n\n                            <include layout=\"@layout/cfdialog_multi_select_item_layout\" />\n\n                            <include layout=\"@layout/cfdialog_single_select_item_layout\" />\n\n                        </LinearLayout>\n\n                        <!--buttons-->\n                        <LinearLayout\n                            android:id=\"@+id/alert_buttons_container\"\n                            style=\"@style/CFDialog.ButtonsContainer\"\n                            android:animateLayoutChanges=\"true\"\n                            android:divider=\"@drawable/cfdialog_buttons_spacing\"\n                            android:orientation=\"vertical\"\n                            android:showDividers=\"middle\"\n                            android:visibility=\"gone\"\n                            tools:visibility=\"visible\">\n\n                        </LinearLayout>\n\n                    </LinearLayout>\n\n                    <!-- Footer view container -->\n                    <LinearLayout\n                        android:id=\"@+id/alert_footer_container\"\n                        android:layout_width=\"match_parent\"\n                        android:layout_height=\"wrap_content\"\n                        android:animateLayoutChanges=\"true\"\n                        android:orientation=\"vertical\" />\n                </LinearLayout>\n\n            </ScrollView>\n        </androidx.cardview.widget.CardView>\n\n    </RelativeLayout>\n\n</RelativeLayout>\n"
  },
  {
    "path": "cfalertdialog/src/main/res/layout/cfdialog_imageview_header.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<ImageView xmlns:android=\"http://schemas.android.com/apk/res/android\"\n              style=\"@style/CFDialog.ContentImageView\"\n    android:id=\"@+id/cfdialog_imageview_content\">\n\n</ImageView>"
  },
  {
    "path": "cfalertdialog/src/main/res/layout/cfdialog_multi_select_item_layout.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RelativeLayout\n    xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"wrap_content\">\n\n    <androidx.appcompat.widget.AppCompatCheckBox\n        android:id=\"@+id/cfdialog_multi_select_item_checkbox\"\n        style=\"@style/CFDialog.MultiSelectItemCheckbox\"\n        tools:checked=\"true\"\n        tools:text=\"item text\"/>\n</RelativeLayout>"
  },
  {
    "path": "cfalertdialog/src/main/res/layout/cfdialog_selectable_item_layout.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n                xmlns:tools=\"http://schemas.android.com/tools\"\n                android:layout_width=\"match_parent\"\n                android:layout_height=\"wrap_content\"\n                android:background=\"?attr/selectableItemBackground\"\n                android:clickable=\"true\"\n                android:orientation=\"vertical\">\n\n    <TextView\n        android:id=\"@+id/cfdialog_selectable_item_textview\"\n        style=\"@style/CFDialog.SelectableItemTextview\"\n        tools:text=\"Item name\"/>\n</RelativeLayout>"
  },
  {
    "path": "cfalertdialog/src/main/res/layout/cfdialog_single_select_item_layout.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RadioGroup xmlns:android=\"http://schemas.android.com/apk/res/android\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"wrap_content\"\n            android:orientation=\"vertical\"\n            android:id=\"@+id/cfstage_single_select_radio_group\"\n            >\n\n    <include layout=\"@layout/cfdialog_single_select_radio_button_layout\"/>\n</RadioGroup>"
  },
  {
    "path": "cfalertdialog/src/main/res/layout/cfdialog_single_select_radio_button_layout.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<androidx.appcompat.widget.AppCompatRadioButton xmlns:android=\"http://schemas.android.com/apk/res/android\"\n                                                xmlns:tools=\"http://schemas.android.com/tools\"\n                                                style=\"@style/CFDialog.SingleSelectItemRadioButton\"\n                                                tools:checked=\"true\"\n                                                tools:text=\"radio button text\">\n\n</androidx.appcompat.widget.AppCompatRadioButton>"
  },
  {
    "path": "cfalertdialog/src/main/res/values/colors.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n\n    <color name=\"cfdialog_default_background_color\">#B3000000</color>\n    <color name=\"cfdialog_default_card_background_color\">#FFFFFF</color>\n    <color name=\"cfdialog_title_font_color\">#000000</color>\n    <color name=\"cfdialog_desc_font_color\">#434343</color>\n    <color name=\"cfdialog_button_drawable_stroke\">#0d000000</color>\n\n    <color name=\"cfdialog_default_button_text_color\">#263238</color>\n    <color name=\"cfdialog_button_white_text_color\">#ffffff</color>\n    <color name=\"cfdialog_button_black_text_color\">#000000</color>\n\n    <color name=\"cfdialog_positive_button_color\">#29c64d</color>\n    <color name=\"cfdialog_positive_button_pressed_color\">#80e598</color>\n    <color name=\"cfdialog_negative_button_color\">#FF4B4B</color>\n    <color name=\"cfdialog_negative_button_pressed_color\">#ff9999</color>\n    <color name=\"cfdialog_neutral_button_color\">#6768d9</color>\n    <color name=\"cfdialog_neutral_button_pressed_color\">#999ae6</color>\n\n</resources>"
  },
  {
    "path": "cfalertdialog/src/main/res/values/dimen.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n\n    <dimen name=\"cfdialog_maxwidth\">400dp</dimen>\n\n    <dimen name=\"cfdialog_outer_margin\">10dp</dimen>\n    <dimen name=\"cfdialog_internal_spacing\">10dp</dimen>\n    <dimen name=\"cfdialog_internal_spacing_half\">5dp</dimen>\n    <dimen name=\"cfdialog_padding\">20dp</dimen>\n    <dimen name=\"cfdialog_padding_half\">10dp</dimen>\n    <dimen name=\"cfdialog_header_bottom_margin_half\">10dp</dimen>\n    <dimen name=\"cfdialog_footer_top_margin_half\">10dp</dimen>\n    \n    <dimen name=\"cfdialog_card_corner_radius\">4dp</dimen>\n    <dimen name=\"cfdialog_card_elevation\">4dp</dimen>\n\n    <dimen name=\"cfdialog_imageview_top_margin\">10dp</dimen>\n    <dimen name=\"cfdialog_icon_dimen\">32dp</dimen>\n\n    <dimen name=\"cfdialog_title_font_size\">20sp</dimen>\n    <dimen name=\"cfdialog_description_font_size\">14sp</dimen>\n    <dimen name=\"cfdialog_button_text_font_size\">14sp</dimen>\n\n    <dimen name=\"cfdialog_button_padding\">10dp</dimen>\n    <dimen name=\"cfdialog_button_corner_radius\">4dp</dimen>\n\n</resources>"
  },
  {
    "path": "cfalertdialog/src/main/res/values/strings.xml",
    "content": "<resources>\n    <string name=\"app_name\">CFAlertDialog</string>\n\n    <string name=\"alert_placeholder_title\">Title</string>\n    <string name=\"alert_placeholder_message\">This is a message to be displayed on the alert.</string>\n</resources>\n"
  },
  {
    "path": "cfalertdialog/src/main/res/values/styles.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources xmlns:tools=\"http://schemas.android.com/tools\">\n\n    <style name=\"CFDialog\" parent=\"Theme.AppCompat.Light.Dialog\">\n        <item name=\"windowNoTitle\">true</item>\n        <item name=\"android:windowAnimationStyle\">@style/CFDialog.Animation</item>\n        <item name=\"android:backgroundDimEnabled\">true</item>\n        <item name=\"android:windowIsFloating\">false</item>\n        <item name=\"android:backgroundDimAmount\">0.0</item>\n    </style>\n\n    <style name=\"CFDialog.Card\" parent=\"CardView\">\n        <item name=\"android:layout_width\">match_parent</item>\n        <item name=\"android:layout_height\">wrap_content</item>\n        <item name=\"android:clipChildren\">true</item>\n    </style>\n\n    <style name=\"CFDialog.Animation\">\n        <item name=\"android:windowEnterAnimation\">@anim/alert_present</item>\n        <item name=\"android:windowExitAnimation\">@anim/alert_dismiss</item>\n    </style>\n\n    <style name=\"CFDialog.Title\">\n        <item name=\"android:textSize\">@dimen/cfdialog_title_font_size</item>\n        <item name=\"android:textColor\">@color/cfdialog_title_font_color</item>\n        <item name=\"android:textStyle\">bold</item>\n        <item name=\"android:includeFontPadding\">false</item>\n        <item name=\"android:layout_width\">match_parent</item>\n        <item name=\"android:layout_height\">wrap_content</item>\n        <item name=\"android:layout_gravity\">center_vertical</item>\n    </style>\n\n    <style name=\"CFDialog.Message\">\n        <item name=\"android:textSize\">@dimen/cfdialog_description_font_size</item>\n        <item name=\"android:textColor\">@color/cfdialog_desc_font_color</item>\n        <item name=\"android:textStyle\">normal</item>\n        <item name=\"android:includeFontPadding\">false</item>\n        <item name=\"android:layout_width\">match_parent</item>\n        <item name=\"android:layout_height\">wrap_content</item>\n        <item name=\"android:gravity\">left</item>\n    </style>\n\n    <style name=\"CFDialog.SelectionContainer\">\n        <item name=\"android:layout_width\">match_parent</item>\n        <item name=\"android:layout_height\">wrap_content</item>\n    </style>\n\n    <style name=\"CFDialog.ButtonsContainer\">\n        <item name=\"android:layout_width\">match_parent</item>\n        <item name=\"android:layout_height\">wrap_content</item>\n    </style>\n\n    <style name=\"CFDialog.ContentImageView\">\n        <item name=\"android:layout_width\">wrap_content</item>\n        <item name=\"android:layout_height\">wrap_content</item>\n        <item name=\"android:layout_weight\">1</item>\n        <item name=\"android:layout_gravity\">center_horizontal</item>\n        <item name=\"android:layout_marginTop\">@dimen/cfdialog_imageview_top_margin</item>\n        <item name=\"android:scaleType\">centerInside</item>\n    </style>\n\n    <style name=\"CFDialog.Button\">\n        <item name=\"android:layout_width\">match_parent</item>\n        <item name=\"android:layout_height\">wrap_content</item>\n        <item name=\"android:gravity\">center</item>\n        <item name=\"android:paddingTop\">10dp</item>\n        <item name=\"android:paddingBottom\">10dp</item>\n        <item name=\"android:paddingLeft\">20dp</item>\n        <item name=\"android:paddingRight\">20dp</item>\n        <item name=\"android:textSize\">@dimen/cfdialog_button_text_font_size</item>\n        <item name=\"android:textStyle\">bold</item>\n        <item name=\"android:textAllCaps\">true</item>\n    </style>\n\n    <style name=\"CFDialog.IconImage\">\n        <item name=\"android:layout_width\">@dimen/cfdialog_icon_dimen</item>\n        <item name=\"android:layout_height\">@dimen/cfdialog_icon_dimen</item>\n        <item name=\"android:scaleType\">centerInside</item>\n    </style>\n\n    <style name=\"CFDialog.SelectableItemTextview\">\n        <item name=\"android:layout_width\">wrap_content</item>\n        <item name=\"android:layout_height\">wrap_content</item>\n        <item name=\"android:layout_marginTop\">@dimen/cfdialog_padding_half</item>\n        <item name=\"android:layout_marginBottom\">@dimen/cfdialog_padding_half</item>\n        <item name=\"android:layout_centerVertical\">true</item>\n        <item name=\"android:textColor\">?android:attr/textColorPrimary</item>\n        <item name=\"android:textSize\">16sp</item>\n    </style>\n\n    <style name=\"CFDialog.MultiSelectItemCheckbox\">\n        <item name=\"android:layout_width\">match_parent</item>\n        <item name=\"android:layout_height\">wrap_content</item>\n        <item name=\"android:paddingTop\">@dimen/cfdialog_padding_half</item>\n        <item name=\"android:paddingBottom\">@dimen/cfdialog_padding_half</item>\n        <item name=\"android:layout_centerVertical\">true</item>\n        <item name=\"android:textColor\">?android:attr/textColorPrimary</item>\n        <item name=\"android:textSize\">16sp</item>\n        <item name=\"android:clickable\">true</item>\n        <item name=\"android:background\">?attr/selectableItemBackground</item>\n    </style>\n\n    <style name=\"CFDialog.SingleSelectItemRadioButton\">\n        <item name=\"android:layout_width\">match_parent</item>\n        <item name=\"android:layout_height\">wrap_content</item>\n        <item name=\"android:layout_centerVertical\">true</item>\n        <item name=\"android:textColor\">?android:attr/textColorPrimary</item>\n        <item name=\"android:textSize\">16sp</item>\n        <item name=\"android:paddingTop\">@dimen/cfdialog_padding_half</item>\n        <item name=\"android:paddingBottom\">@dimen/cfdialog_padding_half</item>\n        <item name=\"android:buttonTint\" tools:targetApi=\"21\">?android:attr/colorAccent</item>\n    </style>\n\n</resources>"
  },
  {
    "path": "cfalertdialog/src/main/res/values/values.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n    <integer name=\"cfdialog_animation_duration\">300</integer>\n    <integer name=\"cfdialog_animation_duration_200\">200</integer>\n    <integer name=\"cfdialog_animation_duration_400\">400</integer>\n    <integer name=\"cfdialog_animation_duration_500\">500</integer>\n</resources>"
  },
  {
    "path": "cfalertdialog/src/test/java/com/crowdfire/cfalertdialog/ExampleUnitTest.java",
    "content": "package com.crowdfire.cfalertdialog;\n\nimport org.junit.Test;\n\nimport static org.junit.Assert.*;\n\n/**\n * Example local unit test, which will execute on the development machine (host).\n *\n * @see <a href=\"http://d.android.com/tools/testing\">Testing documentation</a>\n */\npublic class ExampleUnitTest {\n    @Test\n    public void addition_isCorrect() throws Exception {\n        assertEquals(4, 2 + 2);\n    }\n}"
  },
  {
    "path": "cfalertdialogdemo/.gitignore",
    "content": "/build\n"
  },
  {
    "path": "cfalertdialogdemo/build.gradle",
    "content": "apply plugin: 'com.android.application'\n\nandroid {\n    compileSdkVersion 28\n    buildToolsVersion '28.0.3'\n    defaultConfig {\n        applicationId \"com.crowdfireapp.cfalertdialogdemo\"\n        minSdkVersion 14\n        targetSdkVersion 28\n        versionCode 1\n        versionName \"1.0\"\n        testInstrumentationRunner \"androidx.test.runner.AndroidJUnitRunner\"\n    }\n    buildTypes {\n        release {\n            minifyEnabled false\n            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'\n        }\n    }\n}\n\ndependencies {\n    implementation 'androidx.legacy:legacy-support-v4:1.0.0'\n    implementation fileTree(include: ['*.jar'], dir: 'libs')\n    androidTestImplementation('androidx.test.espresso:espresso-core:3.1.1-alpha01', {\n        exclude group: 'com.android.support', module: 'support-annotations'\n    })\n\n    implementation project(':cfalertdialog')\n    implementation 'androidx.appcompat:appcompat:1.1.0-alpha01'\n    implementation 'com.google.android.material:material:1.1.0-alpha01'\n    testImplementation 'junit:junit:4.12'\n}\n"
  },
  {
    "path": "cfalertdialogdemo/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/rahul/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\n# Uncomment this to preserve the line number information for\n# debugging stack traces.\n#-keepattributes SourceFile,LineNumberTable\n\n# If you keep the line number information, uncomment this to\n# hide the original source file name.\n#-renamesourcefileattribute SourceFile\n"
  },
  {
    "path": "cfalertdialogdemo/src/androidTest/java/com/crowdfire/cfalertdialogdemo/ExampleInstrumentedTest.java",
    "content": "package com.crowdfire.cfalertdialogdemo;\n\nimport android.content.Context;\nimport androidx.test.InstrumentationRegistry;\nimport androidx.test.runner.AndroidJUnit4;\n\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\n\nimport static org.junit.Assert.*;\n\n/**\n * Instrumentation test, which will execute on an Android device.\n *\n * @see <a href=\"http://d.android.com/tools/testing\">Testing documentation</a>\n */\n@RunWith(AndroidJUnit4.class)\npublic class ExampleInstrumentedTest {\n    @Test\n    public void useAppContext() throws Exception {\n        // Context of the app under test.\n        Context appContext = InstrumentationRegistry.getTargetContext();\n\n        assertEquals(\"com.crowdfire.cfalertdialogdemo\", appContext.getPackageName());\n    }\n}\n"
  },
  {
    "path": "cfalertdialogdemo/src/main/AndroidManifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    package=\"com.crowdfire.cfalertdialogdemo\">\n\n    <application\n        android:allowBackup=\"true\"\n        android:icon=\"@mipmap/ic_launcher\"\n        android:label=\"@string/app_name\"\n        android:roundIcon=\"@mipmap/ic_launcher_round\"\n        android:supportsRtl=\"true\"\n        android:theme=\"@style/AppTheme\">\n        <activity android:name=\"com.crowdfire.cfalertdialogdemo.StartActivity\">\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": "cfalertdialogdemo/src/main/java/com/crowdfire/cfalertdialogdemo/StartActivity.java",
    "content": "package com.crowdfire.cfalertdialogdemo;\n\nimport android.content.DialogInterface;\nimport android.graphics.Color;\nimport android.graphics.drawable.GradientDrawable;\nimport android.os.Bundle;\nimport com.google.android.material.floatingactionbutton.FloatingActionButton;\nimport androidx.core.view.ViewCompat;\nimport androidx.appcompat.app.AppCompatActivity;\nimport android.view.Gravity;\nimport android.view.View;\nimport android.view.WindowManager;\nimport android.widget.CheckBox;\nimport android.widget.EditText;\nimport android.widget.RadioButton;\nimport android.widget.Toast;\n\nimport com.crowdfire.cfalertdialog.CFAlertDialog;\nimport com.crowdfire.cfalertdialogdemo.views.ColorSelectionView;\nimport com.crowdfire.cfalertdialogdemo.views.SampleFooterView;\n\nimport static com.crowdfire.cfalertdialog.CFAlertDialog.CFAlertActionAlignment;\nimport static com.crowdfire.cfalertdialog.CFAlertDialog.CFAlertActionStyle;\nimport static com.crowdfire.cfalertdialog.CFAlertDialog.OnClickListener;\n\n/**\n * Created by rahul on 06/07/17.\n */\n\npublic class StartActivity extends AppCompatActivity implements SampleFooterView.FooterActionListener {\n\n    private static final int DEFAULT_BACKGROUND_COLOR = Color.parseColor(\"#B3000000\");\n\n    private EditText titleEditText, messageEditText;\n    private CheckBox positiveButtonCheckbox, negativeButtonCheckbox, neutralButtonCheckbox, addHeaderCheckBox, addFooterCheckBox, closesOnBackgroundTapCheckBox;\n    private RadioButton itemsRadioButton, multiChoiceRadioButton,\n            singleChoiceRadioButton;\n    private RadioButton textGravityLeft, textGravityCenter, textGravityRight;\n    private RadioButton buttonGravityLeft, buttonGravityRight, buttonGravityCenter, buttonGravityFull;\n    private CheckBox showTitleIcon;\n    private RadioButton topDialogGravityRadioButton, centerDialogGravityRadioButton, bottomDialogGravityRadioButton;\n    private View selectedBackgroundColorView, selectBackgroundColorContainer;\n    private FloatingActionButton showDialogFab;\n    private CFAlertDialog alertDialog;\n    private CFAlertDialog colorSelectionDialog;\n    private ColorSelectionView colorSelectionView;\n    private boolean headerVisibility;\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_start);\n        bindViews();\n\n        showDialogFab.setOnClickListener(new View.OnClickListener() {\n            @Override\n            public void onClick(View view) {\n                showCFDialog();\n            }\n        });\n\n        selectBackgroundColorContainer.setOnClickListener(new View.OnClickListener() {\n            @Override\n            public void onClick(View v) {\n                showColorSelectionAlert();\n            }\n        });\n\n        getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN);\n    }\n\n    private void showColorSelectionAlert() {\n        if (colorSelectionDialog == null) {\n\n            colorSelectionView = new ColorSelectionView(this);\n            colorSelectionView.setSelectedColor(DEFAULT_BACKGROUND_COLOR);\n            colorSelectionDialog = new CFAlertDialog.Builder(this)\n                    .addButton(\"Done\", -1, -1, CFAlertActionStyle.POSITIVE, CFAlertActionAlignment.JUSTIFIED, new OnClickListener() {\n                        @Override\n                        public void onClick(DialogInterface dialog, int which) {\n\n                            // Update the color preview\n                            setSelectedBackgroundColor(colorSelectionView.selectedColor);\n\n                            // dismiss the dialog\n                            colorSelectionDialog.dismiss();\n                        }\n                    })\n                    .setDialogStyle(CFAlertDialog.CFAlertStyle.BOTTOM_SHEET)\n                    .setHeaderView(colorSelectionView)\n                    .onDismissListener(new DialogInterface.OnDismissListener() {\n                        @Override\n                        public void onDismiss(DialogInterface dialogInterface) {\n\n                            // Update the color preview\n                            setSelectedBackgroundColor(colorSelectionView.selectedColor);\n                        }\n                    })\n                    .create();\n        }\n        colorSelectionDialog.show();\n    }\n\n    private void showCFDialog() {\n\n        CFAlertDialog.Builder builder = new CFAlertDialog.Builder(this);\n\n        // Vertical position of the dialog\n        if (topDialogGravityRadioButton.isChecked()) {\n            builder.setDialogStyle(CFAlertDialog.CFAlertStyle.NOTIFICATION);\n        }\n        if (centerDialogGravityRadioButton.isChecked()) {\n            builder.setDialogStyle(CFAlertDialog.CFAlertStyle.ALERT);\n        }\n        if (bottomDialogGravityRadioButton.isChecked()) {\n            builder.setDialogStyle(CFAlertDialog.CFAlertStyle.BOTTOM_SHEET);\n        }\n\n        // Background\n        int alertBGColor = -1;\n        if (colorSelectionView != null) {\n            alertBGColor = colorSelectionView.selectedColor;\n            builder.setBackgroundColor(alertBGColor);\n        }\n\n        // Title and message\n        builder.setTitle(titleEditText.getText());\n        builder.setMessage(messageEditText.getText());\n\n        if (textGravityLeft.isChecked()) {\n            builder.setTextGravity(Gravity.START);\n        } else if (textGravityCenter.isChecked()) {\n            builder.setTextGravity(Gravity.CENTER_HORIZONTAL);\n        } else if (textGravityRight.isChecked()) {\n            builder.setTextGravity(Gravity.END);\n        }\n\n        // Title icon\n        if (showTitleIcon.isChecked()) {\n            builder.setIcon(R.drawable.icon_drawable);\n        }\n\n        // Buttons\n        if (positiveButtonCheckbox.isChecked()) {\n\n            // Add a sample positive button\n            builder.addButton(\"Positive\", -1, -1, CFAlertActionStyle.POSITIVE, getButtonGravity(), new DialogInterface.OnClickListener() {\n                @Override\n                public void onClick(DialogInterface dialog, int which) {\n                    Toast.makeText(StartActivity.this, \"Positive\", Toast.LENGTH_SHORT).show();\n                    alertDialog.dismiss();\n                }\n            });\n        }\n        if (negativeButtonCheckbox.isChecked()) {\n\n            // Add a sample negative button\n            builder.addButton(\"Negative\", -1, -1, CFAlertActionStyle.NEGATIVE, getButtonGravity(), new DialogInterface.OnClickListener() {\n                @Override\n                public void onClick(DialogInterface dialog, int which) {\n                    Toast.makeText(StartActivity.this, \"Negative\", Toast.LENGTH_SHORT).show();\n                    alertDialog.dismiss();\n                }\n            });\n        }\n        if (neutralButtonCheckbox.isChecked()) {\n\n            // Add a sample neutral button\n            builder.addButton(\"Neutral\", -1, -1, CFAlertActionStyle.DEFAULT, getButtonGravity(), new DialogInterface.OnClickListener() {\n                @Override\n                public void onClick(DialogInterface dialog, int which) {\n                    Toast.makeText(StartActivity.this, \"Neutral\", Toast.LENGTH_SHORT).show();\n                    alertDialog.dismiss();\n                }\n            });\n        }\n\n        // Add Header\n        if (addHeaderCheckBox.isChecked()) {\n            builder.setHeaderView(R.layout.dialog_header_layout);\n            headerVisibility = true;\n        }\n\n        // Add Footer\n        if (addFooterCheckBox.isChecked()) {\n            SampleFooterView footerView = new SampleFooterView(this);\n            footerView.setSelecteBackgroundColor(alertBGColor);\n            builder.setFooterView(footerView);\n        }\n\n        // Selection Items\n        if (itemsRadioButton.isChecked()) {\n\n            // List items\n            builder.setItems(new String[]{\"First\", \"Second\", \"Third\"}, new DialogInterface.OnClickListener() {\n                @Override\n                public void onClick(DialogInterface dialog, int which) {\n                    switch (which) {\n                        case 0:\n                            Toast.makeText(StartActivity.this, \"First\", Toast.LENGTH_SHORT).show();\n                            break;\n                        case 1:\n                            Toast.makeText(StartActivity.this, \"Second\", Toast.LENGTH_SHORT).show();\n                            break;\n                        case 2:\n                            Toast.makeText(StartActivity.this, \"Third\", Toast.LENGTH_SHORT).show();\n                            break;\n                    }\n                }\n            });\n        } else if (singleChoiceRadioButton.isChecked()) {\n\n            // Single choice list items\n            builder.setSingleChoiceItems(new String[]{\"First\", \"Second\", \"Third\"}, 1, new DialogInterface.OnClickListener() {\n                @Override\n                public void onClick(DialogInterface dialog, int which) {\n                    switch (which) {\n                        case 0:\n                            Toast.makeText(StartActivity.this, \"First\", Toast.LENGTH_SHORT).show();\n                            break;\n                        case 1:\n                            Toast.makeText(StartActivity.this, \"Second\", Toast.LENGTH_SHORT).show();\n                            break;\n                        case 2:\n                            Toast.makeText(StartActivity.this, \"Third\", Toast.LENGTH_SHORT).show();\n                            break;\n                    }\n                }\n            });\n        } else if (multiChoiceRadioButton.isChecked()) {\n\n            // Multi choice list items\n            builder.setMultiChoiceItems(new String[]{\"First\", \"Second\", \"Third\"}, new boolean[]{true, false, false}, new DialogInterface.OnMultiChoiceClickListener() {\n                @Override\n                public void onClick(DialogInterface dialog, int which, boolean isChecked) {\n                    switch (which) {\n                        case 0:\n                            Toast.makeText(StartActivity.this, \"First \" + (isChecked ? \"Checked\" : \"Unchecked\"), Toast.LENGTH_SHORT).show();\n                            break;\n                        case 1:\n                            Toast.makeText(StartActivity.this, \"Second \" + (isChecked ? \"Checked\" : \"Unchecked\"), Toast.LENGTH_SHORT).show();\n                            break;\n                        case 2:\n                            Toast.makeText(StartActivity.this, \"Third \" + (isChecked ? \"Checked\" : \"Unchecked\"), Toast.LENGTH_SHORT).show();\n                            break;\n                    }\n                }\n            });\n\n        }\n\n        // Cancel on background tap\n        builder.setCancelable(closesOnBackgroundTapCheckBox.isChecked());\n\n        alertDialog = builder.show();\n        alertDialog.setOnDismissListener(new DialogInterface.OnDismissListener() {\n            @Override\n            public void onDismiss(DialogInterface dialog) {\n                onDialogDismiss();\n            }\n        });\n    }\n\n    private CFAlertActionAlignment getButtonGravity() {\n\n        if (buttonGravityLeft.isChecked()) {\n            return CFAlertActionAlignment.START;\n        }\n        if (buttonGravityCenter.isChecked()) {\n            return CFAlertActionAlignment.CENTER;\n        }\n        if (buttonGravityRight.isChecked()) {\n            return CFAlertActionAlignment.END;\n        }\n        if (buttonGravityFull.isChecked()) {\n            return CFAlertActionAlignment.JUSTIFIED;\n        }\n        return CFAlertActionAlignment.JUSTIFIED;\n    }\n\n    private void bindViews() {\n        titleEditText = (EditText) findViewById(R.id.title_edittext);\n        messageEditText = (EditText) findViewById(R.id.message_edittext);\n\n        textGravityLeft = (RadioButton) findViewById(R.id.text_gravity_left);\n        textGravityCenter = (RadioButton) findViewById(R.id.text_gravity_center);\n        textGravityRight = (RadioButton) findViewById(R.id.text_gravity_right);\n\n        positiveButtonCheckbox = (CheckBox) findViewById(R.id.positive_button_checkbox);\n        negativeButtonCheckbox = (CheckBox) findViewById(R.id.negative_button_checkbox);\n        neutralButtonCheckbox = (CheckBox) findViewById(R.id.neutral_button_checkbox);\n\n        addHeaderCheckBox = (CheckBox) findViewById(R.id.add_header_checkbox);\n        addFooterCheckBox = (CheckBox) findViewById(R.id.add_footer_checkbox);\n\n        buttonGravityLeft = (RadioButton) findViewById(R.id.button_gravity_left);\n        buttonGravityCenter = (RadioButton) findViewById(R.id.button_gravity_center);\n        buttonGravityRight = (RadioButton) findViewById(R.id.button_gravity_right);\n        buttonGravityFull = (RadioButton) findViewById(R.id.button_gravity_justified);\n\n        itemsRadioButton = (RadioButton) findViewById(R.id.items_radio_button);\n        multiChoiceRadioButton = (RadioButton) findViewById(R.id.multi_select_choice_items_radio_button);\n        singleChoiceRadioButton = (RadioButton) findViewById(R.id.single_choice_items_radio_button);\n\n        showTitleIcon = (CheckBox) findViewById(R.id.show_title_icon);\n\n        topDialogGravityRadioButton = (RadioButton) findViewById(R.id.top_dialog_gravity_radio_button);\n        centerDialogGravityRadioButton = (RadioButton) findViewById(R.id.center_dialog_gravity_radio_button);\n        bottomDialogGravityRadioButton = (RadioButton) findViewById(R.id.bottom_dialog_gravity_radio_button);\n\n        closesOnBackgroundTapCheckBox = ((CheckBox) findViewById(R.id.closes_on_background_tap));\n        selectedBackgroundColorView = findViewById(R.id.background_color_preview);\n        setSelectedBackgroundColor(DEFAULT_BACKGROUND_COLOR);\n        selectBackgroundColorContainer = findViewById(R.id.background_color_selection_container);\n\n        showDialogFab = (FloatingActionButton) findViewById(R.id.fab);\n    }\n\n    private void setSelectedBackgroundColor(int color) {\n        GradientDrawable previewBackground = (GradientDrawable) selectedBackgroundColorView.getBackground();\n        previewBackground.setColor(color);\n        ViewCompat.setBackground(selectedBackgroundColorView, previewBackground);\n    }\n\n    @Override\n    public void onBackgroundColorChanged(int backgroundColor) {\n        alertDialog.setBackgroundColor(backgroundColor, true);\n    }\n\n    @Override\n    public void onHeaderAdded() {\n        if (alertDialog != null) { alertDialog.setHeaderView(R.layout.dialog_header_layout); }\n        headerVisibility = true;\n\n    }\n\n    @Override\n    public void onHeaderRemoved() {\n        if (alertDialog != null) { alertDialog.setHeaderView(null); }\n        headerVisibility = false;\n    }\n\n    private void onDialogDismiss() {\n        headerVisibility = false;\n    }\n\n    @Override\n    public boolean isHeaderVisible() {\n        return headerVisibility;\n    }\n\n}\n"
  },
  {
    "path": "cfalertdialogdemo/src/main/java/com/crowdfire/cfalertdialogdemo/views/ColorSelectionView.java",
    "content": "package com.crowdfire.cfalertdialogdemo.views;\n\nimport android.content.Context;\nimport android.graphics.Color;\nimport android.graphics.drawable.GradientDrawable;\nimport android.os.Build;\nimport androidx.annotation.Nullable;\nimport android.util.AttributeSet;\nimport android.view.View;\nimport android.widget.LinearLayout;\nimport android.widget.SeekBar;\n\nimport com.crowdfire.cfalertdialogdemo.R;\n\n/**\n * Created by rahul on 10/07/17.\n */\n\npublic class ColorSelectionView extends LinearLayout implements SeekBar.OnSeekBarChangeListener{\n\n\n    // region Variables\n    private static int COLOR_MAX_VALUE = 255;\n\n    private SeekBar seekBarRed, seekBarGreen, seekBarBlue, seekBarAlpha;\n    private View selectedColorPreview;\n\n    public int selectedColor;\n    // endregion\n\n\n    public ColorSelectionView(Context context) {\n        super(context);\n        init();\n    }\n\n    public ColorSelectionView(Context context, @Nullable AttributeSet attrs) {\n        super(context, attrs);\n        init();\n    }\n\n    public ColorSelectionView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {\n        super(context, attrs, defStyleAttr);\n        init();\n    }\n\n    private void init() {\n        inflate(getContext(), R.layout.color_selection_view, this);\n\n        bindViews();\n    }\n\n    private void bindViews() {\n\n        selectedColorPreview = findViewById(R.id.selected_color_preview);\n\n        seekBarRed = (SeekBar) findViewById(R.id.seekbar_red);\n        seekBarRed.setMax(COLOR_MAX_VALUE);\n        seekBarRed.setOnSeekBarChangeListener(this);\n        seekBarBlue = (SeekBar) findViewById(R.id.seekbar_blue);\n        seekBarBlue.setMax(COLOR_MAX_VALUE);\n        seekBarBlue.setOnSeekBarChangeListener(this);\n        seekBarGreen = (SeekBar) findViewById(R.id.seekbar_green);\n        seekBarGreen.setMax(COLOR_MAX_VALUE);\n        seekBarGreen.setOnSeekBarChangeListener(this);\n        seekBarAlpha = (SeekBar) findViewById(R.id.seekbar_alpha);\n        seekBarAlpha.setMax(COLOR_MAX_VALUE);\n        seekBarAlpha.setProgress(COLOR_MAX_VALUE);\n        seekBarAlpha.setOnSeekBarChangeListener(this);\n    }\n\n    // region SeekBar value changed listeners\n    @Override\n    public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {\n        updateSelectedColorPreview();\n    }\n\n    @Override\n    public void onStartTrackingTouch(SeekBar seekBar) {\n\n    }\n\n    @Override\n    public void onStopTrackingTouch(SeekBar seekBar) {\n\n    }\n    // endregion\n\n    private void updateSelectedColorPreview() {\n\n        // Create color with selected color values\n        int redValue = seekBarRed.getProgress();\n        int greenValue = seekBarGreen.getProgress();\n        int blueValue = seekBarBlue.getProgress();\n        int alpha = seekBarAlpha.getProgress();\n\n        selectedColor = Color.argb(alpha, redValue, greenValue, blueValue);\n\n        GradientDrawable previewBackground = (GradientDrawable) selectedColorPreview.getBackground();\n        previewBackground.setColor(selectedColor);\n        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {\n            selectedColorPreview.setBackground(previewBackground);\n        }\n        else {\n            selectedColorPreview.setBackgroundDrawable(previewBackground);\n        }\n    }\n\n    public void setSelectedColor(int selectedColor) {\n        this.selectedColor = selectedColor;\n\n        seekBarAlpha.setProgress(Color.alpha(selectedColor));\n        seekBarRed.setProgress(Color.red(selectedColor));\n        seekBarGreen.setProgress(Color.green(selectedColor));\n        seekBarBlue.setProgress(Color.blue(selectedColor));\n    }\n}\n"
  },
  {
    "path": "cfalertdialogdemo/src/main/java/com/crowdfire/cfalertdialogdemo/views/SampleFooterView.java",
    "content": "package com.crowdfire.cfalertdialogdemo.views;\n\nimport android.content.Context;\nimport android.graphics.Color;\nimport android.graphics.drawable.GradientDrawable;\nimport androidx.core.content.ContextCompat;\nimport androidx.core.view.ViewCompat;\nimport android.util.AttributeSet;\nimport android.view.View;\nimport android.widget.LinearLayout;\n\nimport com.crowdfire.cfalertdialog.views.CFPushButton;\nimport com.crowdfire.cfalertdialogdemo.R;\n\nimport java.util.Random;\n\nimport static com.crowdfire.cfalertdialogdemo.views.SampleFooterView.ConfigurationState.COLLAPSED;\nimport static com.crowdfire.cfalertdialogdemo.views.SampleFooterView.ConfigurationState.EXPANDED;\nimport static com.crowdfire.cfalertdialogdemo.views.SampleFooterView.HeaderState.HIDDEN;\nimport static com.crowdfire.cfalertdialogdemo.views.SampleFooterView.HeaderState.SHOWN;\n\n/**\n * Created by rahul on 11/07/17.\n */\n\npublic class SampleFooterView extends LinearLayout implements View.OnClickListener {\n\n    View backgroundColorPreview;\n    CFPushButton headerToggleButton;\n    LinearLayout configurationContainer;\n    CFPushButton configurationToggleButton;\n    FooterActionListener listener;\n\n    public SampleFooterView(Context context) {\n        this(context, null, 0);\n    }\n\n    public SampleFooterView(Context context, AttributeSet attrs) {\n        this(context, attrs, 0);\n    }\n\n    public SampleFooterView(Context context, AttributeSet attrs, int defStyleAttr) {\n        super(context, attrs, defStyleAttr);\n        if (context instanceof FooterActionListener) {\n            listener = (FooterActionListener) context;\n        } else {\n            throw new IllegalStateException(context + \" must implement\" + FooterActionListener.class.getSimpleName());\n        }\n        init();\n    }\n\n    public void setSelecteBackgroundColor(int color) {\n        ((GradientDrawable) backgroundColorPreview.getBackground()).setColor(color);\n    }\n\n    private void setupSubviews() {\n        backgroundColorPreview = findViewById(R.id.background_color_preview);\n        backgroundColorPreview.setOnClickListener(this);\n        headerToggleButton = (CFPushButton) findViewById(R.id.header_toggle_button);\n        headerToggleButton.setOnClickListener(this);\n        configurationContainer = (LinearLayout) findViewById(R.id.configuration_container);\n        configurationToggleButton = (CFPushButton) findViewById(R.id.configuration_toggle_button);\n        configurationToggleButton.setOnClickListener(this);\n\n        collapseConfiguration();\n        if (listener.isHeaderVisible()) {\n            showHeader();\n        } else {\n            hideHeader();\n        }\n    }\n\n    private void toggleHeaderState(HeaderState headerState) {\n        switch (headerState) {\n            case SHOWN:\n                hideHeader();\n                break;\n            case HIDDEN:\n                showHeader();\n                break;\n            default:\n                break;\n        }\n    }\n\n    private void showHeader() {\n        headerToggleButton.setTag(SHOWN);\n        headerToggleButton.setText(\"Remove Header\");\n        ViewCompat.setBackground(headerToggleButton, ContextCompat.getDrawable(getContext(), R.drawable.remove_header_button_background));\n        listener.onHeaderAdded();\n    }\n\n    private void hideHeader() {\n        headerToggleButton.setTag(HIDDEN);\n        headerToggleButton.setText(\"Add Header\");\n        ViewCompat.setBackground(headerToggleButton, ContextCompat.getDrawable(getContext(), R.drawable.footer_button_drawable));\n        listener.onHeaderRemoved();\n    }\n\n    private void changeBackgroundColor() {\n        Random rnd = new Random();\n        int color = Color.argb(rnd.nextInt(256), rnd.nextInt(256), rnd.nextInt(256), rnd.nextInt(256));\n        ((GradientDrawable) backgroundColorPreview.getBackground()).setColor(color);\n        listener.onBackgroundColorChanged(color);\n    }\n\n    private void init() {\n        inflate(getContext(), R.layout.dialog_footer_layout, this);\n        setupSubviews();\n    }\n\n    private void toggleState() {\n        switch ((ConfigurationState) configurationToggleButton.getTag()) {\n            case EXPANDED:\n                collapseConfiguration();\n                break;\n            case COLLAPSED:\n                expandConfiguration();\n                break;\n            default:\n                break;\n        }\n    }\n\n    void collapseConfiguration() {\n        configurationToggleButton.setTag(COLLAPSED);\n        configurationToggleButton.setText(\"Configurations\");\n        configurationToggleButton.setTextColor(Color.WHITE);\n        ViewCompat.setBackground(configurationToggleButton, ContextCompat.getDrawable(getContext(), R.drawable.footer_button_drawable));\n        configurationContainer.setVisibility(GONE);\n    }\n\n    void expandConfiguration() {\n        configurationToggleButton.setTag(EXPANDED);\n        configurationToggleButton.setText(\"Close\");\n        configurationToggleButton.setTextColor(ContextCompat.getColor(getContext(), R.color.close_button_text_color));\n        ViewCompat.setBackground(configurationToggleButton, ContextCompat.getDrawable(getContext(), R.drawable.footer_button_disabled_drawable));\n        configurationContainer.setVisibility(VISIBLE);\n    }\n\n    @Override\n    public void onClick(View view) {\n        switch (view.getId()) {\n            case R.id.background_color_preview:\n                changeBackgroundColor();\n                break;\n            case R.id.header_toggle_button:\n                toggleHeaderState((HeaderState) headerToggleButton.getTag());\n                break;\n            case R.id.configuration_toggle_button:\n                toggleState();\n                break;\n        }\n    }\n\n    enum ConfigurationState {\n        COLLAPSED, EXPANDED\n    }\n\n    public enum HeaderState {\n        SHOWN, HIDDEN\n    }\n\n    public interface FooterActionListener {\n\n        void onBackgroundColorChanged(int backgroundColor);\n\n        void onHeaderAdded();\n\n        void onHeaderRemoved();\n\n        boolean isHeaderVisible();\n\n    }\n\n}\n"
  },
  {
    "path": "cfalertdialogdemo/src/main/res/drawable/black_border.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\">\n\n    <corners android:radius=\"4dp\" />\n    <stroke android:width=\"1dp\" android:color=\"@color/button_border_color\"/>\n    <padding android:bottom=\"1dp\" android:left=\"1dp\" android:right=\"1dp\" android:top=\"1dp\" />\n</shape>"
  },
  {
    "path": "cfalertdialogdemo/src/main/res/drawable/footer_button_disabled_drawable.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\"\n       android:shape=\"rectangle\">\n    <corners android:radius=\"5dp\"/>\n    <solid android:color=\"@color/grey_button_bg_color\"/>\n</shape>\n"
  },
  {
    "path": "cfalertdialogdemo/src/main/res/drawable/footer_button_drawable.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <item android:state_pressed=\"true\">\n        <shape android:shape=\"rectangle\">\n            <corners android:radius=\"5dp\"/>\n            <stroke android:width=\"1dp\" android:color=\"@color/cfdialog_button_drawable_stroke\"/>\n            <solid android:color=\"@color/colorPrimary\"/>\n        </shape>\n    </item>\n    <item>\n        <shape android:shape=\"rectangle\">\n            <corners android:radius=\"5dp\"/>\n            <stroke android:width=\"1dp\" android:color=\"@color/cfdialog_button_drawable_stroke\"/>\n            <solid android:color=\"@color/colorPrimary\"/>\n        </shape>\n    </item>\n</selector>"
  },
  {
    "path": "cfalertdialogdemo/src/main/res/drawable/footer_or_drawable.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\">\n\n    <corners android:radius=\"@dimen/footer_or_label_size_half\" />\n    <stroke android:color=\"@color/footer_bg\" android:width=\"2dp\"/>\n    <solid android:color=\"@android:color/white\" />\n\n</shape>"
  },
  {
    "path": "cfalertdialogdemo/src/main/res/drawable/icon_drawable.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\"\n       android:shape=\"oval\">\n    <solid android:color=\"?attr/colorPrimary\"/>\n</shape>"
  },
  {
    "path": "cfalertdialogdemo/src/main/res/drawable/image_content_drawable.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\"\n       android:shape=\"rectangle\">\n    <size\n        android:width=\"240dp\"\n        android:height=\"60dp\"/>\n    <solid android:color=\"@color/colorAccent\"/>\n    <corners android:radius=\"8dp\"/>\n\n</shape>"
  },
  {
    "path": "cfalertdialogdemo/src/main/res/drawable/remove_header_button_background.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\"\n       android:shape=\"rectangle\">\n    <corners android:radius=\"5dp\"/>\n    <stroke\n        android:width=\"1dp\"\n        android:color=\"@color/cfdialog_button_drawable_stroke\"/>\n    <solid android:color=\"@color/red_button_bg_color\"/>\n</shape>\n"
  },
  {
    "path": "cfalertdialogdemo/src/main/res/layout/activity_start.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:app=\"http://schemas.android.com/apk/res-auto\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:animateLayoutChanges=\"true\"\n    android:background=\"#EFEFF4\"\n    android:fitsSystemWindows=\"true\"\n    tools:context=\"com.crowdfire.cfalertdialogdemo.StartActivity\">\n\n    <ScrollView\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"match_parent\"\n        android:clipToPadding=\"false\"\n        android:paddingTop=\"12dp\">\n\n        <LinearLayout\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"wrap_content\"\n            android:orientation=\"vertical\"\n            android:padding=\"12dp\">\n\n            <!-- Alert type-->\n            <androidx.cardview.widget.CardView\n                android:layout_width=\"match_parent\"\n                android:layout_height=\"wrap_content\"\n                app:contentPadding=\"12dp\">\n\n                <LinearLayout\n                    android:layout_width=\"match_parent\"\n                    android:layout_height=\"wrap_content\"\n                    android:orientation=\"vertical\">\n\n                    <TextView\n                        android:layout_width=\"wrap_content\"\n                        android:layout_height=\"wrap_content\"\n                        android:text=\"Alert Type\"\n                        android:textColor=\"@android:color/black\"\n                        android:textSize=\"20sp\"\n                        android:textStyle=\"bold\" />\n\n                    <RadioGroup\n                        android:layout_width=\"match_parent\"\n                        android:layout_height=\"wrap_content\"\n                        android:orientation=\"vertical\"\n                        android:paddingTop=\"12dp\">\n\n                        <RadioButton\n                            android:id=\"@+id/top_dialog_gravity_radio_button\"\n                            android:layout_width=\"wrap_content\"\n                            android:layout_height=\"wrap_content\"\n                            android:layout_weight=\"1\"\n                            android:text=\"Notification\" />\n\n                        <RadioButton\n                            android:id=\"@+id/center_dialog_gravity_radio_button\"\n                            android:layout_width=\"wrap_content\"\n                            android:layout_height=\"wrap_content\"\n                            android:layout_weight=\"1\"\n                            android:checked=\"true\"\n                            android:text=\"Alert\" />\n\n                        <RadioButton\n                            android:id=\"@+id/bottom_dialog_gravity_radio_button\"\n                            android:layout_width=\"wrap_content\"\n                            android:layout_height=\"wrap_content\"\n                            android:layout_weight=\"1\"\n                            android:text=\"Bottom Sheet\" />\n                    </RadioGroup>\n                </LinearLayout>\n\n            </androidx.cardview.widget.CardView>\n\n            <!-- Title/ message-->\n            <androidx.cardview.widget.CardView\n                android:layout_width=\"match_parent\"\n                android:layout_height=\"wrap_content\"\n                android:layout_marginTop=\"16dp\"\n                app:contentPadding=\"12dp\">\n\n                <LinearLayout\n                    android:layout_width=\"match_parent\"\n                    android:layout_height=\"wrap_content\"\n                    android:orientation=\"vertical\">\n\n                    <TextView\n                        android:layout_width=\"wrap_content\"\n                        android:layout_height=\"wrap_content\"\n                        android:text=\"Text Settings\"\n                        android:textColor=\"@android:color/black\"\n                        android:textSize=\"20sp\"\n                        android:textStyle=\"bold\" />\n\n\n                    <CheckBox\n                        android:id=\"@+id/show_title_icon\"\n                        android:layout_width=\"wrap_content\"\n                        android:layout_height=\"wrap_content\"\n                        android:layout_marginTop=\"20dp\"\n                        android:text=\"Show Title Icon\" />\n\n                    <EditText\n                        android:id=\"@+id/title_edittext\"\n                        android:layout_width=\"match_parent\"\n                        android:layout_height=\"wrap_content\"\n                        android:layout_marginTop=\"12dp\"\n                        android:gravity=\"start\"\n                        android:hint=\"Title\"\n                        android:text=\"Title of the message\" />\n\n                    <EditText\n                        android:id=\"@+id/message_edittext\"\n                        android:layout_width=\"match_parent\"\n                        android:layout_height=\"wrap_content\"\n                        android:layout_marginTop=\"12dp\"\n                        android:gravity=\"start\"\n                        android:hint=\"Description\"\n                        android:text=\"Add message body here. If the text exceeds a certain limit then the alert will automatically become scrollable.\" />\n\n\n                    <TextView\n                        android:layout_width=\"wrap_content\"\n                        android:layout_height=\"wrap_content\"\n                        android:layout_marginTop=\"16dp\"\n                        android:text=\"Alignment\"\n                        android:textSize=\"16sp\"\n                        android:textStyle=\"bold\" />\n\n                    <RadioGroup\n                        android:layout_width=\"match_parent\"\n                        android:layout_height=\"wrap_content\"\n                        android:orientation=\"vertical\"\n                        android:paddingTop=\"12dp\">\n\n                        <RadioButton\n                            android:id=\"@+id/text_gravity_left\"\n                            android:layout_width=\"wrap_content\"\n                            android:layout_height=\"wrap_content\"\n                            android:layout_weight=\"1\"\n                            android:checked=\"true\"\n                            android:text=\"Left\" />\n\n                        <RadioButton\n                            android:id=\"@+id/text_gravity_center\"\n                            android:layout_width=\"wrap_content\"\n                            android:layout_height=\"wrap_content\"\n                            android:layout_weight=\"1\"\n                            android:text=\"Center\" />\n\n                        <RadioButton\n                            android:id=\"@+id/text_gravity_right\"\n                            android:layout_width=\"wrap_content\"\n                            android:layout_height=\"wrap_content\"\n                            android:layout_weight=\"1\"\n                            android:text=\"Right\" />\n                    </RadioGroup>\n\n                </LinearLayout>\n            </androidx.cardview.widget.CardView>\n\n            <!-- Buttons-->\n            <androidx.cardview.widget.CardView\n                android:layout_width=\"match_parent\"\n                android:layout_height=\"wrap_content\"\n                android:layout_marginTop=\"16dp\"\n                app:contentPadding=\"12dp\">\n\n                <LinearLayout\n                    android:layout_width=\"match_parent\"\n                    android:layout_height=\"wrap_content\"\n                    android:orientation=\"vertical\">\n\n                    <TextView\n                        android:layout_width=\"wrap_content\"\n                        android:layout_height=\"wrap_content\"\n                        android:text=\"Button Settings\"\n                        android:textColor=\"@android:color/black\"\n                        android:textSize=\"20sp\"\n                        android:textStyle=\"bold\" />\n\n                    <LinearLayout\n                        android:layout_width=\"wrap_content\"\n                        android:layout_height=\"wrap_content\"\n                        android:layout_marginTop=\"12dp\"\n                        android:orientation=\"vertical\">\n\n                        <CheckBox\n                            android:id=\"@+id/neutral_button_checkbox\"\n                            android:layout_width=\"wrap_content\"\n                            android:layout_height=\"wrap_content\"\n                            android:checked=\"true\"\n                            android:text=\"Neutral\" />\n\n                        <CheckBox\n                            android:id=\"@+id/positive_button_checkbox\"\n                            android:layout_width=\"wrap_content\"\n                            android:layout_height=\"wrap_content\"\n                            android:text=\"Positive\" />\n\n                        <CheckBox\n                            android:id=\"@+id/negative_button_checkbox\"\n                            android:layout_width=\"wrap_content\"\n                            android:layout_height=\"wrap_content\"\n                            android:text=\"Negative\" />\n                    </LinearLayout>\n\n                    <TextView\n                        android:layout_width=\"wrap_content\"\n                        android:layout_height=\"wrap_content\"\n                        android:layout_marginTop=\"16dp\"\n                        android:text=\"Alignment\"\n                        android:textSize=\"16sp\"\n                        android:textStyle=\"bold\" />\n\n                    <RadioGroup\n                        android:layout_width=\"match_parent\"\n                        android:layout_height=\"wrap_content\"\n                        android:layout_marginTop=\"12dp\"\n                        android:orientation=\"vertical\">\n\n                        <RadioButton\n                            android:id=\"@+id/button_gravity_justified\"\n                            android:layout_width=\"100dp\"\n                            android:layout_height=\"wrap_content\"\n                            android:checked=\"true\"\n                            android:text=\"Justified\" />\n\n                        <RadioButton\n                            android:id=\"@+id/button_gravity_left\"\n                            android:layout_width=\"100dp\"\n                            android:layout_height=\"wrap_content\"\n                            android:text=\"Left\" />\n\n                        <RadioButton\n                            android:id=\"@+id/button_gravity_center\"\n                            android:layout_width=\"100dp\"\n                            android:layout_height=\"wrap_content\"\n                            android:text=\"Center\" />\n\n                        <RadioButton\n                            android:id=\"@+id/button_gravity_right\"\n                            android:layout_width=\"100dp\"\n                            android:layout_height=\"wrap_content\"\n                            android:text=\"Right\" />\n                    </RadioGroup>\n\n\n                </LinearLayout>\n            </androidx.cardview.widget.CardView>\n\n            <!--Background-->\n            <androidx.cardview.widget.CardView\n                android:layout_width=\"match_parent\"\n                android:layout_height=\"wrap_content\"\n                android:layout_marginTop=\"16dp\"\n                app:contentPadding=\"12dp\">\n\n                <LinearLayout\n                    android:layout_width=\"match_parent\"\n                    android:layout_height=\"wrap_content\"\n                    android:orientation=\"vertical\">\n\n                    <TextView\n                        android:layout_width=\"wrap_content\"\n                        android:layout_height=\"wrap_content\"\n                        android:text=\"Background\"\n                        android:textColor=\"@android:color/black\"\n                        android:textSize=\"20sp\"\n                        android:textStyle=\"bold\" />\n\n                    <LinearLayout\n                        android:id=\"@+id/background_color_selection_container\"\n                        android:layout_width=\"match_parent\"\n                        android:layout_height=\"wrap_content\"\n                        android:gravity=\"center_vertical\"\n                        android:orientation=\"horizontal\">\n\n                        <TextView\n                            android:layout_width=\"wrap_content\"\n                            android:layout_height=\"wrap_content\"\n                            android:gravity=\"start\"\n                            android:text=\"Background Color\"\n                            android:textColor=\"@android:color/black\" />\n\n                        <View\n                            android:layout_width=\"0dp\"\n                            android:layout_height=\"match_parent\"\n                            android:layout_weight=\"1\"/>\n                        <View\n                            android:id=\"@+id/background_color_preview\"\n                            android:layout_width=\"60dp\"\n                            android:layout_height=\"40dp\"\n                            android:background=\"@drawable/black_border\" />\n\n                    </LinearLayout>\n\n                    <LinearLayout\n                        android:layout_width=\"wrap_content\"\n                        android:layout_height=\"wrap_content\">\n\n                        <CheckBox\n                            android:id=\"@+id/closes_on_background_tap\"\n                            android:layout_width=\"wrap_content\"\n                            android:layout_height=\"wrap_content\"\n                            android:layout_columnWeight=\"1\"\n                            android:checked=\"true\"\n                            android:text=\"Close on background tap\" />\n                    </LinearLayout>\n\n\n                </LinearLayout>\n\n\n            </androidx.cardview.widget.CardView>\n\n            <!-- Other-->\n            <androidx.cardview.widget.CardView\n                android:layout_width=\"match_parent\"\n                android:layout_height=\"wrap_content\"\n                android:layout_marginBottom=\"80dp\"\n                android:layout_marginTop=\"16dp\"\n                app:contentPadding=\"12dp\">\n\n                <LinearLayout\n                    android:layout_width=\"match_parent\"\n                    android:layout_height=\"wrap_content\"\n                    android:orientation=\"vertical\">\n\n                    <TextView\n                        android:layout_width=\"wrap_content\"\n                        android:layout_height=\"wrap_content\"\n                        android:text=\"Other\"\n                        android:textColor=\"@android:color/black\"\n                        android:textSize=\"20sp\"\n                        android:textStyle=\"bold\" />\n\n                    <LinearLayout\n                        android:layout_width=\"match_parent\"\n                        android:layout_height=\"wrap_content\"\n                        android:layout_marginTop=\"12dp\"\n                        android:orientation=\"vertical\">\n\n                        <CheckBox\n                            android:id=\"@+id/add_header_checkbox\"\n                            android:layout_width=\"wrap_content\"\n                            android:layout_height=\"wrap_content\"\n                            android:text=\"Add Header\" />\n\n                        <CheckBox\n                            android:id=\"@+id/add_footer_checkbox\"\n                            android:layout_width=\"wrap_content\"\n                            android:layout_height=\"wrap_content\"\n                            android:checked=\"true\"\n                            android:text=\"Add Footer\" />\n                    </LinearLayout>\n\n                    <TextView\n                        android:layout_width=\"wrap_content\"\n                        android:layout_height=\"wrap_content\"\n                        android:layout_marginTop=\"16dp\"\n                        android:text=\"Selectable items list\"\n                        android:textSize=\"16sp\"\n                        android:textStyle=\"bold\" />\n\n                    <RadioGroup\n                        android:layout_width=\"match_parent\"\n                        android:layout_height=\"wrap_content\">\n\n                        <RadioButton\n                            android:id=\"@+id/no_items_radio_button\"\n                            android:layout_width=\"wrap_content\"\n                            android:layout_height=\"wrap_content\"\n                            android:checked=\"true\"\n                            android:text=\"None\" />\n\n                        <RadioButton\n                            android:id=\"@+id/items_radio_button\"\n                            android:layout_width=\"wrap_content\"\n                            android:layout_height=\"wrap_content\"\n                            android:text=\"Items\" />\n\n                        <RadioButton\n                            android:id=\"@+id/single_choice_items_radio_button\"\n                            android:layout_width=\"wrap_content\"\n                            android:layout_height=\"wrap_content\"\n                            android:text=\"Single choice items\" />\n\n                        <RadioButton\n                            android:id=\"@+id/multi_select_choice_items_radio_button\"\n                            android:layout_width=\"wrap_content\"\n                            android:layout_height=\"wrap_content\"\n                            android:text=\"Multi choice items\" />\n\n                    </RadioGroup>\n\n                </LinearLayout>\n\n            </androidx.cardview.widget.CardView>\n\n        </LinearLayout>\n\n    </ScrollView>\n\n    <com.google.android.material.floatingactionbutton.FloatingActionButton\n        android:id=\"@+id/fab\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:layout_alignParentBottom=\"true\"\n        android:layout_alignParentRight=\"true\"\n        android:layout_alignParentEnd=\"true\"\n        android:layout_gravity=\"bottom|end\"\n        android:layout_margin=\"@dimen/fab_margin\"\n        app:fabSize=\"normal\"\n        app:srcCompat=\"@android:drawable/ic_menu_view\" />\n\n</RelativeLayout>\n"
  },
  {
    "path": "cfalertdialogdemo/src/main/res/layout/color_selection_view.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout\n    xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"wrap_content\"\n    android:gravity=\"center\"\n    android:padding=\"20dp\"\n    android:orientation=\"vertical\" >\n\n    <View\n        android:id=\"@+id/selected_color_preview\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"40dp\"\n        android:background=\"@drawable/black_border\" />\n\n    <SeekBar\n        android:id=\"@+id/seekbar_red\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:paddingTop=\"30dp\"/>\n    <TextView\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:gravity=\"center\"\n        android:text=\"RED\"/>\n\n    <SeekBar\n        android:id=\"@+id/seekbar_green\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:paddingTop=\"30dp\" />\n    <TextView\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:gravity=\"center\"\n        android:text=\"GREEN\"/>\n\n    <SeekBar\n        android:id=\"@+id/seekbar_blue\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:paddingTop=\"30dp\" />\n    <TextView\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:gravity=\"center\"\n        android:text=\"BLUE\"/>\n\n    <SeekBar\n        android:id=\"@+id/seekbar_alpha\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:paddingTop=\"30dp\" />\n    <TextView\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:gravity=\"center\"\n        android:text=\"ALPHA\"/>\n\n</LinearLayout>\n"
  },
  {
    "path": "cfalertdialogdemo/src/main/res/layout/dialog_footer_layout.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"wrap_content\">\n\n    <!--Footer Content-->\n    <LinearLayout\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:layout_marginTop=\"@dimen/footer_or_label_size_half\"\n        android:background=\"@color/footer_bg\"\n        android:animateLayoutChanges=\"true\"\n        android:orientation=\"vertical\"\n        android:padding=\"@dimen/layout_padding\">\n\n        <!--Footer Note-->\n        <TextView\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"wrap_content\"\n            android:textColor=\"@color/footer_description_text_color\"\n            android:textSize=\"11sp\"\n            android:text=\"This is your custom footer view. Here we have added some custom properties that you can change dynamically for more detailed control.\" />\n\n        <!--Configurations container-->\n        <LinearLayout\n            android:id=\"@+id/configuration_container\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"wrap_content\"\n            android:orientation=\"vertical\"\n            android:visibility=\"visible\">\n\n            <!--Background-->\n            <TextView\n                android:layout_width=\"match_parent\"\n                android:layout_height=\"wrap_content\"\n                android:layout_marginTop=\"16dp\"\n                android:text=\"Background\"\n                android:textColor=\"@color/footer_section_title_color\"\n                android:textSize=\"14sp\"\n                android:textStyle=\"bold\" />\n\n\n            <LinearLayout\n                android:layout_width=\"match_parent\"\n                android:layout_height=\"wrap_content\"\n                android:orientation=\"horizontal\"\n                android:gravity=\"center_vertical\">\n\n                <TextView\n                    android:layout_width=\"wrap_content\"\n                    android:layout_height=\"wrap_content\"\n                    android:layout_weight=\"1\"\n                    android:textColor=\"@color/footer_text_color\"\n                    android:text=\"Color\"\n                    android:textSize=\"14sp\" />\n\n                <com.crowdfire.cfalertdialog.views.CFPushButton\n                    android:id=\"@+id/background_color_preview\"\n                    android:layout_width=\"60dp\"\n                    android:layout_height=\"32dp\"\n                    android:background=\"@drawable/black_border\" />\n            </LinearLayout>\n\n            <!--Header-->\n            <TextView\n                android:id=\"@+id/textView\"\n                android:layout_width=\"match_parent\"\n                android:layout_height=\"wrap_content\"\n                android:layout_marginTop=\"16dp\"\n                android:text=\"Header View\"\n                android:textColor=\"@color/footer_section_title_color\"\n                android:textSize=\"14sp\"\n                android:textStyle=\"bold\" />\n\n            <com.crowdfire.cfalertdialog.views.CFPushButton\n                android:id=\"@+id/header_toggle_button\"\n                android:layout_width=\"match_parent\"\n                android:layout_height=\"32dp\"\n                android:layout_marginTop=\"10dp\"\n                android:text=\"Add header\"\n                android:textAllCaps=\"false\"\n                android:fontFamily=\"sans-serif-medium\"\n                android:textSize=\"12sp\"\n                android:textColor=\"@color/cfdialog_button_white_text_color\"\n                android:background=\"@drawable/footer_button_drawable\" />\n\n            <TextView\n                android:layout_width=\"match_parent\"\n                android:layout_height=\"wrap_content\"\n                android:textAlignment=\"center\"\n                android:textSize=\"11sp\"\n                android:layout_marginTop=\"8dp\"\n                android:textColor=\"@color/footer_description_text_color\"\n                android:text=\"You can do the same for footer view as well.\" />\n\n            <!--Text Input-->\n            <TextView\n                android:layout_width=\"match_parent\"\n                android:layout_height=\"wrap_content\"\n                android:layout_marginTop=\"16dp\"\n                android:text=\"Text Input\"\n                android:textColor=\"@color/footer_section_title_color\"\n                android:textSize=\"14sp\"\n                android:textStyle=\"bold\" />\n\n            <EditText\n                android:layout_width=\"match_parent\"\n                android:layout_height=\"wrap_content\"\n                android:layout_marginTop=\"6dp\"\n                android:paddingTop=\"0dp\"\n                android:inputType=\"textMultiLine\"\n                android:textColor=\"@color/footer_text_color\"\n                android:textSize=\"16sp\"\n                android:text=\"You can add text fields like these to header as well as footer\" />\n\n        </LinearLayout>\n\n        <!--Configuration toggle button-->\n        <com.crowdfire.cfalertdialog.views.CFPushButton\n            android:id=\"@+id/configuration_toggle_button\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"32dp\"\n            android:layout_marginTop=\"10dp\"\n            android:textAllCaps=\"false\"\n            android:fontFamily=\"sans-serif-medium\"\n            android:textSize=\"12sp\"\n            android:textColor=\"@color/cfdialog_button_white_text_color\"\n            android:background=\"@drawable/footer_button_drawable\"\n            android:text=\"Configurations\" />\n\n    </LinearLayout>\n\n    <!--OR label-->\n    <TextView\n        android:layout_width=\"@dimen/footer_or_label_size\"\n        android:layout_height=\"@dimen/footer_or_label_size\"\n        android:layout_marginTop=\"0dp\"\n        android:textSize=\"14sp\"\n        android:textColor=\"@color/footer_or_text_color\"\n        android:layout_centerHorizontal=\"true\"\n        android:background=\"@drawable/footer_or_drawable\"\n        android:gravity=\"center\"\n        android:text=\"OR\"/>\n\n\n</RelativeLayout>"
  },
  {
    "path": "cfalertdialogdemo/src/main/res/layout/dialog_header_layout.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"wrap_content\"\n    android:background=\"?android:attr/colorBackground\"\n    android:orientation=\"vertical\"\n    android:gravity=\"center\">\n\n    <ImageView\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:layout_marginTop=\"@dimen/cfdialog_padding\"\n        android:src=\"@drawable/ic_header_icon\"/>\n\n</LinearLayout>"
  },
  {
    "path": "cfalertdialogdemo/src/main/res/values/colors.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n    <color name=\"colorPrimary\">#178DD6</color>\n    <color name=\"colorPrimaryDark\">#167DBC</color>\n    <color name=\"colorAccent\">#FF4081</color>\n\n    <color name=\"sample_bg\">#A0000000</color>\n\n    <color name=\"button_border_color\">#4D000000</color>\n\n    <color name=\"footer_bg\">#F6F6F6</color>\n    <color name=\"footer_description_text_color\">#B8B8B8</color>\n    <color name=\"footer_section_title_color\">#013356</color>\n    <color name=\"footer_text_color\">#4A4A4A</color>\n    <color name=\"footer_or_text_color\">#98A4B3</color>\n    <color name=\"grey_900\">#212121</color>\n    <color name=\"grey_800\">#424242</color>\n    <color name=\"close_button_text_color\">#555555</color>\n    <color name=\"grey_button_bg_color\">#dddddd</color>\n    <color name=\"red_button_bg_color\">#ff4b4b</color>\n</resources>\n"
  },
  {
    "path": "cfalertdialogdemo/src/main/res/values/dimens.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n\n    <dimen name=\"fab_margin\">16dp</dimen>\n    <dimen name=\"layout_padding\">20dp</dimen>\n\n    <dimen name=\"footer_or_label_size\">34dp</dimen>\n    <dimen name=\"footer_or_label_size_half\">17dp</dimen>\n</resources>"
  },
  {
    "path": "cfalertdialogdemo/src/main/res/values/strings.xml",
    "content": "<resources>\n    <string name=\"app_name\">CFAlertDialogDemo</string>\n    \n    <string name=\"btn_sample_button\">Sample Button</string>\n\n    <string-array name=\"cfdialog_text_gravity\">\n        <item>Left</item>\n        <item>Center</item>\n        <item>Right</item>\n    </string-array>\n\n    <string-array name=\"cfdialog_button_gravity\">\n        <item>Left</item>\n        <item>Center</item>\n        <item>Right</item>\n        <item>Full Width</item>\n    </string-array>\n</resources>\n"
  },
  {
    "path": "cfalertdialogdemo/src/main/res/values/styles.xml",
    "content": "<resources>\n\n    <!-- Base application theme. -->\n    <style name=\"AppTheme\" parent=\"Theme.AppCompat.Light.DarkActionBar\">\n        <!-- Customize your theme here. -->\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</resources>\n"
  },
  {
    "path": "cfalertdialogdemo/src/test/java/com/crowdfire/cfalertdialogdemo/ExampleUnitTest.java",
    "content": "package com.crowdfire.cfalertdialogdemo;\n\nimport org.junit.Test;\n\nimport static org.junit.Assert.*;\n\n/**\n * Example local unit test, which will execute on the development machine (host).\n *\n * @see <a href=\"http://d.android.com/tools/testing\">Testing documentation</a>\n */\npublic class ExampleUnitTest {\n    @Test\n    public void addition_isCorrect() throws Exception {\n        assertEquals(4, 2 + 2);\n    }\n}"
  },
  {
    "path": "gradle/wrapper/gradle-wrapper.properties",
    "content": "#Fri Apr 12 12:56:02 IST 2019\ndistributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\nzipStoreBase=GRADLE_USER_HOME\nzipStorePath=wrapper/dists\ndistributionUrl=https\\://services.gradle.org/distributions/gradle-4.10.1-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.\nandroid.enableJetifier=true\nandroid.useAndroidX=true\norg.gradle.jvmargs=-Xmx1536m\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\n"
  },
  {
    "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": "settings.gradle",
    "content": "include ':cfalertdialogdemo', ':cfalertdialog'\n"
  }
]