3 | # Encoding is UTF-8
4 |
--------------------------------------------------------------------------------
/bin/res/crunch/drawable-hdpi/app_plus__ic_radar_panel.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chongbo2013/SwipeRecyclerView/7cdfc9c39d8823bb1628b621c6dca98f79d68161/bin/res/crunch/drawable-hdpi/app_plus__ic_radar_panel.png
--------------------------------------------------------------------------------
/bin/res/crunch/drawable-hdpi/booster.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chongbo2013/SwipeRecyclerView/7cdfc9c39d8823bb1628b621c6dca98f79d68161/bin/res/crunch/drawable-hdpi/booster.png
--------------------------------------------------------------------------------
/bin/res/crunch/drawable-hdpi/com_android_browser.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chongbo2013/SwipeRecyclerView/7cdfc9c39d8823bb1628b621c6dca98f79d68161/bin/res/crunch/drawable-hdpi/com_android_browser.png
--------------------------------------------------------------------------------
/bin/res/crunch/drawable-hdpi/com_android_calculator2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chongbo2013/SwipeRecyclerView/7cdfc9c39d8823bb1628b621c6dca98f79d68161/bin/res/crunch/drawable-hdpi/com_android_calculator2.png
--------------------------------------------------------------------------------
/bin/res/crunch/drawable-hdpi/com_android_calendar.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chongbo2013/SwipeRecyclerView/7cdfc9c39d8823bb1628b621c6dca98f79d68161/bin/res/crunch/drawable-hdpi/com_android_calendar.png
--------------------------------------------------------------------------------
/bin/res/crunch/drawable-hdpi/com_android_camera.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chongbo2013/SwipeRecyclerView/7cdfc9c39d8823bb1628b621c6dca98f79d68161/bin/res/crunch/drawable-hdpi/com_android_camera.png
--------------------------------------------------------------------------------
/bin/res/crunch/drawable-hdpi/com_android_contacts.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chongbo2013/SwipeRecyclerView/7cdfc9c39d8823bb1628b621c6dca98f79d68161/bin/res/crunch/drawable-hdpi/com_android_contacts.png
--------------------------------------------------------------------------------
/bin/res/crunch/drawable-hdpi/com_android_deskclock.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chongbo2013/SwipeRecyclerView/7cdfc9c39d8823bb1628b621c6dca98f79d68161/bin/res/crunch/drawable-hdpi/com_android_deskclock.png
--------------------------------------------------------------------------------
/bin/res/crunch/drawable-hdpi/com_android_email.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chongbo2013/SwipeRecyclerView/7cdfc9c39d8823bb1628b621c6dca98f79d68161/bin/res/crunch/drawable-hdpi/com_android_email.png
--------------------------------------------------------------------------------
/bin/res/crunch/drawable-hdpi/com_android_mms.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chongbo2013/SwipeRecyclerView/7cdfc9c39d8823bb1628b621c6dca98f79d68161/bin/res/crunch/drawable-hdpi/com_android_mms.png
--------------------------------------------------------------------------------
/bin/res/crunch/drawable-hdpi/com_android_music.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chongbo2013/SwipeRecyclerView/7cdfc9c39d8823bb1628b621c6dca98f79d68161/bin/res/crunch/drawable-hdpi/com_android_music.png
--------------------------------------------------------------------------------
/bin/res/crunch/drawable-hdpi/com_android_phone.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chongbo2013/SwipeRecyclerView/7cdfc9c39d8823bb1628b621c6dca98f79d68161/bin/res/crunch/drawable-hdpi/com_android_phone.png
--------------------------------------------------------------------------------
/bin/res/crunch/drawable-hdpi/com_android_quicksearchbox.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chongbo2013/SwipeRecyclerView/7cdfc9c39d8823bb1628b621c6dca98f79d68161/bin/res/crunch/drawable-hdpi/com_android_quicksearchbox.png
--------------------------------------------------------------------------------
/bin/res/crunch/drawable-hdpi/com_android_settings.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chongbo2013/SwipeRecyclerView/7cdfc9c39d8823bb1628b621c6dca98f79d68161/bin/res/crunch/drawable-hdpi/com_android_settings.png
--------------------------------------------------------------------------------
/bin/res/crunch/drawable-hdpi/com_android_soundrecorder.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chongbo2013/SwipeRecyclerView/7cdfc9c39d8823bb1628b621c6dca98f79d68161/bin/res/crunch/drawable-hdpi/com_android_soundrecorder.png
--------------------------------------------------------------------------------
/bin/res/crunch/drawable-hdpi/com_qihoo360_mobilesafe.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chongbo2013/SwipeRecyclerView/7cdfc9c39d8823bb1628b621c6dca98f79d68161/bin/res/crunch/drawable-hdpi/com_qihoo360_mobilesafe.png
--------------------------------------------------------------------------------
/bin/res/crunch/drawable-hdpi/com_sds_android_ttpod.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chongbo2013/SwipeRecyclerView/7cdfc9c39d8823bb1628b621c6dca98f79d68161/bin/res/crunch/drawable-hdpi/com_sds_android_ttpod.png
--------------------------------------------------------------------------------
/bin/res/crunch/drawable-hdpi/com_sina_weibo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chongbo2013/SwipeRecyclerView/7cdfc9c39d8823bb1628b621c6dca98f79d68161/bin/res/crunch/drawable-hdpi/com_sina_weibo.png
--------------------------------------------------------------------------------
/bin/res/crunch/drawable-hdpi/com_tencent_mm.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chongbo2013/SwipeRecyclerView/7cdfc9c39d8823bb1628b621c6dca98f79d68161/bin/res/crunch/drawable-hdpi/com_tencent_mm.png
--------------------------------------------------------------------------------
/bin/res/crunch/drawable-hdpi/com_tencent_mtt.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chongbo2013/SwipeRecyclerView/7cdfc9c39d8823bb1628b621c6dca98f79d68161/bin/res/crunch/drawable-hdpi/com_tencent_mtt.png
--------------------------------------------------------------------------------
/bin/res/crunch/drawable-hdpi/com_tencent_qq.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chongbo2013/SwipeRecyclerView/7cdfc9c39d8823bb1628b621c6dca98f79d68161/bin/res/crunch/drawable-hdpi/com_tencent_qq.png
--------------------------------------------------------------------------------
/bin/res/crunch/drawable-hdpi/com_uc_browser.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chongbo2013/SwipeRecyclerView/7cdfc9c39d8823bb1628b621c6dca98f79d68161/bin/res/crunch/drawable-hdpi/com_uc_browser.png
--------------------------------------------------------------------------------
/bin/res/crunch/drawable-hdpi/com_youdao_dict.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chongbo2013/SwipeRecyclerView/7cdfc9c39d8823bb1628b621c6dca98f79d68161/bin/res/crunch/drawable-hdpi/com_youdao_dict.png
--------------------------------------------------------------------------------
/bin/res/crunch/drawable-hdpi/folder_ic_promo_header.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chongbo2013/SwipeRecyclerView/7cdfc9c39d8823bb1628b621c6dca98f79d68161/bin/res/crunch/drawable-hdpi/folder_ic_promo_header.png
--------------------------------------------------------------------------------
/bin/res/crunch/drawable-hdpi/folder_radar_center_meter.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chongbo2013/SwipeRecyclerView/7cdfc9c39d8823bb1628b621c6dca98f79d68161/bin/res/crunch/drawable-hdpi/folder_radar_center_meter.png
--------------------------------------------------------------------------------
/bin/res/crunch/drawable-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chongbo2013/SwipeRecyclerView/7cdfc9c39d8823bb1628b621c6dca98f79d68161/bin/res/crunch/drawable-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/bin/res/crunch/drawable-hdpi/indicator.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chongbo2013/SwipeRecyclerView/7cdfc9c39d8823bb1628b621c6dca98f79d68161/bin/res/crunch/drawable-hdpi/indicator.png
--------------------------------------------------------------------------------
/bin/res/crunch/drawable-hdpi/indicator_current.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chongbo2013/SwipeRecyclerView/7cdfc9c39d8823bb1628b621c6dca98f79d68161/bin/res/crunch/drawable-hdpi/indicator_current.png
--------------------------------------------------------------------------------
/bin/res/crunch/drawable-hdpi/radar_icon_app_default.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chongbo2013/SwipeRecyclerView/7cdfc9c39d8823bb1628b621c6dca98f79d68161/bin/res/crunch/drawable-hdpi/radar_icon_app_default.png
--------------------------------------------------------------------------------
/bin/res/crunch/drawable-hdpi/radar_scan_indicator.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chongbo2013/SwipeRecyclerView/7cdfc9c39d8823bb1628b621c6dca98f79d68161/bin/res/crunch/drawable-hdpi/radar_scan_indicator.png
--------------------------------------------------------------------------------
/bin/res/crunch/drawable-ldpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chongbo2013/SwipeRecyclerView/7cdfc9c39d8823bb1628b621c6dca98f79d68161/bin/res/crunch/drawable-ldpi/ic_launcher.png
--------------------------------------------------------------------------------
/bin/res/crunch/drawable-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chongbo2013/SwipeRecyclerView/7cdfc9c39d8823bb1628b621c6dca98f79d68161/bin/res/crunch/drawable-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/bin/res/crunch/drawable-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chongbo2013/SwipeRecyclerView/7cdfc9c39d8823bb1628b621c6dca98f79d68161/bin/res/crunch/drawable-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/bin/resources.ap_:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chongbo2013/SwipeRecyclerView/7cdfc9c39d8823bb1628b621c6dca98f79d68161/bin/resources.ap_
--------------------------------------------------------------------------------
/bin/仿apus桌面雷扫描效果.apk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chongbo2013/SwipeRecyclerView/7cdfc9c39d8823bb1628b621c6dca98f79d68161/bin/仿apus桌面雷扫描效果.apk
--------------------------------------------------------------------------------
/gen/com/ferris/holeswipeview/BuildConfig.java:
--------------------------------------------------------------------------------
1 | /** Automatically generated file. DO NOT MODIFY */
2 | package com.ferris.holeswipeview;
3 |
4 | public final class BuildConfig {
5 | public final static boolean DEBUG = true;
6 | }
--------------------------------------------------------------------------------
/gen/com/ferris/holeswipeview/R.java:
--------------------------------------------------------------------------------
1 | /* AUTO-GENERATED FILE. DO NOT MODIFY.
2 | *
3 | * This class was automatically generated by the
4 | * aapt tool from the resource data it found. It
5 | * should not be modified by hand.
6 | */
7 |
8 | package com.ferris.holeswipeview;
9 |
10 | public final class R {
11 | public static final class attr {
12 | /** Must be one or more (separated by '|') of the following constant values.
13 |
14 |
15 |
16 |
17 | Constant Value Description
18 | top
0x30 Push object to the top of its container, not changing its size.
19 | bottom
0x50 Push object to the bottom of its container, not changing its size.
20 | left
0x03 Push object to the left of its container, not changing its size.
21 | right
0x05 Push object to the right of its container, not changing its size.
22 | center_vertical
0x10 Place object in the vertical center of its container, not changing its size.
23 | center_horizontal
0x01 Place object in the horizontal center of its container, not changing its size.
24 |
25 | */
26 | public static final int layout_gravity=0x7f010001;
27 | /** Must be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character.
28 |
This may also be a reference to a resource (in the form
29 | "@[package :]type :name
") or
30 | theme attribute (in the form
31 | "?[package :][type :]name
")
32 | containing a value of this type.
33 | */
34 | public static final int name=0x7f010000;
35 | /**
Must be one of the following constant values.
36 |
37 |
38 |
39 |
40 | Constant Value Description
41 | horizontal
0
42 | vertical
1
43 |
44 | */
45 | public static final int orientation=0x7f010002;
46 | }
47 | public static final class dimen {
48 | public static final int app_icon_height=0x7f040001;
49 | public static final int app_icon_width=0x7f040000;
50 | public static final int boost_icon_size=0x7f04000a;
51 | public static final int boost_img_width=0x7f040009;
52 | public static final int boost_small_text_size=0x7f040006;
53 | public static final int boost_stroke=0x7f040008;
54 | public static final int boost_symbol_size=0x7f040007;
55 | public static final int boost_text_size=0x7f040005;
56 | public static final int icon_width=0x7f040002;
57 | public static final int leida_hight=0x7f040004;
58 | public static final int pading_height=0x7f040003;
59 | }
60 | public static final class drawable {
61 | public static final int app_plus__ic_radar_panel=0x7f020000;
62 | public static final int background=0x7f020001;
63 | public static final int booster=0x7f020002;
64 | public static final int cell_bg=0x7f020003;
65 | public static final int com_android_browser=0x7f020004;
66 | public static final int com_android_calculator2=0x7f020005;
67 | public static final int com_android_calendar=0x7f020006;
68 | public static final int com_android_camera=0x7f020007;
69 | public static final int com_android_contacts=0x7f020008;
70 | public static final int com_android_deskclock=0x7f020009;
71 | public static final int com_android_email=0x7f02000a;
72 | public static final int com_android_mms=0x7f02000b;
73 | public static final int com_android_music=0x7f02000c;
74 | public static final int com_android_phone=0x7f02000d;
75 | public static final int com_android_quicksearchbox=0x7f02000e;
76 | public static final int com_android_settings=0x7f02000f;
77 | public static final int com_android_soundrecorder=0x7f020010;
78 | public static final int com_qihoo360_mobilesafe=0x7f020011;
79 | public static final int com_sds_android_ttpod=0x7f020012;
80 | public static final int com_sina_weibo=0x7f020013;
81 | public static final int com_tencent_mm=0x7f020014;
82 | public static final int com_tencent_mtt=0x7f020015;
83 | public static final int com_tencent_qq=0x7f020016;
84 | public static final int com_uc_browser=0x7f020017;
85 | public static final int com_youdao_dict=0x7f020018;
86 | public static final int folder_ic_promo_header=0x7f020019;
87 | public static final int folder_radar_center_meter=0x7f02001a;
88 | public static final int ic_launcher=0x7f02001b;
89 | public static final int indicator=0x7f02001c;
90 | public static final int indicator_current=0x7f02001d;
91 | public static final int radar_icon_app_default=0x7f02001e;
92 | public static final int radar_scan_indicator=0x7f02001f;
93 | public static final int workspace_bg=0x7f020020;
94 | }
95 | public static final class id {
96 | public static final int anim_view=0x7f07000e;
97 | public static final int app_name=0x7f07000b;
98 | public static final int bottom=0x7f070000;
99 | public static final int button1=0x7f070009;
100 | public static final int center_horizontal=0x7f070001;
101 | public static final int center_vertical=0x7f070002;
102 | public static final int horizontal=0x7f070006;
103 | public static final int icon=0x7f07000a;
104 | public static final int imageView1=0x7f070008;
105 | public static final int intro=0x7f07000d;
106 | public static final int left=0x7f070003;
107 | public static final int right=0x7f070004;
108 | public static final int scan_indicator=0x7f070010;
109 | public static final int scan_meter=0x7f07000f;
110 | public static final int sl=0x7f07000c;
111 | public static final int top=0x7f070005;
112 | public static final int vertical=0x7f070007;
113 | public static final int workspace=0x7f070011;
114 | }
115 | public static final class layout {
116 | public static final int activity_footer=0x7f030000;
117 | public static final int app_item=0x7f030001;
118 | public static final int customscrollview=0x7f030002;
119 | public static final int folder_promotion_loading_footer=0x7f030003;
120 | public static final int main=0x7f030004;
121 | }
122 | public static final class string {
123 | public static final int app_name=0x7f050000;
124 | }
125 | public static final class style {
126 | public static final int TransparentStyle=0x7f060000;
127 | }
128 | public static final class styleable {
129 | /** Attributes that can be used with a CircleImageView.
130 | Includes the following attributes:
131 |
132 |
133 |
134 | Attribute Description
135 | {@link #CircleImageView_name com.ferris.holeswipeview:name}
136 |
137 | @see #CircleImageView_name
138 | */
139 | public static final int[] CircleImageView = {
140 | 0x7f010000
141 | };
142 | /**
143 | This symbol is the offset where the {@link com.ferris.holeswipeview.R.attr#name}
144 | attribute's value can be found in the {@link #CircleImageView} array.
145 |
146 |
147 |
Must be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character.
148 |
This may also be a reference to a resource (in the form
149 | "@[package :]type :name
") or
150 | theme attribute (in the form
151 | "?[package :][type :]name
")
152 | containing a value of this type.
153 | @attr name com.ferris.holeswipeview:name
154 | */
155 | public static final int CircleImageView_name = 0;
156 | /** Attributes that can be used with a SlideGroup.
157 |
Includes the following attributes:
158 |
159 |
160 |
161 | Attribute Description
162 | {@link #SlideGroup_layout_gravity com.ferris.holeswipeview:layout_gravity}
163 |
164 | @see #SlideGroup_layout_gravity
165 | */
166 | public static final int[] SlideGroup = {
167 | 0x7f010001
168 | };
169 | /**
170 | This symbol is the offset where the {@link com.ferris.holeswipeview.R.attr#layout_gravity}
171 | attribute's value can be found in the {@link #SlideGroup} array.
172 |
173 |
174 |
Must be one or more (separated by '|') of the following constant values.
175 |
176 |
177 |
178 |
179 | Constant Value Description
180 | top
0x30 Push object to the top of its container, not changing its size.
181 | bottom
0x50 Push object to the bottom of its container, not changing its size.
182 | left
0x03 Push object to the left of its container, not changing its size.
183 | right
0x05 Push object to the right of its container, not changing its size.
184 | center_vertical
0x10 Place object in the vertical center of its container, not changing its size.
185 | center_horizontal
0x01 Place object in the horizontal center of its container, not changing its size.
186 |
187 | @attr name com.ferris.holeswipeview:layout_gravity
188 | */
189 | public static final int SlideGroup_layout_gravity = 0;
190 | };
191 | }
192 |
--------------------------------------------------------------------------------
/libs/android-support-v4.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chongbo2013/SwipeRecyclerView/7cdfc9c39d8823bb1628b621c6dca98f79d68161/libs/android-support-v4.jar
--------------------------------------------------------------------------------
/libs/android-support-v7-recyclerview.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chongbo2013/SwipeRecyclerView/7cdfc9c39d8823bb1628b621c6dca98f79d68161/libs/android-support-v7-recyclerview.jar
--------------------------------------------------------------------------------
/proguard-project.txt:
--------------------------------------------------------------------------------
1 | # To enable ProGuard in your project, edit project.properties
2 | # to define the proguard.config property as described in that file.
3 | #
4 | # Add project specific ProGuard rules here.
5 | # By default, the flags in this file are appended to flags specified
6 | # in ${sdk.dir}/tools/proguard/proguard-android.txt
7 | # You can edit the include path and order by changing the ProGuard
8 | # include property in project.properties.
9 | #
10 | # For more details, see
11 | # http://developer.android.com/guide/developing/tools/proguard.html
12 |
13 | # Add any project specific keep options here:
14 |
15 | # If your project uses WebView with JS, uncomment the following
16 | # and specify the fully qualified class name to the JavaScript interface
17 | # class:
18 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
19 | # public *;
20 | #}
21 |
--------------------------------------------------------------------------------
/project.properties:
--------------------------------------------------------------------------------
1 | # This file is automatically generated by Android Tools.
2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3 | #
4 | # This file must be checked in Version Control Systems.
5 | #
6 | # To customize properties used by the Ant build system edit
7 | # "ant.properties", and override values to adapt the script to your
8 | # project structure.
9 | #
10 | # To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
11 | #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
12 |
13 | # Project target.
14 | target=android-19
15 |
--------------------------------------------------------------------------------
/res/drawable-hdpi/app_plus__ic_radar_panel.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chongbo2013/SwipeRecyclerView/7cdfc9c39d8823bb1628b621c6dca98f79d68161/res/drawable-hdpi/app_plus__ic_radar_panel.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/booster.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chongbo2013/SwipeRecyclerView/7cdfc9c39d8823bb1628b621c6dca98f79d68161/res/drawable-hdpi/booster.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/cell_bg.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chongbo2013/SwipeRecyclerView/7cdfc9c39d8823bb1628b621c6dca98f79d68161/res/drawable-hdpi/cell_bg.9.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/com_android_browser.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chongbo2013/SwipeRecyclerView/7cdfc9c39d8823bb1628b621c6dca98f79d68161/res/drawable-hdpi/com_android_browser.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/com_android_calculator2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chongbo2013/SwipeRecyclerView/7cdfc9c39d8823bb1628b621c6dca98f79d68161/res/drawable-hdpi/com_android_calculator2.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/com_android_calendar.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chongbo2013/SwipeRecyclerView/7cdfc9c39d8823bb1628b621c6dca98f79d68161/res/drawable-hdpi/com_android_calendar.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/com_android_camera.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chongbo2013/SwipeRecyclerView/7cdfc9c39d8823bb1628b621c6dca98f79d68161/res/drawable-hdpi/com_android_camera.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/com_android_contacts.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chongbo2013/SwipeRecyclerView/7cdfc9c39d8823bb1628b621c6dca98f79d68161/res/drawable-hdpi/com_android_contacts.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/com_android_deskclock.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chongbo2013/SwipeRecyclerView/7cdfc9c39d8823bb1628b621c6dca98f79d68161/res/drawable-hdpi/com_android_deskclock.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/com_android_email.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chongbo2013/SwipeRecyclerView/7cdfc9c39d8823bb1628b621c6dca98f79d68161/res/drawable-hdpi/com_android_email.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/com_android_mms.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chongbo2013/SwipeRecyclerView/7cdfc9c39d8823bb1628b621c6dca98f79d68161/res/drawable-hdpi/com_android_mms.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/com_android_music.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chongbo2013/SwipeRecyclerView/7cdfc9c39d8823bb1628b621c6dca98f79d68161/res/drawable-hdpi/com_android_music.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/com_android_phone.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chongbo2013/SwipeRecyclerView/7cdfc9c39d8823bb1628b621c6dca98f79d68161/res/drawable-hdpi/com_android_phone.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/com_android_quicksearchbox.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chongbo2013/SwipeRecyclerView/7cdfc9c39d8823bb1628b621c6dca98f79d68161/res/drawable-hdpi/com_android_quicksearchbox.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/com_android_settings.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chongbo2013/SwipeRecyclerView/7cdfc9c39d8823bb1628b621c6dca98f79d68161/res/drawable-hdpi/com_android_settings.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/com_android_soundrecorder.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chongbo2013/SwipeRecyclerView/7cdfc9c39d8823bb1628b621c6dca98f79d68161/res/drawable-hdpi/com_android_soundrecorder.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/com_qihoo360_mobilesafe.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chongbo2013/SwipeRecyclerView/7cdfc9c39d8823bb1628b621c6dca98f79d68161/res/drawable-hdpi/com_qihoo360_mobilesafe.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/com_sds_android_ttpod.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chongbo2013/SwipeRecyclerView/7cdfc9c39d8823bb1628b621c6dca98f79d68161/res/drawable-hdpi/com_sds_android_ttpod.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/com_sina_weibo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chongbo2013/SwipeRecyclerView/7cdfc9c39d8823bb1628b621c6dca98f79d68161/res/drawable-hdpi/com_sina_weibo.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/com_tencent_mm.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chongbo2013/SwipeRecyclerView/7cdfc9c39d8823bb1628b621c6dca98f79d68161/res/drawable-hdpi/com_tencent_mm.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/com_tencent_mtt.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chongbo2013/SwipeRecyclerView/7cdfc9c39d8823bb1628b621c6dca98f79d68161/res/drawable-hdpi/com_tencent_mtt.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/com_tencent_qq.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chongbo2013/SwipeRecyclerView/7cdfc9c39d8823bb1628b621c6dca98f79d68161/res/drawable-hdpi/com_tencent_qq.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/com_uc_browser.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chongbo2013/SwipeRecyclerView/7cdfc9c39d8823bb1628b621c6dca98f79d68161/res/drawable-hdpi/com_uc_browser.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/com_youdao_dict.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chongbo2013/SwipeRecyclerView/7cdfc9c39d8823bb1628b621c6dca98f79d68161/res/drawable-hdpi/com_youdao_dict.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/folder_ic_promo_header.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chongbo2013/SwipeRecyclerView/7cdfc9c39d8823bb1628b621c6dca98f79d68161/res/drawable-hdpi/folder_ic_promo_header.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/folder_radar_center_meter.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chongbo2013/SwipeRecyclerView/7cdfc9c39d8823bb1628b621c6dca98f79d68161/res/drawable-hdpi/folder_radar_center_meter.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chongbo2013/SwipeRecyclerView/7cdfc9c39d8823bb1628b621c6dca98f79d68161/res/drawable-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/indicator.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chongbo2013/SwipeRecyclerView/7cdfc9c39d8823bb1628b621c6dca98f79d68161/res/drawable-hdpi/indicator.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/indicator_current.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chongbo2013/SwipeRecyclerView/7cdfc9c39d8823bb1628b621c6dca98f79d68161/res/drawable-hdpi/indicator_current.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/radar_icon_app_default.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chongbo2013/SwipeRecyclerView/7cdfc9c39d8823bb1628b621c6dca98f79d68161/res/drawable-hdpi/radar_icon_app_default.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/radar_scan_indicator.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chongbo2013/SwipeRecyclerView/7cdfc9c39d8823bb1628b621c6dca98f79d68161/res/drawable-hdpi/radar_scan_indicator.png
--------------------------------------------------------------------------------
/res/drawable-ldpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chongbo2013/SwipeRecyclerView/7cdfc9c39d8823bb1628b621c6dca98f79d68161/res/drawable-ldpi/ic_launcher.png
--------------------------------------------------------------------------------
/res/drawable-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chongbo2013/SwipeRecyclerView/7cdfc9c39d8823bb1628b621c6dca98f79d68161/res/drawable-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chongbo2013/SwipeRecyclerView/7cdfc9c39d8823bb1628b621c6dca98f79d68161/res/drawable-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/res/drawable/background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
11 |
12 |
17 |
18 |
--------------------------------------------------------------------------------
/res/drawable/workspace_bg.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chongbo2013/SwipeRecyclerView/7cdfc9c39d8823bb1628b621c6dca98f79d68161/res/drawable/workspace_bg.jpg
--------------------------------------------------------------------------------
/res/layout/activity_footer.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
13 |
14 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/res/layout/app_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
14 |
15 |
25 |
26 |
--------------------------------------------------------------------------------
/res/layout/customscrollview.xml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/res/layout/folder_promotion_loading_footer.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
13 |
19 |
28 |
36 |
37 |
--------------------------------------------------------------------------------
/res/layout/main.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/res/values/attrs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 56dip
5 | 70dip
6 | 56dip
7 |
8 |
9 | 80dp
10 | 100dp
11 |
12 | 80dp
13 | 100dp
14 | 100dp
15 | 100dp
16 | 100dp
17 | 100dp
18 |
--------------------------------------------------------------------------------
/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Workspace
5 |
6 |
--------------------------------------------------------------------------------
/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
9 |
--------------------------------------------------------------------------------
/src/com/ferris/holeswipeview/ApplicationAdapter.java:
--------------------------------------------------------------------------------
1 | package com.ferris.holeswipeview;
2 |
3 | import java.util.List;
4 |
5 | import android.content.Context;
6 | import android.support.v7.widget.RecyclerView;
7 | import android.view.LayoutInflater;
8 | import android.view.View;
9 | import android.view.ViewGroup;
10 | import android.widget.TextView;
11 |
12 | public class ApplicationAdapter extends
13 | RecyclerView.Adapter {
14 |
15 | private Context mContext;
16 |
17 | private List mPackagesInfo;
18 |
19 | public ApplicationAdapter(Context context, List listInfo) {
20 | mContext = context;
21 | mPackagesInfo = listInfo;
22 |
23 | }
24 |
25 | @Override
26 | public long getItemId(int position) {
27 | return position;
28 | }
29 |
30 | public static class MyViewHolder extends RecyclerView.ViewHolder {
31 | public MyViewHolder(View view) {
32 | super(view);
33 | }
34 |
35 | TextView app_name;
36 | }
37 |
38 | @Override
39 | public int getItemCount() {
40 | // TODO Auto-generated method stub
41 | return mPackagesInfo == null ? 0 : mPackagesInfo.size();
42 | }
43 |
44 | @Override
45 | public MyViewHolder onCreateViewHolder(ViewGroup parent, int positon) {
46 | // TODO Auto-generated method stub
47 | View convertView = LayoutInflater.from(mContext).inflate(
48 | R.layout.app_item, parent, false);
49 | MyViewHolder viewHolder = new MyViewHolder(convertView);
50 | viewHolder.app_name = (TextView) convertView
51 | .findViewById(R.id.app_name);
52 | return viewHolder;
53 | }
54 |
55 | public void onBindViewHolder(MyViewHolder viewHolder, int position) {
56 | // TODO Auto-generated method stub
57 | viewHolder.app_name.setText("app" + position);
58 | }
59 |
60 | }
61 |
--------------------------------------------------------------------------------
/src/com/ferris/holeswipeview/ApplicationBeam.java:
--------------------------------------------------------------------------------
1 | package com.ferris.holeswipeview;
2 |
3 | public class ApplicationBeam {
4 | private String name;
5 | public String getName() {
6 | return name;
7 | }
8 | public void setName(String name) {
9 | this.name = name;
10 | }
11 | public ApplicationBeam() {
12 | // TODO Auto-generated constructor stub
13 | }
14 |
15 | }
16 |
--------------------------------------------------------------------------------
/src/com/ferris/holeswipeview/CrashHandler.java:
--------------------------------------------------------------------------------
1 | package com.ferris.holeswipeview ;
2 |
3 | import java.io.File;
4 | import java.io.FileNotFoundException;
5 | import java.io.FileOutputStream;
6 | import java.io.IOException;
7 | import java.io.PrintWriter;
8 | import java.io.StringWriter;
9 | import java.io.Writer;
10 | import java.lang.Thread.UncaughtExceptionHandler;
11 | import java.lang.ref.WeakReference;
12 | import java.lang.reflect.Field;
13 | import java.text.SimpleDateFormat;
14 | import java.util.Date;
15 | import java.util.HashMap;
16 | import java.util.Map;
17 |
18 | import android.content.Context;
19 | import android.content.pm.PackageInfo;
20 | import android.content.pm.PackageManager;
21 | import android.content.pm.PackageManager.NameNotFoundException;
22 | import android.os.Build;
23 | import android.os.Environment;
24 | import android.os.Looper;
25 | import android.util.Log;
26 | import android.widget.Toast;
27 | public class CrashHandler implements UncaughtExceptionHandler {
28 | private static final String TAG = "NorrisInfo" ;
29 | private Thread.UncaughtExceptionHandler mDefaultHandler ;
30 | private static CrashHandler mInstance = new CrashHandler() ;
31 | private WeakReference mContext ;
32 |
33 | private Map mLogInfo = new HashMap() ;
34 |
35 | private SimpleDateFormat mSimpleDateFormat = new SimpleDateFormat("yyyyMMdd_HH-mm-ss") ;
36 | private CrashHandler() {
37 | }
38 | public static CrashHandler getInstance() {
39 | return mInstance ;
40 | }
41 | public void init(Context paramContext) {
42 | mContext = new WeakReference(paramContext) ;
43 | // ��ȡϵͳĬ�ϵ�UncaughtException������
44 | mDefaultHandler = Thread.getDefaultUncaughtExceptionHandler() ;
45 | // ���ø�CrashHandlerΪ�����Ĭ�ϴ�����
46 | Thread.setDefaultUncaughtExceptionHandler(this) ;
47 | }
48 | public void uncaughtException(Thread paramThread , Throwable paramThrowable) {
49 | if( ! handleException(paramThrowable) && mDefaultHandler != null) {
50 | // ����Զ����û�д�������ϵͳĬ�ϵ��쳣������������
51 | mDefaultHandler.uncaughtException(paramThread , paramThrowable) ;
52 | }
53 | else {
54 | try {
55 | // ������ˣ��ó����������1�����˳�����֤�ļ����沢�ϴ���������
56 | paramThread.sleep(1000) ;
57 | }
58 | catch(InterruptedException e) {
59 | e.printStackTrace() ;
60 | }
61 | // �˳�����
62 | android.os.Process.killProcess(android.os.Process.myPid()) ;
63 | System.exit(1) ;
64 | }
65 | }
66 |
67 | public boolean handleException(Throwable paramThrowable) {
68 | if(paramThrowable == null)
69 | return false ;
70 | new Thread() {
71 | public void run() {
72 | Looper.prepare() ;
73 | if(mContext!=null&&mContext.get()!=null){
74 | Toast.makeText(mContext.get() , "I'm sorry, the program appears unusual, be about to exit" , 0).show() ;
75 | }
76 |
77 | Looper.loop() ;
78 | }
79 | }.start() ;
80 | // ��ȡ�豸������Ϣ
81 | if(mContext!=null&&mContext.get()!=null){
82 | getDeviceInfo(mContext.get()) ;
83 | }
84 |
85 | // ������־�ļ�
86 | saveCrashLogToFile(paramThrowable) ;
87 | return true ;
88 | }
89 | public void getDeviceInfo(Context paramContext) {
90 | try {
91 | // ������
92 | PackageManager mPackageManager = paramContext.getPackageManager() ;
93 | // �õ���Ӧ�õ���Ϣ������Activity
94 | PackageInfo mPackageInfo = mPackageManager.getPackageInfo(
95 | paramContext.getPackageName() , PackageManager.GET_ACTIVITIES) ;
96 | if(mPackageInfo != null) {
97 | String versionName = mPackageInfo.versionName == null ? "null"
98 | : mPackageInfo.versionName ;
99 | String versionCode = mPackageInfo.versionCode + "" ;
100 | mLogInfo.put("versionName" , versionName) ;
101 | mLogInfo.put("versionCode" , versionCode) ;
102 | }
103 | }
104 | catch(NameNotFoundException e) {
105 | e.printStackTrace() ;
106 | }
107 | // �������
108 | Field[] mFields = Build.class.getDeclaredFields() ;
109 | // ���Build���ֶ�key-value �˴�����Ϣ��Ҫ��Ϊ���ڷ��������ֻ���ְ汾�ֻ���ԭ��
110 | for(Field field : mFields) {
111 | try {
112 | field.setAccessible(true) ;
113 | mLogInfo.put(field.getName() , field.get("").toString()) ;
114 | Log.d(TAG , field.getName() + ":" + field.get("")) ;
115 | }
116 | catch(IllegalArgumentException e) {
117 | e.printStackTrace() ;
118 | }
119 | catch(IllegalAccessException e) {
120 | e.printStackTrace() ;
121 | }
122 | }
123 | }
124 | private String saveCrashLogToFile(Throwable paramThrowable) {
125 | StringBuffer mStringBuffer = new StringBuffer() ;
126 | for(Map.Entry entry : mLogInfo.entrySet()) {
127 | String key = entry.getKey() ;
128 | String value = entry.getValue() ;
129 | mStringBuffer.append(key + "=" + value + "\r\n") ;
130 | }
131 | Writer mWriter = new StringWriter() ;
132 | PrintWriter mPrintWriter = new PrintWriter(mWriter) ;
133 | paramThrowable.printStackTrace(mPrintWriter) ;
134 | paramThrowable.printStackTrace();
135 | Throwable mThrowable = paramThrowable.getCause() ;
136 | // ���ջ���а����е��쳣��Ϣд��writer��
137 | while(mThrowable != null) {
138 | mThrowable.printStackTrace(mPrintWriter) ;
139 | // ���� ÿ�����쳣ջ֮�任��
140 | mPrintWriter.append("\r\n") ;
141 | mThrowable = mThrowable.getCause() ;
142 | }
143 | //�ǵùر�
144 | mPrintWriter.close() ;
145 | String mResult = mWriter.toString() ;
146 | mStringBuffer.append(mResult) ;
147 | // ��������������
148 | String mTime = mSimpleDateFormat.format(new Date()) ;
149 | String mFileName = "CrashLog-" + mTime + ".txt" ;
150 | if(Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
151 | try {
152 | File mDirectory = new File(Environment.getExternalStorageDirectory()
153 | + "/swipeView") ;
154 | Log.v(TAG , mDirectory.toString()) ;
155 | if( ! mDirectory.exists())
156 | mDirectory.mkdir() ;
157 | FileOutputStream mFileOutputStream = new FileOutputStream(mDirectory + "/"
158 | + mFileName) ;
159 | mFileOutputStream.write(mStringBuffer.toString().getBytes()) ;
160 | mFileOutputStream.close() ;
161 | return mFileName ;
162 | }
163 | catch(FileNotFoundException e) {
164 | e.printStackTrace() ;
165 | }
166 | catch(IOException e) {
167 | e.printStackTrace() ;
168 | }
169 | }
170 | return null ;
171 | }
172 | }
173 |
--------------------------------------------------------------------------------
/src/com/ferris/holeswipeview/CusomSwipeView.java:
--------------------------------------------------------------------------------
1 | package com.ferris.holeswipeview;
2 |
3 | import android.content.Context;
4 | import android.support.v7.widget.RecyclerView;
5 | import android.util.AttributeSet;
6 | import android.view.MotionEvent;
7 | import android.view.VelocityTracker;
8 | import android.view.View;
9 | import android.view.ViewConfiguration;
10 | import android.view.WindowManager;
11 | import android.widget.AdapterView;
12 | import android.widget.Scroller;
13 |
14 | /**
15 | * http://blog.csdn.net/xufeifandj www.github.com/xufeifandj
16 | *
17 | * @ferris 459821731@qq.com
18 | *
19 | */
20 | public class CusomSwipeView extends RecyclerView {
21 | private Orientation orientation = Orientation.HORIZONTAL;
22 | /**
23 | * 当前滑动的ListView position
24 | */
25 | private int slidePosition;
26 | /**
27 | * 手指按下X的坐标
28 | */
29 | private int downY;
30 | /**
31 | * 手指按下Y的坐标
32 | */
33 | private int downX;
34 | /**
35 | * 屏幕宽度
36 | */
37 | private int screenWidth;
38 | /**
39 | * ListView的item
40 | */
41 | private View itemView;
42 | /**
43 | * 滑动类
44 | */
45 | private Scroller scroller;
46 | private static final int SNAP_VELOCITY = 600;
47 | /**
48 | * 速度追踪对象
49 | */
50 | private VelocityTracker velocityTracker;
51 | /**
52 | * 是否响应滑动,默认为不响应
53 | */
54 | private boolean isSlide = false;
55 | /**
56 | * 认为是用户滑动的最小距离
57 | */
58 | private int mTouchSlop;
59 | /**
60 | * 移除item后的回调接口
61 | */
62 | private RemoveListener mRemoveListener;
63 | /**
64 | * 用来指示item滑出屏幕的方向,向左或者向右,用一个枚举值来标记
65 | */
66 | private RemoveDirection removeDirection;
67 |
68 | // 滑动删除方向的枚举值
69 | public enum RemoveDirection {
70 | RIGHT, LEFT;
71 | }
72 |
73 | public CusomSwipeView(Context context) {
74 | super(context);
75 | // TODO Auto-generated constructor stub
76 | init(context);
77 | }
78 |
79 | public CusomSwipeView(Context context, AttributeSet attrs) {
80 | super(context, attrs);
81 | // TODO Auto-generated constructor stub
82 | init(context);
83 | }
84 |
85 | public CusomSwipeView(Context context, AttributeSet attrs, int defStyle) {
86 | super(context, attrs, defStyle);
87 | // TODO Auto-generated constructor stub
88 | init(context);
89 | }
90 |
91 | public void init(Context context) {
92 |
93 | if (orientation == Orientation.VERTICAL) {
94 | screenWidth = ((WindowManager) context
95 | .getSystemService(Context.WINDOW_SERVICE))
96 | .getDefaultDisplay().getWidth();
97 | } else {
98 | screenWidth = ((WindowManager) context
99 | .getSystemService(Context.WINDOW_SERVICE))
100 | .getDefaultDisplay().getHeight();
101 | }
102 | scroller = new Scroller(context);
103 | mTouchSlop = ViewConfiguration.get(getContext()).getScaledTouchSlop();
104 | }
105 |
106 | /**
107 | * 设置滑动删除的回调接口
108 | *
109 | * @param removeListener
110 | */
111 | public void setRemoveListener(RemoveListener removeListener) {
112 | this.mRemoveListener = removeListener;
113 | }
114 |
115 | /**
116 | * 分发事件,主要做的是判断点击的是那个item, 以及通过postDelayed来设置响应左右滑动事件
117 | */
118 | @Override
119 | public boolean dispatchTouchEvent(MotionEvent event) {
120 | switch (event.getAction()) {
121 | case MotionEvent.ACTION_DOWN: {
122 | addVelocityTracker(event);
123 |
124 | // 假如scroller滚动还没有结束,我们直接返回
125 | if (!scroller.isFinished()) {
126 | return super.dispatchTouchEvent(event);
127 | }
128 | downX = (int) event.getX();
129 | downY = (int) event.getY();
130 |
131 | itemView = findChildViewUnder(downX, downY);
132 | if (itemView == null) {
133 | return super.dispatchTouchEvent(event);
134 | }
135 |
136 | slidePosition = getChildPosition(itemView);
137 | // 无效的position, 不做任何处理
138 | if (slidePosition == AdapterView.INVALID_POSITION) {
139 | return super.dispatchTouchEvent(event);
140 | }
141 |
142 | break;
143 | }
144 | case MotionEvent.ACTION_MOVE: {
145 | if (orientation == Orientation.VERTICAL) {// 如果
146 | // 左右滑动的距离大于最大的滑动距离,并且没有上下滑动,就代表
147 | // 右滑删除或者左滑删除
148 | if (Math.abs(getScrollVelocity()) > SNAP_VELOCITY
149 | || (Math.abs(event.getX() - downX) > mTouchSlop && Math
150 | .abs(event.getY() - downY) < mTouchSlop)) {
151 | isSlide = true;
152 |
153 | }
154 | } else {
155 | // 如果 上下滑动的距离大于最大的滑动距离,并且没有左右滑动,就代表上滑删除或者下滑删除
156 | if (Math.abs(getScrollVelocity()) > SNAP_VELOCITY
157 | || (Math.abs(event.getY() - downY) > mTouchSlop && Math
158 | .abs(event.getX() - downX) < mTouchSlop)) {
159 | isSlide = true;
160 |
161 | }
162 |
163 | }
164 | break;
165 | }
166 | case MotionEvent.ACTION_UP:
167 | recycleVelocityTracker();
168 | break;
169 | }
170 |
171 | return super.dispatchTouchEvent(event);
172 | }
173 |
174 | /**
175 | * 往右滑动,getScrollX()返回的是左边缘的距离,就是以View左边缘为原点到开始滑动的距离,所以向右边滑动为负值
176 | */
177 | private void scrollRight() {
178 | if (orientation == Orientation.VERTICAL) {// 往右滑动
179 | removeDirection = RemoveDirection.RIGHT;
180 | final int delta = (screenWidth + itemView.getScrollX());
181 | // 调用startScroll方法来设置一些滚动的参数,我们在computeScroll()方法中调用scrollTo来滚动item
182 | scroller.startScroll(itemView.getScrollX(), 0, -delta, 0,
183 | Math.abs(delta));
184 | postInvalidate(); // 刷新itemView
185 | } else {// 往上滑动
186 | removeDirection = RemoveDirection.RIGHT;
187 | final int delta = (screenWidth + itemView.getScrollY());
188 | // 调用startScroll方法来设置一些滚动的参数,我们在computeScroll()方法中调用scrollTo来滚动item
189 | scroller.startScroll(0, itemView.getScrollY(),0, -delta,
190 | Math.abs(delta));
191 | postInvalidate(); // 刷新itemView
192 | }
193 | }
194 |
195 | /**
196 | * 向左滑动,根据上面我们知道向左滑动为正值
197 | */
198 | private void scrollLeft() {
199 | if (orientation == Orientation.VERTICAL) {// 往左滑动
200 | removeDirection = RemoveDirection.LEFT;
201 | final int delta = (screenWidth - itemView.getScrollX());
202 | // 调用startScroll方法来设置一些滚动的参数,我们在computeScroll()方法中调用scrollTo来滚动item
203 | scroller.startScroll(itemView.getScrollX(), 0, delta, 0,
204 | Math.abs(delta));
205 | postInvalidate(); // 刷新itemView
206 | } else {
207 | removeDirection = RemoveDirection.LEFT;
208 | final int delta = (screenWidth - itemView.getScrollY());
209 | // 调用startScroll方法来设置一些滚动的参数,我们在computeScroll()方法中调用scrollTo来滚动item
210 | scroller.startScroll(0, itemView.getScrollY(), 0, delta,
211 | Math.abs(delta));
212 | postInvalidate(); // 刷新itemView
213 | }
214 | }
215 |
216 | /**
217 | * 根据手指滚动itemView的距离来判断是滚动到开始位置还是向左或者向右滚动
218 | */
219 | private void scrollByDistanceX() {
220 | // 如果向左滚动的距离大于屏幕的二分之一,就让其删除
221 |
222 | if (orientation == Orientation.VERTICAL) {
223 | if (itemView.getScrollX() >= screenWidth / 2) {
224 | scrollLeft();
225 | } else if (itemView.getScrollX() <= -screenWidth / 2) {
226 | scrollRight();
227 | } else {
228 | // 滚回到原始位置,为了偷下懒这里是直接调用scrollTo滚动
229 | itemView.scrollTo(0, 0);
230 | }
231 | } else {
232 | if (itemView.getScrollY() >= screenWidth / 2) {
233 | scrollLeft();
234 | } else if (itemView.getScrollY() <= -screenWidth / 2) {
235 | scrollRight();
236 | } else {
237 | // 滚回到原始位置,为了偷下懒这里是直接调用scrollTo滚动
238 | itemView.scrollTo(0, 0);
239 | }
240 | }
241 |
242 | }
243 |
244 | /**
245 | * 处理我们拖动ListView item的逻辑
246 | */
247 | @Override
248 | public boolean onTouchEvent(MotionEvent ev) {
249 | if (isSlide && slidePosition != AdapterView.INVALID_POSITION
250 | && itemView != null) {
251 | requestDisallowInterceptTouchEvent(true);
252 | addVelocityTracker(ev);
253 | final int action = ev.getAction();
254 | int x = (int) ev.getX();
255 | int y = (int) ev.getY();
256 | switch (action) {
257 | case MotionEvent.ACTION_DOWN:
258 | break;
259 | case MotionEvent.ACTION_MOVE:
260 |
261 | MotionEvent cancelEvent = MotionEvent.obtain(ev);
262 | cancelEvent
263 | .setAction(MotionEvent.ACTION_CANCEL
264 | | (ev.getActionIndex() << MotionEvent.ACTION_POINTER_INDEX_SHIFT));
265 | onTouchEvent(cancelEvent);
266 |
267 | if (orientation == Orientation.VERTICAL) {
268 | int deltaX = downX - x;
269 | downX = x;
270 | // 手指拖动itemView滚动, deltaX大于0向左滚动,小于0向右滚
271 | itemView.scrollBy(deltaX, 0);
272 | } else {
273 | int deltaY = downY - y;
274 | downY = y;
275 | itemView.scrollBy(0, deltaY);
276 | }
277 |
278 | return true; // 拖动的时候ListView不滚动
279 | case MotionEvent.ACTION_UP:
280 | int velocityX = getScrollVelocity();
281 | if (velocityX > SNAP_VELOCITY) {
282 | scrollRight();
283 | } else if (velocityX < -SNAP_VELOCITY) {
284 | scrollLeft();
285 | } else {
286 | scrollByDistanceX();
287 | }
288 |
289 | recycleVelocityTracker();
290 | // 手指离开的时候就不响应左右滚动
291 | isSlide = false;
292 | break;
293 | }
294 | }
295 |
296 | // 否则直接交给ListView来处理onTouchEvent事件
297 | return super.onTouchEvent(ev);
298 | }
299 |
300 | @Override
301 | public void computeScroll() {
302 | // 调用startScroll的时候scroller.computeScrollOffset()返回true,
303 | if (scroller.computeScrollOffset()) {
304 | // 让ListView item根据当前的滚动偏移量进行滚动
305 | itemView.scrollTo(scroller.getCurrX(), scroller.getCurrY());
306 |
307 | postInvalidate();
308 |
309 | // 滚动动画结束的时候调用回调接口
310 | if (scroller.isFinished()) {
311 | if (mRemoveListener == null) {
312 | throw new NullPointerException(
313 | "RemoveListener is null, we should called setRemoveListener()");
314 | }
315 |
316 | itemView.scrollTo(0, 0);
317 | mRemoveListener.removeItem(removeDirection, slidePosition);
318 | }
319 | }
320 | }
321 |
322 | /**
323 | * 添加用户的速度跟踪器
324 | *
325 | * @param event
326 | */
327 | private void addVelocityTracker(MotionEvent event) {
328 | if (velocityTracker == null) {
329 | velocityTracker = VelocityTracker.obtain();
330 | }
331 |
332 | velocityTracker.addMovement(event);
333 | }
334 |
335 | /**
336 | * 移除用户速度跟踪器
337 | */
338 | private void recycleVelocityTracker() {
339 | if (velocityTracker != null) {
340 | velocityTracker.recycle();
341 | velocityTracker = null;
342 | }
343 | }
344 |
345 | /**
346 | * 获取X方向的滑动速度,大于0向右滑动,反之向左
347 | *
348 | * @return
349 | */
350 | private int getScrollVelocity() {
351 | if (orientation == Orientation.VERTICAL) {
352 | velocityTracker.computeCurrentVelocity(1000);
353 | int velocity = (int) velocityTracker.getXVelocity();
354 | return velocity;
355 | }else{
356 | velocityTracker.computeCurrentVelocity(1000);
357 | int velocity = (int) velocityTracker.getYVelocity();
358 | return velocity;
359 | }
360 |
361 | }
362 |
363 | /**
364 | *
365 | * 当ListView item滑出屏幕,回调这个接口 我们需要在回调方法removeItem()中移除该Item,然后刷新ListView
366 | *
367 | *
368 | */
369 | public interface RemoveListener {
370 | public void removeItem(RemoveDirection direction, int position);
371 | }
372 |
373 | public static enum Orientation {
374 | HORIZONTAL(0), VERTICAL(1);
375 |
376 | private int value;
377 |
378 | private Orientation(int i) {
379 | value = i;
380 | }
381 |
382 | public int value() {
383 | return value;
384 | }
385 |
386 | public static Orientation valueOf(int i) {
387 | switch (i) {
388 | case 0:
389 | return HORIZONTAL;
390 | case 1:
391 | return VERTICAL;
392 | default:
393 | throw new RuntimeException("[0->HORIZONTAL, 1->VERTICAL]");
394 | }
395 | }
396 | }
397 | }
398 |
--------------------------------------------------------------------------------
/src/com/ferris/holeswipeview/CustomScrollViewActivity.java:
--------------------------------------------------------------------------------
1 | package com.ferris.holeswipeview;
2 |
3 | import java.util.ArrayList;
4 | import java.util.List;
5 |
6 | import android.app.Activity;
7 | import android.os.Bundle;
8 | import android.support.v7.widget.LinearLayoutManager;
9 | import android.widget.Toast;
10 |
11 | import com.ferris.holeswipeview.CusomSwipeView.RemoveDirection;
12 | import com.ferris.holeswipeview.CusomSwipeView.RemoveListener;
13 |
14 | public class CustomScrollViewActivity extends Activity {
15 | private CusomSwipeView sl;
16 | private List applicationBeams=new ArrayList();
17 |
18 | private ApplicationAdapter adapter;
19 | @Override
20 | protected void onCreate(Bundle savedInstanceState) {
21 | // TODO Auto-generated method stub
22 | super.onCreate(savedInstanceState);
23 | setContentView(R.layout.customscrollview);
24 | CrashHandler crashHandler = CrashHandler.getInstance();
25 | crashHandler.init(this);
26 | sl=(CusomSwipeView)findViewById(R.id.sl);
27 |
28 | for(int i=0;i<=10;i++){
29 | ApplicationBeam applicationBeam=new ApplicationBeam();
30 | applicationBeam.setName("标题"+i);
31 | applicationBeams.add(applicationBeam);
32 | }
33 | adapter=new ApplicationAdapter(getApplicationContext(), applicationBeams);
34 | //设置布局管理器
35 | LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this);
36 | linearLayoutManager.setOrientation(LinearLayoutManager.HORIZONTAL);
37 | sl.setLayoutManager(linearLayoutManager);
38 | sl.setAdapter(adapter);
39 | sl.setRemoveListener(new RemoveListener() {
40 |
41 | @Override
42 | public void removeItem(RemoveDirection direction, int position) {
43 | // TODO Auto-generated method stub
44 | Toast.makeText(CustomScrollViewActivity.this, "移除"+position, Toast.LENGTH_SHORT).show();
45 | }
46 | });
47 | }
48 | }
49 |
--------------------------------------------------------------------------------