[
  {
    "path": ".gitignore",
    "content": "*.iml\n*.apk\n*.ap_\n*.dex\n*.class\n*.log\n.gradle\n/bin\n/gen\n/local.properties\n/.idea\n/build\n.DS_Store\n/captures\n/app/build\n/bdwallet_pay_sdk/build\n/common/build\n/pingpp/build\n/projectFilesBackup"
  },
  {
    "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": "English  |  [中文文档](README_cn.md)\n\n# AndroidAutoSwitcher\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n[![Platform](https://img.shields.io/badge/platform-android-green.svg)](http://developer.android.com/index.html)\n[![API](https://img.shields.io/badge/API-12%2B-brightgreen.svg?style=flat)](https://android-arsenal.com/api?level=12)\n[![Download](https://jitpack.io/v/Marksss/AndroidAutoSwitcher.svg)](https://jitpack.io/#Marksss/AndroidAutoSwitcher)\n\nAutoSwitchView is a view that can automatically switch between two children (items). Compared to ViewFlipper, it has better stability for reusing its children when working on large data sets. Compared to AdapterViewFlipper, its expansibility is more excellent.\n\n![demo-gif](https://github.com/Marksss/AndroidAutoSwitcher/blob/master/gif/demo.gif)\n## Usage\n### Add the JitPack repository to your build file\n```\nallprojects {\n\t\trepositories {\n\t\t\t...\n\t\t\tmaven { url 'https://jitpack.io' }\n\t\t}\n\t}\n```\n### Add the dependency\n```implementation 'com.github.Marksss:AndroidAutoSwitcher:v1.2'```\n### Code in XML\n```\n    <com.switcher.AutoSwitchView\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        app:switcher_repeatCount=\"1\"\n        app:switcher_autoStart=\"true\"/>\n```\nIf you want the switching animation to be infinite, you just need to set switcher_repeatCount -1.\n### Code in Activity\n```\nAutoSwitchView as = (AutoSwitchView) findViewById(R.id.yourid);\nas.setAdapter(new YourAdapter());\nas.setSwitchStrategy(new YourStrategy()); // See Switching Strategy\nas.startSwitcher(); // If you have set autoStart true, this is not needed.\n```\n### Switching Strategy\nYou can easily customize swtiching animations you like with SwitchStrategy. It supports both Animation and ObjectAnimator. Here are some builders of SwitchStrategy I have offered as follows.\n\n - AnimationStrategyBuilder:\n customize your own animation with Animation;\n - AnimatorStrategyBuilder: \n customize your own animation with ObjectAnimator;\n - CarouselStrategyBuilder: \n seamlessly switch between two items in different directions;\n - ContinuousStrategyBuilder: \n switch between items smoothly without any pauses;\n \n An example:\n ```\n as.setSwitchStrategy(\n      new AnimationStrategyBuilder(this, R.anim.anim_in, R.anim.anim_out).\n          build()\n);\n ```\n Another example:\n ```\n as.setSwitchStrategy(\n      new CarouselStrategyBuilder().\n          setAnimDuration(900).\n          setInterpolator(new AccelerateDecelerateInterpolator()).\n          setMode(DirectionMode.right2Left).\n          build()\n);\n ```\n\nIn most cases, strategies above are enough. If you want to customize animation that is not so complicated, you can use AnimationStrategyBuilde or AnimatorStrategyBuilder with your own Animation or ObjectAnimator.\n### Additional\nIt usually is unnecessary. But if you want to customize more complicated animations, then you neeed to create your own SwitchStrategy through adding SingleOperator into BaseBuilder (init->next->withEnd) in turn to control all movements of the switcher.\n```\nnew SwitchStrategy.BaseBuilder().\n    init(new SingleOperator() {\n        @Override\n        public void operate(AutoSwitchView switcher, ChainOperator operator) {\n            ...//init your animation\n        }\n    }).next(new SingleOperator() {\n        @Override\n        public void operate(AutoSwitchView switcher, ChainOperator operator) {\n            ...//run your own animation\n        }\n    }).withEnd(new SingleOperator() {\n        @Override\n        public void operate(AutoSwitchView switcher, ChainOperator operator) {\n            ...//cancle or end your animation\n        }\n    }).build();\n```\n## License\nAutoSwitchView is released under the [Apache License Version 2.0](LICENSE).\n"
  },
  {
    "path": "README_cn.md",
    "content": "[English](README.md)  |  中文文档\n\n# AndroidAutoSwitcher\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n[![Platform](https://img.shields.io/badge/platform-android-green.svg)](http://developer.android.com/index.html)\n[![API](https://img.shields.io/badge/API-12%2B-brightgreen.svg?style=flat)](https://android-arsenal.com/api?level=12)\n[![Download](https://jitpack.io/v/Marksss/AndroidAutoSwitcher.svg)](https://jitpack.io/#Marksss/AndroidAutoSwitcher)\n\nAutoSwitchView是一个能自由切换两个子控件的控件容器，相比于ViewFlipper，它支持子控件的复用，数据量大的情况下能有更好的性能。同时，相比于AdapterViewFlipper，它有更好的扩展性，支持自定义各种切换动画。 \n\n![demo-gif](https://github.com/Marksss/AndroidAutoSwitcher/blob/master/gif/demo.gif)\n## 用法\n### 将JitPack添加到 `build.gradle` 文件中\n```\nallprojects {\n\t\trepositories {\n\t\t\t...\n\t\t\tmaven { url 'https://jitpack.io' }\n\t\t}\n\t}\n```\n### 添加依赖\n```implementation 'com.github.Marksss:AndroidAutoSwitcher:v1.2'```\n### XML中的代码\n```\n    <com.switcher.AutoSwitchView\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        app:switcher_repeatCount=\"1\"\n        app:switcher_autoStart=\"true\"/>\n```\n如果想让切换动画无限循环，只需将switcher_repeatCount设置为-1.\n### Activity中的代码\n```\nAutoSwitchView as = (AutoSwitchView) findViewById(R.id.yourid);\nas.setAdapter(new YourAdapter());\nas.setSwitchStrategy(new YourStrategy()); // See Switching Strategy\nas.startSwitcher(); // If you have set autoStart true, this is not needed.\n```\n### Switching Strategy\n你能利用SwitchStrategy轻松定制你喜欢的切换动画，它同时支持Animation和 ObjectAnimator。以下是一些已经提供的动画策略的建造者类：\n\n - AnimationStrategyBuilde:\n 支持利用Animation定制自己的动画;\n - AnimatorStrategyBuilder: \n 支持利用ObjectAnimator定制自己的动画;\n - CarouselStrategyBuilder: \n 支持在不同方向上的两个item的无缝切换;\n - ContinuousStrategyBuilder: \n 支持两个item之间的平滑无停顿的切换;\n \n 一个栗子:\n ```\n as.setSwitchStrategy(\n      new AnimationStrategyBuilder(this, R.anim.anim_in, R.anim.anim_out).\n          build()\n);\n ```\n 另一个栗子:\n ```\n as.setSwitchStrategy(\n      new CarouselStrategyBuilder().\n          setAnimDuration(900).\n          setInterpolator(new AccelerateDecelerateInterpolator()).\n          setMode(DirectionMode.right2Left).\n          build()\n);\n ```\n\n在大多数情况下，以上的切换动画策略已经足够。如果想定制不那么复杂的动画, 也可以将自己的Animation或者ObjectAnimator添加到AnimationStrategyBuilde或者AnimatorStrategyBuilder中产生对应的切换策略。\n### 复杂定制（非必需）\n如果想定制更加复杂的切换动画, 你可以轮流添加SingleOperator到BaseBuilder中，创建你自己的SwitchStrategy，这样就可以完全控制切换流程了（如下所示）。\n```\nnew SwitchStrategy.BaseBuilder().\n    init(new SingleOperator() {\n        @Override\n        public void operate(AutoSwitchView switcher, ChainOperator operator) {\n            ...//init your animation\n        }\n    }).next(new SingleOperator() {\n        @Override\n        public void operate(AutoSwitchView switcher, ChainOperator operator) {\n            ...//run your own animation\n        }\n    }).withEnd(new SingleOperator() {\n        @Override\n        public void operate(AutoSwitchView switcher, ChainOperator operator) {\n            ...//cancle or end your animation\n        }\n    }).build();\n```\n## 许可证\nAutoSwitchView基于 [Apache License Version 2.0](LICENSE) 发布。"
  },
  {
    "path": "app/.gitignore",
    "content": "/build\n"
  },
  {
    "path": "app/build.gradle",
    "content": "apply plugin: 'com.android.application'\n\nandroid {\n    compileSdkVersion 26\n    defaultConfig {\n        applicationId \"com.example.autoswitcher\"\n        minSdkVersion 15\n        targetSdkVersion 26\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    implementation fileTree(dir: 'libs', include: ['*.jar'])\n    implementation 'com.android.support:appcompat-v7:26.0.0-beta1'\n    implementation 'com.android.support.constraint:constraint-layout:1.0.2'\n    testImplementation 'junit:junit:4.12'\n    androidTestImplementation 'com.android.support.test:runner:0.5'\n    androidTestImplementation 'com.android.support.test.espresso:espresso-core:2.2.2'\n\n    debugImplementation 'com.squareup.leakcanary:leakcanary-android:1.5.4'\n    releaseImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.4'\n\n    compile 'com.github.markshawn:auto-switcher:1.2'\n//    compile project(':auto-switcher')\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/com/example/app/ExampleInstrumentedTest.java",
    "content": "package com.example.app;\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 * Instrumented 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    }\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.example.app\">\n\n    <uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>\n    <uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/>\n\n    <application\n        android:name=\".MyApplication\"\n        android:allowBackup=\"true\"\n        android:label=\"@string/app_name\"\n        android:theme=\"@style/AppTheme\">\n\n        <activity android:name=\"com.example.app.StartActivity\">\n            <intent-filter>\n                <action android:name=\"android.intent.action.MAIN\"/>\n\n                <category android:name=\"android.intent.category.LAUNCHER\"/>\n            </intent-filter>\n        </activity>\n\n        <activity android:name=\"com.example.app.MainActivity\">\n        </activity>\n\n    </application>\n\n</manifest>"
  },
  {
    "path": "app/src/main/java/com/example/app/MainActivity.java",
    "content": "package com.example.app;\n\nimport android.app.Activity;\nimport android.content.Context;\nimport android.os.Bundle;\nimport android.view.LayoutInflater;\nimport android.view.View;\nimport android.view.animation.AccelerateDecelerateInterpolator;\nimport android.view.animation.DecelerateInterpolator;\nimport android.view.animation.OvershootInterpolator;\nimport android.widget.TextView;\nimport android.widget.Toast;\n\nimport com.example.app.adapter.BannerAdapter;\nimport com.example.app.adapter.HornAdapter;\nimport com.example.app.adapter.PortraitAdapter;\nimport com.example.app.adapter.SingleTextAdapter;\nimport com.switcher.AutoSwitchView;\nimport com.switcher.base.BaseSwitchView;\nimport com.switcher.builder.AnimationStrategyBuilder;\nimport com.switcher.builder.AnimatorStrategyBuilder;\nimport com.switcher.builder.CarouselStrategyBuilder;\nimport com.switcher.builder.ContinuousStrategyBuilder;\nimport com.switcher.builder.DirectionMode;\n\nimport java.util.Arrays;\nimport java.util.List;\n\npublic class MainActivity extends Activity {\n    List<String> mEntityList = Arrays.asList(\n            \"My Favourite Fruit is Apply\",\n            \"My Mother's Favourite Fruit is Blueberry\",\n            \"Anne's Favourite Fruit is Banana\",\n            \"Jake Hates Fruit\");\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_main);\n\n        AutoSwitchView aswBanner = (AutoSwitchView) findViewById(R.id.auto_roll_banner);\n        aswBanner.setAdapter(new BannerAdapter());\n        aswBanner.setSwitchStrategy(\n                new CarouselStrategyBuilder().\n                        setAnimDuration(900).\n                        setInterpolator(new AccelerateDecelerateInterpolator()).\n                        setMode(DirectionMode.right2Left).\n                        build()\n        );\n        aswBanner.setOnItemClickListener(new BaseSwitchView.OnItemClickListener() {\n            @Override\n            public void onItemClick(BaseSwitchView parent, View child, int position) {\n                Toast.makeText(MainActivity.this, \"position=\" + position, Toast.LENGTH_SHORT).show();\n            }\n        });\n\n        AutoSwitchView autoSwitchView = (AutoSwitchView) findViewById(R.id.auto_roll_0);\n        autoSwitchView.setAdapter(new HornAdapter(mEntityList));\n\n        AutoSwitchView autoSwitchView1 = (AutoSwitchView) findViewById(R.id.auto_roll_1);\n        autoSwitchView1.setAdapter(new HornAdapter(mEntityList));\n        autoSwitchView1.setSwitchStrategy(\n                new CarouselStrategyBuilder().\n                        setAnimDuration(500).\n                        setInterpolator(new DecelerateInterpolator()).\n                        setMode(DirectionMode.bottom2Top).\n                        build()\n        );\n\n        AutoSwitchView autoSwitchView2 = (AutoSwitchView) findViewById(R.id.auto_roll_2);\n        autoSwitchView2.setAdapter(new SingleTextAdapter(\"I am Animation\"));\n        autoSwitchView2.setSwitchStrategy(\n                new AnimationStrategyBuilder(this, R.anim.anim_in, R.anim.anim_out).\n                        build()\n        );\n\n        AutoSwitchView autoSwitchView3 = (AutoSwitchView) findViewById(R.id.auto_roll_3);\n        autoSwitchView3.setAdapter(new SingleTextAdapter(\"I am Animator\"));\n        autoSwitchView3.setSwitchStrategy(\n                new AnimatorStrategyBuilder(this, R.animator.anim_in, R.animator.anim_out).\n                        build()\n        );\n\n        AutoSwitchView autoSwitchView4 = (AutoSwitchView) findViewById(R.id.auto_roll_4);\n        autoSwitchView4.setAdapter(new PortraitAdapter());\n        autoSwitchView4.setSwitchStrategy(\n                new ContinuousStrategyBuilder().\n                        setDuration(2000).\n                        setMode(DirectionMode.left2Right).\n                        build()\n        );\n    }\n\n\n}\n"
  },
  {
    "path": "app/src/main/java/com/example/app/MyApplication.java",
    "content": "package com.example.app;\n\nimport android.app.Application;\n\nimport com.squareup.leakcanary.LeakCanary;\n\n/**\n * Created by shenxl on 2018/7/21.\n */\n\npublic class MyApplication extends Application {\n    @Override\n    public void onCreate() {\n        super.onCreate();\n        LeakCanary.install(this);\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/com/example/app/StartActivity.java",
    "content": "package com.example.app;\n\nimport android.app.Activity;\nimport android.content.Intent;\nimport android.os.Bundle;\nimport android.view.View;\nimport android.view.animation.AccelerateDecelerateInterpolator;\nimport android.widget.EditText;\n\nimport com.example.app.adapter.BannerAdapter2;\nimport com.switcher.AutoSwitchView;\nimport com.switcher.builder.CarouselStrategyBuilder;\nimport com.switcher.builder.DirectionMode;\n\n/**\n * Created by shenxl on 2018/7/21.\n */\n\npublic class StartActivity extends Activity {\n    private AutoSwitchView mAswBanner;\n    private EditText mContentEdt, mCountEdt;\n    private BannerAdapter2 mBannerAdapter = new BannerAdapter2();\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_start);\n\n        mContentEdt = (EditText) findViewById(R.id.edt_content);\n        mCountEdt = (EditText) findViewById(R.id.edt_count);\n        mAswBanner = (AutoSwitchView) findViewById(R.id.start_banner);\n        mAswBanner.setAdapter(mBannerAdapter);\n        mAswBanner.setSwitchStrategy(\n                new CarouselStrategyBuilder().\n                        setAnimDuration(900).\n                        setInterpolator(new AccelerateDecelerateInterpolator()).\n                        setMode(DirectionMode.right2Left).\n                        build()\n        );\n        findViewById(R.id.btn_save).setOnClickListener(new View.OnClickListener() {\n            @Override\n            public void onClick(View v) {\n                int count = 0;\n                try {\n                    count = Integer.parseInt(mCountEdt.getText().toString());\n                } catch (Exception e) {\n                    e.printStackTrace();\n                }\n                mBannerAdapter.setCount(count);\n                mBannerAdapter.setTitle(mContentEdt.getText().toString());\n                mAswBanner.startSwitcher();\n            }\n        });\n\n        mContentEdt.setText(mBannerAdapter.getTitle());\n        mCountEdt.setText(mBannerAdapter.getCount()+\"\");\n\n        findViewById(R.id.btn_example).setOnClickListener(new View.OnClickListener() {\n            @Override\n            public void onClick(View v) {\n                startActivity(new Intent(StartActivity.this, MainActivity.class));\n            }\n        });\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/com/example/app/adapter/BannerAdapter.java",
    "content": "package com.example.app.adapter;\n\nimport android.content.Context;\nimport android.view.LayoutInflater;\nimport android.view.View;\nimport android.widget.TextView;\n\nimport com.example.app.R;\nimport com.switcher.base.BaseSwitchView;\n\n/**\n * Created by shenxl on 2018/7/21.\n */\n\npublic class BannerAdapter extends BaseSwitchView.AbsBaseAdapter {\n\n    @Override\n    public View makeView(Context context) {\n        return LayoutInflater.from(context).inflate(R.layout.start_banner, null, false);\n    }\n\n    @Override\n    public void updateItem(View view, int position) {\n        View container = view.findViewById(R.id.banner_container);\n        TextView title = (TextView) view.findViewById(R.id.banner_title);\n        switch (position) {\n            case 0:\n                container.setBackgroundColor(view.getContext().getResources().getColor(R.color.colorPrimary));\n                title.setText(\"This is banner 0\");\n                break;\n            case 1:\n                container.setBackgroundColor(view.getContext().getResources().getColor(R.color.colorPrimaryDark));\n                title.setText(\"This is banner 1\");\n                break;\n            default:\n                container.setBackgroundColor(view.getContext().getResources().getColor(R.color.colorAccent));\n                title.setText(\"This is banner 2\");\n                break;\n        }\n\n    }\n\n    @Override\n    public int getItemCount() {\n        return 3;\n    }\n}"
  },
  {
    "path": "app/src/main/java/com/example/app/adapter/BannerAdapter2.java",
    "content": "package com.example.app.adapter;\n\nimport android.content.Context;\nimport android.view.LayoutInflater;\nimport android.view.View;\nimport android.widget.TextView;\n\nimport com.example.app.R;\nimport com.switcher.base.BaseSwitchView;\n\n/**\n * Created by shenxl on 2018/11/26.\n */\npublic class BannerAdapter2  extends BaseSwitchView.AbsBaseAdapter {\n    private int count = 3;\n    private String title = \"This is banner\";\n\n    @Override\n    public View makeView(Context context) {\n        return LayoutInflater.from(context).inflate(R.layout.start_banner_2, null, false);\n    }\n\n    @Override\n    public void updateItem(View view, int position) {\n        View container = view.findViewById(R.id.banner_container);\n        ((TextView) view.findViewById(R.id.banner_title)).setText(title);\n        ((TextView) view.findViewById(R.id.banner_pos)).setText(\"X\"+position);\n        switch (position % 3) {\n            case 0:\n                container.setBackgroundColor(view.getContext().getResources().getColor(R.color.colorPrimary));\n                break;\n            case 1:\n                container.setBackgroundColor(view.getContext().getResources().getColor(R.color.colorPrimaryDark));\n                break;\n            default:\n                container.setBackgroundColor(view.getContext().getResources().getColor(R.color.colorAccent));\n                break;\n        }\n\n    }\n\n    public void setCount(int count) {\n        this.count = count;\n    }\n\n    public void setTitle(String title) {\n        this.title = title;\n    }\n\n    public int getCount() {\n        return count;\n    }\n\n    public String getTitle() {\n        return title;\n    }\n\n    @Override\n    public int getItemCount() {\n        return count;\n    }\n}"
  },
  {
    "path": "app/src/main/java/com/example/app/adapter/HornAdapter.java",
    "content": "package com.example.app.adapter;\n\nimport android.content.Context;\nimport android.view.LayoutInflater;\nimport android.view.View;\nimport android.widget.TextView;\n\nimport com.example.app.R;\nimport com.switcher.AutoSwitchView;\n\nimport java.util.List;\n\n/**\n * Created by shenxl on 2018/7/21.\n */\n\n\npublic class HornAdapter extends AutoSwitchView.AbsBaseAdapter {\n    List<String> mEntityList;\n\n    public HornAdapter(List<String> entityList) {\n        mEntityList = entityList;\n    }\n\n    @Override\n    public View makeView(Context context) {\n        return LayoutInflater.from(context).inflate(R.layout.vertical_banner,null,false);\n    }\n\n    @Override\n    public void updateItem(View view, int position) {\n        String bean = mEntityList.get(position);\n        TextView title = (TextView) view.findViewById(R.id.item_banner_text);\n        TextView stones = (TextView) view.findViewById(R.id.item_banner_stones);\n        title.setText(bean);\n        stones.setText(\"X\"+position);\n    }\n\n    @Override\n    public int getItemCount() {\n        return mEntityList == null ? 0 : mEntityList.size();\n    }\n}"
  },
  {
    "path": "app/src/main/java/com/example/app/adapter/MyAdapterInList.java",
    "content": "package com.example.app.adapter;\n\nimport android.app.Activity;\nimport android.content.Context;\nimport android.view.View;\nimport android.widget.TextView;\n\nimport com.example.app.R;\nimport com.switcher.AutoSwitchView;\n\n/**\n * Created by shenxl on 2018/7/21.\n */\n\npublic class MyAdapterInList extends AutoSwitchView.AbsBaseAdapter{\n    private Activity mActivity;\n    private int count;\n\n    public MyAdapterInList(Activity activity, int count) {\n        mActivity = activity;\n        this.count = count;\n    }\n\n    @Override\n    public View makeView(Context context) {\n        return mActivity.getLayoutInflater().inflate(R.layout.item_in_list, null);\n    }\n\n    @Override\n    public void updateItem(View view, int position) {\n        TextView textView = (TextView) view.findViewById(R.id.text_item_in_list);\n        textView.setText(\"i am rolling in a listview : \"+position);\n    }\n\n    @Override\n    public int getItemCount() {\n        return count;\n    }\n}"
  },
  {
    "path": "app/src/main/java/com/example/app/adapter/PortraitAdapter.java",
    "content": "package com.example.app.adapter;\n\nimport android.content.Context;\nimport android.view.LayoutInflater;\nimport android.view.View;\nimport android.widget.TextView;\n\nimport com.example.app.R;\nimport com.switcher.base.BaseSwitchView;\n\n/**\n * Created by shenxl on 2018/7/21.\n */\n\npublic class PortraitAdapter extends BaseSwitchView.AbsBaseAdapter {\n\n    @Override\n    public View makeView(Context context) {\n        return LayoutInflater.from(context).inflate(R.layout.item_portrait, null, false);\n    }\n\n    @Override\n    public void updateItem(View view, int position) {\n        TextView name = (TextView) view.findViewById(R.id.item_name);\n        TextView desc = (TextView) view.findViewById(R.id.item_desc);\n        switch (position) {\n            case 0:\n                name.setText(\"Savannah\");\n                desc.setText(\"Life means progress and progress means suffering\");\n                break;\n            case 1:\n                name.setText(\"Alexandra\");\n                desc.setText(\"Human life is like flowing water\");\n                break;\n            default:\n                name.setText(\"Katherine\");\n                desc.setText(\"1111112222244433\");\n                break;\n        }\n\n    }\n\n    @Override\n    public int getItemCount() {\n        return 3;\n    }\n}"
  },
  {
    "path": "app/src/main/java/com/example/app/adapter/SingleTextAdapter.java",
    "content": "package com.example.app.adapter;\n\nimport android.content.Context;\nimport android.view.LayoutInflater;\nimport android.view.View;\nimport android.widget.TextView;\n\nimport com.example.app.R;\nimport com.switcher.base.BaseSwitchView;\n\n/**\n * Created by shenxl on 2018/7/21.\n */\n\npublic class SingleTextAdapter extends BaseSwitchView.AbsBaseAdapter {\n    private String str;\n\n    public SingleTextAdapter(String str) {\n        this.str = str;\n    }\n\n    @Override\n    public View makeView(Context context) {\n        return LayoutInflater.from(context).inflate(R.layout.item_single_text, null, false);\n    }\n\n    @Override\n    public void updateItem(View view, int position) {\n        TextView te = (TextView) view.findViewById(R.id.single_text);\n        te.setText(str+\" X\"+position);\n    }\n\n    @Override\n    public int getItemCount() {\n        return 5;\n    }\n}"
  },
  {
    "path": "app/src/main/res/anim/anim_in.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<set xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <translate\n        android:duration=\"500\"\n        android:fromXDelta=\"100%p\"\n        android:toXDelta=\"0\"/>\n</set>"
  },
  {
    "path": "app/src/main/res/anim/anim_out.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<set xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <translate\n        android:duration=\"500\"\n        android:fromXDelta=\"0\"\n        android:toXDelta=\"-100%p\"/>\n</set>"
  },
  {
    "path": "app/src/main/res/animator/anim_in.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<objectAnimator\n    xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:duration=\"600\"\n    android:interpolator=\"@android:anim/accelerate_decelerate_interpolator\"\n    android:propertyName=\"y\"\n    android:valueFrom=\"-100\"\n    android:valueTo=\"0\"\n    android:valueType=\"floatType\"/>"
  },
  {
    "path": "app/src/main/res/animator/anim_out.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<objectAnimator\n    xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:duration=\"600\"\n    android:interpolator=\"@android:anim/accelerate_decelerate_interpolator\"\n    android:propertyName=\"y\"\n    android:valueFrom=\"0\"\n    android:valueTo=\"100\"\n    android:valueType=\"floatType\"/>"
  },
  {
    "path": "app/src/main/res/layout/activity_list.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<FrameLayout\n    xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\">\n\n    <ListView\n        android:id=\"@+id/listview\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"match_parent\"></ListView>\n\n</FrameLayout>"
  },
  {
    "path": "app/src/main/res/layout/activity_main.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout\n    xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:app=\"http://schemas.android.com/apk/res-auto\"\n    android:orientation=\"vertical\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\">\n\n    <com.switcher.AutoSwitchView\n        android:id=\"@+id/auto_roll_banner\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:layout_gravity=\"center_horizontal\"\n        app:switcher_repeatCount=\"-1\"\n        app:switcher_autoStart=\"true\"/>\n\n    <com.switcher.AutoSwitchView\n        android:id=\"@+id/auto_roll_0\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:layout_marginTop=\"30dp\"\n        android:layout_gravity=\"center_horizontal\"\n        app:switcher_repeatCount=\"-1\"\n        app:switcher_autoStart=\"true\"/>\n\n    <com.switcher.AutoSwitchView\n        android:id=\"@+id/auto_roll_1\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:layout_marginTop=\"20dp\"\n        android:layout_gravity=\"center_horizontal\"\n        app:switcher_repeatCount=\"-1\"\n        app:switcher_autoStart=\"true\"/>\n\n    <com.switcher.AutoSwitchView\n        android:id=\"@+id/auto_roll_2\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:layout_marginTop=\"20dp\"\n        android:layout_gravity=\"center_horizontal\"\n        app:switcher_repeatCount=\"-1\"\n        app:switcher_autoStart=\"true\"/>\n\n    <com.switcher.AutoSwitchView\n        android:id=\"@+id/auto_roll_3\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:layout_marginTop=\"20dp\"\n        android:layout_gravity=\"center_horizontal\"\n        app:switcher_repeatCount=\"-1\"\n        app:switcher_autoStart=\"true\"/>\n\n    <com.switcher.AutoSwitchView\n        android:id=\"@+id/auto_roll_4\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:layout_marginTop=\"20dp\"\n        android:layout_gravity=\"center_horizontal\"\n        app:switcher_autoStart=\"true\"/>\n\n</LinearLayout>\n"
  },
  {
    "path": "app/src/main/res/layout/activity_start.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<android.support.constraint.ConstraintLayout\n    xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:app=\"http://schemas.android.com/apk/res-auto\"\n    android:orientation=\"vertical\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:gravity=\"center\">\n\n    <com.switcher.AutoSwitchView\n        android:id=\"@+id/start_banner\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:layout_gravity=\"center_horizontal\"\n        app:switcher_repeatCount=\"-1\"\n        app:switcher_autoStart=\"true\"\n        app:layout_constraintTop_toTopOf=\"parent\"/>\n\n    <TextView\n        android:id=\"@+id/tv_content\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:textSize=\"16sp\"\n        android:textColor=\"#000000\"\n        android:text=\"content:\"\n        android:layout_marginTop=\"30dp\"\n        android:layout_marginLeft=\"15dp\"\n        app:layout_constraintLeft_toLeftOf=\"parent\"\n        app:layout_constraintTop_toBottomOf=\"@id/start_banner\"/>\n\n    <EditText\n        android:id=\"@+id/edt_content\"\n        android:layout_width=\"0dp\"\n        android:layout_height=\"49dp\"\n        android:layout_marginLeft=\"10dp\"\n        android:layout_marginRight=\"15dp\"\n        android:background=\"@null\"\n        android:hint=\"modify content\"\n        android:singleLine=\"true\"\n        android:textColorHint=\"#cccccc\"\n        android:textColor=\"#535353\"\n        android:textSize=\"15sp\"\n        app:layout_constraintLeft_toRightOf=\"@id/tv_content\"\n        app:layout_constraintRight_toRightOf=\"parent\"\n        app:layout_constraintBaseline_toBaselineOf=\"@id/tv_content\" />\n\n    <EditText\n        android:id=\"@+id/edt_count\"\n        android:layout_width=\"0dp\"\n        android:layout_height=\"49dp\"\n        android:layout_marginTop=\"10dp\"\n        android:inputType=\"number\"\n        android:background=\"@null\"\n        android:hint=\"modify count\"\n        android:singleLine=\"true\"\n        android:textColorHint=\"#cccccc\"\n        android:textSize=\"15sp\"\n        app:layout_constraintLeft_toLeftOf=\"@id/edt_content\"\n        app:layout_constraintRight_toRightOf=\"@id/edt_content\"\n        app:layout_constraintTop_toBottomOf=\"@id/edt_content\" />\n\n    <TextView\n        android:id=\"@+id/tv_count\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:textSize=\"16sp\"\n        android:textColor=\"#000000\"\n        android:text=\"count:\"\n        app:layout_constraintLeft_toLeftOf=\"@id/tv_content\"\n        app:layout_constraintBaseline_toBaselineOf=\"@id/edt_count\"/>\n\n    <Button\n        android:id=\"@+id/btn_save\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:layout_marginTop=\"20dp\"\n        android:text=\"Save changes\"\n        app:layout_constraintLeft_toLeftOf=\"parent\"\n        app:layout_constraintRight_toRightOf=\"parent\"\n        app:layout_constraintTop_toBottomOf=\"@id/edt_count\"/>\n\n    <Button\n        android:id=\"@+id/btn_example\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:layout_marginLeft=\"20dp\"\n        android:layout_marginRight=\"20dp\"\n        android:layout_marginBottom=\"40dp\"\n        android:text=\"More examples\"\n        app:layout_constraintBottom_toBottomOf=\"parent\"/>\n\n</android.support.constraint.ConstraintLayout>"
  },
  {
    "path": "app/src/main/res/layout/item_in_list.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<FrameLayout\n    xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\">\n\n    <TextView\n        android:id=\"@+id/text_item_in_list\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:gravity=\"center_horizontal\"\n        android:padding=\"5dp\"/>\n\n</FrameLayout>"
  },
  {
    "path": "app/src/main/res/layout/item_list.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout\n    xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:app=\"http://schemas.android.com/apk/res-auto\"\n    android:orientation=\"vertical\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:paddingTop=\"40dp\"\n    android:paddingBottom=\"40dp\">\n\n    <TextView\n        android:id=\"@+id/textview\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:layout_marginTop=\"8dp\"\n        android:padding=\"8dp\"\n        android:layout_gravity=\"center_horizontal\"/>\n\n    <com.switcher.AutoSwitchView\n        android:id=\"@+id/auto_roll_in_list\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:layout_marginTop=\"15dp\"\n        android:layout_gravity=\"center_horizontal\"/>\n\n</LinearLayout>\n"
  },
  {
    "path": "app/src/main/res/layout/item_portrait.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<FrameLayout\n    xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"wrap_content\">\n\n    <RelativeLayout\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:layout_gravity=\"center\">\n\n        <ImageView\n            android:id=\"@+id/portrait\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:layout_marginTop=\"5dp\"\n            android:src=\"@drawable/portrait\"/>\n\n        <TextView\n            android:id=\"@+id/item_name\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:layout_marginLeft=\"10dp\"\n            android:layout_toRightOf=\"@id/portrait\"\n            android:text=\"my name\"\n            android:textColor=\"#000000\"\n            android:textSize=\"17sp\"/>\n\n        <TextView\n            android:id=\"@+id/item_desc\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:layout_marginLeft=\"10dp\"\n            android:layout_toRightOf=\"@id/portrait\"\n            android:layout_below=\"@id/item_name\"\n            android:text=\"this is the desc\"\n            android:textColor=\"#9c9c9c\"\n            android:textSize=\"12sp\"/>\n\n    </RelativeLayout>\n\n</FrameLayout>"
  },
  {
    "path": "app/src/main/res/layout/item_single_text.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<FrameLayout\n    xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\">\n\n    <TextView\n        android:id=\"@+id/single_text\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:layout_gravity=\"center\"/>\n\n</FrameLayout>"
  },
  {
    "path": "app/src/main/res/layout/start_banner.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RelativeLayout\n    xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:id=\"@+id/banner_container\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"wrap_content\">\n\n    <TextView\n        android:id=\"@+id/banner_title\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:textColor=\"@android:color/black\"\n        android:textSize=\"22sp\"\n        android:text=\"This is title\"\n        android:layout_centerHorizontal=\"true\"\n        android:layout_marginBottom=\"35dp\"\n        android:layout_marginTop=\"40dp\"/>\n\n    <TextView\n        android:id=\"@+id/banner_more\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:textColor=\"#919191\"\n        android:textSize=\"10sp\"\n        android:text=\"Click and See More\"\n        android:drawablePadding=\"5dp\"\n        android:drawableRight=\"@drawable/arrow_double\"\n        android:layout_alignParentRight=\"true\"\n        android:layout_below=\"@id/banner_title\"\n        android:layout_margin=\"5dp\"/>\n\n\n</RelativeLayout>"
  },
  {
    "path": "app/src/main/res/layout/start_banner_2.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout\n    xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:orientation=\"vertical\"\n    android:id=\"@+id/banner_container\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"wrap_content\"\n    android:gravity=\"center_horizontal\"\n    >\n\n    <TextView\n        android:id=\"@+id/banner_title\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:textColor=\"@android:color/black\"\n        android:textSize=\"18sp\"\n        android:layout_centerHorizontal=\"true\"\n        android:layout_marginLeft=\"20dp\"\n        android:layout_marginRight=\"20dp\"\n        android:layout_marginTop=\"40dp\"\n        />\n\n    <TextView\n        android:id=\"@+id/banner_pos\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:textColor=\"@android:color/black\"\n        android:textSize=\"22sp\"\n        android:layout_centerHorizontal=\"true\"\n        android:layout_marginTop=\"5dp\"\n        android:layout_marginBottom=\"35dp\"\n        />\n\n</LinearLayout>"
  },
  {
    "path": "app/src/main/res/layout/vertical_banner.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout\n    xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:orientation=\"horizontal\"\n    android:layout_width=\"wrap_content\"\n    android:layout_height=\"wrap_content\">\n\n    <TextView\n        android:id=\"@+id/item_banner_text\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:layout_marginLeft=\"50dp\"\n        android:drawablePadding=\"8dp\"\n        android:drawableLeft=\"@drawable/horn\"\n        android:textSize=\"11sp\"\n        android:textColor=\"#666666\"/>\n\n    <TextView\n        android:id=\"@+id/item_banner_stones\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:drawableLeft=\"@drawable/stone\"\n        android:drawablePadding=\"3dp\"\n        android:layout_marginLeft=\"5dp\"\n        android:textSize=\"11sp\"\n        android:textColor=\"#666666\"/>\n</LinearLayout>"
  },
  {
    "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/strings.xml",
    "content": "<resources>\n    <string name=\"app_name\">AutoSwitcher</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/com/example/app/ExampleUnitTest.java",
    "content": "package com.example.app;\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": "auto-switcher/.gitignore",
    "content": "/build\n"
  },
  {
    "path": "auto-switcher/build.gradle",
    "content": "apply plugin: 'com.android.library'\n\nandroid {\n    compileSdkVersion 26\n\n    defaultConfig {\n        minSdkVersion 15\n        targetSdkVersion 26\n        versionCode 3\n        versionName \"1.2\"\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    lintOptions {\n        abortOnError false\n    }\n\n}\n\ndependencies {\n    implementation fileTree(dir: 'libs', include: ['*.jar'])\n\n    compileOnly 'com.android.support:appcompat-v7:26.0.0-beta1'\n}\n\n\next {\n    PUBLISH_GROUP_ID = 'com.github.markshawn'\n    PUBLISH_ARTIFACT_ID = 'auto-switcher'\n    PUBLISH_VERSION = '1.2'\n}\n\napply from: 'https://raw.githubusercontent.com/blundell/release-android-library/master/android-release-aar.gradle'"
  },
  {
    "path": "auto-switcher/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": "auto-switcher/src/main/AndroidManifest.xml",
    "content": "<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n          package=\"com.switcher\"/>\n"
  },
  {
    "path": "auto-switcher/src/main/java/com/switcher/AutoSwitchView.java",
    "content": "package com.switcher;\n\nimport android.content.Context;\nimport android.content.res.TypedArray;\nimport android.util.AttributeSet;\n\nimport com.switcher.base.BaseSwitchView;\nimport com.switcher.base.Utils;\nimport com.switcher.builder.DefaultStrategyBuilder;\n\n/**\n * AutoSwitchView will animate between two views and one is shown at a time.\n * It can automatically switch between each child\n *\n * Created by shenxl on 2018/7/11.\n */\n\npublic class AutoSwitchView extends BaseSwitchView {\n    public static final int INFINITE = -1;\n\n    private SwitchStrategy mSwitchStrategy;\n    private SwitchListener mSwitchListener;\n    private boolean mWasRunningWhenDetached;\n    private boolean mIsRunning;\n    private boolean mAutoStart;\n    private int mHasRepeatedCount;\n    private int mRepeatCount;\n\n    public AutoSwitchView(Context context) {\n        super(context);\n        init(null);\n    }\n\n    public AutoSwitchView(Context context, AttributeSet attrs) {\n        super(context, attrs);\n        init(attrs);\n    }\n\n    public AutoSwitchView(Context context, AttributeSet attrs, int defStyleAttr) {\n        super(context, attrs, defStyleAttr);\n        init(attrs);\n    }\n\n    public AutoSwitchView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {\n        super(context, attrs, defStyleAttr, defStyleRes);\n        init(attrs);\n    }\n\n    private void init(AttributeSet attrs) {\n        if (attrs != null) {\n            TypedArray ta = getContext().obtainStyledAttributes(attrs, R.styleable.AutoSwitchView);\n            if (ta.getBoolean(R.styleable.AutoSwitchView_switcher_autoStart, false)) {\n                mAutoStart = true;\n            }\n            if (ta.hasValue(R.styleable.AutoSwitchView_switcher_repeatCount)) {\n                setRepeatCount(ta.getInt(R.styleable.AutoSwitchView_switcher_repeatCount, INFINITE));\n            }\n            ta.recycle();\n        }\n        mSwitchStrategy = new DefaultStrategyBuilder().build();\n    }\n\n    @Override\n    protected void onDetachedFromWindow() {\n        mWasRunningWhenDetached = mIsRunning;\n        mIsRunning = false;\n        if (mSwitchStrategy != null) {\n            mSwitchStrategy.onStop();\n        }\n        super.onDetachedFromWindow();\n    }\n\n    @Override\n    protected void onAttachedToWindow() {\n        super.onAttachedToWindow();\n        if (mWasRunningWhenDetached || mAutoStart) {\n            startSwitcher();\n        }\n    }\n\n    @Override\n    public void setVisibility(int visibility) {\n        // Cancel animations or delays when it is hidden\n        if (visibility != VISIBLE){\n            stopSwitcher();\n        }\n        super.setVisibility(visibility);\n    }\n\n    @Override\n    public void setDisplayedItem(int itemIndex) {\n        // Cancel animations or delays when user choose one of items\n        if (mIsRunning) {\n            stopSwitcher();\n        }\n        super.setDisplayedItem(itemIndex);\n    }\n\n    /**\n     * @return\n     *\n     * @see #setSwitchStrategy(SwitchStrategy)\n     */\n    public SwitchStrategy getSwitchStrategy() {\n        return mSwitchStrategy;\n    }\n\n    /**\n     * Customized animation strategy for switch between each child\n     *\n     * @param switchStrategy\n     */\n    public void setSwitchStrategy(SwitchStrategy switchStrategy) {\n        if (mSwitchStrategy != null){\n            mSwitchStrategy.onStop();\n            mIsRunning = false;\n        }\n        mSwitchStrategy = switchStrategy;\n    }\n\n    /**\n     * @return\n     *\n     * @see #setSwitchListener(SwitchListener)\n     */\n    public SwitchListener getSwitchListener() {\n        return mSwitchListener;\n    }\n\n    /**\n     * Sets a listener to notify the life of animation(that starts, ends or repeats)\n     *\n     * @param switchListener\n     */\n    public void setSwitchListener(SwitchListener switchListener) {\n        mSwitchListener = switchListener;\n    }\n\n    /**\n     * @return\n     *\n     * @see #setRepeatCount(int)\n     */\n    public int getRepeatCount() {\n        return mRepeatCount;\n    }\n\n    /**\n     * Sets how many times the animation should be repeated.\n     * If the repeat count is 0, the animation is never repeated.\n     * The repeat count is 0 by default.\n     *\n     * @param repeatCount the number of times the animation should be repeated\n     */\n    public void setRepeatCount(int repeatCount) {\n        mRepeatCount = repeatCount;\n    }\n\n    /**\n     * @return\n     *\n     * @see #setAutoStart(boolean)\n     */\n    public boolean isAutoStart() {\n        return mAutoStart;\n    }\n\n    /**\n     * Set if this view automatically calls {@link #startSwitcher()} when it\n     * becomes attached to a window.\n     *\n     * @param autoStart\n     */\n    public void setAutoStart(boolean autoStart) {\n        mAutoStart = autoStart;\n    }\n\n    /**\n     * Start a timer to cycle through child views\n     */\n    public void startSwitcher() {\n        mHasRepeatedCount = 0;\n\n        if (getChildCount() == 0 && mAdapter != null) {\n            addView(mAdapter.makeView(getContext()));\n            addView(mAdapter.makeView(getContext()));\n        } else {\n            for (int i = 0; i < getChildCount(); i++) {\n                getChildAt(i).setTag(null);\n            }\n        }\n\n        if (checkNoAnimCondtions()) {\n            stopSwitcher();\n            return;\n        }\n\n        if (!mIsRunning) {\n            if (mSwitchStrategy != null) {\n                post(new Runnable() {\n                    @Override\n                    public void run() {\n                        if (mSwitchListener != null) {\n                            mSwitchListener.switchStart(AutoSwitchView.this);\n                        }\n                        mSwitchStrategy.setSwitcher(AutoSwitchView.this);\n                        mSwitchStrategy.init();\n                        mIsRunning = true;\n                    }\n                });\n            }\n        }\n    }\n\n    /**\n     * Cancel animations or delay\n     */\n    public void stopSwitcher() {\n        mIsRunning = false;\n        if (mSwitchStrategy != null) {\n            mSwitchStrategy.onStop();\n        }\n        resetIndex();\n        if (mAdapter != null) {\n            if (mAdapter.getItemCount() == 0) {\n                removeAllViews();\n            } else if (mAdapter.getItemCount() == 1){\n                showIntervalState();\n            }\n        }\n        clearTags();\n        if (mSwitchListener != null) {\n            mSwitchListener.switchEnd(this);\n        }\n    }\n\n    boolean needStop() {\n        return checkNoAnimCondtions() || repeatOutOfLimit();\n    }\n\n    private boolean checkNoAnimCondtions() {\n        return getAdapter() == null || getAdapter().getItemCount() < 2 || getVisibility() != VISIBLE;\n    }\n\n    private boolean repeatOutOfLimit(){\n        return mRepeatCount != INFINITE && mHasRepeatedCount > mRepeatCount;\n    }\n\n    void showIntervalState() {\n        //show one view for a moment (mInterval) betwwn two switching actions\n        super.setDisplayedItem(mAdapter.getCurrentIndex());\n    }\n\n    void resetIndex() {\n        mWhichChild = 0;\n        if (mAdapter != null) {\n            mAdapter.setCurrentItem(0);\n        }\n    }\n\n    void stepOver() {\n        // index of view ++\n        stepForward();\n        if (mAdapter != null) {\n            // index of item ++\n            mAdapter.setCurrentItem(Utils.getIndexInLoop(mAdapter.getCurrentIndex() + 1, 0, mAdapter.getItemCount()));\n            if (mAdapter.getCurrentIndex() == 0) {\n                mHasRepeatedCount++;\n                if (mSwitchListener != null && !repeatOutOfLimit()) {\n                    mSwitchListener.switchRepeat(this);\n                }\n            }\n        }\n    }\n\n    /**\n     * The animation listener to be notified when the animation of switcher starts,\n     * ends or repeats.\n     */\n    public interface SwitchListener {\n        void switchStart(AutoSwitchView switcher);\n\n        void switchRepeat(AutoSwitchView switcher);\n\n        void switchEnd(AutoSwitchView switcher);\n    }\n}"
  },
  {
    "path": "auto-switcher/src/main/java/com/switcher/SwitchStrategy.java",
    "content": "package com.switcher;\n\nimport android.os.Handler;\nimport android.os.Looper;\nimport android.view.View;\n\nimport com.switcher.base.ChainOperator;\nimport com.switcher.base.SingleOperator;\n\n/**\n * A strategy that leads switcher {@link AutoSwitchView} to get all switching\n * movement or animations done. It is a powerful tool that can be easliy\n * customized through adding SingleOperator into {@link BaseBuilder}\n * (init-next-withend) in turn to control all movements of {@link AutoSwitchView}.\n *\n * And some strategies are offered in the package builder, such as\n * CarouselStrategyBuilder, AnimationStrategyBuilder, AnimatorStrategyBuilder\n * and so on. The DefaultStrategyBuilder is used in {@link AutoSwitchView}\n * by default.\n *\n * Created by shenxl on 2018/7/19.\n */\n\npublic class SwitchStrategy implements ChainOperator {\n    private boolean mIsStopped;\n    private long mInterval;\n    private AutoSwitchView mSwitcher;\n    private Handler mHandler = new Handler(Looper.getMainLooper());\n    private Object[] mCancelMembers;\n\n    private SingleOperator mInitStep, mNextStep, mStopStep;\n\n    private SwitchStrategy(BaseBuilder builder) {\n        mInitStep = builder.mInitStep;\n        mNextStep = builder.mNextStep;\n        mStopStep = builder.mStopStep;\n    }\n\n    void setSwitcher(AutoSwitchView switcher) {\n        mSwitcher = switcher;\n    }\n\n    void init(){\n        mIsStopped = false;\n        mSwitcher.resetIndex();\n        mSwitcher.showIntervalState();\n        if (mInitStep != null) {\n            mInitStep.operate(mSwitcher, this);\n        }\n    }\n\n    @Override\n    public void onStop(){\n        if (!mIsStopped) {\n            mHandler.removeCallbacksAndMessages(null);\n            if (mStopStep != null) {\n                mStopStep.operate(mSwitcher, this);\n            }\n        }\n        mIsStopped = true;\n    }\n\n    @Override\n    public void showNext(){\n        mSwitcher.stepOver();\n\n        if (mIsStopped){\n            return;\n        } else if (mSwitcher.needStop()){\n            mSwitcher.stopSwitcher();\n            return;\n        }\n\n        mSwitcher.getCurrentView().setVisibility(View.VISIBLE);\n        mSwitcher.getPreviousView().setVisibility(View.VISIBLE);\n        mSwitcher.updateCurrentView();\n        if (mNextStep != null) {\n            mNextStep.operate(mSwitcher, this);\n        }\n    }\n\n    @Override\n    public void showNextWithInterval(long delay){\n        this.mInterval = delay;\n        mSwitcher.showIntervalState();\n        mHandler.postDelayed(new Runnable() {\n            @Override\n            public void run() {\n                showNext();\n            }\n        }, delay);\n    }\n\n    @Override\n    public void stopWhenNeeded(Object... ts){\n        mCancelMembers = ts;\n    }\n\n    @Override\n    public Object[] getStoppingMembers() {\n        return mCancelMembers;\n    }\n\n    public static final class BaseBuilder {\n        private SingleOperator mInitStep;\n        private SingleOperator mNextStep;\n        private SingleOperator mStopStep;\n\n        public BaseBuilder() {\n        }\n\n        /**\n         * @param val The access to all the movements or animations in\n         *            AutoSwitchView. if not called, nothing will happen.\n         * @return\n         */\n        public BaseBuilder init(SingleOperator val) {\n            mInitStep = val;\n            return this;\n        }\n\n        /**\n         * @param val Automatically invoked after showNext or showNextWithInterval\n         *            in {@link ChainOperator} is called\n         * @return\n         */\n        public BaseBuilder next(SingleOperator val) {\n            mNextStep = val;\n            return this;\n        }\n\n        /**\n         * Strongly recommend calling it to cancel animations or delay in case menory\n         * leaks or anything unusual happens\n         *\n         * @param val Automatically invoked when the switching movements is stopped\n         *            or {@link AutoSwitchView} is detached from window.\n         * @return\n         */\n        public BaseBuilder withEnd(SingleOperator val) {\n            mStopStep = val;\n            return this;\n        }\n\n        public SwitchStrategy build() {\n            return new SwitchStrategy(this);\n        }\n    }\n}\n"
  },
  {
    "path": "auto-switcher/src/main/java/com/switcher/base/BaseSwitchView.java",
    "content": "package com.switcher.base;\n\nimport android.content.Context;\nimport android.util.AttributeSet;\nimport android.view.MotionEvent;\nimport android.view.View;\nimport android.widget.FrameLayout;\n\n/**\n * Base class for a {@link FrameLayout} container that can switch between views.\n *\n * Created by shenxl on 2018/7/19.\n */\n\npublic class BaseSwitchView extends FrameLayout {\n    public static final int INFINITE = -1;\n\n    protected int mWhichChild = 0;\n    protected AbsBaseAdapter mAdapter;\n    private OnItemClickListener mItemClickListener;\n    private int mActionDownItemIndex = -1;\n\n    public BaseSwitchView(Context context) {\n        super(context);\n    }\n\n    public BaseSwitchView(Context context, AttributeSet attrs) {\n        super(context, attrs);\n    }\n\n    public BaseSwitchView(Context context, AttributeSet attrs, int defStyleAttr) {\n        super(context, attrs, defStyleAttr);\n    }\n\n    public BaseSwitchView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {\n        super(context, attrs, defStyleAttr, defStyleRes);\n    }\n\n    @Override\n    public void removeAllViews() {\n        super.removeAllViews();\n        mWhichChild = 0;\n    }\n\n    @Override\n    public boolean onTouchEvent(MotionEvent event) {\n        switch (event.getAction()){\n            case MotionEvent.ACTION_DOWN:\n                if (mItemClickListener != null && mAdapter != null && mAdapter.getItemCount() > 0) {\n                    mActionDownItemIndex = mAdapter.getCurrentIndex();\n                    return true;\n                }\n                break;\n            case MotionEvent.ACTION_UP:\n                if (mItemClickListener != null && mAdapter != null && mAdapter.getItemCount() > 0 && mAdapter.getCurrentIndex() == mActionDownItemIndex ){\n                    mItemClickListener.onItemClick(this, getCurrentView(), mAdapter.getCurrentIndex());\n                    return true;\n                }\n                performClick();\n                mActionDownItemIndex = -1;\n                break;\n        }\n        return false;\n    }\n\n    public void setOnItemClickListener(OnItemClickListener itemClickListener) {\n        mItemClickListener = itemClickListener;\n    }\n\n    public void setAdapter(AbsBaseAdapter adapter) {\n        this.mAdapter = adapter;\n    }\n\n    public AbsBaseAdapter getAdapter() {\n        return mAdapter;\n    }\n\n    /**\n     * @return Returns the index of the currently displayed child view.\n     */\n    public int getWhichChild() {\n        return mWhichChild;\n    }\n\n    /**\n     * Displays the data at the specified position on the current view and\n     * other views will be hidden\n     *\n     * @param itemIndex\n     */\n    public void setDisplayedItem(int itemIndex) {\n        final int count = getChildCount();\n        final View currentView = getCurrentView();\n        for (int i = 0; i < count; i++) {\n            View child = getChildAt(i);\n            if (child != currentView) {\n                child.setVisibility(View.GONE);\n            } else {\n                child.setVisibility(View.VISIBLE);\n                if (mAdapter != null) {\n                    updateView(child, itemIndex);\n                    mAdapter.mWhichItem = itemIndex;\n                }\n            }\n        }\n    }\n\n    /**\n     * call before we need to update view immediately\n     */\n    public void clearTags(){\n        for (int i = 0;i < getChildCount();i++){\n            getChildAt(i).setTag(-1);\n        }\n    }\n\n    public View getCurrentView(){\n        return getChildAt(Utils.getIndexInLoop(mWhichChild, 0, getChildCount()));\n    }\n\n    public View getNextView(){\n        return getChildAt(Utils.getIndexInLoop(mWhichChild + 1, 0, getChildCount()));\n    }\n\n    public View getPreviousView(){\n        return getChildAt(Utils.getIndexInLoop(mWhichChild - 1, 0, getChildCount()));\n    }\n\n    public void stepForward() {\n        mWhichChild = Utils.getIndexInLoop(mWhichChild + 1, 0, getChildCount());\n    }\n\n    public void stepBackward() {\n        mWhichChild = Utils.getIndexInLoop(mWhichChild - 1, 0, getChildCount());\n    }\n\n    private void updateView(View view, int index){\n        if (mAdapter != null && index < mAdapter.getItemCount()) {\n            if (view.getTag() == null) {\n                view.setTag(index);\n                mAdapter.updateItem(view, index);\n            } else {\n                Integer i = (Integer) view.getTag();\n                if (i != index) {\n                    view.setTag(index);\n                    mAdapter.updateItem(view, index);\n                }\n            }\n        }\n    }\n\n    /**\n     * Displays the data at the current position on the current view\n     */\n    public void updateCurrentView(){\n        if (mAdapter != null) {\n            updateView(getCurrentView(), mAdapter.getCurrentIndex());\n        }\n    }\n\n    /**\n     * An Adapter object acts as a bridge between child views in {@link BaseSwitchView}\n     * and the underlying data for that view.\n     */\n    public static abstract class AbsBaseAdapter {\n        private int mWhichItem;\n\n        /**\n         * Create view that can be reused between items\n         *\n         * @param context\n         * @return\n         */\n        public abstract View makeView(Context context);\n\n        /**\n         * Displays the data at the specified position on a specified view\n         *\n         * @param view\n         * @param position\n         */\n        public abstract void updateItem(View view, int position);\n\n        /**\n         * @return How many items are in the data set represented by this Adapter.\n         */\n        public abstract int getItemCount();\n\n        public final int getCurrentIndex() {\n            return mWhichItem;\n        }\n\n        public final void setCurrentItem(int whichItem) {\n            mWhichItem = whichItem;\n        }\n\n        public final int getNextIndex() {\n            return Utils.getIndexInLoop(mWhichItem + 1, 0, getItemCount());\n        }\n    }\n\n    /**\n     * Interface definition for a callback to be invoked when an item in this\n     * View has been clicked.\n     */\n    public interface OnItemClickListener{\n        void onItemClick(BaseSwitchView parent, View child, int position);\n    }\n}\n"
  },
  {
    "path": "auto-switcher/src/main/java/com/switcher/base/ChainOperator.java",
    "content": "package com.switcher.base;\n\n/**\n * Created by shenxl on 2018/7/23.\n */\n\npublic interface ChainOperator {\n    /**\n     * Displays the data next item on the next view and {@link SingleOperator}\n     * that added in the next() in BaseBuilder will be invoked finally\n     */\n    void showNext();\n\n    /**\n     * Call #showNext() after some delay\n     * @param delay\n     */\n    void showNextWithInterval(long delay);\n\n    /**\n     * Stop switching movements and animations\n     */\n    void onStop();\n\n    /**\n     * Cache objects that need to stopped\n     *\n     * @param ts\n     */\n    void stopWhenNeeded(Object... ts);\n\n    /**\n     * Get objects that cached in #stopWhenNeeded(Object...)\n     *\n     * @return\n     */\n    Object[] getStoppingMembers();\n}\n"
  },
  {
    "path": "auto-switcher/src/main/java/com/switcher/base/SingleOperator.java",
    "content": "package com.switcher.base;\n\nimport com.switcher.AutoSwitchView;\nimport com.switcher.SwitchStrategy;\n\n/**\n * Created by shenxl on 2018/7/23.\n */\n\npublic interface SingleOperator {\n    void operate(AutoSwitchView switcher, ChainOperator operator);\n}\n"
  },
  {
    "path": "auto-switcher/src/main/java/com/switcher/base/Utils.java",
    "content": "package com.switcher.base;\n\n/**\n * Created by shenxl on 2018/7/21.\n */\n\npublic class Utils {\n    public static int getIndexInLoop(int index, int start, int total){\n        if (index >= start + total) {\n            return start;\n        } else if (index < start) {\n            return total + start - 1;\n        }\n        return index;\n    }\n}\n"
  },
  {
    "path": "auto-switcher/src/main/java/com/switcher/builder/AnimationStrategyBuilder.java",
    "content": "package com.switcher.builder;\n\nimport android.content.Context;\nimport android.view.animation.Animation;\nimport android.view.animation.AnimationUtils;\n\nimport com.switcher.AutoSwitchView;\nimport com.switcher.SwitchStrategy;\nimport com.switcher.base.ChainOperator;\nimport com.switcher.base.SingleOperator;\n\n/**\n * Simple strategy to customize your own animation with {@link Animation}\n *\n * Created by shenxl on 2018/7/21.\n */\n\npublic class AnimationStrategyBuilder {\n    private Animation mAnimationIn;\n    private Animation mAnimationOut;\n    private long mInterval = 3000;\n\n    public AnimationStrategyBuilder(Animation animationIn, Animation animationOut) {\n        mAnimationIn = animationIn;\n        mAnimationOut = animationOut;\n    }\n\n    public AnimationStrategyBuilder(Context context, int resourceIDIn, int resourceIDOut){\n        mAnimationIn = AnimationUtils.loadAnimation(context, resourceIDIn);\n        mAnimationOut = AnimationUtils.loadAnimation(context, resourceIDOut);\n    }\n\n    public AnimationStrategyBuilder setInterval(long interval) {\n        mInterval = interval;\n        return this;\n    }\n\n    public SwitchStrategy build() {\n        return new SwitchStrategy.BaseBuilder().\n                init(new SingleOperator() {\n                    @Override\n                    public void operate(AutoSwitchView switcher, ChainOperator operator) {\n                        operator.showNextWithInterval(mInterval);\n                    }\n                }).\n                next(new SingleOperator() {\n                    @Override\n                    public void operate(AutoSwitchView switcher, ChainOperator operator) {\n                        if (mAnimationIn != null) {\n                            switcher.getCurrentView().startAnimation(mAnimationIn);\n                        }\n                        if (mAnimationOut != null) {\n                            switcher.getPreviousView().startAnimation(mAnimationOut);\n                        }\n                        operator.showNextWithInterval(mInterval);\n                    }\n                }).\n                withEnd(new SingleOperator() {\n                    @Override\n                    public void operate(AutoSwitchView switcher, ChainOperator operator) {\n                        if (mAnimationIn != null) {\n                            mAnimationIn.cancel();\n                        }\n                        if (mAnimationOut != null) {\n                            mAnimationOut.cancel();\n                        }\n                    }\n                }).build();\n    }\n}\n"
  },
  {
    "path": "auto-switcher/src/main/java/com/switcher/builder/AnimatorStrategyBuilder.java",
    "content": "package com.switcher.builder;\n\nimport android.animation.AnimatorInflater;\nimport android.animation.ObjectAnimator;\nimport android.content.Context;\nimport android.os.Handler;\nimport android.view.View;\n\nimport com.switcher.AutoSwitchView;\nimport com.switcher.SwitchStrategy;\nimport com.switcher.base.ChainOperator;\nimport com.switcher.base.SingleOperator;\n\n/**\n * Simple strategy to customize your own animation with {@link ObjectAnimator}\n *\n * Created by shenxl on 2018/7/21.\n */\n\npublic class AnimatorStrategyBuilder {\n    private ObjectAnimator mAnimatorIn;\n    private ObjectAnimator mAnimatorOut;\n    private long mInterval = 3000;\n    private Handler mHandler = new Handler();\n\n    public AnimatorStrategyBuilder(ObjectAnimator animatorIn, ObjectAnimator animatorOut) {\n        mAnimatorIn = animatorIn;\n        mAnimatorOut = animatorOut;\n    }\n\n    public AnimatorStrategyBuilder(Context context, int resourceIDIn, int resourceIDOut) {\n        mAnimatorIn = (ObjectAnimator) AnimatorInflater.loadAnimator(context, resourceIDIn);\n        mAnimatorOut = (ObjectAnimator) AnimatorInflater.loadAnimator(context, resourceIDOut);\n    }\n\n    public AnimatorStrategyBuilder setInterval(long interval) {\n        mInterval = interval;\n        return this;\n    }\n\n    public SwitchStrategy build() {\n        return new SwitchStrategy.BaseBuilder().\n                init(new SingleOperator() {\n                    @Override\n                    public void operate(AutoSwitchView switcher, ChainOperator operator) {\n                        operator.showNextWithInterval(mInterval);\n                        View childShow = switcher.getCurrentView();\n                        childShow.setX(0);\n                        childShow.setY(0);\n                        childShow.setAlpha(1f);\n                    }\n                }).\n                next(new SingleOperator() {\n                    @Override\n                    public void operate(AutoSwitchView switcher, final ChainOperator operator) {\n                        long delay = 0;\n                        if (mAnimatorIn != null) {\n                            mAnimatorIn.setTarget(switcher.getCurrentView());\n                            mAnimatorIn.start();\n                            delay = mAnimatorIn.getDuration();\n                        }\n                        if (mAnimatorOut != null) {\n                            mAnimatorOut.setTarget(switcher.getPreviousView());\n                            mAnimatorOut.start();\n                            delay = delay > mAnimatorOut.getDuration() ? delay : mAnimatorOut.getDuration();\n                        }\n                        mHandler.postDelayed(new Runnable() {\n                            @Override\n                            public void run() {\n                                operator.showNextWithInterval(mInterval);\n                            }\n                        }, delay);\n                    }\n                }).\n                withEnd(new SingleOperator() {\n                    @Override\n                    public void operate(AutoSwitchView switcher, ChainOperator operator) {\n                        if (mAnimatorIn != null) {\n                            mAnimatorIn.cancel();\n                        }\n                        if (mAnimatorOut != null) {\n                            mAnimatorOut.cancel();\n                        }\n                        mHandler.removeCallbacksAndMessages(null);\n                    }\n                }).build();\n    }\n}\n"
  },
  {
    "path": "auto-switcher/src/main/java/com/switcher/builder/CarouselStrategyBuilder.java",
    "content": "package com.switcher.builder;\n\nimport android.view.View;\nimport android.view.ViewPropertyAnimator;\nimport android.view.animation.Interpolator;\n\nimport com.switcher.AutoSwitchView;\nimport com.switcher.SwitchStrategy;\nimport com.switcher.base.ChainOperator;\nimport com.switcher.base.SingleOperator;\n\n/**\n *  A strategy that is able to switch between two items in different directions\n *\n * Created by shenxl on 2018/7/21.\n */\n\npublic class CarouselStrategyBuilder {\n    private long mInterval = 2000;\n    private long mAnimDuration = 500;\n    private DirectionMode mMode = DirectionMode.top2Bottom;\n    private Interpolator mInterpolator;\n\n    public CarouselStrategyBuilder setInterval(long interval) {\n        this.mInterval = interval;\n        return this;\n    }\n\n    public CarouselStrategyBuilder setAnimDuration(long animDuration) {\n        this.mAnimDuration = animDuration;\n        return this;\n    }\n\n    public CarouselStrategyBuilder setMode(DirectionMode mode) {\n        this.mMode = mode;\n        return this;\n    }\n\n    public CarouselStrategyBuilder setInterpolator(Interpolator interpolator) {\n        this.mInterpolator = interpolator;\n        return this;\n    }\n\n    public SwitchStrategy build() {\n        return new SwitchStrategy.BaseBuilder().\n                init(new SingleOperator() {\n                    @Override\n                    public void operate(AutoSwitchView switcher, ChainOperator operator) {\n                        operator.showNextWithInterval(mInterval);\n                    }\n                }).\n                next(new SingleOperator() {\n                    @Override\n                    public void operate(AutoSwitchView switcher, final ChainOperator operator) {\n                        View viewOut = switcher.getPreviousView();\n                        switch (mMode) {\n                            case top2Bottom:\n                                viewOut.animate().setDuration(mAnimDuration).setInterpolator(mInterpolator).\n                                        translationYBy(switcher.getMeasuredHeight());\n                                break;\n                            case bottom2Top:\n                                viewOut.animate().setDuration(mAnimDuration).setInterpolator(mInterpolator).\n                                        translationYBy(-switcher.getMeasuredHeight());\n                                break;\n                            case left2Right:\n                                viewOut.animate().setDuration(mAnimDuration).setInterpolator(mInterpolator).\n                                        translationXBy(switcher.getMeasuredWidth());\n                                break;\n                            case right2Left:\n                                viewOut.animate().setDuration(mAnimDuration).setInterpolator(mInterpolator).\n                                        translationXBy(-switcher.getMeasuredWidth());\n                                break;\n                        }\n\n                        View viewIn = switcher.getCurrentView();\n                        switch (mMode) {\n                            case top2Bottom:\n                                viewIn.setY(-switcher.getMeasuredHeight());\n                                viewIn.animate().setDuration(mAnimDuration).setInterpolator(mInterpolator).\n                                        translationYBy(switcher.getMeasuredHeight());\n                                break;\n                            case bottom2Top:\n                                viewIn.setY(switcher.getMeasuredHeight());\n                                viewIn.animate().setDuration(mAnimDuration).setInterpolator(mInterpolator).\n                                        translationYBy(-switcher.getMeasuredHeight());\n                                break;\n                            case left2Right:\n                                viewIn.setX(-switcher.getMeasuredWidth());\n                                viewIn.animate().setDuration(mAnimDuration).setInterpolator(mInterpolator).\n                                        translationXBy(switcher.getMeasuredWidth());\n                                break;\n                            case right2Left:\n                                viewIn.setX(switcher.getMeasuredWidth());\n                                viewIn.animate().setDuration(mAnimDuration).setInterpolator(mInterpolator).\n                                        translationXBy(-switcher.getMeasuredWidth());\n                                break;\n                        }\n\n                        viewIn.animate().withEndAction(new Runnable() {\n                            @Override\n                            public void run() {\n                                operator.showNextWithInterval(mInterval);\n                            }\n                        });\n                        operator.stopWhenNeeded(viewOut.animate(), viewIn.animate());\n                    }\n                }).\n                withEnd(new SingleOperator() {\n                    @Override\n                    public void operate(AutoSwitchView switcher, ChainOperator operator) {\n                        switcher.getCurrentView().setX(0);\n                        switcher.getCurrentView().setY(0);\n                        switcher.getCurrentView().setVisibility(View.VISIBLE);\n                        switcher.getPreviousView().setX(0);\n                        switcher.getPreviousView().setY(0);\n                        switcher.getPreviousView().setVisibility(View.GONE);\n                        if (operator.getStoppingMembers() != null) {\n                            for (Object obj : operator.getStoppingMembers()) {\n                                ((ViewPropertyAnimator) obj).cancel();\n                            }\n                        }\n                    }\n                }).build();\n    }\n}\n"
  },
  {
    "path": "auto-switcher/src/main/java/com/switcher/builder/ContinuousStrategyBuilder.java",
    "content": "package com.switcher.builder;\n\nimport android.animation.ValueAnimator;\nimport android.view.View;\nimport android.view.animation.LinearInterpolator;\n\nimport com.switcher.AutoSwitchView;\nimport com.switcher.SwitchStrategy;\nimport com.switcher.base.ChainOperator;\nimport com.switcher.base.SingleOperator;\n\n/**\n * A strategy that is able to switch between items smoothly without any pauses\n *\n * Created by shenxl on 2018/7/21.\n */\n\npublic class ContinuousStrategyBuilder {\n    private long mDuration = 2000;\n    private DirectionMode mMode = DirectionMode.right2Left;\n\n    public ContinuousStrategyBuilder setDuration(long duration) {\n        this.mDuration = duration;\n        return this;\n    }\n\n    public ContinuousStrategyBuilder setMode(DirectionMode mode) {\n        this.mMode = mode;\n        return this;\n    }\n\n    public SwitchStrategy build() {\n        return new SwitchStrategy.BaseBuilder().\n                init(new SingleOperator() {\n                    @Override\n                    public void operate(final AutoSwitchView switcher, final ChainOperator operator) {\n                        final float end = switcher.getAdapter().getItemCount() + 1;\n                        ValueAnimator animator = ValueAnimator.ofFloat(0f, end);\n                        animator.setDuration((long) (mDuration * end));\n                        animator.setRepeatCount(ValueAnimator.INFINITE);\n                        animator.setRepeatMode(ValueAnimator.RESTART);\n                        animator.setInterpolator(new LinearInterpolator());\n                        animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {\n                            @Override\n                            public void onAnimationUpdate(ValueAnimator animation) {\n                                float value = (float) animation.getAnimatedValue();\n                                double floor = Math.floor(value);\n                                if (switcher.getAdapter().getNextIndex() == floor) {\n                                    operator.showNext();\n                                }\n\n                                float offset;\n                                switch (mMode) {\n                                    case top2Bottom:\n                                        offset = (float) ((value - floor) * switcher.getMeasuredHeight());\n                                        switcher.getCurrentView().setY(floor == end - 1 ? offset : offset - switcher.getMeasuredHeight());\n                                        switcher.getPreviousView().setY(floor == 0 || floor == end - 1 ? -switcher.getMeasuredHeight() : offset);\n                                        break;\n                                    case bottom2Top:\n                                        offset = (float) ((value - floor) * switcher.getMeasuredHeight());\n                                        switcher.getCurrentView().setY(floor == end - 1 ? -offset : switcher.getMeasuredHeight() - offset);\n                                        switcher.getPreviousView().setY(floor == 0 || floor == end - 1 ? switcher.getMeasuredHeight() : -offset);\n                                        break;\n                                    case left2Right:\n                                        offset = (float) ((value - floor) * switcher.getMeasuredWidth());\n                                        switcher.getCurrentView().setX(floor == end - 1 ? offset : offset - switcher.getMeasuredWidth());\n                                        switcher.getPreviousView().setX(floor == 0 || floor == end - 1 ? -switcher.getMeasuredWidth() : offset);\n                                        break;\n                                    case right2Left:\n                                        offset = (float) ((value - floor) * switcher.getMeasuredWidth());\n                                        switcher.getCurrentView().setX(floor == end - 1 ? -offset : switcher.getMeasuredWidth() - offset);\n                                        switcher.getPreviousView().setX(floor == 0 || floor == end - 1? switcher.getMeasuredWidth() : -offset);\n                                        break;\n                                }\n                            }\n                        });\n                        animator.start();\n\n                        operator.stopWhenNeeded(animator);\n                    }\n                }).\n                withEnd(new SingleOperator() {\n                    @Override\n                    public void operate(AutoSwitchView switcher, ChainOperator operator) {\n                        if (operator.getStoppingMembers() != null) {\n                            for (Object obj : operator.getStoppingMembers()) {\n                                ((ValueAnimator) obj).cancel();\n                            }\n                        }\n                    }\n                }).build();\n    }}\n"
  },
  {
    "path": "auto-switcher/src/main/java/com/switcher/builder/DefaultStrategyBuilder.java",
    "content": "package com.switcher.builder;\n\nimport com.switcher.AutoSwitchView;\nimport com.switcher.SwitchStrategy;\nimport com.switcher.base.ChainOperator;\nimport com.switcher.base.SingleOperator;\n\n/**\n * The strategy, that is used in {@link AutoSwitchView} by default, only\n * supports switching between items without any animations\n *\n * Created by shenxl on 2018/7/21.\n */\n\npublic class DefaultStrategyBuilder {\n    private long mInterval = 3000;\n\n    public DefaultStrategyBuilder setInterval(long interval) {\n        mInterval = interval;\n        return this;\n    }\n\n    public SwitchStrategy build() {\n        return new SwitchStrategy.BaseBuilder().\n                init(new SingleOperator() {\n                    @Override\n                    public void operate(AutoSwitchView switcher, ChainOperator operator) {\n                        operator.showNextWithInterval(mInterval);\n                    }\n                }).\n                next(new SingleOperator() {\n                    @Override\n                    public void operate(AutoSwitchView switcher, ChainOperator operator) {\n                        operator.showNextWithInterval(mInterval);\n                    }\n                }).build();\n    }\n}\n"
  },
  {
    "path": "auto-switcher/src/main/java/com/switcher/builder/DirectionMode.java",
    "content": "package com.switcher.builder;\n\n/**\n * Created by shenxl on 2018/7/21.\n */\n\npublic enum DirectionMode {\n    top2Bottom, bottom2Top, left2Right, right2Left\n}\n"
  },
  {
    "path": "auto-switcher/src/main/res/values/attrs.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n    <declare-styleable name=\"AutoSwitchView\">\n        <attr name=\"switcher_autoStart\" format=\"boolean\" />\n        <attr name=\"switcher_repeatCount\" format=\"integer\" />\n    </declare-styleable>\n</resources>"
  },
  {
    "path": "auto-switcher/src/main/res/values/strings.xml",
    "content": "<resources>\n    <string name=\"app_name\">autoSwitcher</string>\n</resources>\n"
  },
  {
    "path": "build.gradle",
    "content": "// Top-level build file where you can add configuration options common to all sub-projects/modules.\n\nbuildscript {\n    \n    repositories {\n        google()\n        jcenter()\n    }\n    dependencies {\n        classpath 'com.android.tools.build:gradle:4.0.1'\n        \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        google()\n        jcenter()\n    }\n}\n\ntask clean(type: Delete) {\n    delete rootProject.buildDir\n}\n"
  },
  {
    "path": "gradle/wrapper/gradle-wrapper.properties",
    "content": "#Thu Oct 01 08:47:46 IST 2020\ndistributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\nzipStoreBase=GRADLE_USER_HOME\nzipStorePath=wrapper/dists\ndistributionUrl=https\\://services.gradle.org/distributions/gradle-6.1.1-all.zip\n"
  },
  {
    "path": "gradle.properties",
    "content": "# 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', ':auto-switcher'\n"
  }
]