##Recyclerview 实现仿电脑文件夹自由拖拽
大家好,今天是我第一次写博客,希望能将学到的技术点记录起来,方便以后借鉴。不足之处,请指出,大家一起学习。
想实现和电脑拖拽文件夹一样的效果其实很简单,因为Recyclerview 本身就提供了类似的动画效果,我们只需将原来的动画效果改吧改吧就可以了。
##效果
1.创建Activity(Mistake_Homework_Activity ) 下面是XML布局
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/activity_mistake__homework_"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
tools:context="com.daxiong.fun.function.homework.MistakeHomework.Mistake_Homework_Activity">
<include
android:id="@+id/layout_head"
layout="@layout/main_header_view"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<android.support.v7.widget.RecyclerView
android:background="@color/white"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="5dp"
android:layout_below="@+id/layout_head"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/recyclerView"/>
<TextView
android:text="编辑"
android:textSize="16sp"
android:id="@+id/tv_edit"
android:layout_marginRight="5dp"
android:layout_alignParentRight="true"
android:padding="10dp"
android:gravity="center"
android:layout_width="wrap_content"
android:la