Recyclerview实现仿电脑文件夹自由拖拽

##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
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值