[
  {
    "path": ".github/workflows/ci.yml",
    "content": "name: CI\n\non:\n  push:\n    branches: [ master ]\n  pull_request:\n    paths-ignore:\n      - 'docs/**'\n      - '*.md'\n\njobs:\n  build:\n    runs-on: ubuntu-latest\n\n    steps:\n      - uses: actions/checkout@v2\n      - uses: gradle/wrapper-validation-action@v1\n\n      - name: Build\n        run: ./gradlew build -s\n"
  },
  {
    "path": ".github/workflows/release.yml",
    "content": "name: Publish a release\n\non:\n  push:\n    tags:\n      - '*'\n\njobs:\n  plugin-deploy:\n    runs-on: ubuntu-latest\n\n    steps:\n      - name: Checkout the repo\n        uses: actions/checkout@v2\n      - name: Publish\n        run: ./gradlew publish\n        env:\n          BINTRAY_API_KEY: ${{ secrets.BINTRAY_API_KEY }}\n          BINTRAY_USER: ${{ secrets.BINTRAY_USER }}\n"
  },
  {
    "path": ".gitignore",
    "content": "*.iml\n.gradle\n/local.properties\n/.idea/caches\n/.idea/libraries\n/.idea/modules.xml\n/.idea/workspace.xml\n/.idea/navEditor.xml\n/.idea/assetWizardSettings.xml\n.DS_Store\n/build\n/captures\n.externalNativeBuild\n.cxx\n"
  },
  {
    "path": ".idea/.name",
    "content": "Panel Layout"
  },
  {
    "path": ".idea/codeStyles",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"ProjectCodeStyleConfiguration\">\n    <code_scheme name=\"Project\" version=\"173\">\n      <Objective-C-extensions>\n        <file>\n          <option name=\"com.jetbrains.cidr.lang.util.OCDeclarationKind\" value=\"Import\" />\n          <option name=\"com.jetbrains.cidr.lang.util.OCDeclarationKind\" value=\"Macro\" />\n          <option name=\"com.jetbrains.cidr.lang.util.OCDeclarationKind\" value=\"Typedef\" />\n          <option name=\"com.jetbrains.cidr.lang.util.OCDeclarationKind\" value=\"Enum\" />\n          <option name=\"com.jetbrains.cidr.lang.util.OCDeclarationKind\" value=\"Constant\" />\n          <option name=\"com.jetbrains.cidr.lang.util.OCDeclarationKind\" value=\"Global\" />\n          <option name=\"com.jetbrains.cidr.lang.util.OCDeclarationKind\" value=\"Struct\" />\n          <option name=\"com.jetbrains.cidr.lang.util.OCDeclarationKind\" value=\"FunctionPredecl\" />\n          <option name=\"com.jetbrains.cidr.lang.util.OCDeclarationKind\" value=\"Function\" />\n        </file>\n        <class>\n          <option name=\"com.jetbrains.cidr.lang.util.OCDeclarationKind\" value=\"Property\" />\n          <option name=\"com.jetbrains.cidr.lang.util.OCDeclarationKind\" value=\"Synthesize\" />\n          <option name=\"com.jetbrains.cidr.lang.util.OCDeclarationKind\" value=\"InitMethod\" />\n          <option name=\"com.jetbrains.cidr.lang.util.OCDeclarationKind\" value=\"StaticMethod\" />\n          <option name=\"com.jetbrains.cidr.lang.util.OCDeclarationKind\" value=\"InstanceMethod\" />\n          <option name=\"com.jetbrains.cidr.lang.util.OCDeclarationKind\" value=\"DeallocMethod\" />\n        </class>\n        <extensions>\n          <pair source=\"cpp\" header=\"h\" fileNamingConvention=\"NONE\" />\n          <pair source=\"c\" header=\"h\" fileNamingConvention=\"NONE\" />\n        </extensions>\n      </Objective-C-extensions>\n    </code_scheme>\n  </component>\n</project>"
  },
  {
    "path": ".idea/gradle.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"GradleMigrationSettings\" migrationVersion=\"1\" />\n  <component name=\"GradleSettings\">\n    <option name=\"linkedExternalProjectsSettings\">\n      <GradleProjectSettings>\n        <option name=\"testRunner\" value=\"PLATFORM\" />\n        <option name=\"distributionType\" value=\"DEFAULT_WRAPPED\" />\n        <option name=\"externalProjectPath\" value=\"$PROJECT_DIR$\" />\n        <option name=\"gradleJvm\" value=\"1.8\" />\n        <option name=\"modules\">\n          <set>\n            <option value=\"$PROJECT_DIR$\" />\n            <option value=\"$PROJECT_DIR$/app\" />\n            <option value=\"$PROJECT_DIR$/panellayout\" />\n          </set>\n        </option>\n        <option name=\"resolveModulePerSourceSet\" value=\"false\" />\n      </GradleProjectSettings>\n    </option>\n  </component>\n</project>"
  },
  {
    "path": ".idea/jarRepositories.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"RemoteRepositoriesConfiguration\">\n    <remote-repository>\n      <option name=\"id\" value=\"central\" />\n      <option name=\"name\" value=\"Maven Central repository\" />\n      <option name=\"url\" value=\"https://repo1.maven.org/maven2\" />\n    </remote-repository>\n    <remote-repository>\n      <option name=\"id\" value=\"jboss.community\" />\n      <option name=\"name\" value=\"JBoss Community repository\" />\n      <option name=\"url\" value=\"https://repository.jboss.org/nexus/content/repositories/public/\" />\n    </remote-repository>\n    <remote-repository>\n      <option name=\"id\" value=\"BintrayJCenter\" />\n      <option name=\"name\" value=\"BintrayJCenter\" />\n      <option name=\"url\" value=\"https://jcenter.bintray.com/\" />\n    </remote-repository>\n    <remote-repository>\n      <option name=\"id\" value=\"Google\" />\n      <option name=\"name\" value=\"Google\" />\n      <option name=\"url\" value=\"https://dl.google.com/dl/android/maven2/\" />\n    </remote-repository>\n  </component>\n</project>"
  },
  {
    "path": ".idea/misc.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"CMakeSettings\">\n    <configurations>\n      <configuration PROFILE_NAME=\"Debug\" CONFIG_NAME=\"Debug\" />\n    </configurations>\n  </component>\n  <component name=\"MarkdownProjectSettings\" wasCopied=\"true\">\n    <PreviewSettings splitEditorLayout=\"SPLIT\" splitEditorPreview=\"PREVIEW\" useGrayscaleRendering=\"false\" zoomFactor=\"1.0\" maxImageWidth=\"0\" showGitHubPageIfSynced=\"false\" allowBrowsingInPreview=\"false\" synchronizePreviewPosition=\"true\" highlightPreviewType=\"NONE\" highlightFadeOut=\"5\" highlightOnTyping=\"true\" synchronizeSourcePosition=\"true\" verticallyAlignSourceAndPreviewSyncPosition=\"true\" showSearchHighlightsInPreview=\"false\" showSelectionInPreview=\"true\" openRemoteLinks=\"true\" replaceUnicodeEmoji=\"false\" lastLayoutSetsDefault=\"false\">\n      <PanelProvider>\n        <provider providerId=\"com.vladsch.idea.multimarkdown.editor.swing.html.panel\" providerName=\"Default - Swing\" />\n      </PanelProvider>\n    </PreviewSettings>\n    <ParserSettings gitHubSyntaxChange=\"false\" emojiShortcuts=\"1\" emojiImages=\"0\">\n      <PegdownExtensions>\n        <option name=\"ABBREVIATIONS\" value=\"false\" />\n        <option name=\"ANCHORLINKS\" value=\"true\" />\n        <option name=\"ASIDE\" value=\"false\" />\n        <option name=\"ATXHEADERSPACE\" value=\"true\" />\n        <option name=\"AUTOLINKS\" value=\"true\" />\n        <option name=\"DEFINITIONS\" value=\"false\" />\n        <option name=\"DEFINITION_BREAK_DOUBLE_BLANK_LINE\" value=\"false\" />\n        <option name=\"FENCED_CODE_BLOCKS\" value=\"true\" />\n        <option name=\"FOOTNOTES\" value=\"false\" />\n        <option name=\"HARDWRAPS\" value=\"false\" />\n        <option name=\"HTML_DEEP_PARSER\" value=\"false\" />\n        <option name=\"INSERTED\" value=\"false\" />\n        <option name=\"QUOTES\" value=\"false\" />\n        <option name=\"RELAXEDHRULES\" value=\"true\" />\n        <option name=\"SMARTS\" value=\"false\" />\n        <option name=\"STRIKETHROUGH\" value=\"true\" />\n        <option name=\"SUBSCRIPT\" value=\"false\" />\n        <option name=\"SUPERSCRIPT\" value=\"false\" />\n        <option name=\"SUPPRESS_HTML_BLOCKS\" value=\"false\" />\n        <option name=\"SUPPRESS_INLINE_HTML\" value=\"false\" />\n        <option name=\"TABLES\" value=\"true\" />\n        <option name=\"TASKLISTITEMS\" value=\"true\" />\n        <option name=\"TOC\" value=\"false\" />\n        <option name=\"WIKILINKS\" value=\"false\" />\n      </PegdownExtensions>\n      <ParserOptions>\n        <option name=\"ADMONITION_EXT\" value=\"false\" />\n        <option name=\"ATTRIBUTES_EXT\" value=\"false\" />\n        <option name=\"COMMONMARK_LISTS\" value=\"true\" />\n        <option name=\"DUMMY\" value=\"false\" />\n        <option name=\"EMOJI_SHORTCUTS\" value=\"true\" />\n        <option name=\"ENUMERATED_REFERENCES_EXT\" value=\"false\" />\n        <option name=\"FLEXMARK_FRONT_MATTER\" value=\"false\" />\n        <option name=\"GFM_LOOSE_BLANK_LINE_AFTER_ITEM_PARA\" value=\"false\" />\n        <option name=\"GFM_TABLE_RENDERING\" value=\"true\" />\n        <option name=\"GITBOOK_URL_ENCODING\" value=\"false\" />\n        <option name=\"GITHUB_LISTS\" value=\"false\" />\n        <option name=\"GITHUB_WIKI_LINKS\" value=\"false\" />\n        <option name=\"GITLAB_EXT\" value=\"false\" />\n        <option name=\"GITLAB_MATH_EXT\" value=\"false\" />\n        <option name=\"GITLAB_MERMAID_EXT\" value=\"false\" />\n        <option name=\"HEADER_ID_NON_ASCII_TO_LOWERCASE\" value=\"false\" />\n        <option name=\"HEADER_ID_NO_DUPED_DASHES\" value=\"false\" />\n        <option name=\"JEKYLL_FRONT_MATTER\" value=\"false\" />\n        <option name=\"MACROS_EXT\" value=\"false\" />\n        <option name=\"NO_TEXT_ATTRIBUTES\" value=\"false\" />\n        <option name=\"PARSE_HTML_ANCHOR_ID\" value=\"false\" />\n        <option name=\"PLANTUML_FENCED_CODE\" value=\"false\" />\n        <option name=\"PUML_FENCED_CODE\" value=\"false\" />\n        <option name=\"SIM_TOC_BLANK_LINE_SPACER\" value=\"true\" />\n      </ParserOptions>\n    </ParserSettings>\n    <HtmlSettings headerTopEnabled=\"false\" headerBottomEnabled=\"false\" bodyTopEnabled=\"false\" bodyBottomEnabled=\"false\" embedUrlContent=\"false\" addPageHeader=\"true\" embedImages=\"false\" embedHttpImages=\"false\" imageUriSerials=\"false\" addDocTypeHtml=\"true\" noParaTags=\"false\" plantUmlConversion=\"0\" mathConversion=\"0\">\n      <GeneratorProvider>\n        <provider providerId=\"com.vladsch.idea.multimarkdown.editor.swing.html.generator\" providerName=\"Default Swing HTML Generator\" />\n      </GeneratorProvider>\n      <headerTop />\n      <headerBottom />\n      <bodyTop />\n      <bodyBottom />\n    </HtmlSettings>\n    <CssSettings previewScheme=\"UI_SCHEME\" cssUri=\"\" isCssUriEnabled=\"false\" isCssUriSerial=\"true\" isCssTextEnabled=\"false\" isDynamicPageWidth=\"true\">\n      <StylesheetProvider>\n        <provider providerId=\"com.vladsch.idea.multimarkdown.editor.swing.html.css\" providerName=\"Default Swing Stylesheet\" />\n      </StylesheetProvider>\n      <ScriptProviders />\n      <cssText />\n      <cssUriHistory />\n    </CssSettings>\n    <HtmlExportSettings updateOnSave=\"false\" parentDir=\"\" targetDir=\"\" cssDir=\"\" scriptDir=\"\" plainHtml=\"false\" imageDir=\"\" copyLinkedImages=\"false\" imageUniquifyType=\"0\" targetPathType=\"2\" targetExt=\"\" useTargetExt=\"false\" noCssNoScripts=\"false\" useElementStyleAttribute=\"false\" linkToExportedHtml=\"true\" exportOnSettingsChange=\"true\" regenerateOnProjectOpen=\"false\" linkFormatType=\"HTTP_ABSOLUTE\" />\n    <LinkMapSettings>\n      <textMaps />\n    </LinkMapSettings>\n  </component>\n  <component name=\"ProjectRootManager\" version=\"2\" languageLevel=\"JDK_1_8\" project-jdk-name=\"1.8\" project-jdk-type=\"JavaSDK\">\n    <output url=\"file://$PROJECT_DIR$/build/classes\" />\n  </component>\n  <component name=\"ProjectType\">\n    <option name=\"id\" value=\"Android\" />\n  </component>\n</project>"
  },
  {
    "path": ".idea/runConfigurations.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"RunConfigurationProducerService\">\n    <option name=\"ignoredProducers\">\n      <set>\n        <option value=\"org.jetbrains.plugins.gradle.execution.test.runner.AllInPackageGradleConfigurationProducer\" />\n        <option value=\"org.jetbrains.plugins.gradle.execution.test.runner.TestClassGradleConfigurationProducer\" />\n        <option value=\"org.jetbrains.plugins.gradle.execution.test.runner.TestMethodGradleConfigurationProducer\" />\n      </set>\n    </option>\n  </component>\n</project>"
  },
  {
    "path": ".idea/vcs.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"VcsDirectoryMappings\">\n    <mapping directory=\"$PROJECT_DIR$\" vcs=\"Git\" />\n  </component>\n</project>"
  },
  {
    "path": "CHANGELOG.md",
    "content": "### v1.0.0-alpha02\n- Fixes a bug that prevents resizing of the panel.\n\n### v1.0.0-alpha01\n- The very first release!\n"
  },
  {
    "path": "CONTRIBUTING.md",
    "content": "## Contributing to Panel Layout\nFirst off, thank you for your interest in contributing to Panel Layout!\n\n### Issue first\nFound a bug 🐛, have an idea 💡, or want to improve something 🔧?\n\nPlease open an issue first describing the problem, your idea or possible improvements. Getting early feedback on your idea will save a ton of time before writing code in advance and realizing the idea is not feasible or not aligned with the goals of the project.\n\n### Pull Requests\nPlease try to cover added / modified functions with tests as much as possible and make tests a part of your PR.\n\nWriting a good description with screenshots / screen captures when necessary will help your PR get accepted / merged quickly.\n\n\n"
  },
  {
    "path": "LICENSE.md",
    "content": "BSD 2-Clause License\n\nCopyright (c) 2020 Wayfair GmbH\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n1. Redistributions of source code must retain the above copyright notice, this\n   list of conditions and the following disclaimer.\n\n2. Redistributions in binary form must reproduce the above copyright notice,\n   this list of conditions and the following disclaimer in the documentation\n   and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\nAND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\nFOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\nDAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\nSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\nCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\nOR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "MAINTAINERS.md",
    "content": "mkojadinovic [at] wayfair.com\n"
  },
  {
    "path": "README.md",
    "content": "*ARCHIVED* -- Wayfair's technology team is now focused on other endeavors. Please consider this project archived / available as-is until further notice.\n\n## Panel Layout\n\n![CI](https://github.com/GradleUp/auto-manifest/workflows/CI/badge.svg)\n\nPanel Layout is a UI library for Android that allows you to display a floating and resizable panel that can also snap to the edges.\n\nPanel Layout makes use of [ConstraintLayout](https://developer.android.com/training/constraint-layout) to lay out panel with rest of the content.\n\nThis library is inspired by a good iOS UI framework: [PanelKit](https://github.com/louisdh/panelkit)\n\n![](https://user-images.githubusercontent.com/4990386/83229577-e6564f00-a190-11ea-8998-97322e3d818d.gif)\n\n### Importing Panel Layout\n\n[ ![Bintray](https://img.shields.io/bintray/v/wayfair/PanelLayout/PanelLayout) ](https://bintray.com/wayfair/PanelLayout/PanelLayout/_latestVersion)\n\n\n```kotlin\ndependencies {\n    implementation(\"com.wayfair.panellayout:panellayout:<latest-version>\")\n}\n```\n\n**Note:** Panel Layout is currently in alpha and the public API it offers is __subject to heavy changes__.\n\n### Panel Layout API\nDefine if the Panel Layout is visible\n```kotlin\nvar panelVisible: Boolean\n```\n\nThe command that put Panel Layout in one of the predefine Panel Positions.\nPossible panel positions are: `LEFT_EDGE`, `RIGHT_EDGE`, `TOP_EDGE`, `BOTTOM_EDGE`, `NO_EDGE`.\n```kotlin\nfun snapPanelTo(panelPosition: PanelPosition)\n```\n\nThe command that put the Panel Layout in absolute position with coordinates `x` and `y`.\n```kotlin\nfun popPanelTo(x: Int, y: Int)\n```\n\nDefine a listener to define actions on different kinds of events.\n```kotlin\nvar panelLayoutCallbacks: PanelLayout.Callbacks?\n\ninterface Callbacks {\n    fun beforeSnap(position: PanelPosition)\n    fun afterSnap(position: PanelPosition)\n    fun beforePop(popToX: Int, popToY: Int)\n    fun afterPop(popToX: Int, popToY: Int)\n    fun afterClose()\n}\n```\n\n### Panel Layout attributes\n\n`panel_content` - Resource id of view where is placed the Panel Layout\n\n`panel_view` - Resource id of view inside the Panel Layout\n \n`panel_move_handle` - Resource id of view used for moving the Panel Layout inside of content view\n\n`panel_resize_enabled` - Flag that defines if the Panel Layout is resizable\n\n`panel_snap_to_edges` - Define edges where the Panel Layout could be snapped. Possible values: `all`, `none`, `left`, `top`, `right` and `bottom`\n\n`panel_start_height` - Start height\n\n`panel_start_width` - Start width\n\n### How to Use Panel Layout\n\nAdd Panel Layout in your layout:\n```xml\n<com.wayfair.panellayout.PanelLayout\n        android:id=\"@+id/panelLayout\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"match_parent\"\n        app:panel_content=\"@id/content\"\n        app:panel_move_handle=\"@id/moveHandle\"\n        app:panel_resize_enabled=\"true\"\n        app:panel_resize_handle=\"@id/resizeHandle\"\n        app:panel_snap_to_edges=\"all\"\n        app:panel_start_height=\"300dp\"\n        app:panel_start_width=\"300dp\"\n        app:panel_view=\"@id/panel\">\n\n        <FrameLayout\n            android:id=\"@+id/content\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:background=\"#f3e5f5\">\n        </FrameLayout>\n\n        <com.google.android.material.card.MaterialCardView\n            android:id=\"@+id/panel\"\n            android:layout_width=\"300dp\"\n            android:layout_height=\"300dp\"\n            app:cardBackgroundColor=\"@color/white\">\n\n            <FrameLayout\n                android:layout_width=\"match_parent\"\n                android:layout_height=\"match_parent\">\n\n                <View\n                    android:id=\"@+id/moveHandle\"\n                    android:layout_width=\"match_parent\"\n                    android:layout_height=\"48dp\"\n                    android:background=\"#e1bee7\" />\n\n                <ImageView\n                    android:id=\"@+id/resizeHandle\"\n                    android:layout_width=\"48dp\"\n                    android:layout_height=\"48dp\"\n                    android:layout_gravity=\"bottom|end\"\n                    android:padding=\"4dp\"\n                    android:src=\"@drawable/ic_resize\"\n                    app:tint=\"@color/divider\" />\n            </FrameLayout>\n        </com.google.android.material.card.MaterialCardView>\n    </com.wayfair.panellayout.PanelLayout>\n``` \n\nControls and listeners in the code:\n```kotlin\npanelLayout.panelVisible = !panelLayout.panelVisible\n```\n```kotlin\npanelLayout.popPanelTo(100, 100)\n```\n```kotlin\npanelLayout.snapPanelTo(PanelPosition.RIGHT_EDGE)\n```\n```kotlin\npanelLayout.panelLayoutCallbacks = object : PanelLayout.Callbacks {\n    override fun beforeSnap(position: PanelPosition) {\n        TODO(\"Not yet implemented\")\n    }\n\n    override fun afterSnap(position: PanelPosition) {\n        TODO(\"Not yet implemented\")\n    }\n\n    override fun beforePop(popToX: Int, popToY: Int) {\n        TODO(\"Not yet implemented\")\n    }\n\n    override fun afterPop(popToX: Int, popToY: Int) {\n        TODO(\"Not yet implemented\")\n    }\n\n    override fun afterClose() {\n        TODO(\"Not yet implemented\")\n    }\n}\n```\n\n### LICENSE\n\nPanel Layout is licensed under 2-clause BSD License\n\nSee [LICENSE.md](LICENSE.md) for details.\n\n### CONTRIBUTION\n\nPanel Layout is open to contribution. See [CONTRIBUTING.md](CONTRIBUTING.md) for details\n"
  },
  {
    "path": "RELEASING.md",
    "content": "Releasing\n========\n\n 1. Change the version in `gradle.properties` to a new version.\n 1. Update the `CHANGELOG.md` for the impending release.\n 1. `git commit -am \"Prepare for release X.Y.Z.\"` (where X.Y.Z is the new version)\n 1. `git tag -a X.Y.X -m \"Version X.Y.Z\"` (where X.Y.Z is the new version)\n 1. `git push && git push --tags`\n 1. Wait for CI to publish and verify the version in `README.md` \n"
  },
  {
    "path": "SECURITY.md",
    "content": "If you have discovered a security vulnerability, please email opensource@wayfair.com\n"
  },
  {
    "path": "app/.gitignore",
    "content": "/build\n"
  },
  {
    "path": "app/build.gradle",
    "content": "apply plugin: 'com.android.application'\napply plugin: 'kotlin-android'\napply plugin: 'kotlin-android-extensions'\n\nandroid {\n    compileSdkVersion 29\n\n    defaultConfig {\n        applicationId \"com.wayfair.panellayout.sample\"\n        minSdkVersion 21\n        targetSdkVersion 29\n        versionCode 1\n        versionName \"1.0\"\n\n        testInstrumentationRunner \"androidx.test.runner.AndroidJUnitRunner\"\n    }\n\n    buildFeatures {\n        buildConfig = false\n        resValues = false\n    }\n}\n\ndependencies {\n    implementation fileTree(dir: \"libs\", include: [\"*.jar\"])\n    implementation \"org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version\"\n    implementation 'androidx.core:core-ktx:1.2.0'\n    implementation 'androidx.appcompat:appcompat:1.1.0'\n    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'\n    implementation 'com.google.android.material:material:1.1.0'\n\n    implementation project(':panellayout')\n\n    testImplementation 'junit:junit:4.13'\n    androidTestImplementation 'androidx.test.ext:junit:1.1.1'\n    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'\n\n}\n"
  },
  {
    "path": "app/src/androidTest/java/com/wayfair/panellayout/ExampleInstrumentedTest.kt",
    "content": "package com.wayfair.panellayout\n\nimport androidx.test.platform.app.InstrumentationRegistry\nimport androidx.test.ext.junit.runners.AndroidJUnit4\n\nimport org.junit.Test\nimport org.junit.runner.RunWith\n\nimport org.junit.Assert.*\n\n/**\n * Instrumented test, which will execute on an Android device.\n *\n * See [testing documentation](http://d.android.com/tools/testing).\n */\n@RunWith(AndroidJUnit4::class)\nclass ExampleInstrumentedTest {\n    @Test\n    fun useAppContext() {\n        // Context of the app under test.\n        val appContext = InstrumentationRegistry.getInstrumentation().targetContext\n        assertEquals(\"com.wayfair.panellayout\", appContext.packageName)\n    }\n}\n"
  },
  {
    "path": "app/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.wayfair.panellayout\">\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=\".MainActivity\">\n            <intent-filter>\n                <action android:name=\"android.intent.action.MAIN\" />\n\n                <category android:name=\"android.intent.category.LAUNCHER\" />\n            </intent-filter>\n        </activity>\n    </application>\n\n</manifest>\n"
  },
  {
    "path": "app/src/main/java/com/wayfair/panellayout/MainActivity.kt",
    "content": "package com.wayfair.panellayout\n\nimport android.content.res.ColorStateList\nimport android.os.Bundle\nimport androidx.appcompat.app.AppCompatActivity\nimport androidx.core.view.children\nimport kotlinx.android.synthetic.main.activity_main.*\nimport kotlinx.android.synthetic.main.colors.*\n\nclass MainActivity : AppCompatActivity() {\n    override fun onCreate(savedInstanceState: Bundle?) {\n        super.onCreate(savedInstanceState)\n        setContentView(R.layout.activity_main)\n\n        addShowHideClickListener()\n        addPanelElevationAndRadiusAnimations()\n        addColorSelectorClickListener()\n    }\n\n    private fun addShowHideClickListener() {\n        showHideButton.setOnClickListener {\n            panelLayout.panelVisible = !panelLayout.panelVisible\n            showHideButton.isSelected = !showHideButton.isSelected\n        }\n    }\n\n    private fun addColorSelectorClickListener() {\n        colorSelector.children.forEach { child ->\n            child.setOnClickListener {\n                it.backgroundTintList?.defaultColor?.let { color ->\n                    art.imageTintList = ColorStateList.valueOf(color)\n                }\n            }\n        }\n    }\n\n    private fun addPanelElevationAndRadiusAnimations() {\n        panelLayout.panelLayoutCallbacks = object : PanelLayout.Callbacks {\n            override fun beforeSnap(position: PanelPosition) {\n                panel.animateRadius(\n                    from = resources.getDimension(R.dimen.panel_corner_radius),\n                    to = resources.getDimension(R.dimen.zero)\n                )\n\n                panel.animateElevation(\n                    from = resources.getDimension(R.dimen.panel_elevation),\n                    to = resources.getDimension(R.dimen.zero)\n                )\n            }\n\n            override fun afterSnap(position: PanelPosition) {}\n\n            override fun beforePop(popToX: Int, popToY: Int) {\n                panel.animateRadius(\n                    from = resources.getDimension(R.dimen.zero),\n                    to = resources.getDimension(R.dimen.panel_corner_radius)\n                )\n\n                panel.animateElevation(\n                    from = resources.getDimension(R.dimen.zero),\n                    to = resources.getDimension(R.dimen.panel_elevation)\n                )\n            }\n\n            override fun afterPop(popToX: Int, popToY: Int) {}\n\n            override fun afterClose() {}\n        }\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/com/wayfair/panellayout/MaterialCardViewExt.kt",
    "content": "package com.wayfair.panellayout\n\nimport android.animation.ValueAnimator\nimport com.google.android.material.card.MaterialCardView\n\nfun MaterialCardView.animateRadius(from: Float, to: Float) =\n    ValueAnimator.ofFloat(from, to).apply {\n        addUpdateListener {\n            radius = it.animatedValue as Float\n        }\n    }.start()\n\n\nfun MaterialCardView.animateElevation(from: Float, to: Float) =\n    ValueAnimator.ofFloat(from, to).apply {\n        addUpdateListener {\n            elevation = it.animatedValue as Float\n        }\n    }.start()\n"
  },
  {
    "path": "app/src/main/res/drawable/ic_ballpoint_pen.xml",
    "content": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:height=\"24dp\"\n    android:width=\"24dp\"\n    android:viewportWidth=\"24\"\n    android:viewportHeight=\"24\">\n    <path\n        android:fillColor=\"#000\"\n        android:pathData=\"M20.71,7.04C20.37,7.38 20.04,7.71 20.03,8.04C20,8.36 20.34,8.69 20.66,9C21.14,9.5 21.61,9.95 21.59,10.44C21.57,10.93 21.06,11.44 20.55,11.94L16.42,16.08L15,14.66L19.25,10.42L18.29,9.46L16.87,10.87L13.12,7.12L16.96,3.29C17.35,2.9 18,2.9 18.37,3.29L20.71,5.63C21.1,6 21.1,6.65 20.71,7.04M3,17.25L12.56,7.68L16.31,11.43L6.75,21H3V17.25Z\" />\n</vector>\n"
  },
  {
    "path": "app/src/main/res/drawable/ic_baseline_visibility_off.xml",
    "content": "<vector android:height=\"24dp\"\n    android:tint=\"#FFFFFF\"\n    android:viewportHeight=\"24\"\n    android:viewportWidth=\"24\"\n    android:width=\"24dp\"\n    xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <path\n        android:fillColor=\"@android:color/white\"\n        android:pathData=\"M12,7c2.76,0 5,2.24 5,5 0,0.65 -0.13,1.26 -0.36,1.83l2.92,2.92c1.51,-1.26 2.7,-2.89 3.43,-4.75 -1.73,-4.39 -6,-7.5 -11,-7.5 -1.4,0 -2.74,0.25 -3.98,0.7l2.16,2.16C10.74,7.13 11.35,7 12,7zM2,4.27l2.28,2.28 0.46,0.46C3.08,8.3 1.78,10.02 1,12c1.73,4.39 6,7.5 11,7.5 1.55,0 3.03,-0.3 4.38,-0.84l0.42,0.42L19.73,22 21,20.73 3.27,3 2,4.27zM7.53,9.8l1.55,1.55c-0.05,0.21 -0.08,0.43 -0.08,0.65 0,1.66 1.34,3 3,3 0.22,0 0.44,-0.03 0.65,-0.08l1.55,1.55c-0.67,0.33 -1.41,0.53 -2.2,0.53 -2.76,0 -5,-2.24 -5,-5 0,-0.79 0.2,-1.53 0.53,-2.2zM11.84,9.02l3.15,3.15 0.02,-0.16c0,-1.66 -1.34,-3 -3,-3l-0.17,0.01z\" />\n</vector>\n"
  },
  {
    "path": "app/src/main/res/drawable/ic_baseline_visibility_on.xml",
    "content": "<vector android:height=\"24dp\"\n    android:tint=\"#FFFFFF\"\n    android:viewportHeight=\"24\"\n    android:viewportWidth=\"24\"\n    android:width=\"24dp\"\n    xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <path\n        android:fillColor=\"@android:color/white\"\n        android:pathData=\"M12,4.5C7,4.5 2.73,7.61 1,12c1.73,4.39 6,7.5 11,7.5s9.27,-3.11 11,-7.5c-1.73,-4.39 -6,-7.5 -11,-7.5zM12,17c-2.76,0 -5,-2.24 -5,-5s2.24,-5 5,-5 5,2.24 5,5 -2.24,5 -5,5zM12,9c-1.66,0 -3,1.34 -3,3s1.34,3 3,3 3,-1.34 3,-3 -1.34,-3 -3,-3z\" />\n</vector>\n"
  },
  {
    "path": "app/src/main/res/drawable/ic_circle.xml",
    "content": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:height=\"24dp\"\n    android:width=\"24dp\"\n    android:viewportWidth=\"24\"\n    android:viewportHeight=\"24\">\n    <path\n        android:fillColor=\"#000\"\n        android:pathData=\"M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z\" />\n</vector>\n"
  },
  {
    "path": "app/src/main/res/drawable/ic_circle_outline.xml",
    "content": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:height=\"24dp\"\n    android:width=\"24dp\"\n    android:viewportWidth=\"24\"\n    android:viewportHeight=\"24\">\n    <path\n        android:fillColor=\"#000\"\n        android:pathData=\"M12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4A8,8 0 0,1 20,12A8,8 0 0,1 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z\" />\n</vector>\n"
  },
  {
    "path": "app/src/main/res/drawable/ic_color_fill.xml",
    "content": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:height=\"24dp\"\n    android:width=\"24dp\"\n    android:viewportWidth=\"24\"\n    android:viewportHeight=\"24\">\n    <path\n        android:fillColor=\"#000\"\n        android:pathData=\"M19,11.5C19,11.5 17,13.67 17,15A2,2 0 0,0 19,17A2,2 0 0,0 21,15C21,13.67 19,11.5 19,11.5M5.21,10L10,5.21L14.79,10M16.56,8.94L7.62,0L6.21,1.41L8.59,3.79L3.44,8.94C2.85,9.5 2.85,10.47 3.44,11.06L8.94,16.56C9.23,16.85 9.62,17 10,17C10.38,17 10.77,16.85 11.06,16.56L16.56,11.06C17.15,10.47 17.15,9.5 16.56,8.94Z\" />\n</vector>\n"
  },
  {
    "path": "app/src/main/res/drawable/ic_eraser.xml",
    "content": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:height=\"24dp\"\n    android:width=\"24dp\"\n    android:viewportWidth=\"24\"\n    android:viewportHeight=\"24\">\n    <path\n        android:fillColor=\"#000\"\n        android:pathData=\"M16.24,3.56L21.19,8.5C21.97,9.29 21.97,10.55 21.19,11.34L12,20.53C10.44,22.09 7.91,22.09 6.34,20.53L2.81,17C2.03,16.21 2.03,14.95 2.81,14.16L13.41,3.56C14.2,2.78 15.46,2.78 16.24,3.56M4.22,15.58L7.76,19.11C8.54,19.9 9.8,19.9 10.59,19.11L14.12,15.58L9.17,10.63L4.22,15.58Z\" />\n</vector>\n"
  },
  {
    "path": "app/src/main/res/drawable/ic_fountain_pen.xml",
    "content": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:height=\"24dp\"\n    android:width=\"24dp\"\n    android:viewportWidth=\"24\"\n    android:viewportHeight=\"24\">\n    <path\n        android:fillColor=\"#000\"\n        android:pathData=\"M6.95,14.93L11.19,9.27L19.68,2.2C20.07,1.81 20.72,1.81 21.09,2.2L21.8,2.91C22.19,3.28 22.19,3.93 21.8,4.32L14.73,12.81L9.07,17.05L6.95,14.93M8.36,17.76L6.24,15.64L3.41,17.05L2,21.29L4.12,19.17C4.32,19 4.63,19 4.83,19.17C5,19.37 5,19.68 4.83,19.88L2.71,22L6.95,20.59L8.36,17.76Z\" />\n</vector>\n"
  },
  {
    "path": "app/src/main/res/drawable/ic_grease_pencil.xml",
    "content": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:height=\"24dp\"\n    android:width=\"24dp\"\n    android:viewportWidth=\"24\"\n    android:viewportHeight=\"24\">\n    <path\n        android:fillColor=\"#000\"\n        android:pathData=\"M18.62,1.5C18.11,1.5 17.6,1.69 17.21,2.09L10.75,8.55L14.95,12.74L21.41,6.29C22.2,5.5 22.2,4.24 21.41,3.46L20.04,2.09C19.65,1.69 19.14,1.5 18.62,1.5M9.8,9.5L3.23,16.07L3.93,16.77C3.4,17.24 2.89,17.78 2.38,18.29C1.6,19.08 1.6,20.34 2.38,21.12C3.16,21.9 4.42,21.9 5.21,21.12C5.72,20.63 6.25,20.08 6.73,19.58L7.43,20.27L14,13.7\" />\n</vector>\n"
  },
  {
    "path": "app/src/main/res/drawable/ic_launcher_background.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:width=\"108dp\"\n    android:height=\"108dp\"\n    android:viewportWidth=\"108\"\n    android:viewportHeight=\"108\">\n    <path\n        android:fillColor=\"#3DDC84\"\n        android:pathData=\"M0,0h108v108h-108z\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M9,0L9,108\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M19,0L19,108\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M29,0L29,108\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M39,0L39,108\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M49,0L49,108\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M59,0L59,108\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M69,0L69,108\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M79,0L79,108\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M89,0L89,108\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M99,0L99,108\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M0,9L108,9\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M0,19L108,19\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M0,29L108,29\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M0,39L108,39\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M0,49L108,49\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M0,59L108,59\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M0,69L108,69\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M0,79L108,79\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M0,89L108,89\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M0,99L108,99\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M19,29L89,29\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M19,39L89,39\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M19,49L89,49\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M19,59L89,59\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M19,69L89,69\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M19,79L89,79\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M29,19L29,89\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M39,19L39,89\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M49,19L49,89\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M59,19L59,89\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M69,19L69,89\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M79,19L79,89\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n</vector>\n"
  },
  {
    "path": "app/src/main/res/drawable/ic_pencil.xml",
    "content": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:height=\"24dp\"\n    android:width=\"24dp\"\n    android:viewportWidth=\"24\"\n    android:viewportHeight=\"24\">\n    <path\n        android:fillColor=\"#000\"\n        android:pathData=\"M20.71,7.04C21.1,6.65 21.1,6 20.71,5.63L18.37,3.29C18,2.9 17.35,2.9 16.96,3.29L15.12,5.12L18.87,8.87M3,17.25V21H6.75L17.81,9.93L14.06,6.18L3,17.25Z\" />\n</vector>\n"
  },
  {
    "path": "app/src/main/res/drawable/ic_resize.xml",
    "content": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:height=\"24dp\"\n    android:width=\"24dp\"\n    android:viewportWidth=\"24\"\n    android:viewportHeight=\"24\">\n    <path\n        android:fillColor=\"#000\"\n        android:pathData=\"M22,22H20V20H22V22M22,18H20V16H22V18M18,22H16V20H18V22M18,18H16V16H18V18M14,22H12V20H14V22M22,14H20V12H22V14Z\" />\n</vector>\n"
  },
  {
    "path": "app/src/main/res/drawable/ic_select.xml",
    "content": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:height=\"24dp\"\n    android:width=\"24dp\"\n    android:viewportWidth=\"24\"\n    android:viewportHeight=\"24\">\n    <path\n        android:fillColor=\"#000\"\n        android:pathData=\"M4,3H5V5H3V4A1,1 0 0,1 4,3M20,3A1,1 0 0,1 21,4V5H19V3H20M15,5V3H17V5H15M11,5V3H13V5H11M7,5V3H9V5H7M21,20A1,1 0 0,1 20,21H19V19H21V20M15,21V19H17V21H15M11,21V19H13V21H11M7,21V19H9V21H7M4,21A1,1 0 0,1 3,20V19H5V21H4M3,15H5V17H3V15M21,15V17H19V15H21M3,11H5V13H3V11M21,11V13H19V11H21M3,7H5V9H3V7M21,7V9H19V7H21Z\" />\n</vector>\n"
  },
  {
    "path": "app/src/main/res/drawable/ic_show_hide_button.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <item android:drawable=\"@drawable/ic_baseline_visibility_on\" android:state_selected=\"true\" />\n    <item android:drawable=\"@drawable/ic_baseline_visibility_off\" />\n</selector>\n"
  },
  {
    "path": "app/src/main/res/drawable/ic_square.xml",
    "content": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:height=\"24dp\"\n    android:width=\"24dp\"\n    android:viewportWidth=\"24\"\n    android:viewportHeight=\"24\">\n    <path\n        android:fillColor=\"#000\"\n        android:pathData=\"M3,3V21H21V3\" />\n</vector>\n"
  },
  {
    "path": "app/src/main/res/drawable/ic_square_outline.xml",
    "content": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:height=\"24dp\"\n    android:width=\"24dp\"\n    android:viewportWidth=\"24\"\n    android:viewportHeight=\"24\">\n    <path\n        android:fillColor=\"#000\"\n        android:pathData=\"M3,3H21V21H3V3M5,5V19H19V5H5Z\" />\n</vector>\n"
  },
  {
    "path": "app/src/main/res/drawable/ic_text.xml",
    "content": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:height=\"24dp\"\n    android:width=\"24dp\"\n    android:viewportWidth=\"24\"\n    android:viewportHeight=\"24\">\n    <path\n        android:fillColor=\"#000\"\n        android:pathData=\"M9.62,12L12,5.67L14.37,12M11,3L5.5,17H7.75L8.87,14H15.12L16.25,17H18.5L13,3H11Z\" />\n</vector>\n"
  },
  {
    "path": "app/src/main/res/drawable/ic_triangle.xml",
    "content": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:height=\"24dp\"\n    android:width=\"24dp\"\n    android:viewportWidth=\"24\"\n    android:viewportHeight=\"24\">\n    <path\n        android:fillColor=\"#000\"\n        android:pathData=\"M1,21H23L12,2\" />\n</vector>\n"
  },
  {
    "path": "app/src/main/res/drawable/ic_triangle_outline.xml",
    "content": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:height=\"24dp\"\n    android:width=\"24dp\"\n    android:viewportWidth=\"24\"\n    android:viewportHeight=\"24\">\n    <path\n        android:fillColor=\"#000\"\n        android:pathData=\"M12,2L1,21H23M12,6L19.53,19H4.47\" />\n</vector>\n"
  },
  {
    "path": "app/src/main/res/drawable-v24/ic_launcher_foreground.xml",
    "content": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:aapt=\"http://schemas.android.com/aapt\"\n    android:width=\"108dp\"\n    android:height=\"108dp\"\n    android:viewportWidth=\"108\"\n    android:viewportHeight=\"108\">\n    <path android:pathData=\"M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z\">\n        <aapt:attr name=\"android:fillColor\">\n            <gradient\n                android:endX=\"85.84757\"\n                android:endY=\"92.4963\"\n                android:startX=\"42.9492\"\n                android:startY=\"49.59793\"\n                android:type=\"linear\">\n                <item\n                    android:color=\"#44000000\"\n                    android:offset=\"0.0\" />\n                <item\n                    android:color=\"#00000000\"\n                    android:offset=\"1.0\" />\n            </gradient>\n        </aapt:attr>\n    </path>\n    <path\n        android:fillColor=\"#FFFFFF\"\n        android:fillType=\"nonZero\"\n        android:pathData=\"M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z\"\n        android:strokeWidth=\"1\"\n        android:strokeColor=\"#00000000\" />\n</vector>\n"
  },
  {
    "path": "app/src/main/res/layout/activity_main.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<androidx.constraintlayout.widget.ConstraintLayout 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    tools:context=\".MainActivity\">\n\n    <com.wayfair.panellayout.PanelLayout\n        android:id=\"@+id/panelLayout\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"match_parent\"\n        app:panel_content=\"@id/content\"\n        app:panel_move_handle=\"@id/moveHandle\"\n        app:panel_resize_enabled=\"true\"\n        app:panel_resize_handle=\"@id/resizeHandle\"\n        app:panel_snap_to_edges=\"all\"\n        app:panel_start_height=\"300dp\"\n        app:panel_start_width=\"300dp\"\n        app:panel_view=\"@id/panel\">\n\n        <FrameLayout\n            android:id=\"@+id/content\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:background=\"#f3e5f5\">\n\n            <FrameLayout\n                android:id=\"@+id/canvas\"\n                android:layout_width=\"match_parent\"\n                android:layout_height=\"match_parent\"\n                android:layout_margin=\"16dp\"\n                android:background=\"@color/white\"\n                android:elevation=\"2dp\">\n\n                <ImageView\n                    android:id=\"@+id/art\"\n                    android:scaleType=\"centerCrop\"\n                    android:layout_gravity=\"center\"\n                    android:layout_width=\"96dp\"\n                    android:layout_height=\"96dp\"\n                    android:tint=\"@color/colorAccent\"\n                    android:src=\"@drawable/ic_triangle_outline\" />\n            </FrameLayout>\n\n            <com.google.android.material.floatingactionbutton.FloatingActionButton\n                android:id=\"@+id/showHideButton\"\n                android:layout_width=\"wrap_content\"\n                android:layout_height=\"wrap_content\"\n                android:layout_gravity=\"bottom|end\"\n                android:layout_margin=\"32dp\"\n                android:src=\"@drawable/ic_show_hide_button\"\n                app:backgroundTint=\"@color/colorAccent\"\n                app:fabSize=\"normal\"\n                app:tint=\"@color/white\" />\n        </FrameLayout>\n\n        <com.google.android.material.card.MaterialCardView\n            android:id=\"@+id/panel\"\n            android:layout_width=\"300dp\"\n            android:layout_height=\"300dp\"\n            app:cardBackgroundColor=\"@color/white\">\n\n            <FrameLayout\n                android:layout_width=\"match_parent\"\n                android:layout_height=\"match_parent\">\n\n                <ScrollView\n                    android:layout_width=\"match_parent\"\n                    android:layout_height=\"wrap_content\"\n                    android:layout_marginTop=\"48dp\">\n\n                    <LinearLayout\n                        android:layout_width=\"match_parent\"\n                        android:layout_height=\"wrap_content\"\n                        android:orientation=\"vertical\"\n                        android:padding=\"16dp\">\n\n                        <TextView\n                            android:layout_width=\"wrap_content\"\n                            android:layout_height=\"wrap_content\"\n                            android:text=\"@string/tools\"\n                            android:textAppearance=\"@style/TextAppearance.MaterialComponents.Headline6\"\n                            android:textColor=\"@color/charcoal\" />\n\n                        <View\n                            android:layout_width=\"match_parent\"\n                            android:layout_height=\"1dp\"\n                            android:layout_marginVertical=\"16dp\"\n                            android:background=\"@color/divider\" />\n\n                        <include\n                            layout=\"@layout/tools\"\n                            android:layout_width=\"wrap_content\"\n                            android:layout_height=\"wrap_content\" />\n\n                        <TextView\n                            android:layout_width=\"wrap_content\"\n                            android:layout_height=\"wrap_content\"\n                            android:layout_marginTop=\"24dp\"\n                            android:text=\"@string/shapes\"\n                            android:textAppearance=\"@style/TextAppearance.MaterialComponents.Headline6\"\n                            android:textColor=\"@color/charcoal\" />\n\n                        <View\n                            android:layout_width=\"match_parent\"\n                            android:layout_height=\"1dp\"\n                            android:layout_marginVertical=\"16dp\"\n                            android:background=\"@color/divider\" />\n\n                        <include\n                            layout=\"@layout/shapes\"\n                            android:layout_width=\"wrap_content\"\n                            android:layout_height=\"wrap_content\" />\n\n                        <TextView\n                            android:layout_width=\"wrap_content\"\n                            android:layout_height=\"wrap_content\"\n                            android:layout_marginTop=\"24dp\"\n                            android:text=\"@string/colors\"\n                            android:textAppearance=\"@style/TextAppearance.MaterialComponents.Headline6\"\n                            android:textColor=\"@color/charcoal\" />\n\n                        <View\n                            android:layout_width=\"match_parent\"\n                            android:layout_height=\"1dp\"\n                            android:layout_marginVertical=\"16dp\"\n                            android:background=\"@color/divider\" />\n\n                        <include\n                            layout=\"@layout/colors\"\n                            android:layout_width=\"wrap_content\"\n                            android:layout_height=\"wrap_content\" />\n                    </LinearLayout>\n                </ScrollView>\n\n                <View\n                    android:id=\"@+id/moveHandle\"\n                    android:layout_width=\"match_parent\"\n                    android:layout_height=\"48dp\"\n                    android:background=\"#e1bee7\" />\n\n                <ImageView\n                    android:id=\"@+id/resizeHandle\"\n                    android:layout_width=\"48dp\"\n                    android:layout_height=\"48dp\"\n                    android:layout_gravity=\"bottom|end\"\n                    android:padding=\"4dp\"\n                    android:src=\"@drawable/ic_resize\"\n                    app:tint=\"@color/divider\" />\n            </FrameLayout>\n        </com.google.android.material.card.MaterialCardView>\n    </com.wayfair.panellayout.PanelLayout>\n</androidx.constraintlayout.widget.ConstraintLayout>\n"
  },
  {
    "path": "app/src/main/res/layout/colors.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<androidx.constraintlayout.widget.ConstraintLayout 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:id=\"@+id/colorSelector\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"wrap_content\"\n    tools:ignore=\"MissingConstraints\">\n\n    <androidx.constraintlayout.helper.widget.Flow\n        android:id=\"@+id/flow\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"0dp\"\n        app:constraint_referenced_ids=\"color1, color2, color3, color4, color5, color6, color7, color8, color9, color10, color11, color12, color13, color14, color15, color16, color17, color18, color19, color20, color21, color22, color23\"\n        app:flow_horizontalGap=\"16dp\"\n        app:flow_verticalGap=\"16dp\"\n        app:flow_wrapMode=\"aligned\"\n        app:layout_constraintBottom_toBottomOf=\"parent\"\n        app:layout_constraintStart_toStartOf=\"parent\"\n        app:layout_constraintTop_toTopOf=\"parent\" />\n\n    <View\n        android:id=\"@+id/color1\"\n        android:layout_width=\"@dimen/color_width\"\n        android:layout_height=\"@dimen/color_width\"\n        android:background=\"@drawable/ic_circle\"\n        android:backgroundTint=\"@color/color1\" />\n\n    <View\n        android:id=\"@+id/color2\"\n        android:layout_width=\"@dimen/color_width\"\n        android:layout_height=\"@dimen/color_width\"\n        android:background=\"@drawable/ic_circle\"\n        android:backgroundTint=\"@color/color2\" />\n\n    <View\n        android:id=\"@+id/color3\"\n        android:layout_width=\"@dimen/color_width\"\n        android:layout_height=\"@dimen/color_width\"\n        android:background=\"@drawable/ic_circle\"\n        android:backgroundTint=\"@color/color3\" />\n\n    <View\n        android:id=\"@+id/color4\"\n        android:layout_width=\"@dimen/color_width\"\n        android:layout_height=\"@dimen/color_width\"\n        android:background=\"@drawable/ic_circle\"\n        android:backgroundTint=\"@color/color4\" />\n\n    <View\n        android:id=\"@+id/color5\"\n        android:layout_width=\"@dimen/color_width\"\n        android:layout_height=\"@dimen/color_width\"\n        android:background=\"@drawable/ic_circle\"\n        android:backgroundTint=\"@color/color5\" />\n\n    <View\n        android:id=\"@+id/color6\"\n        android:layout_width=\"@dimen/color_width\"\n        android:layout_height=\"@dimen/color_width\"\n        android:background=\"@drawable/ic_circle\"\n        android:backgroundTint=\"@color/color6\" />\n\n    <View\n        android:id=\"@+id/color7\"\n        android:layout_width=\"@dimen/color_width\"\n        android:layout_height=\"@dimen/color_width\"\n        android:background=\"@drawable/ic_circle\"\n        android:backgroundTint=\"@color/color7\" />\n\n    <View\n        android:id=\"@+id/color8\"\n        android:layout_width=\"@dimen/color_width\"\n        android:layout_height=\"@dimen/color_width\"\n        android:background=\"@drawable/ic_circle\"\n        android:backgroundTint=\"@color/color8\" />\n\n    <View\n        android:id=\"@+id/color9\"\n        android:layout_width=\"@dimen/color_width\"\n        android:layout_height=\"@dimen/color_width\"\n        android:background=\"@drawable/ic_circle\"\n        android:backgroundTint=\"@color/color9\" />\n\n    <View\n        android:id=\"@+id/color10\"\n        android:layout_width=\"@dimen/color_width\"\n        android:layout_height=\"@dimen/color_width\"\n        android:background=\"@drawable/ic_circle\"\n        android:backgroundTint=\"@color/color10\" />\n\n    <View\n        android:id=\"@+id/color11\"\n        android:layout_width=\"@dimen/color_width\"\n        android:layout_height=\"@dimen/color_width\"\n        android:background=\"@drawable/ic_circle\"\n        android:backgroundTint=\"@color/color11\" />\n\n    <View\n        android:id=\"@+id/color12\"\n        android:layout_width=\"@dimen/color_width\"\n        android:layout_height=\"@dimen/color_width\"\n        android:background=\"@drawable/ic_circle\"\n        android:backgroundTint=\"@color/color12\" />\n\n    <View\n        android:id=\"@+id/color13\"\n        android:layout_width=\"@dimen/color_width\"\n        android:layout_height=\"@dimen/color_width\"\n        android:background=\"@drawable/ic_circle\"\n        android:backgroundTint=\"@color/color13\" />\n\n    <View\n        android:id=\"@+id/color14\"\n        android:layout_width=\"@dimen/color_width\"\n        android:layout_height=\"@dimen/color_width\"\n        android:background=\"@drawable/ic_circle\"\n        android:backgroundTint=\"@color/color14\" />\n\n    <View\n        android:id=\"@+id/color15\"\n        android:layout_width=\"@dimen/color_width\"\n        android:layout_height=\"@dimen/color_width\"\n        android:background=\"@drawable/ic_circle\"\n        android:backgroundTint=\"@color/color15\" />\n\n    <View\n        android:id=\"@+id/color16\"\n        android:layout_width=\"@dimen/color_width\"\n        android:layout_height=\"@dimen/color_width\"\n        android:background=\"@drawable/ic_circle\"\n        android:backgroundTint=\"@color/color16\" />\n\n    <View\n        android:id=\"@+id/color17\"\n        android:layout_width=\"@dimen/color_width\"\n        android:layout_height=\"@dimen/color_width\"\n        android:background=\"@drawable/ic_circle\"\n        android:backgroundTint=\"@color/color17\" />\n\n    <View\n        android:id=\"@+id/color18\"\n        android:layout_width=\"@dimen/color_width\"\n        android:layout_height=\"@dimen/color_width\"\n        android:background=\"@drawable/ic_circle\"\n        android:backgroundTint=\"@color/color18\" />\n\n    <View\n        android:id=\"@+id/color19\"\n        android:layout_width=\"@dimen/color_width\"\n        android:layout_height=\"@dimen/color_width\"\n        android:background=\"@drawable/ic_circle\"\n        android:backgroundTint=\"@color/color19\" />\n\n    <View\n        android:id=\"@+id/color20\"\n        android:layout_width=\"@dimen/color_width\"\n        android:layout_height=\"@dimen/color_width\"\n        android:background=\"@drawable/ic_circle\"\n        android:backgroundTint=\"@color/color20\" />\n\n    <View\n        android:id=\"@+id/color21\"\n        android:layout_width=\"@dimen/color_width\"\n        android:layout_height=\"@dimen/color_width\"\n        android:background=\"@drawable/ic_circle\"\n        android:backgroundTint=\"@color/color21\" />\n\n    <View\n        android:id=\"@+id/color22\"\n        android:layout_width=\"@dimen/color_width\"\n        android:layout_height=\"@dimen/color_width\"\n        android:background=\"@drawable/ic_circle\"\n        android:backgroundTint=\"@color/color22\" />\n\n    <View\n        android:id=\"@+id/color23\"\n        android:layout_width=\"@dimen/color_width\"\n        android:layout_height=\"@dimen/color_width\"\n        android:background=\"@drawable/ic_circle\"\n        android:backgroundTint=\"@color/color23\" />\n</androidx.constraintlayout.widget.ConstraintLayout>\n"
  },
  {
    "path": "app/src/main/res/layout/shapes.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<androidx.constraintlayout.widget.ConstraintLayout 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    tools:ignore=\"MissingConstraints\">\n\n    <View\n        android:id=\"@+id/shape1\"\n        android:layout_width=\"@dimen/tool_width\"\n        android:layout_height=\"@dimen/tool_width\"\n        android:background=\"@drawable/ic_circle\"\n        android:backgroundTint=\"@color/charcoal\" />\n\n    <View\n        android:id=\"@+id/shape2\"\n        android:layout_width=\"@dimen/tool_width\"\n        android:layout_height=\"@dimen/tool_width\"\n        android:background=\"@drawable/ic_circle_outline\"\n        android:backgroundTint=\"@color/charcoal\" />\n\n    <View\n        android:id=\"@+id/shape3\"\n        android:layout_width=\"@dimen/tool_width\"\n        android:layout_height=\"@dimen/tool_width\"\n        android:background=\"@drawable/ic_square\"\n        android:backgroundTint=\"@color/charcoal\" />\n\n    <View\n        android:id=\"@+id/shape4\"\n        android:layout_width=\"@dimen/tool_width\"\n        android:layout_height=\"@dimen/tool_width\"\n        android:background=\"@drawable/ic_square_outline\"\n        android:backgroundTint=\"@color/charcoal\" />\n\n    <View\n        android:id=\"@+id/shape5\"\n        android:layout_width=\"@dimen/tool_width\"\n        android:layout_height=\"@dimen/tool_width\"\n        android:background=\"@drawable/ic_triangle\"\n        android:backgroundTint=\"@color/charcoal\" />\n\n    <View\n        android:id=\"@+id/shape6\"\n        android:layout_width=\"@dimen/tool_width\"\n        android:layout_height=\"@dimen/tool_width\"\n        android:background=\"@drawable/ic_triangle_outline\"\n        android:backgroundTint=\"@color/charcoal\" />\n\n\n    <androidx.constraintlayout.helper.widget.Flow\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"0dp\"\n        app:constraint_referenced_ids=\"shape1, shape2, shape3, shape4, shape5, shape6\"\n        app:flow_horizontalGap=\"16dp\"\n        app:flow_verticalGap=\"16dp\"\n        app:flow_wrapMode=\"aligned\"\n        app:layout_constraintBottom_toBottomOf=\"parent\"\n        app:layout_constraintStart_toStartOf=\"parent\"\n        app:layout_constraintTop_toTopOf=\"parent\" />\n\n</androidx.constraintlayout.widget.ConstraintLayout>\n"
  },
  {
    "path": "app/src/main/res/layout/tools.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<androidx.constraintlayout.widget.ConstraintLayout 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    tools:ignore=\"MissingConstraints\">\n\n    <View\n        android:id=\"@+id/tool1\"\n        android:layout_width=\"@dimen/tool_width\"\n        android:layout_height=\"@dimen/tool_width\"\n        android:background=\"@drawable/ic_pencil\"\n        android:backgroundTint=\"@color/charcoal\" />\n\n    <View\n        android:id=\"@+id/tool2\"\n        android:layout_width=\"@dimen/tool_width\"\n        android:layout_height=\"@dimen/tool_width\"\n        android:background=\"@drawable/ic_grease_pencil\"\n        android:backgroundTint=\"@color/charcoal\" />\n\n    <View\n        android:id=\"@+id/tool3\"\n        android:layout_width=\"@dimen/tool_width\"\n        android:layout_height=\"@dimen/tool_width\"\n        android:background=\"@drawable/ic_fountain_pen\"\n        android:backgroundTint=\"@color/charcoal\" />\n\n    <View\n        android:id=\"@+id/tool4\"\n        android:layout_width=\"@dimen/tool_width\"\n        android:layout_height=\"@dimen/tool_width\"\n        android:background=\"@drawable/ic_ballpoint_pen\"\n        android:backgroundTint=\"@color/charcoal\" />\n\n    <View\n        android:id=\"@+id/tool5\"\n        android:layout_width=\"@dimen/tool_width\"\n        android:layout_height=\"@dimen/tool_width\"\n        android:background=\"@drawable/ic_eraser\"\n        android:backgroundTint=\"@color/charcoal\" />\n\n    <View\n        android:id=\"@+id/tool6\"\n        android:layout_width=\"@dimen/tool_width\"\n        android:layout_height=\"@dimen/tool_width\"\n        android:background=\"@drawable/ic_select\"\n        android:backgroundTint=\"@color/charcoal\" />\n\n    <View\n        android:id=\"@+id/tool7\"\n        android:layout_width=\"@dimen/tool_width\"\n        android:layout_height=\"@dimen/tool_width\"\n        android:background=\"@drawable/ic_color_fill\"\n        android:backgroundTint=\"@color/charcoal\" />\n\n\n    <View\n        android:id=\"@+id/tool8\"\n        android:layout_width=\"@dimen/tool_width\"\n        android:layout_height=\"@dimen/tool_width\"\n        android:background=\"@drawable/ic_text\"\n        android:backgroundTint=\"@color/charcoal\" />\n\n\n    <androidx.constraintlayout.helper.widget.Flow\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"0dp\"\n        app:constraint_referenced_ids=\"tool1, tool2, tool3, tool4, tool5, tool6, tool7, tool8\"\n        app:flow_horizontalGap=\"16dp\"\n        app:flow_verticalGap=\"16dp\"\n        app:flow_wrapMode=\"aligned\"\n        app:layout_constraintBottom_toBottomOf=\"parent\"\n        app:layout_constraintStart_toStartOf=\"parent\"\n        app:layout_constraintTop_toTopOf=\"parent\" />\n\n</androidx.constraintlayout.widget.ConstraintLayout>\n"
  },
  {
    "path": "app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<adaptive-icon xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <background android:drawable=\"@drawable/ic_launcher_background\" />\n    <foreground android:drawable=\"@drawable/ic_launcher_foreground\" />\n</adaptive-icon>\n"
  },
  {
    "path": "app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<adaptive-icon xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <background android:drawable=\"@drawable/ic_launcher_background\" />\n    <foreground android:drawable=\"@drawable/ic_launcher_foreground\" />\n</adaptive-icon>\n"
  },
  {
    "path": "app/src/main/res/values/colors.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n    <color name=\"colorPrimary\">#9C27B0</color>\n    <color name=\"colorPrimaryDark\">#6a0080</color>\n    <color name=\"colorAccent\">#9C27B0</color>\n    <color name=\"white\">#FFFFFF</color>\n    <color name=\"divider\">#20000000</color>\n    <color name=\"charcoal\">#424242</color>\n\n    <!-- Color picker values-->\n    <color name=\"color1\">#F44336</color>\n    <color name=\"color2\">#E91E63</color>\n    <color name=\"color3\">#9C27B0</color>\n    <color name=\"color4\">#673AB7</color>\n    <color name=\"color5\">#3F51B5</color>\n    <color name=\"color6\">#2196F3</color>\n    <color name=\"color7\">#03A9F4</color>\n    <color name=\"color8\">#00BCD4</color>\n    <color name=\"color9\">#009688</color>\n    <color name=\"color10\">#4CAF50</color>\n    <color name=\"color11\">#8BC34A</color>\n    <color name=\"color12\">#CDDC39</color>\n    <color name=\"color13\">#FFEB3B</color>\n    <color name=\"color14\">#FFC107</color>\n    <color name=\"color15\">#FF9800</color>\n    <color name=\"color16\">#FF5722</color>\n    <color name=\"color17\">#795548</color>\n    <color name=\"color18\">#9E9E9E</color>\n    <color name=\"color19\">#757575</color>\n    <color name=\"color20\">#616161</color>\n    <color name=\"color21\">#424242</color>\n    <color name=\"color22\">#212121</color>\n    <color name=\"color23\">#FFFFFF</color>\n</resources>\n"
  },
  {
    "path": "app/src/main/res/values/dimens.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n    <dimen name=\"zero\">0dp</dimen>\n    <dimen name=\"panel_elevation\">4dp</dimen>\n    <dimen name=\"panel_corner_radius\">4dp</dimen>\n    <dimen name=\"tool_width\">32dp</dimen>\n    <dimen name=\"color_width\">32dp</dimen>\n</resources>\n"
  },
  {
    "path": "app/src/main/res/values/strings.xml",
    "content": "<resources>\n    <string name=\"app_name\">Panel Layout</string>\n    <string name=\"shapes\">Shapes</string>\n    <string name=\"tools\">Tools</string>\n    <string name=\"colors\">Colors</string>\n</resources>\n"
  },
  {
    "path": "app/src/main/res/values/styles.xml",
    "content": "<resources>\n    <!-- Base application theme. -->\n    <style name=\"AppTheme\" parent=\"Theme.MaterialComponents.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": "build.gradle",
    "content": "// Top-level build file where you can add configuration options common to all sub-projects/modules.\nbuildscript {\n    ext.kotlin_version = \"1.3.72\"\n    repositories {\n        google()\n        jcenter()\n    }\n    dependencies {\n        classpath \"com.android.tools.build:gradle:4.0.0\"\n        classpath \"org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version\"\n    }\n}\n\nallprojects {\n    repositories {\n        google()\n        jcenter()\n    }\n}\n\ntask clean(type: Delete) {\n    delete rootProject.buildDir\n}\n"
  },
  {
    "path": "gradle/wrapper/gradle-wrapper.properties",
    "content": "#Tue May 05 17:46:57 EET 2020\ndistributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\nzipStoreBase=GRADLE_USER_HOME\nzipStorePath=wrapper/dists\ndistributionUrl=https\\://services.gradle.org/distributions/gradle-6.1.1-all.zip\n"
  },
  {
    "path": "gradle.properties",
    "content": "org.gradle.jvmargs=-Xmx2048m\nandroid.useAndroidX=true\nandroid.enableJetifier=true\nkotlin.code.style=official\n\nGROUP=com.wayfair.panellayout\nVERSION_NAME=1.0.0-alpha02\n\nPOM_URL=https://github.com/wayfair-incubator/panel-layout/\nPOM_SCM_URL=https://github.com/wayfair-incubator/panel-layout.git\nPOM_SCM_CONNECTION=scm:git:git://github.com/wayfair-incubator/panel-layout.git\nPOM_LICENCE_NAME=BSD 2-Clause \"Simplified\" License\nPOM_LICENCE_URL=https://raw.githubusercontent.com/wayfair-incubator/panel-layout/master/LICENSE\nPOM_LICENCE_DIST=repo\n\n# https://github.com/gradle/gradle/issues/11412\nsystemProp.org.gradle.internal.publish.checksums.insecure=true\n"
  },
  {
    "path": "gradlew",
    "content": "#!/usr/bin/env sh\n\n##############################################################################\n##\n##  Gradle start up script for UN*X\n##\n##############################################################################\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\nAPP_NAME=\"Gradle\"\nAPP_BASE_NAME=`basename \"$0\"`\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\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\nnonstop=false\ncase \"`uname`\" in\n  CYGWIN* )\n    cygwin=true\n    ;;\n  Darwin* )\n    darwin=true\n    ;;\n  MINGW* )\n    msys=true\n    ;;\n  NONSTOP* )\n    nonstop=true\n    ;;\nesac\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\" -a \"$nonstop\" = \"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# Escape application args\nsave () {\n    for i do printf %s\\\\n \"$i\" | sed \"s/'/'\\\\\\\\''/g;1s/^/'/;\\$s/\\$/' \\\\\\\\/\" ; done\n    echo \" \"\n}\nAPP_ARGS=$(save \"$@\")\n\n# Collect all arguments for the java command, following the shell quoting and substitution rules\neval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS \"\\\"-Dorg.gradle.appname=$APP_BASE_NAME\\\"\" -classpath \"\\\"$CLASSPATH\\\"\" org.gradle.wrapper.GradleWrapperMain \"$APP_ARGS\"\n\n# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong\nif [ \"$(uname)\" = \"Darwin\" ] && [ \"$HOME\" = \"$PWD\" ]; then\n  cd \"$(dirname \"$0\")\"\nfi\n\nexec \"$JAVACMD\" \"$@\"\n"
  },
  {
    "path": "gradlew.bat",
    "content": "@if \"%DEBUG%\" == \"\" @echo off\n@rem ##########################################################################\n@rem\n@rem  Gradle startup script for Windows\n@rem\n@rem ##########################################################################\n\n@rem Set local scope for the variables with windows NT shell\nif \"%OS%\"==\"Windows_NT\" setlocal\n\nset DIRNAME=%~dp0\nif \"%DIRNAME%\" == \"\" set DIRNAME=.\nset APP_BASE_NAME=%~n0\nset APP_HOME=%DIRNAME%\n\n@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\nset DEFAULT_JVM_OPTS=\n\n@rem Find java.exe\nif defined JAVA_HOME goto findJavaFromJavaHome\n\nset JAVA_EXE=java.exe\n%JAVA_EXE% -version >NUL 2>&1\nif \"%ERRORLEVEL%\" == \"0\" goto init\n\necho.\necho ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\necho.\necho Please set the JAVA_HOME variable in your environment to match the\necho location of your Java installation.\n\ngoto fail\n\n:findJavaFromJavaHome\nset JAVA_HOME=%JAVA_HOME:\"=%\nset JAVA_EXE=%JAVA_HOME%/bin/java.exe\n\nif exist \"%JAVA_EXE%\" goto init\n\necho.\necho ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%\necho.\necho Please set the JAVA_HOME variable in your environment to match the\necho location of your Java installation.\n\ngoto fail\n\n:init\n@rem Get command-line arguments, handling Windows variants\n\nif not \"%OS%\" == \"Windows_NT\" goto win9xME_args\n\n:win9xME_args\n@rem Slurp the command line arguments.\nset CMD_LINE_ARGS=\nset _SKIP=2\n\n:win9xME_args_slurp\nif \"x%~1\" == \"x\" goto execute\n\nset CMD_LINE_ARGS=%*\n\n:execute\n@rem Setup the command line\n\nset CLASSPATH=%APP_HOME%\\gradle\\wrapper\\gradle-wrapper.jar\n\n@rem Execute Gradle\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%\n\n:end\n@rem End local scope for the variables with windows NT shell\nif \"%ERRORLEVEL%\"==\"0\" goto mainEnd\n\n:fail\nrem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of\nrem the _cmd.exe /c_ return code!\nif  not \"\" == \"%GRADLE_EXIT_CONSOLE%\" exit 1\nexit /b 1\n\n:mainEnd\nif \"%OS%\"==\"Windows_NT\" endlocal\n\n:omega\n"
  },
  {
    "path": "panellayout/.gitignore",
    "content": "/build\n"
  },
  {
    "path": "panellayout/build.gradle",
    "content": "apply plugin: 'com.android.library'\napply plugin: 'kotlin-android'\napply plugin: 'kotlin-android-extensions'\napply plugin: 'org.gradle.maven-publish'\n\nandroid {\n    compileSdkVersion 28\n\n    defaultConfig {\n        minSdkVersion 21\n    }\n\n    compileOptions {\n        sourceCompatibility JavaVersion.VERSION_1_8\n        targetCompatibility JavaVersion.VERSION_1_8\n    }\n\n    kotlinOptions {\n        jvmTarget = JavaVersion.VERSION_1_8\n    }\n    buildFeatures {\n        buildConfig = false\n        resValues = false\n    }\n}\n\nandroidExtensions {\n    features = ['parcelize']\n}\n\ndependencies {\n    implementation 'androidx.appcompat:appcompat:1.1.0'\n    implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta4'\n    implementation 'androidx.core:core-ktx:1.2.0'\n    implementation \"androidx.transition:transition:1.3.1\"\n}\n\npublishing {\n    publications.create(\"default\", MavenPublication) {\n        afterEvaluate {\n            from(components.findByName(\"release\"))\n        }\n\n        def sourcesJarTask = tasks.create(\"sourcesJar\", Jar) {\n            archiveClassifier.set(\"sources\")\n            from(android.sourceSets[\"main\"].java.srcDirs)\n        }\n        artifact(sourcesJarTask)\n\n        groupId = findProperty(\"GROUP\")\n        version = findProperty(\"VERSION_NAME\")\n        artifactId = findProperty(\"POM_ARTIFACT_ID\")\n\n        pom {\n            name = findProperty(\"POM_NAME\")\n            description = findProperty(\"POM_DESCRIPTION\")\n            packaging = findProperty(\"POM_PACKAGING\")\n            url = findProperty(\"POM_URL\")\n\n            scm {\n                url = findProperty(\"POM_SCM_URL\")\n                connection = findProperty(\"POM_SCM_CONNECTION\")\n            }\n\n            licenses {\n                license {\n                    name = findProperty(\"POM_LICENCE_NAME\")\n                    url = findProperty(\"POM_LICENCE_URL\")\n                }\n            }\n        }\n    }\n\n    repositories {\n        maven {\n            name = \"bintray\"\n            url = uri(\"https://api.bintray.com/maven/wayfair/PanelLayout/PanelLayout/;publish=1;override=1\")\n            credentials {\n                username = System.getenv(\"BINTRAY_USER\")\n                password = System.getenv(\"BINTRAY_API_KEY\")\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "panellayout/gradle.properties",
    "content": "POM_ARTIFACT_ID=panellayout\nPOM_NAME=Panel Layout\nPOM_DESCRIPTION=UI library for Android that allows you to display a floating and resizable panel that can also snap to the edges.\nPOM_PACKAGING=aar\n"
  },
  {
    "path": "panellayout/src/main/AndroidManifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<manifest package=\"com.wayfair.panellayout\" />\n"
  },
  {
    "path": "panellayout/src/main/java/com/wayfair/panellayout/PanelLayout.kt",
    "content": "/*  These imports produce a detekt false-positive:\n    import androidx.core.graphics.component1\n    import androidx.core.graphics.component2\n    import androidx.core.graphics.component3\n    import androidx.core.graphics.component4\n\n    So UnusedImports are suppressed. */\n@file:Suppress(\"UnusedImports\", \"CommentOverPrivateFunction\")\n\npackage com.wayfair.panellayout\n\nimport android.annotation.SuppressLint\nimport android.content.Context\nimport android.content.res.TypedArray\nimport android.graphics.Rect\nimport android.os.Bundle\nimport android.os.Parcelable\nimport android.util.AttributeSet\nimport android.view.*\nimport android.view.MotionEvent.*\nimport android.view.animation.AccelerateDecelerateInterpolator\nimport androidx.annotation.ColorRes\nimport androidx.annotation.IdRes\nimport androidx.annotation.LayoutRes\nimport androidx.constraintlayout.widget.ConstraintLayout\nimport androidx.constraintlayout.widget.ConstraintSet\nimport androidx.core.content.ContextCompat\nimport androidx.core.content.res.getResourceIdOrThrow\nimport androidx.core.graphics.component1\nimport androidx.core.graphics.component2\nimport androidx.core.graphics.component3\nimport androidx.core.graphics.component4\nimport androidx.core.graphics.drawable.toDrawable\nimport androidx.core.os.bundleOf\nimport androidx.core.view.isVisible\nimport androidx.transition.AutoTransition\nimport androidx.transition.ChangeBounds\nimport androidx.transition.Transition\nimport androidx.transition.TransitionManager\nimport com.wayfair.panellayout.PanelPosition.*\nimport com.wayfair.panellayout.PanelPosition.values\nimport com.wayfair.panellayout.PanelState.HorizontalEdge.LEFT\nimport com.wayfair.panellayout.PanelState.HorizontalEdge.RIGHT\nimport com.wayfair.panellayout.PanelState.Snap.ANIMATING\nimport com.wayfair.panellayout.PanelState.Snap.FLOATING\nimport com.wayfair.panellayout.PanelState.Snap.SNAPPED\nimport com.wayfair.panellayout.PanelState.VerticalEdge.BOTTOM\nimport com.wayfair.panellayout.PanelState.VerticalEdge.TOP\nimport kotlin.math.roundToInt\nimport kotlin.math.sqrt\n\n@Suppress(\"LargeClass\", \"LongMethod\") // It's hard to split view classes\n@SuppressLint(\"ClickableViewAccessibility\") // ClickableViewAccessibility: We do not want to handle clicks on move and resize handles\nclass PanelLayout @JvmOverloads constructor(\n    context: Context,\n    attrs: AttributeSet? = null,\n    defStyleAttr: Int = 0\n) : ConstraintLayout(context, attrs, defStyleAttr), PanelLayoutCommands {\n\n    // Public field\n    override var panelLayoutCallbacks: Callbacks? = null\n    override var panelVisible: Boolean\n        get() = panelState.isVisible\n        set(value) {\n            if (value) showPanel() else hidePanel()\n        }\n\n    // Attrs (initial values are not used)\n    @IdRes\n    private var panelResId = 0\n\n    @IdRes\n    private var contentResId = 0\n\n    @IdRes\n    private var moveHandleResId = 0\n\n    @IdRes\n    private var resizeHandleResId = 0\n\n    private var resizeEnabled = false\n\n    private var panelMinWidth = 0\n    private var panelMaxWidth = 0\n\n    private var panelMinHeight = 0\n    private var panelMaxHeight = 0\n\n    private var panelStartWidth = 0\n    private var panelStartHeight = 0\n\n    private var panelSnapWidth = 0f\n    private var panelSnapHeight = 0f\n\n    private var panelSnapWidthPercent = 0f\n    private var panelSnapHeightPercent = 0f\n\n    @LayoutRes\n    private var snapLeftLayout = 0\n\n    @LayoutRes\n    private var snapTopLayout = 0\n\n    @LayoutRes\n    private var snapRightLayout = 0\n\n    @LayoutRes\n    private var snapBottomLayout = 0\n\n    private var snapAnimationDuration = 0L\n    private var snapOverlayAnimationDuration = 0L\n\n    @ColorRes\n    private var snapOverlayColor = 0\n\n    private var snapToEdges = 0\n\n    // View references\n    private lateinit var content: View\n    private lateinit var panelView: View\n    private lateinit var moveHandle: View\n    private var resizeHandle: View? = null\n\n    private val leftOverlay = View(context)\n    private val topOverlay = View(context)\n    private val rightOverlay = View(context)\n    private val bottomOverlay = View(context)\n\n    private var isPanelStateRestored = false\n\n    lateinit var panelState: PanelState\n\n    val initialPanelState: PanelState\n        get() = PanelState(\n            snap = FLOATING,\n            position = NO_EDGE,\n            size = panelStartWidth to panelStartHeight\n        )\n\n    private val preferredSnapWidth: Float\n        get() = when (panelSnapWidthPercent) {\n            NOT_SET -> panelSnapWidth\n            else -> width * panelSnapWidthPercent\n        }\n\n    private val preferredSnapHeight: Float\n        get() = when (panelSnapHeightPercent) {\n            NOT_SET -> panelSnapHeight\n            else -> height * panelSnapHeightPercent\n        }\n\n    // Touch / motion related\n    private val moveSnapListener = PanelMoveSnapListener()\n    private val popListener = PanelPopListener()\n    private val resizeListener = PanelResizeListener()\n\n    private var lastDownEvent: MotionEvent? = null\n    private var relativeTouchPositionX = 0f\n    private var relativeTouchPositionY = 0f\n\n    private var touchSubject: View? = null\n\n    init {\n        isMotionEventSplittingEnabled = false\n        isSaveEnabled = true\n\n        readAttrs(attrs)\n        setUpOverlays()\n    }\n\n    override fun onAttachedToWindow() {\n        super.onAttachedToWindow()\n\n        if (!isPanelStateRestored) {\n            panelState = initialPanelState\n        }\n\n        ensureChildren()\n        setTouchListeners()\n        restorePanelFromState()\n    }\n\n    private fun ensureChildren() {\n        fun Int.toResourceName() = resources.getResourceName(this)\n\n        require(::content.isInitialized) {\n            \"Could not find child (panel_content) with id: ${contentResId.toResourceName()}\"\n        }\n        require(::panelView.isInitialized) {\n            \"Could not find child (panel_view) with id: ${panelResId.toResourceName()}\"\n        }\n        require(::moveHandle.isInitialized) {\n            \"Could not find child (panel_move_handle) with id: ${moveHandleResId.toResourceName()}\"\n        }\n        if (resizeEnabled) {\n            require(resizeHandle != null) {\n                \"Could not find child (panel_resize_handle) with id: ${resizeHandleResId.toResourceName()}\"\n            }\n        }\n    }\n\n    override fun addView(child: View, index: Int, params: ViewGroup.LayoutParams?) {\n        super.addView(child, index, params)\n\n        child.findViewById<View>(contentResId)?.let {\n            content = it\n        }\n        child.findViewById<View>(panelResId)?.let {\n            panelView = it\n            moveHandle = it.findViewById(moveHandleResId)\n        }\n        if (resizeEnabled) {\n            child.findViewById<View>(resizeHandleResId)?.let {\n                resizeHandle = it\n            }\n        }\n    }\n\n    private fun restorePanelFromState() = post {\n        if (!panelState.isVisible) {\n            panelView.isVisible = false\n        } else if (panelState.snap == FLOATING) {\n            // Restore size\n            val (withWidth, withHeight) = panelState.size\n\n            // Restore position\n            val toX = panelState.horizontalNearestEdgeDistance.toX(withWidth)\n            val toY = panelState.verticalNearestEdgeDistance.toY(withHeight)\n\n            applyFloatingPanelConstraints(toX, toY, withWidth, withHeight)\n        } else {\n            // Restore snap\n            snapPanelTo(panelState.position)\n        }\n    }\n\n    override fun onSaveInstanceState(): Parcelable? {\n        val superState = super.onSaveInstanceState()\n\n        return bundleOf(\n            PARCELABLE_KEY_SUPER_STATE to superState,\n            PARCELABLE_KEY_PANEL_STATE to panelState\n        )\n    }\n\n    override fun onRestoreInstanceState(state: Parcelable?) {\n        val bundle = state as Bundle\n        panelState = bundle.getParcelable(PARCELABLE_KEY_PANEL_STATE)!!\n        val superState: AbsSavedState? = bundle.getParcelable(PARCELABLE_KEY_SUPER_STATE)\n\n        isPanelStateRestored = true\n\n        super.onRestoreInstanceState(superState)\n    }\n\n    override fun onSizeChanged(w: Int, h: Int, oldw: Int, oldh: Int) {\n        if (panelState.snap == FLOATING) {\n            coercePanelSize()\n        }\n    }\n\n    private fun readAttrs(attrs: AttributeSet?) = attrs?.let {\n        val a = context.obtainStyledAttributes(it, R.styleable.PanelLayout, 0, 0)\n        try {\n            readResizeEnabledAttr(a)\n            readViewReferenceAttrs(a)\n            readMinMaxSizeAttrs(a)\n            readStartSizeAttrs(a)\n            readSnapSizeAttrs(a)\n            readSnapToEdgesAttr(a)\n            readSnapAttrs(a)\n            readOverlayAndAnimationAttrs(a)\n        } finally {\n            a.recycle()\n        }\n    }\n\n    private fun readResizeEnabledAttr(a: TypedArray) {\n        resizeEnabled = a.getBoolean(R.styleable.PanelLayout_panel_resize_enabled, true)\n    }\n\n    private fun readViewReferenceAttrs(a: TypedArray) {\n        panelResId = a.getResourceIdOrThrow(R.styleable.PanelLayout_panel_view)\n        contentResId = a.getResourceIdOrThrow(R.styleable.PanelLayout_panel_content)\n        moveHandleResId = a.getResourceIdOrThrow(R.styleable.PanelLayout_panel_move_handle)\n        resizeHandleResId = a.getResourceId(R.styleable.PanelLayout_panel_resize_handle, -1)\n    }\n\n    private fun readMinMaxSizeAttrs(a: TypedArray) {\n        panelMinWidth = a.getDimensionPixelSize(\n            R.styleable.PanelLayout_panel_min_width,\n            resources.getDimensionPixelSize(R.dimen.panel_default_min_width)\n        )\n        panelMaxWidth = a.getDimensionPixelSize(\n            R.styleable.PanelLayout_panel_max_width,\n            resources.getDimensionPixelSize(R.dimen.panel_default_max_width)\n        )\n        panelMinHeight = a.getDimensionPixelSize(\n            R.styleable.PanelLayout_panel_min_height,\n            resources.getDimensionPixelSize(R.dimen.panel_default_min_height)\n        )\n        panelMaxHeight = a.getDimensionPixelSize(\n            R.styleable.PanelLayout_panel_max_height,\n            resources.getDimensionPixelSize(R.dimen.panel_default_max_height)\n        )\n    }\n\n    private fun readStartSizeAttrs(a: TypedArray) {\n        panelStartWidth = a.getDimensionPixelSize(\n            R.styleable.PanelLayout_panel_start_width,\n            resources.getDimensionPixelSize(R.dimen.panel_default_start_width)\n        )\n        panelStartHeight = a.getDimensionPixelSize(\n            R.styleable.PanelLayout_panel_start_height,\n            resources.getDimensionPixelSize(R.dimen.panel_default_start_height)\n        )\n    }\n\n    private fun readSnapSizeAttrs(a: TypedArray) {\n        panelSnapWidthPercent = a.getFloat(R.styleable.PanelLayout_panel_snap_width_percent, NOT_SET)\n        panelSnapHeightPercent = a.getFloat(R.styleable.PanelLayout_panel_snap_height_percent, NOT_SET)\n\n        if (panelSnapWidthPercent == NOT_SET) {\n            panelSnapWidth = a.getDimension(\n                R.styleable.PanelLayout_panel_snap_width,\n                resources.getDimension(R.dimen.panel_default_snap_width)\n            )\n        }\n\n        if (panelSnapHeightPercent == NOT_SET) {\n            panelSnapHeight = a.getDimension(\n                R.styleable.PanelLayout_panel_snap_height,\n                resources.getDimension(R.dimen.panel_default_snap_height)\n            )\n        }\n    }\n\n    private fun readSnapToEdgesAttr(a: TypedArray) {\n        snapToEdges = a.getInt(\n            R.styleable.PanelLayout_panel_snap_to_edges,\n            R.integer.panel_default_snap_edges\n        )\n    }\n\n    private fun readSnapAttrs(a: TypedArray) {\n        snapLeftLayout = a.getResourceId(\n            R.styleable.PanelLayout_panel_snap_left_layout,\n            R.layout.panel_view_default_snap_left\n        )\n        snapTopLayout = a.getResourceId(\n            R.styleable.PanelLayout_panel_snap_top_layout,\n            R.layout.panel_view_default_snap_top\n        )\n        snapRightLayout = a.getResourceId(\n            R.styleable.PanelLayout_panel_snap_right_layout,\n            R.layout.panel_view_default_snap_right\n        )\n        snapBottomLayout = a.getResourceId(\n            R.styleable.PanelLayout_panel_snap_bottom_layout,\n            R.layout.panel_view_default_snap_bottom\n        )\n    }\n\n    private fun readOverlayAndAnimationAttrs(a: TypedArray) {\n        snapAnimationDuration = a.getInt(\n            R.styleable.PanelLayout_panel_snap_animation_duration,\n            resources.getInteger(R.integer.panel_default_snap_animation_duration)\n        ).toLong()\n        snapOverlayAnimationDuration = a.getInt(\n            R.styleable.PanelLayout_panel_snap_overlay_animation_duration,\n            resources.getInteger(R.integer.panel_default_snap_overlay_animation_duration)\n        ).toLong()\n        snapOverlayColor = a.getResourceId(\n            R.styleable.PanelLayout_panel_snap_overlay_color,\n            R.color.panel_default_snap_overlay_color\n        )\n    }\n\n    private fun setUpOverlays() {\n        for (overlay in arrayOf(leftOverlay, topOverlay, rightOverlay, bottomOverlay)) {\n            overlay.background = ContextCompat.getColor(context, snapOverlayColor).toDrawable()\n            overlay.alpha = 0f\n            overlay.layoutParams = LayoutParams(1, 1) // create square 1px x 1px to scale later.\n            overlay.elevation = 2f\n            addView(overlay)\n        }\n    }\n\n    private fun setTouchListeners() {\n        setOnTouchListener { v: View, event: MotionEvent ->\n            when (touchSubject) {\n                moveHandle -> when (panelState.snap) {\n                    FLOATING -> moveSnapListener.onTouch(v, event)\n                    SNAPPED -> popListener.onTouch(v, event)\n                    else -> false\n                }\n                resizeHandle -> when (panelState.snap) {\n                    FLOATING -> resizeListener.onTouch(v, event)\n                    else -> false\n                }\n                else -> false\n            }\n        }\n    }\n\n    override fun onInterceptTouchEvent(event: MotionEvent): Boolean {\n        when (event.actionMasked) {\n            ACTION_DOWN -> {\n                relativeTouchPositionX = event.rawX - panelView.x\n                relativeTouchPositionY = event.rawY - panelView.y\n\n                lastDownEvent = obtain(event)\n\n                if (moveHandle.containsInHitRect(event)) {\n                    touchSubject = moveHandle\n                } else if (resizeEnabled && resizeHandle != null && resizeHandle!!.containsInHitRect(event)) {\n                    touchSubject = resizeHandle!!\n                } else {\n                    touchSubject = null\n                }\n\n                return false\n            }\n            ACTION_MOVE -> {\n                return touchSubject != null && event.isSignificantlyDistantTo(lastDownEvent!!)\n            }\n            ACTION_UP -> {\n                return touchSubject != null && event.isSignificantlyDistantTo(lastDownEvent!!)\n            }\n            ACTION_CANCEL -> {\n                touchSubject = null\n                return false\n            }\n            else -> return false\n        }\n    }\n\n    /**\n     * Imitates a panel resize with zero difference in size.\n     * <p>\n     * This will make sure the panel size is recalculated and limited by the new panelLayout size.\n     * Whenever the keyboard is shown, we resize the panelView to fit into the limited space available.\n     */\n    private fun coercePanelSize() = post {\n        val (updatedWidth, updatedHeight) = calculateNewSize(diffX = 0f, diffY = 0f)\n        resizePanel(updatedWidth, updatedHeight)\n    }\n\n    private fun calculateNewSize(diffX: Float, diffY: Float): Pair<Int, Int> {\n        var updatedWidth =\n            (panelView.width + diffX).roundToInt().coerceIn(panelMinWidth, panelMaxWidth)\n        var updatedHeight =\n            (panelView.height + diffY).roundToInt().coerceIn(panelMinHeight, panelMaxHeight)\n\n        // These negative adjustment values are to prevent resizing out of the panel layout\n        val negativeAdjustmentX = (width - (panelView.x + updatedWidth)).coerceAtMost(0f).roundToInt()\n        val negativeAdjustmentY = (height - (panelView.y + updatedHeight)).coerceAtMost(0f).roundToInt()\n\n        updatedWidth += negativeAdjustmentX\n        updatedHeight += negativeAdjustmentY\n\n        return updatedWidth to updatedHeight\n    }\n\n    private fun resizePanel(updatedWidth: Int, updatedHeight: Int) {\n        val params = panelView.layoutParams as LayoutParams\n        params.width = updatedWidth\n        params.height = updatedHeight\n        panelView.layoutParams = params\n    }\n\n    private fun calculatePositionFor(x: Int, y: Int): PanelPosition {\n        val (left, top, right, bottom) = panelView.moveBounds()\n\n        if (x == left) return LEFT_EDGE\n        if (x == right) return RIGHT_EDGE\n        if (y == top) return TOP_EDGE\n        if (y == bottom) return BOTTOM_EDGE\n        return NO_EDGE\n    }\n\n    private fun showSnapOverlay(snapPosition: PanelPosition) {\n\n        val overlay = snapPosition.overlay()\n        val (touchPointX, touchPointY) = snapPosition.touchPoint()\n        val (scaleX, scaleY) = snapPosition.overlayScale()\n\n        overlay.translationX = touchPointX\n        overlay.translationY = touchPointY\n        overlay.pivotX = touchPointX / width\n        overlay.pivotY = touchPointY / height\n\n        overlay.clearAnimation()\n\n        overlay.animate()\n            .alpha(1f)\n            .scaleX(scaleX)\n            .scaleY(scaleY)\n            .setDuration(snapOverlayAnimationDuration)\n            .setInterpolator(AccelerateDecelerateInterpolator())\n            .start()\n    }\n\n    private fun hideSnapOverlay(snapPosition: PanelPosition) {\n        val overlay = snapPosition.overlay()\n\n        overlay.clearAnimation()\n\n        overlay.animate()\n            .alpha(0f)\n            .scaleX(0f)\n            .scaleY(0f)\n            .setDuration(snapOverlayAnimationDuration)\n            .setInterpolator(AccelerateDecelerateInterpolator())\n            .start()\n    }\n\n    private fun hidePanel() {\n        if (panelState.snap == SNAPPED) {\n            val transition = AutoTransition().apply {\n                interpolator = AccelerateDecelerateInterpolator()\n                duration = snapAnimationDuration\n\n                addListener(object : Transition.TransitionListener {\n                    override fun onTransitionEnd(transition: Transition) {\n                        panelLayoutCallbacks?.afterClose()\n                    }\n\n                    override fun onTransitionStart(transition: Transition) {} // No-op\n                    override fun onTransitionResume(transition: Transition) {} // No-op\n                    override fun onTransitionPause(transition: Transition) {} // No-op\n                    override fun onTransitionCancel(transition: Transition) {} // No-op\n                })\n            }\n\n            TransitionManager.beginDelayedTransition(this, transition)\n        }\n\n        panelView.isVisible = false\n        panelState.isVisible = false\n    }\n\n    private fun showPanel() {\n        panelState.isVisible = true\n\n        restorePanelFromState()\n    }\n\n    override fun popPanelTo(x: Int, y: Int) {\n        panelState.snap = ANIMATING\n\n        val (popWidth, popHeight) = panelState.sanitizedSize()\n\n        val transition = ChangeBounds().apply {\n            interpolator = AccelerateDecelerateInterpolator()\n            duration = snapAnimationDuration\n\n            addListener(object : Transition.TransitionListener {\n                override fun onTransitionStart(transition: Transition) {\n                    panelLayoutCallbacks?.beforePop(x, y)\n                    resizeHandle?.isVisible = true\n                }\n\n                override fun onTransitionEnd(transition: Transition) {\n                    panelLayoutCallbacks?.afterPop(x, y)\n                }\n\n                override fun onTransitionResume(transition: Transition) {} // No-op\n                override fun onTransitionPause(transition: Transition) {} // No-op\n                override fun onTransitionCancel(transition: Transition) {} // No-op\n            })\n        }\n\n        TransitionManager.beginDelayedTransition(this, transition)\n\n        applyFloatingPanelConstraints(x, y, popWidth, popHeight)\n\n        panelState.position = NO_EDGE\n        panelState.snap = FLOATING\n    }\n\n    private fun applyFloatingPanelConstraints(x: Int, y: Int, width: Int, height: Int) = ConstraintSet().apply {\n        clone(this)\n        clear(panelResId)\n        clear(contentResId)\n\n        connect(contentResId, ConstraintSet.LEFT, ConstraintSet.PARENT_ID, ConstraintSet.LEFT)\n        connect(contentResId, ConstraintSet.TOP, ConstraintSet.PARENT_ID, ConstraintSet.TOP)\n        connect(contentResId, ConstraintSet.RIGHT, ConstraintSet.PARENT_ID, ConstraintSet.RIGHT)\n        connect(contentResId, ConstraintSet.BOTTOM, ConstraintSet.PARENT_ID, ConstraintSet.BOTTOM)\n\n        setTranslationX(panelResId, x.toFloat())\n        setTranslationY(panelResId, y.toFloat())\n\n        constrainWidth(panelResId, width)\n        constrainHeight(panelResId, height)\n\n        applyTo(this@PanelLayout)\n    }\n\n    override fun snapPanelTo(panelPosition: PanelPosition) {\n        if (panelState.snap == FLOATING) {\n            switchToMarginPositioning()\n        }\n\n        panelState.snap = ANIMATING\n\n        when (panelPosition) {\n            LEFT_EDGE -> applyConstraintsWithAnimation(snapLeftLayout)\n            RIGHT_EDGE -> applyConstraintsWithAnimation(snapRightLayout)\n            TOP_EDGE -> applyConstraintsWithAnimation(snapTopLayout)\n            BOTTOM_EDGE -> applyConstraintsWithAnimation(snapBottomLayout)\n            NO_EDGE -> throw IllegalArgumentException(\"Cannot snap panel with position NO_EDGE\")\n        }\n    }\n\n    private fun switchToMarginPositioning() {\n        val marginLeft = panelView.translationX.roundToInt()\n        val marginTop = panelView.translationY.roundToInt()\n\n        panelView.translationX = 0f\n        panelView.translationY = 0f\n\n        ConstraintSet().apply {\n            clone(this)\n            connect(panelResId, ConstraintSet.LEFT, ConstraintSet.PARENT_ID, ConstraintSet.LEFT, marginLeft)\n            connect(panelResId, ConstraintSet.TOP, ConstraintSet.PARENT_ID, ConstraintSet.TOP, marginTop)\n            applyTo(this@PanelLayout)\n        }\n    }\n\n    private fun applyConstraintsWithAnimation(layoutResId: Int) = post {\n        val constraintSet = ConstraintSet()\n        constraintSet.load(context, layoutResId)\n\n        val transition = AutoTransition().apply {\n            interpolator = AccelerateDecelerateInterpolator()\n            duration = snapAnimationDuration\n\n            addListener(object : Transition.TransitionListener {\n                override fun onTransitionStart(transition: Transition) {\n                    panelLayoutCallbacks?.beforeSnap(panelState.position)\n                    resizeHandle?.isVisible = false\n                }\n\n                override fun onTransitionEnd(transition: Transition) {\n                    panelLayoutCallbacks?.afterSnap(panelState.position)\n                }\n\n                override fun onTransitionResume(transition: Transition) {} // No-op\n                override fun onTransitionPause(transition: Transition) {} // No-op\n                override fun onTransitionCancel(transition: Transition) {} // No-op\n            })\n        }\n\n        TransitionManager.beginDelayedTransition(this, transition)\n\n        constraintSet.applyTo(this)\n        panelState.snap = SNAPPED\n    }\n\n    private fun PanelPosition.isSnapEnabled() = snapToEdges.hasFlag(this.snapFlag())\n\n    private fun PanelPosition.snapFlag() = when (this) {\n        LEFT_EDGE -> SNAP_TO_LEFT\n        RIGHT_EDGE -> SNAP_TO_RIGHT\n        TOP_EDGE -> SNAP_TO_TOP\n        BOTTOM_EDGE -> SNAP_TO_BOTTOM\n        NO_EDGE -> throw IllegalArgumentException(\"You cannot get a snapFlag for PanelState.Position.NO_EDGE\")\n    }\n\n    private fun PanelPosition.overlay() = when (this) {\n        LEFT_EDGE -> leftOverlay\n        RIGHT_EDGE -> rightOverlay\n        TOP_EDGE -> topOverlay\n        BOTTOM_EDGE -> bottomOverlay\n        NO_EDGE -> throw IllegalArgumentException(\"You cannot get an overlay for PanelState.Position.NO_EDGE\")\n    }\n\n    private fun PanelPosition.overlayScale() = when (this) {\n        LEFT_EDGE,\n        RIGHT_EDGE -> preferredSnapWidth to height.toFloat() + 1\n        TOP_EDGE,\n        BOTTOM_EDGE -> width.toFloat() + 1 to preferredSnapHeight\n        NO_EDGE -> throw IllegalArgumentException(\"You cannot get an overlayScale for PanelState.Position.NO_EDGE\")\n    }\n\n    private fun PanelPosition.touchPoint() = when (this) {\n        LEFT_EDGE -> 0f to panelView.centerY()\n        RIGHT_EDGE -> width.toFloat() to panelView.centerY()\n        TOP_EDGE -> panelView.centerX() to 0f\n        BOTTOM_EDGE -> panelView.centerX() to height.toFloat()\n        NO_EDGE -> throw IllegalArgumentException(\"You cannot get an touchPoint for PanelState.Position.NO_EDGE\")\n    }\n\n    private fun View.centerX() = x + width / 2f\n\n    private fun View.centerY() = y + height / 2f\n\n    private fun PanelState.sanitizedSize(): Pair<Int, Int> {\n        val (savedWidth, savedHeight) = size\n\n        val w = when (savedWidth) {\n            -1 -> panelStartWidth\n            else -> savedWidth.coerceAtMost(width)\n        }\n\n        val h = when (savedHeight) {\n            -1 -> panelStartHeight\n            else -> savedHeight.coerceAtMost(height)\n        }\n\n        return w to h\n    }\n\n    private fun PanelState.HorizontalEdgeDistance.toX(panelWidth: Int) = when (this.edge) {\n        LEFT -> distance\n        RIGHT -> width - panelWidth - distance\n    }\n\n    private fun PanelState.VerticalEdgeDistance.toY(panelHeight: Int) = when (this.edge) {\n        TOP -> distance\n        BOTTOM -> height - panelHeight - distance\n    }\n\n    private fun View.calculateHorizontalNearestEdgeDistance(): PanelState.HorizontalEdgeDistance {\n        val leftDistance = this.x.roundToInt()\n        val rightDistance = this@PanelLayout.width - this.x.roundToInt() - this.width\n\n        return if (leftDistance <= rightDistance) {\n            PanelState.HorizontalEdgeDistance(LEFT, leftDistance)\n        } else {\n            PanelState.HorizontalEdgeDistance(RIGHT, rightDistance)\n        }\n    }\n\n    private fun View.calculateVerticalNearestEdgeDistance(): PanelState.VerticalEdgeDistance {\n        val topDistance = this.y.roundToInt()\n        val bottomDistance = this@PanelLayout.height - this.y.roundToInt() - this.height\n\n        return if (topDistance <= bottomDistance) {\n            PanelState.VerticalEdgeDistance(TOP, topDistance)\n        } else {\n            PanelState.VerticalEdgeDistance(BOTTOM, bottomDistance)\n        }\n    }\n\n    // Calculates move bounds given (width to height) pair in PanelLayout\n    private fun Pair<Int, Int>.moveBounds(offset: Int = 0): Rect {\n        val (childWidth, childHeight) = this\n\n        val minX = 0 + offset\n        val minY = 0 + offset\n        val maxX = (width - childWidth - offset).coerceAtLeast(minX)\n        val maxY = (height - childHeight - offset).coerceAtLeast(minY)\n\n        return Rect(minX, minY, maxX, maxY)\n    }\n\n    private fun View.moveBounds(): Rect = (width to height).moveBounds()\n\n    private fun MotionEvent.isSignificantlyDistantTo(other: MotionEvent): Boolean {\n        val deltaX = other.rawX - this.rawX\n        val deltaY = other.rawY - this.rawY\n\n        return sqrt(deltaX * deltaX + deltaY * deltaY) > ViewConfiguration.get(context).scaledTouchSlop\n    }\n\n    private fun View.containsInHitRect(event: MotionEvent) = offsetHitRectToAscendant(this@PanelLayout)\n        .contains(event.x.toInt(), event.y.toInt())\n\n    private fun View.offsetHitRectToAscendant(ascendant: View): Rect {\n        val hitRect = Rect()\n        this.getHitRect(hitRect)\n\n        var iterator = parent as View\n\n        while (iterator != ascendant) {\n            hitRect.offset(iterator.x.toInt(), iterator.y.toInt())\n            iterator = iterator.parent as View\n        }\n\n        return hitRect\n    }\n\n    private inner class PanelMoveSnapListener : OnTouchListener {\n        override fun onTouch(v: View, event: MotionEvent): Boolean {\n            return when (event.action) {\n                ACTION_DOWN -> true\n                ACTION_MOVE -> handleActionMove(event)\n                ACTION_UP -> handleActionUp()\n                else -> false\n            }\n        }\n\n        private fun handleActionMove(event: MotionEvent): Boolean {\n            val (left, top, right, bottom) = panelView.moveBounds()\n\n            val nextX = (event.rawX - relativeTouchPositionX).roundToInt().coerceIn(left, right)\n            val nextY = (event.rawY - relativeTouchPositionY).roundToInt().coerceIn(top, bottom)\n\n            val currentPosition = panelState.position\n            val nextPosition = calculatePositionFor(nextX, nextY)\n            panelState.position = nextPosition\n\n            handleSnapOverlayAnimation(currentPosition, nextPosition)\n            movePanelTo(nextX, nextY)\n\n            return true\n        }\n\n        private fun handleActionUp(): Boolean {\n            if (panelState.position != NO_EDGE && panelState.position.isSnapEnabled()) {\n                hideSnapOverlay(panelState.position)\n                snapPanelTo(panelState.position)\n            }\n\n            touchSubject = null\n            return true\n        }\n\n        // Checking current and next positions shows or hides snap overlays with animation\n        private fun handleSnapOverlayAnimation(\n            currentPosition: PanelPosition,\n            nextPosition: PanelPosition\n        ) {\n            for (position in values()) {\n                if (position == NO_EDGE) continue\n                if (position.isSnapEnabled().not()) continue\n\n                if (currentPosition != position && nextPosition == position) {\n                    showSnapOverlay(position)\n                }\n\n                if (currentPosition == position && nextPosition != position) {\n                    hideSnapOverlay(position)\n                }\n            }\n        }\n\n        private fun movePanelTo(destinationX: Int, destinationY: Int) {\n            panelView.animate()\n                .translationX(destinationX.toFloat())\n                .translationY(destinationY.toFloat())\n                .setDuration(0)\n                .withEndAction {\n                    panelState.horizontalNearestEdgeDistance = panelView.calculateHorizontalNearestEdgeDistance()\n                    panelState.verticalNearestEdgeDistance = panelView.calculateVerticalNearestEdgeDistance()\n                }\n                .start()\n        }\n    }\n\n    private inner class PanelPopListener : OnTouchListener {\n        override fun onTouch(v: View, event: MotionEvent): Boolean {\n            return when (event.action) {\n                ACTION_DOWN -> true\n                ACTION_MOVE -> handleActionMove(event)\n                ACTION_UP -> handleActionUp()\n                else -> false\n            }\n        }\n\n        private fun handleActionMove(event: MotionEvent): Boolean {\n            relativeTouchPositionX = event.rawX - panelView.x\n            relativeTouchPositionY = event.rawY - panelView.y\n\n            val (popWidth, popHeight) = panelState.sanitizedSize()\n\n            val nextRelativeTouchPositionX = relativeTouchPositionX / panelView.width * popWidth\n            val nextRelativeTouchPositionY = relativeTouchPositionY / panelView.height * popHeight\n\n            val (left, top, right, bottom) = (popWidth to popHeight).moveBounds(offset = PANEL_POP_OFFSET)\n\n            val popToX = (event.rawX - nextRelativeTouchPositionX).roundToInt().coerceIn(left, right)\n            val popToY = (event.rawY - nextRelativeTouchPositionY).roundToInt().coerceIn(top, bottom)\n\n            popPanelTo(popToX, popToY)\n\n            relativeTouchPositionX = event.rawX - popToX\n            relativeTouchPositionY = event.rawY - popToY\n\n            return true\n        }\n\n        private fun handleActionUp(): Boolean {\n            touchSubject = null\n            return true\n        }\n    }\n\n    private inner class PanelResizeListener : OnTouchListener {\n        private var previousX = NOT_SET\n        private var previousY = NOT_SET\n\n        override fun onTouch(v: View, event: MotionEvent): Boolean {\n            return when (event.action) {\n                ACTION_DOWN -> true\n                ACTION_MOVE -> handleActionMove(event)\n                ACTION_UP -> handleActionUp()\n                else -> false\n            }\n        }\n\n        private fun handleActionMove(event: MotionEvent): Boolean {\n            if (previousX == NOT_SET || previousY == NOT_SET) {\n                previousX = lastDownEvent!!.rawX\n                previousY = lastDownEvent!!.rawY\n            }\n\n            val diffX = event.rawX - previousX\n            val diffY = event.rawY - previousY\n\n            val (updatedWidth, updatedHeight) = calculateNewSize(diffX, diffY)\n\n            resizePanel(updatedWidth, updatedHeight)\n\n            panelState.size = updatedWidth to updatedHeight\n\n            previousX = event.rawX\n            previousY = event.rawY\n\n            return true\n        }\n\n        private fun handleActionUp(): Boolean {\n            previousX = NOT_SET\n            previousY = NOT_SET\n            touchSubject = null\n            return true\n        }\n    }\n\n    interface Callbacks {\n        fun beforeSnap(position: PanelPosition)\n        fun afterSnap(position: PanelPosition)\n        fun beforePop(popToX: Int, popToY: Int)\n        fun afterPop(popToX: Int, popToY: Int)\n        fun afterClose()\n    }\n\n    companion object {\n        private const val NOT_SET = -1f\n        private const val PANEL_POP_OFFSET = 4 // distance from edges when panelState is popped. in pixels\n        private const val PARCELABLE_KEY_SUPER_STATE = \"superState\"\n        private const val PARCELABLE_KEY_PANEL_STATE = \"panelState\"\n\n        // Possible flags for snapToEdges\n        private const val SNAP_TO_LEFT = 1\n        private const val SNAP_TO_TOP = 2\n        private const val SNAP_TO_RIGHT = 4\n        private const val SNAP_TO_BOTTOM = 8\n\n        private fun Int.hasFlag(flag: Int) = (this and flag) == flag\n    }\n}\n"
  },
  {
    "path": "panellayout/src/main/java/com/wayfair/panellayout/PanelLayoutCommands.kt",
    "content": "package com.wayfair.panellayout\n\ninternal interface PanelLayoutCommands {\n    var panelLayoutCallbacks: PanelLayout.Callbacks?\n    var panelVisible: Boolean\n\n    fun snapPanelTo(panelPosition: PanelPosition)\n    fun popPanelTo(x: Int, y: Int)\n}\n"
  },
  {
    "path": "panellayout/src/main/java/com/wayfair/panellayout/PanelPosition.kt",
    "content": "package com.wayfair.panellayout\n\nenum class PanelPosition {\n    LEFT_EDGE, RIGHT_EDGE, TOP_EDGE, BOTTOM_EDGE, NO_EDGE\n}\n"
  },
  {
    "path": "panellayout/src/main/java/com/wayfair/panellayout/PanelState.kt",
    "content": "package com.wayfair.panellayout\n\nimport android.os.Parcelable\nimport com.wayfair.panellayout.PanelState.HorizontalEdge.LEFT\nimport com.wayfair.panellayout.PanelState.VerticalEdge.TOP\nimport kotlinx.android.parcel.Parcelize\n\n@Parcelize\ndata class PanelState(\n    var isVisible: Boolean = true,\n    var snap: Snap = Snap.FLOATING,\n    var size: Pair<Int, Int> = -1 to -1,\n    var position: PanelPosition = PanelPosition.NO_EDGE,\n    var horizontalNearestEdgeDistance: HorizontalEdgeDistance = HorizontalEdgeDistance(edge = LEFT, distance = 0),\n    var verticalNearestEdgeDistance: VerticalEdgeDistance = VerticalEdgeDistance(edge = TOP, distance = 0)\n) : Parcelable {\n\n    @Parcelize\n    data class HorizontalEdgeDistance(val edge: HorizontalEdge, val distance: Int) : Parcelable\n\n    @Parcelize\n    data class VerticalEdgeDistance(val edge: VerticalEdge, val distance: Int) : Parcelable\n\n    enum class HorizontalEdge {\n        LEFT, RIGHT\n    }\n\n    enum class VerticalEdge {\n        TOP, BOTTOM\n    }\n\n    enum class Snap {\n        FLOATING, ANIMATING, SNAPPED\n    }\n}\n"
  },
  {
    "path": "panellayout/src/main/res/layout/panel_view_default_snap_bottom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<androidx.constraintlayout.widget.ConstraintLayout 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:id=\"@+id/panelLayout\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    tools:ignore=\"WrongConstraintLayoutUsage\">\n\n    <View\n        android:id=\"@+id/content\"\n        android:layout_width=\"0dp\"\n        android:layout_height=\"0dp\"\n        app:layout_constraintBottom_toTopOf=\"@id/panel\"\n        app:layout_constraintLeft_toLeftOf=\"parent\"\n        app:layout_constraintRight_toRightOf=\"parent\"\n        app:layout_constraintTop_toTopOf=\"parent\"\n        tools:background=\"#ABC\" />\n\n    <View\n        android:id=\"@+id/panel\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"@dimen/panel_default_snap_height\"\n        app:layout_constraintBottom_toBottomOf=\"parent\"\n        app:layout_constraintLeft_toLeftOf=\"parent\"\n        app:layout_constraintRight_toRightOf=\"parent\" />\n</androidx.constraintlayout.widget.ConstraintLayout>"
  },
  {
    "path": "panellayout/src/main/res/layout/panel_view_default_snap_left.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<androidx.constraintlayout.widget.ConstraintLayout 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:id=\"@+id/panelLayout\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    tools:ignore=\"WrongConstraintLayoutUsage\">\n\n    <View\n        android:id=\"@+id/content\"\n        android:layout_width=\"0dp\"\n        android:layout_height=\"0dp\"\n        app:layout_constraintBottom_toBottomOf=\"parent\"\n        app:layout_constraintLeft_toRightOf=\"@id/panel\"\n        app:layout_constraintRight_toRightOf=\"parent\"\n        app:layout_constraintTop_toTopOf=\"parent\"\n        tools:background=\"#ABC\" />\n\n    <View\n        android:id=\"@+id/panel\"\n        android:layout_width=\"@dimen/panel_default_snap_width\"\n        android:layout_height=\"match_parent\"\n        app:layout_constraintBottom_toBottomOf=\"parent\"\n        app:layout_constraintLeft_toLeftOf=\"parent\"\n        app:layout_constraintTop_toTopOf=\"parent\" />\n</androidx.constraintlayout.widget.ConstraintLayout>\n"
  },
  {
    "path": "panellayout/src/main/res/layout/panel_view_default_snap_right.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<androidx.constraintlayout.widget.ConstraintLayout 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:id=\"@+id/panelLayout\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    tools:ignore=\"WrongConstraintLayoutUsage\">\n\n    <View\n        android:id=\"@+id/content\"\n        android:layout_width=\"0dp\"\n        android:layout_height=\"0dp\"\n        app:layout_constraintBottom_toBottomOf=\"parent\"\n        app:layout_constraintLeft_toLeftOf=\"parent\"\n        app:layout_constraintRight_toLeftOf=\"@id/panel\"\n        app:layout_constraintTop_toTopOf=\"parent\"\n        tools:background=\"#ABC\" />\n\n    <View\n        android:id=\"@+id/panel\"\n        android:layout_width=\"@dimen/panel_default_snap_width\"\n        android:layout_height=\"match_parent\"\n        app:layout_constraintBottom_toBottomOf=\"parent\"\n        app:layout_constraintRight_toRightOf=\"parent\"\n        app:layout_constraintTop_toTopOf=\"parent\" />\n</androidx.constraintlayout.widget.ConstraintLayout>"
  },
  {
    "path": "panellayout/src/main/res/layout/panel_view_default_snap_top.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<androidx.constraintlayout.widget.ConstraintLayout 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:id=\"@+id/panelLayout\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    tools:ignore=\"WrongConstraintLayoutUsage\">\n\n    <View\n        android:id=\"@+id/content\"\n        android:layout_width=\"0dp\"\n        android:layout_height=\"0dp\"\n        app:layout_constraintBottom_toBottomOf=\"parent\"\n        app:layout_constraintLeft_toLeftOf=\"parent\"\n        app:layout_constraintRight_toRightOf=\"parent\"\n        app:layout_constraintTop_toBottomOf=\"@id/panel\"\n        tools:background=\"#ABC\" />\n\n    <View\n        android:id=\"@+id/panel\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"@dimen/panel_default_snap_height\"\n        app:layout_constraintLeft_toLeftOf=\"parent\"\n        app:layout_constraintRight_toRightOf=\"parent\"\n        app:layout_constraintTop_toTopOf=\"parent\" />\n</androidx.constraintlayout.widget.ConstraintLayout>"
  },
  {
    "path": "panellayout/src/main/res/values/panel_attrs.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n\n    <declare-styleable name=\"PanelLayout\">\n\n        <attr name=\"panel_view\" format=\"reference\" />\n        <attr name=\"panel_content\" format=\"reference\" />\n        <attr name=\"panel_move_handle\" format=\"reference\" />\n        <attr name=\"panel_resize_handle\" format=\"reference\" />\n\n        <attr name=\"panel_resize_enabled\" format=\"boolean\" />\n\n        <attr name=\"panel_min_width\" format=\"dimension\" />\n        <attr name=\"panel_max_width\" format=\"dimension\" />\n        <attr name=\"panel_min_height\" format=\"dimension\" />\n        <attr name=\"panel_max_height\" format=\"dimension\" />\n        <attr name=\"panel_start_width\" format=\"dimension\" />\n        <attr name=\"panel_start_height\" format=\"dimension\" />\n        <attr name=\"panel_snap_width\" format=\"dimension\" />\n        <attr name=\"panel_snap_height\" format=\"dimension\" />\n\n        <attr name=\"panel_snap_width_percent\" format=\"float\" />\n        <attr name=\"panel_snap_height_percent\" format=\"float\" />\n\n        <attr name=\"panel_snap_animation_duration\" format=\"integer\" />\n        <attr name=\"panel_snap_overlay_animation_duration\" format=\"integer\" />\n\n        <attr name=\"panel_snap_overlay_color\" format=\"color\" />\n\n        <attr name=\"panel_snap_to_edges\">\n            <flag name=\"none\" value=\"0\" />\n            <flag name=\"left\" value=\"1\" />\n            <flag name=\"top\" value=\"2\" />\n            <flag name=\"right\" value=\"4\" />\n            <flag name=\"bottom\" value=\"8\" />\n            <flag name=\"all\" value=\"15\" />\n        </attr>\n\n        <attr name=\"panel_snap_top_layout\" format=\"reference\" />\n        <attr name=\"panel_snap_right_layout\" format=\"reference\" />\n        <attr name=\"panel_snap_bottom_layout\" format=\"reference\" />\n        <attr name=\"panel_snap_left_layout\" format=\"reference\" />\n\n    </declare-styleable>\n</resources>"
  },
  {
    "path": "panellayout/src/main/res/values/panel_colors.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n    <color name=\"panel_default_snap_overlay_color\">#802196F3</color>\n</resources>"
  },
  {
    "path": "panellayout/src/main/res/values/panel_dimens.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n    <dimen name=\"panel_default_min_width\">100dp</dimen>\n    <dimen name=\"panel_default_max_width\">600dp</dimen>\n    <dimen name=\"panel_default_min_height\">100dp</dimen>\n    <dimen name=\"panel_default_max_height\">600dp</dimen>\n    <dimen name=\"panel_default_start_width\">320dp</dimen>\n    <dimen name=\"panel_default_start_height\">480dp</dimen>\n    <dimen name=\"panel_default_snap_width\">300dp</dimen>\n    <dimen name=\"panel_default_snap_height\">300dp</dimen>\n</resources>"
  },
  {
    "path": "panellayout/src/main/res/values/panel_integers.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n    <integer name=\"panel_default_snap_edges\">15</integer> <!-- snap to all -->\n    <integer name=\"panel_default_snap_animation_duration\">300</integer>\n    <integer name=\"panel_default_snap_overlay_animation_duration\">300</integer>\n</resources>"
  },
  {
    "path": "settings.gradle",
    "content": "include ':app', ':panellayout'\nrootProject.name = \"Panel Layout\"\n"
  }
]