() {
49 | @Override
50 | public GroupMember createFromParcel(Parcel in) {
51 | return new GroupMember(in);
52 | }
53 |
54 | @Override
55 | public GroupMember[] newArray(int size) {
56 | return new GroupMember[size];
57 | }
58 | };
59 |
60 | public String getId() {
61 | return id;
62 | }
63 |
64 | public void setId(String id) {
65 | this.id = id;
66 | }
67 |
68 | public String getName() {
69 | return name;
70 | }
71 |
72 | public void setName(String name) {
73 | this.name = name;
74 | }
75 | }
--------------------------------------------------------------------------------
/supportSample/src/main/java/com/yanzhenjie/recyclerview/sample/activity/group/GroupActivity.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017 Yan Zhenjie
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.yanzhenjie.recyclerview.sample.activity.group;
17 |
18 | import android.content.Intent;
19 | import android.os.Bundle;
20 | import android.view.View;
21 |
22 | import com.yanzhenjie.recyclerview.sample.R;
23 | import com.yanzhenjie.recyclerview.sample.activity.BaseActivity;
24 |
25 | import java.util.Arrays;
26 | import java.util.List;
27 |
28 | /**
29 | *
30 | * Sticky的几个效果演示。
31 | *
32 | * Created by YanZhenjie on 2017/7/22.
33 | */
34 | public class GroupActivity extends BaseActivity {
35 |
36 | @Override
37 | protected void onCreate(Bundle savedInstanceState) {
38 | super.onCreate(savedInstanceState);
39 |
40 | mRecyclerView.setAdapter(mAdapter);
41 | mAdapter.notifyDataSetChanged(mDataList);
42 | }
43 |
44 | @Override
45 | public void onItemClick(View itemView, int position) {
46 | switch (position) {
47 | case 0: {
48 | startActivity(new Intent(this, LayoutActivity.class));
49 | break;
50 | }
51 | case 1: {
52 | startActivity(new Intent(this, MenuActivity.class));
53 | break;
54 | }
55 | }
56 | }
57 |
58 | @Override
59 | protected List createDataList() {
60 | return Arrays.asList(getResources().getStringArray(R.array.sticky_item));
61 | }
62 |
63 | }
--------------------------------------------------------------------------------
/supportSample/src/main/java/com/yanzhenjie/recyclerview/sample/activity/load/RefreshLoadActivity.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017 Yan Zhenjie
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.yanzhenjie.recyclerview.sample.activity.load;
17 |
18 | import android.content.Intent;
19 | import android.os.Bundle;
20 | import android.view.View;
21 |
22 | import com.yanzhenjie.recyclerview.sample.R;
23 | import com.yanzhenjie.recyclerview.sample.activity.BaseActivity;
24 |
25 | import java.util.Arrays;
26 | import java.util.List;
27 |
28 | /**
29 | *
30 | * 加载更多的两个演示。
31 | *
32 | * Created by YanZhenjie on 2017/7/21.
33 | */
34 | public class RefreshLoadActivity extends BaseActivity {
35 |
36 | @Override
37 | protected void onCreate(Bundle savedInstanceState) {
38 | super.onCreate(savedInstanceState);
39 |
40 | mRecyclerView.setAdapter(mAdapter);
41 | mAdapter.notifyDataSetChanged(mDataList);
42 | }
43 |
44 | @Override
45 | public void onItemClick(View itemView, int position) {
46 | switch (position) {
47 | case 0: {
48 | startActivity(new Intent(this, DefaultActivity.class));
49 | break;
50 | }
51 | case 1: {
52 | startActivity(new Intent(this, DefineActivity.class));
53 | break;
54 | }
55 | }
56 | }
57 |
58 | @Override
59 | protected List createDataList() {
60 | return Arrays.asList(getResources().getStringArray(R.array.refresh_item));
61 | }
62 | }
--------------------------------------------------------------------------------
/supportSample/src/main/java/com/yanzhenjie/recyclerview/sample/activity/menu/MenuActivity.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017 Yan Zhenjie
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.yanzhenjie.recyclerview.sample.activity.menu;
17 |
18 | import android.content.Intent;
19 | import android.os.Bundle;
20 | import android.view.View;
21 |
22 | import com.yanzhenjie.recyclerview.sample.R;
23 | import com.yanzhenjie.recyclerview.sample.activity.BaseActivity;
24 |
25 | import java.util.Arrays;
26 | import java.util.List;
27 |
28 | /**
29 | *
30 | * 侧滑菜单的演示。
31 | *
32 | * Created by YanZhenjie on 2017/7/21.
33 | */
34 | public class MenuActivity extends BaseActivity {
35 |
36 | @Override
37 | protected void onCreate(Bundle savedInstanceState) {
38 | super.onCreate(savedInstanceState);
39 |
40 | mRecyclerView.setAdapter(mAdapter);
41 | mAdapter.notifyDataSetChanged(mDataList);
42 | }
43 |
44 | @Override
45 | public void onItemClick(View itemView, int position) {
46 | switch (position) {
47 | case 0: {
48 | startActivity(new Intent(this, ListActivity.class));
49 | break;
50 | }
51 | case 1: {
52 | startActivity(new Intent(this, GridActivity.class));
53 | break;
54 | }
55 | case 2: {
56 | startActivity(new Intent(this, ViewTypeActivity.class));
57 | break;
58 | }
59 | case 3: {
60 | startActivity(new Intent(this, VerticalActivity.class));
61 | break;
62 | }
63 | case 4: {
64 | startActivity(new Intent(this, DefineActivity.class));
65 | break;
66 | }
67 | }
68 | }
69 |
70 | @Override
71 | protected List createDataList() {
72 | return Arrays.asList(getResources().getStringArray(R.array.menu_item));
73 | }
74 | }
--------------------------------------------------------------------------------
/supportSample/src/main/java/com/yanzhenjie/recyclerview/sample/activity/move/MoveActivity.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017 Yan Zhenjie
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.yanzhenjie.recyclerview.sample.activity.move;
17 |
18 | import android.content.Intent;
19 | import android.os.Bundle;
20 | import android.view.View;
21 |
22 | import com.yanzhenjie.recyclerview.sample.R;
23 | import com.yanzhenjie.recyclerview.sample.activity.BaseActivity;
24 |
25 | import java.util.Arrays;
26 | import java.util.List;
27 |
28 | /**
29 | *
30 | * Item拖拽和侧滑删除演示。
31 | *
32 | * Created by YanZhenjie on 2017/7/21.
33 | */
34 | public class MoveActivity extends BaseActivity {
35 |
36 | @Override
37 | protected void onCreate(Bundle savedInstanceState) {
38 | super.onCreate(savedInstanceState);
39 |
40 | mRecyclerView.setAdapter(mAdapter);
41 | mAdapter.notifyDataSetChanged(mDataList);
42 | }
43 |
44 | @Override
45 | public void onItemClick(View itemView, int position) {
46 | switch (position) {
47 | case 0: {
48 | startActivity(new Intent(this, DragSwipeListActivity.class));
49 | break;
50 | }
51 | case 1: {
52 | startActivity(new Intent(this, DragGridActivity.class));
53 | break;
54 | }
55 | case 2: {
56 | startActivity(new Intent(this, DragTouchListActivity.class));
57 | break;
58 | }
59 | case 3: {
60 | startActivity(new Intent(this, DefineActivity.class));
61 | break;
62 | }
63 | }
64 | }
65 |
66 | @Override
67 | protected List createDataList() {
68 | return Arrays.asList(getResources().getStringArray(R.array.touch_item));
69 | }
70 |
71 | }
--------------------------------------------------------------------------------
/supportSample/src/main/java/com/yanzhenjie/recyclerview/sample/activity/nested/NestedActivity.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017 Yan Zhenjie
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.yanzhenjie.recyclerview.sample.activity.nested;
17 |
18 | import android.content.Intent;
19 | import android.os.Bundle;
20 | import android.view.View;
21 |
22 | import com.yanzhenjie.recyclerview.sample.R;
23 | import com.yanzhenjie.recyclerview.sample.activity.BaseActivity;
24 |
25 | import java.util.Arrays;
26 | import java.util.List;
27 |
28 | /**
29 | *
30 | * 几种嵌套使用的演示。
31 | *
32 | * Created by YanZhenjie on 2017/7/21.
33 | */
34 | public class NestedActivity extends BaseActivity {
35 |
36 | @Override
37 | protected void onCreate(Bundle savedInstanceState) {
38 | super.onCreate(savedInstanceState);
39 |
40 | mRecyclerView.setAdapter(mAdapter);
41 | mAdapter.notifyDataSetChanged(mDataList);
42 | }
43 |
44 | @Override
45 | public void onItemClick(View itemView, int position) {
46 | switch (position) {
47 | case 0: {
48 | startActivity(new Intent(this, CardViewActivity.class));
49 | break;
50 | }
51 | case 1: {
52 | startActivity(new Intent(this, DrawerActivity.class));
53 | break;
54 | }
55 | case 2: {
56 | startActivity(new Intent(this, ViewPagerActivity.class));
57 | break;
58 | }
59 | }
60 | }
61 |
62 | @Override
63 | protected List createDataList() {
64 | return Arrays.asList(getResources().getStringArray(R.array.nested_item));
65 | }
66 | }
--------------------------------------------------------------------------------
/supportSample/src/main/java/com/yanzhenjie/recyclerview/sample/adapter/BaseAdapter.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017 Yan Zhenjie
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.yanzhenjie.recyclerview.sample.adapter;
17 |
18 | import android.content.Context;
19 | import android.support.v7.widget.RecyclerView;
20 | import android.view.LayoutInflater;
21 |
22 | import java.util.List;
23 |
24 | /**
25 | * Created by YanZhenjie on 2017/10/3.
26 | */
27 | public abstract class BaseAdapter extends RecyclerView.Adapter {
28 |
29 | private LayoutInflater mInflater;
30 |
31 | public BaseAdapter(Context context) {
32 | this.mInflater = LayoutInflater.from(context);
33 | }
34 |
35 | public LayoutInflater getInflater() {
36 | return mInflater;
37 | }
38 |
39 | public abstract void notifyDataSetChanged(List dataList);
40 |
41 | }
--------------------------------------------------------------------------------
/supportSample/src/main/java/com/yanzhenjie/recyclerview/sample/adapter/MainAdapter.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 Yan Zhenjie
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.yanzhenjie.recyclerview.sample.adapter;
17 |
18 | import android.content.Context;
19 | import android.support.annotation.NonNull;
20 | import android.support.v7.widget.RecyclerView;
21 | import android.view.View;
22 | import android.view.ViewGroup;
23 | import android.widget.TextView;
24 |
25 | import com.yanzhenjie.recyclerview.sample.R;
26 |
27 | import java.util.List;
28 |
29 |
30 | /**
31 | * Created by YOLANDA on 2016/7/22.
32 | */
33 | public class MainAdapter extends BaseAdapter {
34 |
35 | private List mDataList;
36 |
37 | public MainAdapter(Context context) {
38 | super(context);
39 | }
40 |
41 | public void notifyDataSetChanged(List dataList) {
42 | this.mDataList = dataList;
43 | super.notifyDataSetChanged();
44 | }
45 |
46 | @Override
47 | public int getItemCount() {
48 | return mDataList == null ? 0 : mDataList.size();
49 | }
50 |
51 | @NonNull
52 | @Override
53 | public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
54 | return new ViewHolder(getInflater().inflate(R.layout.item_menu_main, parent, false));
55 | }
56 |
57 | @Override
58 | public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
59 | holder.setData(mDataList.get(position));
60 | }
61 |
62 | static class ViewHolder extends RecyclerView.ViewHolder {
63 |
64 | TextView tvTitle;
65 |
66 | public ViewHolder(View itemView) {
67 | super(itemView);
68 | tvTitle = itemView.findViewById(R.id.tv_title);
69 | }
70 |
71 | public void setData(String title) {
72 | this.tvTitle.setText(title);
73 | }
74 | }
75 |
76 | }
--------------------------------------------------------------------------------
/supportSample/src/main/res/drawable-hdpi/ic_action_drop_down_black.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yanzhenjie/SwipeRecyclerView/69aa14d05da09beaeb880240c62f7de6f4f1bb39/supportSample/src/main/res/drawable-hdpi/ic_action_drop_down_black.png
--------------------------------------------------------------------------------
/supportSample/src/main/res/drawable-hdpi/ic_action_drop_down_white.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yanzhenjie/SwipeRecyclerView/69aa14d05da09beaeb880240c62f7de6f4f1bb39/supportSample/src/main/res/drawable-hdpi/ic_action_drop_down_white.png
--------------------------------------------------------------------------------
/supportSample/src/main/res/drawable-hdpi/ic_action_drop_end_black.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yanzhenjie/SwipeRecyclerView/69aa14d05da09beaeb880240c62f7de6f4f1bb39/supportSample/src/main/res/drawable-hdpi/ic_action_drop_end_black.png
--------------------------------------------------------------------------------
/supportSample/src/main/res/drawable-hdpi/ic_action_drop_end_white.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yanzhenjie/SwipeRecyclerView/69aa14d05da09beaeb880240c62f7de6f4f1bb39/supportSample/src/main/res/drawable-hdpi/ic_action_drop_end_white.png
--------------------------------------------------------------------------------
/supportSample/src/main/res/drawable-hdpi/ic_action_drop_start_black.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yanzhenjie/SwipeRecyclerView/69aa14d05da09beaeb880240c62f7de6f4f1bb39/supportSample/src/main/res/drawable-hdpi/ic_action_drop_start_black.png
--------------------------------------------------------------------------------
/supportSample/src/main/res/drawable-hdpi/ic_action_drop_start_white.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yanzhenjie/SwipeRecyclerView/69aa14d05da09beaeb880240c62f7de6f4f1bb39/supportSample/src/main/res/drawable-hdpi/ic_action_drop_start_white.png
--------------------------------------------------------------------------------
/supportSample/src/main/res/drawable-xhdpi/ic_action_drop_down_black.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yanzhenjie/SwipeRecyclerView/69aa14d05da09beaeb880240c62f7de6f4f1bb39/supportSample/src/main/res/drawable-xhdpi/ic_action_drop_down_black.png
--------------------------------------------------------------------------------
/supportSample/src/main/res/drawable-xhdpi/ic_action_drop_down_white.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yanzhenjie/SwipeRecyclerView/69aa14d05da09beaeb880240c62f7de6f4f1bb39/supportSample/src/main/res/drawable-xhdpi/ic_action_drop_down_white.png
--------------------------------------------------------------------------------
/supportSample/src/main/res/drawable-xhdpi/ic_action_drop_end_black.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yanzhenjie/SwipeRecyclerView/69aa14d05da09beaeb880240c62f7de6f4f1bb39/supportSample/src/main/res/drawable-xhdpi/ic_action_drop_end_black.png
--------------------------------------------------------------------------------
/supportSample/src/main/res/drawable-xhdpi/ic_action_drop_end_white.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yanzhenjie/SwipeRecyclerView/69aa14d05da09beaeb880240c62f7de6f4f1bb39/supportSample/src/main/res/drawable-xhdpi/ic_action_drop_end_white.png
--------------------------------------------------------------------------------
/supportSample/src/main/res/drawable-xhdpi/ic_action_drop_start_black.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yanzhenjie/SwipeRecyclerView/69aa14d05da09beaeb880240c62f7de6f4f1bb39/supportSample/src/main/res/drawable-xhdpi/ic_action_drop_start_black.png
--------------------------------------------------------------------------------
/supportSample/src/main/res/drawable-xhdpi/ic_action_drop_start_white.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yanzhenjie/SwipeRecyclerView/69aa14d05da09beaeb880240c62f7de6f4f1bb39/supportSample/src/main/res/drawable-xhdpi/ic_action_drop_start_white.png
--------------------------------------------------------------------------------
/supportSample/src/main/res/drawable-xxhdpi/header.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yanzhenjie/SwipeRecyclerView/69aa14d05da09beaeb880240c62f7de6f4f1bb39/supportSample/src/main/res/drawable-xxhdpi/header.jpg
--------------------------------------------------------------------------------
/supportSample/src/main/res/drawable-xxhdpi/ic_action_add.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yanzhenjie/SwipeRecyclerView/69aa14d05da09beaeb880240c62f7de6f4f1bb39/supportSample/src/main/res/drawable-xxhdpi/ic_action_add.png
--------------------------------------------------------------------------------
/supportSample/src/main/res/drawable-xxhdpi/ic_action_close.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yanzhenjie/SwipeRecyclerView/69aa14d05da09beaeb880240c62f7de6f4f1bb39/supportSample/src/main/res/drawable-xxhdpi/ic_action_close.png
--------------------------------------------------------------------------------
/supportSample/src/main/res/drawable-xxhdpi/ic_action_delete.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yanzhenjie/SwipeRecyclerView/69aa14d05da09beaeb880240c62f7de6f4f1bb39/supportSample/src/main/res/drawable-xxhdpi/ic_action_delete.png
--------------------------------------------------------------------------------
/supportSample/src/main/res/drawable-xxhdpi/ic_action_drop_down_black.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yanzhenjie/SwipeRecyclerView/69aa14d05da09beaeb880240c62f7de6f4f1bb39/supportSample/src/main/res/drawable-xxhdpi/ic_action_drop_down_black.png
--------------------------------------------------------------------------------
/supportSample/src/main/res/drawable-xxhdpi/ic_action_drop_down_white.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yanzhenjie/SwipeRecyclerView/69aa14d05da09beaeb880240c62f7de6f4f1bb39/supportSample/src/main/res/drawable-xxhdpi/ic_action_drop_down_white.png
--------------------------------------------------------------------------------
/supportSample/src/main/res/drawable-xxhdpi/ic_action_drop_end_black.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yanzhenjie/SwipeRecyclerView/69aa14d05da09beaeb880240c62f7de6f4f1bb39/supportSample/src/main/res/drawable-xxhdpi/ic_action_drop_end_black.png
--------------------------------------------------------------------------------
/supportSample/src/main/res/drawable-xxhdpi/ic_action_drop_end_white.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yanzhenjie/SwipeRecyclerView/69aa14d05da09beaeb880240c62f7de6f4f1bb39/supportSample/src/main/res/drawable-xxhdpi/ic_action_drop_end_white.png
--------------------------------------------------------------------------------
/supportSample/src/main/res/drawable-xxhdpi/ic_action_drop_start_black.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yanzhenjie/SwipeRecyclerView/69aa14d05da09beaeb880240c62f7de6f4f1bb39/supportSample/src/main/res/drawable-xxhdpi/ic_action_drop_start_black.png
--------------------------------------------------------------------------------
/supportSample/src/main/res/drawable-xxhdpi/ic_action_drop_start_white.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yanzhenjie/SwipeRecyclerView/69aa14d05da09beaeb880240c62f7de6f4f1bb39/supportSample/src/main/res/drawable-xxhdpi/ic_action_drop_start_white.png
--------------------------------------------------------------------------------
/supportSample/src/main/res/drawable-xxhdpi/ic_action_module_black.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yanzhenjie/SwipeRecyclerView/69aa14d05da09beaeb880240c62f7de6f4f1bb39/supportSample/src/main/res/drawable-xxhdpi/ic_action_module_black.png
--------------------------------------------------------------------------------
/supportSample/src/main/res/drawable-xxhdpi/ic_action_wechat.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yanzhenjie/SwipeRecyclerView/69aa14d05da09beaeb880240c62f7de6f4f1bb39/supportSample/src/main/res/drawable-xxhdpi/ic_action_wechat.png
--------------------------------------------------------------------------------
/supportSample/src/main/res/drawable-xxxhdpi/ic_action_drop_down_black.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yanzhenjie/SwipeRecyclerView/69aa14d05da09beaeb880240c62f7de6f4f1bb39/supportSample/src/main/res/drawable-xxxhdpi/ic_action_drop_down_black.png
--------------------------------------------------------------------------------
/supportSample/src/main/res/drawable-xxxhdpi/ic_action_drop_down_white.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yanzhenjie/SwipeRecyclerView/69aa14d05da09beaeb880240c62f7de6f4f1bb39/supportSample/src/main/res/drawable-xxxhdpi/ic_action_drop_down_white.png
--------------------------------------------------------------------------------
/supportSample/src/main/res/drawable-xxxhdpi/ic_action_drop_end_black.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yanzhenjie/SwipeRecyclerView/69aa14d05da09beaeb880240c62f7de6f4f1bb39/supportSample/src/main/res/drawable-xxxhdpi/ic_action_drop_end_black.png
--------------------------------------------------------------------------------
/supportSample/src/main/res/drawable-xxxhdpi/ic_action_drop_end_white.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yanzhenjie/SwipeRecyclerView/69aa14d05da09beaeb880240c62f7de6f4f1bb39/supportSample/src/main/res/drawable-xxxhdpi/ic_action_drop_end_white.png
--------------------------------------------------------------------------------
/supportSample/src/main/res/drawable-xxxhdpi/ic_action_drop_start_black.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yanzhenjie/SwipeRecyclerView/69aa14d05da09beaeb880240c62f7de6f4f1bb39/supportSample/src/main/res/drawable-xxxhdpi/ic_action_drop_start_black.png
--------------------------------------------------------------------------------
/supportSample/src/main/res/drawable-xxxhdpi/ic_action_drop_start_white.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yanzhenjie/SwipeRecyclerView/69aa14d05da09beaeb880240c62f7de6f4f1bb39/supportSample/src/main/res/drawable-xxxhdpi/ic_action_drop_start_white.png
--------------------------------------------------------------------------------
/supportSample/src/main/res/drawable/select_expandable_black.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/supportSample/src/main/res/drawable/select_white.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/supportSample/src/main/res/drawable/selector_green.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/supportSample/src/main/res/drawable/selector_purple.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/supportSample/src/main/res/drawable/selector_red.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/supportSample/src/main/res/layout/activity_group_menu.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
23 |
24 |
25 |
26 |
31 |
32 |
36 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/supportSample/src/main/res/layout/activity_refresh_loadmore.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
23 |
24 |
25 |
26 |
31 |
32 |
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/supportSample/src/main/res/layout/activity_scroll.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
23 |
24 |
25 |
26 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/supportSample/src/main/res/layout/fragment_menu.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
22 |
23 |
--------------------------------------------------------------------------------
/supportSample/src/main/res/layout/item_drag_touch.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
23 |
24 |
35 |
36 |
45 |
46 |
57 |
58 |
--------------------------------------------------------------------------------
/supportSample/src/main/res/layout/item_expand_child.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
24 |
25 |
33 |
34 |
--------------------------------------------------------------------------------
/supportSample/src/main/res/layout/item_expand_parent.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
24 |
25 |
33 |
34 |
42 |
43 |
--------------------------------------------------------------------------------
/supportSample/src/main/res/layout/item_menu_define.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
27 |
28 |
33 |
34 |
40 |
41 |
42 |
43 |
48 |
49 |
54 |
55 |
--------------------------------------------------------------------------------
/supportSample/src/main/res/layout/item_menu_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
26 |
27 |
32 |
33 |
--------------------------------------------------------------------------------
/supportSample/src/main/res/layout/item_menu_sticky.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
23 |
24 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/supportSample/src/main/res/layout/item_menu_vertical.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
26 |
27 |
32 |
33 |
--------------------------------------------------------------------------------
/supportSample/src/main/res/layout/layout_footer.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
24 |
--------------------------------------------------------------------------------
/supportSample/src/main/res/layout/layout_fotter_loadmore.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
20 |
21 |
28 |
29 |
36 |
37 |
--------------------------------------------------------------------------------
/supportSample/src/main/res/layout/layout_header.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
23 |
24 |
29 |
30 |
36 |
37 |
--------------------------------------------------------------------------------
/supportSample/src/main/res/layout/layout_header_switch.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
23 |
24 |
29 |
30 |
37 |
38 |
--------------------------------------------------------------------------------
/supportSample/src/main/res/layout/toolbar.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
23 |
24 |
30 |
31 |
--------------------------------------------------------------------------------
/supportSample/src/main/res/layout/toolbar_scroll.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
23 |
24 |
31 |
32 |
--------------------------------------------------------------------------------
/supportSample/src/main/res/menu/menu_all_activity.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
--------------------------------------------------------------------------------
/supportSample/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yanzhenjie/SwipeRecyclerView/69aa14d05da09beaeb880240c62f7de6f4f1bb39/supportSample/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/supportSample/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yanzhenjie/SwipeRecyclerView/69aa14d05da09beaeb880240c62f7de6f4f1bb39/supportSample/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/supportSample/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yanzhenjie/SwipeRecyclerView/69aa14d05da09beaeb880240c62f7de6f4f1bb39/supportSample/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/supportSample/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yanzhenjie/SwipeRecyclerView/69aa14d05da09beaeb880240c62f7de6f4f1bb39/supportSample/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/supportSample/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yanzhenjie/SwipeRecyclerView/69aa14d05da09beaeb880240c62f7de6f4f1bb39/supportSample/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/supportSample/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yanzhenjie/SwipeRecyclerView/69aa14d05da09beaeb880240c62f7de6f4f1bb39/supportSample/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/supportSample/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yanzhenjie/SwipeRecyclerView/69aa14d05da09beaeb880240c62f7de6f4f1bb39/supportSample/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/supportSample/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yanzhenjie/SwipeRecyclerView/69aa14d05da09beaeb880240c62f7de6f4f1bb39/supportSample/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/supportSample/src/main/res/values/array.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 | - Item中的横竖菜单
20 | - Item的拖拽和侧滑删除
21 | - 添加Header和Footer
22 | - 下拉刷新和加载更多
23 | - 和滑动布局嵌套使用
24 | - 二级列表
25 | - Sticky分组效果
26 |
27 |
28 |
29 | - List形式菜单
30 | - Grid形式菜单
31 | - 根据ViewType定制菜单
32 | - 竖向排布的菜单
33 | - 自定义菜单
34 |
35 |
36 |
37 | - ListItem拖拽和侧滑删除
38 | - GridItem拖拽
39 | - 触摸即开始拖拽
40 | - 自定义拖拽参数(不同ViewType)
41 |
42 |
43 |
44 | - 默认LoadMoreView
45 | - 自定义LoadMoreView
46 |
47 |
48 |
49 | - 当Item是CardView时(特殊)
50 | - 和DrawerLayout嵌套使用
51 | - 和ViewPager嵌套使用
52 |
53 |
54 |
55 | - List形式
56 | - Grid形式
57 | - Staggered形式
58 |
59 |
60 |
61 | - 普通布局中Sticky
62 | - Item菜单Sticky分组
63 |
64 |
--------------------------------------------------------------------------------
/supportSample/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 | #3F51B5
19 | #303F9F
20 | #FF4081
21 |
22 | #333333
23 |
24 | #FF0000
25 | #FF6666
26 | #37C000
27 | #30A070
28 | #9932CC
29 | #9F79EE
30 |
31 | #000000
32 | #FFFFFF
33 | #CFCFCF
34 |
35 | #B7B2B2
36 |
37 |
--------------------------------------------------------------------------------
/supportSample/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 | 200dp
19 | 100dp
20 | 70dp
21 | 10dp
22 | 2dp
23 |
24 |
--------------------------------------------------------------------------------
/supportSample/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 | SwipeRecyclerView
19 |
20 |
--------------------------------------------------------------------------------
/supportSample/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/x/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/x/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: rootProject.ext.plugins.library
2 |
3 | android {
4 |
5 | compileSdkVersion rootProject.ext.android.compileSdkVersion
6 | buildToolsVersion rootProject.ext.android.buildToolsVersion
7 |
8 | defaultConfig {
9 | minSdkVersion rootProject.ext.android.minSdkVersion
10 | targetSdkVersion rootProject.ext.android.targetSdkVersion
11 | consumerProguardFiles 'proguard-rules.txt'
12 | }
13 |
14 | resourcePrefix 'x_recycler'
15 | }
16 |
17 | dependencies {
18 | api rootProject.ext.dependencies.xRecyclerView
19 | }
--------------------------------------------------------------------------------
/x/proguard-rules.txt:
--------------------------------------------------------------------------------
1 | -keepclasseswithmembers class androidx.recyclerview.widget.RecyclerView$ViewHolder {
2 | public final android.view.View *;
3 | }
--------------------------------------------------------------------------------
/x/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
--------------------------------------------------------------------------------
/x/src/main/java/com/yanzhenjie/recyclerview/Horizontal.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 Yan Zhenjie
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.yanzhenjie.recyclerview;
17 |
18 | import android.view.View;
19 | import android.view.ViewGroup;
20 | import android.widget.OverScroller;
21 |
22 | /**
23 | * Created by Yan Zhenjie on 2016/7/22.
24 | */
25 | abstract class Horizontal {
26 |
27 | private int direction;
28 | private View menuView;
29 | protected Checker mChecker;
30 |
31 | public Horizontal(int direction, View menuView) {
32 | this.direction = direction;
33 | this.menuView = menuView;
34 | mChecker = new Checker();
35 | }
36 |
37 | public boolean canSwipe() {
38 | if (menuView instanceof ViewGroup) {
39 | return ((ViewGroup)menuView).getChildCount() > 0;
40 | }
41 | return false;
42 | }
43 |
44 | public boolean isCompleteClose(int scrollX) {
45 | int i = -getMenuView().getWidth() * getDirection();
46 | return scrollX == 0 && i != 0;
47 | }
48 |
49 | public abstract boolean isMenuOpen(int scrollX);
50 |
51 | public abstract boolean isMenuOpenNotEqual(int scrollX);
52 |
53 | public abstract void autoOpenMenu(OverScroller scroller, int scrollX, int duration);
54 |
55 | public abstract void autoCloseMenu(OverScroller scroller, int scrollX, int duration);
56 |
57 | public abstract Checker checkXY(int x, int y);
58 |
59 | public abstract boolean isClickOnContentView(int contentViewWidth, float x);
60 |
61 | public int getDirection() {
62 | return direction;
63 | }
64 |
65 | public View getMenuView() {
66 | return menuView;
67 | }
68 |
69 | public int getMenuWidth() {
70 | return menuView.getWidth();
71 | }
72 |
73 | public static final class Checker {
74 |
75 | public int x;
76 | public int y;
77 | public boolean shouldResetSwipe;
78 | }
79 |
80 | }
--------------------------------------------------------------------------------
/x/src/main/java/com/yanzhenjie/recyclerview/LeftHorizontal.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 Yan Zhenjie
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.yanzhenjie.recyclerview;
17 |
18 | import android.view.View;
19 | import android.widget.OverScroller;
20 |
21 | /**
22 | * Created by Yan Zhenjie on 2016/7/22.
23 | */
24 | class LeftHorizontal extends Horizontal {
25 |
26 | public LeftHorizontal(View menuView) {
27 | super(SwipeRecyclerView.LEFT_DIRECTION, menuView);
28 | }
29 |
30 | @Override
31 | public boolean isMenuOpen(int scrollX) {
32 | int i = -getMenuView().getWidth() * getDirection();
33 | return scrollX <= i && i != 0;
34 | }
35 |
36 | @Override
37 | public boolean isMenuOpenNotEqual(int scrollX) {
38 | return scrollX < -getMenuView().getWidth() * getDirection();
39 | }
40 |
41 | @Override
42 | public void autoOpenMenu(OverScroller scroller, int scrollX, int duration) {
43 | scroller.startScroll(Math.abs(scrollX), 0, getMenuView().getWidth() - Math.abs(scrollX), 0, duration);
44 | }
45 |
46 | @Override
47 | public void autoCloseMenu(OverScroller scroller, int scrollX, int duration) {
48 | scroller.startScroll(-Math.abs(scrollX), 0, Math.abs(scrollX), 0, duration);
49 | }
50 |
51 | @Override
52 | public Checker checkXY(int x, int y) {
53 | mChecker.x = x;
54 | mChecker.y = y;
55 | mChecker.shouldResetSwipe = false;
56 | if (mChecker.x == 0) {
57 | mChecker.shouldResetSwipe = true;
58 | }
59 | if (mChecker.x >= 0) {
60 | mChecker.x = 0;
61 | }
62 | if (mChecker.x <= -getMenuView().getWidth()) {
63 | mChecker.x = -getMenuView().getWidth();
64 | }
65 | return mChecker;
66 | }
67 |
68 | @Override
69 | public boolean isClickOnContentView(int contentViewWidth, float x) {
70 | return x > getMenuView().getWidth();
71 | }
72 | }
--------------------------------------------------------------------------------
/x/src/main/java/com/yanzhenjie/recyclerview/OnItemClickListener.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017 Yan Zhenjie
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.yanzhenjie.recyclerview;
17 |
18 | import android.view.View;
19 |
20 | /**
21 | * Created by YanZhenjie on 2017/7/21.
22 | */
23 | public interface OnItemClickListener {
24 |
25 | /**
26 | * @param view target view.
27 | * @param adapterPosition position of item.
28 | */
29 | void onItemClick(View view, int adapterPosition);
30 | }
--------------------------------------------------------------------------------
/x/src/main/java/com/yanzhenjie/recyclerview/OnItemLongClickListener.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017 Yan Zhenjie
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.yanzhenjie.recyclerview;
17 |
18 | import android.view.View;
19 |
20 | /**
21 | * Created by YanZhenjie on 2017/7/21.
22 | */
23 | public interface OnItemLongClickListener {
24 |
25 | /**
26 | * @param view target view.
27 | * @param adapterPosition position of item.
28 | */
29 | void onItemLongClick(View view, int adapterPosition);
30 | }
--------------------------------------------------------------------------------
/x/src/main/java/com/yanzhenjie/recyclerview/OnItemMenuClickListener.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 Yan Zhenjie
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.yanzhenjie.recyclerview;
17 |
18 | /**
19 | * Created by Yan Zhenjie on 2016/7/26.
20 | */
21 | public interface OnItemMenuClickListener {
22 |
23 | /**
24 | * @param menuBridge menu bridge.
25 | * @param adapterPosition position of item.
26 | */
27 | void onItemClick(SwipeMenuBridge menuBridge, int adapterPosition);
28 | }
--------------------------------------------------------------------------------
/x/src/main/java/com/yanzhenjie/recyclerview/SwipeMenuBridge.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017 Yan Zhenjie
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.yanzhenjie.recyclerview;
17 |
18 | /**
19 | * Created by YanZhenjie on 2017/7/20.
20 | */
21 | public class SwipeMenuBridge {
22 |
23 | private final Controller mController;
24 | private final int mDirection;
25 | private final int mPosition;
26 |
27 | public SwipeMenuBridge(Controller controller, int direction, int position) {
28 | this.mController = controller;
29 | this.mDirection = direction;
30 | this.mPosition = position;
31 | }
32 |
33 | @SwipeRecyclerView.DirectionMode
34 | public int getDirection() {
35 | return mDirection;
36 | }
37 |
38 | /**
39 | * Get the position of button in the menu.
40 | */
41 | public int getPosition() {
42 | return mPosition;
43 | }
44 |
45 | public void closeMenu() {
46 | mController.smoothCloseMenu();
47 | }
48 | }
--------------------------------------------------------------------------------
/x/src/main/java/com/yanzhenjie/recyclerview/SwipeMenuCreator.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 Yan Zhenjie
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.yanzhenjie.recyclerview;
17 |
18 | /**
19 | * Created by Yan Zhenjie on 2016/7/26.
20 | */
21 | public interface SwipeMenuCreator {
22 |
23 | /**
24 | * Create menu for recyclerVie item.
25 | *
26 | * @param leftMenu the menu on the left.
27 | * @param rightMenu the menu on the right.
28 | * @param position the position of item.
29 | */
30 | void onCreateMenu(SwipeMenu leftMenu, SwipeMenu rightMenu, int position);
31 | }
--------------------------------------------------------------------------------
/x/src/main/java/com/yanzhenjie/recyclerview/touch/OnItemMoveListener.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 Yan Zhenjie
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.yanzhenjie.recyclerview.touch;
17 |
18 | import androidx.recyclerview.widget.RecyclerView;
19 |
20 | /**
21 | * Created by Yolanda on 2016/4/19.
22 | */
23 | public interface OnItemMoveListener {
24 |
25 | /**
26 | * When drag and drop the callback.
27 | *
28 | * @param srcHolder src.
29 | * @param targetHolder target.
30 | *
31 | * @return To deal with the returns true, false otherwise.
32 | */
33 | boolean onItemMove(RecyclerView.ViewHolder srcHolder, RecyclerView.ViewHolder targetHolder);
34 |
35 | /**
36 | * When items should be removed when the callback.
37 | *
38 | * @param srcHolder src.
39 | */
40 | void onItemDismiss(RecyclerView.ViewHolder srcHolder);
41 |
42 | }
--------------------------------------------------------------------------------
/x/src/main/java/com/yanzhenjie/recyclerview/touch/OnItemMovementListener.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 Yan Zhenjie
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.yanzhenjie.recyclerview.touch;
17 |
18 | import androidx.recyclerview.widget.ItemTouchHelper;
19 | import androidx.recyclerview.widget.RecyclerView;
20 |
21 | /**
22 | * Created by Yan Zhenjie on 2016/8/1.
23 | */
24 | public interface OnItemMovementListener {
25 |
26 | int INVALID = 0;
27 |
28 | int LEFT = ItemTouchHelper.LEFT;
29 |
30 | int UP = ItemTouchHelper.UP;
31 |
32 | int RIGHT = ItemTouchHelper.RIGHT;
33 |
34 | int DOWN = ItemTouchHelper.DOWN;
35 |
36 | /**
37 | * Can drag and drop the ViewHolder?
38 | *
39 | * @param recyclerView {@link RecyclerView}.
40 | * @param targetViewHolder target ViewHolder.
41 | *
42 | * @return use {@link #LEFT}, {@link #UP}, {@link #RIGHT}, {@link #DOWN}.
43 | */
44 | int onDragFlags(RecyclerView recyclerView, RecyclerView.ViewHolder targetViewHolder);
45 |
46 | /**
47 | * Can swipe and drop the ViewHolder?
48 | *
49 | * @param recyclerView {@link RecyclerView}.
50 | * @param targetViewHolder target ViewHolder.
51 | *
52 | * @return use {@link #LEFT}, {@link #UP}, {@link #RIGHT}, {@link #DOWN}.
53 | */
54 | int onSwipeFlags(RecyclerView recyclerView, RecyclerView.ViewHolder targetViewHolder);
55 |
56 | }
--------------------------------------------------------------------------------
/x/src/main/java/com/yanzhenjie/recyclerview/touch/OnItemStateChangedListener.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 Yan Zhenjie
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.yanzhenjie.recyclerview.touch;
17 |
18 | import androidx.recyclerview.widget.ItemTouchHelper;
19 | import androidx.recyclerview.widget.RecyclerView;
20 |
21 | /**
22 | * Created by Yan Zhenjie on 2016/8/12.
23 | */
24 | public interface OnItemStateChangedListener {
25 |
26 | /**
27 | * ItemTouchHelper is in idle state. At this state, either there is no related motion event by the user or latest
28 | * motion events have not yet triggered a swipe or drag.
29 | */
30 | int ACTION_STATE_IDLE = ItemTouchHelper.ACTION_STATE_IDLE;
31 |
32 | /**
33 | * A View is currently being swiped.
34 | */
35 | int ACTION_STATE_SWIPE = ItemTouchHelper.ACTION_STATE_SWIPE;
36 |
37 | /**
38 | * A View is currently being dragged.
39 | */
40 | int ACTION_STATE_DRAG = ItemTouchHelper.ACTION_STATE_DRAG;
41 |
42 | /**
43 | * Called when the ViewHolder swiped or dragged by the ItemTouchHelper is changed.
44 | *
45 | * @param viewHolder The new ViewHolder that is being swiped or dragged. Might be null if it is cleared.
46 | * @param actionState One of {@link OnItemStateChangedListener#ACTION_STATE_IDLE}, {@link
47 | * OnItemStateChangedListener#ACTION_STATE_SWIPE} or {@link OnItemStateChangedListener#ACTION_STATE_DRAG}.
48 | */
49 | void onSelectedChanged(RecyclerView.ViewHolder viewHolder, int actionState);
50 | }
--------------------------------------------------------------------------------
/x/src/main/java/com/yanzhenjie/recyclerview/widget/ColorDrawer.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2018 Yan Zhenjie.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.yanzhenjie.recyclerview.widget;
17 |
18 | import android.graphics.Color;
19 | import android.graphics.drawable.ColorDrawable;
20 |
21 | import androidx.annotation.ColorInt;
22 |
23 | /**
24 | * Created by YanZhenjie on 2018/4/20.
25 | */
26 | class ColorDrawer extends Drawer {
27 |
28 | public ColorDrawer(int color, int width, int height) {
29 | super(new ColorDrawable(opaqueColor(color)), width, height);
30 | }
31 |
32 | /**
33 | * The target color is packaged in an opaque color.
34 | *
35 | * @param color color.
36 | *
37 | * @return color.
38 | */
39 | @ColorInt
40 | public static int opaqueColor(@ColorInt int color) {
41 | int alpha = Color.alpha(color);
42 | if (alpha == 0) return color;
43 | int red = Color.red(color);
44 | int green = Color.green(color);
45 | int blue = Color.blue(color);
46 | return Color.argb(255, red, green, blue);
47 | }
48 | }
--------------------------------------------------------------------------------
/x/src/main/res/layout/x_recycler_view_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
25 |
26 |
30 |
31 |
35 |
36 |
40 |
41 |
--------------------------------------------------------------------------------
/x/src/main/res/layout/x_recycler_view_load_more.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
20 |
21 |
28 |
29 |
38 |
39 |
--------------------------------------------------------------------------------
/x/src/main/res/values-zh-rHK/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 | 暫時沒有數據
20 | 沒有更多數據啦
21 | 點擊加載更多
22 | 加載出錯啦,請稍後重試
23 | 正在加載更多數據,請稍後
24 |
25 |
--------------------------------------------------------------------------------
/x/src/main/res/values-zh-rTW/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 | 暫時沒有數據
20 | 沒有更多數據啦
21 | 點擊加載更多
22 | 加載出錯啦,請稍後重試
23 | 正在加載更多數據,請稍後
24 |
25 |
--------------------------------------------------------------------------------
/x/src/main/res/values-zh/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 | 暂时没有数据
20 | 没有更多数据啦
21 | 点击加载更多
22 | 加载出错啦,请稍后重试
23 | 正在加载更多数据,请稍后
24 |
25 |
--------------------------------------------------------------------------------
/x/src/main/res/values/attrs.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/x/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 | #FF777777
20 |
21 | #55777777
22 | #B1777777
23 | #FF777777
24 |
25 |
--------------------------------------------------------------------------------
/x/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 | There is no data
20 | No more data
21 | Click to load more
22 | Error, please try again
23 | Loading, please wait later
24 |
25 |
--------------------------------------------------------------------------------
/xSample/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/xSample/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: rootProject.ext.plugins.application
2 |
3 | android {
4 | compileSdkVersion rootProject.ext.android.compileSdkVersion
5 | buildToolsVersion rootProject.ext.android.buildToolsVersion
6 |
7 | defaultConfig {
8 | applicationId rootProject.ext.android.applicationId
9 | minSdkVersion rootProject.ext.android.minSdkVersion
10 | targetSdkVersion rootProject.ext.android.targetSdkVersion
11 | versionCode rootProject.ext.android.versionCode
12 | versionName rootProject.ext.android.versionName
13 | }
14 | }
15 |
16 | dependencies {
17 | implementation project(':x')
18 |
19 | implementation rootProject.ext.dependencies.xDesign
20 | implementation rootProject.ext.dependencies.xAppCompat
21 | implementation rootProject.ext.dependencies.xRecyclerView
22 | implementation rootProject.ext.dependencies.xCardView
23 | }
--------------------------------------------------------------------------------
/xSample/src/main/java/com/yanzhenjie/recyclerview/sample/App.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 Yan Zhenjie
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.yanzhenjie.recyclerview.sample;
17 |
18 | import android.app.Application;
19 |
20 | /**
21 | * Created by Yan Zhenjie on 2016/7/27.
22 | */
23 | public class App extends Application {
24 |
25 | private static App instance;
26 |
27 | @Override
28 | public void onCreate() {
29 | super.onCreate();
30 |
31 | if (instance == null) {
32 | instance = this;
33 | }
34 | }
35 |
36 | public static App getInstance() {
37 | return instance;
38 | }
39 | }
--------------------------------------------------------------------------------
/xSample/src/main/java/com/yanzhenjie/recyclerview/sample/activity/expanded/ExpandableActivity.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2019 Zhenjie Yan
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.yanzhenjie.recyclerview.sample.activity.expanded;
17 |
18 | import android.content.Intent;
19 | import android.os.Bundle;
20 | import android.view.View;
21 |
22 | import com.yanzhenjie.recyclerview.sample.R;
23 | import com.yanzhenjie.recyclerview.sample.activity.BaseActivity;
24 |
25 | import java.util.Arrays;
26 | import java.util.List;
27 |
28 | /**
29 | * Created by Zhenjie Yan on 1/30/19.
30 | */
31 | public class ExpandableActivity extends BaseActivity {
32 |
33 | @Override
34 | protected void onCreate(Bundle savedInstanceState) {
35 | super.onCreate(savedInstanceState);
36 |
37 | mRecyclerView.setAdapter(mAdapter);
38 | mAdapter.notifyDataSetChanged(mDataList);
39 | }
40 |
41 | @Override
42 | public void onItemClick(View itemView, int position) {
43 | switch (position) {
44 | case 0: {
45 | startActivity(new Intent(this, ListActivity.class));
46 | break;
47 | }
48 | case 1: {
49 | startActivity(new Intent(this, GridActivity.class));
50 | break;
51 | }
52 | case 2: {
53 | startActivity(new Intent(this, StaggeredActivity.class));
54 | break;
55 | }
56 | }
57 | }
58 |
59 | @Override
60 | protected List createDataList() {
61 | return Arrays.asList(getResources().getStringArray(R.array.expandable_item));
62 | }
63 | }
--------------------------------------------------------------------------------
/xSample/src/main/java/com/yanzhenjie/recyclerview/sample/activity/expanded/entity/GroupMember.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2019 Zhenjie Yan
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.yanzhenjie.recyclerview.sample.activity.expanded.entity;
17 |
18 | import android.os.Parcel;
19 | import android.os.Parcelable;
20 |
21 | /**
22 | * Created by Zhenjie Yan on 1/30/19.
23 | */
24 | public class GroupMember implements Parcelable {
25 |
26 | private String id;
27 | private String name;
28 |
29 | public GroupMember() {
30 | }
31 |
32 | protected GroupMember(Parcel in) {
33 | id = in.readString();
34 | name = in.readString();
35 | }
36 |
37 | @Override
38 | public void writeToParcel(Parcel dest, int flags) {
39 | dest.writeString(id);
40 | dest.writeString(name);
41 | }
42 |
43 | @Override
44 | public int describeContents() {
45 | return 0;
46 | }
47 |
48 | public static final Creator CREATOR = new Creator() {
49 | @Override
50 | public GroupMember createFromParcel(Parcel in) {
51 | return new GroupMember(in);
52 | }
53 |
54 | @Override
55 | public GroupMember[] newArray(int size) {
56 | return new GroupMember[size];
57 | }
58 | };
59 |
60 | public String getId() {
61 | return id;
62 | }
63 |
64 | public void setId(String id) {
65 | this.id = id;
66 | }
67 |
68 | public String getName() {
69 | return name;
70 | }
71 |
72 | public void setName(String name) {
73 | this.name = name;
74 | }
75 | }
--------------------------------------------------------------------------------
/xSample/src/main/java/com/yanzhenjie/recyclerview/sample/activity/group/GroupActivity.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017 Yan Zhenjie
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.yanzhenjie.recyclerview.sample.activity.group;
17 |
18 | import android.content.Intent;
19 | import android.os.Bundle;
20 | import android.view.View;
21 |
22 | import com.yanzhenjie.recyclerview.sample.R;
23 | import com.yanzhenjie.recyclerview.sample.activity.BaseActivity;
24 |
25 | import java.util.Arrays;
26 | import java.util.List;
27 |
28 | /**
29 | *
30 | * Sticky的几个效果演示。
31 | *
32 | * Created by YanZhenjie on 2017/7/22.
33 | */
34 | public class GroupActivity extends BaseActivity {
35 |
36 | @Override
37 | protected void onCreate(Bundle savedInstanceState) {
38 | super.onCreate(savedInstanceState);
39 |
40 | mRecyclerView.setAdapter(mAdapter);
41 | mAdapter.notifyDataSetChanged(mDataList);
42 | }
43 |
44 | @Override
45 | public void onItemClick(View itemView, int position) {
46 | switch (position) {
47 | case 0: {
48 | startActivity(new Intent(this, LayoutActivity.class));
49 | break;
50 | }
51 | case 1: {
52 | startActivity(new Intent(this, MenuActivity.class));
53 | break;
54 | }
55 | }
56 | }
57 |
58 | @Override
59 | protected List createDataList() {
60 | return Arrays.asList(getResources().getStringArray(R.array.sticky_item));
61 | }
62 |
63 | }
--------------------------------------------------------------------------------
/xSample/src/main/java/com/yanzhenjie/recyclerview/sample/activity/load/RefreshLoadActivity.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017 Yan Zhenjie
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.yanzhenjie.recyclerview.sample.activity.load;
17 |
18 | import android.content.Intent;
19 | import android.os.Bundle;
20 | import android.view.View;
21 |
22 | import com.yanzhenjie.recyclerview.sample.R;
23 | import com.yanzhenjie.recyclerview.sample.activity.BaseActivity;
24 |
25 | import java.util.Arrays;
26 | import java.util.List;
27 |
28 | /**
29 | *
30 | * 加载更多的两个演示。
31 | *
32 | * Created by YanZhenjie on 2017/7/21.
33 | */
34 | public class RefreshLoadActivity extends BaseActivity {
35 |
36 | @Override
37 | protected void onCreate(Bundle savedInstanceState) {
38 | super.onCreate(savedInstanceState);
39 |
40 | mRecyclerView.setAdapter(mAdapter);
41 | mAdapter.notifyDataSetChanged(mDataList);
42 | }
43 |
44 | @Override
45 | public void onItemClick(View itemView, int position) {
46 | switch (position) {
47 | case 0: {
48 | startActivity(new Intent(this, DefaultActivity.class));
49 | break;
50 | }
51 | case 1: {
52 | startActivity(new Intent(this, DefineActivity.class));
53 | break;
54 | }
55 | }
56 | }
57 |
58 | @Override
59 | protected List createDataList() {
60 | return Arrays.asList(getResources().getStringArray(R.array.refresh_item));
61 | }
62 | }
--------------------------------------------------------------------------------
/xSample/src/main/java/com/yanzhenjie/recyclerview/sample/activity/menu/MenuActivity.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017 Yan Zhenjie
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.yanzhenjie.recyclerview.sample.activity.menu;
17 |
18 | import android.content.Intent;
19 | import android.os.Bundle;
20 | import android.view.View;
21 |
22 | import com.yanzhenjie.recyclerview.sample.R;
23 | import com.yanzhenjie.recyclerview.sample.activity.BaseActivity;
24 |
25 | import java.util.Arrays;
26 | import java.util.List;
27 |
28 | /**
29 | *
30 | * 侧滑菜单的演示。
31 | *
32 | * Created by YanZhenjie on 2017/7/21.
33 | */
34 | public class MenuActivity extends BaseActivity {
35 |
36 | @Override
37 | protected void onCreate(Bundle savedInstanceState) {
38 | super.onCreate(savedInstanceState);
39 |
40 | mRecyclerView.setAdapter(mAdapter);
41 | mAdapter.notifyDataSetChanged(mDataList);
42 | }
43 |
44 | @Override
45 | public void onItemClick(View itemView, int position) {
46 | switch (position) {
47 | case 0: {
48 | startActivity(new Intent(this, ListActivity.class));
49 | break;
50 | }
51 | case 1: {
52 | startActivity(new Intent(this, GridActivity.class));
53 | break;
54 | }
55 | case 2: {
56 | startActivity(new Intent(this, ViewTypeActivity.class));
57 | break;
58 | }
59 | case 3: {
60 | startActivity(new Intent(this, VerticalActivity.class));
61 | break;
62 | }
63 | case 4: {
64 | startActivity(new Intent(this, DefineActivity.class));
65 | break;
66 | }
67 | }
68 | }
69 |
70 | @Override
71 | protected List createDataList() {
72 | return Arrays.asList(getResources().getStringArray(R.array.menu_item));
73 | }
74 | }
--------------------------------------------------------------------------------
/xSample/src/main/java/com/yanzhenjie/recyclerview/sample/activity/move/MoveActivity.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017 Yan Zhenjie
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.yanzhenjie.recyclerview.sample.activity.move;
17 |
18 | import android.content.Intent;
19 | import android.os.Bundle;
20 | import android.view.View;
21 |
22 | import com.yanzhenjie.recyclerview.sample.R;
23 | import com.yanzhenjie.recyclerview.sample.activity.BaseActivity;
24 |
25 | import java.util.Arrays;
26 | import java.util.List;
27 |
28 | /**
29 | *
30 | * Item拖拽和侧滑删除演示。
31 | *
32 | * Created by YanZhenjie on 2017/7/21.
33 | */
34 | public class MoveActivity extends BaseActivity {
35 |
36 | @Override
37 | protected void onCreate(Bundle savedInstanceState) {
38 | super.onCreate(savedInstanceState);
39 |
40 | mRecyclerView.setAdapter(mAdapter);
41 | mAdapter.notifyDataSetChanged(mDataList);
42 | }
43 |
44 | @Override
45 | public void onItemClick(View itemView, int position) {
46 | switch (position) {
47 | case 0: {
48 | startActivity(new Intent(this, DragSwipeListActivity.class));
49 | break;
50 | }
51 | case 1: {
52 | startActivity(new Intent(this, DragGridActivity.class));
53 | break;
54 | }
55 | case 2: {
56 | startActivity(new Intent(this, DragTouchListActivity.class));
57 | break;
58 | }
59 | case 3: {
60 | startActivity(new Intent(this, DefineActivity.class));
61 | break;
62 | }
63 | }
64 | }
65 |
66 | @Override
67 | protected List createDataList() {
68 | return Arrays.asList(getResources().getStringArray(R.array.touch_item));
69 | }
70 |
71 | }
--------------------------------------------------------------------------------
/xSample/src/main/java/com/yanzhenjie/recyclerview/sample/activity/nested/NestedActivity.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017 Yan Zhenjie
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.yanzhenjie.recyclerview.sample.activity.nested;
17 |
18 | import android.content.Intent;
19 | import android.os.Bundle;
20 | import android.view.View;
21 |
22 | import com.yanzhenjie.recyclerview.sample.R;
23 | import com.yanzhenjie.recyclerview.sample.activity.BaseActivity;
24 |
25 | import java.util.Arrays;
26 | import java.util.List;
27 |
28 | /**
29 | *
30 | * 几种嵌套使用的演示。
31 | *
32 | * Created by YanZhenjie on 2017/7/21.
33 | */
34 | public class NestedActivity extends BaseActivity {
35 |
36 | @Override
37 | protected void onCreate(Bundle savedInstanceState) {
38 | super.onCreate(savedInstanceState);
39 |
40 | mRecyclerView.setAdapter(mAdapter);
41 | mAdapter.notifyDataSetChanged(mDataList);
42 | }
43 |
44 | @Override
45 | public void onItemClick(View itemView, int position) {
46 | switch (position) {
47 | case 0: {
48 | startActivity(new Intent(this, CardViewActivity.class));
49 | break;
50 | }
51 | case 1: {
52 | startActivity(new Intent(this, DrawerActivity.class));
53 | break;
54 | }
55 | case 2: {
56 | startActivity(new Intent(this, ViewPagerActivity.class));
57 | break;
58 | }
59 | }
60 | }
61 |
62 | @Override
63 | protected List createDataList() {
64 | return Arrays.asList(getResources().getStringArray(R.array.nested_item));
65 | }
66 | }
--------------------------------------------------------------------------------
/xSample/src/main/java/com/yanzhenjie/recyclerview/sample/adapter/BaseAdapter.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017 Yan Zhenjie
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.yanzhenjie.recyclerview.sample.adapter;
17 |
18 | import android.content.Context;
19 | import android.view.LayoutInflater;
20 |
21 | import java.util.List;
22 |
23 | import androidx.recyclerview.widget.RecyclerView;
24 |
25 | /**
26 | * Created by YanZhenjie on 2017/10/3.
27 | */
28 | public abstract class BaseAdapter extends RecyclerView.Adapter {
29 |
30 | private LayoutInflater mInflater;
31 |
32 | public BaseAdapter(Context context) {
33 | this.mInflater = LayoutInflater.from(context);
34 | }
35 |
36 | public LayoutInflater getInflater() {
37 | return mInflater;
38 | }
39 |
40 | public abstract void notifyDataSetChanged(List dataList);
41 |
42 | }
--------------------------------------------------------------------------------
/xSample/src/main/java/com/yanzhenjie/recyclerview/sample/adapter/MainAdapter.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 Yan Zhenjie
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.yanzhenjie.recyclerview.sample.adapter;
17 |
18 | import android.content.Context;
19 | import android.view.View;
20 | import android.view.ViewGroup;
21 | import android.widget.TextView;
22 |
23 | import com.yanzhenjie.recyclerview.sample.R;
24 |
25 | import java.util.List;
26 |
27 | import androidx.annotation.NonNull;
28 | import androidx.recyclerview.widget.RecyclerView;
29 |
30 | /**
31 | * Created by YOLANDA on 2016/7/22.
32 | */
33 | public class MainAdapter extends BaseAdapter {
34 |
35 | private List mDataList;
36 |
37 | public MainAdapter(Context context) {
38 | super(context);
39 | }
40 |
41 | public void notifyDataSetChanged(List dataList) {
42 | this.mDataList = dataList;
43 | super.notifyDataSetChanged();
44 | }
45 |
46 | @Override
47 | public int getItemCount() {
48 | return mDataList == null ? 0 : mDataList.size();
49 | }
50 |
51 | @NonNull
52 | @Override
53 | public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
54 | return new ViewHolder(getInflater().inflate(R.layout.item_menu_main, parent, false));
55 | }
56 |
57 | @Override
58 | public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
59 | holder.setData(mDataList.get(position));
60 | }
61 |
62 | static class ViewHolder extends RecyclerView.ViewHolder {
63 |
64 | TextView tvTitle;
65 |
66 | public ViewHolder(View itemView) {
67 | super(itemView);
68 | tvTitle = itemView.findViewById(R.id.tv_title);
69 | }
70 |
71 | public void setData(String title) {
72 | this.tvTitle.setText(title);
73 | }
74 | }
75 |
76 | }
--------------------------------------------------------------------------------
/xSample/src/main/res/drawable-hdpi/ic_action_drop_down_black.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yanzhenjie/SwipeRecyclerView/69aa14d05da09beaeb880240c62f7de6f4f1bb39/xSample/src/main/res/drawable-hdpi/ic_action_drop_down_black.png
--------------------------------------------------------------------------------
/xSample/src/main/res/drawable-hdpi/ic_action_drop_down_white.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yanzhenjie/SwipeRecyclerView/69aa14d05da09beaeb880240c62f7de6f4f1bb39/xSample/src/main/res/drawable-hdpi/ic_action_drop_down_white.png
--------------------------------------------------------------------------------
/xSample/src/main/res/drawable-hdpi/ic_action_drop_end_black.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yanzhenjie/SwipeRecyclerView/69aa14d05da09beaeb880240c62f7de6f4f1bb39/xSample/src/main/res/drawable-hdpi/ic_action_drop_end_black.png
--------------------------------------------------------------------------------
/xSample/src/main/res/drawable-hdpi/ic_action_drop_end_white.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yanzhenjie/SwipeRecyclerView/69aa14d05da09beaeb880240c62f7de6f4f1bb39/xSample/src/main/res/drawable-hdpi/ic_action_drop_end_white.png
--------------------------------------------------------------------------------
/xSample/src/main/res/drawable-hdpi/ic_action_drop_start_black.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yanzhenjie/SwipeRecyclerView/69aa14d05da09beaeb880240c62f7de6f4f1bb39/xSample/src/main/res/drawable-hdpi/ic_action_drop_start_black.png
--------------------------------------------------------------------------------
/xSample/src/main/res/drawable-hdpi/ic_action_drop_start_white.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yanzhenjie/SwipeRecyclerView/69aa14d05da09beaeb880240c62f7de6f4f1bb39/xSample/src/main/res/drawable-hdpi/ic_action_drop_start_white.png
--------------------------------------------------------------------------------
/xSample/src/main/res/drawable-xhdpi/ic_action_drop_down_black.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yanzhenjie/SwipeRecyclerView/69aa14d05da09beaeb880240c62f7de6f4f1bb39/xSample/src/main/res/drawable-xhdpi/ic_action_drop_down_black.png
--------------------------------------------------------------------------------
/xSample/src/main/res/drawable-xhdpi/ic_action_drop_down_white.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yanzhenjie/SwipeRecyclerView/69aa14d05da09beaeb880240c62f7de6f4f1bb39/xSample/src/main/res/drawable-xhdpi/ic_action_drop_down_white.png
--------------------------------------------------------------------------------
/xSample/src/main/res/drawable-xhdpi/ic_action_drop_end_black.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yanzhenjie/SwipeRecyclerView/69aa14d05da09beaeb880240c62f7de6f4f1bb39/xSample/src/main/res/drawable-xhdpi/ic_action_drop_end_black.png
--------------------------------------------------------------------------------
/xSample/src/main/res/drawable-xhdpi/ic_action_drop_end_white.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yanzhenjie/SwipeRecyclerView/69aa14d05da09beaeb880240c62f7de6f4f1bb39/xSample/src/main/res/drawable-xhdpi/ic_action_drop_end_white.png
--------------------------------------------------------------------------------
/xSample/src/main/res/drawable-xhdpi/ic_action_drop_start_black.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yanzhenjie/SwipeRecyclerView/69aa14d05da09beaeb880240c62f7de6f4f1bb39/xSample/src/main/res/drawable-xhdpi/ic_action_drop_start_black.png
--------------------------------------------------------------------------------
/xSample/src/main/res/drawable-xhdpi/ic_action_drop_start_white.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yanzhenjie/SwipeRecyclerView/69aa14d05da09beaeb880240c62f7de6f4f1bb39/xSample/src/main/res/drawable-xhdpi/ic_action_drop_start_white.png
--------------------------------------------------------------------------------
/xSample/src/main/res/drawable-xxhdpi/header.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yanzhenjie/SwipeRecyclerView/69aa14d05da09beaeb880240c62f7de6f4f1bb39/xSample/src/main/res/drawable-xxhdpi/header.jpg
--------------------------------------------------------------------------------
/xSample/src/main/res/drawable-xxhdpi/ic_action_add.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yanzhenjie/SwipeRecyclerView/69aa14d05da09beaeb880240c62f7de6f4f1bb39/xSample/src/main/res/drawable-xxhdpi/ic_action_add.png
--------------------------------------------------------------------------------
/xSample/src/main/res/drawable-xxhdpi/ic_action_close.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yanzhenjie/SwipeRecyclerView/69aa14d05da09beaeb880240c62f7de6f4f1bb39/xSample/src/main/res/drawable-xxhdpi/ic_action_close.png
--------------------------------------------------------------------------------
/xSample/src/main/res/drawable-xxhdpi/ic_action_delete.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yanzhenjie/SwipeRecyclerView/69aa14d05da09beaeb880240c62f7de6f4f1bb39/xSample/src/main/res/drawable-xxhdpi/ic_action_delete.png
--------------------------------------------------------------------------------
/xSample/src/main/res/drawable-xxhdpi/ic_action_drop_down_black.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yanzhenjie/SwipeRecyclerView/69aa14d05da09beaeb880240c62f7de6f4f1bb39/xSample/src/main/res/drawable-xxhdpi/ic_action_drop_down_black.png
--------------------------------------------------------------------------------
/xSample/src/main/res/drawable-xxhdpi/ic_action_drop_down_white.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yanzhenjie/SwipeRecyclerView/69aa14d05da09beaeb880240c62f7de6f4f1bb39/xSample/src/main/res/drawable-xxhdpi/ic_action_drop_down_white.png
--------------------------------------------------------------------------------
/xSample/src/main/res/drawable-xxhdpi/ic_action_drop_end_black.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yanzhenjie/SwipeRecyclerView/69aa14d05da09beaeb880240c62f7de6f4f1bb39/xSample/src/main/res/drawable-xxhdpi/ic_action_drop_end_black.png
--------------------------------------------------------------------------------
/xSample/src/main/res/drawable-xxhdpi/ic_action_drop_end_white.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yanzhenjie/SwipeRecyclerView/69aa14d05da09beaeb880240c62f7de6f4f1bb39/xSample/src/main/res/drawable-xxhdpi/ic_action_drop_end_white.png
--------------------------------------------------------------------------------
/xSample/src/main/res/drawable-xxhdpi/ic_action_drop_start_black.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yanzhenjie/SwipeRecyclerView/69aa14d05da09beaeb880240c62f7de6f4f1bb39/xSample/src/main/res/drawable-xxhdpi/ic_action_drop_start_black.png
--------------------------------------------------------------------------------
/xSample/src/main/res/drawable-xxhdpi/ic_action_drop_start_white.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yanzhenjie/SwipeRecyclerView/69aa14d05da09beaeb880240c62f7de6f4f1bb39/xSample/src/main/res/drawable-xxhdpi/ic_action_drop_start_white.png
--------------------------------------------------------------------------------
/xSample/src/main/res/drawable-xxhdpi/ic_action_module_black.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yanzhenjie/SwipeRecyclerView/69aa14d05da09beaeb880240c62f7de6f4f1bb39/xSample/src/main/res/drawable-xxhdpi/ic_action_module_black.png
--------------------------------------------------------------------------------
/xSample/src/main/res/drawable-xxhdpi/ic_action_wechat.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yanzhenjie/SwipeRecyclerView/69aa14d05da09beaeb880240c62f7de6f4f1bb39/xSample/src/main/res/drawable-xxhdpi/ic_action_wechat.png
--------------------------------------------------------------------------------
/xSample/src/main/res/drawable-xxxhdpi/ic_action_drop_down_black.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yanzhenjie/SwipeRecyclerView/69aa14d05da09beaeb880240c62f7de6f4f1bb39/xSample/src/main/res/drawable-xxxhdpi/ic_action_drop_down_black.png
--------------------------------------------------------------------------------
/xSample/src/main/res/drawable-xxxhdpi/ic_action_drop_down_white.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yanzhenjie/SwipeRecyclerView/69aa14d05da09beaeb880240c62f7de6f4f1bb39/xSample/src/main/res/drawable-xxxhdpi/ic_action_drop_down_white.png
--------------------------------------------------------------------------------
/xSample/src/main/res/drawable-xxxhdpi/ic_action_drop_end_black.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yanzhenjie/SwipeRecyclerView/69aa14d05da09beaeb880240c62f7de6f4f1bb39/xSample/src/main/res/drawable-xxxhdpi/ic_action_drop_end_black.png
--------------------------------------------------------------------------------
/xSample/src/main/res/drawable-xxxhdpi/ic_action_drop_end_white.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yanzhenjie/SwipeRecyclerView/69aa14d05da09beaeb880240c62f7de6f4f1bb39/xSample/src/main/res/drawable-xxxhdpi/ic_action_drop_end_white.png
--------------------------------------------------------------------------------
/xSample/src/main/res/drawable-xxxhdpi/ic_action_drop_start_black.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yanzhenjie/SwipeRecyclerView/69aa14d05da09beaeb880240c62f7de6f4f1bb39/xSample/src/main/res/drawable-xxxhdpi/ic_action_drop_start_black.png
--------------------------------------------------------------------------------
/xSample/src/main/res/drawable-xxxhdpi/ic_action_drop_start_white.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yanzhenjie/SwipeRecyclerView/69aa14d05da09beaeb880240c62f7de6f4f1bb39/xSample/src/main/res/drawable-xxxhdpi/ic_action_drop_start_white.png
--------------------------------------------------------------------------------
/xSample/src/main/res/drawable/select_expandable_black.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/xSample/src/main/res/drawable/select_white.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/xSample/src/main/res/drawable/selector_green.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/xSample/src/main/res/drawable/selector_purple.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/xSample/src/main/res/drawable/selector_red.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/xSample/src/main/res/layout/activity_group_menu.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
23 |
24 |
25 |
26 |
31 |
32 |
36 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/xSample/src/main/res/layout/activity_refresh_loadmore.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
23 |
24 |
25 |
26 |
31 |
32 |
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/xSample/src/main/res/layout/activity_scroll.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
23 |
24 |
25 |
26 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/xSample/src/main/res/layout/fragment_menu.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
22 |
23 |
--------------------------------------------------------------------------------
/xSample/src/main/res/layout/item_drag_touch.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
23 |
24 |
35 |
36 |
45 |
46 |
57 |
58 |
--------------------------------------------------------------------------------
/xSample/src/main/res/layout/item_expand_child.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
24 |
25 |
33 |
34 |
--------------------------------------------------------------------------------
/xSample/src/main/res/layout/item_expand_parent.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
24 |
25 |
33 |
34 |
42 |
43 |
--------------------------------------------------------------------------------
/xSample/src/main/res/layout/item_menu_define.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
27 |
28 |
33 |
34 |
40 |
41 |
42 |
43 |
48 |
49 |
54 |
55 |
--------------------------------------------------------------------------------
/xSample/src/main/res/layout/item_menu_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
26 |
27 |
32 |
33 |
--------------------------------------------------------------------------------
/xSample/src/main/res/layout/item_menu_sticky.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
23 |
24 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/xSample/src/main/res/layout/item_menu_vertical.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
26 |
27 |
32 |
33 |
--------------------------------------------------------------------------------
/xSample/src/main/res/layout/layout_footer.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
24 |
--------------------------------------------------------------------------------
/xSample/src/main/res/layout/layout_fotter_loadmore.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
20 |
21 |
28 |
29 |
36 |
37 |
--------------------------------------------------------------------------------
/xSample/src/main/res/layout/layout_header.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
23 |
24 |
29 |
30 |
36 |
37 |
--------------------------------------------------------------------------------
/xSample/src/main/res/layout/layout_header_switch.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
23 |
24 |
29 |
30 |
37 |
38 |
--------------------------------------------------------------------------------
/xSample/src/main/res/layout/toolbar.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
23 |
24 |
30 |
31 |
--------------------------------------------------------------------------------
/xSample/src/main/res/layout/toolbar_scroll.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
23 |
24 |
31 |
32 |
--------------------------------------------------------------------------------
/xSample/src/main/res/menu/menu_all_activity.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
--------------------------------------------------------------------------------
/xSample/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yanzhenjie/SwipeRecyclerView/69aa14d05da09beaeb880240c62f7de6f4f1bb39/xSample/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/xSample/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yanzhenjie/SwipeRecyclerView/69aa14d05da09beaeb880240c62f7de6f4f1bb39/xSample/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/xSample/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yanzhenjie/SwipeRecyclerView/69aa14d05da09beaeb880240c62f7de6f4f1bb39/xSample/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/xSample/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yanzhenjie/SwipeRecyclerView/69aa14d05da09beaeb880240c62f7de6f4f1bb39/xSample/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/xSample/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yanzhenjie/SwipeRecyclerView/69aa14d05da09beaeb880240c62f7de6f4f1bb39/xSample/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/xSample/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yanzhenjie/SwipeRecyclerView/69aa14d05da09beaeb880240c62f7de6f4f1bb39/xSample/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/xSample/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yanzhenjie/SwipeRecyclerView/69aa14d05da09beaeb880240c62f7de6f4f1bb39/xSample/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/xSample/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yanzhenjie/SwipeRecyclerView/69aa14d05da09beaeb880240c62f7de6f4f1bb39/xSample/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/xSample/src/main/res/values/array.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 | - Item中的横竖菜单
20 | - Item的拖拽和侧滑删除
21 | - 添加Header和Footer
22 | - 下拉刷新和加载更多
23 | - 和滑动布局嵌套使用
24 | - 二级列表
25 | - Sticky分组效果
26 |
27 |
28 |
29 | - List形式菜单
30 | - Grid形式菜单
31 | - 根据ViewType定制菜单
32 | - 竖向排布的菜单
33 | - 自定义菜单
34 |
35 |
36 |
37 | - ListItem拖拽和侧滑删除
38 | - GridItem拖拽
39 | - 触摸即开始拖拽
40 | - 自定义拖拽参数(不同ViewType)
41 |
42 |
43 |
44 | - 默认LoadMoreView
45 | - 自定义LoadMoreView
46 |
47 |
48 |
49 | - 当Item是CardView时(特殊)
50 | - 和DrawerLayout嵌套使用
51 | - 和ViewPager嵌套使用
52 |
53 |
54 |
55 | - List形式
56 | - Grid形式
57 | - Staggered形式
58 |
59 |
60 |
61 | - 普通布局中Sticky
62 | - Item菜单Sticky分组
63 |
64 |
--------------------------------------------------------------------------------
/xSample/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 | #3F51B5
19 | #303F9F
20 | #FF4081
21 |
22 | #333333
23 |
24 | #FF0000
25 | #FF6666
26 | #37C000
27 | #30A070
28 | #9932CC
29 | #9F79EE
30 |
31 | #000000
32 | #FFFFFF
33 | #CFCFCF
34 |
35 | #B7B2B2
36 |
37 |
--------------------------------------------------------------------------------
/xSample/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 | 200dp
19 | 100dp
20 | 70dp
21 | 10dp
22 | 2dp
23 |
24 |
--------------------------------------------------------------------------------
/xSample/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 | SwipeRecyclerView
19 |
20 |
--------------------------------------------------------------------------------
/xSample/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------