[
  {
    "path": ".gitignore",
    "content": "*.iml\n.gradle\n/local.properties\n/.idea/workspace.xml\n/.idea/libraries\n.DS_Store\n/build\n/captures\n"
  },
  {
    "path": ".idea/.name",
    "content": "ZuiMeiTAG"
  },
  {
    "path": ".idea/compiler.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"CompilerConfiguration\">\n    <resourceExtensions />\n    <wildcardResourcePatterns>\n      <entry name=\"!?*.java\" />\n      <entry name=\"!?*.form\" />\n      <entry name=\"!?*.class\" />\n      <entry name=\"!?*.groovy\" />\n      <entry name=\"!?*.scala\" />\n      <entry name=\"!?*.flex\" />\n      <entry name=\"!?*.kt\" />\n      <entry name=\"!?*.clj\" />\n      <entry name=\"!?*.aj\" />\n    </wildcardResourcePatterns>\n    <annotationProcessing>\n      <profile default=\"true\" name=\"Default\" enabled=\"false\">\n        <processorPath useClasspath=\"true\" />\n      </profile>\n    </annotationProcessing>\n  </component>\n</project>"
  },
  {
    "path": ".idea/copyright/profiles_settings.xml",
    "content": "<component name=\"CopyrightManager\">\n  <settings default=\"\" />\n</component>"
  },
  {
    "path": ".idea/encodings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"Encoding\">\n    <file url=\"PROJECT\" charset=\"UTF-8\" />\n  </component>\n</project>"
  },
  {
    "path": ".idea/gradle.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"GradleSettings\">\n    <option name=\"linkedExternalProjectsSettings\">\n      <GradleProjectSettings>\n        <option name=\"distributionType\" value=\"LOCAL\" />\n        <option name=\"externalProjectPath\" value=\"$PROJECT_DIR$\" />\n        <option name=\"gradleHome\" value=\"E:\\AndroidStudio\\IDE3\\gradle\\gradle-2.10\" />\n        <option name=\"modules\">\n          <set>\n            <option value=\"$PROJECT_DIR$\" />\n            <option value=\"$PROJECT_DIR$/app\" />\n          </set>\n        </option>\n        <option name=\"myModules\">\n          <set>\n            <option value=\"$PROJECT_DIR$\" />\n            <option value=\"$PROJECT_DIR$/app\" />\n          </set>\n        </option>\n      </GradleProjectSettings>\n    </option>\n  </component>\n</project>"
  },
  {
    "path": ".idea/misc.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"EntryPointsManager\">\n    <entry_points version=\"2.0\" />\n  </component>\n  <component name=\"NullableNotNullManager\">\n    <option name=\"myDefaultNullable\" value=\"android.support.annotation.Nullable\" />\n    <option name=\"myDefaultNotNull\" value=\"android.support.annotation.NonNull\" />\n    <option name=\"myNullables\">\n      <value>\n        <list size=\"4\">\n          <item index=\"0\" class=\"java.lang.String\" itemvalue=\"org.jetbrains.annotations.Nullable\" />\n          <item index=\"1\" class=\"java.lang.String\" itemvalue=\"javax.annotation.Nullable\" />\n          <item index=\"2\" class=\"java.lang.String\" itemvalue=\"edu.umd.cs.findbugs.annotations.Nullable\" />\n          <item index=\"3\" class=\"java.lang.String\" itemvalue=\"android.support.annotation.Nullable\" />\n        </list>\n      </value>\n    </option>\n    <option name=\"myNotNulls\">\n      <value>\n        <list size=\"4\">\n          <item index=\"0\" class=\"java.lang.String\" itemvalue=\"org.jetbrains.annotations.NotNull\" />\n          <item index=\"1\" class=\"java.lang.String\" itemvalue=\"javax.annotation.Nonnull\" />\n          <item index=\"2\" class=\"java.lang.String\" itemvalue=\"edu.umd.cs.findbugs.annotations.NonNull\" />\n          <item index=\"3\" class=\"java.lang.String\" itemvalue=\"android.support.annotation.NonNull\" />\n        </list>\n      </value>\n    </option>\n  </component>\n  <component name=\"ProjectLevelVcsManager\" settingsEditedManually=\"false\">\n    <OptionsSetting value=\"true\" id=\"Add\" />\n    <OptionsSetting value=\"true\" id=\"Remove\" />\n    <OptionsSetting value=\"true\" id=\"Checkout\" />\n    <OptionsSetting value=\"true\" id=\"Update\" />\n    <OptionsSetting value=\"true\" id=\"Status\" />\n    <OptionsSetting value=\"true\" id=\"Edit\" />\n    <ConfirmationsSetting value=\"0\" id=\"Add\" />\n    <ConfirmationsSetting value=\"0\" id=\"Remove\" />\n  </component>\n  <component name=\"ProjectRootManager\" version=\"2\" languageLevel=\"JDK_1_7\" default=\"true\" assert-keyword=\"true\" jdk-15=\"true\" project-jdk-name=\"1.7\" project-jdk-type=\"JavaSDK\">\n    <output url=\"file://$PROJECT_DIR$/build/classes\" />\n  </component>\n  <component name=\"ProjectType\">\n    <option name=\"id\" value=\"Android\" />\n  </component>\n</project>"
  },
  {
    "path": ".idea/modules.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"ProjectModuleManager\">\n    <modules>\n      <module fileurl=\"file://$PROJECT_DIR$/ZuiMeiTAG.iml\" filepath=\"$PROJECT_DIR$/ZuiMeiTAG.iml\" />\n      <module fileurl=\"file://$PROJECT_DIR$/app/app.iml\" filepath=\"$PROJECT_DIR$/app/app.iml\" />\n    </modules>\n  </component>\n</project>"
  },
  {
    "path": ".idea/runConfigurations.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"RunConfigurationProducerService\">\n    <option name=\"ignoredProducers\">\n      <set>\n        <option value=\"org.jetbrains.plugins.gradle.execution.test.runner.AllInPackageGradleConfigurationProducer\" />\n        <option value=\"org.jetbrains.plugins.gradle.execution.test.runner.TestClassGradleConfigurationProducer\" />\n        <option value=\"org.jetbrains.plugins.gradle.execution.test.runner.TestMethodGradleConfigurationProducer\" />\n      </set>\n    </option>\n  </component>\n</project>"
  },
  {
    "path": "README.md",
    "content": "# ZuiMeiTAG\n仿最美应用的底栏，使用recyclerView实现，相关博文http://www.jianshu.com/p/7202416974f6   \n能不能给个star鼓励下(●'◡'●)\n#效果图\n![效果图](https://github.com/huage2580/ZuiMeiTAG/raw/master/hello.gif)\n"
  },
  {
    "path": "app/.gitignore",
    "content": "/build\n"
  },
  {
    "path": "app/build.gradle",
    "content": "apply plugin: 'com.android.application'\n\nandroid {\n    compileSdkVersion 23\n    buildToolsVersion \"23.0.2\"\n\n    defaultConfig {\n        applicationId \"com.toxicant.hua.zuimeitag\"\n        minSdkVersion 16\n        targetSdkVersion 23\n        versionCode 1\n        versionName \"1.0\"\n    }\n    buildTypes {\n        release {\n            minifyEnabled false\n            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'\n        }\n    }\n}\n\ndependencies {\n    compile fileTree(dir: 'libs', include: ['*.jar'])\n    testCompile 'junit:junit:4.12'\n    compile 'com.android.support:appcompat-v7:23.4.0'\n    compile 'com.android.support:recyclerview-v7:23.4.0'\n}\n"
  },
  {
    "path": "app/proguard-rules.pro",
    "content": "# Add project specific ProGuard rules here.\n# By default, the flags in this file are appended to flags specified\n# in E:\\AndroidStudio\\SDK/tools/proguard/proguard-android.txt\n# You can edit the include path and order by changing the proguardFiles\n# directive in build.gradle.\n#\n# For more details, see\n#   http://developer.android.com/guide/developing/tools/proguard.html\n\n# Add any project specific keep options here:\n\n# If your project uses WebView with JS, uncomment the following\n# and specify the fully qualified class name to the JavaScript interface\n# class:\n#-keepclassmembers class fqcn.of.javascript.interface.for.webview {\n#   public *;\n#}\n"
  },
  {
    "path": "app/src/androidTest/java/com/toxicant/hua/zuimeitag/ApplicationTest.java",
    "content": "package com.toxicant.hua.zuimeitag;\n\nimport android.app.Application;\nimport android.test.ApplicationTestCase;\n\n/**\n * <a href=\"http://d.android.com/tools/testing/testing_android.html\">Testing Fundamentals</a>\n */\npublic class ApplicationTest extends ApplicationTestCase<Application> {\n    public ApplicationTest() {\n        super(Application.class);\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.toxicant.hua.zuimeitag\">\n\n    <application\n        android:allowBackup=\"true\"\n        android:icon=\"@mipmap/ic_launcher\"\n        android:label=\"@string/app_name\"\n        android:supportsRtl=\"true\"\n        android:theme=\"@style/AppTheme\">\n        <activity android:name=\".MainActivity\">\n            <intent-filter>\n                <action android:name=\"android.intent.action.MAIN\" />\n\n                <category android:name=\"android.intent.category.LAUNCHER\" />\n            </intent-filter>\n        </activity>\n    </application>\n\n</manifest>"
  },
  {
    "path": "app/src/main/java/com/toxicant/hua/zuimeitag/MainActivity.java",
    "content": "package com.toxicant.hua.zuimeitag;\n\nimport android.animation.ObjectAnimator;\nimport android.graphics.Bitmap;\nimport android.support.v7.app.AppCompatActivity;\nimport android.os.Bundle;\nimport android.support.v7.widget.LinearLayoutManager;\nimport android.support.v7.widget.RecyclerView;\nimport android.util.Log;\nimport android.view.LayoutInflater;\nimport android.view.MotionEvent;\nimport android.view.View;\nimport android.view.ViewGroup;\nimport android.view.animation.Animation;\nimport android.view.animation.TranslateAnimation;\nimport android.widget.Button;\nimport android.widget.ImageView;\nimport android.widget.LinearLayout;\nimport android.widget.TextView;\nimport android.widget.Toast;\n\nimport java.util.ArrayList;\n\npublic class MainActivity extends AppCompatActivity {\n    TAGRecyclerView rv;\n    Button btn1;\n    Button btn2;\n    ArrayList<String> datas;\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_main);\n        btn1= (Button) findViewById(R.id.button);\n        btn2= (Button) findViewById(R.id.button2);\n        rv= (TAGRecyclerView) findViewById(R.id.rv1);\n        rv.setLayoutManager(new MyLayoutManager());\n       datas=new ArrayList<>();\n        for (int i=0;i<20;i++){\n            datas.add(\"item==>\"+i);\n        }\n       // final int temp=height/7;\n        final RvAdapter adapter = new RvAdapter();\n        rv.setAdapter(adapter);\n        btn1.setOnClickListener(new View.OnClickListener() {\n            @Override\n            public void onClick(View v) {\n                rv.selectNextItem();\n\n            }\n        });\n        btn2.setOnClickListener(new View.OnClickListener() {\n            @Override\n            public void onClick(View v) {\n                rv.selectPreviousItem();\n            }\n        });\n        rv.setSwitchListener(new TAGRecyclerView.SwitchListener() {\n            @Override\n            public void onSwitch(int realIndex) {\n                Toast.makeText(MainActivity.this,\"当前选择=>\"+realIndex,Toast.LENGTH_SHORT).show();\n            }\n        });\n    }\n\n    class RvAdapter extends RecyclerView.Adapter<ViewHoler>{\n\n        @Override\n        public ViewHoler onCreateViewHolder(ViewGroup parent, int viewType) {\n            return new ViewHoler(LayoutInflater.from(parent.getContext()).inflate(R.layout.item,null,false));\n        }\n\n        @Override\n        public void onBindViewHolder(final ViewHoler holder, int position) {\n            holder.tv1.setText(datas.get(position));\n        }\n\n        @Override\n        public int getItemCount() {\n            return datas.size();\n        }\n\n    }\n    class ViewHoler extends RecyclerView.ViewHolder{\n        ImageView ivl;\n        TextView tv1;\n        LinearLayout ll;\n        public ViewHoler(View itemView) {\n            super(itemView);\n            ivl= (ImageView) itemView.findViewById(R.id.iv);\n            tv1= (TextView) itemView.findViewById(R.id.tv1);\n            ll= (LinearLayout) itemView.findViewById(R.id.linear_layout);\n            itemView.setClickable(false);\n        }\n    }\n\n\n}\n\n\n\n\n"
  },
  {
    "path": "app/src/main/java/com/toxicant/hua/zuimeitag/MyLayoutManager.java",
    "content": "package com.toxicant.hua.zuimeitag;\n\nimport android.graphics.PointF;\nimport android.graphics.Rect;\nimport android.support.v7.widget.LinearSmoothScroller;\nimport android.support.v7.widget.RecyclerView;\nimport android.util.SparseArray;\nimport android.util.SparseBooleanArray;\nimport android.view.View;\nimport android.view.ViewGroup;\n\n/**\n * Created by hua on 2016.12.10.\n */\npublic class MyLayoutManager extends RecyclerView.LayoutManager {\n    public int mSelectIndex=0;\n    final int mPadding=3;\n    int allWidth=0;\n    int offsetScroll=0;\n    int firstView=0;//第一个可视view序号\n    boolean firstLayout=true;//每次开始布局\n    //保存所有的Item的上下左右的偏移量信息\n    private SparseArray<Rect> allItemFrames = new SparseArray<>();\n    //记录Item是否出现过屏幕且还没有回收。true表示出现过屏幕上，并且还没被回收\n    private SparseBooleanArray hasAttachedItems = new SparseBooleanArray();\n    @Override\n    public RecyclerView.LayoutParams generateDefaultLayoutParams() {\n        return new RecyclerView.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);\n    }\n\n    @Override\n    public void onLayoutChildren(RecyclerView.Recycler recycler, RecyclerView.State state) {\n        detachAndScrapAttachedViews(recycler);\n        int offsetX=mPadding;\n        for(int i=0;i<getItemCount();i++){\n            View view=recycler.getViewForPosition(i);\n           // addView(view);\n            measureChildWithMargins(view,0,0);\n             int width = getDecoratedMeasuredWidth(view);\n            int height = getDecoratedMeasuredHeight(view);\n//            layoutDecorated(view,offsetX+mPadding,mPadding,offsetX+width-mPadding,height);\n\n            Rect frame = allItemFrames.get(i);\n            if (frame == null) {\n                frame = new Rect();\n            }\n            frame.set(offsetX,mPadding,offsetX+width,height);\n            // 将当前的Item的Rect边界数据保存\n            allItemFrames.put(i, frame);\n            // 由于已经调用了detachAndScrapAttachedViews，因此需要将当前的Item设置为未出现过\n            hasAttachedItems.put(i, false);\n            offsetX+=(width+mPadding*2);\n\n        }\n        allWidth=Math.max(getWidth()/7*getItemCount(),getWidth());\n        recyclerAndFillItems(recycler,state);\n    }\n\n    @Override\n    public void measureChildWithMargins(View child, int widthUsed, int heightUsed) {\n        final RecyclerView.LayoutParams lp = (RecyclerView.LayoutParams) child.getLayoutParams();\n        final int widthSpec = getChildMeasureSpec(getWidth(), getWidthMode(),\n                0, getWidth()/7-2*mPadding,\n                canScrollHorizontally());\n        final int heightSpec = getChildMeasureSpec(getHeight(), getHeightMode(),\n                0, lp.height,\n                canScrollVertically());\n            child.measure(widthSpec, heightSpec);\n\n    }\n\n    @Override\n    public boolean canScrollHorizontally() {\n        return true;\n    }\n\n    @Override\n    public void smoothScrollToPosition(RecyclerView recyclerView, RecyclerView.State state,\n                                       final int position) {\n        LinearSmoothScroller linearSmoothScroller =\n                new LinearSmoothScroller(recyclerView.getContext()) {\n                    @Override\n                    public PointF computeScrollVectorForPosition(int targetPosition) {\n                        return MyLayoutManager.this.computeScrollVectorForPosition(position);\n                    }\n                };\n        linearSmoothScroller.setTargetPosition(position);\n        startSmoothScroll(linearSmoothScroller);\n    }\n\n    public PointF computeScrollVectorForPosition(int targetPosition) {\n        if (getChildCount() == 0) {\n            return null;\n        }\n        final int firstChildPos = getPosition(getChildAt(0));\n        final int direction = targetPosition < firstChildPos? -1 : 1;\n\n        return new PointF(direction, 0);\n\n    }\n\n    @Override\n    public int scrollHorizontallyBy(int dx, RecyclerView.Recycler recycler, RecyclerView.State state) {\n        //先detach掉所有的子View\n        detachAndScrapAttachedViews(recycler);\n        //实际要滑动的距离\n        int travel = dx;\n        if (offsetScroll+dx<0){//滑动到最左边\n            travel=-offsetScroll;\n        }else if(offsetScroll+dx>allWidth-getWidth()){//最右边\n            travel=allWidth-getWidth()-offsetScroll;\n        }\n        offsetScroll+=travel;\n        offsetChildrenHorizontal(-travel);\n        recyclerAndFillItems(recycler, state);\n        return travel;\n    }\n\n    void recyclerAndFillItems(RecyclerView.Recycler recycler, RecyclerView.State state){\n        if (state.isPreLayout()) { // 跳过preLayout，preLayout主要用于支持动画\n            return;\n        }\n\n        // 当前scroll offset状态下的显示区域\n        Rect displayFrame = new Rect(offsetScroll,0, getWidth()+offsetScroll, getHeight());\n       // Log.e(\"display\",\"left->\"+displayFrame.left+\"right->\"+displayFrame.right);\n        //回收\n        Rect childFrame = new Rect();\n        for (int i = 0; i < getChildCount(); i++) {\n            View child = getChildAt(i);\n            childFrame.left = getDecoratedLeft(child);\n            childFrame.top = getDecoratedTop(child);\n            childFrame.right = getDecoratedRight(child);\n            childFrame.bottom = getDecoratedBottom(child);\n           // Log.e(\"回收判断\",\"left->\"+childFrame.left+\"right->\"+childFrame.right);\n            //如果Item没有在显示区域，就说明需要回收\n            if (!Rect.intersects(displayFrame, childFrame)) {\n                //回收掉滑出屏幕的View\n                removeAndRecycleView(child, recycler);\n            }\n        }\n        //显示\n        firstLayout=true;\n        for (int i = 0; i < getItemCount(); i++) {\n            if (Rect.intersects(displayFrame, allItemFrames.get(i))) {\n               // Log.e(\"layout\",\"显示==>\"+i);\n                if(firstLayout){\n                    firstView=i;\n                    firstLayout=false;\n                }\n                View scrap = recycler.getViewForPosition(i);\n                measureChildWithMargins(scrap, 0, 0);\n                int height = getDecoratedMeasuredHeight(scrap);\n                if (i!=mSelectIndex){\n                    scrap.setTranslationY(height/7*6);\n                }\n                addView(scrap);\n                Rect frame = allItemFrames.get(i);\n              //  Log.e(\"显示判断\",\"left->\"+frame.left+\"right->\"+frame.right);\n                //将这个item布局出来\n                layoutDecorated(scrap,\n                        frame.left-offsetScroll,\n                        frame.top,\n                        frame.right-offsetScroll,\n                        frame.bottom);\n\n            }\n        }\n\n    }\n}\n\n"
  },
  {
    "path": "app/src/main/java/com/toxicant/hua/zuimeitag/TAGRecyclerView.java",
    "content": "package com.toxicant.hua.zuimeitag;\n\nimport android.animation.Animator;\nimport android.animation.ObjectAnimator;\nimport android.content.Context;\nimport android.support.annotation.Nullable;\nimport android.support.v7.widget.RecyclerView;\nimport android.util.AttributeSet;\nimport android.util.Log;\nimport android.view.MotionEvent;\nimport android.view.View;\n\n/**\n * Created by hua on 2016.12.11.\n */\npublic class TAGRecyclerView extends RecyclerView implements View.OnTouchListener {\n    private int mOffsetIndex;//偏移量，显示的第一个view的序号 [0,n)\n    private int mSelectIndex;//当前选择的真实序号 [0,n)\n    private SwitchListener mSwitchListener;\n\n    interface SwitchListener{\n        void onSwitch(int realIndex);\n    }\n    public TAGRecyclerView(Context context) {\n        super(context);\n        init();\n    }\n\n    public TAGRecyclerView(Context context, @Nullable AttributeSet attrs) {\n        super(context, attrs);\n        init();\n    }\n\n    public TAGRecyclerView(Context context, @Nullable AttributeSet attrs, int defStyle) {\n        super(context, attrs, defStyle);\n        init();\n    }\n\n    void init(){\n        mOffsetIndex=0;\n        mSelectIndex=0;\n        setOnTouchListener(this);\n    }\n\n    @Override\n    public boolean onTouch(View v, MotionEvent event) {\n        int action = event.getAction();\n        float x=event.getX();\n        final int index= (int) (x/(this.getWidth()/7));\n        //Log.i(\"index\",\"index->\"+index);\n        switch (action){\n            case MotionEvent.ACTION_DOWN:\n            case MotionEvent.ACTION_MOVE:\n                    final int th=this.getHeight()/7;\n                    //view突出\n                    for (int i=0;i<7;i++){\n                        int t=Math.abs(index-i);\n                       // Log.i(\"突出\",\"点击->\"+index+\"当前相距->\"+t+\"第一个view:\"+count);\n                        this.getChildAt(i).setTranslationY(t*th);\n                    }\n                break;\n            case MotionEvent.ACTION_UP:\n                //记录位置\n                RecyclerView.LayoutManager lm= this.getLayoutManager();\n                if (lm instanceof MyLayoutManager){\n                    mOffsetIndex = ((MyLayoutManager) lm).firstView;\n                    mSelectIndex=mOffsetIndex+index;\n                    ((MyLayoutManager) lm).mSelectIndex=mSelectIndex;\n                    //Log.i(\"up\",\"抬起相对位置-\"+index+\"偏移量-\"+mOffsetIndex+\"选择的真实序号-\"+mSelectIndex);\n                }\n                if (mSwitchListener!=null){\n                    mSwitchListener.onSwitch(mSelectIndex);\n                }\n                boolean isFirstAnim=true;\n                //下落动画\n                for (int i=0;i<7;i++){\n                    if (i==index){\n                        continue;\n                    }\n                    View temp=this.getChildAt(i);\n                    ObjectAnimator anim=ObjectAnimator//\n                            .ofFloat(temp, \"TranslationY\", temp.getTranslationY(),this.getHeight()/7*6)//\n                            .setDuration(500);\n                            anim.start();\n                    if (isFirstAnim){\n                        anim.addListener(new Animator.AnimatorListener() {\n                            @Override\n                            public void onAnimationStart(Animator animation) {\n\n                            }\n\n                            @Override\n                            public void onAnimationEnd(Animator animation) {\n                                //位移动画\n                                scrollItem(index);\n                            }\n\n                            @Override\n                            public void onAnimationCancel(Animator animation) {\n\n                            }\n\n                            @Override\n                            public void onAnimationRepeat(Animator animation) {\n\n                            }\n                        });\n                        isFirstAnim=false;\n                    }\n\n                }\n\n                break;\n        }\n        return true;\n    }\n\n    /**\n     * 把这个item放到中间,是相对序号\n     * @param index 对应屏幕上的第几个[0,n)\n     */\n    private void scrollItem(int index){\n        int dx=0;\n        final int tw=TAGRecyclerView.this.getWidth()/7;\n        if (index<3){\n            dx=-tw*(3-index);\n        }else if(index>3){\n            dx=tw*(index-3);\n        }\n        TAGRecyclerView.this.smoothScrollBy(dx,0);\n    }\n\n    /**\n     * 切换到下一个item\n     */\n    public boolean selectNextItem(){\n        if (mSelectIndex>=TAGRecyclerView.this.getAdapter().getItemCount()-1){//已经是最后一个\n            return false;\n        }\n        //当前选择的item下落\n        final RecyclerView.LayoutManager lm= this.getLayoutManager();\n        if (lm instanceof MyLayoutManager) {\n            mOffsetIndex = ((MyLayoutManager) lm).firstView;\n            View view=this.getChildAt(mSelectIndex-mOffsetIndex);\n            final ObjectAnimator anim=ObjectAnimator.ofFloat(view, \"TranslationY\", view.getTranslationY(),this.getHeight()/7*6)\n                    .setDuration(200);\n                   anim.start();\n            anim.addListener(new Animator.AnimatorListener() {\n                @Override\n                public void onAnimationStart(Animator animation) {\n\n                }\n\n                @Override\n                public void onAnimationEnd(Animator animation) {\n                    //下一个item升起\n                    mSelectIndex+=1;\n                    ((MyLayoutManager) lm).mSelectIndex=mSelectIndex;\n                    View view=TAGRecyclerView.this.getChildAt(mSelectIndex-mOffsetIndex);\n                    ObjectAnimator animR=ObjectAnimator.ofFloat(view, \"TranslationY\", view.getTranslationY(),0)\n                            .setDuration(200);\n                    animR.start();\n                    animR.addListener(new Animator.AnimatorListener() {\n                        @Override\n                        public void onAnimationStart(Animator animation) {\n\n                        }\n\n                        @Override\n                        public void onAnimationEnd(Animator animation) {\n                            scrollItem(mSelectIndex-mOffsetIndex);\n                        }\n\n                        @Override\n                        public void onAnimationCancel(Animator animation) {\n\n                        }\n\n                        @Override\n                        public void onAnimationRepeat(Animator animation) {\n\n                        }\n                    });\n                }\n\n                @Override\n                public void onAnimationCancel(Animator animation) {\n\n                }\n\n                @Override\n                public void onAnimationRepeat(Animator animation) {\n\n                }\n            });\n        }\n        return true;\n    }\n\n    /**\n     * 切换到上一个item\n     */\n    public boolean selectPreviousItem(){\n        if (mSelectIndex<1){//已经是第一个\n            return false;\n        }\n        //当前选择的item下落\n        final RecyclerView.LayoutManager lm= this.getLayoutManager();\n        if (lm instanceof MyLayoutManager) {\n            mOffsetIndex = ((MyLayoutManager) lm).firstView;\n            View view=this.getChildAt(mSelectIndex-mOffsetIndex);\n            final ObjectAnimator anim=ObjectAnimator.ofFloat(view, \"TranslationY\", view.getTranslationY(),this.getHeight()/7*6)\n                    .setDuration(200);\n            anim.start();\n            anim.addListener(new Animator.AnimatorListener() {\n                @Override\n                public void onAnimationStart(Animator animation) {\n\n                }\n\n                @Override\n                public void onAnimationEnd(Animator animation) {\n                    //上一个item升起\n                    mSelectIndex-=1;\n                    ((MyLayoutManager) lm).mSelectIndex=mSelectIndex;\n                    View view=TAGRecyclerView.this.getChildAt(mSelectIndex-mOffsetIndex);\n                    ObjectAnimator animR=ObjectAnimator.ofFloat(view, \"TranslationY\", view.getTranslationY(),0)\n                            .setDuration(200);\n                    animR.start();\n                    animR.addListener(new Animator.AnimatorListener() {\n                        @Override\n                        public void onAnimationStart(Animator animation) {\n\n                        }\n\n                        @Override\n                        public void onAnimationEnd(Animator animation) {\n                            scrollItem(mSelectIndex-mOffsetIndex);\n                        }\n\n                        @Override\n                        public void onAnimationCancel(Animator animation) {\n\n                        }\n\n                        @Override\n                        public void onAnimationRepeat(Animator animation) {\n\n                        }\n                    });\n                }\n\n                @Override\n                public void onAnimationCancel(Animator animation) {\n\n                }\n\n                @Override\n                public void onAnimationRepeat(Animator animation) {\n\n                }\n            });\n        }\n        return true;\n\n    }\n\n    /**\n     * 当前选择的item真实序号\n     * @return\n     */\n    public int getSelectIndex(){\n        return mSelectIndex;\n    }\n    public void setSwitchListener(SwitchListener listener){\n        this.mSwitchListener=listener;\n    }\n}\n"
  },
  {
    "path": "app/src/main/res/drawable/bg_white.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:shape=\"rectangle\">\n    <corners\n        android:topLeftRadius=\"10dp\"\n        android:topRightRadius=\"10dp\">\n\n    </corners>\n   <solid android:color=\"#ffffff\">\n\n   </solid>\n\n</shape>"
  },
  {
    "path": "app/src/main/res/layout/activity_main.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:background=\"@color/colorAccent\"\n    tools:context=\"com.toxicant.hua.zuimeitag.MainActivity\">\n    <com.toxicant.hua.zuimeitag.TAGRecyclerView\n        android:id=\"@+id/rv1\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"80dp\"\n        android:layout_alignParentBottom=\"true\">\n    </com.toxicant.hua.zuimeitag.TAGRecyclerView>\n    <Button\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:text=\"下一个\"\n        android:id=\"@+id/button\"\n        android:layout_centerVertical=\"true\"\n        android:layout_centerHorizontal=\"true\" />\n    <Button\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:text=\"上一个\"\n        android:id=\"@+id/button2\"\n        android:layout_alignParentTop=\"true\"\n        android:layout_centerHorizontal=\"true\" />\n</RelativeLayout>\n"
  },
  {
    "path": "app/src/main/res/layout/item.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<FrameLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"80dp\">\n    <LinearLayout\n        android:id=\"@+id/linear_layout\"\n        android:orientation=\"vertical\"\n        android:padding=\"5dp\"\n        android:clickable=\"false\"\n        android:background=\"@drawable/bg_white\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"match_parent\">\n        <ImageView\n            android:id=\"@+id/iv\"\n            android:src=\"@drawable/logo1\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"35dp\" />\n        <TextView\n            android:id=\"@+id/tv1\"\n            tools:text=\"666\"\n            android:layout_gravity=\"center_horizontal\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\" />\n    </LinearLayout>\n</FrameLayout>\n"
  },
  {
    "path": "app/src/main/res/values/colors.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n    <color name=\"colorPrimary\">#3F51B5</color>\n    <color name=\"colorPrimaryDark\">#303F9F</color>\n    <color name=\"colorAccent\">#FF4081</color>\n</resources>\n"
  },
  {
    "path": "app/src/main/res/values/dimens.xml",
    "content": "<resources>\n    <!-- Default screen margins, per the Android Design guidelines. -->\n    <dimen name=\"activity_horizontal_margin\">16dp</dimen>\n    <dimen name=\"activity_vertical_margin\">16dp</dimen>\n</resources>\n"
  },
  {
    "path": "app/src/main/res/values/strings.xml",
    "content": "<resources>\n    <string name=\"app_name\">ZuiMeiTAG</string>\n</resources>\n"
  },
  {
    "path": "app/src/main/res/values/styles.xml",
    "content": "<resources>\n\n    <!-- Base application theme. -->\n    <style name=\"AppTheme\" parent=\"Theme.AppCompat.Light.DarkActionBar\">\n        <!-- Customize your theme here. -->\n        <item name=\"colorPrimary\">@color/colorPrimary</item>\n        <item name=\"colorPrimaryDark\">@color/colorPrimaryDark</item>\n        <item name=\"colorAccent\">@color/colorAccent</item>\n    </style>\n\n</resources>\n"
  },
  {
    "path": "app/src/main/res/values-w820dp/dimens.xml",
    "content": "<resources>\n    <!-- Example customization of dimensions originally defined in res/values/dimens.xml\n         (such as screen margins) for screens with more than 820dp of available width. This\n         would include 7\" and 10\" devices in landscape (~960dp and ~1280dp respectively). -->\n    <dimen name=\"activity_horizontal_margin\">64dp</dimen>\n</resources>\n"
  },
  {
    "path": "app/src/test/java/com/toxicant/hua/zuimeitag/ExampleUnitTest.java",
    "content": "package com.toxicant.hua.zuimeitag;\n\nimport org.junit.Test;\n\nimport static org.junit.Assert.*;\n\n/**\n * To work on unit tests, switch the Test Artifact in the Build Variants view.\n */\npublic class ExampleUnitTest {\n    @Test\n    public void addition_isCorrect() throws Exception {\n        assertEquals(4, 2 + 2);\n    }\n}"
  },
  {
    "path": "build.gradle",
    "content": "// Top-level build file where you can add configuration options common to all sub-projects/modules.\n\nbuildscript {\n    repositories {\n        jcenter()\n    }\n    dependencies {\n        classpath 'com.android.tools.build:gradle:2.0.0'\n\n        // NOTE: Do not place your application dependencies here; they belong\n        // in the individual module build.gradle files\n    }\n}\n\nallprojects {\n    repositories {\n        jcenter()\n    }\n}\n\ntask clean(type: Delete) {\n    delete rootProject.buildDir\n}\n"
  },
  {
    "path": "gradle/wrapper/gradle-wrapper.properties",
    "content": "#Mon Dec 28 10:00:20 PST 2015\ndistributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\nzipStoreBase=GRADLE_USER_HOME\nzipStorePath=wrapper/dists\ndistributionUrl=https\\://services.gradle.org/distributions/gradle-2.10-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.\n# Default value: -Xmx10248m -XX:MaxPermSize=256m\n# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8\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"
  },
  {
    "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'\n"
  }
]