[
  {
    "path": ".github/ISSUE_TEMPLATE/bug_report.md",
    "content": "---\nname: Bug report\nabout: Create a report to help us improve\ntitle: ''\nlabels: bug\nassignees: ''\n\n---\n\n**Describe the bug**\nA clear and concise description of what the bug is.\n\n**Expected behavior**\nA clear and concise description of what you expected to happen.\n\n**Screenshots**\nIf applicable, add screenshots to help explain your problem.\n\n**Smartphone (please complete the following information):**\n - Device: [e.g. pixel google phone]\n - OS: [e.g. android 9.0/(28) ]\n - Version [e.g. 1.0.0]\n\n**Additional context**\nAdd any other context about the problem here.\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/feature_request.md",
    "content": "---\nname: Feature request\nabout: Suggest an idea for this project\ntitle: ''\nlabels: feature\nassignees: ''\n\n---\n\n**Is your feature request related to a problem? Please describe.**\nA clear and concise description of what the problem is. Ex. I'm always frustrated when [...]\n\n**Describe the solution you'd like**\nA clear and concise description of what you want to happen.\n\n**Describe alternatives you've considered**\nA clear and concise description of any alternative solutions or features you've considered.\n\n**Additional context**\nAdd any other context or screenshots about the feature request here.\n"
  },
  {
    "path": ".gitignore",
    "content": "*.iml\n.gradle\n/local.properties\n/.idea/caches\n/.idea/libraries\n/.idea/modules.xml\n/.idea/workspace.xml\n/.idea/navEditor.xml\n/.idea/assetWizardSettings.xml\n.DS_Store\n/build\n/captures\n.externalNativeBuild\n.idea"
  },
  {
    "path": "CHANGELOG",
    "content": "CarouselView\n\nv 1.0.0 Released!\n\n- showing horizontal and vertical\n- auto scrolling (with pause/resume)\n- change listener scrolling\n- slider mode/ carousel mode\n- change scrolling speed\n\nv 1.1.0 Released!\n\n- add lazy loading\n\nv 1.1.1 Released!\n\n- update dependecy\n- fix auto scroll in initialize\n"
  },
  {
    "path": "LICENSE.txt",
    "content": "\n                                 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."
  },
  {
    "path": "README.md",
    "content": "# CarouselView\n\n--------------------------------------------------------------------\nUseful library for showing list in sliding mode or carousel mode\n\nOptions\n- showing horizontal and vertical\n- auto scrolling (with pause/resume)\n- change listener scrolling\n- slider mode/ carousel mode\n- change scrolling speed\n \n### Issue\n- [bug report](.github/ISSUE_TEMPLATE/bug_report.md)\n- [feature request](.github/ISSUE_TEMPLATE/feature_request.md)\n\n\n### Usage\n\nadd to root build.gradle\n```groovy\n\n    maven { url \"https://jitpack.io\" }\n\n```\n\nadd to module build.gradle\n```groovy\n\n    implementation 'com.github.alirezat775:carousel-view:{latest-version}'\n\n```\n\n<img src=\"https://raw.githubusercontent.com/alirezat775/CarouselView/master/assets/demo.gif\" width=\"200\" height=\"400\" />\n\n\n- [changelog](CHANGELOG)\n\n### contribution guidelines\n\nplease commit in development branch and send a pull request to merge development branch.\nexplain better in a commit message, don't remove class author and add your data in a header of class\n"
  },
  {
    "path": "app/.gitignore",
    "content": "/build\n"
  },
  {
    "path": "app/build.gradle",
    "content": "apply plugin: 'com.android.application'\napply plugin: 'kotlin-android'\napply plugin: 'kotlin-android-extensions'\n\nandroid {\n    compileSdkVersion 28\n    defaultConfig {\n        applicationId \"alirezat775.carouselview\"\n        minSdkVersion 17\n        targetSdkVersion 28\n        versionCode 1\n        versionName \"1.0\"\n        testInstrumentationRunner \"androidx.test.runner.AndroidJUnitRunner\"\n    }\n    buildTypes {\n        release {\n            minifyEnabled false\n            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'\n        }\n    }\n\n    compileOptions {\n        sourceCompatibility JavaVersion.VERSION_1_8\n        targetCompatibility JavaVersion.VERSION_1_8\n    }\n}\n\ndependencies {\n    implementation fileTree(dir: 'libs', include: ['*.jar'])\n    implementation \"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version\"\n    implementation 'androidx.appcompat:appcompat:1.2.0-beta01'\n    implementation 'androidx.core:core-ktx:1.3.0-rc01'\n    implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta4'\n    implementation 'androidx.recyclerview:recyclerview:1.2.0-alpha02'\n    testImplementation 'junit:junit:4.13'\n    androidTestImplementation 'androidx.test:runner:1.2.0'\n    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'\n    implementation project(path: ':carouselview')\n}\n"
  },
  {
    "path": "app/proguard-rules.pro",
    "content": "# Add project specific ProGuard rules here.\n# You can control the set of applied configuration files using the\n# proguardFiles setting in build.gradle.\n#\n# For more details, see\n#   http://developer.android.com/guide/developing/tools/proguard.html\n\n# If your project uses WebView with JS, uncomment the following\n# and specify the fully qualified class name to the JavaScript interface\n# class:\n#-keepclassmembers class fqcn.of.javascript.interface.for.webview {\n#   public *;\n#}\n\n# Uncomment this to preserve the line number information for\n# debugging stack traces.\n#-keepattributes SourceFile,LineNumberTable\n\n# If you keep the line number information, uncomment this to\n# hide the original source file name.\n#-renamesourcefileattribute SourceFile\n"
  },
  {
    "path": "app/src/androidTest/java/alirezat775/carouselview/ExampleInstrumentedTest.kt",
    "content": "package alirezat775.carouselview\n\nimport androidx.test.InstrumentationRegistry\nimport androidx.test.runner.AndroidJUnit4\n\nimport org.junit.Test\nimport org.junit.runner.RunWith\n\nimport org.junit.Assert.*\n\n/**\n * Instrumented test, which will execute on an Android device.\n *\n * See [testing documentation](http://d.android.com/tools/testing).\n */\n@RunWith(AndroidJUnit4::class)\nclass ExampleInstrumentedTest {\n    @Test\n    fun useAppContext() {\n        // Context of the app under test.\n        val appContext = InstrumentationRegistry.getTargetContext()\n        assertEquals(\"alirezat775.carouselview\", appContext.packageName)\n    }\n}\n"
  },
  {
    "path": "app/src/main/AndroidManifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n          package=\"alirezat775.carouselview\">\n\n    <application\n            android:allowBackup=\"true\"\n            android:icon=\"@mipmap/ic_launcher\"\n            android:label=\"@string/app_name\"\n            android:roundIcon=\"@mipmap/ic_launcher_round\"\n            android:supportsRtl=\"true\"\n            android:theme=\"@style/AppTheme\">\n        <activity android:name=\".sample.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/alirezat775/carouselview/sample/EmptySampleModel.kt",
    "content": "package alirezat775.carouselview.sample\n\nimport alirezat775.lib.carouselview.CarouselModel\n\nclass EmptySampleModel constructor(private val text: String) : CarouselModel() {\n\n    fun getText(): String {\n        return text\n    }\n}"
  },
  {
    "path": "app/src/main/java/alirezat775/carouselview/sample/MainActivity.kt",
    "content": "package alirezat775.carouselview.sample\n\nimport alirezat775.carouselview.R\nimport alirezat775.lib.carouselview.Carousel\nimport alirezat775.lib.carouselview.CarouselLazyLoadListener\nimport alirezat775.lib.carouselview.CarouselListener\nimport alirezat775.lib.carouselview.CarouselView\nimport android.os.Bundle\nimport android.util.Log\nimport androidx.appcompat.app.AppCompatActivity\nimport kotlinx.android.synthetic.main.activity_main.*\n\nclass MainActivity : AppCompatActivity() {\n\n    private var hasNextPage: Boolean = true\n    val TAG: String = this::class.java.name\n\n    override fun onCreate(savedInstanceState: Bundle?) {\n        super.onCreate(savedInstanceState)\n        setContentView(R.layout.activity_main)\n\n        val adapter = SampleAdapter()\n        val carousel = Carousel(this, carousel_view, adapter)\n        carousel.setOrientation(CarouselView.HORIZONTAL, false)\n        carousel.autoScroll(true, 5000, true)\n        carousel.scaleView(true)\n        carousel.lazyLoad(true, object : CarouselLazyLoadListener {\n            override fun onLoadMore(page: Int, totalItemsCount: Int, view: CarouselView) {\n                if (hasNextPage) {\n                    Log.d(TAG, \"load new item on lazy mode\")\n                    carousel.add(SampleModel(11))\n                    carousel.add(SampleModel(12))\n                    carousel.add(SampleModel(13))\n                    carousel.add(SampleModel(14))\n                    carousel.add(SampleModel(15))\n                    hasNextPage = false\n                }\n            }\n        })\n        adapter.setOnClickListener(object :\n            SampleAdapter.OnClick {\n            override fun click(model: SampleModel) {\n                carousel.remove(model)\n            }\n        })\n//        carousel.scrollSpeed(100f)\n//        carousel.enableSlider(true)\n\n        carousel.addCarouselListener(object : CarouselListener {\n            override fun onPositionChange(position: Int) {\n                Log.d(TAG, \"currentPosition : $position\")\n            }\n\n            override fun onScroll(dx: Int, dy: Int) {\n                Log.d(TAG, \"onScroll dx : $dx -- dy : $dx\")\n            }\n        })\n\n//        carousel.add(EmptySampleModel(\"empty list\"))\n        carousel.add(SampleModel(1))\n        carousel.add(SampleModel(2))\n        carousel.add(SampleModel(3))\n        carousel.add(SampleModel(4))\n        carousel.add(SampleModel(5))\n        carousel.add(SampleModel(6))\n        carousel.add(SampleModel(7))\n        carousel.add(SampleModel(8))\n        carousel.add(SampleModel(9))\n        carousel.add(SampleModel(10))\n\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/alirezat775/carouselview/sample/SampleAdapter.kt",
    "content": "package alirezat775.carouselview.sample\n\nimport alirezat775.carouselview.R\nimport alirezat775.lib.carouselview.CarouselAdapter\nimport android.view.LayoutInflater\nimport android.view.View\nimport android.view.ViewGroup\nimport android.widget.TextView\nimport kotlinx.android.synthetic.main.item_carousel.view.*\nimport kotlinx.android.synthetic.main.item_empty_carousel.view.*\n\n/**\n * Author:  Alireza Tizfahm Fard\n * Date:    2019-06-14\n * Email:   alirezat775@gmail.com\n */\n\nclass SampleAdapter : CarouselAdapter() {\n\n    private val EMPTY_ITEM = 0\n    private val NORMAL_ITEM = 1\n\n    private var vh: CarouselViewHolder? = null\n    var onClick: OnClick? = null\n\n    fun setOnClickListener(onClick: OnClick?) {\n        this.onClick = onClick\n    }\n\n    override fun getItemViewType(position: Int): Int {\n        return when (getItems()[position]) {\n            is EmptySampleModel -> EMPTY_ITEM\n            else -> NORMAL_ITEM\n        }\n    }\n\n    override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): CarouselViewHolder {\n        val inflater = LayoutInflater.from(parent.context)\n        return if (viewType == NORMAL_ITEM) {\n            val v = inflater.inflate(R.layout.item_carousel, parent, false)\n            vh = MyViewHolder(v)\n            vh as MyViewHolder\n        } else {\n            val v = inflater.inflate(R.layout.item_empty_carousel, parent, false)\n            vh = EmptyMyViewHolder(v)\n            vh as EmptyMyViewHolder\n        }\n    }\n\n    override fun onBindViewHolder(holder: CarouselViewHolder, position: Int) {\n        when (holder) {\n            is MyViewHolder -> {\n                vh = holder\n                val model = getItems()[position] as SampleModel\n                (vh as MyViewHolder).title.text = model.getId().toString()\n            }\n            else -> {\n                vh = holder\n                val model = getItems()[position] as EmptySampleModel\n                (vh as EmptyMyViewHolder).titleEmpty.text = model.getText()\n            }\n        }\n    }\n\n    inner class MyViewHolder(itemView: View) : CarouselViewHolder(itemView) {\n\n        var title: TextView = itemView.item_text\n\n        init {\n            title.setOnClickListener { onClick?.click(getItems()[adapterPosition] as SampleModel) }\n        }\n\n    }\n\n    inner class EmptyMyViewHolder(itemView: View) : CarouselViewHolder(itemView) {\n        var titleEmpty: TextView = itemView.item_empty_text\n    }\n\n    interface OnClick {\n        fun click(model: SampleModel)\n    }\n}"
  },
  {
    "path": "app/src/main/java/alirezat775/carouselview/sample/SampleModel.kt",
    "content": "package alirezat775.carouselview.sample\n\nimport alirezat775.lib.carouselview.CarouselModel\n\nclass SampleModel constructor(private var id: Int) : CarouselModel() {\n\n    fun getId(): Int {\n        return id\n    }\n}\n"
  },
  {
    "path": "app/src/main/res/drawable/ic_launcher_background.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<vector\n        xmlns:android=\"http://schemas.android.com/apk/res/android\"\n        android:height=\"108dp\"\n        android:width=\"108dp\"\n        android:viewportHeight=\"108\"\n        android:viewportWidth=\"108\">\n    <path android:fillColor=\"#008577\"\n          android:pathData=\"M0,0h108v108h-108z\"/>\n    <path android:fillColor=\"#00000000\" android:pathData=\"M9,0L9,108\"\n          android:strokeColor=\"#33FFFFFF\" android:strokeWidth=\"0.8\"/>\n    <path android:fillColor=\"#00000000\" android:pathData=\"M19,0L19,108\"\n          android:strokeColor=\"#33FFFFFF\" android:strokeWidth=\"0.8\"/>\n    <path android:fillColor=\"#00000000\" android:pathData=\"M29,0L29,108\"\n          android:strokeColor=\"#33FFFFFF\" android:strokeWidth=\"0.8\"/>\n    <path android:fillColor=\"#00000000\" android:pathData=\"M39,0L39,108\"\n          android:strokeColor=\"#33FFFFFF\" android:strokeWidth=\"0.8\"/>\n    <path android:fillColor=\"#00000000\" android:pathData=\"M49,0L49,108\"\n          android:strokeColor=\"#33FFFFFF\" android:strokeWidth=\"0.8\"/>\n    <path android:fillColor=\"#00000000\" android:pathData=\"M59,0L59,108\"\n          android:strokeColor=\"#33FFFFFF\" android:strokeWidth=\"0.8\"/>\n    <path android:fillColor=\"#00000000\" android:pathData=\"M69,0L69,108\"\n          android:strokeColor=\"#33FFFFFF\" android:strokeWidth=\"0.8\"/>\n    <path android:fillColor=\"#00000000\" android:pathData=\"M79,0L79,108\"\n          android:strokeColor=\"#33FFFFFF\" android:strokeWidth=\"0.8\"/>\n    <path android:fillColor=\"#00000000\" android:pathData=\"M89,0L89,108\"\n          android:strokeColor=\"#33FFFFFF\" android:strokeWidth=\"0.8\"/>\n    <path android:fillColor=\"#00000000\" android:pathData=\"M99,0L99,108\"\n          android:strokeColor=\"#33FFFFFF\" android:strokeWidth=\"0.8\"/>\n    <path android:fillColor=\"#00000000\" android:pathData=\"M0,9L108,9\"\n          android:strokeColor=\"#33FFFFFF\" android:strokeWidth=\"0.8\"/>\n    <path android:fillColor=\"#00000000\" android:pathData=\"M0,19L108,19\"\n          android:strokeColor=\"#33FFFFFF\" android:strokeWidth=\"0.8\"/>\n    <path android:fillColor=\"#00000000\" android:pathData=\"M0,29L108,29\"\n          android:strokeColor=\"#33FFFFFF\" android:strokeWidth=\"0.8\"/>\n    <path android:fillColor=\"#00000000\" android:pathData=\"M0,39L108,39\"\n          android:strokeColor=\"#33FFFFFF\" android:strokeWidth=\"0.8\"/>\n    <path android:fillColor=\"#00000000\" android:pathData=\"M0,49L108,49\"\n          android:strokeColor=\"#33FFFFFF\" android:strokeWidth=\"0.8\"/>\n    <path android:fillColor=\"#00000000\" android:pathData=\"M0,59L108,59\"\n          android:strokeColor=\"#33FFFFFF\" android:strokeWidth=\"0.8\"/>\n    <path android:fillColor=\"#00000000\" android:pathData=\"M0,69L108,69\"\n          android:strokeColor=\"#33FFFFFF\" android:strokeWidth=\"0.8\"/>\n    <path android:fillColor=\"#00000000\" android:pathData=\"M0,79L108,79\"\n          android:strokeColor=\"#33FFFFFF\" android:strokeWidth=\"0.8\"/>\n    <path android:fillColor=\"#00000000\" android:pathData=\"M0,89L108,89\"\n          android:strokeColor=\"#33FFFFFF\" android:strokeWidth=\"0.8\"/>\n    <path android:fillColor=\"#00000000\" android:pathData=\"M0,99L108,99\"\n          android:strokeColor=\"#33FFFFFF\" android:strokeWidth=\"0.8\"/>\n    <path android:fillColor=\"#00000000\" android:pathData=\"M19,29L89,29\"\n          android:strokeColor=\"#33FFFFFF\" android:strokeWidth=\"0.8\"/>\n    <path android:fillColor=\"#00000000\" android:pathData=\"M19,39L89,39\"\n          android:strokeColor=\"#33FFFFFF\" android:strokeWidth=\"0.8\"/>\n    <path android:fillColor=\"#00000000\" android:pathData=\"M19,49L89,49\"\n          android:strokeColor=\"#33FFFFFF\" android:strokeWidth=\"0.8\"/>\n    <path android:fillColor=\"#00000000\" android:pathData=\"M19,59L89,59\"\n          android:strokeColor=\"#33FFFFFF\" android:strokeWidth=\"0.8\"/>\n    <path android:fillColor=\"#00000000\" android:pathData=\"M19,69L89,69\"\n          android:strokeColor=\"#33FFFFFF\" android:strokeWidth=\"0.8\"/>\n    <path android:fillColor=\"#00000000\" android:pathData=\"M19,79L89,79\"\n          android:strokeColor=\"#33FFFFFF\" android:strokeWidth=\"0.8\"/>\n    <path android:fillColor=\"#00000000\" android:pathData=\"M29,19L29,89\"\n          android:strokeColor=\"#33FFFFFF\" android:strokeWidth=\"0.8\"/>\n    <path android:fillColor=\"#00000000\" android:pathData=\"M39,19L39,89\"\n          android:strokeColor=\"#33FFFFFF\" android:strokeWidth=\"0.8\"/>\n    <path android:fillColor=\"#00000000\" android:pathData=\"M49,19L49,89\"\n          android:strokeColor=\"#33FFFFFF\" android:strokeWidth=\"0.8\"/>\n    <path android:fillColor=\"#00000000\" android:pathData=\"M59,19L59,89\"\n          android:strokeColor=\"#33FFFFFF\" android:strokeWidth=\"0.8\"/>\n    <path android:fillColor=\"#00000000\" android:pathData=\"M69,19L69,89\"\n          android:strokeColor=\"#33FFFFFF\" android:strokeWidth=\"0.8\"/>\n    <path android:fillColor=\"#00000000\" android:pathData=\"M79,19L79,89\"\n          android:strokeColor=\"#33FFFFFF\" android:strokeWidth=\"0.8\"/>\n</vector>\n"
  },
  {
    "path": "app/src/main/res/drawable-v24/ic_launcher_foreground.xml",
    "content": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n        xmlns:aapt=\"http://schemas.android.com/aapt\"\n        android:width=\"108dp\"\n        android:height=\"108dp\"\n        android:viewportHeight=\"108\"\n        android:viewportWidth=\"108\">\n    <path\n            android:fillType=\"evenOdd\"\n            android:pathData=\"M32,64C32,64 38.39,52.99 44.13,50.95C51.37,48.37 70.14,49.57 70.14,49.57L108.26,87.69L108,109.01L75.97,107.97L32,64Z\"\n            android:strokeColor=\"#00000000\"\n            android:strokeWidth=\"1\">\n        <aapt:attr name=\"android:fillColor\">\n            <gradient\n                    android:endX=\"78.5885\"\n                    android:endY=\"90.9159\"\n                    android:startX=\"48.7653\"\n                    android:startY=\"61.0927\"\n                    android:type=\"linear\">\n                <item\n                        android:color=\"#44000000\"\n                        android:offset=\"0.0\"/>\n                <item\n                        android:color=\"#00000000\"\n                        android:offset=\"1.0\"/>\n            </gradient>\n        </aapt:attr>\n    </path>\n    <path\n            android:fillColor=\"#FFFFFF\"\n            android:fillType=\"nonZero\"\n            android:pathData=\"M66.94,46.02L66.94,46.02C72.44,50.07 76,56.61 76,64L32,64C32,56.61 35.56,50.11 40.98,46.06L36.18,41.19C35.45,40.45 35.45,39.3 36.18,38.56C36.91,37.81 38.05,37.81 38.78,38.56L44.25,44.05C47.18,42.57 50.48,41.71 54,41.71C57.48,41.71 60.78,42.57 63.68,44.05L69.11,38.56C69.84,37.81 70.98,37.81 71.71,38.56C72.44,39.3 72.44,40.45 71.71,41.19L66.94,46.02ZM62.94,56.92C64.08,56.92 65,56.01 65,54.88C65,53.76 64.08,52.85 62.94,52.85C61.8,52.85 60.88,53.76 60.88,54.88C60.88,56.01 61.8,56.92 62.94,56.92ZM45.06,56.92C46.2,56.92 47.13,56.01 47.13,54.88C47.13,53.76 46.2,52.85 45.06,52.85C43.92,52.85 43,53.76 43,54.88C43,56.01 43.92,56.92 45.06,56.92Z\"\n            android:strokeColor=\"#00000000\"\n            android:strokeWidth=\"1\"/>\n</vector>\n"
  },
  {
    "path": "app/src/main/res/layout/activity_main.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<androidx.constraintlayout.widget.ConstraintLayout\n        xmlns:android=\"http://schemas.android.com/apk/res/android\"\n        xmlns:tools=\"http://schemas.android.com/tools\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"match_parent\"\n        tools:context=\".sample.MainActivity\">\n\n    <alirezat775.lib.carouselview.CarouselView\n            android:id=\"@+id/carousel_view\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"match_parent\"/>\n\n</androidx.constraintlayout.widget.ConstraintLayout>"
  },
  {
    "path": "app/src/main/res/layout/item_carousel.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=\"250dp\"\n              android:layout_height=\"250dp\">\n\n    <TextView\n            android:layout_margin=\"12dp\"\n            android:textColor=\"@android:color/white\"\n            android:background=\"@color/colorPrimary\"\n            android:gravity=\"center\"\n            android:textSize=\"22sp\"\n            android:id=\"@+id/item_text\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"match_parent\"/>\n\n</LinearLayout>"
  },
  {
    "path": "app/src/main/res/layout/item_empty_carousel.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\n    <TextView\n            android:layout_margin=\"12dp\"\n            android:textColor=\"@android:color/white\"\n            android:background=\"@color/colorAccent\"\n            android:gravity=\"center\"\n            android:textSize=\"22sp\"\n            android:id=\"@+id/item_empty_text\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"match_parent\"/>\n\n</LinearLayout>"
  },
  {
    "path": "app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<adaptive-icon xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <background android:drawable=\"@drawable/ic_launcher_background\"/>\n    <foreground android:drawable=\"@drawable/ic_launcher_foreground\"/>\n</adaptive-icon>"
  },
  {
    "path": "app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<adaptive-icon xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <background android:drawable=\"@drawable/ic_launcher_background\"/>\n    <foreground android:drawable=\"@drawable/ic_launcher_foreground\"/>\n</adaptive-icon>"
  },
  {
    "path": "app/src/main/res/values/colors.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n    <color name=\"colorPrimary\">#008577</color>\n    <color name=\"colorPrimaryDark\">#00574B</color>\n    <color name=\"colorAccent\">#D81B60</color>\n</resources>\n"
  },
  {
    "path": "app/src/main/res/values/strings.xml",
    "content": "<resources>\n    <string name=\"app_name\">CarouselView</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/test/java/alirezat775/carouselview/ExampleUnitTest.kt",
    "content": "package alirezat775.carouselview\n\nimport org.junit.Test\n\nimport org.junit.Assert.*\n\n/**\n * Example local unit test, which will execute on the development machine (host).\n *\n * See [testing documentation](http://d.android.com/tools/testing).\n */\nclass ExampleUnitTest {\n    @Test\n    fun addition_isCorrect() {\n        assertEquals(4, 2 + 2)\n    }\n}\n"
  },
  {
    "path": "build.gradle",
    "content": "buildscript {\n    ext.kotlin_version = '1.3.72'\n    repositories {\n        google()\n        jcenter()\n        \n    }\n    dependencies {\n        classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'\n        classpath 'com.android.tools.build:gradle:3.6.3'\n        classpath \"org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version\"\n    }\n}\n\nallprojects {\n    repositories {\n        google()\n        jcenter()\n        \n    }\n}\n\ntask clean(type: Delete) {\n    delete rootProject.buildDir\n}\n"
  },
  {
    "path": "build.sh",
    "content": "#!/usr/bin/env bash\n\n./gradlew clean\n./gradlew build\n./gradlew assemble"
  },
  {
    "path": "carouselview/.gitignore",
    "content": "/build\n"
  },
  {
    "path": "carouselview/build.gradle",
    "content": "apply plugin: 'com.android.library'\napply plugin: 'kotlin-android'\napply plugin: 'kotlin-android-extensions'\napply plugin: 'com.github.dcendents.android-maven'\ngroup = 'com.github.alirezat775'\n\nandroid {\n    compileSdkVersion 28\n\n    defaultConfig {\n        minSdkVersion 17\n        targetSdkVersion 28\n        versionCode 3\n        versionName \"1.1.1\"\n        testInstrumentationRunner \"androidx.test.runner.AndroidJUnitRunner\"\n    }\n\n    buildTypes {\n        release {\n            minifyEnabled false\n            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'\n        }\n    }\n}\n\ndependencies {\n    implementation fileTree(dir: 'libs', include: ['*.jar'])\n    implementation 'androidx.core:core-ktx:1.3.0-rc01'\n    implementation \"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version\"\n    implementation 'androidx.appcompat:appcompat:1.1.0'\n    implementation 'androidx.recyclerview:recyclerview:1.2.0-alpha02'\n    testImplementation 'junit:junit:4.13'\n    androidTestImplementation 'androidx.test:runner:1.2.0'\n    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'\n}\nrepositories {\n    mavenCentral()\n}\n"
  },
  {
    "path": "carouselview/proguard-rules.pro",
    "content": "# Add project specific ProGuard rules here.\n# You can control the set of applied configuration files using the\n# proguardFiles setting in build.gradle.\n#\n# For more details, see\n#   http://developer.android.com/guide/developing/tools/proguard.html\n\n# If your project uses WebView with JS, uncomment the following\n# and specify the fully qualified class name to the JavaScript interface\n# class:\n#-keepclassmembers class fqcn.of.javascript.interface.for.webview {\n#   public *;\n#}\n\n# Uncomment this to preserve the line number information for\n# debugging stack traces.\n#-keepattributes SourceFile,LineNumberTable\n\n# If you keep the line number information, uncomment this to\n# hide the original source file name.\n#-renamesourcefileattribute SourceFile\n"
  },
  {
    "path": "carouselview/src/androidTest/java/alirezat775/lib/carouselview/ExampleInstrumentedTest.kt",
    "content": "package alirezat775.lib.carouselview\n\nimport android.content.Context\nimport androidx.test.InstrumentationRegistry\nimport androidx.test.runner.AndroidJUnit4\n\nimport org.junit.Test\nimport org.junit.runner.RunWith\n\nimport org.junit.Assert.*\n\n/**\n * Instrumented test, which will execute on an Android device.\n *\n * @see [Testing documentation](http://d.android.com/tools/testing)\n */\n@RunWith(AndroidJUnit4::class)\nclass ExampleInstrumentedTest {\n    @Test\n    fun useAppContext() {\n        // Context of the app under test.\n        val appContext = InstrumentationRegistry.getTargetContext()\n\n        assertEquals(\"alirezat775.lib.carouselview.test\", appContext.getPackageName())\n    }\n}\n"
  },
  {
    "path": "carouselview/src/main/AndroidManifest.xml",
    "content": "<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n          package=\"alirezat775.lib.carouselview\"/>\n"
  },
  {
    "path": "carouselview/src/main/java/alirezat775/lib/carouselview/Carousel.kt",
    "content": "package alirezat775.lib.carouselview\n\nimport alirezat775.lib.carouselview.helper.EndlessListener\nimport alirezat775.lib.carouselview.helper.ViewHelper\nimport android.content.Context\nimport androidx.annotation.NonNull\nimport androidx.appcompat.app.AppCompatActivity\nimport androidx.recyclerview.widget.RecyclerView\n\n/**\n * Author:  Alireza Tizfahm Fard\n * Date:    2019-06-14\n * Email:   alirezat775@gmail.com\n */\n\nclass Carousel constructor(\n    private var context: Context,\n    @NonNull private var carouselView: CarouselView,\n    @NonNull private var adapter: CarouselAdapter\n) {\n\n    private var manager: CarouselLayoutManager? = null\n    private var carouselLazyLoadListener: CarouselLazyLoadListener? = null\n\n    init {\n        carouselView.layoutManager = getManager()\n        carouselView.adapter = adapter\n        carouselView.isAutoScroll = false\n    }\n\n    /**\n     * @param orientation set VERTICAL/HORIZONTAL\n     * @param reverseLayout set RTL layout\n     */\n    fun setOrientation(\n        @CarouselView.CarouselOrientation orientation: Int, reverseLayout: Boolean,\n        enablePadding: Boolean = true\n    ) {\n        manager = CarouselLayoutManager(context, orientation, reverseLayout)\n        carouselView.layoutManager = manager\n        val padding: Int\n        when (orientation) {\n            CarouselView.HORIZONTAL -> {\n                padding = if (enablePadding) ViewHelper.getScreenWidth() / 4 else 1\n                carouselView.setPadding(padding, 0, padding, 0)\n            }\n            CarouselView.VERTICAL -> {\n                padding = if (enablePadding) ViewHelper.getScreenHeight() / 4 else 1\n                carouselView.setPadding(0, padding, 0, padding)\n            }\n        }\n    }\n\n    fun addCarouselListener(listener: CarouselListener) {\n        carouselView.listener = listener\n    }\n\n    fun removeCarouselListener() {\n        carouselView.listener = null\n    }\n\n    /**\n     * lazyLoad load more item with infinity scroll.\n     * for enable this feature should be pass true value in first parameter\n     * and pass child of CarouselLazyLoadListener for second parameter\n     * for disable this feature should be pass false value in first argument\n     * and pass null for second parameter\n     *\n     * @param lazy this flag enable or disable lazy loading view\n     * @param carouselLazyLoadListener listener when need call load more item\n     */\n    fun lazyLoad(lazy: Boolean, carouselLazyLoadListener: CarouselLazyLoadListener?) {\n        this.carouselLazyLoadListener = carouselLazyLoadListener\n\n        if (lazy)\n            carouselView.addOnScrollListener(object : EndlessListener(getManager()!!) {\n                override fun onLoadMore(page: Int, totalItemsCount: Int, view: RecyclerView) {\n                    carouselLazyLoadListener?.onLoadMore(page, totalItemsCount, view as CarouselView)\n                }\n            })\n        else\n            carouselView.clearOnScrollListeners()\n    }\n\n    /**\n     * @param scaleView enable scaleView item\n     */\n    fun scaleView(scaleView: Boolean) {\n        getManager()?.scaleView(scaleView)\n    }\n\n    /**\n     * @return CarouselLayoutManager\n     */\n    private fun getManager(): CarouselLayoutManager? {\n        if (manager == null) setOrientation(CarouselView.VERTICAL, false)\n        return manager\n    }\n\n    /**\n     * @param items list items should be add to carousel\n     */\n    fun addAll(items: MutableList<CarouselModel>) {\n        adapter.addAll(items)\n    }\n\n    /**\n     * @param item one item should be add to carousel\n     */\n    fun add(item: CarouselModel) {\n        adapter.operation(item, CarouselAdapter.ADD)\n    }\n\n    /**\n     * @param item list items should be remove to carousel\n     */\n    fun remove(item: CarouselModel) {\n        adapter.operation(item, CarouselAdapter.REMOVE)\n    }\n\n    /**\n     * @param currentPosition\n     */\n    fun setCurrentPosition(currentPosition: Int) {\n        carouselView.scrollToPosition(currentPosition)\n    }\n\n    /**\n     * @return current item position\n     */\n    fun getCurrentPosition(): Int {\n        return carouselView.currentPosition\n    }\n\n    /**\n     * pause auto scrolling\n     */\n    fun pauseAutoScroll() {\n        carouselView.pauseAutoScroll()\n    }\n\n    /**\n     * resume auto scrolling\n     */\n    fun resumeAutoScroll() {\n        carouselView.resumeAutoScroll()\n    }\n\n    /**\n     * @param autoScroll\n     * @param delayMillis\n     * @param loopMode\n     */\n    fun autoScroll(autoScroll: Boolean, delayMillis: Long, loopMode: Boolean) {\n        carouselView.isAutoScroll = autoScroll\n        carouselView.delayMillis = delayMillis\n        carouselView.isLoopMode = loopMode\n    }\n\n    /**\n     * @param enableSlider enable slider mode\n     */\n    fun enableSlider(enableSlider: Boolean) {\n        if (getManager()?.orientation == CarouselView.VERTICAL)\n            throw IllegalStateException(\"for using slider mode, orientation must be is HORIZONTAL\")\n        else\n            adapter.enableSlider(enableSlider)\n    }\n\n    /**\n     * @param scrollSpeed change speed scrolling item\n     */\n    fun scrollSpeed(scrollSpeed: Float) {\n        getManager()?.setScrollSpeed(scrollSpeed)\n    }\n\n}"
  },
  {
    "path": "carouselview/src/main/java/alirezat775/lib/carouselview/CarouselAdapter.kt",
    "content": "package alirezat775.lib.carouselview\n\nimport alirezat775.lib.carouselview.helper.ViewHelper\nimport android.view.View\nimport androidx.recyclerview.widget.RecyclerView\nimport java.util.*\nimport kotlin.math.roundToInt\n\n/**\n * Author:  Alireza Tizfahm Fard\n * Date:    2019-06-14\n * Email:   alirezat775@gmail.com\n */\n\nabstract class CarouselAdapter : RecyclerView.Adapter<CarouselAdapter.CarouselViewHolder>() {\n\n    companion object {\n        const val REMOVE = 1\n        const val ADD = 2\n    }\n\n    private lateinit var recyclerView: RecyclerView\n    private var enableSlider = false\n    private var items: MutableList<CarouselModel> = ArrayList()\n\n    private fun imageOption(view: View) {\n        view.layoutParams.width = ViewHelper.getScreenWidth().toDouble().roundToInt()\n        view.layoutParams.height = (view.layoutParams.width * 0.70).roundToInt()\n        view.requestLayout()\n    }\n\n    override fun getItemCount(): Int {\n        return items.size\n    }\n\n    override fun onAttachedToRecyclerView(recyclerView: RecyclerView) {\n        super.onAttachedToRecyclerView(recyclerView)\n        this.recyclerView = recyclerView\n    }\n\n    override fun onDetachedFromRecyclerView(recyclerView: RecyclerView) {\n        super.onDetachedFromRecyclerView(recyclerView)\n        this.recyclerView = recyclerView\n    }\n\n    /**\n     * @return list items\n     */\n    fun getItems(): MutableList<CarouselModel> {\n        return items\n    }\n\n    /**\n     * @param item      instance CarouselModel\n     * @param operation action add or remove\n     */\n    fun operation(item: CarouselModel, operation: Int) {\n        when (operation) {\n            ADD -> add(item)\n            REMOVE -> remove(item)\n        }\n    }\n\n    fun addAll(items: MutableList<CarouselModel>) {\n        this.items = items\n        notifyDataSetChanged()\n    }\n\n    /**\n     * add item to list and notifyDataSetChanged adapter\n     *\n     * @param item instance CarouselModel\n     */\n    private fun add(item: CarouselModel) {\n        notifyItemInserted(itemCount - 1)\n        getItems().add(item)\n    }\n\n    /**\n     * remove item from list and notifyDataSetChanged adapter\n     *\n     * @param item instance CarouselModel\n     */\n    private fun remove(item: CarouselModel) {\n        notifyItemRemoved(getItems().indexOf(item))\n        getItems().remove(item)\n    }\n\n    private fun isEnableSlider(): Boolean {\n        return enableSlider\n    }\n\n    fun enableSlider(enableSlider: Boolean) {\n        this.enableSlider = enableSlider\n    }\n\n    open inner class CarouselViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {\n        init {\n            if (isEnableSlider()) imageOption(itemView)\n        }\n    }\n}"
  },
  {
    "path": "carouselview/src/main/java/alirezat775/lib/carouselview/CarouselLayoutManager.kt",
    "content": "package alirezat775.lib.carouselview\n\nimport android.content.Context\nimport android.graphics.PointF\nimport android.util.DisplayMetrics\nimport androidx.recyclerview.widget.LinearLayoutManager\nimport androidx.recyclerview.widget.LinearSmoothScroller\nimport androidx.recyclerview.widget.RecyclerView\n\n/**\n * Author:  Alireza Tizfahm Fard\n * Date:    12/7/17\n * Email:   alirezat775@gmail.com\n */\nclass CarouselLayoutManager(context: Context?, orientation: Int, reverseLayout: Boolean) :\n    LinearLayoutManager(context, orientation, reverseLayout) {\n\n    private val shrinkAmount = 0.15f\n    private val shrinkDistance = 0.9f\n    private var smoothScroller: SmoothScroller? = null\n\n    var anchor: Int = 0\n\n    private var scaleView = true\n\n    init {\n        if (smoothScroller == null) {\n            smoothScroller = SmoothScroller(context)\n        }\n    }\n\n    /**\n     * @param scaleView set center view scale\n     */\n    fun scaleView(scaleView: Boolean) {\n        this.scaleView = scaleView\n    }\n\n    private fun isScaleView(): Boolean {\n        return scaleView\n    }\n\n    /**\n     * @param recycler\n     * @param state\n     */\n    override fun onLayoutChildren(recycler: RecyclerView.Recycler?, state: RecyclerView.State) {\n        super.onLayoutChildren(recycler, state)\n        scrollVerticallyBy(0, recycler, state)\n        scrollHorizontallyBy(0, recycler, state)\n    }\n\n    /**\n     * @param dy\n     * @param recycler\n     * @param state\n     * @return\n     */\n    override fun scrollVerticallyBy(dy: Int, recycler: RecyclerView.Recycler?, state: RecyclerView.State?): Int {\n        val orientation = orientation\n        if (orientation == VERTICAL) {\n            val scrolled = super.scrollVerticallyBy(dy, recycler, state)\n            if (isScaleView()) {\n                val midpoint = height / 2f\n                val d0 = 0f\n                val d1 = shrinkDistance * midpoint\n                val s0 = 1f\n                val s1 = 1f - shrinkAmount\n                for (i in 0 until childCount) {\n                    val child = getChildAt(i)\n                    val childMidpoint = (getDecoratedBottom(child!!) + getDecoratedTop(child)) / 2f\n                    val d = Math.min(d1, Math.abs(midpoint - childMidpoint))\n                    val scale = s0 + (s1 - s0) * (d - d0) / (d1 - d0)\n                    child.scaleX = scale\n                    child.scaleY = scale\n                }\n            }\n            return scrolled\n        } else {\n            return 0\n        }\n    }\n\n    /**\n     * @param dx\n     * @param recycler\n     * @param state\n     * @return\n     */\n    override fun scrollHorizontallyBy(dx: Int, recycler: RecyclerView.Recycler?, state: RecyclerView.State?): Int {\n        val orientation = orientation\n        if (orientation == HORIZONTAL) {\n            val scrolled = super.scrollHorizontallyBy(dx, recycler, state)\n            if (isScaleView()) {\n                val midpoint = width / 2f\n                val d0 = 0f\n                val d1 = shrinkDistance * midpoint\n                val s0 = 1f\n                val s1 = 1f - shrinkAmount\n                for (i in 0 until childCount) {\n                    val child = getChildAt(i)\n                    val childMidpoint = (getDecoratedRight(child!!) + getDecoratedLeft(child)) / 2f\n                    val d = Math.min(d1, Math.abs(midpoint - childMidpoint))\n                    val scale = s0 + (s1 - s0) * (d - d0) / (d1 - d0)\n                    child.scaleX = scale\n                    child.scaleY = scale\n                }\n            }\n            return scrolled\n        } else {\n            return 0\n        }\n    }\n\n    /**\n     * @param scrollSpeed milliSecond per inch\n     */\n    fun setScrollSpeed(scrollSpeed: Float) {\n        smoothScroller!!.setScrollSpeed(scrollSpeed)\n    }\n\n    /**\n     * @param recyclerView\n     * @param state\n     * @param position\n     */\n    override fun smoothScrollToPosition(recyclerView: RecyclerView, state: RecyclerView.State?, position: Int) {\n        smoothScroller!!.targetPosition = position\n        startSmoothScroll(smoothScroller)\n    }\n\n    inner class SmoothScroller(context: Context?, private var speed: Float = 150f) : LinearSmoothScroller(context) {\n\n        /**\n         * @param scrollSpeed milliSecond per inch\n         */\n        fun setScrollSpeed(scrollSpeed: Float) {\n            speed = scrollSpeed\n        }\n\n        /**\n         * @param targetPosition\n         * @return\n         */\n        override fun computeScrollVectorForPosition(targetPosition: Int): PointF? {\n            return this@CarouselLayoutManager.computeScrollVectorForPosition(targetPosition)\n        }\n\n        /**\n         * @param viewStart\n         * @param viewEnd\n         * @param boxStart\n         * @param boxEnd\n         * @param snapPreference\n         * @return position view\n         */\n        override fun calculateDtToFit(\n            viewStart: Int,\n            viewEnd: Int,\n            boxStart: Int,\n            boxEnd: Int,\n            snapPreference: Int\n        ): Int {\n            return (boxStart + boxEnd) / 2 - (viewStart + viewEnd) / 2\n        }\n\n        /**\n         * @param displayMetrics\n         * @return\n         */\n        override fun calculateSpeedPerPixel(displayMetrics: DisplayMetrics): Float {\n            return speed / displayMetrics.densityDpi;\n        }\n    }\n}"
  },
  {
    "path": "carouselview/src/main/java/alirezat775/lib/carouselview/CarouselLazyLoadListener.kt",
    "content": "package alirezat775.lib.carouselview\n\n/**\n * Author:  Alireza Tizfahm Fard\n * Date:    12/22/17\n * Email:   alirezat775@gmail.com\n */\n\ninterface CarouselLazyLoadListener {\n\n    fun onLoadMore(page: Int, totalItemsCount: Int, view: CarouselView)\n\n}\n"
  },
  {
    "path": "carouselview/src/main/java/alirezat775/lib/carouselview/CarouselListener.kt",
    "content": "package alirezat775.lib.carouselview\n\n/**\n * Author:  Alireza Tizfahm Fard\n * Date:    12/22/17\n * Email:   alirezat775@gmail.com\n */\ninterface CarouselListener {\n    /**\n     * @param position current position\n     */\n    fun onPositionChange(position: Int)\n\n    /**\n     * @param dx delta x\n     * @param dy delta y\n     */\n    fun onScroll(dx: Int, dy: Int)\n}\n"
  },
  {
    "path": "carouselview/src/main/java/alirezat775/lib/carouselview/CarouselModel.kt",
    "content": "package alirezat775.lib.carouselview\n\n\n/**\n * Author:  Alireza Tizfahm Fard\n * Date:    2019-06-14\n * Email:   alirezat775@gmail.com\n */\n\nopen class CarouselModel {\n}"
  },
  {
    "path": "carouselview/src/main/java/alirezat775/lib/carouselview/CarouselView.kt",
    "content": "package alirezat775.lib.carouselview\n\nimport android.content.Context\nimport android.os.CountDownTimer\nimport android.util.AttributeSet\nimport android.view.MotionEvent\nimport android.view.VelocityTracker\nimport android.view.View\nimport androidx.annotation.IntDef\nimport androidx.core.view.ViewCompat\nimport androidx.recyclerview.widget.RecyclerView\n\n/**\n * Author:  Alireza Tizfahm Fard\n * Date:    12/7/17\n * Email:   alirezat775@gmail.com\n */\n\nclass CarouselView\n/**\n * @param context  current context, will be used to access resources\n * @param attrs    attributeSet\n * @param defStyle defStyle\n */\n@JvmOverloads constructor(context: Context, attrs: AttributeSet? = null, defStyle: Int = 0) :\n    RecyclerView(context, attrs, defStyle) {\n\n    var listener: CarouselListener? = null\n\n    private var velocityTracker: VelocityTracker? = null\n\n    var currentPosition: Int = 0\n    private var actionDown = true\n    var isAutoScroll = false\n    var isLoopMode: Boolean = false\n    var delayMillis: Long = 5000\n    private var reverseLoop = true\n    private var scheduler: Scheduler? = null\n    private var scrolling = true\n\n    var anchor: Int = 0\n        set(anchor) {\n            if (this.anchor != anchor) {\n                field = anchor\n                manager.anchor = anchor\n                requestLayout()\n            }\n        }\n\n    /**\n     * @return support RTL view\n     */\n    private val isRTL: Boolean\n        get() = ViewCompat.getLayoutDirection(this@CarouselView) == ViewCompat.LAYOUT_DIRECTION_RTL\n\n    /**\n     * @return support RTL view\n     */\n    private val isTrustLayout: Boolean\n        get() {\n            if (isRTL && manager.reverseLayout) {\n                return true\n            } else if (!isRTL && manager.reverseLayout) {\n                return false\n            } else if (isRTL && !manager.reverseLayout) {\n                return false\n            } else if (!isRTL && !manager.reverseLayout) {\n                return true\n            }\n            return false\n        }\n\n    /**\n     * @return layoutManager\n     */\n    val manager: CarouselLayoutManager\n        get() = layoutManager as CarouselLayoutManager\n\n    /**\n     * @param adapter the new adapter to set, or null to set no adapter\n     */\n    override fun setAdapter(adapter: Adapter<*>?) {\n        super.setAdapter(adapter)\n        if (adapter!!.itemCount >= 0)\n            initSnap()\n    }\n\n    override fun onAttachedToWindow() {\n        super.onAttachedToWindow()\n        initSnap()\n    }\n\n    /**\n     * initialize\n     */\n    private fun initSnap() {\n        clipToPadding = false\n        overScrollMode = View.OVER_SCROLL_NEVER\n        anchor = CENTER\n        addOnItemTouchListener(onItemTouchListener())\n        post { scrolling(0); if (isAutoScroll) getScheduler() }\n    }\n\n    /**\n     * @return scheduler scroll item\n     */\n    private fun getScheduler(): Scheduler? {\n        if (scheduler == null) {\n            scheduler = Scheduler(delayMillis, 1)\n        }\n        return scheduler\n    }\n\n    /**\n     * pause auto scroll\n     */\n    fun pauseAutoScroll() {\n        getScheduler()?.cancel()\n        scrolling = false\n    }\n\n    /**\n     * resume auto scroll\n     */\n    fun resumeAutoScroll() {\n        getScheduler()?.start()\n        scrolling = true\n    }\n\n    /**\n     * @return onItemTouchListener for calculate velocity and position fix view center\n     */\n    private fun onItemTouchListener(): OnItemTouchListener {\n        return object : OnItemTouchListener {\n            override fun onInterceptTouchEvent(rv: RecyclerView, e: MotionEvent): Boolean {\n                val action = e.actionMasked\n                when (action) {\n                    MotionEvent.ACTION_MOVE -> if (actionDown) {\n                        actionDown = false\n                        if (velocityTracker == null) {\n                            velocityTracker = VelocityTracker.obtain()\n                        } else {\n                            velocityTracker!!.clear()\n                        }\n                        velocityTracker!!.addMovement(e)\n                    } else {\n                        velocityTracker!!.addMovement(e)\n                        velocityTracker!!.computeCurrentVelocity(1000)\n                    }\n                    MotionEvent.ACTION_UP, MotionEvent.ACTION_CANCEL -> {\n                        actionDown = true\n                        if (velocityTracker != null) {\n                            when (manager.orientation) {\n                                HORIZONTAL -> if (velocityTracker!!.xVelocity <= 0) {\n                                    if (!isTrustLayout)\n                                        scrolling(-1)// rtl or reverse mode\n                                    else\n                                        scrolling(1)//scroll to right\n                                } else if (velocityTracker!!.xVelocity > 0) {\n                                    if (!isTrustLayout)\n                                        scrolling(1)// rtl or reverse mode\n                                    else\n                                        scrolling(-1)//scroll to left\n                                }\n                                VERTICAL -> if (velocityTracker!!.yVelocity <= 0) {\n                                    if (manager.getReverseLayout())\n                                        scrolling(-1)// rtl or reverse mode\n                                    else\n                                        scrolling(1)//scroll to up\n                                } else if (velocityTracker!!.yVelocity > 0) {\n                                    if (manager.getReverseLayout())\n                                        scrolling(1)// rtl or reverse mode\n                                    else\n                                        scrolling(-1)//scroll to down\n                                }\n                            }\n                            velocityTracker!!.recycle()\n                            velocityTracker = null\n                        }\n                    }\n                }\n                return false\n            }\n\n            override fun onTouchEvent(rv: RecyclerView, e: MotionEvent) {}\n            override fun onRequestDisallowInterceptTouchEvent(disallowIntercept: Boolean) {}\n        }\n    }\n\n    /**\n     * @param dx delta x\n     * @param dy delta y\n     */\n    override fun onScrolled(dx: Int, dy: Int) {\n        super.onScrolled(dx, dy)\n        if (listener != null)\n            listener!!.onScroll(dx, dy)\n    }\n\n    /**\n     * @param position scrolling to specific position\n     */\n    override fun scrollToPosition(position: Int) {\n        super.scrollToPosition(position)\n        post { smoothScrollToPosition(position) }\n    }\n\n    /**\n     * @param state called when the scroll state of this RecyclerView changes\n     */\n    override fun onScrollStateChanged(state: Int) {\n        super.onScrollStateChanged(state)\n        if (state == SCROLL_STATE_IDLE) {\n            if (isAutoScroll) {\n                getScheduler()?.start()\n            }\n\n            if (currentPosition == 0)\n                reverseLoop = true\n            else if (currentPosition == adapter!!.itemCount - 1)\n                reverseLoop = false\n        }\n    }\n\n    /**\n     * @param positionPlus scroll to new position from previous position\n     */\n    fun scrolling(positionPlus: Int) {\n        if (calculateSnapViewPosition() > -1) {\n            var centerViewPosition = calculateSnapViewPosition() + positionPlus\n            if (centerViewPosition <= 0)\n                centerViewPosition = 0\n            else if (centerViewPosition >= adapter!!.itemCount - 1)\n                centerViewPosition = adapter!!.itemCount - 1\n\n            smoothScrollToPosition(centerViewPosition)\n\n            if (listener != null)\n                listener!!.onPositionChange(centerViewPosition)\n\n            currentPosition = centerViewPosition\n        }\n    }\n\n    /**\n     * @return position fit in screen for parent list\n     */\n    private val parentAnchor: Int\n        get() = (if (manager.orientation == VERTICAL) height else width) / 2\n\n    /**\n     * @param view item view\n     * @return position fit in screen specific view in parent\n     */\n    private fun getViewAnchor(view: View?): Int {\n        return if (manager.orientation == VERTICAL) view?.top!! + view.height / 2\n        else view?.left!! + view.width / 2\n    }\n\n    /**\n     * @return calculate snapping position relation anchor\n     */\n    private fun calculateSnapViewPosition(): Int {\n        val parentAnchor = parentAnchor\n        val lastVisibleItemPosition = manager.findLastVisibleItemPosition()\n        val firstVisibleItemPosition = manager.findFirstVisibleItemPosition()\n\n        if (firstVisibleItemPosition > -1) {\n            val currentViewClosestToAnchor = manager.findViewByPosition(firstVisibleItemPosition)\n            var currentViewClosestToAnchorDistance =\n                parentAnchor - getViewAnchor(currentViewClosestToAnchor)\n            var currentViewClosestToAnchorPosition = firstVisibleItemPosition\n\n            for (i in firstVisibleItemPosition + 1..lastVisibleItemPosition) {\n                val view = manager.findViewByPosition(i)\n                val distanceToCenter = parentAnchor - getViewAnchor(view)\n                if (Math.abs(distanceToCenter) < Math.abs(currentViewClosestToAnchorDistance)) {\n                    currentViewClosestToAnchorPosition = i\n                    currentViewClosestToAnchorDistance = distanceToCenter\n                }\n            }\n            return currentViewClosestToAnchorPosition\n        } else {\n            return -1\n        }\n    }\n\n    inner class Scheduler(millisInFuture: Long, countDownInterval: Long) :\n        CountDownTimer(millisInFuture, countDownInterval) {\n\n        override fun onTick(millisUntilFinished: Long) {}\n\n        override fun onFinish() {\n            if (isLoopMode) {\n                if (reverseLoop)\n                    scrolling(+1)\n                else\n                    scrolling(-1)\n\n            } else {\n                if (currentPosition >= adapter!!.itemCount - 1)\n                    scrollToPosition(0)\n            }\n            cancel()\n            if (scrolling) start()\n        }\n    }\n\n    companion object {\n\n        //carousel orientation\n        const val HORIZONTAL = 0\n        const val VERTICAL = 1\n\n        //anchor default\n        private val CENTER = 0\n\n    }\n\n    @IntDef(VERTICAL, HORIZONTAL)\n    @Retention(AnnotationRetention.SOURCE)\n    annotation class CarouselOrientation\n}\n"
  },
  {
    "path": "carouselview/src/main/java/alirezat775/lib/carouselview/helper/EndlessListener.kt",
    "content": "package alirezat775.lib.carouselview.helper\n\nimport alirezat775.lib.carouselview.CarouselLayoutManager\nimport androidx.recyclerview.widget.LinearLayoutManager\nimport androidx.recyclerview.widget.RecyclerView\n\n/**\n * Author:  Alireza Tizfahm Fard\n * Date:    2019-06-14\n * Email:   alirezat775@gmail.com\n */\n\nabstract class EndlessListener(private val carouselLayoutManager: CarouselLayoutManager) :\n    RecyclerView.OnScrollListener() {\n\n    private val visibleThreshold = 5\n    private var currentPage = 0\n    private var previousTotalItemCount = 0\n    private var loading = true\n    private var startingPageIndex = 0\n\n    fun getLastVisibleItem(lastVisibleItemPositions: IntArray): Int {\n        var maxSize = 0\n        for (i in lastVisibleItemPositions.indices) {\n            if (i == 0) {\n                maxSize = lastVisibleItemPositions[i]\n            } else if (lastVisibleItemPositions[i] > maxSize) {\n                maxSize = lastVisibleItemPositions[i]\n            }\n        }\n        return maxSize\n    }\n\n    override fun onScrolled(view: RecyclerView, dx: Int, dy: Int) {\n        val lastVisibleItemPosition = (carouselLayoutManager as LinearLayoutManager).findLastVisibleItemPosition()\n        val totalItemCount = carouselLayoutManager.itemCount\n\n        if (totalItemCount < previousTotalItemCount) {\n            currentPage = startingPageIndex\n            previousTotalItemCount = totalItemCount\n            if (totalItemCount == 0) {\n                loading = true\n            }\n        }\n\n        if (loading && totalItemCount > previousTotalItemCount) {\n            loading = false\n            previousTotalItemCount = totalItemCount\n        }\n\n        if (!loading && lastVisibleItemPosition + visibleThreshold > totalItemCount) {\n            currentPage++\n            onLoadMore(currentPage, totalItemCount, view)\n            loading = true\n        }\n    }\n\n    fun resetState() {\n        this.currentPage = this.startingPageIndex\n        this.previousTotalItemCount = 0\n        this.loading = true\n    }\n\n    abstract fun onLoadMore(page: Int, totalItemsCount: Int, view: RecyclerView)\n\n}\n"
  },
  {
    "path": "carouselview/src/main/java/alirezat775/lib/carouselview/helper/ViewHelper.kt",
    "content": "package alirezat775.lib.carouselview.helper\n\nimport android.content.res.Resources\n\n\n/**\n * Author:  Alireza Tizfahm Fard\n * Date:    2019-06-14\n * Email:   alirezat775@gmail.com\n */\n\nobject ViewHelper {\n\n    /**\n     * @return screen width size\n     */\n    fun getScreenWidth(): Int {\n        return Resources.getSystem().displayMetrics.widthPixels\n    }\n\n    /**\n     * @return screen height size\n     */\n    fun getScreenHeight(): Int {\n        return Resources.getSystem().displayMetrics.heightPixels\n    }\n\n}"
  },
  {
    "path": "carouselview/src/main/res/values/strings.xml",
    "content": "<resources>\n    <string name=\"app_name\">carouselview</string>\n</resources>\n"
  },
  {
    "path": "carouselview/src/test/java/alirezat775/lib/carouselview/ExampleUnitTest.kt",
    "content": "package alirezat775.lib.carouselview\n\nimport org.junit.Test\n\nimport org.junit.Assert.*\n\n/**\n * Example local unit test, which will execute on the development machine (host).\n *\n * @see [Testing documentation](http://d.android.com/tools/testing)\n */\nclass ExampleUnitTest {\n    @Test\n    fun addition_isCorrect() {\n        assertEquals(4, 2 + 2)\n    }\n}"
  },
  {
    "path": "gradle/wrapper/gradle-wrapper.properties",
    "content": "#Thu Apr 23 17:51:28 IRDT 2020\ndistributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\nzipStoreBase=GRADLE_USER_HOME\nzipStorePath=wrapper/dists\ndistributionUrl=https\\://services.gradle.org/distributions/gradle-5.6.4-all.zip\n"
  },
  {
    "path": "gradle.properties",
    "content": "# Project-wide Gradle settings.\n# IDE (e.g. Android Studio) users:\n# Gradle settings configured through the IDE *will override*\n# any settings specified in this file.\n# For more details on how to configure your build environment visit\n# http://www.gradle.org/docs/current/userguide/build_environment.html\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# 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# AndroidX package structure to make it clearer which packages are bundled with the\n# Android operating system, and which are packaged with your app's APK\n# https://developer.android.com/topic/libraries/support-library/androidx-rn\nandroid.useAndroidX=true\n# Automatically convert third-party libraries to use AndroidX\nandroid.enableJetifier=true\n# Kotlin code style for this project: \"official\" or \"obsolete\":\nkotlin.code.style=official\n"
  },
  {
    "path": "gradlew",
    "content": "#!/usr/bin/env sh\n\n##############################################################################\n##\n##  Gradle start up script for UN*X\n##\n##############################################################################\n\n# Attempt to set APP_HOME\n# Resolve links: $0 may be a link\nPRG=\"$0\"\n# Need this for relative symlinks.\nwhile [ -h \"$PRG\" ] ; do\n    ls=`ls -ld \"$PRG\"`\n    link=`expr \"$ls\" : '.*-> \\(.*\\)$'`\n    if expr \"$link\" : '/.*' > /dev/null; then\n        PRG=\"$link\"\n    else\n        PRG=`dirname \"$PRG\"`\"/$link\"\n    fi\ndone\nSAVED=\"`pwd`\"\ncd \"`dirname \\\"$PRG\\\"`/\" >/dev/null\nAPP_HOME=\"`pwd -P`\"\ncd \"$SAVED\" >/dev/null\n\nAPP_NAME=\"Gradle\"\nAPP_BASE_NAME=`basename \"$0\"`\n\n# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\nDEFAULT_JVM_OPTS=\"\"\n\n# Use the maximum available, or set MAX_FD != -1 to use that value.\nMAX_FD=\"maximum\"\n\nwarn () {\n    echo \"$*\"\n}\n\ndie () {\n    echo\n    echo \"$*\"\n    echo\n    exit 1\n}\n\n# OS specific support (must be 'true' or 'false').\ncygwin=false\nmsys=false\ndarwin=false\nnonstop=false\ncase \"`uname`\" in\n  CYGWIN* )\n    cygwin=true\n    ;;\n  Darwin* )\n    darwin=true\n    ;;\n  MINGW* )\n    msys=true\n    ;;\n  NONSTOP* )\n    nonstop=true\n    ;;\nesac\n\nCLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar\n\n# Determine the Java command to use to start the JVM.\nif [ -n \"$JAVA_HOME\" ] ; then\n    if [ -x \"$JAVA_HOME/jre/sh/java\" ] ; then\n        # IBM's JDK on AIX uses strange locations for the executables\n        JAVACMD=\"$JAVA_HOME/jre/sh/java\"\n    else\n        JAVACMD=\"$JAVA_HOME/bin/java\"\n    fi\n    if [ ! -x \"$JAVACMD\" ] ; then\n        die \"ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\n    fi\nelse\n    JAVACMD=\"java\"\n    which java >/dev/null 2>&1 || die \"ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\nfi\n\n# Increase the maximum file descriptors if we can.\nif [ \"$cygwin\" = \"false\" -a \"$darwin\" = \"false\" -a \"$nonstop\" = \"false\" ] ; then\n    MAX_FD_LIMIT=`ulimit -H -n`\n    if [ $? -eq 0 ] ; then\n        if [ \"$MAX_FD\" = \"maximum\" -o \"$MAX_FD\" = \"max\" ] ; then\n            MAX_FD=\"$MAX_FD_LIMIT\"\n        fi\n        ulimit -n $MAX_FD\n        if [ $? -ne 0 ] ; then\n            warn \"Could not set maximum file descriptor limit: $MAX_FD\"\n        fi\n    else\n        warn \"Could not query maximum file descriptor limit: $MAX_FD_LIMIT\"\n    fi\nfi\n\n# For Darwin, add options to specify how the application appears in the dock\nif $darwin; then\n    GRADLE_OPTS=\"$GRADLE_OPTS \\\"-Xdock:name=$APP_NAME\\\" \\\"-Xdock:icon=$APP_HOME/media/gradle.icns\\\"\"\nfi\n\n# For Cygwin, switch paths to Windows format before running java\nif $cygwin ; then\n    APP_HOME=`cygpath --path --mixed \"$APP_HOME\"`\n    CLASSPATH=`cygpath --path --mixed \"$CLASSPATH\"`\n    JAVACMD=`cygpath --unix \"$JAVACMD\"`\n\n    # We build the pattern for arguments to be converted via cygpath\n    ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`\n    SEP=\"\"\n    for dir in $ROOTDIRSRAW ; do\n        ROOTDIRS=\"$ROOTDIRS$SEP$dir\"\n        SEP=\"|\"\n    done\n    OURCYGPATTERN=\"(^($ROOTDIRS))\"\n    # Add a user-defined pattern to the cygpath arguments\n    if [ \"$GRADLE_CYGPATTERN\" != \"\" ] ; then\n        OURCYGPATTERN=\"$OURCYGPATTERN|($GRADLE_CYGPATTERN)\"\n    fi\n    # Now convert the arguments - kludge to limit ourselves to /bin/sh\n    i=0\n    for arg in \"$@\" ; do\n        CHECK=`echo \"$arg\"|egrep -c \"$OURCYGPATTERN\" -`\n        CHECK2=`echo \"$arg\"|egrep -c \"^-\"`                                 ### Determine if an option\n\n        if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then                    ### Added a condition\n            eval `echo args$i`=`cygpath --path --ignore --mixed \"$arg\"`\n        else\n            eval `echo args$i`=\"\\\"$arg\\\"\"\n        fi\n        i=$((i+1))\n    done\n    case $i in\n        (0) set -- ;;\n        (1) set -- \"$args0\" ;;\n        (2) set -- \"$args0\" \"$args1\" ;;\n        (3) set -- \"$args0\" \"$args1\" \"$args2\" ;;\n        (4) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" ;;\n        (5) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" ;;\n        (6) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" ;;\n        (7) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" ;;\n        (8) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" \"$args7\" ;;\n        (9) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" \"$args7\" \"$args8\" ;;\n    esac\nfi\n\n# Escape application args\nsave () {\n    for i do printf %s\\\\n \"$i\" | sed \"s/'/'\\\\\\\\''/g;1s/^/'/;\\$s/\\$/' \\\\\\\\/\" ; done\n    echo \" \"\n}\nAPP_ARGS=$(save \"$@\")\n\n# Collect all arguments for the java command, following the shell quoting and substitution rules\neval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS \"\\\"-Dorg.gradle.appname=$APP_BASE_NAME\\\"\" -classpath \"\\\"$CLASSPATH\\\"\" org.gradle.wrapper.GradleWrapperMain \"$APP_ARGS\"\n\n# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong\nif [ \"$(uname)\" = \"Darwin\" ] && [ \"$HOME\" = \"$PWD\" ]; then\n  cd \"$(dirname \"$0\")\"\nfi\n\nexec \"$JAVACMD\" \"$@\"\n"
  },
  {
    "path": "gradlew.bat",
    "content": "@if \"%DEBUG%\" == \"\" @echo off\r\n@rem ##########################################################################\r\n@rem\r\n@rem  Gradle startup script for Windows\r\n@rem\r\n@rem ##########################################################################\r\n\r\n@rem Set local scope for the variables with windows NT shell\r\nif \"%OS%\"==\"Windows_NT\" setlocal\r\n\r\nset DIRNAME=%~dp0\r\nif \"%DIRNAME%\" == \"\" set DIRNAME=.\r\nset APP_BASE_NAME=%~n0\r\nset APP_HOME=%DIRNAME%\r\n\r\n@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\r\nset DEFAULT_JVM_OPTS=\r\n\r\n@rem Find java.exe\r\nif defined JAVA_HOME goto findJavaFromJavaHome\r\n\r\nset JAVA_EXE=java.exe\r\n%JAVA_EXE% -version >NUL 2>&1\r\nif \"%ERRORLEVEL%\" == \"0\" goto init\r\n\r\necho.\r\necho ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\r\necho.\r\necho Please set the JAVA_HOME variable in your environment to match the\r\necho location of your Java installation.\r\n\r\ngoto fail\r\n\r\n:findJavaFromJavaHome\r\nset JAVA_HOME=%JAVA_HOME:\"=%\r\nset JAVA_EXE=%JAVA_HOME%/bin/java.exe\r\n\r\nif exist \"%JAVA_EXE%\" goto init\r\n\r\necho.\r\necho ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%\r\necho.\r\necho Please set the JAVA_HOME variable in your environment to match the\r\necho location of your Java installation.\r\n\r\ngoto fail\r\n\r\n:init\r\n@rem Get command-line arguments, handling Windows variants\r\n\r\nif not \"%OS%\" == \"Windows_NT\" goto win9xME_args\r\n\r\n:win9xME_args\r\n@rem Slurp the command line arguments.\r\nset CMD_LINE_ARGS=\r\nset _SKIP=2\r\n\r\n:win9xME_args_slurp\r\nif \"x%~1\" == \"x\" goto execute\r\n\r\nset CMD_LINE_ARGS=%*\r\n\r\n:execute\r\n@rem Setup the command line\r\n\r\nset CLASSPATH=%APP_HOME%\\gradle\\wrapper\\gradle-wrapper.jar\r\n\r\n@rem Execute Gradle\r\n\"%JAVA_EXE%\" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% \"-Dorg.gradle.appname=%APP_BASE_NAME%\" -classpath \"%CLASSPATH%\" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%\r\n\r\n:end\r\n@rem End local scope for the variables with windows NT shell\r\nif \"%ERRORLEVEL%\"==\"0\" goto mainEnd\r\n\r\n:fail\r\nrem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of\r\nrem the _cmd.exe /c_ return code!\r\nif  not \"\" == \"%GRADLE_EXIT_CONSOLE%\" exit 1\r\nexit /b 1\r\n\r\n:mainEnd\r\nif \"%OS%\"==\"Windows_NT\" endlocal\r\n\r\n:omega\r\n"
  },
  {
    "path": "settings.gradle",
    "content": "include ':app', ':carouselview'\n"
  }
]