ViewDragHelper学习之九宫格拼图
import android.content.Context; import android.support.v4.widget.ViewDragHelper; import android.util.AttributeSet; import android.util.Log; import android.view.MotionEvent; import android.view.View; import android.widget.RelativeLayout; /** * Created by alanchen on 15/7/29. */ public class SwipeBackRelativelayout extends RelativeLayout { public static final String TAG = SwipeBackRelativelayout.class.getSimpleName(); private ViewDragHelper mDragHelper; /*通过九个数字来表示空白格的位置 * 1 2 3 * 4 5 6 * 7 8 9*/ private int blank; private int maxLeft; private int maxTop; public SwipeBackRelativelayout(Context