[
  {
    "path": ".gitignore",
    "content": "*.iml\n.gradle\n/local.properties\n/.idea/workspace.xml\n/.idea/libraries\n.DS_Store\n/build\n/captures\n.externalNativeBuild\n"
  },
  {
    "path": ".idea/codeStyles/Project.xml",
    "content": "<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>"
  },
  {
    "path": ".idea/compiler.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"CompilerConfiguration\">\n    <resourceExtensions />\n    <wildcardResourcePatterns>\n      <entry name=\"!?*.java\" />\n      <entry name=\"!?*.form\" />\n      <entry name=\"!?*.class\" />\n      <entry name=\"!?*.groovy\" />\n      <entry name=\"!?*.scala\" />\n      <entry name=\"!?*.flex\" />\n      <entry name=\"!?*.kt\" />\n      <entry name=\"!?*.clj\" />\n      <entry name=\"!?*.aj\" />\n    </wildcardResourcePatterns>\n    <annotationProcessing>\n      <profile default=\"true\" name=\"Default\" enabled=\"false\">\n        <processorPath useClasspath=\"true\" />\n      </profile>\n    </annotationProcessing>\n  </component>\n</project>"
  },
  {
    "path": ".idea/copyright/profiles_settings.xml",
    "content": "<component name=\"CopyrightManager\">\n  <settings default=\"\" />\n</component>"
  },
  {
    "path": ".idea/gradle.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"GradleSettings\">\n    <option name=\"linkedExternalProjectsSettings\">\n      <GradleProjectSettings>\n        <option name=\"distributionType\" value=\"DEFAULT_WRAPPED\" />\n        <option name=\"externalProjectPath\" value=\"$PROJECT_DIR$\" />\n        <option name=\"modules\">\n          <set>\n            <option value=\"$PROJECT_DIR$\" />\n            <option value=\"$PROJECT_DIR$/app\" />\n            <option value=\"$PROJECT_DIR$/boardview\" />\n          </set>\n        </option>\n        <option name=\"resolveModulePerSourceSet\" value=\"false\" />\n      </GradleProjectSettings>\n    </option>\n  </component>\n</project>"
  },
  {
    "path": ".idea/inspectionProfiles/Project_Default.xml",
    "content": "<component name=\"InspectionProjectProfileManager\">\n  <profile version=\"1.0\">\n    <option name=\"myName\" value=\"Project Default\" />\n    <inspection_tool class=\"AndroidLintNewApi\" enabled=\"false\" level=\"ERROR\" enabled_by_default=\"false\" />\n    <inspection_tool class=\"LoggerInitializedWithForeignClass\" enabled=\"false\" level=\"WARNING\" enabled_by_default=\"false\">\n      <option name=\"loggerClassName\" value=\"org.apache.log4j.Logger,org.slf4j.LoggerFactory,org.apache.commons.logging.LogFactory,java.util.logging.Logger\" />\n      <option name=\"loggerFactoryMethodName\" value=\"getLogger,getLogger,getLog,getLogger\" />\n    </inspection_tool>\n  </profile>\n</component>"
  },
  {
    "path": ".idea/inspectionProfiles/profiles_settings.xml",
    "content": "<component name=\"InspectionProjectProfileManager\">\n  <settings>\n    <option name=\"PROJECT_PROFILE\" value=\"Project Default\" />\n    <option name=\"USE_PROJECT_PROFILE\" value=\"true\" />\n    <version value=\"1.0\" />\n  </settings>\n</component>"
  },
  {
    "path": ".idea/misc.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"NullableNotNullManager\">\n    <option name=\"myDefaultNullable\" value=\"android.support.annotation.Nullable\" />\n    <option name=\"myDefaultNotNull\" value=\"android.support.annotation.NonNull\" />\n    <option name=\"myNullables\">\n      <value>\n        <list size=\"4\">\n          <item index=\"0\" class=\"java.lang.String\" itemvalue=\"org.jetbrains.annotations.Nullable\" />\n          <item index=\"1\" class=\"java.lang.String\" itemvalue=\"javax.annotation.Nullable\" />\n          <item index=\"2\" class=\"java.lang.String\" itemvalue=\"edu.umd.cs.findbugs.annotations.Nullable\" />\n          <item index=\"3\" class=\"java.lang.String\" itemvalue=\"android.support.annotation.Nullable\" />\n        </list>\n      </value>\n    </option>\n    <option name=\"myNotNulls\">\n      <value>\n        <list size=\"4\">\n          <item index=\"0\" class=\"java.lang.String\" itemvalue=\"org.jetbrains.annotations.NotNull\" />\n          <item index=\"1\" class=\"java.lang.String\" itemvalue=\"javax.annotation.Nonnull\" />\n          <item index=\"2\" class=\"java.lang.String\" itemvalue=\"edu.umd.cs.findbugs.annotations.NonNull\" />\n          <item index=\"3\" class=\"java.lang.String\" itemvalue=\"android.support.annotation.NonNull\" />\n        </list>\n      </value>\n    </option>\n  </component>\n  <component name=\"ProjectRootManager\" version=\"2\" languageLevel=\"JDK_1_7\" default=\"true\" 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  <component name=\"masterDetails\">\n    <states>\n      <state key=\"ProjectJDKs.UI\">\n        <settings>\n          <last-edited>1.8</last-edited>\n          <splitter-proportions>\n            <option name=\"proportions\">\n              <list>\n                <option value=\"0.2\" />\n              </list>\n            </option>\n          </splitter-proportions>\n        </settings>\n      </state>\n    </states>\n  </component>\n</project>"
  },
  {
    "path": ".idea/modules.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"ProjectModuleManager\">\n    <modules>\n      <module fileurl=\"file://$PROJECT_DIR$/BoardView.iml\" filepath=\"$PROJECT_DIR$/BoardView.iml\" />\n      <module fileurl=\"file://$PROJECT_DIR$/app/app.iml\" filepath=\"$PROJECT_DIR$/app/app.iml\" />\n      <module fileurl=\"file://$PROJECT_DIR$/boardview/boardview.iml\" filepath=\"$PROJECT_DIR$/boardview/boardview.iml\" />\n    </modules>\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": "LICENSE",
    "content": "                                 Apache License\n                           Version 2.0, January 2004\n                        http://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n   APPENDIX: How to apply the Apache License to your work.\n\n      To apply the Apache License to your work, attach the following\n      boilerplate notice, with the fields enclosed by brackets \"{}\"\n      replaced with your own identifying information. (Don't include\n      the brackets!)  The text should be enclosed in the appropriate\n      comment syntax for the file format. We also recommend that a\n      file or class name and description of purpose be included on the\n      same \"printed page\" as the copyright notice for easier\n      identification within third-party archives.\n\n   Copyright {yyyy} {name of copyright owner}\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n"
  },
  {
    "path": "README.md",
    "content": "[![](https://jitpack.io/v/jakebonk/BoardView.svg)](https://jitpack.io/#jakebonk/BoardView)\n\n# BoardView\nBoardView is a custom view that allows you to be able to re-order items in a list as well as in a board. You can drag and drop items between columns as well as drag and drop columns.\n\n## Example\n\n![Basic Example](https://thumbs.gfycat.com/DeadUntidyHartebeest-size_restricted.gif)\n\n## Download library with Jitpack.io\nAdd this to your build.gradle file for your app.\n```java\n\tallprojects {\n\t\trepositories {\n\t\t\t...\n\t\t\tmaven { url 'https://jitpack.io' }\n\t\t}\n\t}\n```\t\n\nAdd this to your dependencies in build.gradle for your project.\n```java\n\tdependencies {\n\t        implementation 'com.github.jakebonk:BoardView:1.3.6'\n\t}\n```\n## Usage\n\nBoardView utilizes a BoardAdapter, SimpleBoardAdapter is an example of how to extend BoardAdapter.\n```java\n\tBoardView boardView = (BoardView)findViewById(R.id.boardview);\n\tArrayList<SimpleBoardAdapter.SimpleColumn> data = new ArrayList<>();\n        ArrayList<String> list = new ArrayList<String>();\n        list.add(\"Item 1\");\n        list.add(\"Item 2\");\n        list.add(\"Item 3\");\n        list.add(\"Item 4\");\n        data.add(new SimpleBoardAdapter.SimpleColumn(\"Column 1\",list));\n        data.add(new SimpleBoardAdapter.SimpleColumn(\"Column 2\",list));\n        data.add(new SimpleBoardAdapter.SimpleColumn(\"Column 3\",list));\n        data.add(new SimpleBoardAdapter.SimpleColumn(\"Column 4\",list));\n        data.add(new SimpleBoardAdapter.SimpleColumn(\"Column 5\",list));\n        SimpleBoardAdapter boardAdapter = new SimpleBoardAdapter(this,data);\n        boardView.setAdapter(boardAdapter);\n```\nTo manipulate the BoardView simply call one of the new functions in BoardAdapter\n\n```java\nvoid removeColumn(int index)\nvoid removeItem(int column, int index)\nvoid addItem(int column,int index, Object item)\nvoid addColumn(int index, Column column)\n```\n\nI also added the ability to set Transition animations when adding items/columns.\n\n```java\n void SetColumnTransition(Transition t)\n void SetItemTransition(Transition t)\n```\n\nThere are two types of drag listeners, the first is for columns\n```java\n\t boardView.setOnDragColumnListener(new BoardView.DragColumnStartCallback() {\n            @Override\n            public void startDrag(View view, int startColumnPos) {\n\n            }\n\n            @Override\n            public void changedPosition(View view, int startColumnPos, int newColumnPos) {\n\n            }\n\t    \n\t    @Override\n            public void dragging(View itemView, MotionEvent event) {\n                \n            }\n\n            @Override\n            public void endDrag(View view, int startColumnPos, int endColumnPos) {\n\n            }\n        });\n```\nSimilarly we can get the drag listener for items\n```java\n\t boardView.setOnDragItemListener(new BoardView.DragItemStartCallback() {\n            @Override\n            public void startDrag(View view, int startItemPos, int startColumnPos) {\n\n            }\n\n            @Override\n            public void changedPosition(View view, int startItemPos, int startColumnPos, int newItemPos, int newColumnPos) {\n\n            }\n\t    \n\t     @Override\n            public void dragging(View itemView, MotionEvent event) {\n\t    \n            }\n\n            @Override\n            public void endDrag(View view, int startItemPos, int startColumnPos, int endItemPos, int endColumnPos) {\n\n            }\n        });\n```\n\nThere is also a listener for when the BoardView has finished creating and assigning its views.\n\n```java \n\n\t boardView.setOnDoneListener(new BoardView.DoneListener() {\n            @Override\n            public void onDone() {\n                Log.e(\"ee\",\"Done\");\n            }\n        });\n\n```\n\nThis is how to set the click listener for a item, header and footer, which gives their respective positions.\n\t\n```java\n\t\n\tboardView.setOnItemClickListener(new BoardView.ItemClickListener() {\n            @Override\n            public void onClick(View v, int column_pos, int item_pos) {\n                \n            }\n        });\n        boardView.setOnHeaderClickListener(new BoardView.HeaderClickListener() {\n            @Override\n            public void onClick(View v, int column_pos) {\n                \n            }\n        });\t\n\tboardView.setOnFooterClickListener(new BoardView.FooterClickListener() {\n            @Override\n            public void onClick(View v, int column_pos) {\n\t    \n            }\n        });\n\n```\n\nBy setting SetColumnSnap you can allow the BoardView to snap to the closest column when scrolling, this is activated by default. To set it back to normal just set it to false\n\n```java\n\nboardView.SetColumnSnap(true);\n\t\n\tor\n\t\nboardView.SetColumnSnap(false);\n\n```\n\t\n### Creating your own BoardAdapter\n\nCreating a custom BoardAdapter is pretty similar to that of a BaseAdapter, the main focus being to create some type of object that help you create your custom views for both headers and items.\nThe adapter also has two new abstract methods called, isColumnLocked when true prevents the column from being draggable. isItemLocked will not allow item to be dragged to or from this column.\n\n```java\n\t@Override\n\tpublic boolean isColumnLocked(int column_position) {\n\t\treturn false;\n\t}\n\n\t@Override\n\tpublic boolean isItemLocked(int column_position) {\t\t\n\t\treturn false;\n\t}\n```\n\nYou can also set the maximum amount of items you want in a list. If -1 is returned then there will be no cap otherwise the returned value will be the cap. The example below allow only 4 items inside any given column.\n\n```java\n@Override\n    public int maxItemCount(int column_position) {\n        return 4;\n    }\n```    \n\n### Things to fix\nThere is a scaling issue when the column is beginning dragging or has ended dragging. I know this is an issue but I don't know of a good way to solve this at the moment. I eventually will fix it but for now I'm putting it on the back burners.\n"
  },
  {
    "path": "app/.gitignore",
    "content": "/build\n"
  },
  {
    "path": "app/build.gradle",
    "content": "apply plugin: 'com.android.application'\n\nandroid {\n    compileSdkVersion 25\n    buildToolsVersion \"25.0.2\"\n    defaultConfig {\n        applicationId \"com.allyants.boardviewexample\"\n        minSdkVersion 15\n        targetSdkVersion 25\n        versionCode 1\n        versionName \"1.0\"\n        testInstrumentationRunner \"android.support.test.runner.AndroidJUnitRunner\"\n    }\n    buildTypes {\n        release {\n            minifyEnabled false\n            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'\n        }\n    }\n}\n\ndependencies {\n    compile fileTree(dir: 'libs', include: ['*.jar'])\n    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {\n        exclude group: 'com.android.support', module: 'support-annotations'\n    })\n    compile 'com.android.support:appcompat-v7:25.3.1'\n    testCompile 'junit:junit:4.12'\n    compile project(path: ':boardview')\n}\n"
  },
  {
    "path": "app/proguard-rules.pro",
    "content": "# Add project specific ProGuard rules here.\n# By default, the flags in this file are appended to flags specified\n# in C:\\Users\\jbonk\\AppData\\Local\\Android\\Sdk/tools/proguard/proguard-android.txt\n# You can edit the include path and order by changing the proguardFiles\n# directive in build.gradle.\n#\n# For more details, see\n#   http://developer.android.com/guide/developing/tools/proguard.html\n\n# Add any project specific keep options here:\n\n# If your project uses WebView with JS, uncomment the following\n# and specify the fully qualified class name to the JavaScript interface\n# class:\n#-keepclassmembers class fqcn.of.javascript.interface.for.webview {\n#   public *;\n#}\n"
  },
  {
    "path": "app/src/androidTest/java/com/allyants/boardviewexample/ExampleInstrumentedTest.java",
    "content": "package com.allyants.boardviewexample;\n\nimport android.content.Context;\nimport android.support.test.InstrumentationRegistry;\nimport android.support.test.runner.AndroidJUnit4;\n\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\n\nimport static org.junit.Assert.*;\n\n/**\n * Instrumentation test, which will execute on an Android device.\n *\n * @see <a href=\"http://d.android.com/tools/testing\">Testing documentation</a>\n */\n@RunWith(AndroidJUnit4.class)\npublic class ExampleInstrumentedTest {\n    @Test\n    public void useAppContext() throws Exception {\n        // Context of the app under test.\n        Context appContext = InstrumentationRegistry.getTargetContext();\n\n        assertEquals(\"com.allyants.boardviewexample\", appContext.getPackageName());\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.allyants.boardviewexample\">\n\n    <application\n        android:allowBackup=\"true\"\n        android:icon=\"@mipmap/ic_launcher\"\n        android:label=\"@string/app_name\"\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>"
  },
  {
    "path": "app/src/main/java/com/allyants/boardviewexample/MainActivity.java",
    "content": "package com.allyants.boardviewexample;\n\nimport android.os.Bundle;\nimport android.support.v7.app.AppCompatActivity;\nimport android.util.Log;\nimport android.view.MotionEvent;\nimport android.view.View;\n\nimport com.allyants.boardview.BoardView;\nimport com.allyants.boardview.Item;\nimport com.allyants.boardview.SimpleBoardAdapter;\n\nimport java.util.ArrayList;\n\npublic class MainActivity extends AppCompatActivity {\n    ArrayList<Item> list = new ArrayList<>();\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_main);\n        final BoardView boardView = (BoardView)findViewById(R.id.boardView);\n        boardView.SetColumnSnap(false);\n        boardView.SetColumnSnap(true);\n        final ArrayList<SimpleBoardAdapter.SimpleColumn> data = new ArrayList<>();\n        list.add(new Item(\"I am a very long list that is not the same size as the others. I am a multiline\"));\n        list.add(new Item(\"Item 1\"));\n        final ArrayList<Item> empty = new ArrayList<>();\n        final ArrayList<Item> test = new ArrayList<>();\n        test.add(new Item(\"Item 1\"));\n        test.add(new Item(\"Item 1\"));\n        test.add(new Item(\"Item 1\"));\n        test.add(new Item(\"Item 1\"));\n        data.add(new SimpleBoardAdapter.SimpleColumn(\"Column 1\",(ArrayList)list));\n        data.add(new SimpleBoardAdapter.SimpleColumn(\"Column 2\",(ArrayList)test));\n        data.add(new SimpleBoardAdapter.SimpleColumn(\"Column 3\",(ArrayList)empty));\n        data.add(new SimpleBoardAdapter.SimpleColumn(\"Column 4\",(ArrayList)empty));\n        data.add(new SimpleBoardAdapter.SimpleColumn(\"Column 5\",(ArrayList)empty));\n        data.add(new SimpleBoardAdapter.SimpleColumn(\"Column 6\",(ArrayList)empty));\n        data.add(new SimpleBoardAdapter.SimpleColumn(\"Column 7\",(ArrayList)empty));\n        final SimpleBoardAdapter boardAdapter = new SimpleBoardAdapter(this,data);\n        boardView.setAdapter(boardAdapter);\n        boardView.setOnDoneListener(new BoardView.DoneListener() {\n            @Override\n            public void onDone() {\n                Log.e(\"scroll\",\"done\");\n            }\n        });\n    }\n\n}\n"
  },
  {
    "path": "app/src/main/res/layout/activity_main.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    android:id=\"@+id/activity_main\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\">\n\n    <com.allyants.boardview.BoardView\n        xmlns:boardview=\"http://schemas.android.com/apk/res-auto/com.allyants.boardview\"\n        boardview:boardItemBackground=\"@color/colorPrimary\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"match_parent\"\n        android:id=\"@+id/boardView\" />\n</RelativeLayout>\n"
  },
  {
    "path": "app/src/main/res/values/colors.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n    <color name=\"colorPrimary\">#3F51B5</color>\n    <color name=\"colorPrimaryDark\">#303F9F</color>\n    <color name=\"colorAccent\">#FF4081</color>\n</resources>\n"
  },
  {
    "path": "app/src/main/res/values/dimens.xml",
    "content": "<resources>\n    <!-- Default screen margins, per the Android Design guidelines. -->\n    <dimen name=\"activity_horizontal_margin\">16dp</dimen>\n    <dimen name=\"activity_vertical_margin\">16dp</dimen>\n</resources>\n"
  },
  {
    "path": "app/src/main/res/values/strings.xml",
    "content": "<resources>\n    <string name=\"app_name\">BoardViewExample</string>\n</resources>\n"
  },
  {
    "path": "app/src/main/res/values/styles.xml",
    "content": "<resources>\n\n    <!-- Base application theme. -->\n    <style name=\"AppTheme\" parent=\"Theme.AppCompat.Light.DarkActionBar\">\n        <!-- Customize your theme here. -->\n        <item name=\"colorPrimary\">@color/colorPrimary</item>\n        <item name=\"colorPrimaryDark\">@color/colorPrimaryDark</item>\n        <item name=\"colorAccent\">@color/colorAccent</item>\n    </style>\n\n</resources>\n"
  },
  {
    "path": "app/src/main/res/values-w820dp/dimens.xml",
    "content": "<resources>\n    <!-- Example customization of dimensions originally defined in res/values/dimens.xml\n         (such as screen margins) for screens with more than 820dp of available width. This\n         would include 7\" and 10\" devices in landscape (~960dp and ~1280dp respectively). -->\n    <dimen name=\"activity_horizontal_margin\">64dp</dimen>\n</resources>\n"
  },
  {
    "path": "app/src/test/java/com/allyants/boardviewexample/ExampleUnitTest.java",
    "content": "package com.allyants.boardviewexample;\n\nimport org.junit.Test;\n\nimport static org.junit.Assert.*;\n\n/**\n * Example local unit test, which will execute on the development machine (host).\n *\n * @see <a href=\"http://d.android.com/tools/testing\">Testing documentation</a>\n */\npublic class ExampleUnitTest {\n    @Test\n    public void addition_isCorrect() throws Exception {\n        assertEquals(4, 2 + 2);\n    }\n}"
  },
  {
    "path": "boardview/.gitignore",
    "content": "/build\n"
  },
  {
    "path": "boardview/build.gradle",
    "content": "apply plugin: 'com.android.library'\n\nandroid {\n    compileSdkVersion 25\n    buildToolsVersion \"25.0.2\"\n\n    defaultConfig {\n        minSdkVersion 15\n        targetSdkVersion 25\n        versionCode 1\n        versionName \"1.0\"\n\n        testInstrumentationRunner \"android.support.test.runner.AndroidJUnitRunner\"\n\n    }\n    buildTypes {\n        release {\n            minifyEnabled false\n            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'\n        }\n    }\n}\n\ndependencies {\n    compile fileTree(dir: 'libs', include: ['*.jar'])\n    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {\n        exclude group: 'com.android.support', module: 'support-annotations'\n    })\n    compile 'com.android.support:appcompat-v7:25.3.1'\n    testCompile 'junit:junit:4.12'\n}\n"
  },
  {
    "path": "boardview/proguard-rules.pro",
    "content": "# Add project specific ProGuard rules here.\n# By default, the flags in this file are appended to flags specified\n# in C:\\Users\\jbonk\\AppData\\Local\\Android\\Sdk/tools/proguard/proguard-android.txt\n# You can edit the include path and order by changing the proguardFiles\n# directive in build.gradle.\n#\n# For more details, see\n#   http://developer.android.com/guide/developing/tools/proguard.html\n\n# Add any project specific keep options here:\n\n# If your project uses WebView with JS, uncomment the following\n# and specify the fully qualified class name to the JavaScript interface\n# class:\n#-keepclassmembers class fqcn.of.javascript.interface.for.webview {\n#   public *;\n#}\n"
  },
  {
    "path": "boardview/src/androidTest/java/com/allyants/boardview/ExampleInstrumentedTest.java",
    "content": "package com.allyants.boardview;\n\nimport android.content.Context;\nimport android.support.test.InstrumentationRegistry;\nimport android.support.test.runner.AndroidJUnit4;\n\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\n\nimport static org.junit.Assert.*;\n\n/**\n * Instrumentation test, which will execute on an Android device.\n *\n * @see <a href=\"http://d.android.com/tools/testing\">Testing documentation</a>\n */\n@RunWith(AndroidJUnit4.class)\npublic class ExampleInstrumentedTest {\n    @Test\n    public void useAppContext() throws Exception {\n        // Context of the app under test.\n        Context appContext = InstrumentationRegistry.getTargetContext();\n\n        assertEquals(\"com.allyants.boardview.test\", appContext.getPackageName());\n    }\n}\n"
  },
  {
    "path": "boardview/src/main/AndroidManifest.xml",
    "content": "<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    package=\"com.allyants.boardview\">\n\n    <application android:allowBackup=\"true\" android:label=\"@string/app_name\"\n        android:supportsRtl=\"true\">\n\n    </application>\n\n</manifest>\n"
  },
  {
    "path": "boardview/src/main/java/com/allyants/boardview/BoardAdapter.java",
    "content": "package com.allyants.boardview;\n\nimport android.content.Context;\nimport android.transition.Fade;\nimport android.transition.Transition;\nimport android.transition.TransitionManager;\nimport android.view.View;\nimport android.view.ViewGroup;\nimport android.widget.LinearLayout;\nimport android.widget.ScrollView;\n\nimport java.util.ArrayList;\n\n/**\n * Created by jbonk on 6/12/2017.\n */\n\npublic abstract class BoardAdapter{\n\n    Context context;\n    Transition transition = new Fade();\n    Transition boardViewTransition = new Fade();\n    public ArrayList<Column> columns = new ArrayList<>();\n    public BoardAdapter(Context context){\n        this.context = context;\n    }\n    public BoardView boardView;\n\n    public void createColumns(){\n        ArrayList<Column> tmp = new ArrayList<>();\n        for(int i = 0; i < getColumnCount();i++){\n            ArrayList<View> views = new ArrayList<>();\n            Column column = new Column(createHeaderView(context,createHeaderObject(i),i),views,createFooterView(context,createFooterObject(i),i));\n            for(int j = 0; j < getItemCount(i);j++){\n                column.objects.add(createItemObject(i,j));\n                views.add(createItemView(context,createHeaderObject(i),createItemObject(i,j),i,j));\n            }\n            column.items_locked = isItemLocked(i);\n            column.column_locked = isColumnLocked(i);\n            column.header_object = createHeaderObject(i);\n            column.footer_object = createFooterObject(i);\n            tmp.add(column);\n        }\n        columns = tmp;\n    }\n\n    public void SetItemTransition(Transition t){\n        transition = t;\n    }\n\n    public void SetColumnTransition(Transition t){\n        boardViewTransition = t;\n    }\n\n    public static class Column{\n        public View header;\n        public Object header_object;\n        public Object footer_object;\n        public View footer;\n        public Boolean column_locked = false;\n        public Boolean items_locked =  false;\n        public ArrayList<View> views = new ArrayList<>();\n        public ArrayList<Object> objects = new ArrayList<>();\n\n        public Column(){\n            this.footer_object = \"Foot\";\n            this.header_object = \"Header\";\n        }\n\n        public Column(View header, ArrayList<View> views,View footer){\n            this.header = header;\n            this.views = views;\n            this.footer = footer;\n        }\n\n    }\n\n    public Object getHeaderObject(int column_position){\n        return columns.get(column_position).header_object;\n    }\n\n    public Object getItemObject(int column_position,int item_position){\n        return columns.get(column_position).objects.get(item_position);\n    }\n\n    public void addColumn(int index, Column column){\n        columns.add(index,column);\n        for(int j = 0; j < getItemCount(index);j++){\n            column.objects.add(createItemObject(index,j));\n            column.views.add(createItemView(context,createHeaderObject(index),createItemObject(index,j),index,j));\n        }\n        column.items_locked = isItemLocked(index);\n        column.column_locked = isColumnLocked(index);\n        column.header_object = createHeaderObject(index);\n        column.footer_object = createFooterObject(index);\n        column.header = createHeaderView(context,column.header_object,index);\n        column.footer = createFooterView(context,column.footer_object,index);\n        TransitionManager.beginDelayedTransition(boardView, boardViewTransition);\n        boardView.addColumnList(column.header,column.views,column.footer,index);\n    }\n\n    public void removeColumn(int index){\n        BoardItem item = (BoardItem)((ViewGroup)((ViewGroup)boardView.getChildAt(0)).getChildAt(0)).getChildAt(index);\n        ViewGroup group = ((ViewGroup) item.getParent());\n        ((ViewGroup)item.getParent()).removeView(item);\n        columns.remove(index);\n        group.invalidate();\n    }\n\n    public void removeItem(int column, int index){\n        BoardItem item = (BoardItem)((ViewGroup)((ViewGroup)boardView.getChildAt(0)).getChildAt(0)).getChildAt(column);\n        ScrollView scrollView = (ScrollView)item.getChildAt(1);\n        LinearLayout llColumn = (LinearLayout)scrollView.getChildAt(0);\n        llColumn.removeViewAt(index);\n        llColumn.invalidate();\n        columns.get(column).objects.remove(index);\n        columns.get(column).views.remove(index);\n    }\n\n    public void addItem(int column,int index, Object item){\n        BoardItem boardItem = (BoardItem)((ViewGroup)((ViewGroup)boardView.getChildAt(0)).getChildAt(0)).getChildAt(column);\n        TransitionManager.beginDelayedTransition(boardItem, transition);\n        ScrollView scrollView = (ScrollView)boardItem.getChildAt(1);\n        LinearLayout llColumn = (LinearLayout)scrollView.getChildAt(0);\n        columns.get(column).objects.add(index,item);\n        View v = createItemView(context,columns.get(column).header_object,item,column,index);\n        llColumn.addView(v,index);\n        boardView.addBoardItem(v,column);\n        llColumn.invalidate();\n        columns.get(column).views.add(index,v);\n    }\n\n    public abstract int getColumnCount();\n    public abstract int getItemCount(int column_position);\n    public abstract int maxItemCount(int column_position);\n    public abstract Object createHeaderObject(int column_position);\n    public abstract Object createFooterObject(int column_position);\n    public abstract Object createItemObject(int column_position,int item_position);\n    public abstract boolean isColumnLocked(int column_position);\n    public abstract boolean isItemLocked(int column_position);\n    public abstract View createItemView(Context context,Object header_object, Object item,int column_position,int item_position);\n    public abstract View createHeaderView(Context context,Object header_object,int column_position);\n    public abstract View createFooterView(Context context,Object footer_object,int column_position);\n\n}\n"
  },
  {
    "path": "boardview/src/main/java/com/allyants/boardview/BoardItem.java",
    "content": "package com.allyants.boardview;\n\nimport android.content.Context;\nimport android.util.AttributeSet;\nimport android.widget.LinearLayout;\n\n/**\n * Created by jbonk on 4/19/2017.\n */\n\npublic class BoardItem extends LinearLayout {\n    int originalWidth = 0;\n    int originalHeight = 0;\n    private float scale = 1f;\n    public BoardItem(Context context) {\n        super(context);\n    }\n\n    public BoardItem(Context context, AttributeSet attrs) {\n        super(context, attrs);\n    }\n\n    public BoardItem(Context context, AttributeSet attrs, int defStyleAttr) {\n        super(context, attrs, defStyleAttr);\n    }\n\n    public void init(){\n//        originalHeight = 0;\n//        originalWidth = 0;\n    }\n\n    public void setScale(float scale){\n        this.scale = scale;\n    }\n\n    public float getScale(){\n        return scale;\n    }\n\n    @Override\n    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {\n\n        if(getHeight() > 0 && getWidth() > 0 && scale != 1f) {\n            if(originalWidth == 0){\n                originalWidth = getWidth();\n            }\n            if(originalHeight == 0){\n                originalHeight = getHeight();\n            }\n            this.setMeasuredDimension((int) (originalWidth * scale), (int) (originalHeight * scale));\n        }else {\n            super.onMeasure(widthMeasureSpec, heightMeasureSpec);\n        }\n    }\n}\n"
  },
  {
    "path": "boardview/src/main/java/com/allyants/boardview/BoardView.java",
    "content": "package com.allyants.boardview;\n\nimport android.content.Context;\nimport android.content.res.TypedArray;\nimport android.graphics.Bitmap;\nimport android.graphics.Canvas;\nimport android.graphics.Color;\nimport android.graphics.Paint;\nimport android.graphics.Rect;\nimport android.graphics.drawable.BitmapDrawable;\nimport android.os.Handler;\nimport android.support.annotation.Nullable;\nimport android.support.v4.view.ViewCompat;\nimport android.util.AttributeSet;\nimport android.util.DisplayMetrics;\nimport android.util.Log;\nimport android.view.MotionEvent;\nimport android.view.VelocityTracker;\nimport android.view.View;\nimport android.view.ViewGroup;\nimport android.view.ViewParent;\nimport android.view.animation.Animation;\nimport android.view.animation.DecelerateInterpolator;\nimport android.view.animation.ScaleAnimation;\nimport android.widget.FrameLayout;\nimport android.widget.HorizontalScrollView;\nimport android.widget.LinearLayout;\nimport android.widget.ScrollView;\nimport android.widget.Scroller;\n\nimport java.util.ArrayList;\n\n/**\n * Created by jbonk on 4/17/2017.\n */\n\npublic class BoardView extends FrameLayout {\n\n    private static final float GLOBAL_SCALE = 0.6f;\n    private static final int SCROLL_ANIMATION_DURATION = 325;\n    private boolean mCellIsMobile = false;\n    private BitmapDrawable mHoverCell;\n    private Rect mHoverCellCurrentBounds;\n    private Rect mHoverCellOriginalBounds;\n    private boolean columnSnap;\n    private boolean isTouched;\n    private boolean isSnapping;\n\n    private int HEADER_ID = generateViewId();\n\n    private int background_color;\n\n    private HorizontalScrollView mRootLayout;\n    private LinearLayout mParentLayout;\n\n    private int originalPosition = -1;\n    private int originalItemPosition = -1;\n\n    public void setBackgroundColor(int color){\n        background_color = color;\n    }\n\n    public int getBackgroundColor(){\n        return background_color;\n    }\n\n    private DoneListener mDoneCallback = new DoneListener() {\n        @Override\n        public void onDone() {\n\n        }\n    };\n\n    private FooterClickListener footerClickListener = new FooterClickListener() {\n        @Override\n        public void onClick(View v, int column_pos) {\n\n        }\n    };\n\n    private HeaderClickListener headerClickListener = new HeaderClickListener() {\n        @Override\n        public void onClick(View v, int column_pos) {\n\n        }\n    };\n\n    private ItemClickListener itemClickListener = new ItemClickListener() {\n        @Override\n        public void onClick(View v, int column_pos, int item_pos) {\n\n        }\n    };\n\n    private DragColumnStartCallback mDragColumnStartCallback = new DragColumnStartCallback() {\n        @Override\n        public void startDrag(View itemView, int originalPosition) {\n\n        }\n\n        @Override\n        public void changedPosition(View itemView, int originalPosition, int newPosition) {\n\n        }\n\n        @Override\n        public void dragging(View itemView, MotionEvent event) {\n\n        }\n\n        @Override\n        public void endDrag(View itemView, int originalPosition, int newPosition) {\n\n        }\n    };\n\n    private DragItemStartCallback mDragItemStartCallback = new DragItemStartCallback() {\n        @Override\n        public void startDrag(View itemView, int originalPosition,int originalColumn) {\n\n        }\n\n        @Override\n        public void changedPosition(View itemView, int originalPosition,int originalColumn, int newPosition, int newColumn) {\n\n        }\n\n        @Override\n        public void dragging(View itemView, MotionEvent event) {\n\n        }\n\n        @Override\n        public void endDrag(View itemView, int originalPosition,int originalColumn, int newPosition, int newColumn) {\n\n        }\n    };\n\n    public boolean constWidth = true;\n\n    private final int LINE_THICKNESS = 15;\n\n    private boolean can_scroll = false;\n    private boolean created = false;\n\n    private int mLastEventX = -1;\n    private int mLastEventY = -1;\n    private Scroller mScroller;\n\n    public interface DragColumnStartCallback{\n        void startDrag(View itemView, int originalPosition);\n        void changedPosition(View itemView, int originalPosition, int newPosition);\n        void dragging(View itemView, MotionEvent event);\n        void endDrag(View itemView, int originalPosition, int newPosition);\n    }\n\n    public interface DragItemStartCallback{\n        void startDrag(View itemView, int originalPosition,int originalColumn);\n        void changedPosition(View itemView, int originalPosition,int originalColumn, int newPosition, int newColumn);\n        void dragging(View itemView, MotionEvent event);\n        void endDrag(View itemView, int originalPosition,int originalColumn, int newPosition, int newColumn);\n    }\n\n    public interface FooterClickListener{\n        void onClick(View v,int column_pos);\n    }\n\n\n    public interface HeaderClickListener{\n        void onClick(View v,int column_pos);\n    }\n\n    public interface ItemClickListener{\n        void onClick(View v,int column_pos,int item_pos);\n    }\n\n    public void setOnHeaderClickListener(HeaderClickListener headerClickListener){\n        this.headerClickListener = headerClickListener;\n    }\n\n    public void setOnFooterClickListener(FooterClickListener footerClickListener){\n        this.footerClickListener = footerClickListener;\n    }\n\n    public void setOnItemClickListener(ItemClickListener itemClickListener){\n        this.itemClickListener = itemClickListener;\n    }\n\n    public void setOnDragColumnListener(DragColumnStartCallback dragStartCallback){\n        mDragColumnStartCallback = dragStartCallback;\n    }\n\n    public void setOnDragItemListener(DragItemStartCallback dragStartCallback){\n        mDragItemStartCallback = dragStartCallback;\n    }\n\n    public void setOnDoneListener(DoneListener onDoneListener){\n        mDoneCallback = onDoneListener;\n    }\n\n    long last_swap = System.currentTimeMillis();\n    long last_swap_item = System.currentTimeMillis();\n\n    final long ANIM_TIME = 300;\n    long mDelaySwap = 400;\n    long mDelaySwapItem = 400;\n\n    private int mLastSwap = -1;\n    private int mDownY = -1;\n    private int mDownX = -1;\n\n    private boolean mSwapped = false;\n    private boolean canDragHorizontal = true;\n    private boolean canDragVertical = true;\n\n    private boolean mCellSubIsMobile = false;\n\n    private int mTotalOffsetX = 0;\n    private int mTotalOffsetY = 0;\n\n    public BoardAdapter boardAdapter;\n\n    private View mobileView;\n\n    public BoardView(Context context) {\n        super(context);\n    }\n\n    public BoardView(Context context, AttributeSet attrs) {\n        super(context, attrs);\n        TypedArray ta = context.obtainStyledAttributes(attrs,R.styleable.BoardView,0,0);\n        try {\n            background_color = ta.getColor(R.styleable.BoardView_boardItemBackground,Color.TRANSPARENT);\n        }finally{\n            ta.recycle();\n        }\n    }\n\n    public BoardView(Context context, AttributeSet attrs, int defStyleAttr) {\n        super(context, attrs, defStyleAttr);\n        TypedArray ta = context.obtainStyledAttributes(attrs,R.styleable.BoardView,0,0);\n        try {\n            background_color = ta.getColor(R.styleable.BoardView_boardItemBackground,Color.TRANSPARENT);\n        }finally{\n            ta.recycle();\n        }\n    }\n\n    public interface DoneListener {\n        void onDone();\n    }\n\n    public void setAdapter(BoardAdapter boardAdapter){\n        this.boardAdapter = boardAdapter;\n        Log.e(\"set\",\"adapter\");\n        boardAdapter.boardView = this;\n        mParentLayout.removeAllViews();\n        boardAdapter.createColumns();\n        for(int i = 0;i < boardAdapter.columns.size();i++){\n            BoardAdapter.Column column = boardAdapter.columns.get(i);\n            addColumnList(column.header,column.views,column.footer,i);\n        }\n    }\n\n    @Override\n    protected void onFinishInflate() {\n        super.onFinishInflate();\n        mRootLayout = new HorizontalScrollView(getContext());\n        mRootLayout.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT,LayoutParams.MATCH_PARENT));\n        mParentLayout = new LinearLayout(getContext());\n        mParentLayout.setOrientation(LinearLayout.HORIZONTAL);\n        mScroller = new Scroller(mRootLayout.getContext(), new DecelerateInterpolator(1.2f));\n        mParentLayout.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.MATCH_PARENT));\n        mRootLayout.addView(mParentLayout);\n        addView(mRootLayout);\n        SetColumnSnap(true);\n    }\n\n    @Override\n    protected void dispatchDraw(Canvas canvas) {\n        super.dispatchDraw(canvas);\n        if(!created){\n            created = true;\n            mDoneCallback.onDone();\n        }\n        if(mHoverCell != null){\n            mHoverCell.draw(canvas);\n        }\n    }\n\n    @Override\n    public boolean onInterceptTouchEvent(MotionEvent event) {\n        boolean colValue = handleColumnDragEvent(event);\n        return colValue || super.onInterceptTouchEvent(event);\n    }\n\n    @Override\n    public boolean onTouchEvent(MotionEvent event) {\n        boolean colValue = handleColumnDragEvent(event);\n        return colValue || super.onTouchEvent(event);\n    }\n\n    public int getStatusBarHeight() {\n        int result = 0;\n        int resourceId = getResources().getIdentifier(\"status_bar_height\", \"dimen\", \"android\");\n        if (resourceId > 0) {\n            result = getResources().getDimensionPixelSize(resourceId);\n        }\n        return result;\n    }\n\n    VelocityTracker mVelocityTracker = VelocityTracker.obtain();\n    public void SetColumnSnap(boolean columnSnap){\n        this.columnSnap = columnSnap;\n        mRootLayout.setOnTouchListener(new OnTouchListener() {\n            @Override\n            public boolean onTouch(View v, MotionEvent event) {\n                isTouched = true;\n                isSnapping = false;\n                switch (event.getAction()){\n                    case MotionEvent.ACTION_DOWN:\n                        mVelocityTracker.clear();\n                        mVelocityTracker.addMovement(event);\n                        break;\n                    case MotionEvent.ACTION_MOVE:\n                        mVelocityTracker.addMovement(event);\n                        mVelocityTracker.computeCurrentVelocity(1000);\n                        break;\n                    case MotionEvent.ACTION_UP:\n                        isTouched = false;\n                        if(Math.abs(mVelocityTracker.getXVelocity()) < 230){\n                            int pos = getPositionInListX(mRootLayout.getWidth()/2,mParentLayout);\n                            scrollToColumn(pos,true);\n                        }\n                        break;\n                }\n                return false;\n            }\n        });\n        if(this.columnSnap) {\n            mRootLayout.setOnScrollChangeListener(onScrollChangeListener);\n        }else{\n            mRootLayout.setOnScrollChangeListener(null);\n        }\n    }\n\n    OnScrollChangeListener onScrollChangeListener = new OnScrollChangeListener() {\n        @Override\n        public void onScrollChange(View v, int scrollX, int scrollY, int oldScrollX, int oldScrollY) {\n            if(!isTouched && !isSnapping && mParentLayout.getChildCount() > 0) {\n                int deltaX = Math.abs(oldScrollX - scrollX);\n                if(deltaX < 3){\n                    //Scroll To closest column\n                    isSnapping = true;\n                    int[] location = new int[2];\n                    mParentLayout.getLocationOnScreen(location);\n                    int offset = (mParentLayout.getChildAt(0).getWidth())/2;\n                    if(oldScrollX - scrollX <= 0){\n                        offset *= 2;\n                    }\n                    int x = scrollX+location[0]+offset;\n                    int pos = getPositionInListX(x,mParentLayout);\n                    scrollToColumn(pos,true);\n                }\n            }\n        }\n    };\n\n    public void scrollToColumn(int column,boolean animate){\n        if(column >= 0) {\n            View childView = mParentLayout.getChildAt(column);\n            if(childView != null) {\n                final int newX = childView.getLeft() - (int) (((getMeasuredWidth() - childView.getMeasuredWidth()) / 2));\n                if (animate) {\n                    mRootLayout.post(new Runnable() {\n                        @Override\n                        public void run() {\n                            mRootLayout.smoothScrollTo(newX, 0);\n                        }\n                    });\n                } else {\n                    mRootLayout.scrollTo(newX, 0);\n                }\n            }\n        }\n    }\n\n    public boolean handleColumnDragEvent(MotionEvent event){\n        switch (event.getAction() & MotionEvent.ACTION_MASK) {\n            case MotionEvent.ACTION_DOWN:\n                mDownX = (int)event.getX();\n                mDownY = (int)event.getRawY();\n                break;\n            case MotionEvent.ACTION_MOVE:\n                if(mDownY == -1){\n                    mDownY = (int)event.getRawY();\n\n                }\n                if(mDownX == -1){\n                    mDownX = (int)event.getX();\n                }\n\n                mLastEventX = (int) event.getX();\n                mLastEventY = (int) event.getRawY();\n                int deltaX = mLastEventX - mDownX;\n                int deltaY = mLastEventY - mDownY;\n\n                if(mCellSubIsMobile){\n                    if(mDragItemStartCallback != null)\n                        mDragItemStartCallback.dragging(mobileView,event);\n                    int offsetX = 0;\n                    if(canDragHorizontal){\n                        offsetX =  deltaX;\n                    }\n                    int offsetY = mHoverCellOriginalBounds.top;\n                    if(canDragVertical){\n                        offsetY = mHoverCellOriginalBounds.top + deltaY;\n                    }\n                    mHoverCell.setBounds(rotatedBounds(mHoverCellCurrentBounds,0.0523599f));\n                    mHoverCellCurrentBounds.offsetTo(offsetX,\n                            mLastEventY - 330);\n                    invalidate();\n                    handleItemSwitchHorizontal();\n                    return true;\n                }else if (mCellIsMobile) {\n                    if(mDragColumnStartCallback != null)\n                        mDragColumnStartCallback.dragging(mobileView,event);\n                    int offsetX = 0;\n                    if(canDragHorizontal){\n                        offsetX =  deltaX;\n                    }\n                    int offsetY = mHoverCellOriginalBounds.top;\n                    if(canDragVertical){\n                        offsetY = mHoverCellOriginalBounds.top + deltaY + mTotalOffsetY;\n                    }\n                    mHoverCell.setBounds(rotatedBounds(mHoverCellCurrentBounds,0.0523599f));\n                    mHoverCellCurrentBounds.offsetTo(offsetX,\n                            offsetY);\n                    invalidate();\n                    handleColumnSwitchHorizontal();\n\n                    return true;\n                }\n                break;\n            case MotionEvent.ACTION_UP:\n                touchEventsCancelled();\n                break;\n            case MotionEvent.ACTION_CANCEL:\n                touchEventsCancelled();\n                break;\n            case MotionEvent.ACTION_POINTER_UP:\n                /* If a multitouch event took place and the original touch dictating\n                 * the movement of the hover cell has ended, then the dragging event\n                 * ends and the hover cell is animated to its corresponding position\n                 * in the listview. */\n//                pointerIndex = (event.getAction() & MotionEvent.ACTION_POINTER_INDEX_MASK) >>\n//                        MotionEvent.ACTION_POINTER_INDEX_SHIFT;\n//                final int pointerId = event.getPointerId(pointerIndex);\n//                if (pointerId == mActivePointerId) {\n//\n//                }\n                break;\n            default:\n                break;\n        }\n        return false;\n    }\n\n    @Override\n    public void computeScroll() {\n        if (!mScroller.isFinished() && mScroller.computeScrollOffset()) {\n            int x = mScroller.getCurrX();\n            int y = mScroller.getCurrY();\n            if (getScrollX() != x || getScrollY() != y) {\n                scrollTo(x, y);\n            }\n\n            ViewCompat.postInvalidateOnAnimation(this);\n        } else {\n            super.computeScroll();\n        }\n    }\n\n    //checks if item should be switched between columns\n    private void handleItemSwitchHorizontal(){\n        int itemPos = ((LinearLayout)(mobileView.getParent())).indexOfChild(mobileView);\n        View aboveView = ((LinearLayout)(mobileView.getParent())).getChildAt(itemPos - 1);\n        View belowView = ((LinearLayout)(mobileView.getParent())).getChildAt(itemPos + 1);\n        int[] location = new int[2];\n        mobileView.getLocationOnScreen(location);\n        int[] parentLocation = new int[2];\n        ScrollView parent = ((ScrollView)((LinearLayout)mobileView.getParent()).getParent());\n        parent.getLocationOnScreen(parentLocation);\n        if(mLastEventY < parentLocation[1]+200){\n            parent.smoothScrollBy(0,-10);\n        }\n        if(mLastEventY > parentLocation[1]+parent.getHeight()-200){\n            parent.smoothScrollBy(0,10);\n        }\n        int columnPos = mParentLayout.indexOfChild((View)(mobileView.getParent().getParent().getParent()));\n        //swapping above\n        if(aboveView != null){\n            int[] locationAbove = new int[2];\n            aboveView.getLocationInWindow(locationAbove);\n\n            if(locationAbove[1]+aboveView.getHeight()/2 > mLastEventY){\n                switchItemFromPosition(-1,mobileView);\n            }\n        }\n        //swapping below\n        if(belowView != null){\n            int[] locationBelow = new int[2];\n            belowView.getLocationOnScreen(locationBelow);\n            if(locationBelow[1] + belowView.getHeight()/2 < mLastEventY){\n                switchItemFromPosition(1,mobileView);\n            }\n        }\n\n        int leftPos = 1;\n        while (columnPos - leftPos > 0 && boardAdapter.columns.get(columnPos - leftPos).items_locked){\n            leftPos++;\n        }\n        if(columnPos-leftPos >= 0 && columnPos-leftPos < boardAdapter.columns.size()) {\n            while (boardAdapter.maxItemCount(columnPos - leftPos) != -1 && boardAdapter.maxItemCount(columnPos - leftPos) <= boardAdapter.columns.get(columnPos - leftPos).objects.size() && columnPos - leftPos != 0) {\n                leftPos++;\n            }\n        }\n        View leftView = mParentLayout.getChildAt(columnPos - leftPos);\n        View currentView = mParentLayout.getChildAt(columnPos);\n        int rightPos = 1;\n        while(boardAdapter.columns.size() > columnPos+rightPos && boardAdapter.columns.get(columnPos + rightPos).items_locked){\n            rightPos++;\n        }\n        if(columnPos + rightPos >= 0 && columnPos + rightPos < boardAdapter.columns.size()) {\n            while (boardAdapter.maxItemCount(columnPos + rightPos) != -1 && columnPos + rightPos != boardAdapter.columns.size() && boardAdapter.maxItemCount(columnPos + rightPos) <= boardAdapter.columns.get(columnPos + rightPos).objects.size()) {\n                rightPos++;\n            }\n        }\n        View rightView = mParentLayout.getChildAt(columnPos + rightPos);\n        View firstLeftView = mParentLayout.getChildAt(columnPos-1);\n        View firstRightView = mParentLayout.getChildAt(columnPos+1);\n\n        if(leftView != null){\n            int[] locationLeft = new int[2];\n            firstLeftView.getLocationOnScreen(locationLeft);\n            if (locationLeft[0] + leftView.getWidth() > mLastEventX) {\n                int pos = ((LinearLayout)mobileView.getParent()).indexOfChild(mobileView);\n                if(last_swap_item <= System.currentTimeMillis() - mDelaySwapItem) {\n                    last_swap_item = System.currentTimeMillis();\n                    if(((LinearLayout)mobileView.getParent()) != null) {\n                        scrollToColumn(columnPos-leftPos,true);\n                        if(boardAdapter.maxItemCount(columnPos-leftPos) == -1 || boardAdapter.maxItemCount(columnPos-leftPos) > boardAdapter.columns.get(columnPos-leftPos).objects.size()) {\n                            ((LinearLayout) mobileView.getParent()).removeViewAt(pos);\n                            LinearLayout layout = ((LinearLayout) ((ScrollView) ((ViewGroup) leftView).getChildAt(1)).getChildAt(0));\n                            layout.addView(mobileView, getPositionInListY(mLastEventY, layout));\n                            int newItemPos = ((LinearLayout) ((ViewGroup) leftView).getChildAt(0)).indexOfChild(mobileView) - 1;\n                            int newColumnPos = ((LinearLayout) mobileView.getParent().getParent().getParent()).indexOfChild((View) (mobileView.getParent().getParent()));\n                            mDragItemStartCallback.changedPosition(mobileView, originalItemPosition, originalPosition, newItemPos, newColumnPos);\n                        }\n                    }\n                }\n            }\n        }\n        if(rightView != null){\n            int[] locationRight = new int[2];\n            firstRightView.getLocationOnScreen(locationRight);\n            if (locationRight[0] < mLastEventX) {\n                int pos = ((LinearLayout)mobileView.getParent()).indexOfChild(mobileView);\n                if(last_swap_item <= System.currentTimeMillis() - mDelaySwapItem) {\n                    last_swap_item = System.currentTimeMillis();\n                    if(((LinearLayout)mobileView.getParent()) != null) {\n                        scrollToColumn(columnPos+rightPos,true);\n                        if(boardAdapter.maxItemCount(columnPos+rightPos) == -1 || boardAdapter.maxItemCount(columnPos+rightPos) > boardAdapter.columns.get(columnPos+rightPos).objects.size()) {\n                            ((LinearLayout) mobileView.getParent()).removeViewAt(pos);\n                            LinearLayout layout = ((LinearLayout) ((ScrollView) ((ViewGroup) rightView).getChildAt(1)).getChildAt(0));\n                            layout.addView(mobileView, getPositionInListY(mLastEventY, layout));\n                            int newItemPos = ((LinearLayout) ((ViewGroup) rightView).getChildAt(0)).indexOfChild(mobileView) - 1;\n                            int newColumnPos = ((LinearLayout) mobileView.getParent().getParent().getParent()).indexOfChild((View) (mobileView.getParent().getParent()));\n                            mDragItemStartCallback.changedPosition(mobileView, originalItemPosition, originalPosition, newItemPos, newColumnPos);\n                        }\n                    }\n                }\n            }\n        }\n\n    }\n\n    //Gets the position of a item inside a list based on the y offset\n    public int getPositionInListY(int y,LinearLayout layout){\n        for(int i = 0; i < layout.getChildCount();i++){\n            int[] location = new int[2];\n            View view = layout.getChildAt(i);\n            view.getLocationOnScreen(location);\n            if(y > location[1] && y < location[1]+view.getHeight()){\n                return i;\n            }\n        }\n        return 0;\n    }\n\n    //Gets the position of a item inside a list based on the y offset\n    public int getPositionInListX(int x,LinearLayout layout){\n        for(int i = 0; i < layout.getChildCount();i++){\n            int[] location = new int[2];\n            View view = layout.getChildAt(i);\n            int end = layout.getWidth();\n            if(layout.getChildCount() > i+1){\n                int[] end_location = new int[2];\n                layout.getChildAt(i+1).getLocationOnScreen(end_location);\n                end = end_location[0];\n            }\n            view.getLocationOnScreen(location);\n            if(x >= location[0] && x <= end){\n                return i;\n            }\n        }\n        return 0;\n    }\n\n    //Change int change to position to fix problem with starting from the bottom\n    private void switchItemFromPosition(int change,View view){\n        LinearLayout parentLayout = (LinearLayout)(view.getParent());\n        int columnPos = parentLayout.indexOfChild(view);\n        if (columnPos + change >= 0 && columnPos + change < parentLayout.getChildCount()) {\n            parentLayout.removeView(view);\n            parentLayout.addView(view, columnPos + change);\n            if (mDragItemStartCallback != null) {\n                int newPos = parentLayout.indexOfChild(view);\n                last_swap = System.currentTimeMillis();\n                mLastSwap = newPos;\n                int newColumnPos = ((LinearLayout) mobileView.getParent().getParent().getParent().getParent()).indexOfChild((View) (mobileView.getParent().getParent().getParent()));\n                mDragItemStartCallback.changedPosition(view, originalItemPosition, originalPosition, newPos, newColumnPos);\n            }\n        }\n    }\n\n    private void handleColumnSwitchHorizontal(){\n        if(can_scroll && last_swap <= System.currentTimeMillis()-mDelaySwap) {\n            int columnPos = mParentLayout.indexOfChild(mobileView);\n            View leftView = mParentLayout.getChildAt(columnPos - 1);\n            View rightView = mParentLayout.getChildAt(columnPos + 1);\n\n            int[] locationRight = new int[2];\n            if (rightView != null) {\n                rightView.getLocationOnScreen(locationRight);\n                if (locationRight[0] < mLastEventX) {\n                    //Scroll to the right\n                    switchColumnFromPosition(1,mobileView);\n                    if (locationRight[0] + (rightView.getWidth() / 2) < mLastEventX) {\n\n                    }\n                }\n            }\n\n            int[] locationLeft = new int[2];\n            if (leftView != null) {\n                leftView.getLocationOnScreen(locationLeft);\n                if (locationLeft[0] + leftView.getWidth() > mLastEventX) {\n                    //Scroll to the right\n                    switchColumnFromPosition(-1,mobileView);\n                    //mRootLayout.scrollBy(-1 * 2, 0);\n                    if (locationLeft[0] + (leftView.getWidth() / 2) > mLastEventX) {\n\n                    }\n                }\n            }\n        }\n    }\n\n    private void switchColumnFromPosition(int change,View view){\n        int columnPos = mParentLayout.indexOfChild(view);\n        if(columnPos+change >=  0 && last_swap <= System.currentTimeMillis()-mDelaySwap) {\n            mParentLayout.removeView(view);\n            mParentLayout.addView(view, columnPos + change);\n            if(mDragColumnStartCallback != null){\n                int newPos = mParentLayout.indexOfChild(view);\n                last_swap = System.currentTimeMillis();\n                mLastSwap = newPos;\n                Handler handlerTimer = new Handler();\n                handlerTimer.postDelayed(new Runnable(){\n                    public void run() {\n                        scrollToColumn(mLastSwap,true);\n                    }}, 0);\n                mDragColumnStartCallback.changedPosition(((LinearLayout)view).getChildAt(0),originalPosition,newPos);\n            }\n        }\n    }\n\n    private void touchEventsCancelled() {\n        if(mCellSubIsMobile){\n            mobileView.setVisibility(VISIBLE);\n            mHoverCell = null;\n            invalidate();\n            LinearLayout parentLayout = (LinearLayout)(mobileView.getParent().getParent().getParent().getParent());\n            int columnPos = parentLayout.indexOfChild((View)(mobileView.getParent().getParent().getParent()));\n            int pos = ((LinearLayout)mobileView.getParent()).indexOfChild(mobileView);\n            View tmpView = boardAdapter.columns.get(originalPosition).views.get(originalItemPosition);\n            boardAdapter.columns.get(originalPosition).views.remove(originalItemPosition);\n            boardAdapter.columns.get(columnPos).views.add(pos, tmpView);\n            Object tmpObject = boardAdapter.columns.get(originalPosition).objects.get(originalItemPosition);\n            boardAdapter.columns.get(originalPosition).objects.remove(originalItemPosition);\n            boardAdapter.columns.get(columnPos).objects.add(pos, tmpObject);\n            if (mDragItemStartCallback != null) {\n                mDragItemStartCallback.endDrag(mobileView, originalItemPosition,originalPosition, pos, columnPos);\n            }\n        }else if(mCellIsMobile){\n            for(int i = 0;i < mParentLayout.getChildCount();i++){\n                BoardItem parentView = (BoardItem)mParentLayout.getChildAt(i);//Gets the parent layout\n                for(int j = 0;j < parentView.getChildCount();j++) {\n                    View childView = ((LinearLayout) parentView).getChildAt(j);\n                    scrollToColumn(originalPosition, true);\n                    scaleView(childView, parentView, GLOBAL_SCALE, 1f);\n                }\n            }\n            mobileView.setVisibility(VISIBLE);\n            mHoverCell = null;\n            invalidate();\n            if(mDragColumnStartCallback != null){\n                int columnPos = mParentLayout.indexOfChild(mobileView);\n                scrollToColumn(columnPos,true);\n                BoardAdapter.Column column = boardAdapter.columns.get(originalPosition);\n                boardAdapter.columns.remove(originalPosition);\n                boardAdapter.columns.add(columnPos,column);\n                mDragColumnStartCallback.endDrag(((LinearLayout)mobileView).getChildAt(0),originalPosition,columnPos);\n            }\n        }\n\n        mDownX = -1;\n        mDownY = -1;\n        mCellSubIsMobile = false;\n        mCellIsMobile = false;\n    }\n\n    Handler handler = new Handler();\n\n    public void scaleView(final View v, final BoardItem parent, final float startScale, final float endScale) {\n        final Animation anim = new ScaleAnimation(\n                startScale, endScale, // Start and end values for the X axis scaling\n                startScale, endScale, // Start and end values for the Y axis scaling\n                Animation.RELATIVE_TO_SELF,0f, // Pivot point of X scaling\n                Animation.RELATIVE_TO_SELF, 0f); // Pivot point of Y scaling\n        anim.setFillAfter(true); // Needed to keep the result of the animation\n        anim.setFillBefore(false);\n        anim.setFillEnabled(true);\n        anim.setDuration(ANIM_TIME);\n        v.startAnimation(anim);\n        final long startTime = System.currentTimeMillis();\n        anim.setAnimationListener(new Animation.AnimationListener() {\n            @Override\n            public void onAnimationStart(Animation animation) {\n                handler.post(createRunnable(parent,startTime,startScale,endScale));\n                parent.init();\n                can_scroll = false;\n            }\n\n            @Override\n            public void onAnimationEnd(Animation animation) {\n                parent.setScale(endScale);\n                scrollToColumn(mLastSwap,true);\n                parent.requestLayout();\n                parent.invalidate();\n                can_scroll = true;\n\n            }\n\n            @Override\n            public void onAnimationRepeat(Animation animation) {\n\n            }\n        });\n    }\n\n    private Runnable createRunnable(final BoardItem parent, final long startTime, final float startScale, final float endScale){\n        Runnable runnable = new Runnable() {\n            @Override\n            public void run() {\n                long time = System.currentTimeMillis()-startTime;\n                float scale_time = time/(float)ANIM_TIME;\n                if(scale_time > 1){\n                    scale_time = 1;\n                }\n                scrollToColumn(mLastSwap,true);\n                parent.setScale(startScale + (endScale - startScale)*scale_time);\n                parent.requestLayout();\n                parent.invalidate();\n                if(scale_time != 1) {\n                    handler.postDelayed(this,10);\n                }\n            }\n        };\n        return runnable;\n    }\n\n    private ViewGroup removeParent(View view){\n        if(view == null){\n            return null;\n        }\n        ViewGroup viewGroup = ((ViewGroup)view.getParent());\n        if(viewGroup != null){\n            viewGroup.removeView(view);\n        }\n        return viewGroup;\n    }\n\n    public void notifyDataSetChanged(){\n        for(int column_pos = 0; column_pos < boardAdapter.columns.size(); column_pos++) {\n            if(boardAdapter.columns.get(column_pos).header != null) {\n                ViewGroup parent_header = removeParent(boardAdapter.columns.get(column_pos).header);\n                boardAdapter.columns.get(column_pos).header = boardAdapter.createHeaderView(getContext(), boardAdapter.columns.get(column_pos).header_object, column_pos);\n                parent_header.addView(boardAdapter.columns.get(column_pos).header);\n                ViewGroup layout = (ViewGroup)parent_header.getParent();\n                boardAdapter.columns.get(column_pos).header.setOnClickListener(createHeaderOnClickListener(layout));\n                boardAdapter.columns.get(column_pos).header.setOnLongClickListener(createHeaderOnLongClickListener(parent_header,layout));\n\n            }\n            if(boardAdapter.columns.get(column_pos).footer != null) {\n                ViewGroup parent_footer = removeParent(boardAdapter.columns.get(column_pos).footer);\n                boardAdapter.columns.get(column_pos).footer = boardAdapter.createFooterView(getContext(), boardAdapter.columns.get(column_pos).footer_object, column_pos);\n                parent_footer.addView(boardAdapter.columns.get(column_pos).footer);\n            }\n        }\n    }\n\n    private OnClickListener createHeaderOnClickListener(final View parent_layout){\n        return new OnClickListener() {\n            @Override\n            public void onClick(View v) {\n                int pos = mParentLayout.indexOfChild(parent_layout);\n                scrollToColumn(pos,true);\n                headerClickListener.onClick(v,pos);\n            }\n        };\n    }\n\n    private OnLongClickListener createHeaderOnLongClickListener(final ViewGroup layout,final View parent_layout){\n        return new OnLongClickListener() {\n            @Override\n            public boolean onLongClick(View v) {\n                if (mDragColumnStartCallback == null) {\n                    return false;\n                }\n                originalPosition = mParentLayout.indexOfChild(parent_layout);\n                mDragColumnStartCallback.startDrag(layout, originalPosition);\n                mLastSwap = originalPosition;\n                for (int i = 0; i < mParentLayout.getChildCount(); i++) {\n                    BoardItem parentView = (BoardItem) mParentLayout.getChildAt(i);//Gets the parent layout\n                    for (int j = 0; j < parentView.getChildCount(); j++) {\n                        View childView = ((LinearLayout) parentView).getChildAt(j);\n                        scrollToColumn(originalPosition, true);\n                        scaleView(childView, parentView, 1f, GLOBAL_SCALE);\n                    }\n                }\n\n                scrollToColumn(originalPosition, false);\n                mCellIsMobile = true;\n                mobileView = (View) (parent_layout);\n                mHoverCell = getAndAddHoverView(mobileView, GLOBAL_SCALE);\n                mobileView.setVisibility(INVISIBLE);\n                return false;\n            }\n        };\n    }\n\n    private OnClickListener createFooterOnClickListener(final View parent_layout){\n        return new OnClickListener() {\n            @Override\n            public void onClick(View v) {\n                int column_pos = mParentLayout.indexOfChild(parent_layout);\n                footerClickListener.onClick(v,column_pos);\n            }\n        };\n    }\n\n    public void addColumnList(@Nullable View header, ArrayList<View> items, @Nullable final View footer,int column_pos){\n        final BoardItem parent_layout = new BoardItem(getContext());\n        parent_layout.setBackgroundColor(background_color);\n        final LinearLayout layout = new LinearLayout(getContext());\n        final ScrollView scroll_view = new ScrollView(getContext());\n        ScrollView.LayoutParams scrollParams = new ScrollView.LayoutParams(ScrollView.LayoutParams.MATCH_PARENT, ScrollView.LayoutParams.WRAP_CONTENT);\n        scroll_view.setLayoutParams(scrollParams);\n        final LinearLayout layout_children = new LinearLayout(getContext());\n        layout_children.setOrientation(LinearLayout.VERTICAL);\n        layout.setOrientation(LinearLayout.VERTICAL);\n        parent_layout.setOrientation(LinearLayout.VERTICAL);\n        if(constWidth) {\n            int margin = calculatePixelFromDensity(8);\n            LayoutParams params = new LayoutParams(calculatePixelFromDensity(240), LayoutParams.WRAP_CONTENT);\n            LayoutParams parent_params = new LayoutParams(calculatePixelFromDensity(240), LayoutParams.WRAP_CONTENT);\n            layout.setLayoutParams(params);\n            parent_params.setMargins(margin,margin,margin,margin);\n            parent_layout.setLayoutParams(parent_params);\n        }else {\n            int margin = calculatePixelFromDensity(8);\n            LayoutParams params = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);\n            LayoutParams parent_params = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);\n            layout.setLayoutParams(params);\n            parent_params.setMargins(margin,margin,margin,margin);\n            parent_layout.setLayoutParams(parent_params);\n        }\n        parent_layout.addView(layout);\n        if(header != null){\n            header.setId(HEADER_ID);\n            removeParent(header);\n            layout.addView(header);\n            header.setOnClickListener(createHeaderOnClickListener(parent_layout));\n            if(!boardAdapter.columns.get(column_pos).column_locked) {\n                header.setOnLongClickListener(createHeaderOnLongClickListener(layout,parent_layout));\n            }\n        }\n        parent_layout.addView(scroll_view);\n        scroll_view.addView(layout_children);\n        for(int i = 0;i < items.size();i++){\n            final View view = items.get(i);\n            removeParent(view);\n            layout_children.addView(view);\n            addBoardItem(view,column_pos);\n        }\n        if(footer != null) {\n            removeParent(footer);\n            final LinearLayout footer_layout = new LinearLayout(getContext());\n            footer_layout.setOrientation(LinearLayout.VERTICAL);\n            final LayoutParams params = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);\n            params.setMargins(0,200*-1,0,0);\n            layout.addView(footer);\n            footer_layout.setLayoutParams(params);\n            parent_layout.addView(footer_layout);\n            footer.setOnClickListener(createFooterOnClickListener(parent_layout));\n            footer.post(new Runnable() {\n                @Override\n                public void run() {\n                    scroll_view.setPadding(0,0,0,footer.getHeight());\n                    final LinearLayout.LayoutParams new_params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT);\n                    new_params.setMargins(0,footer.getHeight()*-1,0,0);\n                    removeParent(footer);\n                    footer_layout.setLayoutParams(new_params);\n                    footer_layout.addView(footer);\n                }\n            });\n        }\n        mParentLayout.addView(parent_layout,column_pos);\n    }\n\n    public void addBoardItem(final View view, final int column_pos){\n        view.setOnClickListener(new OnClickListener() {\n            @Override\n            public void onClick(View v) {\n                LinearLayout layout = (LinearLayout)view.getParent();\n                BoardItem parent_layout = (BoardItem)layout.getParent().getParent();\n                int pos = mParentLayout.indexOfChild(parent_layout);\n                int i = layout.indexOfChild(view);\n                itemClickListener.onClick(view,pos, i);\n            }\n        });\n        if(!boardAdapter.columns.get(column_pos).items_locked) {\n            view.setOnLongClickListener(new OnLongClickListener() {\n                @Override\n                public boolean onLongClick(View v) {\n                    if (mDragItemStartCallback == null) {\n                        return false;\n                    }\n                    originalPosition = mParentLayout.indexOfChild((LinearLayout) ((LinearLayout) view.getParent()).getParent().getParent());\n                    originalItemPosition = ((LinearLayout) view.getParent()).indexOfChild(view);\n                    mDragItemStartCallback.startDrag(view, originalItemPosition,originalPosition);\n                    mCellSubIsMobile = true;\n                    mobileView = (View) (view);\n                    mHoverCell = getAndAddHoverView(mobileView, 1);\n                    mobileView.setVisibility(INVISIBLE);\n                    return false;\n                }\n            });\n        }\n    }\n\n    private int calculatePixelFromDensity(float dp){\n        DisplayMetrics metrics = getContext().getResources().getDisplayMetrics();\n        float fpixels = metrics.density * dp;\n        int pixels = (int) (fpixels + 0.5f);\n        return pixels;\n    }\n\n    private BitmapDrawable getAndAddHoverView(View v, float scale){\n        int w = v.getWidth();\n        int h = v.getHeight();\n        int top = v.getTop();\n        int left = v.getLeft();\n\n        Bitmap b = getBitmapWithBorder(v,scale);\n        BitmapDrawable drawable = new BitmapDrawable(getResources(),b);\n        mHoverCellOriginalBounds = new Rect(left,top,left+w,top+h);\n        mHoverCellCurrentBounds = new Rect(mHoverCellOriginalBounds);\n        drawable.setBounds(mHoverCellCurrentBounds);\n        return drawable;\n    }\n\n    private Bitmap getBitmapWithBorder(View v, float scale) {\n        Bitmap bitmap = getBitmapFromView(v,0);\n        Bitmap b = getBitmapFromView(v,1);\n        Canvas can = new Canvas(bitmap);\n        Paint paint = new Paint();\n        paint.setAlpha(150);\n        can.scale(scale,scale,mDownX,mDownY);\n        can.rotate(3);\n        can.drawBitmap(b,0,0,paint);\n        return bitmap;\n    }\n\n    private Bitmap getBitmapFromView(View v, float scale){\n        double radians = 0.0523599f;\n        double s = Math.abs(Math.sin(radians));\n        double c = Math.abs(Math.cos(radians));\n        int width = (int)(v.getHeight()*s + v.getWidth()*c);\n        int height = (int)(v.getWidth()*s + v.getHeight()*c);\n        Bitmap bitmap = Bitmap.createBitmap(width,height,Bitmap.Config.ARGB_8888);\n        Canvas canvas = new Canvas(bitmap);\n        canvas.scale(scale,scale);\n        v.draw(canvas);\n        return bitmap;\n    }\n\n    private Rect rotatedBounds(Rect tmp,double radians){\n        double s = Math.abs(Math.sin(radians));\n        double c = Math.abs(Math.cos(radians));\n        int width = (int)(tmp.height()*s + tmp.width()*c);\n        int height = (int)(tmp.width()*s + tmp.height()*c);\n\n        return new Rect(tmp.left,tmp.top,tmp.left+width,tmp.top+height);\n    }\n\n}\n"
  },
  {
    "path": "boardview/src/main/java/com/allyants/boardview/Item.java",
    "content": "package com.allyants.boardview;\n\n/**\n * Created by jbonk on 5/5/2018.\n */\n\npublic class Item{\n\n    public String item;\n\n    public Item(String item){\n        this.item = item;\n    }\n\n    public String toString(){\n        return item;\n    }\n}"
  },
  {
    "path": "boardview/src/main/java/com/allyants/boardview/SimpleBoardAdapter.java",
    "content": "package com.allyants.boardview;\n\nimport android.content.Context;\nimport android.view.View;\nimport android.widget.TextView;\n\nimport java.util.ArrayList;\n\n/**\n * Created by jbonk on 6/12/2017.\n */\n\npublic class SimpleBoardAdapter extends BoardAdapter{\n    int header_resource;\n    int item_resource;\n    public SimpleBoardAdapter instance;\n\n    public SimpleBoardAdapter(Context context, ArrayList<SimpleColumn> data) {\n        super(context);\n        instance = this;\n        this.columns = (ArrayList)data;\n        this.header_resource = R.layout.column_header;\n        this.item_resource = R.layout.column_item;\n    }\n\n    @Override\n    public int getColumnCount() {\n        return columns.size();\n    }\n\n    @Override\n    public int getItemCount(int column_position) {\n        return columns.get(column_position).objects.size();\n    }\n\n    @Override\n    public Object createHeaderObject(int column_position) {\n        return columns.get(column_position).header_object;\n    }\n\n    @Override\n    public Object createFooterObject(int column_position) {\n        return \"Footer \"+ String.valueOf(column_position);\n    }\n\n    @Override\n    public Object createItemObject(int column_position, int item_position) {\n        return columns.get(column_position).objects.get(item_position);\n    }\n\n    @Override\n    public boolean isColumnLocked(int column_position) {\n        return false;\n    }\n\n    @Override\n    public boolean isItemLocked(int column_position) {\n        return false;\n    }\n\n    @Override\n    public View createItemView(Context context,Object header_object,Object item_object,int column_position, int item_position) {\n        View item = View.inflate(context, item_resource, null);\n        TextView textView = (TextView)item.findViewById(R.id.textView);\n        textView.setText(columns.get(column_position).objects.get(item_position).toString());\n        return item;\n    }\n\n    @Override\n    public int maxItemCount(int column_position) {\n        return 4;\n    }\n\n    @Override\n    public void createColumns() {\n        super.createColumns();\n    }\n\n    @Override\n    public View createHeaderView(Context context,Object header_object,int column_position) {\n        View column = View.inflate(context, header_resource, null);\n        TextView textView = (TextView)column.findViewById(R.id.textView);\n        textView.setText(columns.get(column_position).header_object.toString());\n        return column;\n    }\n\n    @Override\n    public View createFooterView(Context context, Object footer_object, int column_position) {\n        View footer = View.inflate(context, header_resource, null);\n        TextView textView = (TextView)footer.findViewById(R.id.textView);\n        textView.setText((String)footer_object);\n        return footer;\n    }\n\n    public static class SimpleColumn extends Column{\n        public String title;\n        public SimpleColumn(String title, ArrayList<Object> items){\n            super();\n            this.title = title;\n            this.header_object = new Item(title);\n            this.objects = items;\n        }\n    }\n\n}\n"
  },
  {
    "path": "boardview/src/main/res/drawable/shadow_background.xml",
    "content": "<layer-list xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <item>\n        <shape android:shape=\"rectangle\">\n            <solid android:color=\"#CABBBBBB\"/>\n            <corners android:radius=\"2dp\" />\n        </shape>\n    </item>\n\n    <item\n        android:left=\"1dp\"\n        android:right=\"1dp\"\n        android:top=\"0dp\"\n        android:bottom=\"2dp\">\n        <shape android:shape=\"rectangle\">\n            <solid android:color=\"@android:color/white\"/>\n            <corners android:radius=\"2dp\" />\n        </shape>\n    </item>\n</layer-list>"
  },
  {
    "path": "boardview/src/main/res/layout/column_header.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:orientation=\"vertical\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:background=\"@android:color/white\">\n\n        <TextView\n            android:text=\"Hello World this is a test\"\n            android:layout_height=\"wrap_content\"\n            android:id=\"@+id/textView\"\n            android:textAlignment=\"center\"\n            android:maxWidth=\"240dp\"\n            android:layout_width=\"230dp\"\n            android:textSize=\"20dp\" />\n</LinearLayout>"
  },
  {
    "path": "boardview/src/main/res/layout/column_item.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:orientation=\"vertical\" android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:gravity=\"center_horizontal\">\n    <TextView\n        android:text=\"Hello World this is a test\"\n        android:layout_height=\"wrap_content\"\n        android:background=\"@drawable/shadow_background\"\n        android:id=\"@+id/textView\"\n        android:textAlignment=\"center\"\n        android:maxWidth=\"240dp\"\n        android:textSize=\"20dp\"\n        android:layout_width=\"200dp\" />\n</LinearLayout>"
  },
  {
    "path": "boardview/src/main/res/values/attrs.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n    <declare-styleable name=\"BoardView\">\n        <attr name=\"boardItemBackground\" format=\"color\" />\n    </declare-styleable>\n</resources>"
  },
  {
    "path": "boardview/src/main/res/values/strings.xml",
    "content": "<resources>\n    <string name=\"app_name\">BoardView</string>\n</resources>\n"
  },
  {
    "path": "boardview/src/test/java/com/allyants/boardview/ExampleUnitTest.java",
    "content": "package com.allyants.boardview;\n\nimport org.junit.Test;\n\nimport static org.junit.Assert.*;\n\n/**\n * Example local unit test, which will execute on the development machine (host).\n *\n * @see <a href=\"http://d.android.com/tools/testing\">Testing documentation</a>\n */\npublic class ExampleUnitTest {\n    @Test\n    public void addition_isCorrect() throws Exception {\n        assertEquals(4, 2 + 2);\n    }\n}"
  },
  {
    "path": "build.gradle",
    "content": "// Top-level build file where you can add configuration options common to all sub-projects/modules.\n\nbuildscript {\n    repositories {\n        jcenter()\n    }\n    dependencies {\n        classpath 'com.android.tools.build:gradle:2.2.3'\n\n        // NOTE: Do not place your application dependencies here; they belong\n        // in the individual module build.gradle files\n    }\n}\n\nallprojects {\n    repositories {\n        jcenter()\n    }\n}\n\ntask clean(type: Delete) {\n    delete rootProject.buildDir\n}\n"
  },
  {
    "path": "gradle/wrapper/gradle-wrapper.properties",
    "content": "#Mon Dec 28 10:00:20 PST 2015\ndistributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\nzipStoreBase=GRADLE_USER_HOME\nzipStorePath=wrapper/dists\ndistributionUrl=https\\://services.gradle.org/distributions/gradle-2.14.1-all.zip\n"
  },
  {
    "path": "gradle.properties",
    "content": "# Project-wide Gradle settings.\n\n# IDE (e.g. Android Studio) users:\n# Gradle settings configured through the IDE *will override*\n# any settings specified in this file.\n\n# For more details on how to configure your build environment visit\n# http://www.gradle.org/docs/current/userguide/build_environment.html\n\n# Specifies the JVM arguments used for the daemon process.\n# The setting is particularly useful for tweaking memory settings.\norg.gradle.jvmargs=-Xmx1536m\n\n# When configured, Gradle will run in incubating parallel mode.\n# This option should only be used with decoupled projects. More details, visit\n# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects\n# org.gradle.parallel=true\n"
  },
  {
    "path": "gradlew",
    "content": "#!/usr/bin/env bash\n\n##############################################################################\n##\n##  Gradle start up script for UN*X\n##\n##############################################################################\n\n# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\nDEFAULT_JVM_OPTS=\"\"\n\nAPP_NAME=\"Gradle\"\nAPP_BASE_NAME=`basename \"$0\"`\n\n# Use the maximum available, or set MAX_FD != -1 to use that value.\nMAX_FD=\"maximum\"\n\nwarn ( ) {\n    echo \"$*\"\n}\n\ndie ( ) {\n    echo\n    echo \"$*\"\n    echo\n    exit 1\n}\n\n# OS specific support (must be 'true' or 'false').\ncygwin=false\nmsys=false\ndarwin=false\ncase \"`uname`\" in\n  CYGWIN* )\n    cygwin=true\n    ;;\n  Darwin* )\n    darwin=true\n    ;;\n  MINGW* )\n    msys=true\n    ;;\nesac\n\n# Attempt to set APP_HOME\n# Resolve links: $0 may be a link\nPRG=\"$0\"\n# Need this for relative symlinks.\nwhile [ -h \"$PRG\" ] ; do\n    ls=`ls -ld \"$PRG\"`\n    link=`expr \"$ls\" : '.*-> \\(.*\\)$'`\n    if expr \"$link\" : '/.*' > /dev/null; then\n        PRG=\"$link\"\n    else\n        PRG=`dirname \"$PRG\"`\"/$link\"\n    fi\ndone\nSAVED=\"`pwd`\"\ncd \"`dirname \\\"$PRG\\\"`/\" >/dev/null\nAPP_HOME=\"`pwd -P`\"\ncd \"$SAVED\" >/dev/null\n\nCLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar\n\n# Determine the Java command to use to start the JVM.\nif [ -n \"$JAVA_HOME\" ] ; then\n    if [ -x \"$JAVA_HOME/jre/sh/java\" ] ; then\n        # IBM's JDK on AIX uses strange locations for the executables\n        JAVACMD=\"$JAVA_HOME/jre/sh/java\"\n    else\n        JAVACMD=\"$JAVA_HOME/bin/java\"\n    fi\n    if [ ! -x \"$JAVACMD\" ] ; then\n        die \"ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\n    fi\nelse\n    JAVACMD=\"java\"\n    which java >/dev/null 2>&1 || die \"ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\nfi\n\n# Increase the maximum file descriptors if we can.\nif [ \"$cygwin\" = \"false\" -a \"$darwin\" = \"false\" ] ; then\n    MAX_FD_LIMIT=`ulimit -H -n`\n    if [ $? -eq 0 ] ; then\n        if [ \"$MAX_FD\" = \"maximum\" -o \"$MAX_FD\" = \"max\" ] ; then\n            MAX_FD=\"$MAX_FD_LIMIT\"\n        fi\n        ulimit -n $MAX_FD\n        if [ $? -ne 0 ] ; then\n            warn \"Could not set maximum file descriptor limit: $MAX_FD\"\n        fi\n    else\n        warn \"Could not query maximum file descriptor limit: $MAX_FD_LIMIT\"\n    fi\nfi\n\n# For Darwin, add options to specify how the application appears in the dock\nif $darwin; then\n    GRADLE_OPTS=\"$GRADLE_OPTS \\\"-Xdock:name=$APP_NAME\\\" \\\"-Xdock:icon=$APP_HOME/media/gradle.icns\\\"\"\nfi\n\n# For Cygwin, switch paths to Windows format before running java\nif $cygwin ; then\n    APP_HOME=`cygpath --path --mixed \"$APP_HOME\"`\n    CLASSPATH=`cygpath --path --mixed \"$CLASSPATH\"`\n    JAVACMD=`cygpath --unix \"$JAVACMD\"`\n\n    # We build the pattern for arguments to be converted via cygpath\n    ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`\n    SEP=\"\"\n    for dir in $ROOTDIRSRAW ; do\n        ROOTDIRS=\"$ROOTDIRS$SEP$dir\"\n        SEP=\"|\"\n    done\n    OURCYGPATTERN=\"(^($ROOTDIRS))\"\n    # Add a user-defined pattern to the cygpath arguments\n    if [ \"$GRADLE_CYGPATTERN\" != \"\" ] ; then\n        OURCYGPATTERN=\"$OURCYGPATTERN|($GRADLE_CYGPATTERN)\"\n    fi\n    # Now convert the arguments - kludge to limit ourselves to /bin/sh\n    i=0\n    for arg in \"$@\" ; do\n        CHECK=`echo \"$arg\"|egrep -c \"$OURCYGPATTERN\" -`\n        CHECK2=`echo \"$arg\"|egrep -c \"^-\"`                                 ### Determine if an option\n\n        if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then                    ### Added a condition\n            eval `echo args$i`=`cygpath --path --ignore --mixed \"$arg\"`\n        else\n            eval `echo args$i`=\"\\\"$arg\\\"\"\n        fi\n        i=$((i+1))\n    done\n    case $i in\n        (0) set -- ;;\n        (1) set -- \"$args0\" ;;\n        (2) set -- \"$args0\" \"$args1\" ;;\n        (3) set -- \"$args0\" \"$args1\" \"$args2\" ;;\n        (4) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" ;;\n        (5) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" ;;\n        (6) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" ;;\n        (7) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" ;;\n        (8) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" \"$args7\" ;;\n        (9) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" \"$args7\" \"$args8\" ;;\n    esac\nfi\n\n# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules\nfunction splitJvmOpts() {\n    JVM_OPTS=(\"$@\")\n}\neval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS\nJVM_OPTS[${#JVM_OPTS[*]}]=\"-Dorg.gradle.appname=$APP_BASE_NAME\"\n\nexec \"$JAVACMD\" \"${JVM_OPTS[@]}\" -classpath \"$CLASSPATH\" org.gradle.wrapper.GradleWrapperMain \"$@\"\n"
  },
  {
    "path": "gradlew.bat",
    "content": "@if \"%DEBUG%\" == \"\" @echo off\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\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\nset DIRNAME=%~dp0\nif \"%DIRNAME%\" == \"\" set DIRNAME=.\nset APP_BASE_NAME=%~n0\nset APP_HOME=%DIRNAME%\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 Windowz variants\n\nif not \"%OS%\" == \"Windows_NT\" goto win9xME_args\nif \"%@eval[2+2]\" == \"4\" goto 4NT_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=%*\ngoto execute\n\n:4NT_args\n@rem Get arguments from the 4NT Shell from JP Software\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": "settings.gradle",
    "content": "include ':app', ':boardview'\n"
  }
]