├── CardSlidePanel.apk
├── CardSlidePanel
├── .gitignore
├── .idea
│ ├── compiler.xml
│ ├── copyright
│ │ └── profiles_settings.xml
│ ├── gradle.xml
│ ├── misc.xml
│ ├── modules.xml
│ └── runConfigurations.xml
├── CardSlidePanel.iml
├── app
│ ├── .gitignore
│ ├── app.iml
│ ├── build.gradle
│ ├── proguard-rules.pro
│ └── src
│ │ ├── androidTest
│ │ └── java
│ │ │ └── com
│ │ │ └── stone
│ │ │ └── card
│ │ │ └── ApplicationTest.java
│ │ ├── main
│ │ ├── AndroidManifest.xml
│ │ ├── assets
│ │ │ ├── wall01.jpg
│ │ │ ├── wall02.jpg
│ │ │ ├── wall03.jpg
│ │ │ ├── wall04.jpg
│ │ │ ├── wall05.jpg
│ │ │ ├── wall06.jpg
│ │ │ ├── wall07.jpg
│ │ │ ├── wall08.jpg
│ │ │ ├── wall09.jpg
│ │ │ ├── wall10.jpg
│ │ │ ├── wall11.jpg
│ │ │ └── wall12.jpg
│ │ ├── java
│ │ │ └── com
│ │ │ │ └── stone
│ │ │ │ └── card
│ │ │ │ ├── CardDataItem.java
│ │ │ │ └── MainActivity.java
│ │ └── res
│ │ │ ├── drawable-xhdpi
│ │ │ ├── bottom.9.png
│ │ │ ├── home_normal.png
│ │ │ ├── home_pressed.png
│ │ │ ├── ic_launcher.png
│ │ │ ├── ignore_normal.png
│ │ │ ├── ignore_pressed.png
│ │ │ ├── like_normal.png
│ │ │ ├── like_pressed.png
│ │ │ └── top.9.png
│ │ │ ├── drawable-xxhdpi
│ │ │ ├── card_left1.png
│ │ │ ├── card_left2.png
│ │ │ ├── card_photot.png
│ │ │ ├── download.png
│ │ │ └── ic_launcher.png
│ │ │ ├── drawable
│ │ │ ├── home_button.xml
│ │ │ ├── ignore_button.xml
│ │ │ └── like_button.xml
│ │ │ ├── layout
│ │ │ ├── activity_main.xml
│ │ │ └── card_item.xml
│ │ │ ├── menu
│ │ │ └── menu_main.xml
│ │ │ ├── mipmap-hdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-mdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xxxhdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── values-v21
│ │ │ └── styles.xml
│ │ │ ├── values-w820dp
│ │ │ └── dimens.xml
│ │ │ └── values
│ │ │ ├── colors.xml
│ │ │ ├── dimens.xml
│ │ │ ├── ids.xml
│ │ │ ├── strings.xml
│ │ │ └── styles.xml
│ │ └── test
│ │ └── java
│ │ └── com
│ │ └── stone
│ │ └── card
│ │ └── ExampleUnitTest.java
├── build.gradle
├── gradle.properties
├── gradle
│ └── wrapper
│ │ ├── gradle-wrapper.jar
│ │ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── library
│ ├── .gitignore
│ ├── build.gradle
│ ├── library.iml
│ ├── proguard-rules.pro
│ └── src
│ │ ├── androidTest
│ │ └── java
│ │ │ └── com
│ │ │ └── stone
│ │ │ └── card
│ │ │ └── library
│ │ │ └── ExampleInstrumentedTest.java
│ │ ├── main
│ │ ├── AndroidManifest.xml
│ │ ├── java
│ │ │ └── com
│ │ │ │ └── stone
│ │ │ │ └── card
│ │ │ │ └── library
│ │ │ │ ├── CardAdapter.java
│ │ │ │ ├── CardItemView.java
│ │ │ │ └── CardSlidePanel.java
│ │ └── res
│ │ │ └── values
│ │ │ ├── attrs.xml
│ │ │ └── strings.xml
│ │ └── test
│ │ └── java
│ │ └── com
│ │ └── stone
│ │ └── card
│ │ └── library
│ │ └── ExampleUnitTest.java
└── settings.gradle
├── README.md
└── capture4.jpg
/CardSlidePanel.apk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xmuSistone/CardSlidePanel/70dab2540745c39bfef805c4621b52ebfb85fc97/CardSlidePanel.apk
--------------------------------------------------------------------------------
/CardSlidePanel/.gitignore:
--------------------------------------------------------------------------------
1 | .gradle
2 | /local.properties
3 | /.idea/workspace.xml
4 | /.idea/libraries
5 | .DS_Store
6 | /build
7 | /captures
8 |
--------------------------------------------------------------------------------
/CardSlidePanel/.idea/compiler.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/CardSlidePanel/.idea/copyright/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/CardSlidePanel/.idea/gradle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
18 |
19 |
--------------------------------------------------------------------------------
/CardSlidePanel/.idea/misc.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 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/CardSlidePanel/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/CardSlidePanel/.idea/runConfigurations.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/CardSlidePanel/CardSlidePanel.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/CardSlidePanel/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/CardSlidePanel/app/app.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 | generateDebugSources
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
--------------------------------------------------------------------------------
/CardSlidePanel/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 25
5 | buildToolsVersion '25.0.2'
6 |
7 | defaultConfig {
8 | applicationId "com.stone.card"
9 | minSdkVersion 14
10 | targetSdkVersion 25
11 | versionCode 1
12 | versionName "1.0"
13 | }
14 | buildTypes {
15 | release {
16 | minifyEnabled false
17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
18 | }
19 | }
20 | }
21 |
22 | dependencies {
23 | compile fileTree(include: ['*.jar'], dir: 'libs')
24 | testCompile 'junit:junit:4.12'
25 | compile 'com.android.support:support-v4:25.3.1'
26 | compile 'com.github.bumptech.glide:glide:3.8.0'
27 | compile project(':library')
28 | }
29 |
--------------------------------------------------------------------------------
/CardSlidePanel/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in D:\adt-bundle-windows-x86_64-20140702\sdk/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/CardSlidePanel/app/src/androidTest/java/com/stone/card/ApplicationTest.java:
--------------------------------------------------------------------------------
1 | package com.stone.card;
2 |
3 | import android.app.Application;
4 | import android.test.ApplicationTestCase;
5 |
6 | /**
7 | * Testing Fundamentals
8 | */
9 | public class ApplicationTest extends ApplicationTestCase {
10 | public ApplicationTest() {
11 | super(Application.class);
12 | }
13 | }
--------------------------------------------------------------------------------
/CardSlidePanel/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
12 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/CardSlidePanel/app/src/main/assets/wall01.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xmuSistone/CardSlidePanel/70dab2540745c39bfef805c4621b52ebfb85fc97/CardSlidePanel/app/src/main/assets/wall01.jpg
--------------------------------------------------------------------------------
/CardSlidePanel/app/src/main/assets/wall02.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xmuSistone/CardSlidePanel/70dab2540745c39bfef805c4621b52ebfb85fc97/CardSlidePanel/app/src/main/assets/wall02.jpg
--------------------------------------------------------------------------------
/CardSlidePanel/app/src/main/assets/wall03.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xmuSistone/CardSlidePanel/70dab2540745c39bfef805c4621b52ebfb85fc97/CardSlidePanel/app/src/main/assets/wall03.jpg
--------------------------------------------------------------------------------
/CardSlidePanel/app/src/main/assets/wall04.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xmuSistone/CardSlidePanel/70dab2540745c39bfef805c4621b52ebfb85fc97/CardSlidePanel/app/src/main/assets/wall04.jpg
--------------------------------------------------------------------------------
/CardSlidePanel/app/src/main/assets/wall05.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xmuSistone/CardSlidePanel/70dab2540745c39bfef805c4621b52ebfb85fc97/CardSlidePanel/app/src/main/assets/wall05.jpg
--------------------------------------------------------------------------------
/CardSlidePanel/app/src/main/assets/wall06.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xmuSistone/CardSlidePanel/70dab2540745c39bfef805c4621b52ebfb85fc97/CardSlidePanel/app/src/main/assets/wall06.jpg
--------------------------------------------------------------------------------
/CardSlidePanel/app/src/main/assets/wall07.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xmuSistone/CardSlidePanel/70dab2540745c39bfef805c4621b52ebfb85fc97/CardSlidePanel/app/src/main/assets/wall07.jpg
--------------------------------------------------------------------------------
/CardSlidePanel/app/src/main/assets/wall08.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xmuSistone/CardSlidePanel/70dab2540745c39bfef805c4621b52ebfb85fc97/CardSlidePanel/app/src/main/assets/wall08.jpg
--------------------------------------------------------------------------------
/CardSlidePanel/app/src/main/assets/wall09.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xmuSistone/CardSlidePanel/70dab2540745c39bfef805c4621b52ebfb85fc97/CardSlidePanel/app/src/main/assets/wall09.jpg
--------------------------------------------------------------------------------
/CardSlidePanel/app/src/main/assets/wall10.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xmuSistone/CardSlidePanel/70dab2540745c39bfef805c4621b52ebfb85fc97/CardSlidePanel/app/src/main/assets/wall10.jpg
--------------------------------------------------------------------------------
/CardSlidePanel/app/src/main/assets/wall11.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xmuSistone/CardSlidePanel/70dab2540745c39bfef805c4621b52ebfb85fc97/CardSlidePanel/app/src/main/assets/wall11.jpg
--------------------------------------------------------------------------------
/CardSlidePanel/app/src/main/assets/wall12.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xmuSistone/CardSlidePanel/70dab2540745c39bfef805c4621b52ebfb85fc97/CardSlidePanel/app/src/main/assets/wall12.jpg
--------------------------------------------------------------------------------
/CardSlidePanel/app/src/main/java/com/stone/card/CardDataItem.java:
--------------------------------------------------------------------------------
1 | package com.stone.card;
2 |
3 | /**
4 | * 卡片数据装载对象
5 | *
6 | * @author xmuSistone
7 | */
8 | public class CardDataItem {
9 | String imagePath;
10 | String userName;
11 | int likeNum;
12 | int imageNum;
13 | }
14 |
--------------------------------------------------------------------------------
/CardSlidePanel/app/src/main/java/com/stone/card/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.stone.card;
2 |
3 | import android.graphics.Rect;
4 | import android.os.Bundle;
5 | import android.os.Handler;
6 | import android.support.v4.app.FragmentActivity;
7 | import android.util.Log;
8 | import android.view.View;
9 | import android.view.Window;
10 | import android.widget.ImageView;
11 | import android.widget.TextView;
12 |
13 | import com.bumptech.glide.Glide;
14 | import com.stone.card.library.CardAdapter;
15 | import com.stone.card.library.CardSlidePanel;
16 |
17 | import java.util.ArrayList;
18 | import java.util.List;
19 |
20 | public class MainActivity extends FragmentActivity {
21 |
22 | private CardSlidePanel.CardSwitchListener cardSwitchListener;
23 |
24 | private String imagePaths[] = {"file:///android_asset/wall01.jpg",
25 | "file:///android_asset/wall02.jpg", "file:///android_asset/wall03.jpg",
26 | "file:///android_asset/wall04.jpg", "file:///android_asset/wall05.jpg",
27 | "file:///android_asset/wall06.jpg", "file:///android_asset/wall07.jpg",
28 | "file:///android_asset/wall08.jpg", "file:///android_asset/wall09.jpg",
29 | "file:///android_asset/wall10.jpg", "file:///android_asset/wall11.jpg",
30 | "file:///android_asset/wall12.jpg"}; // 12个图片资源
31 |
32 | private String names[] = {"郭富城", "刘德华", "张学友", "李连杰", "成龙", "谢霆锋", "李易峰",
33 | "霍建华", "胡歌", "曾志伟", "吴孟达", "梁朝伟"}; // 12个人名
34 |
35 | private List dataList = new ArrayList<>();
36 |
37 |
38 | @Override
39 | protected void onCreate(Bundle savedInstanceState) {
40 | super.onCreate(savedInstanceState);
41 | requestWindowFeature(Window.FEATURE_NO_TITLE);
42 | setContentView(R.layout.activity_main);
43 | initView();
44 | }
45 |
46 | private void initView() {
47 | final CardSlidePanel slidePanel = (CardSlidePanel) findViewById(R.id.image_slide_panel);
48 |
49 | // 1. 左右滑动监听
50 | cardSwitchListener = new CardSlidePanel.CardSwitchListener() {
51 |
52 | @Override
53 | public void onShow(int index) {
54 | Log.d("Card", "正在显示-" + dataList.get(index).userName);
55 | }
56 |
57 | @Override
58 | public void onCardVanish(int index, int type) {
59 | Log.d("Card", "正在消失-" + dataList.get(index).userName + " 消失type=" + type);
60 | }
61 | };
62 | slidePanel.setCardSwitchListener(cardSwitchListener);
63 |
64 |
65 | // 2. 绑定Adapter
66 | slidePanel.setAdapter(new CardAdapter() {
67 | @Override
68 | public int getLayoutId() {
69 | return R.layout.card_item;
70 | }
71 |
72 | @Override
73 | public int getCount() {
74 | return dataList.size();
75 | }
76 |
77 | @Override
78 | public void bindView(View view, int index) {
79 | Object tag = view.getTag();
80 | ViewHolder viewHolder;
81 | if (null != tag) {
82 | viewHolder = (ViewHolder) tag;
83 | } else {
84 | viewHolder = new ViewHolder(view);
85 | view.setTag(viewHolder);
86 | }
87 |
88 | viewHolder.bindData(dataList.get(index));
89 | }
90 |
91 | @Override
92 | public Object getItem(int index) {
93 | return dataList.get(index);
94 | }
95 |
96 | @Override
97 | public Rect obtainDraggableArea(View view) {
98 | // 可滑动区域定制,该函数只会调用一次
99 | View contentView = view.findViewById(R.id.card_item_content);
100 | View topLayout = view.findViewById(R.id.card_top_layout);
101 | View bottomLayout = view.findViewById(R.id.card_bottom_layout);
102 | int left = view.getLeft() + contentView.getPaddingLeft() + topLayout.getPaddingLeft();
103 | int right = view.getRight() - contentView.getPaddingRight() - topLayout.getPaddingRight();
104 | int top = view.getTop() + contentView.getPaddingTop() + topLayout.getPaddingTop();
105 | int bottom = view.getBottom() - contentView.getPaddingBottom() - bottomLayout.getPaddingBottom();
106 | return new Rect(left, top, right, bottom);
107 | }
108 | });
109 |
110 |
111 | Handler handler = new Handler();
112 | handler.postDelayed(new Runnable() {
113 | @Override
114 | public void run() {
115 | prepareDataList();
116 | slidePanel.getAdapter().notifyDataSetChanged();
117 | }
118 | }, 500);
119 |
120 | // 3. notifyDataSetChanged调用
121 | findViewById(R.id.notify_change).setOnClickListener(new View.OnClickListener() {
122 | @Override
123 | public void onClick(View v) {
124 | appendDataList();
125 | slidePanel.getAdapter().notifyDataSetChanged();
126 | }
127 | });
128 | }
129 |
130 | private void prepareDataList() {
131 | for (int i = 0; i < 6; i++) {
132 | CardDataItem dataItem = new CardDataItem();
133 | dataItem.userName = names[i];
134 | dataItem.imagePath = imagePaths[i];
135 | dataItem.likeNum = (int) (Math.random() * 10);
136 | dataItem.imageNum = (int) (Math.random() * 6);
137 | dataList.add(dataItem);
138 | }
139 | }
140 |
141 | private void appendDataList() {
142 | for (int i = 0; i < 6; i++) {
143 | CardDataItem dataItem = new CardDataItem();
144 | dataItem.userName = "From Append";
145 | dataItem.imagePath = imagePaths[8];
146 | dataItem.likeNum = (int) (Math.random() * 10);
147 | dataItem.imageNum = (int) (Math.random() * 6);
148 | dataList.add(dataItem);
149 | }
150 | }
151 |
152 | class ViewHolder {
153 |
154 | ImageView imageView;
155 | View maskView;
156 | TextView userNameTv;
157 | TextView imageNumTv;
158 | TextView likeNumTv;
159 |
160 | public ViewHolder(View view) {
161 | imageView = (ImageView) view.findViewById(R.id.card_image_view);
162 | maskView = view.findViewById(R.id.maskView);
163 | userNameTv = (TextView) view.findViewById(R.id.card_user_name);
164 | imageNumTv = (TextView) view.findViewById(R.id.card_pic_num);
165 | likeNumTv = (TextView) view.findViewById(R.id.card_like);
166 | }
167 |
168 | public void bindData(CardDataItem itemData) {
169 | Glide.with(MainActivity.this).load(itemData.imagePath).into(imageView);
170 | userNameTv.setText(itemData.userName);
171 | imageNumTv.setText(itemData.imageNum + "");
172 | likeNumTv.setText(itemData.likeNum + "");
173 | }
174 | }
175 |
176 | }
177 |
--------------------------------------------------------------------------------
/CardSlidePanel/app/src/main/res/drawable-xhdpi/bottom.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xmuSistone/CardSlidePanel/70dab2540745c39bfef805c4621b52ebfb85fc97/CardSlidePanel/app/src/main/res/drawable-xhdpi/bottom.9.png
--------------------------------------------------------------------------------
/CardSlidePanel/app/src/main/res/drawable-xhdpi/home_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xmuSistone/CardSlidePanel/70dab2540745c39bfef805c4621b52ebfb85fc97/CardSlidePanel/app/src/main/res/drawable-xhdpi/home_normal.png
--------------------------------------------------------------------------------
/CardSlidePanel/app/src/main/res/drawable-xhdpi/home_pressed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xmuSistone/CardSlidePanel/70dab2540745c39bfef805c4621b52ebfb85fc97/CardSlidePanel/app/src/main/res/drawable-xhdpi/home_pressed.png
--------------------------------------------------------------------------------
/CardSlidePanel/app/src/main/res/drawable-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xmuSistone/CardSlidePanel/70dab2540745c39bfef805c4621b52ebfb85fc97/CardSlidePanel/app/src/main/res/drawable-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/CardSlidePanel/app/src/main/res/drawable-xhdpi/ignore_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xmuSistone/CardSlidePanel/70dab2540745c39bfef805c4621b52ebfb85fc97/CardSlidePanel/app/src/main/res/drawable-xhdpi/ignore_normal.png
--------------------------------------------------------------------------------
/CardSlidePanel/app/src/main/res/drawable-xhdpi/ignore_pressed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xmuSistone/CardSlidePanel/70dab2540745c39bfef805c4621b52ebfb85fc97/CardSlidePanel/app/src/main/res/drawable-xhdpi/ignore_pressed.png
--------------------------------------------------------------------------------
/CardSlidePanel/app/src/main/res/drawable-xhdpi/like_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xmuSistone/CardSlidePanel/70dab2540745c39bfef805c4621b52ebfb85fc97/CardSlidePanel/app/src/main/res/drawable-xhdpi/like_normal.png
--------------------------------------------------------------------------------
/CardSlidePanel/app/src/main/res/drawable-xhdpi/like_pressed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xmuSistone/CardSlidePanel/70dab2540745c39bfef805c4621b52ebfb85fc97/CardSlidePanel/app/src/main/res/drawable-xhdpi/like_pressed.png
--------------------------------------------------------------------------------
/CardSlidePanel/app/src/main/res/drawable-xhdpi/top.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xmuSistone/CardSlidePanel/70dab2540745c39bfef805c4621b52ebfb85fc97/CardSlidePanel/app/src/main/res/drawable-xhdpi/top.9.png
--------------------------------------------------------------------------------
/CardSlidePanel/app/src/main/res/drawable-xxhdpi/card_left1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xmuSistone/CardSlidePanel/70dab2540745c39bfef805c4621b52ebfb85fc97/CardSlidePanel/app/src/main/res/drawable-xxhdpi/card_left1.png
--------------------------------------------------------------------------------
/CardSlidePanel/app/src/main/res/drawable-xxhdpi/card_left2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xmuSistone/CardSlidePanel/70dab2540745c39bfef805c4621b52ebfb85fc97/CardSlidePanel/app/src/main/res/drawable-xxhdpi/card_left2.png
--------------------------------------------------------------------------------
/CardSlidePanel/app/src/main/res/drawable-xxhdpi/card_photot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xmuSistone/CardSlidePanel/70dab2540745c39bfef805c4621b52ebfb85fc97/CardSlidePanel/app/src/main/res/drawable-xxhdpi/card_photot.png
--------------------------------------------------------------------------------
/CardSlidePanel/app/src/main/res/drawable-xxhdpi/download.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xmuSistone/CardSlidePanel/70dab2540745c39bfef805c4621b52ebfb85fc97/CardSlidePanel/app/src/main/res/drawable-xxhdpi/download.png
--------------------------------------------------------------------------------
/CardSlidePanel/app/src/main/res/drawable-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xmuSistone/CardSlidePanel/70dab2540745c39bfef805c4621b52ebfb85fc97/CardSlidePanel/app/src/main/res/drawable-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/CardSlidePanel/app/src/main/res/drawable/home_button.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/CardSlidePanel/app/src/main/res/drawable/ignore_button.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/CardSlidePanel/app/src/main/res/drawable/like_button.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/CardSlidePanel/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
13 |
14 |
21 |
22 |
29 |
30 |
31 |
32 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/CardSlidePanel/app/src/main/res/layout/card_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
17 |
18 |
23 |
24 |
30 |
31 |
44 |
45 |
46 |
52 |
53 |
61 |
62 |
72 |
73 |
79 |
80 |
89 |
90 |
102 |
103 |
104 |
--------------------------------------------------------------------------------
/CardSlidePanel/app/src/main/res/menu/menu_main.xml:
--------------------------------------------------------------------------------
1 |
7 |
--------------------------------------------------------------------------------
/CardSlidePanel/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xmuSistone/CardSlidePanel/70dab2540745c39bfef805c4621b52ebfb85fc97/CardSlidePanel/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/CardSlidePanel/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xmuSistone/CardSlidePanel/70dab2540745c39bfef805c4621b52ebfb85fc97/CardSlidePanel/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/CardSlidePanel/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xmuSistone/CardSlidePanel/70dab2540745c39bfef805c4621b52ebfb85fc97/CardSlidePanel/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/CardSlidePanel/app/src/main/res/values-v21/styles.xml:
--------------------------------------------------------------------------------
1 | >
2 |
3 |
--------------------------------------------------------------------------------
/CardSlidePanel/app/src/main/res/values-w820dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 64dp
6 |
7 |
--------------------------------------------------------------------------------
/CardSlidePanel/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3F51B5
4 | #303F9F
5 | #FF4081
6 |
7 | #a5c5ccf5
8 | #8f000000
9 |
10 |
--------------------------------------------------------------------------------
/CardSlidePanel/app/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 16dp
4 | 16dp
5 | 16dp
6 | 312dp
7 | 220dp
8 |
9 |
--------------------------------------------------------------------------------
/CardSlidePanel/app/src/main/res/values/ids.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/CardSlidePanel/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | CardSlidePanel
3 | Settings
4 |
5 |
--------------------------------------------------------------------------------
/CardSlidePanel/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/CardSlidePanel/app/src/test/java/com/stone/card/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.stone.card;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * To work on unit tests, switch the Test Artifact in the Build Variants view.
9 | */
10 | public class ExampleUnitTest {
11 | @Test
12 | public void addition_isCorrect() throws Exception {
13 | assertEquals(4, 2 + 2);
14 | }
15 | }
--------------------------------------------------------------------------------
/CardSlidePanel/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | repositories {
5 | jcenter()
6 | }
7 | dependencies {
8 | classpath 'com.android.tools.build:gradle:2.0.0'
9 | }
10 | }
11 |
12 | allprojects {
13 | repositories {
14 | jcenter()
15 | }
16 | }
17 |
18 | task clean(type: Delete) {
19 | delete rootProject.buildDir
20 | }
21 |
--------------------------------------------------------------------------------
/CardSlidePanel/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Gradle settings configured through the IDE *will override*
5 | # any settings specified in this file.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m
13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
14 |
15 | # When configured, Gradle will run in incubating parallel mode.
16 | # This option should only be used with decoupled projects. More details, visit
17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
18 | # org.gradle.parallel=true
--------------------------------------------------------------------------------
/CardSlidePanel/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xmuSistone/CardSlidePanel/70dab2540745c39bfef805c4621b52ebfb85fc97/CardSlidePanel/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/CardSlidePanel/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Mon Nov 30 10:13:14 CST 2015
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip
7 |
--------------------------------------------------------------------------------
/CardSlidePanel/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
10 | DEFAULT_JVM_OPTS=""
11 |
12 | APP_NAME="Gradle"
13 | APP_BASE_NAME=`basename "$0"`
14 |
15 | # Use the maximum available, or set MAX_FD != -1 to use that value.
16 | MAX_FD="maximum"
17 |
18 | warn ( ) {
19 | echo "$*"
20 | }
21 |
22 | die ( ) {
23 | echo
24 | echo "$*"
25 | echo
26 | exit 1
27 | }
28 |
29 | # OS specific support (must be 'true' or 'false').
30 | cygwin=false
31 | msys=false
32 | darwin=false
33 | case "`uname`" in
34 | CYGWIN* )
35 | cygwin=true
36 | ;;
37 | Darwin* )
38 | darwin=true
39 | ;;
40 | MINGW* )
41 | msys=true
42 | ;;
43 | esac
44 |
45 | # For Cygwin, ensure paths are in UNIX format before anything is touched.
46 | if $cygwin ; then
47 | [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
48 | fi
49 |
50 | # Attempt to set APP_HOME
51 | # Resolve links: $0 may be a link
52 | PRG="$0"
53 | # Need this for relative symlinks.
54 | while [ -h "$PRG" ] ; do
55 | ls=`ls -ld "$PRG"`
56 | link=`expr "$ls" : '.*-> \(.*\)$'`
57 | if expr "$link" : '/.*' > /dev/null; then
58 | PRG="$link"
59 | else
60 | PRG=`dirname "$PRG"`"/$link"
61 | fi
62 | done
63 | SAVED="`pwd`"
64 | cd "`dirname \"$PRG\"`/" >&-
65 | APP_HOME="`pwd -P`"
66 | cd "$SAVED" >&-
67 |
68 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
69 |
70 | # Determine the Java command to use to start the JVM.
71 | if [ -n "$JAVA_HOME" ] ; then
72 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
73 | # IBM's JDK on AIX uses strange locations for the executables
74 | JAVACMD="$JAVA_HOME/jre/sh/java"
75 | else
76 | JAVACMD="$JAVA_HOME/bin/java"
77 | fi
78 | if [ ! -x "$JAVACMD" ] ; then
79 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
80 |
81 | Please set the JAVA_HOME variable in your environment to match the
82 | location of your Java installation."
83 | fi
84 | else
85 | JAVACMD="java"
86 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
87 |
88 | Please set the JAVA_HOME variable in your environment to match the
89 | location of your Java installation."
90 | fi
91 |
92 | # Increase the maximum file descriptors if we can.
93 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
94 | MAX_FD_LIMIT=`ulimit -H -n`
95 | if [ $? -eq 0 ] ; then
96 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
97 | MAX_FD="$MAX_FD_LIMIT"
98 | fi
99 | ulimit -n $MAX_FD
100 | if [ $? -ne 0 ] ; then
101 | warn "Could not set maximum file descriptor limit: $MAX_FD"
102 | fi
103 | else
104 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
105 | fi
106 | fi
107 |
108 | # For Darwin, add options to specify how the application appears in the dock
109 | if $darwin; then
110 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
111 | fi
112 |
113 | # For Cygwin, switch paths to Windows format before running java
114 | if $cygwin ; then
115 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
116 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
117 |
118 | # We build the pattern for arguments to be converted via cygpath
119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
120 | SEP=""
121 | for dir in $ROOTDIRSRAW ; do
122 | ROOTDIRS="$ROOTDIRS$SEP$dir"
123 | SEP="|"
124 | done
125 | OURCYGPATTERN="(^($ROOTDIRS))"
126 | # Add a user-defined pattern to the cygpath arguments
127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
129 | fi
130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
131 | i=0
132 | for arg in "$@" ; do
133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
135 |
136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
138 | else
139 | eval `echo args$i`="\"$arg\""
140 | fi
141 | i=$((i+1))
142 | done
143 | case $i in
144 | (0) set -- ;;
145 | (1) set -- "$args0" ;;
146 | (2) set -- "$args0" "$args1" ;;
147 | (3) set -- "$args0" "$args1" "$args2" ;;
148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
154 | esac
155 | fi
156 |
157 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
158 | function splitJvmOpts() {
159 | JVM_OPTS=("$@")
160 | }
161 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
162 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
163 |
164 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
165 |
--------------------------------------------------------------------------------
/CardSlidePanel/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/CardSlidePanel/library/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/CardSlidePanel/library/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.library'
2 |
3 | android {
4 | compileSdkVersion 25
5 | buildToolsVersion "25.0.2"
6 |
7 | defaultConfig {
8 | minSdkVersion 14
9 | targetSdkVersion 25
10 | versionCode 1
11 | versionName "1.0"
12 |
13 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
14 |
15 | }
16 | buildTypes {
17 | release {
18 | minifyEnabled false
19 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
20 | }
21 | }
22 | }
23 |
24 | dependencies {
25 | compile fileTree(dir: 'libs', include: ['*.jar'])
26 | androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
27 | exclude group: 'com.android.support', module: 'support-annotations'
28 | })
29 | compile 'com.android.support:appcompat-v7:25.3.1'
30 | compile 'com.facebook.rebound:rebound:0.3.8'
31 | testCompile 'junit:junit:4.12'
32 | }
33 |
--------------------------------------------------------------------------------
/CardSlidePanel/library/library.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 | generateDebugSources
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
--------------------------------------------------------------------------------
/CardSlidePanel/library/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in D:\adt-bundle-windows-x86-20130917\sdk/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/CardSlidePanel/library/src/androidTest/java/com/stone/card/library/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.stone.card.library;
2 |
3 | import android.content.Context;
4 | import android.support.test.InstrumentationRegistry;
5 | import android.support.test.runner.AndroidJUnit4;
6 |
7 | import org.junit.Test;
8 | import org.junit.runner.RunWith;
9 |
10 | import static org.junit.Assert.*;
11 |
12 | /**
13 | * Instrumentation test, which will execute on an Android device.
14 | *
15 | * @see Testing documentation
16 | */
17 | @RunWith(AndroidJUnit4.class)
18 | public class ExampleInstrumentedTest {
19 | @Test
20 | public void useAppContext() throws Exception {
21 | // Context of the app under test.
22 | Context appContext = InstrumentationRegistry.getTargetContext();
23 |
24 | assertEquals("com.stone.card.library.test", appContext.getPackageName());
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/CardSlidePanel/library/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/CardSlidePanel/library/src/main/java/com/stone/card/library/CardAdapter.java:
--------------------------------------------------------------------------------
1 | package com.stone.card.library;
2 |
3 | import android.database.DataSetObservable;
4 | import android.database.DataSetObserver;
5 | import android.graphics.Rect;
6 | import android.view.View;
7 |
8 | /**
9 | * Created by xmuSistone on 2017/7/5.
10 | */
11 |
12 | public abstract class CardAdapter {
13 |
14 | private final DataSetObservable mDataSetObservable = new DataSetObservable();
15 |
16 | /**
17 | * layout文件ID,调用者必须实现
18 | */
19 | public abstract int getLayoutId();
20 |
21 | /**
22 | * item数量,调用者必须实现
23 | */
24 | public abstract int getCount();
25 |
26 | /**
27 | * View与数据绑定回调,可重载
28 | */
29 | public abstract void bindView(View view, int index);
30 |
31 | /**
32 | * 获取数据用
33 | */
34 | public abstract Object getItem(int index);
35 |
36 |
37 | /**
38 | * 可滑动区域定制
39 | *
40 | * @param view 拖动的View
41 | */
42 | public Rect obtainDraggableArea(View view) {
43 | return null;
44 | }
45 |
46 | public void registerDataSetObserver(DataSetObserver observer) {
47 | mDataSetObservable.registerObserver(observer);
48 | }
49 |
50 | public void unregisterDataSetObserver(DataSetObserver observer) {
51 | mDataSetObservable.unregisterObserver(observer);
52 | }
53 |
54 | public void notifyDataSetChanged() {
55 | mDataSetObservable.notifyChanged();
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/CardSlidePanel/library/src/main/java/com/stone/card/library/CardItemView.java:
--------------------------------------------------------------------------------
1 | package com.stone.card.library;
2 |
3 | import android.animation.ObjectAnimator;
4 | import android.animation.ValueAnimator;
5 | import android.annotation.SuppressLint;
6 | import android.content.Context;
7 | import android.util.AttributeSet;
8 | import android.view.LayoutInflater;
9 | import android.view.View;
10 | import android.widget.FrameLayout;
11 |
12 | import com.facebook.rebound.SimpleSpringListener;
13 | import com.facebook.rebound.Spring;
14 | import com.facebook.rebound.SpringConfig;
15 | import com.facebook.rebound.SpringSystem;
16 |
17 | /**
18 | * 卡片View项
19 | *
20 | * @author xmuSistone
21 | */
22 | @SuppressLint("NewApi")
23 | public class CardItemView extends FrameLayout {
24 |
25 | private Spring springX, springY;
26 | private CardSlidePanel parentView;
27 | private ObjectAnimator alphaAnimator;
28 |
29 | public CardItemView(Context context) {
30 | this(context, null);
31 | }
32 |
33 | public CardItemView(Context context, AttributeSet attrs) {
34 | this(context, attrs, 0);
35 | }
36 |
37 | public CardItemView(Context context, AttributeSet attrs, int defStyle) {
38 | super(context, attrs, defStyle);
39 | initSpring();
40 | }
41 |
42 | private void initSpring() {
43 | SpringConfig springConfig = SpringConfig.fromBouncinessAndSpeed(15, 20);
44 | SpringSystem mSpringSystem = SpringSystem.create();
45 | springX = mSpringSystem.createSpring().setSpringConfig(springConfig);
46 | springY = mSpringSystem.createSpring().setSpringConfig(springConfig);
47 |
48 | springX.addListener(new SimpleSpringListener() {
49 | @Override
50 | public void onSpringUpdate(Spring spring) {
51 | int xPos = (int) spring.getCurrentValue();
52 | setScreenX(xPos);
53 | parentView.onViewPosChanged(CardItemView.this);
54 | }
55 | });
56 |
57 | springY.addListener(new SimpleSpringListener() {
58 | @Override
59 | public void onSpringUpdate(Spring spring) {
60 | int yPos = (int) spring.getCurrentValue();
61 | setScreenY(yPos);
62 | parentView.onViewPosChanged(CardItemView.this);
63 | }
64 | });
65 | }
66 |
67 | /**
68 | * 动画移动到某个位置
69 | */
70 | public void animTo(int xPos, int yPos) {
71 | setCurrentSpringPos(getLeft(), getTop());
72 | springX.setEndValue(xPos);
73 | springY.setEndValue(yPos);
74 | }
75 |
76 | /**
77 | * 设置当前spring位置
78 | */
79 | private void setCurrentSpringPos(int xPos, int yPos) {
80 | springX.setCurrentValue(xPos);
81 | springY.setCurrentValue(yPos);
82 | }
83 |
84 | public void setScreenX(int screenX) {
85 | this.offsetLeftAndRight(screenX - getLeft());
86 | }
87 |
88 | public void setScreenY(int screenY) {
89 | this.offsetTopAndBottom(screenY - getTop());
90 | }
91 |
92 | public void setParentView(CardSlidePanel parentView) {
93 | this.parentView = parentView;
94 | }
95 |
96 | public void onStartDragging() {
97 | springX.setAtRest();
98 | springY.setAtRest();
99 | }
100 |
101 | public void bindLayoutResId(int layoutResId) {
102 | LayoutInflater inflater = LayoutInflater.from(getContext());
103 | View view = inflater.inflate(layoutResId, null);
104 | addView(view, new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT));
105 | }
106 |
107 | public void setVisibilityWithAnimation(final int visibility, int delayIndex) {
108 | if (visibility == View.VISIBLE && getVisibility() != View.VISIBLE) {
109 | setAlpha(0);
110 | setVisibility(visibility);
111 |
112 | if (null != alphaAnimator) {
113 | alphaAnimator.cancel();
114 | }
115 | alphaAnimator = ObjectAnimator.ofFloat(this, "alpha",
116 | 0.0f, 1.0f);
117 | alphaAnimator.setDuration(360);
118 | alphaAnimator.setStartDelay(delayIndex * 200);
119 | alphaAnimator.start();
120 | }
121 | }
122 | }
123 |
--------------------------------------------------------------------------------
/CardSlidePanel/library/src/main/java/com/stone/card/library/CardSlidePanel.java:
--------------------------------------------------------------------------------
1 | package com.stone.card.library;
2 |
3 | import android.annotation.SuppressLint;
4 | import android.content.Context;
5 | import android.content.res.TypedArray;
6 | import android.database.DataSetObserver;
7 | import android.graphics.Point;
8 | import android.graphics.Rect;
9 | import android.support.v4.view.GestureDetectorCompat;
10 | import android.support.v4.view.ViewCompat;
11 | import android.support.v4.widget.ViewDragHelper;
12 | import android.util.AttributeSet;
13 | import android.view.GestureDetector.SimpleOnGestureListener;
14 | import android.view.MotionEvent;
15 | import android.view.View;
16 | import android.view.ViewConfiguration;
17 | import android.view.ViewGroup;
18 | import android.view.ViewTreeObserver;
19 |
20 | import java.lang.ref.WeakReference;
21 | import java.util.ArrayList;
22 | import java.util.List;
23 |
24 | /**
25 | * 卡片滑动面板,主要逻辑实现类
26 | *
27 | * @author xmuSistone
28 | */
29 | @SuppressLint({"HandlerLeak", "NewApi", "ClickableViewAccessibility"})
30 | public class CardSlidePanel extends ViewGroup {
31 | private List viewList = new ArrayList<>(); // 存放的是每一层的view,从顶到底
32 | private List releasedViewList = new ArrayList<>(); // 手指松开后存放的view列表
33 |
34 | /* 拖拽工具类 */
35 | private final ViewDragHelper mDragHelper; // 这个跟原生的ViewDragHelper差不多,我仅仅只是修改了Interpolator
36 | private int initCenterViewX = 0, initCenterViewY = 0; // 最初时,中间View的x位置,y位置
37 | private int allWidth = 0; // 面板的宽度
38 | private int allHeight = 0; // 面板的高度
39 | private int childWith = 0; // 每一个子View对应的宽度
40 |
41 | private static final float SCALE_STEP = 0.08f; // view叠加缩放的步长
42 | private static final int MAX_SLIDE_DISTANCE_LINKAGE = 500; // 水平距离+垂直距离
43 |
44 | private int itemMarginTop = 10; // 卡片距离顶部的偏移量
45 | private int bottomMarginTop = 40; // 底部按钮与卡片的margin值
46 | private int yOffsetStep = 40; // view叠加垂直偏移量的步长
47 | private int mTouchSlop = 5; // 判定为滑动的阈值,单位是像素
48 |
49 | private static final int X_VEL_THRESHOLD = 800;
50 | private static final int X_DISTANCE_THRESHOLD = 300;
51 |
52 | public static final int VANISH_TYPE_LEFT = 0;
53 | public static final int VANISH_TYPE_RIGHT = 1;
54 |
55 | private CardSwitchListener cardSwitchListener; // 回调接口
56 | private int isShowing = 0; // 当前正在显示的小项
57 | private boolean btnLock = false;
58 | private GestureDetectorCompat moveDetector;
59 | private Point downPoint = new Point();
60 | private CardAdapter adapter;
61 | private static final int VIEW_COUNT = 4;
62 | private Rect draggableArea;
63 | private WeakReference