├── app
├── .gitignore
├── src
│ ├── main
│ │ ├── res
│ │ │ ├── mipmap-xhdpi
│ │ │ │ ├── ic_header.png
│ │ │ │ ├── ic_launcher.png
│ │ │ │ ├── ic_left_logo.png
│ │ │ │ ├── ic_action_good.png
│ │ │ │ ├── ic_drag_handle.png
│ │ │ │ ├── ic_right_logo.png
│ │ │ │ ├── iconfont_downgrey.png
│ │ │ │ └── ic_action_favorite.png
│ │ │ ├── mipmap-hdpi
│ │ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-mdpi
│ │ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xxhdpi
│ │ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xxxhdpi
│ │ │ │ └── ic_launcher.png
│ │ │ ├── drawable
│ │ │ │ ├── meituan_iten_header_item_bg.xml
│ │ │ │ ├── shape_super_side_bar_bg.xml
│ │ │ │ └── xml_oval_half_transparent_bg.xml
│ │ │ ├── values
│ │ │ │ ├── dimens.xml
│ │ │ │ ├── styles.xml
│ │ │ │ ├── strings.xml
│ │ │ │ ├── colors.xml
│ │ │ │ └── arrays.xml
│ │ │ ├── values-w820dp
│ │ │ │ └── dimens.xml
│ │ │ ├── layout
│ │ │ │ ├── activity_ad_header_layout.xml
│ │ │ │ ├── activity_drag_layout.xml
│ │ │ │ ├── activity_layoutmanager_layout.xml
│ │ │ │ ├── activity_main.xml
│ │ │ │ ├── activity_swipemenu_layout.xml
│ │ │ │ ├── view_header_layout.xml
│ │ │ │ ├── activity_item_click_layout.xml
│ │ │ │ ├── activity_multi_item_layout.xml
│ │ │ │ ├── activity_refresh_load_layout.xml
│ │ │ │ ├── view_recycle_empty_view.xml
│ │ │ │ ├── view_footer_layout.xml
│ │ │ │ ├── adapter_meituan_header_layout.xml
│ │ │ │ ├── view_meituan_header_layout.xml
│ │ │ │ ├── adapter_swipemenu_layout.xml
│ │ │ │ ├── adapter_swipemenu1_layout.xml
│ │ │ │ ├── adapter_animation_layout.xml
│ │ │ │ ├── adapter_multi_item3_layout.xml
│ │ │ │ ├── adapter_header_footer_layout.xml
│ │ │ │ ├── activity_animation_layout.xml
│ │ │ │ ├── item_swipe_menu1.xml
│ │ │ │ ├── adapter_wechat_layout.xml
│ │ │ │ ├── item_swipe_menu.xml
│ │ │ │ ├── adapter_main_layout.xml
│ │ │ │ ├── adapter_manager_layout.xml
│ │ │ │ ├── adapter_refresh_load_layout.xml
│ │ │ │ ├── activity_wechat_layout.xml
│ │ │ │ ├── activity_slide_meituan_layout.xml
│ │ │ │ ├── activity_slide_swipe_menu_layout.xml
│ │ │ │ ├── adapter_multi_item1_layout.xml
│ │ │ │ ├── activity_header_footer_layout.xml
│ │ │ │ ├── adapter_item_click_layout.xml
│ │ │ │ ├── item_swipe_menu_content.xml
│ │ │ │ ├── activity_sidebar_layout.xml
│ │ │ │ ├── adapter_draggable_layout.xml
│ │ │ │ ├── adapter_multi_item2_layout.xml
│ │ │ │ └── adapter_slide_swipe_menu_layout.xml
│ │ │ └── menu
│ │ │ │ └── main.xml
│ │ ├── java
│ │ │ └── com
│ │ │ │ └── superrecycleview
│ │ │ │ └── library
│ │ │ │ ├── bean
│ │ │ │ ├── MultipleItemBean.java
│ │ │ │ └── sidebar
│ │ │ │ │ ├── WeChatBean.java
│ │ │ │ │ └── MeituanHeaderBean.java
│ │ │ │ ├── adapter
│ │ │ │ ├── sidebar
│ │ │ │ │ ├── HeaderAdapter.java
│ │ │ │ │ ├── WeChatAdapter.java
│ │ │ │ │ ├── MeiTuanAdapter1.java
│ │ │ │ │ ├── SlideSwipeAdapter.java
│ │ │ │ │ ├── MeituanHeaderAdapter.java
│ │ │ │ │ └── MeiTuanAdapter.java
│ │ │ │ ├── AnimationAdapter.java
│ │ │ │ ├── MainAdapter.java
│ │ │ │ ├── DragAdapter.java
│ │ │ │ ├── HeaderFooterAdapter.java
│ │ │ │ ├── LayoutMannagerAdapter.java
│ │ │ │ ├── RefreshAndLoadMoreAdapter.java
│ │ │ │ ├── ItemClickAdapter.java
│ │ │ │ ├── MultiItemAdapter.java
│ │ │ │ └── SwipeMenuAdapter.java
│ │ │ │ ├── utils
│ │ │ │ ├── ColorUtil.java
│ │ │ │ └── DensityUtil.java
│ │ │ │ ├── ui
│ │ │ │ ├── SideBarActivity.java
│ │ │ │ ├── AnimationActivity.java
│ │ │ │ └── RefreshAndLoadMoreActivity.java
│ │ │ │ └── MainActivity.java
│ │ └── AndroidManifest.xml
│ ├── test
│ │ └── java
│ │ │ └── com
│ │ │ └── superrecycleview
│ │ │ └── library
│ │ │ └── ExampleUnitTest.java
│ └── androidTest
│ │ └── java
│ │ └── com
│ │ └── superrecycleview
│ │ └── library
│ │ └── ApplicationTest.java
├── proguard-rules.pro
└── build.gradle
├── settings.gradle
├── superlibrary
├── .gitignore
├── src
│ ├── main
│ │ ├── res
│ │ │ ├── mipmap-xhdpi
│ │ │ │ ├── loading_01.png
│ │ │ │ ├── loading_02.png
│ │ │ │ ├── loading_03.png
│ │ │ │ ├── loading_04.png
│ │ │ │ ├── loading_05.png
│ │ │ │ ├── loading_06.png
│ │ │ │ ├── loading_07.png
│ │ │ │ ├── loading_08.png
│ │ │ │ ├── loading_09.png
│ │ │ │ ├── loading_10.png
│ │ │ │ ├── loading_11.png
│ │ │ │ ├── loading_12.png
│ │ │ │ ├── ic_loading_rotate.png
│ │ │ │ ├── ic_pulltorefresh_arrow.png
│ │ │ │ └── bga_adapter_divider_bitmap.png
│ │ │ ├── drawable
│ │ │ │ ├── progressloading.xml
│ │ │ │ ├── bga_adapter_divider_shape.xml
│ │ │ │ └── progressbar.xml
│ │ │ ├── values
│ │ │ │ ├── ids.xml
│ │ │ │ ├── strings.xml
│ │ │ │ └── attrs.xml
│ │ │ └── layout
│ │ │ │ ├── listview_footer.xml
│ │ │ │ └── listview_header.xml
│ │ ├── AndroidManifest.xml
│ │ └── java
│ │ │ └── com
│ │ │ └── superrecycleview
│ │ │ └── superlibrary
│ │ │ ├── adapter
│ │ │ ├── AnimationType.java
│ │ │ └── AnimationUtil.java
│ │ │ ├── callback
│ │ │ ├── ISuspensionInterface.java
│ │ │ └── OnItemDragListener.java
│ │ │ ├── recycleview
│ │ │ ├── BaseRefreshHeader.java
│ │ │ ├── progressindicator
│ │ │ │ └── indicator
│ │ │ │ │ ├── LineSpinFadeLoaderIndicator.java
│ │ │ │ │ ├── SemiCircleSpinIndicator.java
│ │ │ │ │ ├── LineScalePulseOutIndicator.java
│ │ │ │ │ ├── LineScalePulseOutRapidIndicator.java
│ │ │ │ │ ├── SquareSpinIndicator.java
│ │ │ │ │ ├── BallPulseRiseIndicator.java
│ │ │ │ │ ├── TriangleSkewSpinIndicator.java
│ │ │ │ │ ├── BallScaleRippleIndicator.java
│ │ │ │ │ ├── BallPulseSyncIndicator.java
│ │ │ │ │ ├── LineScaleIndicator.java
│ │ │ │ │ ├── BallScaleIndicator.java
│ │ │ │ │ ├── BallPulseIndicator.java
│ │ │ │ │ ├── LineScalePartyIndicator.java
│ │ │ │ │ ├── BallRotateIndicator.java
│ │ │ │ │ ├── BallClipRotateIndicator.java
│ │ │ │ │ ├── BallScaleRippleMultipleIndicator.java
│ │ │ │ │ ├── BallGridBeatIndicator.java
│ │ │ │ │ ├── BallZigZagDeflectIndicator.java
│ │ │ │ │ ├── BaseIndicatorController.java
│ │ │ │ │ ├── BallScaleMultipleIndicator.java
│ │ │ │ │ ├── BallBeatIndicator.java
│ │ │ │ │ ├── BallZigZagIndicator.java
│ │ │ │ │ ├── BallClipRotateMultipleIndicator.java
│ │ │ │ │ ├── BallClipRotatePulseIndicator.java
│ │ │ │ │ ├── BallTrianglePathIndicator.java
│ │ │ │ │ └── BallGridPulseIndicator.java
│ │ │ ├── AppBarStateChangeListener.java
│ │ │ ├── ItemTouchHelperAdapter.java
│ │ │ ├── ProgressStyle.java
│ │ │ ├── SimpleViewSwitcher.java
│ │ │ ├── JellyView.java
│ │ │ ├── SimpleItemTouchHelperCallback.java
│ │ │ └── LoadingMoreFooter.java
│ │ │ └── sidebar
│ │ │ ├── bean
│ │ │ ├── BaseIndexBean.java
│ │ │ └── BaseIndexPinyinBean.java
│ │ │ └── helper
│ │ │ └── IIndexBarDataHelper.java
│ ├── test
│ │ └── java
│ │ │ └── com
│ │ │ └── superrecycleview
│ │ │ └── superlibrary
│ │ │ └── ExampleUnitTest.java
│ └── androidTest
│ │ └── java
│ │ └── com
│ │ └── superrecycleview
│ │ └── superlibrary
│ │ └── ApplicationTest.java
├── proguard-rules.pro
└── build.gradle
├── gif
├── drag.gif
├── change.gif
├── multitem.gif
├── animation.gif
└── swipemenu.gif
├── .idea
├── copyright
│ └── profiles_settings.xml
├── encodings.xml
├── vcs.xml
├── modules.xml
├── runConfigurations.xml
├── gradle.xml
├── compiler.xml
└── misc.xml
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── .gitignore
├── gradle.properties
└── gradlew.bat
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app', ':superlibrary'
2 |
--------------------------------------------------------------------------------
/superlibrary/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 | *.iml
3 | .idea
--------------------------------------------------------------------------------
/gif/drag.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/supercwn/SuperRecycleView/HEAD/gif/drag.gif
--------------------------------------------------------------------------------
/gif/change.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/supercwn/SuperRecycleView/HEAD/gif/change.gif
--------------------------------------------------------------------------------
/gif/multitem.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/supercwn/SuperRecycleView/HEAD/gif/multitem.gif
--------------------------------------------------------------------------------
/gif/animation.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/supercwn/SuperRecycleView/HEAD/gif/animation.gif
--------------------------------------------------------------------------------
/gif/swipemenu.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/supercwn/SuperRecycleView/HEAD/gif/swipemenu.gif
--------------------------------------------------------------------------------
/.idea/copyright/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/supercwn/SuperRecycleView/HEAD/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | /.idea/workspace.xml
5 | /.idea/libraries
6 | .DS_Store
7 | /build
8 | /captures
9 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_header.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/supercwn/SuperRecycleView/HEAD/app/src/main/res/mipmap-xhdpi/ic_header.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/supercwn/SuperRecycleView/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/supercwn/SuperRecycleView/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/supercwn/SuperRecycleView/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_left_logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/supercwn/SuperRecycleView/HEAD/app/src/main/res/mipmap-xhdpi/ic_left_logo.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/supercwn/SuperRecycleView/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_action_good.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/supercwn/SuperRecycleView/HEAD/app/src/main/res/mipmap-xhdpi/ic_action_good.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_drag_handle.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/supercwn/SuperRecycleView/HEAD/app/src/main/res/mipmap-xhdpi/ic_drag_handle.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_right_logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/supercwn/SuperRecycleView/HEAD/app/src/main/res/mipmap-xhdpi/ic_right_logo.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/supercwn/SuperRecycleView/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/iconfont_downgrey.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/supercwn/SuperRecycleView/HEAD/app/src/main/res/mipmap-xhdpi/iconfont_downgrey.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_action_favorite.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/supercwn/SuperRecycleView/HEAD/app/src/main/res/mipmap-xhdpi/ic_action_favorite.png
--------------------------------------------------------------------------------
/superlibrary/src/main/res/mipmap-xhdpi/loading_01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/supercwn/SuperRecycleView/HEAD/superlibrary/src/main/res/mipmap-xhdpi/loading_01.png
--------------------------------------------------------------------------------
/superlibrary/src/main/res/mipmap-xhdpi/loading_02.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/supercwn/SuperRecycleView/HEAD/superlibrary/src/main/res/mipmap-xhdpi/loading_02.png
--------------------------------------------------------------------------------
/superlibrary/src/main/res/mipmap-xhdpi/loading_03.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/supercwn/SuperRecycleView/HEAD/superlibrary/src/main/res/mipmap-xhdpi/loading_03.png
--------------------------------------------------------------------------------
/superlibrary/src/main/res/mipmap-xhdpi/loading_04.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/supercwn/SuperRecycleView/HEAD/superlibrary/src/main/res/mipmap-xhdpi/loading_04.png
--------------------------------------------------------------------------------
/superlibrary/src/main/res/mipmap-xhdpi/loading_05.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/supercwn/SuperRecycleView/HEAD/superlibrary/src/main/res/mipmap-xhdpi/loading_05.png
--------------------------------------------------------------------------------
/superlibrary/src/main/res/mipmap-xhdpi/loading_06.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/supercwn/SuperRecycleView/HEAD/superlibrary/src/main/res/mipmap-xhdpi/loading_06.png
--------------------------------------------------------------------------------
/superlibrary/src/main/res/mipmap-xhdpi/loading_07.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/supercwn/SuperRecycleView/HEAD/superlibrary/src/main/res/mipmap-xhdpi/loading_07.png
--------------------------------------------------------------------------------
/superlibrary/src/main/res/mipmap-xhdpi/loading_08.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/supercwn/SuperRecycleView/HEAD/superlibrary/src/main/res/mipmap-xhdpi/loading_08.png
--------------------------------------------------------------------------------
/superlibrary/src/main/res/mipmap-xhdpi/loading_09.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/supercwn/SuperRecycleView/HEAD/superlibrary/src/main/res/mipmap-xhdpi/loading_09.png
--------------------------------------------------------------------------------
/superlibrary/src/main/res/mipmap-xhdpi/loading_10.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/supercwn/SuperRecycleView/HEAD/superlibrary/src/main/res/mipmap-xhdpi/loading_10.png
--------------------------------------------------------------------------------
/superlibrary/src/main/res/mipmap-xhdpi/loading_11.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/supercwn/SuperRecycleView/HEAD/superlibrary/src/main/res/mipmap-xhdpi/loading_11.png
--------------------------------------------------------------------------------
/superlibrary/src/main/res/mipmap-xhdpi/loading_12.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/supercwn/SuperRecycleView/HEAD/superlibrary/src/main/res/mipmap-xhdpi/loading_12.png
--------------------------------------------------------------------------------
/superlibrary/src/main/res/mipmap-xhdpi/ic_loading_rotate.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/supercwn/SuperRecycleView/HEAD/superlibrary/src/main/res/mipmap-xhdpi/ic_loading_rotate.png
--------------------------------------------------------------------------------
/superlibrary/src/main/res/mipmap-xhdpi/ic_pulltorefresh_arrow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/supercwn/SuperRecycleView/HEAD/superlibrary/src/main/res/mipmap-xhdpi/ic_pulltorefresh_arrow.png
--------------------------------------------------------------------------------
/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/superlibrary/src/main/res/mipmap-xhdpi/bga_adapter_divider_bitmap.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/supercwn/SuperRecycleView/HEAD/superlibrary/src/main/res/mipmap-xhdpi/bga_adapter_divider_bitmap.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/meituan_iten_header_item_bg.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/shape_super_side_bar_bg.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 16dp
4 | 16dp
5 |
6 |
--------------------------------------------------------------------------------
/superlibrary/src/main/res/drawable/progressloading.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/xml_oval_half_transparent_bg.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Wed Apr 26 11:38:03 CST 2017
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
7 |
--------------------------------------------------------------------------------
/superlibrary/src/main/res/drawable/bga_adapter_divider_shape.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
8 |
--------------------------------------------------------------------------------
/superlibrary/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/superlibrary/src/main/java/com/superrecycleview/superlibrary/adapter/AnimationType.java:
--------------------------------------------------------------------------------
1 | package com.superrecycleview.superlibrary.adapter;
2 |
3 | /**
4 | * Created by super南仔 on 07/28/16.
5 | * blog: http://supercwn.github.io/
6 | * GitHub: https://github.com/supercwn
7 | */
8 | public enum AnimationType {
9 | ALPHA, SCALE, SLIDE_FROM_BOTTOM, SLIDE_FROM_LEFT, SLIDE_FROM_RIGHT
10 | }
11 |
--------------------------------------------------------------------------------
/app/src/main/res/values-w820dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 64dp
6 |
7 |
--------------------------------------------------------------------------------
/superlibrary/src/main/res/values/ids.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/app/src/test/java/com/superrecycleview/library/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.superrecycleview.library;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * To work on unit tests, switch the Test Artifact in the Build Variants view.
9 | */
10 | public class ExampleUnitTest {
11 | @Test
12 | public void addition_isCorrect() throws Exception {
13 | assertEquals(4, 2 + 2);
14 | }
15 | }
--------------------------------------------------------------------------------
/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | SuperRecycleView
3 |
4 | Alpha
5 | Scale
6 | Slide from left
7 | Slide from right
8 | GitHub
9 | Slide from bottom
10 |
11 |
--------------------------------------------------------------------------------
/superlibrary/src/test/java/com/superrecycleview/superlibrary/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.superrecycleview.superlibrary;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * To work on unit tests, switch the Test Artifact in the Build Variants view.
9 | */
10 | public class ExampleUnitTest {
11 | @Test
12 | public void addition_isCorrect() throws Exception {
13 | assertEquals(4, 2 + 2);
14 | }
15 | }
--------------------------------------------------------------------------------
/superlibrary/src/main/java/com/superrecycleview/superlibrary/callback/ISuspensionInterface.java:
--------------------------------------------------------------------------------
1 |
2 | package com.superrecycleview.superlibrary.callback;
3 |
4 | /**
5 | * 介绍:分类悬停的接口 作者:zhangxutong 邮箱:mcxtzhang@163.com
6 | * 主页:http://blog.csdn.net/zxt0601 时间: 2016/11/7.
7 | */
8 |
9 | public interface ISuspensionInterface {
10 | // 是否需要显示悬停title
11 | boolean isShowSuspension();
12 |
13 | // 悬停的title
14 | String getSuspensionTag();
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3F51B5
4 | #303F9F
5 | #FF4081
6 |
7 | #ffffff
8 | #00000000
9 | #8f000000
10 | #f27242
11 |
12 |
--------------------------------------------------------------------------------
/app/src/androidTest/java/com/superrecycleview/library/ApplicationTest.java:
--------------------------------------------------------------------------------
1 | package com.superrecycleview.library;
2 |
3 | import android.app.Application;
4 | import android.test.ApplicationTestCase;
5 |
6 | /**
7 | * Testing Fundamentals
8 | */
9 | public class ApplicationTest extends ApplicationTestCase {
10 | public ApplicationTest() {
11 | super(Application.class);
12 | }
13 | }
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_ad_header_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/superlibrary/src/main/java/com/superrecycleview/superlibrary/recycleview/BaseRefreshHeader.java:
--------------------------------------------------------------------------------
1 | package com.superrecycleview.superlibrary.recycleview;
2 |
3 | /**
4 | * Created by Jack on 2015/10/19.
5 | */
6 | interface BaseRefreshHeader {
7 |
8 | int STATE_NORMAL = 0;
9 | int STATE_RELEASE_TO_REFRESH = 1;
10 | int STATE_REFRESHING = 2;
11 | int STATE_DONE = 3;
12 |
13 | void onMove(float delta);
14 |
15 | boolean releaseAction();
16 |
17 | void refreshComplete();
18 |
19 | }
--------------------------------------------------------------------------------
/superlibrary/src/androidTest/java/com/superrecycleview/superlibrary/ApplicationTest.java:
--------------------------------------------------------------------------------
1 | package com.superrecycleview.superlibrary;
2 |
3 | import android.app.Application;
4 | import android.test.ApplicationTestCase;
5 |
6 | /**
7 | * Testing Fundamentals
8 | */
9 | public class ApplicationTest extends ApplicationTestCase {
10 | public ApplicationTest() {
11 | super(Application.class);
12 | }
13 | }
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_drag_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_layoutmanager_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_swipemenu_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
10 |
11 |
--------------------------------------------------------------------------------
/superlibrary/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | SuperLibrary
3 |
4 | 下拉刷新
5 | 释放立即刷新
6 | 正在加载
7 | 没有了
8 | 正在刷新
9 | 刷新完成
10 | 上次更新时间:
11 |
12 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/view_header_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_item_click_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_multi_item_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_refresh_load_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/view_recycle_empty_view.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/view_footer_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/adapter_meituan_header_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/.idea/runConfigurations.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/view_meituan_header_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
14 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/adapter_swipemenu_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
9 |
10 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/adapter_swipemenu1_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
9 |
10 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/superlibrary/src/main/java/com/superrecycleview/superlibrary/callback/OnItemDragListener.java:
--------------------------------------------------------------------------------
1 | package com.superrecycleview.superlibrary.callback;
2 |
3 | import android.support.v7.widget.RecyclerView;
4 |
5 | /**
6 | * Created by super南仔 on 07/28/16.
7 | * blog: http://supercwn.github.io/
8 | * GitHub: https://github.com/supercwn
9 | */
10 | public interface OnItemDragListener {
11 | void onItemDragStart(RecyclerView.ViewHolder viewHolder, int pos);
12 | void onItemDragMoving(RecyclerView.ViewHolder source, int from, RecyclerView.ViewHolder target, int to);
13 | void onItemDragEnd(RecyclerView.ViewHolder viewHolder, int pos);
14 |
15 | }
16 |
--------------------------------------------------------------------------------
/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in D:\android_sdk\sdk/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/adapter_animation_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/superlibrary/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in D:\android_sdk\sdk/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/.idea/gradle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/.idea/compiler.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/superlibrary/src/main/res/layout/listview_footer.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
13 |
20 |
21 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/adapter_multi_item3_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
20 |
21 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/adapter_header_footer_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
9 |
10 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/app/src/main/java/com/superrecycleview/library/bean/MultipleItemBean.java:
--------------------------------------------------------------------------------
1 | package com.superrecycleview.library.bean;
2 |
3 | /**
4 | * Created by super南仔 on 07/28/16.
5 | * blog: http://supercwn.github.io/
6 | * GitHub: https://github.com/supercwn
7 | */
8 | public class MultipleItemBean {
9 |
10 | private int type;
11 | private String name;
12 | private String info;
13 |
14 | public int getType() {
15 | return type;
16 | }
17 |
18 | public void setType(int type) {
19 | this.type = type;
20 | }
21 |
22 | public String getName() {
23 | return name;
24 | }
25 |
26 | public void setName(String name) {
27 | this.name = name;
28 | }
29 |
30 | public String getInfo() {
31 | return info;
32 | }
33 |
34 | public void setInfo(String info) {
35 | this.info = info;
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_animation_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
11 |
12 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | ## Project-wide Gradle settings.
2 | #
3 | # For more details on how to configure your build environment visit
4 | # http://www.gradle.org/docs/current/userguide/build_environment.html
5 | #
6 | # Specifies the JVM arguments used for the daemon process.
7 | # The setting is particularly useful for tweaking memory settings.
8 | # Default value: -Xmx10248m -XX:MaxPermSize=256m
9 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
10 | #
11 | # When configured, Gradle will run in incubating parallel mode.
12 | # This option should only be used with decoupled projects. More details, visit
13 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
14 | # org.gradle.parallel=true
15 | #Fri Jul 29 10:11:41 CST 2016
16 | systemProp.http.proxyHost=121.199.4.166
17 | systemProp.http.proxyPort=7000
18 |
--------------------------------------------------------------------------------
/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 24
5 | buildToolsVersion '25.0.0'
6 |
7 | defaultConfig {
8 | applicationId "com.superrecycleview.library"
9 | minSdkVersion 14
10 | targetSdkVersion 24
11 | versionCode 1
12 | versionName "1.0"
13 | }
14 | buildTypes {
15 | release {
16 | minifyEnabled false
17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
18 | }
19 | }
20 | }
21 |
22 | dependencies {
23 | compile fileTree(dir: 'libs', include: ['*.jar'])
24 | testCompile 'junit:junit:4.12'
25 | compile 'com.android.support:appcompat-v7:24.1.0'
26 | compile 'com.android.support:cardview-v7:24.1.0'
27 | compile 'com.github.CymChad:BaseRecyclerViewAdapterHelper:2.9.15'
28 | compile project(':superlibrary')
29 | }
30 |
--------------------------------------------------------------------------------
/superlibrary/src/main/java/com/superrecycleview/superlibrary/sidebar/bean/BaseIndexBean.java:
--------------------------------------------------------------------------------
1 |
2 | package com.superrecycleview.superlibrary.sidebar.bean;
3 |
4 | import com.superrecycleview.superlibrary.callback.ISuspensionInterface;
5 |
6 | /**
7 | * 介绍:索引类的标志位的实体基类 作者:zhangxutong 邮箱:mcxtzhang@163.com
8 | * CSDN:http://blog.csdn.net/zxt0601 时间: 16/09/04.
9 | */
10 |
11 | public abstract class BaseIndexBean implements ISuspensionInterface {
12 | private String baseIndexTag;// 所属的分类(城市的汉语拼音首字母)
13 |
14 | public String getBaseIndexTag() {
15 | return baseIndexTag;
16 | }
17 |
18 | public BaseIndexBean setBaseIndexTag(String baseIndexTag) {
19 | this.baseIndexTag = baseIndexTag;
20 | return this;
21 | }
22 |
23 | @Override
24 | public String getSuspensionTag() {
25 | return baseIndexTag;
26 | }
27 |
28 | @Override
29 | public boolean isShowSuspension() {
30 | return true;
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/superlibrary/src/main/java/com/superrecycleview/superlibrary/sidebar/bean/BaseIndexPinyinBean.java:
--------------------------------------------------------------------------------
1 |
2 | package com.superrecycleview.superlibrary.sidebar.bean;
3 |
4 | /**
5 | * 介绍:索引类的汉语拼音的接口 作者:zhangxutong 邮箱:mcxtzhang@163.com
6 | * CSDN:http://blog.csdn.net/zxt0601 时间: 16/09/04.
7 | */
8 |
9 | public abstract class BaseIndexPinyinBean extends BaseIndexBean {
10 | private String baseIndexPinyin;// 城市的拼音
11 |
12 | public String getBaseIndexPinyin() {
13 | return baseIndexPinyin;
14 | }
15 |
16 | public BaseIndexPinyinBean setBaseIndexPinyin(String baseIndexPinyin) {
17 | this.baseIndexPinyin = baseIndexPinyin;
18 | return this;
19 | }
20 |
21 | // 是否需要被转化成拼音, 类似微信头部那种就不需要 美团的也不需要
22 | // 微信的头部 不需要显示索引
23 | // 美团的头部 索引自定义
24 | // 默认应该是需要的
25 | public boolean isNeedToPinyin() {
26 | return true;
27 | }
28 |
29 | // 需要转化成拼音的目标字段
30 | public abstract String getTarget();
31 |
32 | }
33 |
--------------------------------------------------------------------------------
/app/src/main/java/com/superrecycleview/library/adapter/sidebar/HeaderAdapter.java:
--------------------------------------------------------------------------------
1 |
2 | package com.superrecycleview.library.adapter.sidebar;
3 |
4 | import android.content.Context;
5 |
6 | import com.superrecycleview.library.R;
7 | import com.superrecycleview.superlibrary.adapter.BaseViewHolder;
8 | import com.superrecycleview.superlibrary.adapter.SuperBaseAdapter;
9 |
10 | import java.util.List;
11 |
12 | /**
13 | * Created by super南仔 on 2017-05-09. 类备注: 需要传入的参数:
14 | */
15 | public class HeaderAdapter extends SuperBaseAdapter {
16 |
17 | public HeaderAdapter(Context context, List data) {
18 | super(context, data);
19 | }
20 |
21 | @Override
22 | protected void convert(BaseViewHolder holder, String item, int position) {
23 | holder.setText(R.id.tvName, item);
24 | }
25 |
26 | @Override
27 | protected int getItemViewLayoutId(int position, String item) {
28 | return R.layout.adapter_meituan_header_layout;
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/app/src/main/java/com/superrecycleview/library/adapter/AnimationAdapter.java:
--------------------------------------------------------------------------------
1 | package com.superrecycleview.library.adapter;
2 |
3 |
4 | import android.content.Context;
5 |
6 | import com.superrecycleview.library.R;
7 | import com.superrecycleview.superlibrary.adapter.BaseViewHolder;
8 | import com.superrecycleview.superlibrary.adapter.SuperBaseAdapter;
9 |
10 | import java.util.List;
11 |
12 | /**
13 | * Created by super南仔 on 07/28/16.
14 | * blog: http://supercwn.github.io/
15 | * GitHub: https://github.com/supercwn
16 | */
17 | public class AnimationAdapter extends SuperBaseAdapter {
18 |
19 |
20 | public AnimationAdapter(Context context, List data) {
21 | super(context, data);
22 | }
23 |
24 | @Override
25 | protected void convert(BaseViewHolder holder, String item, int position) {
26 |
27 | }
28 |
29 | @Override
30 | protected int getItemViewLayoutId(int position, String item) {
31 | return R.layout.adapter_animation_layout;
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/app/src/main/java/com/superrecycleview/library/adapter/MainAdapter.java:
--------------------------------------------------------------------------------
1 |
2 | package com.superrecycleview.library.adapter;
3 |
4 | import android.content.Context;
5 |
6 | import com.superrecycleview.library.R;
7 | import com.superrecycleview.superlibrary.adapter.BaseViewHolder;
8 | import com.superrecycleview.superlibrary.adapter.SuperBaseAdapter;
9 |
10 | import java.util.List;
11 |
12 | /**
13 | * Created by super南仔 on 07/28/16. blog: http://supercwn.github.io/ GitHub:
14 | * https://github.com/supercwn
15 | */
16 | public class MainAdapter extends SuperBaseAdapter {
17 |
18 | public MainAdapter(Context context, List data) {
19 | super(context, data);
20 | }
21 |
22 | @Override
23 | protected void convert(BaseViewHolder holder, String item, int position) {
24 | holder.setText(R.id.info_text, item);
25 | }
26 |
27 | @Override
28 | protected int getItemViewLayoutId(int position, String item) {
29 | return R.layout.adapter_main_layout;
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/app/src/main/java/com/superrecycleview/library/adapter/DragAdapter.java:
--------------------------------------------------------------------------------
1 | package com.superrecycleview.library.adapter;
2 |
3 | import android.content.Context;
4 |
5 | import com.superrecycleview.library.R;
6 | import com.superrecycleview.superlibrary.adapter.BaseViewHolder;
7 | import com.superrecycleview.superlibrary.adapter.SuperBaseDragAdapter;
8 |
9 | import java.util.List;
10 |
11 | /**
12 | * Created by super南仔 on 07/28/16.
13 | * blog: http://supercwn.github.io/
14 | * GitHub: https://github.com/supercwn
15 | */
16 | public class DragAdapter extends SuperBaseDragAdapter {
17 | public DragAdapter(Context context, List data) {
18 | super(context, data);
19 | }
20 |
21 | @Override
22 | protected void convert(BaseViewHolder holder, String item, int position) {
23 | holder.setText(R.id.tv,item);
24 | }
25 |
26 | @Override
27 | protected int getItemViewLayoutId(int position, String item) {
28 | return R.layout.adapter_draggable_layout;
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_swipe_menu1.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
16 |
17 |
26 |
--------------------------------------------------------------------------------
/app/src/main/java/com/superrecycleview/library/adapter/HeaderFooterAdapter.java:
--------------------------------------------------------------------------------
1 | package com.superrecycleview.library.adapter;
2 |
3 | import android.content.Context;
4 |
5 | import com.superrecycleview.library.R;
6 | import com.superrecycleview.superlibrary.adapter.BaseViewHolder;
7 | import com.superrecycleview.superlibrary.adapter.SuperBaseAdapter;
8 |
9 | import java.util.List;
10 |
11 | /**
12 | * Created by super南仔 on 07/28/16.
13 | * blog: http://supercwn.github.io/
14 | * GitHub: https://github.com/supercwn
15 | */
16 | public class HeaderFooterAdapter extends SuperBaseAdapter {
17 |
18 | public HeaderFooterAdapter(Context context, List data) {
19 | super(context, data);
20 | }
21 |
22 | @Override
23 | protected void convert(BaseViewHolder holder, String item, int position) {
24 | holder.setText(R.id.tv_info,item);
25 | }
26 |
27 | @Override
28 | protected int getItemViewLayoutId(int position, String item) {
29 | return R.layout.adapter_header_footer_layout;
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/app/src/main/java/com/superrecycleview/library/adapter/LayoutMannagerAdapter.java:
--------------------------------------------------------------------------------
1 |
2 | package com.superrecycleview.library.adapter;
3 |
4 | import android.content.Context;
5 |
6 | import com.superrecycleview.library.R;
7 | import com.superrecycleview.superlibrary.adapter.BaseViewHolder;
8 | import com.superrecycleview.superlibrary.adapter.SuperBaseAdapter;
9 |
10 | import java.util.List;
11 |
12 | /**
13 | * Created by super南仔 on 07/28/16. blog: http://supercwn.github.io/ GitHub:
14 | * https://github.com/supercwn
15 | */
16 | public class LayoutMannagerAdapter extends SuperBaseAdapter {
17 |
18 | public LayoutMannagerAdapter(Context context, List data) {
19 | super(context, data);
20 | }
21 |
22 | @Override
23 | protected void convert(BaseViewHolder holder, String item, int position) {
24 | holder.setText(R.id.info_text, item);
25 | }
26 |
27 | @Override
28 | protected int getItemViewLayoutId(int position, String item) {
29 | return R.layout.adapter_manager_layout;
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/superlibrary/src/main/java/com/superrecycleview/superlibrary/sidebar/helper/IIndexBarDataHelper.java:
--------------------------------------------------------------------------------
1 |
2 | package com.superrecycleview.superlibrary.sidebar.helper;
3 |
4 | import com.superrecycleview.superlibrary.sidebar.bean.BaseIndexPinyinBean;
5 |
6 | import java.util.List;
7 |
8 | /**
9 | * 介绍:IndexBar 的 数据相关帮助类 1 将汉语转成拼音 2 填充indexTag 3 排序源数据源 4
10 | * 根据排序后的源数据源->indexBar的数据源 作者:zhangxutong 邮箱:mcxtzhang@163.com
11 | * 主页:http://blog.csdn.net/zxt0601 时间: 2016/11/28.
12 | */
13 |
14 | public interface IIndexBarDataHelper {
15 | // 汉语-》拼音
16 | IIndexBarDataHelper convert(List extends BaseIndexPinyinBean> data);
17 |
18 | // 拼音->tag
19 | IIndexBarDataHelper fillInexTag(List extends BaseIndexPinyinBean> data);
20 |
21 | // 对源数据进行排序(RecyclerView)
22 | IIndexBarDataHelper sortSourceDatas(List extends BaseIndexPinyinBean> datas);
23 |
24 | // 对IndexBar的数据源进行排序(右侧栏),在 sortSourceDatas 方法后调用
25 | IIndexBarDataHelper getSortedIndexDatas(List extends BaseIndexPinyinBean> sourceDatas,
26 | List datas);
27 | }
28 |
--------------------------------------------------------------------------------
/app/src/main/java/com/superrecycleview/library/adapter/RefreshAndLoadMoreAdapter.java:
--------------------------------------------------------------------------------
1 |
2 | package com.superrecycleview.library.adapter;
3 |
4 | import android.content.Context;
5 |
6 | import com.superrecycleview.library.R;
7 | import com.superrecycleview.superlibrary.adapter.BaseViewHolder;
8 | import com.superrecycleview.superlibrary.adapter.SuperBaseAdapter;
9 |
10 | import java.util.List;
11 |
12 | /**
13 | * Created by super南仔 on 07/28/16. blog: http://supercwn.github.io/ GitHub:
14 | * https://github.com/supercwn
15 | */
16 | public class RefreshAndLoadMoreAdapter extends SuperBaseAdapter {
17 |
18 | public RefreshAndLoadMoreAdapter(Context context, List data) {
19 | super(context, data);
20 | }
21 |
22 | @Override
23 | protected void convert(BaseViewHolder holder, String item, int position) {
24 | holder.setText(R.id.info_text, item);
25 | }
26 |
27 | @Override
28 | protected int getItemViewLayoutId(int position, String item) {
29 | return R.layout.adapter_refresh_load_layout;
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/app/src/main/java/com/superrecycleview/library/adapter/sidebar/WeChatAdapter.java:
--------------------------------------------------------------------------------
1 |
2 | package com.superrecycleview.library.adapter.sidebar;
3 |
4 | import android.content.Context;
5 |
6 | import com.superrecycleview.library.R;
7 | import com.superrecycleview.library.bean.sidebar.WeChatBean;
8 | import com.superrecycleview.superlibrary.adapter.SuperBaseAdapter;
9 |
10 | import java.util.List;
11 |
12 | /**
13 | * Created by super南仔 on 2017-05-04. 类备注: 需要传入的参数:
14 | */
15 | public class WeChatAdapter extends SuperBaseAdapter {
16 |
17 | public WeChatAdapter(Context context, List data) {
18 | super(context, data);
19 | }
20 |
21 | @Override
22 | protected void convert(com.superrecycleview.superlibrary.adapter.BaseViewHolder holder,
23 | WeChatBean item, int position) {
24 | holder.setText(R.id.super_tv_name, item.getName());
25 | }
26 |
27 | @Override
28 | protected int getItemViewLayoutId(int position, WeChatBean item) {
29 | return R.layout.adapter_wechat_layout;
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/app/src/main/java/com/superrecycleview/library/bean/sidebar/WeChatBean.java:
--------------------------------------------------------------------------------
1 |
2 | package com.superrecycleview.library.bean.sidebar;
3 |
4 | import com.superrecycleview.superlibrary.sidebar.bean.BaseIndexPinyinBean;
5 |
6 | /**
7 | * Created by super南仔 on 2017-05-04. 类备注: 需要传入的参数:
8 | */
9 | public class WeChatBean extends BaseIndexPinyinBean {
10 |
11 | private String name;// 城市的名称
12 | private boolean isTop;// 是否是最上面 不需要被转化成拼音
13 |
14 | public String getName() {
15 | return name;
16 | }
17 |
18 | public void setName(String name) {
19 | this.name = name;
20 | }
21 |
22 | public boolean isTop() {
23 | return isTop;
24 | }
25 |
26 | public void setTop(boolean top) {
27 | isTop = top;
28 | }
29 |
30 | @Override
31 | public String getTarget() {
32 | return name;
33 | }
34 |
35 | @Override
36 | public boolean isNeedToPinyin() {
37 | return !isTop;
38 | }
39 |
40 | @Override
41 | public boolean isShowSuspension() {
42 | return !isTop;
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/app/src/main/java/com/superrecycleview/library/adapter/sidebar/MeiTuanAdapter1.java:
--------------------------------------------------------------------------------
1 |
2 | package com.superrecycleview.library.adapter.sidebar;
3 |
4 | import android.content.Context;
5 |
6 | import com.superrecycleview.library.R;
7 | import com.superrecycleview.library.bean.sidebar.WeChatBean;
8 | import com.superrecycleview.superlibrary.adapter.BaseViewHolder;
9 | import com.superrecycleview.superlibrary.adapter.SuperBaseAdapter;
10 |
11 | import java.util.List;
12 |
13 | /**
14 | * Created by super南仔 on 2017-05-09. 类备注: 需要传入的参数:
15 | */
16 | public class MeiTuanAdapter1 extends SuperBaseAdapter {
17 |
18 | public MeiTuanAdapter1(Context context, List data) {
19 | super(context, data);
20 | }
21 |
22 | @Override
23 | protected void convert(BaseViewHolder holder, WeChatBean item, int position) {
24 | holder.setText(R.id.super_tv_name, item.getName());
25 | }
26 |
27 | @Override
28 | protected int getItemViewLayoutId(int position, WeChatBean item) {
29 | return R.layout.adapter_wechat_layout;
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/main.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/superlibrary/src/main/res/drawable/progressbar.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/superlibrary/src/main/java/com/superrecycleview/superlibrary/recycleview/progressindicator/indicator/LineSpinFadeLoaderIndicator.java:
--------------------------------------------------------------------------------
1 | package com.superrecycleview.superlibrary.recycleview.progressindicator.indicator;
2 |
3 | import android.graphics.Canvas;
4 | import android.graphics.Paint;
5 | import android.graphics.RectF;
6 |
7 | /**
8 | * Created by Jack on 2015/10/19.
9 | */
10 | public class LineSpinFadeLoaderIndicator extends BallSpinFadeLoaderIndicator {
11 |
12 |
13 | @Override
14 | public void draw(Canvas canvas, Paint paint) {
15 | float radius=getWidth()/10;
16 | for (int i = 0; i < 8; i++) {
17 | canvas.save();
18 | Point point=circleAt(getWidth(),getHeight(),getWidth()/2.5f-radius,i*(Math.PI/4));
19 | canvas.translate(point.x, point.y);
20 | canvas.scale(scaleFloats[i], scaleFloats[i]);
21 | canvas.rotate(i*45);
22 | paint.setAlpha(alphas[i]);
23 | RectF rectF=new RectF(-radius,-radius/1.5f,1.5f*radius,radius/1.5f);
24 | canvas.drawRoundRect(rectF,5,5,paint);
25 | canvas.restore();
26 | }
27 | }
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/adapter_wechat_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
15 |
16 |
17 |
22 |
23 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_swipe_menu.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
19 |
31 |
--------------------------------------------------------------------------------
/superlibrary/src/main/java/com/superrecycleview/superlibrary/recycleview/progressindicator/indicator/SemiCircleSpinIndicator.java:
--------------------------------------------------------------------------------
1 | package com.superrecycleview.superlibrary.recycleview.progressindicator.indicator;
2 |
3 | import android.animation.Animator;
4 | import android.animation.ObjectAnimator;
5 | import android.graphics.Canvas;
6 | import android.graphics.Paint;
7 | import android.graphics.RectF;
8 |
9 | import java.util.ArrayList;
10 | import java.util.List;
11 |
12 | /**
13 | * Created by Jack on 2015/10/19.
14 | */
15 | public class SemiCircleSpinIndicator extends BaseIndicatorController {
16 |
17 |
18 | @Override
19 | public void draw(Canvas canvas, Paint paint) {
20 | RectF rectF=new RectF(0,0,getWidth(),getHeight());
21 | canvas.drawArc(rectF,-60,120,false,paint);
22 | }
23 |
24 | @Override
25 | public List createAnimation() {
26 | List animators=new ArrayList<>();
27 | ObjectAnimator rotateAnim= ObjectAnimator.ofFloat(getTarget(),"rotation",0,180,360);
28 | rotateAnim.setDuration(600);
29 | rotateAnim.setRepeatCount(-1);
30 | rotateAnim.start();
31 | animators.add(rotateAnim);
32 | return animators;
33 | }
34 |
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/adapter_main_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
18 |
19 |
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/adapter_manager_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
18 |
19 |
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/adapter_refresh_load_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
18 |
19 |
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/app/src/main/java/com/superrecycleview/library/adapter/ItemClickAdapter.java:
--------------------------------------------------------------------------------
1 | package com.superrecycleview.library.adapter;
2 |
3 | import android.content.Context;
4 |
5 | import com.superrecycleview.library.R;
6 | import com.superrecycleview.library.bean.MultipleItemBean;
7 | import com.superrecycleview.superlibrary.adapter.BaseViewHolder;
8 | import com.superrecycleview.superlibrary.adapter.SuperBaseAdapter;
9 |
10 | import java.util.List;
11 |
12 | /**
13 | * Created by super南仔 on 07/28/16.
14 | * blog: http://supercwn.github.io/
15 | * GitHub: https://github.com/supercwn
16 | */
17 | public class ItemClickAdapter extends SuperBaseAdapter {
18 |
19 | public ItemClickAdapter(Context context, List data) {
20 | super(context, data);
21 | }
22 |
23 | @Override
24 | protected void convert(BaseViewHolder holder, MultipleItemBean item, int position) {
25 | holder.setText(R.id.name_tv,item.getName())
26 | .setOnClickListener(R.id.name_tv,new OnItemChildClickListener())
27 | .setOnLongClickListener(R.id.image_iv,new OnItemChildLongClickListener());
28 | }
29 |
30 | @Override
31 | protected int getItemViewLayoutId(int position, MultipleItemBean item) {
32 | return R.layout.adapter_item_click_layout;
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_wechat_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
11 |
12 |
19 |
20 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_slide_meituan_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
11 |
12 |
19 |
20 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/app/src/main/res/values/arrays.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | - 广东
6 | - 北京
7 | - 福建
8 | - 浙江
9 | - 山东
10 | - 江苏
11 | - 河南
12 | - 安徽
13 | - 123
14 | - 重庆
15 | - 湖北
16 | - 湖南
17 | - 河北
18 | - 四川
19 | - 天津
20 | - 吉林
21 | - 黑龙江
22 | - 江西
23 | - 辽宁
24 | - 内蒙古
25 | - 宁夏
26 | - 青海
27 | - 山西
28 | - 陕西
29 | - 上海
30 | - 新疆
31 | - 西藏
32 | - 云南
33 | - 甘肃
34 | - 贵州
35 | - 广西
36 | - 海南
37 |
38 | - A
39 | - a
40 | - b
41 | - d
42 |
43 | - .a
44 | - ;b
45 | - #c
46 | - d
47 |
48 | - ab
49 |
50 |
51 |
52 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_slide_swipe_menu_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
11 |
12 |
19 |
20 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/superlibrary/src/main/java/com/superrecycleview/superlibrary/recycleview/AppBarStateChangeListener.java:
--------------------------------------------------------------------------------
1 | package com.superrecycleview.superlibrary.recycleview;
2 |
3 | import android.support.design.widget.AppBarLayout;
4 |
5 | /**
6 | * Created by Jack on 2015/10/19.
7 | */
8 | public abstract class AppBarStateChangeListener implements AppBarLayout.OnOffsetChangedListener {
9 |
10 | public enum State {
11 | EXPANDED,
12 | COLLAPSED,
13 | IDLE
14 | }
15 |
16 | private State mCurrentState = State.IDLE;
17 |
18 | @Override
19 | public final void onOffsetChanged(AppBarLayout appBarLayout, int i) {
20 | if (i == 0) {
21 | if (mCurrentState != State.EXPANDED) {
22 | onStateChanged(appBarLayout, State.EXPANDED);
23 | }
24 | mCurrentState = State.EXPANDED;
25 | } else if (Math.abs(i) >= appBarLayout.getTotalScrollRange()) {
26 | if (mCurrentState != State.COLLAPSED) {
27 | onStateChanged(appBarLayout, State.COLLAPSED);
28 | }
29 | mCurrentState = State.COLLAPSED;
30 | } else {
31 | if (mCurrentState != State.IDLE) {
32 | onStateChanged(appBarLayout, State.IDLE);
33 | }
34 | mCurrentState = State.IDLE;
35 | }
36 | }
37 | public abstract void onStateChanged(AppBarLayout appBarLayout, State state);
38 | }
39 |
40 |
--------------------------------------------------------------------------------
/superlibrary/src/main/java/com/superrecycleview/superlibrary/recycleview/progressindicator/indicator/LineScalePulseOutIndicator.java:
--------------------------------------------------------------------------------
1 | package com.superrecycleview.superlibrary.recycleview.progressindicator.indicator;
2 |
3 | import android.animation.Animator;
4 | import android.animation.ValueAnimator;
5 |
6 | import java.util.ArrayList;
7 | import java.util.List;
8 |
9 | /**
10 | * Created by Jack on 2015/10/19.
11 | */
12 | public class LineScalePulseOutIndicator extends LineScaleIndicator {
13 |
14 | @Override
15 | public List createAnimation() {
16 | List animators=new ArrayList<>();
17 | long[] delays=new long[]{500,250,0,250,500};
18 | for (int i = 0; i < 5; i++) {
19 | final int index=i;
20 | ValueAnimator scaleAnim= ValueAnimator.ofFloat(1,0.3f,1);
21 | scaleAnim.setDuration(900);
22 | scaleAnim.setRepeatCount(-1);
23 | scaleAnim.setStartDelay(delays[i]);
24 | scaleAnim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
25 | @Override
26 | public void onAnimationUpdate(ValueAnimator animation) {
27 | scaleYFloats[index] = (float) animation.getAnimatedValue();
28 | postInvalidate();
29 | }
30 | });
31 | scaleAnim.start();
32 | animators.add(scaleAnim);
33 | }
34 | return animators;
35 | }
36 |
37 | }
38 |
--------------------------------------------------------------------------------
/superlibrary/src/main/java/com/superrecycleview/superlibrary/recycleview/progressindicator/indicator/LineScalePulseOutRapidIndicator.java:
--------------------------------------------------------------------------------
1 | package com.superrecycleview.superlibrary.recycleview.progressindicator.indicator;
2 |
3 | import android.animation.Animator;
4 | import android.animation.ValueAnimator;
5 |
6 | import java.util.ArrayList;
7 | import java.util.List;
8 |
9 | /**
10 | * Created by Jack on 2015/10/19.
11 | */
12 | public class LineScalePulseOutRapidIndicator extends LineScaleIndicator {
13 |
14 | @Override
15 | public List createAnimation() {
16 | List animators=new ArrayList<>();
17 | long[] delays=new long[]{400,200,0,200,400};
18 | for (int i = 0; i < 5; i++) {
19 | final int index=i;
20 | ValueAnimator scaleAnim= ValueAnimator.ofFloat(1,0.4f,1);
21 | scaleAnim.setDuration(1000);
22 | scaleAnim.setRepeatCount(-1);
23 | scaleAnim.setStartDelay(delays[i]);
24 | scaleAnim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
25 | @Override
26 | public void onAnimationUpdate(ValueAnimator animation) {
27 | scaleYFloats[index] = (float) animation.getAnimatedValue();
28 | postInvalidate();
29 | }
30 | });
31 | scaleAnim.start();
32 | animators.add(scaleAnim);
33 | }
34 | return animators;
35 | }
36 |
37 | }
38 |
--------------------------------------------------------------------------------
/app/src/main/java/com/superrecycleview/library/adapter/sidebar/SlideSwipeAdapter.java:
--------------------------------------------------------------------------------
1 |
2 | package com.superrecycleview.library.adapter.sidebar;
3 |
4 | import android.content.Context;
5 |
6 | import com.superrecycleview.library.R;
7 | import com.superrecycleview.library.bean.sidebar.WeChatBean;
8 | import com.superrecycleview.superlibrary.adapter.BaseViewHolder;
9 | import com.superrecycleview.superlibrary.adapter.SuperBaseAdapter;
10 | import com.superrecycleview.superlibrary.recycleview.swipemenu.SuperSwipeMenuLayout;
11 |
12 | import java.util.List;
13 |
14 | /**
15 | * Created by super南仔 on 2017-05-04. 类备注: 需要传入的参数:
16 | */
17 | public class SlideSwipeAdapter extends SuperBaseAdapter {
18 |
19 | public SlideSwipeAdapter(Context context, List data) {
20 | super(context, data);
21 | }
22 |
23 | @Override
24 | protected void convert(BaseViewHolder holder, WeChatBean item, int position) {
25 | holder.setIsRecyclable(false);// 关闭Adapter的复用
26 | final SuperSwipeMenuLayout superSwipeMenuLayout = (SuperSwipeMenuLayout) holder.itemView;
27 | superSwipeMenuLayout.setSwipeEnable(true);// 设置是否可以侧滑
28 | holder.setText(R.id.super_tv_name, item.getName()).setOnClickListener(R.id.btnDel,
29 | new OnItemChildClickListener());
30 | }
31 |
32 | @Override
33 | protected int getItemViewLayoutId(int position, WeChatBean item) {
34 | return R.layout.adapter_slide_swipe_menu_layout;
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/adapter_multi_item1_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
12 |
13 |
20 |
21 |
28 |
29 |
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/app/src/main/java/com/superrecycleview/library/utils/ColorUtil.java:
--------------------------------------------------------------------------------
1 | package com.superrecycleview.library.utils;
2 |
3 | import android.content.Context;
4 |
5 | /**
6 | * Created by sunfusheng on 16/4/22.
7 | */
8 | public class ColorUtil {
9 |
10 |
11 | // 成新的颜色值
12 | public static int getNewColorByStartEndColor(Context context, float fraction, int startValue, int endValue) {
13 | return evaluate(fraction, context.getResources().getColor(startValue), context.getResources().getColor(endValue));
14 | }
15 | /**
16 | * 成新的颜色值
17 | * @param fraction 颜色取值的级别 (0.0f ~ 1.0f)
18 | * @param startValue 开始显示的颜色
19 | * @param endValue 结束显示的颜色
20 | * @return 返回生成新的颜色值
21 | */
22 | public static int evaluate(float fraction, int startValue, int endValue) {
23 | int startA = (startValue >> 24) & 0xff;
24 | int startR = (startValue >> 16) & 0xff;
25 | int startG = (startValue >> 8) & 0xff;
26 | int startB = startValue & 0xff;
27 |
28 | int endA = (endValue >> 24) & 0xff;
29 | int endR = (endValue >> 16) & 0xff;
30 | int endG = (endValue >> 8) & 0xff;
31 | int endB = endValue & 0xff;
32 |
33 | return ((startA + (int) (fraction * (endA - startA))) << 24) |
34 | ((startR + (int) (fraction * (endR - startR))) << 16) |
35 | ((startG + (int) (fraction * (endG - startG))) << 8) |
36 | ((startB + (int) (fraction * (endB - startB))));
37 | }
38 |
39 | }
40 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_header_footer_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
11 |
21 |
29 |
30 |
31 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/adapter_item_click_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
12 |
13 |
21 |
22 |
29 |
30 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_swipe_menu_content.xml:
--------------------------------------------------------------------------------
1 |
2 |
12 |
13 |
21 |
22 |
29 |
30 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/app/src/main/java/com/superrecycleview/library/bean/sidebar/MeituanHeaderBean.java:
--------------------------------------------------------------------------------
1 |
2 | package com.superrecycleview.library.bean.sidebar;
3 |
4 | import com.superrecycleview.superlibrary.sidebar.bean.BaseIndexPinyinBean;
5 |
6 | import java.util.List;
7 |
8 | /**
9 | * Created by super南仔 on 2017-05-09. 类备注:仿美团城市列表 HeaderView Bean
10 | * 需要传入的参数:
11 | */
12 | public class MeituanHeaderBean extends BaseIndexPinyinBean {
13 |
14 | private List cityList;
15 | // 悬停ItemDecoration显示的Tag
16 | private String suspensionTag;
17 |
18 | public MeituanHeaderBean() {
19 | }
20 |
21 | public MeituanHeaderBean(List cityList, String suspensionTag, String indexBarTag) {
22 | this.cityList = cityList;
23 | this.suspensionTag = suspensionTag;
24 | this.setBaseIndexTag(indexBarTag);
25 | }
26 |
27 | public List getCityList() {
28 | return cityList;
29 | }
30 |
31 | public MeituanHeaderBean setCityList(List cityList) {
32 | this.cityList = cityList;
33 | return this;
34 | }
35 |
36 | public MeituanHeaderBean setSuspensionTag(String suspensionTag) {
37 | this.suspensionTag = suspensionTag;
38 | return this;
39 | }
40 |
41 | @Override
42 | public String getTarget() {
43 | return null;
44 | }
45 |
46 | @Override
47 | public boolean isNeedToPinyin() {
48 | return false;
49 | }
50 |
51 | @Override
52 | public String getSuspensionTag() {
53 | return suspensionTag;
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/superlibrary/src/main/java/com/superrecycleview/superlibrary/recycleview/progressindicator/indicator/SquareSpinIndicator.java:
--------------------------------------------------------------------------------
1 | package com.superrecycleview.superlibrary.recycleview.progressindicator.indicator;
2 |
3 | import android.animation.Animator;
4 | import android.animation.ObjectAnimator;
5 | import android.animation.PropertyValuesHolder;
6 | import android.graphics.Canvas;
7 | import android.graphics.Paint;
8 | import android.graphics.RectF;
9 | import android.view.animation.LinearInterpolator;
10 |
11 | import java.util.ArrayList;
12 | import java.util.List;
13 |
14 | /**
15 | * Created by Jack on 2015/10/19.
16 | */
17 | public class SquareSpinIndicator extends BaseIndicatorController {
18 |
19 | @Override
20 | public void draw(Canvas canvas, Paint paint) {
21 | canvas.drawRect(new RectF(getWidth()/5,getHeight()/5,getWidth()*4/5,getHeight()*4/5),paint);
22 | }
23 |
24 | @Override
25 | public List createAnimation() {
26 | List animators=new ArrayList<>();
27 | PropertyValuesHolder rotation5= PropertyValuesHolder.ofFloat("rotationX",0,180,180,0,0);
28 | PropertyValuesHolder rotation6= PropertyValuesHolder.ofFloat("rotationY",0,0,180,180,0);
29 | ObjectAnimator animator= ObjectAnimator.ofPropertyValuesHolder(getTarget(), rotation6,rotation5);
30 | animator.setInterpolator(new LinearInterpolator());
31 | animator.setRepeatCount(-1);
32 | animator.setDuration(2500);
33 | animator.start();
34 | animators.add(animator);
35 | return animators;
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/app/src/main/java/com/superrecycleview/library/adapter/MultiItemAdapter.java:
--------------------------------------------------------------------------------
1 | package com.superrecycleview.library.adapter;
2 |
3 | import android.content.Context;
4 |
5 | import com.superrecycleview.library.R;
6 | import com.superrecycleview.library.bean.MultipleItemBean;
7 | import com.superrecycleview.superlibrary.adapter.BaseViewHolder;
8 | import com.superrecycleview.superlibrary.adapter.SuperBaseAdapter;
9 |
10 | import java.util.List;
11 |
12 | /**
13 | * Created by super南仔 on 07/28/16.
14 | * blog: http://supercwn.github.io/
15 | * GitHub: https://github.com/supercwn
16 | */
17 | public class MultiItemAdapter extends SuperBaseAdapter {
18 |
19 | public MultiItemAdapter(Context context, List data) {
20 | super(context, data);
21 | }
22 |
23 | @Override
24 | protected void convert(BaseViewHolder holder, MultipleItemBean item, int position) {
25 | if(item.getType() == 0){
26 | holder.setText(R.id.name_tv,item.getName());
27 | } else if(item.getType() == 1){
28 | holder.setText(R.id.name_tv,item.getName())
29 | .setText(R.id.info_tv,item.getInfo());
30 | }
31 | }
32 |
33 | @Override
34 | protected int getItemViewLayoutId(int position, MultipleItemBean item) {
35 | if(item.getType() == 0){
36 | return R.layout.adapter_multi_item1_layout;
37 | } else if(item.getType() == 1){
38 | return R.layout.adapter_multi_item2_layout;
39 | } else{
40 | return R.layout.adapter_multi_item3_layout;
41 | }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/superlibrary/src/main/java/com/superrecycleview/superlibrary/recycleview/ItemTouchHelperAdapter.java:
--------------------------------------------------------------------------------
1 | package com.superrecycleview.superlibrary.recycleview;
2 |
3 | import android.support.v7.widget.RecyclerView;
4 |
5 | /**
6 | * Created by Jack on 2015/10/19.
7 | */
8 | public interface ItemTouchHelperAdapter {
9 |
10 | /**
11 | * Called when an item has been dragged far enough to trigger a move. This is called every time
12 | * an item is shifted, and not at the end of a "drop" event.
13 | *
14 | * Implementations should call {@link RecyclerView.Adapter#notifyItemMoved(int, int)} after
15 | * adjusting the underlying data to reflect this move.
16 | *
17 | * @param fromPosition The start position of the moved item.
18 | * @param toPosition Then resolved position of the moved item.
19 | *
20 | * @see RecyclerView#getAdapterPositionFor(RecyclerView.ViewHolder)
21 | * @see RecyclerView.ViewHolder#getAdapterPosition()
22 | */
23 | void onItemMove(int fromPosition, int toPosition);
24 |
25 |
26 | /**
27 | * Called when an item has been dismissed by a swipe.
28 | *
29 | * Implementations should call {@link RecyclerView.Adapter#notifyItemRemoved(int)} after
30 | * adjusting the underlying data to reflect this removal.
31 | *
32 | * @param position The position of the item dismissed.
33 | *
34 | * @see RecyclerView#getAdapterPositionFor(RecyclerView.ViewHolder)
35 | * @see RecyclerView.ViewHolder#getAdapterPosition()
36 | */
37 | void onItemDismiss(int position);
38 | }
39 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_sidebar_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
18 |
19 |
29 |
30 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/superlibrary/src/main/java/com/superrecycleview/superlibrary/recycleview/ProgressStyle.java:
--------------------------------------------------------------------------------
1 | package com.superrecycleview.superlibrary.recycleview;
2 |
3 | /**
4 | * Created by Jack on 2015/10/19.
5 | */
6 | public class ProgressStyle {
7 | public static final int SysProgress=-1;
8 | public static final int BallPulse=0;
9 | public static final int BallGridPulse=1;
10 | public static final int BallClipRotate=2;
11 | public static final int BallClipRotatePulse=3;
12 | public static final int SquareSpin=4;
13 | public static final int BallClipRotateMultiple=5;
14 | public static final int BallPulseRise=6;
15 | public static final int BallRotate=7;
16 | public static final int CubeTransition=8;
17 | public static final int BallZigZag=9;
18 | public static final int BallZigZagDeflect=10;
19 | public static final int BallTrianglePath=11;
20 | public static final int BallScale=12;
21 | public static final int LineScale=13;
22 | public static final int LineScaleParty=14;
23 | public static final int BallScaleMultiple=15;
24 | public static final int BallPulseSync=16;
25 | public static final int BallBeat=17;
26 | public static final int LineScalePulseOut=18;
27 | public static final int LineScalePulseOutRapid=19;
28 | public static final int BallScaleRipple=20;
29 | public static final int BallScaleRippleMultiple=21;
30 | public static final int BallSpinFadeLoader=22;
31 | public static final int LineSpinFadeLoader=23;
32 | public static final int TriangleSkewSpin=24;
33 | public static final int Pacman=25;
34 | public static final int BallGridBeat=26;
35 | public static final int SemiCircleSpin=27;
36 | }
37 |
--------------------------------------------------------------------------------
/app/src/main/java/com/superrecycleview/library/utils/DensityUtil.java:
--------------------------------------------------------------------------------
1 | package com.superrecycleview.library.utils;
2 |
3 | import android.app.Activity;
4 | import android.content.Context;
5 | import android.util.DisplayMetrics;
6 |
7 | public class DensityUtil {
8 |
9 | // 根据手机的分辨率将dp的单位转成px(像素)
10 | public static int dip2px(Context context, float dpValue) {
11 | final float scale = context.getResources().getDisplayMetrics().density;
12 | return (int) (dpValue * scale + 0.5f);
13 | }
14 |
15 | // 根据手机的分辨率将px(像素)的单位转成dp
16 | public static int px2dip(Context context, float pxValue) {
17 | final float scale = context.getResources().getDisplayMetrics().density;
18 | return (int) (pxValue / scale + 0.5f);
19 | }
20 |
21 | // 将px值转换为sp值
22 | public static int px2sp(Context context, float pxValue) {
23 | final float fontScale = context.getResources().getDisplayMetrics().scaledDensity;
24 | return (int) (pxValue / fontScale + 0.5f);
25 | }
26 |
27 | // 将sp值转换为px值
28 | public static int sp2px(Context context, float spValue) {
29 | final float fontScale = context.getResources().getDisplayMetrics().scaledDensity;
30 | return (int) (spValue * fontScale + 0.5f);
31 | }
32 |
33 | // 屏幕宽度(像素)
34 | public static int getWindowWidth(Activity context){
35 | DisplayMetrics metric = new DisplayMetrics();
36 | context.getWindowManager().getDefaultDisplay().getMetrics(metric);
37 | return metric.widthPixels;
38 | }
39 |
40 | // 屏幕高度(像素)
41 | public static int getWindowHeight(Activity activity){
42 | DisplayMetrics metric = new DisplayMetrics();
43 | activity.getWindowManager().getDefaultDisplay().getMetrics(metric);
44 | return metric.heightPixels;
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/superlibrary/src/main/java/com/superrecycleview/superlibrary/recycleview/progressindicator/indicator/BallPulseRiseIndicator.java:
--------------------------------------------------------------------------------
1 | package com.superrecycleview.superlibrary.recycleview.progressindicator.indicator;
2 |
3 | import android.animation.Animator;
4 | import android.animation.ObjectAnimator;
5 | import android.animation.PropertyValuesHolder;
6 | import android.graphics.Canvas;
7 | import android.graphics.Paint;
8 | import android.view.animation.LinearInterpolator;
9 |
10 | import java.util.ArrayList;
11 | import java.util.List;
12 |
13 | /**
14 | * Created by Jack on 2015/10/19.
15 | */
16 | public class BallPulseRiseIndicator extends BaseIndicatorController{
17 |
18 | @Override
19 | public void draw(Canvas canvas, Paint paint) {
20 | float radius=getWidth()/10;
21 | canvas.drawCircle(getWidth()/4,radius*2,radius,paint);
22 | canvas.drawCircle(getWidth()*3/4,radius*2,radius,paint);
23 |
24 | canvas.drawCircle(radius,getHeight()-2*radius,radius,paint);
25 | canvas.drawCircle(getWidth()/2,getHeight()-2*radius,radius,paint);
26 | canvas.drawCircle(getWidth()-radius,getHeight()-2*radius,radius,paint);
27 | }
28 |
29 | @Override
30 | public List createAnimation() {
31 | PropertyValuesHolder rotation6= PropertyValuesHolder.ofFloat("rotationX",0,360);
32 | ObjectAnimator animator= ObjectAnimator.ofPropertyValuesHolder(getTarget(), rotation6);
33 | animator.setInterpolator(new LinearInterpolator());
34 | animator.setRepeatCount(-1);
35 | animator.setDuration(1500);
36 | animator.start();
37 | List animators=new ArrayList<>();
38 | animators.add(animator);
39 | return animators;
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/superlibrary/src/main/java/com/superrecycleview/superlibrary/recycleview/progressindicator/indicator/TriangleSkewSpinIndicator.java:
--------------------------------------------------------------------------------
1 | package com.superrecycleview.superlibrary.recycleview.progressindicator.indicator;
2 |
3 | import android.animation.Animator;
4 | import android.animation.ObjectAnimator;
5 | import android.animation.PropertyValuesHolder;
6 | import android.graphics.Canvas;
7 | import android.graphics.Paint;
8 | import android.graphics.Path;
9 | import android.view.animation.LinearInterpolator;
10 |
11 | import java.util.ArrayList;
12 | import java.util.List;
13 |
14 | /**
15 | * Created by Jack on 2015/10/19.
16 | */
17 | public class TriangleSkewSpinIndicator extends BaseIndicatorController {
18 |
19 | @Override
20 | public void draw(Canvas canvas, Paint paint) {
21 | Path path=new Path();
22 | path.moveTo(getWidth()/5,getHeight()*4/5);
23 | path.lineTo(getWidth()*4/5, getHeight()*4/5);
24 | path.lineTo(getWidth()/2,getHeight()/5);
25 | path.close();
26 | canvas.drawPath(path, paint);
27 | }
28 |
29 | @Override
30 | public List createAnimation() {
31 | List animators=new ArrayList<>();
32 | PropertyValuesHolder rotation5= PropertyValuesHolder.ofFloat("rotationX",0,180,180,0,0);
33 | PropertyValuesHolder rotation6= PropertyValuesHolder.ofFloat("rotationY",0,0,180,180,0);
34 |
35 | ObjectAnimator animator= ObjectAnimator.ofPropertyValuesHolder(getTarget(), rotation6,rotation5);
36 | animator.setInterpolator(new LinearInterpolator());
37 | animator.setRepeatCount(-1);
38 | animator.setDuration(2500);
39 | animator.start();
40 |
41 | animators.add(animator);
42 | return animators;
43 | }
44 |
45 | }
46 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/adapter_draggable_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
21 |
22 |
33 |
34 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/adapter_multi_item2_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
22 |
23 |
33 |
34 |
44 |
45 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/adapter_slide_swipe_menu_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
14 |
15 |
20 |
21 |
28 |
29 |
30 |
35 |
36 |
44 |
45 |
--------------------------------------------------------------------------------
/app/src/main/java/com/superrecycleview/library/ui/SideBarActivity.java:
--------------------------------------------------------------------------------
1 |
2 | package com.superrecycleview.library.ui;
3 |
4 | import android.app.Activity;
5 | import android.content.Intent;
6 | import android.os.Bundle;
7 | import android.support.annotation.Nullable;
8 | import android.view.View;
9 | import android.widget.TextView;
10 |
11 | import com.superrecycleview.library.R;
12 | import com.superrecycleview.library.ui.sidebar.MeiTuanActivity;
13 | import com.superrecycleview.library.ui.sidebar.SlideSwipeActivity;
14 | import com.superrecycleview.library.ui.sidebar.WeChatActivity;
15 |
16 | /**
17 | * Created by super南仔 on 2017-05-04. 类备注: 需要传入的参数:
18 | */
19 | public class SideBarActivity extends Activity implements View.OnClickListener {
20 |
21 | private TextView tvWechat;
22 |
23 | @Override
24 | protected void onCreate(@Nullable Bundle savedInstanceState) {
25 | super.onCreate(savedInstanceState);
26 | setContentView(R.layout.activity_sidebar_layout);
27 | initView();
28 | }
29 |
30 | private void initView() {
31 | tvWechat = (TextView) findViewById(R.id.super_tv_wechat);
32 | tvWechat.setOnClickListener(this);
33 | findViewById(R.id.super_tv_swipe_menu).setOnClickListener(this);
34 | findViewById(R.id.super_tv_meituan).setOnClickListener(this);
35 | }
36 |
37 | @Override
38 | public void onClick(View v) {
39 | switch (v.getId()) {
40 | case R.id.super_tv_wechat:
41 | startActivity(new Intent(this, WeChatActivity.class));
42 | break;
43 | case R.id.super_tv_swipe_menu:
44 | startActivity(new Intent(this, SlideSwipeActivity.class));
45 | break;
46 | case R.id.super_tv_meituan:
47 | startActivity(new Intent(this, MeiTuanActivity.class));
48 | break;
49 | }
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/app/src/main/java/com/superrecycleview/library/adapter/sidebar/MeituanHeaderAdapter.java:
--------------------------------------------------------------------------------
1 |
2 | package com.superrecycleview.library.adapter.sidebar;
3 |
4 | import android.content.Context;
5 | import android.support.v7.widget.GridLayoutManager;
6 | import android.support.v7.widget.RecyclerView;
7 |
8 | import com.superrecycleview.library.R;
9 | import com.superrecycleview.library.bean.sidebar.MeituanHeaderBean;
10 | import com.superrecycleview.superlibrary.adapter.BaseViewHolder;
11 | import com.superrecycleview.superlibrary.adapter.SuperHeaderAndFooterAdapter;
12 |
13 | /**
14 | * Created by zhangxutong . Date: 16/08/28
15 | */
16 |
17 | public class MeituanHeaderAdapter extends SuperHeaderAndFooterAdapter {
18 | private Context mContext;
19 |
20 | public MeituanHeaderAdapter(RecyclerView.Adapter mInnerAdapter, Context mContext) {
21 | super(mContext, mInnerAdapter);
22 | this.mContext = mContext;
23 | }
24 |
25 | @Override
26 | protected void onBindHeaderHolder(BaseViewHolder holder, int headerPos, int layoutId,
27 | Object o) {
28 | switch (layoutId) {
29 | case R.layout.view_meituan_header_layout:
30 | final MeituanHeaderBean meituanHeaderBean = (MeituanHeaderBean) o;
31 | // 网格
32 | RecyclerView recyclerView = holder.getView(R.id.header_location_recycleview);
33 | recyclerView
34 | .setAdapter(new HeaderAdapter(mContext, meituanHeaderBean.getCityList()));
35 | recyclerView.setLayoutManager(new GridLayoutManager(mContext, 3));
36 | break;
37 | // case R.layout.meituan_item_header_top:
38 | // MeituanTopHeaderBean meituanTopHeaderBean =
39 | // (MeituanTopHeaderBean) o;
40 | // holder.setText(R.id.tvCurrent, meituanTopHeaderBean.getTxt());
41 | // break;
42 | default:
43 | break;
44 | }
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/superlibrary/src/main/java/com/superrecycleview/superlibrary/recycleview/SimpleViewSwitcher.java:
--------------------------------------------------------------------------------
1 | package com.superrecycleview.superlibrary.recycleview;
2 |
3 | import android.content.Context;
4 | import android.util.AttributeSet;
5 | import android.view.View;
6 | import android.view.ViewGroup;
7 |
8 | /**
9 | * Created by Jack on 2015/10/19.
10 | */
11 | public class SimpleViewSwitcher extends ViewGroup {
12 |
13 | public SimpleViewSwitcher(Context context) {
14 | super(context);
15 | }
16 |
17 | public SimpleViewSwitcher(Context context, AttributeSet attrs) {
18 | this(context, attrs, 0);
19 | }
20 |
21 | public SimpleViewSwitcher(Context context, AttributeSet attrs, int defStyle) {
22 | super(context, attrs, defStyle);
23 | }
24 |
25 | @Override
26 | protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
27 | int childCount = this.getChildCount();
28 | int maxHeight = 0;
29 | int maxWidth = 0;
30 | for (int i = 0; i < childCount; i++) {
31 | View child = this.getChildAt(i);
32 | this.measureChild(child, widthMeasureSpec, heightMeasureSpec);
33 | int cw = child.getMeasuredWidth();
34 | // int ch = child.getMeasuredHeight();
35 | maxWidth = child.getMeasuredWidth();
36 | maxHeight = child.getMeasuredHeight();
37 | }
38 | setMeasuredDimension(maxWidth, maxHeight);
39 | }
40 |
41 | @Override
42 | protected void onLayout(boolean changed, int l, int t, int r, int b) {
43 | final int count = getChildCount();
44 | for (int i = 0; i < count; i++) {
45 | final View child = getChildAt(i);
46 | if (child.getVisibility() != View.GONE) {
47 | child.layout(0, 0, r - l, b - t);
48 |
49 | }
50 | }
51 | }
52 |
53 | public void setView(View view) {
54 | if (this.getChildCount() != 0){
55 | this.removeViewAt(0);
56 | }
57 | this.addView(view,0);
58 | }
59 |
60 | }
--------------------------------------------------------------------------------
/superlibrary/src/main/java/com/superrecycleview/superlibrary/recycleview/progressindicator/indicator/BallScaleRippleIndicator.java:
--------------------------------------------------------------------------------
1 | package com.superrecycleview.superlibrary.recycleview.progressindicator.indicator;
2 |
3 | import android.animation.Animator;
4 | import android.animation.ValueAnimator;
5 | import android.graphics.Canvas;
6 | import android.graphics.Paint;
7 | import android.view.animation.LinearInterpolator;
8 |
9 | import java.util.ArrayList;
10 | import java.util.List;
11 |
12 | /**
13 | * Created by Jack on 2015/10/19.
14 | */
15 | public class BallScaleRippleIndicator extends BallScaleIndicator {
16 |
17 |
18 | @Override
19 | public void draw(Canvas canvas, Paint paint) {
20 | paint.setStyle(Paint.Style.STROKE);
21 | paint.setStrokeWidth(3);
22 | super.draw(canvas, paint);
23 | }
24 |
25 | @Override
26 | public List createAnimation() {
27 | List animators=new ArrayList<>();
28 | ValueAnimator scaleAnim= ValueAnimator.ofFloat(0,1);
29 | scaleAnim.setInterpolator(new LinearInterpolator());
30 | scaleAnim.setDuration(1000);
31 | scaleAnim.setRepeatCount(-1);
32 | scaleAnim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
33 | @Override
34 | public void onAnimationUpdate(ValueAnimator animation) {
35 | scale = (float) animation.getAnimatedValue();
36 | postInvalidate();
37 | }
38 | });
39 | scaleAnim.start();
40 |
41 | ValueAnimator alphaAnim= ValueAnimator.ofInt(0, 255);
42 | alphaAnim.setInterpolator(new LinearInterpolator());
43 | alphaAnim.setDuration(1000);
44 | alphaAnim.setRepeatCount(-1);
45 | alphaAnim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
46 | @Override
47 | public void onAnimationUpdate(ValueAnimator animation) {
48 | alpha = (int) animation.getAnimatedValue();
49 | postInvalidate();
50 | }
51 | });
52 | alphaAnim.start();
53 |
54 | animators.add(scaleAnim);
55 | animators.add(alphaAnim);
56 | return animators;
57 | }
58 |
59 | }
60 |
--------------------------------------------------------------------------------
/superlibrary/src/main/java/com/superrecycleview/superlibrary/recycleview/progressindicator/indicator/BallPulseSyncIndicator.java:
--------------------------------------------------------------------------------
1 | package com.superrecycleview.superlibrary.recycleview.progressindicator.indicator;
2 |
3 | import android.animation.Animator;
4 | import android.animation.ValueAnimator;
5 | import android.graphics.Canvas;
6 | import android.graphics.Paint;
7 |
8 | import java.util.ArrayList;
9 | import java.util.List;
10 |
11 | /**
12 | * Created by Jack on 2015/10/19.
13 | */
14 | public class BallPulseSyncIndicator extends BaseIndicatorController {
15 |
16 | float[] translateYFloats=new float[3];
17 |
18 | @Override
19 | public void draw(Canvas canvas, Paint paint) {
20 | float circleSpacing=4;
21 | float radius=(getWidth()-circleSpacing*2)/6;
22 | float x = getWidth()/ 2-(radius*2+circleSpacing);
23 | for (int i = 0; i < 3; i++) {
24 | canvas.save();
25 | float translateX=x+(radius*2)*i+circleSpacing*i;
26 | canvas.translate(translateX, translateYFloats[i]);
27 | canvas.drawCircle(0, 0, radius, paint);
28 | canvas.restore();
29 | }
30 | }
31 |
32 | @Override
33 | public List createAnimation() {
34 | List animators=new ArrayList<>();
35 | float circleSpacing=4;
36 | float radius=(getWidth()-circleSpacing*2)/6;
37 | int[] delays=new int[]{70,140,210};
38 | for (int i = 0; i < 3; i++) {
39 | final int index=i;
40 | ValueAnimator scaleAnim= ValueAnimator.ofFloat(getHeight()/2,getHeight()/2-radius*2,getHeight()/2);
41 | scaleAnim.setDuration(600);
42 | scaleAnim.setRepeatCount(-1);
43 | scaleAnim.setStartDelay(delays[i]);
44 | scaleAnim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
45 | @Override
46 | public void onAnimationUpdate(ValueAnimator animation) {
47 | translateYFloats[index] = (float) animation.getAnimatedValue();
48 | postInvalidate();
49 | }
50 | });
51 | scaleAnim.start();
52 | animators.add(scaleAnim);
53 | }
54 | return animators;
55 | }
56 |
57 | }
58 |
--------------------------------------------------------------------------------
/superlibrary/src/main/java/com/superrecycleview/superlibrary/recycleview/progressindicator/indicator/LineScaleIndicator.java:
--------------------------------------------------------------------------------
1 | package com.superrecycleview.superlibrary.recycleview.progressindicator.indicator;
2 |
3 | import android.animation.Animator;
4 | import android.animation.ValueAnimator;
5 | import android.graphics.Canvas;
6 | import android.graphics.Paint;
7 | import android.graphics.RectF;
8 |
9 | import java.util.ArrayList;
10 | import java.util.List;
11 |
12 | /**
13 | * Created by Jack on 2015/10/19.
14 | */
15 | public class LineScaleIndicator extends BaseIndicatorController {
16 |
17 | public static final float SCALE=1.0f;
18 |
19 | float[] scaleYFloats=new float[]{SCALE,
20 | SCALE,
21 | SCALE,
22 | SCALE,
23 | SCALE,};
24 |
25 | @Override
26 | public void draw(Canvas canvas, Paint paint) {
27 | float translateX=getWidth()/11;
28 | float translateY=getHeight()/2;
29 | for (int i = 0; i < 5; i++) {
30 | canvas.save();
31 | canvas.translate((2 + i * 2) * translateX - translateX / 2, translateY);
32 | canvas.scale(SCALE, scaleYFloats[i]);
33 | RectF rectF=new RectF(-translateX/2,-getHeight()/2.5f,translateX/2,getHeight()/2.5f);
34 | canvas.drawRoundRect(rectF, 5, 5, paint);
35 | canvas.restore();
36 | }
37 | }
38 |
39 | @Override
40 | public List createAnimation() {
41 | List animators=new ArrayList<>();
42 | long[] delays=new long[]{100,200,300,400,500};
43 | for (int i = 0; i < 5; i++) {
44 | final int index=i;
45 | ValueAnimator scaleAnim= ValueAnimator.ofFloat(1, 0.4f, 1);
46 | scaleAnim.setDuration(1000);
47 | scaleAnim.setRepeatCount(-1);
48 | scaleAnim.setStartDelay(delays[i]);
49 | scaleAnim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
50 | @Override
51 | public void onAnimationUpdate(ValueAnimator animation) {
52 | scaleYFloats[index] = (float) animation.getAnimatedValue();
53 | postInvalidate();
54 | }
55 | });
56 | scaleAnim.start();
57 | animators.add(scaleAnim);
58 | }
59 | return animators;
60 | }
61 |
62 | }
63 |
--------------------------------------------------------------------------------
/superlibrary/src/main/java/com/superrecycleview/superlibrary/recycleview/progressindicator/indicator/BallScaleIndicator.java:
--------------------------------------------------------------------------------
1 | package com.superrecycleview.superlibrary.recycleview.progressindicator.indicator;
2 |
3 | import android.animation.Animator;
4 | import android.animation.ValueAnimator;
5 | import android.graphics.Canvas;
6 | import android.graphics.Paint;
7 | import android.view.animation.LinearInterpolator;
8 |
9 | import java.util.ArrayList;
10 | import java.util.List;
11 |
12 | /**
13 | * Created by Jack on 2015/10/19.
14 | */
15 | public class BallScaleIndicator extends BaseIndicatorController {
16 |
17 | float scale=1;
18 | int alpha=255;
19 |
20 | @Override
21 | public void draw(Canvas canvas, Paint paint) {
22 | float circleSpacing=4;
23 | paint.setAlpha(alpha);
24 | canvas.scale(scale,scale,getWidth()/2,getHeight()/2);
25 | paint.setAlpha(alpha);
26 | canvas.drawCircle(getWidth()/2,getHeight()/2,getWidth()/2-circleSpacing,paint);
27 | }
28 |
29 | @Override
30 | public List createAnimation() {
31 | List animators=new ArrayList<>();
32 | ValueAnimator scaleAnim= ValueAnimator.ofFloat(0,1);
33 | scaleAnim.setInterpolator(new LinearInterpolator());
34 | scaleAnim.setDuration(1000);
35 | scaleAnim.setRepeatCount(-1);
36 | scaleAnim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
37 | @Override
38 | public void onAnimationUpdate(ValueAnimator animation) {
39 | scale = (float) animation.getAnimatedValue();
40 | postInvalidate();
41 | }
42 | });
43 | scaleAnim.start();
44 |
45 | ValueAnimator alphaAnim= ValueAnimator.ofInt(255, 0);
46 | alphaAnim.setInterpolator(new LinearInterpolator());
47 | alphaAnim.setDuration(1000);
48 | alphaAnim.setRepeatCount(-1);
49 | alphaAnim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
50 | @Override
51 | public void onAnimationUpdate(ValueAnimator animation) {
52 | alpha = (int) animation.getAnimatedValue();
53 | postInvalidate();
54 | }
55 | });
56 | alphaAnim.start();
57 | animators.add(scaleAnim);
58 | animators.add(alphaAnim);
59 | return animators;
60 | }
61 |
62 |
63 | }
64 |
--------------------------------------------------------------------------------
/superlibrary/src/main/java/com/superrecycleview/superlibrary/recycleview/progressindicator/indicator/BallPulseIndicator.java:
--------------------------------------------------------------------------------
1 | package com.superrecycleview.superlibrary.recycleview.progressindicator.indicator;
2 |
3 | import android.animation.Animator;
4 | import android.animation.ValueAnimator;
5 | import android.graphics.Canvas;
6 | import android.graphics.Paint;
7 |
8 | import java.util.ArrayList;
9 | import java.util.List;
10 |
11 | /**
12 | * Created by Jack on 2015/10/19.
13 | */
14 | public class BallPulseIndicator extends BaseIndicatorController{
15 |
16 | public static final float SCALE=1.0f;
17 |
18 | //scale x ,y
19 | private float[] scaleFloats=new float[]{SCALE,
20 | SCALE,
21 | SCALE};
22 |
23 |
24 |
25 | @Override
26 | public void draw(Canvas canvas, Paint paint) {
27 | float circleSpacing=4;
28 | float radius=(Math.min(getWidth(),getHeight())-circleSpacing*2)/6;
29 | float x = getWidth()/ 2-(radius*2+circleSpacing);
30 | float y=getHeight() / 2;
31 | for (int i = 0; i < 3; i++) {
32 | canvas.save();
33 | float translateX=x+(radius*2)*i+circleSpacing*i;
34 | canvas.translate(translateX, y);
35 | canvas.scale(scaleFloats[i], scaleFloats[i]);
36 | canvas.drawCircle(0, 0, radius, paint);
37 | canvas.restore();
38 | }
39 | }
40 |
41 | @Override
42 | public List createAnimation() {
43 | List animators=new ArrayList<>();
44 | int[] delays=new int[]{120,240,360};
45 | for (int i = 0; i < 3; i++) {
46 | final int index=i;
47 |
48 | ValueAnimator scaleAnim= ValueAnimator.ofFloat(1,0.3f,1);
49 |
50 | scaleAnim.setDuration(750);
51 | scaleAnim.setRepeatCount(-1);
52 | scaleAnim.setStartDelay(delays[i]);
53 |
54 | scaleAnim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
55 | @Override
56 | public void onAnimationUpdate(ValueAnimator animation) {
57 | scaleFloats[index] = (float) animation.getAnimatedValue();
58 | postInvalidate();
59 |
60 | }
61 | });
62 | scaleAnim.start();
63 | animators.add(scaleAnim);
64 | }
65 | return animators;
66 | }
67 |
68 | }
69 |
--------------------------------------------------------------------------------
/superlibrary/src/main/java/com/superrecycleview/superlibrary/recycleview/progressindicator/indicator/LineScalePartyIndicator.java:
--------------------------------------------------------------------------------
1 | package com.superrecycleview.superlibrary.recycleview.progressindicator.indicator;
2 |
3 | import android.animation.Animator;
4 | import android.animation.ValueAnimator;
5 | import android.graphics.Canvas;
6 | import android.graphics.Paint;
7 | import android.graphics.RectF;
8 |
9 | import java.util.ArrayList;
10 | import java.util.List;
11 |
12 | /**
13 | * Created by Jack on 2015/10/19.
14 | */
15 | public class LineScalePartyIndicator extends BaseIndicatorController {
16 |
17 | public static final float SCALE=1.0f;
18 |
19 | float[] scaleFloats=new float[]{SCALE,
20 | SCALE,
21 | SCALE,
22 | SCALE,
23 | SCALE,};
24 |
25 | @Override
26 | public void draw(Canvas canvas, Paint paint) {
27 | float translateX=getWidth()/9;
28 | float translateY=getHeight()/2;
29 | for (int i = 0; i < 4; i++) {
30 | canvas.save();
31 | canvas.translate((2 + i * 2) * translateX - translateX / 2, translateY);
32 | canvas.scale(scaleFloats[i], scaleFloats[i]);
33 | RectF rectF=new RectF(-translateX/2,-getHeight()/2.5f,translateX/2,getHeight()/2.5f);
34 | canvas.drawRoundRect(rectF,5,5,paint);
35 | canvas.restore();
36 | }
37 | }
38 |
39 | @Override
40 | public List createAnimation() {
41 | List animators=new ArrayList<>();
42 | long[] durations=new long[]{1260, 430, 1010, 730};
43 | long[] delays=new long[]{770, 290, 280, 740};
44 | for (int i = 0; i < 4; i++) {
45 | final int index=i;
46 | ValueAnimator scaleAnim= ValueAnimator.ofFloat(1,0.4f,1);
47 | scaleAnim.setDuration(durations[i]);
48 | scaleAnim.setRepeatCount(-1);
49 | scaleAnim.setStartDelay(delays[i]);
50 | scaleAnim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
51 | @Override
52 | public void onAnimationUpdate(ValueAnimator animation) {
53 | scaleFloats[index] = (float) animation.getAnimatedValue();
54 | postInvalidate();
55 | }
56 | });
57 | scaleAnim.start();
58 | animators.add(scaleAnim);
59 | }
60 | return animators;
61 | }
62 |
63 |
64 | }
65 |
--------------------------------------------------------------------------------
/superlibrary/src/main/java/com/superrecycleview/superlibrary/recycleview/progressindicator/indicator/BallRotateIndicator.java:
--------------------------------------------------------------------------------
1 | package com.superrecycleview.superlibrary.recycleview.progressindicator.indicator;
2 |
3 | import android.animation.Animator;
4 | import android.animation.ObjectAnimator;
5 | import android.animation.ValueAnimator;
6 | import android.graphics.Canvas;
7 | import android.graphics.Paint;
8 |
9 | import java.util.ArrayList;
10 | import java.util.List;
11 |
12 | /**
13 | * Created by Jack on 2015/10/19.
14 | */
15 | public class BallRotateIndicator extends BaseIndicatorController{
16 |
17 | float scaleFloat=0.5f;
18 |
19 |
20 | @Override
21 | public void draw(Canvas canvas, Paint paint) {
22 | float radius=getWidth()/10;
23 | float x = getWidth()/ 2;
24 | float y=getHeight()/2;
25 |
26 | canvas.save();
27 | canvas.translate(x - radius * 2 - radius, y);
28 | canvas.scale(scaleFloat, scaleFloat);
29 | canvas.drawCircle(0, 0, radius, paint);
30 | canvas.restore();
31 |
32 | canvas.save();
33 | canvas.translate(x, y);
34 | canvas.scale(scaleFloat, scaleFloat);
35 | canvas.drawCircle(0, 0, radius, paint);
36 | canvas.restore();
37 |
38 | canvas.save();
39 | canvas.translate(x + radius * 2 + radius, y);
40 | canvas.scale(scaleFloat, scaleFloat);
41 | canvas.drawCircle(0,0,radius, paint);
42 | canvas.restore();
43 | }
44 |
45 | @Override
46 | public List createAnimation() {
47 | List animators=new ArrayList<>();
48 | ValueAnimator scaleAnim= ValueAnimator.ofFloat(0.5f,1,0.5f);
49 | scaleAnim.setDuration(1000);
50 | scaleAnim.setRepeatCount(-1);
51 | scaleAnim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
52 | @Override
53 | public void onAnimationUpdate(ValueAnimator animation) {
54 | scaleFloat = (float) animation.getAnimatedValue();
55 | postInvalidate();
56 | }
57 | });
58 | scaleAnim.start();
59 |
60 | ObjectAnimator rotateAnim= ObjectAnimator.ofFloat(getTarget(),"rotation",0,180,360);
61 | rotateAnim.setDuration(1000);
62 | rotateAnim.setRepeatCount(-1);
63 | rotateAnim.start();
64 |
65 | animators.add(scaleAnim);
66 | animators.add(rotateAnim);
67 | return animators;
68 | }
69 |
70 |
71 | }
72 |
--------------------------------------------------------------------------------
/superlibrary/src/main/java/com/superrecycleview/superlibrary/recycleview/progressindicator/indicator/BallClipRotateIndicator.java:
--------------------------------------------------------------------------------
1 | package com.superrecycleview.superlibrary.recycleview.progressindicator.indicator;
2 |
3 | import android.animation.Animator;
4 | import android.animation.ValueAnimator;
5 | import android.graphics.Canvas;
6 | import android.graphics.Paint;
7 | import android.graphics.RectF;
8 |
9 | import java.util.ArrayList;
10 | import java.util.List;
11 |
12 | /**
13 | * Created by Jack on 2015/10/19.
14 | */
15 | public class BallClipRotateIndicator extends BaseIndicatorController {
16 |
17 | float scaleFloat=1,degrees;
18 |
19 | @Override
20 | public void draw(Canvas canvas, Paint paint) {
21 | paint.setStyle(Paint.Style.STROKE);
22 | paint.setStrokeWidth(3);
23 |
24 | float circleSpacing=12;
25 | float x = (getWidth()) / 2;
26 | float y=(getHeight()) / 2;
27 | canvas.translate(x, y);
28 | canvas.scale(scaleFloat, scaleFloat);
29 | canvas.rotate(degrees);
30 | RectF rectF=new RectF(-x+circleSpacing,-y+circleSpacing,0+x-circleSpacing,0+y-circleSpacing);
31 | canvas.drawArc(rectF, -45, 270, false, paint);
32 | }
33 |
34 | @Override
35 | public List createAnimation() {
36 | List animators=new ArrayList<>();
37 | ValueAnimator scaleAnim= ValueAnimator.ofFloat(1,0.6f,0.5f,1);
38 | scaleAnim.setDuration(750);
39 | scaleAnim.setRepeatCount(-1);
40 | scaleAnim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
41 | @Override
42 | public void onAnimationUpdate(ValueAnimator animation) {
43 | scaleFloat = (float) animation.getAnimatedValue();
44 | postInvalidate();
45 | }
46 | });
47 | scaleAnim.start();
48 |
49 | ValueAnimator rotateAnim= ValueAnimator.ofFloat(0,180,360);
50 | rotateAnim.setDuration(750);
51 | rotateAnim.setRepeatCount(-1);
52 | rotateAnim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
53 | @Override
54 | public void onAnimationUpdate(ValueAnimator animation) {
55 | degrees = (float) animation.getAnimatedValue();
56 | postInvalidate();
57 | }
58 | });
59 | rotateAnim.start();
60 | animators.add(scaleAnim);
61 | animators.add(rotateAnim);
62 | return animators;
63 | }
64 |
65 | }
66 |
--------------------------------------------------------------------------------
/app/src/main/java/com/superrecycleview/library/adapter/sidebar/MeiTuanAdapter.java:
--------------------------------------------------------------------------------
1 |
2 | package com.superrecycleview.library.adapter.sidebar;
3 |
4 | import android.content.Context;
5 | import android.support.v7.widget.RecyclerView;
6 | import android.view.LayoutInflater;
7 | import android.view.View;
8 | import android.view.ViewGroup;
9 | import android.widget.TextView;
10 | import android.widget.Toast;
11 |
12 | import com.superrecycleview.library.R;
13 | import com.superrecycleview.library.bean.sidebar.WeChatBean;
14 |
15 | import java.util.List;
16 |
17 | /**
18 | * Created by super南仔 on 2017-05-09. 类备注: 需要传入的参数:
19 | */
20 | public class MeiTuanAdapter extends RecyclerView.Adapter {
21 | protected Context mContext;
22 | protected List mDatas;
23 | protected LayoutInflater mInflater;
24 |
25 | public MeiTuanAdapter(Context mContext, List mDatas) {
26 | this.mContext = mContext;
27 | this.mDatas = mDatas;
28 | mInflater = LayoutInflater.from(mContext);
29 | }
30 |
31 | public List getDatas() {
32 | return mDatas;
33 | }
34 |
35 | public MeiTuanAdapter setDatas(List datas) {
36 | mDatas = datas;
37 | return this;
38 | }
39 |
40 | @Override
41 | public MeiTuanAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
42 | return new ViewHolder(mInflater.inflate(R.layout.adapter_wechat_layout, parent, false));
43 | }
44 |
45 | @Override
46 | public void onBindViewHolder(final MeiTuanAdapter.ViewHolder holder, final int position) {
47 | final WeChatBean cityBean = mDatas.get(position);
48 | holder.tvCity.setText(cityBean.getName());
49 | holder.content.setOnClickListener(new View.OnClickListener() {
50 | @Override
51 | public void onClick(View v) {
52 | Toast.makeText(mContext, "pos:" + position, Toast.LENGTH_SHORT).show();
53 | }
54 | });
55 | }
56 |
57 | @Override
58 | public int getItemCount() {
59 | return mDatas != null ? mDatas.size() : 0;
60 | }
61 |
62 | public static class ViewHolder extends RecyclerView.ViewHolder {
63 | TextView tvCity;
64 | View content;
65 |
66 | public ViewHolder(View itemView) {
67 | super(itemView);
68 | tvCity = (TextView) itemView.findViewById(R.id.super_tv_name);
69 | content = itemView.findViewById(R.id.content);
70 | }
71 | }
72 | }
73 |
--------------------------------------------------------------------------------
/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
22 |
23 |
26 |
27 |
30 |
31 |
34 |
35 |
38 |
39 |
42 |
43 |
46 |
47 |
50 |
51 |
54 |
55 |
58 |
59 |
62 |
63 |
66 |
67 |
70 |
71 |
72 |
--------------------------------------------------------------------------------
/app/src/main/java/com/superrecycleview/library/adapter/SwipeMenuAdapter.java:
--------------------------------------------------------------------------------
1 | package com.superrecycleview.library.adapter;
2 |
3 | import android.content.Context;
4 | import android.view.View;
5 |
6 | import com.superrecycleview.library.R;
7 | import com.superrecycleview.superlibrary.adapter.BaseViewHolder;
8 | import com.superrecycleview.superlibrary.adapter.SuperBaseAdapter;
9 | import com.superrecycleview.superlibrary.recycleview.swipemenu.SuperSwipeMenuLayout;
10 |
11 | import java.util.List;
12 |
13 | /**
14 | * Created by super南仔 on 07/28/16.
15 | * blog: http://supercwn.github.io/
16 | * GitHub: https://github.com/supercwn
17 | */
18 | public class SwipeMenuAdapter extends SuperBaseAdapter{
19 |
20 | public SwipeMenuAdapter(Context context, List data) {
21 | super(context, data);
22 | }
23 |
24 | @Override
25 | protected void convert(BaseViewHolder holder, String item, int position) {
26 | final SuperSwipeMenuLayout superSwipeMenuLayout = (SuperSwipeMenuLayout) holder.itemView;
27 | superSwipeMenuLayout.setSwipeEnable(true);//设置是否可以侧滑
28 | if(position%3==0){
29 | holder.setText(R.id.name_tv,item)
30 | .setOnClickListener(R.id.btFavorite,new OnItemChildClickListener())
31 | .setOnClickListener(R.id.btGood,new OnItemChildClickListener())
32 | .setOnClickListener(R.id.image_iv,new OnItemChildClickListener());
33 | } else {
34 | holder.setText(R.id.name_tv,item).setOnClickListener(R.id.btOpen,new OnItemChildClickListener())
35 | .setOnClickListener(R.id.btDelete,new OnItemChildClickListener())
36 | .setOnClickListener(R.id.image_iv,new OnItemChildClickListener());
37 | /**
38 | * 设置可以非滑动触发的开启菜单
39 | */
40 | holder.getView(R.id.image_iv).setOnClickListener(new View.OnClickListener() {
41 | @Override
42 | public void onClick(View view) {
43 | if(superSwipeMenuLayout.isOpen()) {
44 | superSwipeMenuLayout.closeMenu();
45 | } else {
46 | superSwipeMenuLayout.openMenu();
47 | }
48 | }
49 | });
50 | }
51 | }
52 | @Override
53 | protected int getItemViewLayoutId(int position, String item) {
54 | if(position%3==0){
55 | return R.layout.adapter_swipemenu1_layout;
56 | } else {
57 | return R.layout.adapter_swipemenu_layout;
58 | }
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/superlibrary/src/main/java/com/superrecycleview/superlibrary/recycleview/progressindicator/indicator/BallScaleRippleMultipleIndicator.java:
--------------------------------------------------------------------------------
1 | package com.superrecycleview.superlibrary.recycleview.progressindicator.indicator;
2 |
3 | import android.animation.Animator;
4 | import android.animation.ValueAnimator;
5 | import android.graphics.Canvas;
6 | import android.graphics.Paint;
7 | import android.view.animation.LinearInterpolator;
8 |
9 | import java.util.ArrayList;
10 | import java.util.List;
11 |
12 | /**
13 | * Created by Jack on 2015/10/19.
14 | */
15 | public class BallScaleRippleMultipleIndicator extends BallScaleMultipleIndicator{
16 |
17 |
18 | @Override
19 | public void draw(Canvas canvas, Paint paint) {
20 | paint.setStyle(Paint.Style.STROKE);
21 | paint.setStrokeWidth(3);
22 | super.draw(canvas, paint);
23 | }
24 |
25 | @Override
26 | public List createAnimation() {
27 | List animators=new ArrayList<>();
28 | long[] delays=new long[]{0, 200, 400};
29 | for (int i = 0; i < 3; i++) {
30 | final int index=i;
31 | ValueAnimator scaleAnim= ValueAnimator.ofFloat(0,1);
32 | scaleAnim.setInterpolator(new LinearInterpolator());
33 | scaleAnim.setDuration(1000);
34 | scaleAnim.setRepeatCount(-1);
35 | scaleAnim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
36 | @Override
37 | public void onAnimationUpdate(ValueAnimator animation) {
38 | scaleFloats[index] = (float) animation.getAnimatedValue();
39 | postInvalidate();
40 | }
41 | });
42 | scaleAnim.setStartDelay(delays[i]);
43 | scaleAnim.start();
44 |
45 | ValueAnimator alphaAnim= ValueAnimator.ofInt(0,255);
46 | scaleAnim.setInterpolator(new LinearInterpolator());
47 | alphaAnim.setDuration(1000);
48 | alphaAnim.setRepeatCount(-1);
49 | alphaAnim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
50 | @Override
51 | public void onAnimationUpdate(ValueAnimator animation) {
52 | alphaInts[index] = (int) animation.getAnimatedValue();
53 | postInvalidate();
54 | }
55 | });
56 | scaleAnim.setStartDelay(delays[i]);
57 | alphaAnim.start();
58 |
59 | animators.add(scaleAnim);
60 | animators.add(alphaAnim);
61 | }
62 | return animators;
63 | }
64 |
65 | }
66 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/superlibrary/src/main/java/com/superrecycleview/superlibrary/recycleview/progressindicator/indicator/BallGridBeatIndicator.java:
--------------------------------------------------------------------------------
1 | package com.superrecycleview.superlibrary.recycleview.progressindicator.indicator;
2 |
3 | import android.animation.Animator;
4 | import android.animation.ValueAnimator;
5 | import android.graphics.Canvas;
6 | import android.graphics.Paint;
7 |
8 | import java.util.ArrayList;
9 | import java.util.List;
10 |
11 | /**
12 | * Created by Jack on 2015/10/19.
13 | */
14 | public class BallGridBeatIndicator extends BaseIndicatorController {
15 |
16 | public static final int ALPHA=255;
17 |
18 | int[] alphas=new int[]{ALPHA,
19 | ALPHA,
20 | ALPHA,
21 | ALPHA,
22 | ALPHA,
23 | ALPHA,
24 | ALPHA,
25 | ALPHA,
26 | ALPHA};
27 |
28 | @Override
29 | public void draw(Canvas canvas, Paint paint) {
30 | float circleSpacing=4;
31 | float radius=(getWidth()-circleSpacing*4)/6;
32 | float x = getWidth()/ 2-(radius*2+circleSpacing);
33 | float y = getWidth()/ 2-(radius*2+circleSpacing);
34 |
35 | for (int i = 0; i < 3; i++) {
36 | for (int j = 0; j < 3; j++) {
37 | canvas.save();
38 | float translateX=x+(radius*2)*j+circleSpacing*j;
39 | float translateY=y+(radius*2)*i+circleSpacing*i;
40 | canvas.translate(translateX, translateY);
41 | paint.setAlpha(alphas[3 * i + j]);
42 | canvas.drawCircle(0, 0, radius, paint);
43 | canvas.restore();
44 | }
45 | }
46 | }
47 |
48 | @Override
49 | public List createAnimation() {
50 | List animators=new ArrayList<>();
51 |
52 | int[] durations={960, 930, 1190, 1130, 1340, 940, 1200, 820, 1190};
53 | int[] delays= {360, 400, 680, 410, 710, -150, -120, 10, 320};
54 |
55 | for (int i = 0; i < 9; i++) {
56 | final int index=i;
57 | ValueAnimator alphaAnim= ValueAnimator.ofInt(255, 168,255);
58 | alphaAnim.setDuration(durations[i]);
59 | alphaAnim.setRepeatCount(-1);
60 | alphaAnim.setStartDelay(delays[i]);
61 | alphaAnim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
62 | @Override
63 | public void onAnimationUpdate(ValueAnimator animation) {
64 | alphas[index] = (int) animation.getAnimatedValue();
65 | postInvalidate();
66 | }
67 | });
68 | alphaAnim.start();
69 | animators.add(alphaAnim);
70 | }
71 | return animators;
72 | }
73 |
74 |
75 |
76 | }
77 |
--------------------------------------------------------------------------------
/superlibrary/src/main/res/values/attrs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
--------------------------------------------------------------------------------
/superlibrary/src/main/java/com/superrecycleview/superlibrary/recycleview/progressindicator/indicator/BallZigZagDeflectIndicator.java:
--------------------------------------------------------------------------------
1 | package com.superrecycleview.superlibrary.recycleview.progressindicator.indicator;
2 |
3 |
4 | import android.animation.Animator;
5 | import android.animation.ValueAnimator;
6 | import android.view.animation.LinearInterpolator;
7 |
8 | import java.util.ArrayList;
9 | import java.util.List;
10 |
11 | /**
12 | * Created by Jack on 2015/10/19.
13 | */
14 | public class BallZigZagDeflectIndicator extends BallZigZagIndicator {
15 |
16 |
17 |
18 |
19 | @Override
20 | public List createAnimation() {
21 | List animators=new ArrayList<>();
22 | float startX=getWidth()/6;
23 | float startY=getWidth()/6;
24 | for (int i = 0; i < 2; i++) {
25 | final int index=i;
26 | ValueAnimator translateXAnim= ValueAnimator.ofFloat(startX,getWidth()-startX,startX,getWidth()-startX,startX);
27 | if (i==1){
28 | translateXAnim= ValueAnimator.ofFloat(getWidth()-startX,startX,getWidth()-startX,startX,getWidth()-startX);
29 | }
30 | ValueAnimator translateYAnim= ValueAnimator.ofFloat(startY,startY,getHeight()-startY,getHeight()-startY,startY);
31 | if (i==1){
32 | translateYAnim= ValueAnimator.ofFloat(getHeight()-startY,getHeight()-startY,startY,startY,getHeight()-startY);
33 | }
34 |
35 | translateXAnim.setDuration(2000);
36 | translateXAnim.setInterpolator(new LinearInterpolator());
37 | translateXAnim.setRepeatCount(-1);
38 | translateXAnim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
39 | @Override
40 | public void onAnimationUpdate(ValueAnimator animation) {
41 | translateX [index]= (float) animation.getAnimatedValue();
42 | postInvalidate();
43 | }
44 | });
45 | translateXAnim.start();
46 |
47 | translateYAnim.setDuration(2000);
48 | translateYAnim.setInterpolator(new LinearInterpolator());
49 | translateYAnim.setRepeatCount(-1);
50 | translateYAnim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
51 | @Override
52 | public void onAnimationUpdate(ValueAnimator animation) {
53 | translateY [index]= (float) animation.getAnimatedValue();
54 | postInvalidate();
55 | }
56 | });
57 | translateYAnim.start();
58 |
59 | animators.add(translateXAnim);
60 | animators.add(translateYAnim);
61 | }
62 | return animators;
63 | }
64 |
65 | }
66 |
--------------------------------------------------------------------------------
/superlibrary/src/main/java/com/superrecycleview/superlibrary/recycleview/progressindicator/indicator/BaseIndicatorController.java:
--------------------------------------------------------------------------------
1 | package com.superrecycleview.superlibrary.recycleview.progressindicator.indicator;
2 |
3 | import android.animation.Animator;
4 | import android.graphics.Canvas;
5 | import android.graphics.Paint;
6 | import android.view.View;
7 |
8 | import java.util.List;
9 |
10 | /**
11 | * Created by Jack on 2015/10/19.
12 | */
13 | public abstract class BaseIndicatorController {
14 |
15 |
16 | private View mTarget;
17 |
18 | private List mAnimators;
19 |
20 |
21 | public void setTarget(View target){
22 | this.mTarget=target;
23 | }
24 |
25 | public View getTarget(){
26 | return mTarget;
27 | }
28 |
29 |
30 | public int getWidth(){
31 | return mTarget.getWidth();
32 | }
33 |
34 | public int getHeight(){
35 | return mTarget.getHeight();
36 | }
37 |
38 | public void postInvalidate(){
39 | mTarget.postInvalidate();
40 | }
41 |
42 | /**
43 | * draw indicator
44 | * @param canvas
45 | * @param paint
46 | */
47 | public abstract void draw(Canvas canvas, Paint paint);
48 |
49 | /**
50 | * create animation or animations
51 | */
52 | public abstract List createAnimation();
53 |
54 | public void initAnimation(){
55 | mAnimators=createAnimation();
56 | }
57 |
58 | /**
59 | * make animation to start or end when target
60 | * view was be Visible or Gone or Invisible.
61 | * make animation to cancel when target view
62 | * be onDetachedFromWindow.
63 | * @param animStatus
64 | */
65 | public void setAnimationStatus(AnimStatus animStatus){
66 | if (mAnimators==null){
67 | return;
68 | }
69 | int count=mAnimators.size();
70 | for (int i = 0; i < count; i++) {
71 | Animator animator=mAnimators.get(i);
72 | boolean isRunning=animator.isRunning();
73 | switch (animStatus){
74 | case START:
75 | if (!isRunning){
76 | animator.start();
77 | }
78 | break;
79 | case END:
80 | if (isRunning){
81 | animator.end();
82 | }
83 | break;
84 | case CANCEL:
85 | if (isRunning){
86 | animator.cancel();
87 | }
88 | break;
89 | }
90 | }
91 | }
92 |
93 |
94 | public enum AnimStatus{
95 | START,END,CANCEL
96 | }
97 |
98 |
99 |
100 | }
101 |
--------------------------------------------------------------------------------
/superlibrary/src/main/java/com/superrecycleview/superlibrary/recycleview/progressindicator/indicator/BallScaleMultipleIndicator.java:
--------------------------------------------------------------------------------
1 | package com.superrecycleview.superlibrary.recycleview.progressindicator.indicator;
2 |
3 | import android.animation.Animator;
4 | import android.animation.ValueAnimator;
5 | import android.graphics.Canvas;
6 | import android.graphics.Paint;
7 | import android.view.animation.LinearInterpolator;
8 |
9 | import java.util.ArrayList;
10 | import java.util.List;
11 |
12 | /**
13 | * Created by Jack on 2015/10/19.
14 | */
15 | public class BallScaleMultipleIndicator extends BaseIndicatorController {
16 |
17 | float[] scaleFloats=new float[]{1,1,1};
18 | int[] alphaInts=new int[]{255,255,255};
19 |
20 | @Override
21 | public void draw(Canvas canvas, Paint paint) {
22 | float circleSpacing=4;
23 | for (int i = 0; i < 3; i++) {
24 | paint.setAlpha(alphaInts[i]);
25 | canvas.scale(scaleFloats[i],scaleFloats[i],getWidth()/2,getHeight()/2);
26 | canvas.drawCircle(getWidth()/2,getHeight()/2,getWidth()/2-circleSpacing,paint);
27 | }
28 | }
29 |
30 | @Override
31 | public List createAnimation() {
32 | List animators=new ArrayList<>();
33 | long[] delays=new long[]{0, 200, 400};
34 | for (int i = 0; i < 3; i++) {
35 | final int index=i;
36 | ValueAnimator scaleAnim= ValueAnimator.ofFloat(0,1);
37 | scaleAnim.setInterpolator(new LinearInterpolator());
38 | scaleAnim.setDuration(1000);
39 | scaleAnim.setRepeatCount(-1);
40 | scaleAnim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
41 | @Override
42 | public void onAnimationUpdate(ValueAnimator animation) {
43 | scaleFloats[index] = (float) animation.getAnimatedValue();
44 | postInvalidate();
45 | }
46 | });
47 | scaleAnim.setStartDelay(delays[i]);
48 | scaleAnim.start();
49 |
50 | ValueAnimator alphaAnim= ValueAnimator.ofInt(255,0);
51 | alphaAnim.setInterpolator(new LinearInterpolator());
52 | alphaAnim.setDuration(1000);
53 | alphaAnim.setRepeatCount(-1);
54 | alphaAnim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
55 | @Override
56 | public void onAnimationUpdate(ValueAnimator animation) {
57 | alphaInts[index] = (int) animation.getAnimatedValue();
58 | postInvalidate();
59 | }
60 | });
61 | scaleAnim.setStartDelay(delays[i]);
62 | alphaAnim.start();
63 |
64 | animators.add(scaleAnim);
65 | animators.add(alphaAnim);
66 | }
67 | return animators;
68 | }
69 |
70 | }
71 |
--------------------------------------------------------------------------------
/superlibrary/src/main/res/layout/listview_header.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
13 |
14 |
22 |
23 |
28 |
29 |
34 |
35 |
40 |
41 |
46 |
47 |
48 |
49 |
58 |
59 |
68 |
69 |
70 |
--------------------------------------------------------------------------------
/superlibrary/src/main/java/com/superrecycleview/superlibrary/recycleview/progressindicator/indicator/BallBeatIndicator.java:
--------------------------------------------------------------------------------
1 | package com.superrecycleview.superlibrary.recycleview.progressindicator.indicator;
2 |
3 | import android.animation.Animator;
4 | import android.animation.ValueAnimator;
5 | import android.graphics.Canvas;
6 | import android.graphics.Paint;
7 |
8 | import java.util.ArrayList;
9 | import java.util.List;
10 |
11 | /**
12 | * Created by Jack on 2015/10/19.
13 | */
14 | public class BallBeatIndicator extends BaseIndicatorController {
15 |
16 | public static final float SCALE=1.0f;
17 |
18 | public static final int ALPHA=255;
19 |
20 | private float[] scaleFloats=new float[]{SCALE,
21 | SCALE,
22 | SCALE};
23 |
24 | int[] alphas=new int[]{ALPHA,
25 | ALPHA,
26 | ALPHA,};
27 |
28 | @Override
29 | public void draw(Canvas canvas, Paint paint) {
30 | float circleSpacing=4;
31 | float radius=(getWidth()-circleSpacing*2)/6;
32 | float x = getWidth()/ 2-(radius*2+circleSpacing);
33 | float y=getHeight() / 2;
34 | for (int i = 0; i < 3; i++) {
35 | canvas.save();
36 | float translateX=x+(radius*2)*i+circleSpacing*i;
37 | canvas.translate(translateX, y);
38 | canvas.scale(scaleFloats[i], scaleFloats[i]);
39 | paint.setAlpha(alphas[i]);
40 | canvas.drawCircle(0, 0, radius, paint);
41 | canvas.restore();
42 | }
43 | }
44 |
45 | @Override
46 | public List createAnimation() {
47 | List animators=new ArrayList<>();
48 | int[] delays=new int[]{350,0,350};
49 | for (int i = 0; i < 3; i++) {
50 | final int index=i;
51 | ValueAnimator scaleAnim= ValueAnimator.ofFloat(1,0.75f,1);
52 | scaleAnim.setDuration(700);
53 | scaleAnim.setRepeatCount(-1);
54 | scaleAnim.setStartDelay(delays[i]);
55 | scaleAnim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
56 | @Override
57 | public void onAnimationUpdate(ValueAnimator animation) {
58 | scaleFloats[index] = (float) animation.getAnimatedValue();
59 | postInvalidate();
60 | }
61 | });
62 | scaleAnim.start();
63 |
64 | ValueAnimator alphaAnim= ValueAnimator.ofInt(255,51,255);
65 | alphaAnim.setDuration(700);
66 | alphaAnim.setRepeatCount(-1);
67 | alphaAnim.setStartDelay(delays[i]);
68 | alphaAnim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
69 | @Override
70 | public void onAnimationUpdate(ValueAnimator animation) {
71 | alphas[index] = (int) animation.getAnimatedValue();
72 | postInvalidate();
73 | }
74 | });
75 | alphaAnim.start();
76 | animators.add(scaleAnim);
77 | animators.add(alphaAnim);
78 | }
79 | return animators;
80 | }
81 |
82 | }
83 |
--------------------------------------------------------------------------------
/superlibrary/src/main/java/com/superrecycleview/superlibrary/recycleview/JellyView.java:
--------------------------------------------------------------------------------
1 | package com.superrecycleview.superlibrary.recycleview;
2 |
3 | import android.annotation.TargetApi;
4 | import android.content.Context;
5 | import android.graphics.Canvas;
6 | import android.graphics.Paint;
7 | import android.graphics.Path;
8 | import android.os.Build;
9 | import android.util.AttributeSet;
10 | import android.util.Log;
11 | import android.view.View;
12 |
13 | /**
14 | * Created by Jack on 2015/10/19.
15 | */
16 | public class JellyView extends View implements BaseRefreshHeader{
17 | Path path;
18 |
19 | Paint paint;
20 |
21 | private int minimumHeight = 0;
22 |
23 | private int jellyHeight =0;
24 |
25 | public JellyView(Context context) {
26 | super(context);
27 | init();
28 | }
29 |
30 | public JellyView(Context context, AttributeSet attrs) {
31 | super(context, attrs);
32 | init();
33 | }
34 |
35 | public JellyView(Context context, AttributeSet attrs, int defStyleAttr) {
36 | super(context, attrs, defStyleAttr);
37 | init();
38 | }
39 |
40 | @SuppressWarnings("unused")
41 | @TargetApi(Build.VERSION_CODES.LOLLIPOP)
42 | public JellyView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
43 | super(context, attrs, defStyleAttr, defStyleRes);
44 | init();
45 | }
46 |
47 | private void init() {
48 | if (isInEditMode()) {
49 | return;
50 | }
51 | path = new Path();
52 | paint = new Paint();
53 | paint.setColor(getContext().getResources().getColor(android.R.color.holo_blue_bright));
54 | paint.setAntiAlias(true);
55 | }
56 |
57 | public void setJellyColor(int jellyColor) {
58 | paint.setColor(jellyColor);
59 | }
60 |
61 | @Override
62 | protected void onDraw(Canvas canvas) {
63 | super.onDraw(canvas);
64 | path.reset();
65 | path.lineTo(0, minimumHeight);
66 | path.quadTo(getMeasuredWidth() / 2, minimumHeight + jellyHeight, getMeasuredWidth(), minimumHeight);
67 | path.lineTo(getMeasuredWidth(), 0);
68 | canvas.drawPath(path, paint);
69 | }
70 |
71 | @Override
72 | public void setMinimumHeight(int minimumHeight) {
73 | this.minimumHeight = minimumHeight;
74 | }
75 |
76 | public void setJellyHeight(int ribbonHeight) {
77 | this.jellyHeight = ribbonHeight;
78 | }
79 |
80 | @Override
81 | public int getMinimumHeight() {
82 | return minimumHeight;
83 | }
84 |
85 | public int getJellyHeight() {
86 | return jellyHeight;
87 | }
88 |
89 |
90 | @Override
91 | public void refreshComplete(){
92 |
93 | }
94 |
95 | @Override
96 | public void onMove(float delta) {
97 | jellyHeight = jellyHeight + (int)delta;
98 | Log.i("jellyHeight", "delta = " + delta);
99 | this.invalidate();
100 | }
101 |
102 | @Override
103 | public boolean releaseAction() {
104 | return false;
105 | }
106 | }
107 |
--------------------------------------------------------------------------------
/superlibrary/src/main/java/com/superrecycleview/superlibrary/recycleview/progressindicator/indicator/BallZigZagIndicator.java:
--------------------------------------------------------------------------------
1 | package com.superrecycleview.superlibrary.recycleview.progressindicator.indicator;
2 |
3 | import android.animation.Animator;
4 | import android.animation.ValueAnimator;
5 | import android.graphics.Canvas;
6 | import android.graphics.Paint;
7 | import android.view.animation.LinearInterpolator;
8 |
9 | import java.util.ArrayList;
10 | import java.util.List;
11 |
12 | /**
13 | * Created by Jack on 2015/10/19.
14 | */
15 | public class BallZigZagIndicator extends BaseIndicatorController {
16 |
17 | float[] translateX=new float[2],translateY=new float[2];
18 |
19 |
20 | @Override
21 | public void draw(Canvas canvas, Paint paint) {
22 | for (int i = 0; i < 2; i++) {
23 | canvas.save();
24 | canvas.translate(translateX[i], translateY[i]);
25 | canvas.drawCircle(0, 0, getWidth() / 10, paint);
26 | canvas.restore();
27 | }
28 | }
29 |
30 | @Override
31 | public List createAnimation() {
32 | List animators=new ArrayList<>();
33 | float startX=getWidth()/6;
34 | float startY=getWidth()/6;
35 | for (int i = 0; i < 2; i++) {
36 | final int index=i;
37 | ValueAnimator translateXAnim= ValueAnimator.ofFloat(startX,getWidth()-startX,getWidth()/2,startX);
38 | if (i==1){
39 | translateXAnim= ValueAnimator.ofFloat(getWidth()-startX,startX,getWidth()/2,getWidth()-startX);
40 | }
41 | ValueAnimator translateYAnim= ValueAnimator.ofFloat(startY,startY,getHeight()/2,startY);
42 | if (i==1){
43 | translateYAnim= ValueAnimator.ofFloat(getHeight()-startY,getHeight()-startY,getHeight()/2,getHeight()-startY);
44 | }
45 |
46 | translateXAnim.setDuration(1000);
47 | translateXAnim.setInterpolator(new LinearInterpolator());
48 | translateXAnim.setRepeatCount(-1);
49 | translateXAnim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
50 | @Override
51 | public void onAnimationUpdate(ValueAnimator animation) {
52 | translateX[index] = (float) animation.getAnimatedValue();
53 | postInvalidate();
54 | }
55 | });
56 | translateXAnim.start();
57 |
58 | translateYAnim.setDuration(1000);
59 | translateYAnim.setInterpolator(new LinearInterpolator());
60 | translateYAnim.setRepeatCount(-1);
61 | translateYAnim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
62 | @Override
63 | public void onAnimationUpdate(ValueAnimator animation) {
64 | translateY[index] = (float) animation.getAnimatedValue();
65 | postInvalidate();
66 | }
67 | });
68 | translateYAnim.start();
69 | animators.add(translateXAnim);
70 | animators.add(translateYAnim);
71 | }
72 | return animators;
73 | }
74 |
75 | }
76 |
--------------------------------------------------------------------------------
/superlibrary/src/main/java/com/superrecycleview/superlibrary/recycleview/progressindicator/indicator/BallClipRotateMultipleIndicator.java:
--------------------------------------------------------------------------------
1 | package com.superrecycleview.superlibrary.recycleview.progressindicator.indicator;
2 |
3 | import android.animation.Animator;
4 | import android.animation.ValueAnimator;
5 | import android.graphics.Canvas;
6 | import android.graphics.Paint;
7 | import android.graphics.RectF;
8 |
9 | import java.util.ArrayList;
10 | import java.util.List;
11 |
12 | /**
13 | * Created by Jack on 2015/10/19.
14 | */
15 | public class BallClipRotateMultipleIndicator extends BaseIndicatorController{
16 |
17 | float scaleFloat=1,degrees;
18 |
19 |
20 | @Override
21 | public void draw(Canvas canvas, Paint paint) {
22 | paint.setStrokeWidth(3);
23 | paint.setStyle(Paint.Style.STROKE);
24 |
25 | float circleSpacing=12;
26 | float x=getWidth()/2;
27 | float y=getHeight()/2;
28 |
29 | canvas.save();
30 |
31 | canvas.translate(x, y);
32 | canvas.scale(scaleFloat, scaleFloat);
33 | canvas.rotate(degrees);
34 |
35 | //draw two big arc
36 | float[] bStartAngles=new float[]{135,-45};
37 | for (int i = 0; i < 2; i++) {
38 | RectF rectF=new RectF(-x+circleSpacing,-y+circleSpacing,x-circleSpacing,y-circleSpacing);
39 | canvas.drawArc(rectF, bStartAngles[i], 90, false, paint);
40 | }
41 |
42 | canvas.restore();
43 | canvas.translate(x, y);
44 | canvas.scale(scaleFloat, scaleFloat);
45 | canvas.rotate(-degrees);
46 | //draw two small arc
47 | float[] sStartAngles=new float[]{225,45};
48 | for (int i = 0; i < 2; i++) {
49 | RectF rectF=new RectF(-x/1.8f+circleSpacing,-y/1.8f+circleSpacing,x/1.8f-circleSpacing,y/1.8f-circleSpacing);
50 | canvas.drawArc(rectF, sStartAngles[i], 90, false, paint);
51 | }
52 | }
53 |
54 | @Override
55 | public List createAnimation() {
56 | List animators=new ArrayList<>();
57 | ValueAnimator scaleAnim= ValueAnimator.ofFloat(1,0.6f,1);
58 | scaleAnim.setDuration(1000);
59 | scaleAnim.setRepeatCount(-1);
60 | scaleAnim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
61 | @Override
62 | public void onAnimationUpdate(ValueAnimator animation) {
63 | scaleFloat = (float) animation.getAnimatedValue();
64 | postInvalidate();
65 | }
66 | });
67 | scaleAnim.start();
68 |
69 | ValueAnimator rotateAnim= ValueAnimator.ofFloat(0, 180,360);
70 | rotateAnim.setDuration(1000);
71 | rotateAnim.setRepeatCount(-1);
72 | rotateAnim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
73 | @Override
74 | public void onAnimationUpdate(ValueAnimator animation) {
75 | degrees = (float) animation.getAnimatedValue();
76 | postInvalidate();
77 | }
78 | });
79 | rotateAnim.start();
80 | animators.add(scaleAnim);
81 | animators.add(rotateAnim);
82 | return animators;
83 | }
84 |
85 | }
86 |
--------------------------------------------------------------------------------
/superlibrary/src/main/java/com/superrecycleview/superlibrary/adapter/AnimationUtil.java:
--------------------------------------------------------------------------------
1 | package com.superrecycleview.superlibrary.adapter;
2 |
3 | import android.animation.Animator;
4 | import android.animation.AnimatorSet;
5 | import android.animation.ObjectAnimator;
6 | import android.view.View;
7 | import android.view.animation.Interpolator;
8 |
9 | /**
10 | * Created by super南仔 on 07/28/16.
11 | * blog: http://supercwn.github.io/
12 | * GitHub: https://github.com/supercwn
13 | */
14 | public class AnimationUtil {
15 | private AnimationType mAnimationType = AnimationType.ALPHA;
16 | private Animator mCustomAnimator;
17 | private View mTargetView;
18 | private Interpolator mInterpolator;
19 | private int mDuration = 300;
20 |
21 | public AnimationUtil() {
22 | }
23 |
24 | public AnimationUtil setAnimationType(AnimationType animationType) {
25 | mAnimationType = animationType;
26 | return this;
27 | }
28 |
29 | public AnimationUtil setCustomAnimation(Animator animator) {
30 | mCustomAnimator = animator;
31 | return this;
32 | }
33 |
34 | public AnimationUtil setDuration(int duration) {
35 | mDuration = duration;
36 | return this;
37 | }
38 |
39 | public AnimationUtil setInterpolator(Interpolator interpolator) {
40 | mInterpolator = interpolator;
41 | return this;
42 | }
43 |
44 | public AnimationUtil setTargetView(View targetView) {
45 | mTargetView = targetView;
46 | return this;
47 | }
48 |
49 | public void start() {
50 | if (null != mCustomAnimator) {
51 | mCustomAnimator.start();
52 | } else if (null == mTargetView) {
53 | throw new IllegalArgumentException("You must set a target view!");
54 | } else {
55 | startAnimation(mAnimationType);
56 | }
57 | }
58 |
59 | private void startAnimation(AnimationType animationType) {
60 | AnimatorSet animatorSet = new AnimatorSet();
61 | switch (animationType) {
62 | case ALPHA:
63 | animatorSet.play(ObjectAnimator.ofFloat(mTargetView, "alpha", 0.7f, 1f));
64 | break;
65 | case SCALE:
66 | animatorSet.playTogether(ObjectAnimator.ofFloat(mTargetView, "scaleX", 0.6f, 1f)
67 | , ObjectAnimator.ofFloat(mTargetView, "scaleY", 0.6f, 1f));
68 | break;
69 | case SLIDE_FROM_BOTTOM:
70 | animatorSet.play(ObjectAnimator.ofFloat(mTargetView, "translationY", mTargetView
71 | .getMeasuredHeight(), 0));
72 | break;
73 | case SLIDE_FROM_LEFT:
74 | animatorSet.play(ObjectAnimator.ofFloat(mTargetView, "translationX", -mTargetView
75 | .getRootView().getWidth(), 0));
76 | break;
77 | case SLIDE_FROM_RIGHT:
78 | animatorSet.play(ObjectAnimator.ofFloat(mTargetView, "translationX", mTargetView
79 | .getRootView().getWidth(), 0));
80 | break;
81 | }
82 |
83 | if (null != mInterpolator) {
84 | animatorSet.setInterpolator(mInterpolator);
85 | }
86 | animatorSet.setDuration(mDuration);
87 | animatorSet.start();
88 | }
89 | }
90 |
--------------------------------------------------------------------------------
/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 | 1.8
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
--------------------------------------------------------------------------------
/superlibrary/src/main/java/com/superrecycleview/superlibrary/recycleview/progressindicator/indicator/BallClipRotatePulseIndicator.java:
--------------------------------------------------------------------------------
1 | package com.superrecycleview.superlibrary.recycleview.progressindicator.indicator;
2 |
3 | import android.animation.Animator;
4 | import android.animation.ValueAnimator;
5 | import android.graphics.Canvas;
6 | import android.graphics.Paint;
7 | import android.graphics.RectF;
8 |
9 | import java.util.ArrayList;
10 | import java.util.List;
11 |
12 | /**
13 | * Created by Jack on 2015/10/19.
14 | */
15 | public class BallClipRotatePulseIndicator extends BaseIndicatorController {
16 |
17 | float scaleFloat1,scaleFloat2,degrees;
18 |
19 |
20 | @Override
21 | public void draw(Canvas canvas, Paint paint) {
22 | float circleSpacing=12;
23 | float x=getWidth()/2;
24 | float y=getHeight()/2;
25 |
26 | //draw fill circle
27 | canvas.save();
28 | canvas.translate(x, y);
29 | canvas.scale(scaleFloat1, scaleFloat1);
30 | paint.setStyle(Paint.Style.FILL);
31 | canvas.drawCircle(0, 0, x / 2.5f, paint);
32 |
33 | canvas.restore();
34 |
35 | canvas.translate(x, y);
36 | canvas.scale(scaleFloat2, scaleFloat2);
37 | canvas.rotate(degrees);
38 |
39 | paint.setStrokeWidth(3);
40 | paint.setStyle(Paint.Style.STROKE);
41 |
42 | //draw two arc
43 | float[] startAngles=new float[]{225,45};
44 | for (int i = 0; i < 2; i++) {
45 | RectF rectF=new RectF(-x+circleSpacing,-y+circleSpacing,x-circleSpacing,y-circleSpacing);
46 | canvas.drawArc(rectF, startAngles[i], 90, false, paint);
47 | }
48 | }
49 |
50 | @Override
51 | public List createAnimation() {
52 | ValueAnimator scaleAnim= ValueAnimator.ofFloat(1,0.3f,1);
53 | scaleAnim.setDuration(1000);
54 | scaleAnim.setRepeatCount(-1);
55 | scaleAnim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
56 | @Override
57 | public void onAnimationUpdate(ValueAnimator animation) {
58 | scaleFloat1 = (float) animation.getAnimatedValue();
59 | postInvalidate();
60 | }
61 | });
62 | scaleAnim.start();
63 |
64 | ValueAnimator scaleAnim2= ValueAnimator.ofFloat(1,0.6f,1);
65 | scaleAnim2.setDuration(1000);
66 | scaleAnim2.setRepeatCount(-1);
67 | scaleAnim2.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
68 | @Override
69 | public void onAnimationUpdate(ValueAnimator animation) {
70 | scaleFloat2 = (float) animation.getAnimatedValue();
71 | postInvalidate();
72 | }
73 | });
74 | scaleAnim2.start();
75 |
76 | ValueAnimator rotateAnim= ValueAnimator.ofFloat(0, 180,360);
77 | rotateAnim.setDuration(1000);
78 | rotateAnim.setRepeatCount(-1);
79 | rotateAnim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
80 | @Override
81 | public void onAnimationUpdate(ValueAnimator animation) {
82 | degrees = (float) animation.getAnimatedValue();
83 | postInvalidate();
84 | }
85 | });
86 | rotateAnim.start();
87 | List animators=new ArrayList<>();
88 | animators.add(scaleAnim);
89 | animators.add(scaleAnim2);
90 | animators.add(rotateAnim);
91 | return animators;
92 | }
93 |
94 | }
95 |
--------------------------------------------------------------------------------
/superlibrary/src/main/java/com/superrecycleview/superlibrary/recycleview/SimpleItemTouchHelperCallback.java:
--------------------------------------------------------------------------------
1 | package com.superrecycleview.superlibrary.recycleview;
2 |
3 | import android.graphics.Canvas;
4 | import android.graphics.Color;
5 | import android.support.v7.widget.RecyclerView;
6 | import android.support.v7.widget.helper.ItemTouchHelper;
7 | import android.view.View;
8 |
9 | /**
10 | * Created by Jack on 2015/10/19.
11 | */
12 | public class SimpleItemTouchHelperCallback extends ItemTouchHelper.Callback {
13 |
14 | public static final float ALPHA_FULL = 1.0f;
15 |
16 | private final ItemTouchHelperAdapter mAdapter;
17 | private SuperRecyclerView mSrecyclerView;
18 |
19 | public SimpleItemTouchHelperCallback(ItemTouchHelperAdapter adapter, SuperRecyclerView recyclerView) {
20 | mAdapter = adapter;
21 | this.mSrecyclerView = recyclerView;
22 | }
23 |
24 | @Override
25 | public boolean isLongPressDragEnabled() {
26 | return true;
27 | }
28 |
29 | @Override
30 | public boolean isItemViewSwipeEnabled() {
31 | return true;
32 | }
33 |
34 | @Override
35 | public int getMovementFlags(RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder) {
36 | // Enable drag and swipe in both directions
37 | final int dragFlags = ItemTouchHelper.UP | ItemTouchHelper.DOWN;
38 | final int swipeFlags = ItemTouchHelper.START | ItemTouchHelper.END;
39 | return makeMovementFlags(dragFlags, swipeFlags);
40 | }
41 |
42 | @Override
43 | public boolean onMove(RecyclerView recyclerView, RecyclerView.ViewHolder source, RecyclerView.ViewHolder target) {
44 | if (source.getItemViewType() != target.getItemViewType()) {
45 | return false;
46 | }
47 | // Notify the adapter of the move
48 | mAdapter.onItemMove(source.getAdapterPosition(), target.getAdapterPosition());
49 | return true;
50 | }
51 |
52 | @Override
53 | public void onSwiped(RecyclerView.ViewHolder viewHolder, int i) {
54 | // Notify the adapter of the dismissal
55 | mAdapter.onItemDismiss(viewHolder.getAdapterPosition());
56 | }
57 |
58 | @Override
59 | public void onChildDraw(Canvas c, RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder, float dX, float dY, int actionState, boolean isCurrentlyActive) {
60 | super.onChildDraw(c, recyclerView, viewHolder, dX, dY, actionState, isCurrentlyActive);
61 |
62 | // Fade out the view as it is swiped out of the parent's bounds
63 | if (actionState == ItemTouchHelper.ACTION_STATE_SWIPE) {
64 | View itemView = viewHolder.itemView;
65 | final float alpha = ALPHA_FULL - Math.abs(dX) / (float) itemView.getWidth();
66 | itemView.setAlpha(alpha);
67 | }
68 | }
69 |
70 | @Override
71 | public void onSelectedChanged(RecyclerView.ViewHolder viewHolder, int actionState) {
72 | if (actionState != ItemTouchHelper.ACTION_STATE_IDLE) {
73 | // Let the view holder know that this item is being moved or dragged
74 | viewHolder.itemView.setBackgroundColor(Color.LTGRAY);
75 | }
76 |
77 | super.onSelectedChanged(viewHolder, actionState);
78 | }
79 |
80 | @Override
81 | public void clearView(RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder) {
82 | super.clearView(recyclerView, viewHolder);
83 | viewHolder.itemView.setAlpha(ALPHA_FULL);
84 | viewHolder.itemView.setBackgroundColor(0);
85 | }
86 | }
87 |
--------------------------------------------------------------------------------
/superlibrary/src/main/java/com/superrecycleview/superlibrary/recycleview/progressindicator/indicator/BallTrianglePathIndicator.java:
--------------------------------------------------------------------------------
1 | package com.superrecycleview.superlibrary.recycleview.progressindicator.indicator;
2 |
3 | import android.animation.Animator;
4 | import android.animation.ValueAnimator;
5 | import android.graphics.Canvas;
6 | import android.graphics.Paint;
7 | import android.view.animation.LinearInterpolator;
8 |
9 | import java.util.ArrayList;
10 | import java.util.List;
11 |
12 | /**
13 | * Created by Jack on 2015/10/19.
14 | */
15 | public class BallTrianglePathIndicator extends BaseIndicatorController {
16 |
17 | float[] translateX=new float[3],translateY=new float[3];
18 |
19 | @Override
20 | public void draw(Canvas canvas, Paint paint) {
21 | paint.setStrokeWidth(3);
22 | paint.setStyle(Paint.Style.STROKE);
23 | for (int i = 0; i < 3; i++) {
24 | canvas.save();
25 | canvas.translate(translateX[i], translateY[i]);
26 | canvas.drawCircle(0, 0, getWidth() / 10, paint);
27 | canvas.restore();
28 | }
29 | }
30 |
31 | @Override
32 | public List createAnimation() {
33 | List animators=new ArrayList<>();
34 | float startX=getWidth()/5;
35 | float startY=getWidth()/5;
36 | for (int i = 0; i < 3; i++) {
37 | final int index=i;
38 | ValueAnimator translateXAnim= ValueAnimator.ofFloat(getWidth()/2,getWidth()-startX,startX,getWidth()/2);
39 | if (i==1){
40 | translateXAnim= ValueAnimator.ofFloat(getWidth()-startX,startX,getWidth()/2,getWidth()-startX);
41 | }else if (i==2){
42 | translateXAnim= ValueAnimator.ofFloat(startX,getWidth()/2,getWidth()-startX,startX);
43 | }
44 | ValueAnimator translateYAnim= ValueAnimator.ofFloat(startY,getHeight()-startY,getHeight()-startY,startY);
45 | if (i==1){
46 | translateYAnim= ValueAnimator.ofFloat(getHeight()-startY,getHeight()-startY,startY,getHeight()-startY);
47 | }else if (i==2){
48 | translateYAnim= ValueAnimator.ofFloat(getHeight()-startY,startY,getHeight()-startY,getHeight()-startY);
49 | }
50 |
51 | translateXAnim.setDuration(2000);
52 | translateXAnim.setInterpolator(new LinearInterpolator());
53 | translateXAnim.setRepeatCount(-1);
54 | translateXAnim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
55 | @Override
56 | public void onAnimationUpdate(ValueAnimator animation) {
57 | translateX [index]= (float) animation.getAnimatedValue();
58 | postInvalidate();
59 | }
60 | });
61 | translateXAnim.start();
62 |
63 | translateYAnim.setDuration(2000);
64 | translateYAnim.setInterpolator(new LinearInterpolator());
65 | translateYAnim.setRepeatCount(-1);
66 | translateYAnim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
67 | @Override
68 | public void onAnimationUpdate(ValueAnimator animation) {
69 | translateY [index]= (float) animation.getAnimatedValue();
70 | postInvalidate();
71 | }
72 | });
73 | translateYAnim.start();
74 |
75 | animators.add(translateXAnim);
76 | animators.add(translateYAnim);
77 | }
78 | return animators;
79 | }
80 |
81 |
82 | }
83 |
--------------------------------------------------------------------------------
/superlibrary/src/main/java/com/superrecycleview/superlibrary/recycleview/LoadingMoreFooter.java:
--------------------------------------------------------------------------------
1 | package com.superrecycleview.superlibrary.recycleview;
2 |
3 | import android.content.Context;
4 | import android.support.v7.widget.RecyclerView;
5 | import android.util.AttributeSet;
6 | import android.view.Gravity;
7 | import android.view.View;
8 | import android.view.ViewGroup;
9 | import android.widget.LinearLayout;
10 | import android.widget.ProgressBar;
11 | import android.widget.TextView;
12 | import com.superrecycleview.superlibrary.recycleview.progressindicator.AVLoadingIndicatorView;
13 |
14 | /**
15 | * Created by Jack on 2015/10/19.
16 | * update by super南仔
17 | */
18 | public class LoadingMoreFooter extends LinearLayout {
19 |
20 | private SimpleViewSwitcher progressCon;
21 | public final static int STATE_LOADING = 0;
22 | public final static int STATE_COMPLETE = 1;
23 | public final static int STATE_NOMORE = 2;
24 | private TextView mText;
25 |
26 |
27 | public LoadingMoreFooter(Context context) {
28 | super(context);
29 | initView();
30 | }
31 |
32 | /**
33 | * @param context
34 | * @param attrs
35 | */
36 | public LoadingMoreFooter(Context context, AttributeSet attrs) {
37 | super(context, attrs);
38 | initView();
39 | }
40 | public void initView(){
41 | setGravity(Gravity.CENTER);
42 | setLayoutParams(new RecyclerView.LayoutParams(
43 | ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT));
44 | progressCon = new SimpleViewSwitcher(getContext());
45 | progressCon.setLayoutParams(new ViewGroup.LayoutParams(
46 | ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT));
47 |
48 | AVLoadingIndicatorView progressView = new AVLoadingIndicatorView(this.getContext());
49 | progressView.setIndicatorColor(0xffB5B5B5);
50 | progressView.setIndicatorId(ProgressStyle.BallSpinFadeLoader);
51 | progressCon.setView(progressView);
52 |
53 | addView(progressCon);
54 | mText = new TextView(getContext());
55 | mText.setText("正在加载");
56 |
57 | LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
58 | layoutParams.setMargins(10,0,0,0 );
59 |
60 | mText.setLayoutParams(layoutParams);
61 | addView(mText);
62 | }
63 |
64 | public void setProgressStyle(int style) {
65 | if(style == ProgressStyle.SysProgress){
66 | progressCon.setView(new ProgressBar(getContext(), null, android.R.attr.progressBarStyle));
67 | }else{
68 | AVLoadingIndicatorView progressView = new AVLoadingIndicatorView(this.getContext());
69 | progressView.setIndicatorColor(0xffB5B5B5);
70 | progressView.setIndicatorId(style);
71 | progressCon.setView(progressView);
72 | }
73 | }
74 |
75 | public void setState(int state) {
76 | switch(state) {
77 | case STATE_LOADING:
78 | progressCon.setVisibility(View.VISIBLE);
79 | mText.setText("正在加载");
80 | this.setVisibility(View.VISIBLE);
81 | break;
82 | case STATE_COMPLETE:
83 | mText.setText("正在加载");
84 | this.setVisibility(View.GONE);
85 | break;
86 | case STATE_NOMORE:
87 | mText.setText("没有更多了");
88 | progressCon.setVisibility(View.GONE);
89 | this.setVisibility(View.VISIBLE);
90 | break;
91 | }
92 | }
93 | }
94 |
--------------------------------------------------------------------------------
/app/src/main/java/com/superrecycleview/library/MainActivity.java:
--------------------------------------------------------------------------------
1 |
2 | package com.superrecycleview.library;
3 |
4 | import android.content.Intent;
5 | import android.os.Bundle;
6 | import android.support.v7.app.AppCompatActivity;
7 | import android.support.v7.widget.LinearLayoutManager;
8 | import android.view.View;
9 |
10 | import com.superrecycleview.library.adapter.MainAdapter;
11 | import com.superrecycleview.library.ui.AnimationActivity;
12 | import com.superrecycleview.library.ui.DragActivity;
13 | import com.superrecycleview.library.ui.GradualChangeActivity;
14 | import com.superrecycleview.library.ui.HeaderAndFooterActivity;
15 | import com.superrecycleview.library.ui.ItemClickActivity;
16 | import com.superrecycleview.library.ui.LayoutManagerActivity;
17 | import com.superrecycleview.library.ui.MultiItemActivity;
18 | import com.superrecycleview.library.ui.RefreshAndLoadMoreActivity;
19 | import com.superrecycleview.library.ui.SideBarActivity;
20 | import com.superrecycleview.library.ui.SwipeMenuActivity;
21 | import com.superrecycleview.superlibrary.adapter.SuperBaseAdapter;
22 | import com.superrecycleview.superlibrary.recycleview.SuperRecyclerView;
23 |
24 | import java.util.ArrayList;
25 | import java.util.List;
26 |
27 | /**
28 | * Created by super南仔 on 07/28/16. blog: http://supercwn.github.io/ GitHub:
29 | * https://github.com/supercwn
30 | */
31 | public class MainActivity extends AppCompatActivity
32 | implements SuperBaseAdapter.OnItemClickListener {
33 |
34 | private static final String[] titles = {
35 | "AnimationActivity", "HeaderViewAndFooterView", "RefreshAndLoadMoreActivity",
36 | "Gradual change", "MultiItemActivity", "ItemClickActivity", "SwipeMenuActivity",
37 | "DragActivity", "LayoutManagerActivity", "SideBarActivity"
38 | };
39 | private static final Class>[] ACTIVITY = {
40 | AnimationActivity.class, HeaderAndFooterActivity.class,
41 | RefreshAndLoadMoreActivity.class, GradualChangeActivity.class, MultiItemActivity.class,
42 | ItemClickActivity.class, SwipeMenuActivity.class, DragActivity.class,
43 | LayoutManagerActivity.class, SideBarActivity.class
44 | };
45 | private List dataList = new ArrayList<>();
46 |
47 | private SuperRecyclerView superRecyclerView;
48 |
49 | private MainAdapter mAdapter;
50 |
51 | @Override
52 | protected void onCreate(Bundle savedInstanceState) {
53 | super.onCreate(savedInstanceState);
54 | setContentView(R.layout.activity_main);
55 | initView();
56 | initDatas();
57 | initAdapter();
58 | }
59 |
60 | private void initView() {
61 | superRecyclerView = (SuperRecyclerView) findViewById(R.id.super_recycle_view);
62 | LinearLayoutManager layoutManager = new LinearLayoutManager(this);
63 | layoutManager.setOrientation(LinearLayoutManager.VERTICAL);
64 | superRecyclerView.setLayoutManager(layoutManager);
65 | superRecyclerView.setRefreshEnabled(false);
66 | superRecyclerView.setLoadMoreEnabled(false);
67 | }
68 |
69 | private void initAdapter() {
70 | mAdapter = new MainAdapter(this, dataList);
71 | mAdapter.setOnItemClickListener(this);
72 | superRecyclerView.setAdapter(mAdapter);
73 | }
74 |
75 | private void initDatas() {
76 | for (int i = 0; i < titles.length; i++) {
77 | dataList.add(titles[i]);
78 | }
79 | }
80 |
81 | @Override
82 | public void onItemClick(View view, int position) {
83 | Intent intent = new Intent(this, ACTIVITY[position - 1]);
84 | startActivity(intent);
85 | }
86 | }
87 |
--------------------------------------------------------------------------------
/superlibrary/src/main/java/com/superrecycleview/superlibrary/recycleview/progressindicator/indicator/BallGridPulseIndicator.java:
--------------------------------------------------------------------------------
1 | package com.superrecycleview.superlibrary.recycleview.progressindicator.indicator;
2 |
3 | import android.animation.Animator;
4 | import android.animation.ValueAnimator;
5 | import android.graphics.Canvas;
6 | import android.graphics.Paint;
7 |
8 | import java.util.ArrayList;
9 | import java.util.List;
10 |
11 | /**
12 | * Created by Jack on 2015/10/19.
13 | */
14 | public class BallGridPulseIndicator extends BaseIndicatorController{
15 |
16 | public static final int ALPHA=255;
17 |
18 | public static final float SCALE=1.0f;
19 |
20 | int[] alphas=new int[]{ALPHA,
21 | ALPHA,
22 | ALPHA,
23 | ALPHA,
24 | ALPHA,
25 | ALPHA,
26 | ALPHA,
27 | ALPHA,
28 | ALPHA};
29 |
30 | float[] scaleFloats=new float[]{SCALE,
31 | SCALE,
32 | SCALE,
33 | SCALE,
34 | SCALE,
35 | SCALE,
36 | SCALE,
37 | SCALE,
38 | SCALE};
39 |
40 |
41 |
42 | @Override
43 | public void draw(Canvas canvas, Paint paint) {
44 | float circleSpacing=4;
45 | float radius=(getWidth()-circleSpacing*4)/6;
46 | float x = getWidth()/ 2-(radius*2+circleSpacing);
47 | float y = getWidth()/ 2-(radius*2+circleSpacing);
48 |
49 | for (int i = 0; i < 3; i++) {
50 | for (int j = 0; j < 3; j++) {
51 | canvas.save();
52 | float translateX=x+(radius*2)*j+circleSpacing*j;
53 | float translateY=y+(radius*2)*i+circleSpacing*i;
54 | canvas.translate(translateX, translateY);
55 | canvas.scale(scaleFloats[3 * i + j], scaleFloats[3 * i + j]);
56 | paint.setAlpha(alphas[3 * i + j]);
57 | canvas.drawCircle(0, 0, radius, paint);
58 | canvas.restore();
59 | }
60 | }
61 | }
62 |
63 | @Override
64 | public List createAnimation() {
65 | List animators=new ArrayList<>();
66 | int[] durations={720, 1020, 1280, 1420, 1450, 1180, 870, 1450, 1060};
67 | int[] delays= {-60, 250, -170, 480, 310, 30, 460, 780, 450};
68 |
69 | for (int i = 0; i < 9; i++) {
70 | final int index=i;
71 | ValueAnimator scaleAnim= ValueAnimator.ofFloat(1,0.5f,1);
72 | scaleAnim.setDuration(durations[i]);
73 | scaleAnim.setRepeatCount(-1);
74 | scaleAnim.setStartDelay(delays[i]);
75 | scaleAnim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
76 | @Override
77 | public void onAnimationUpdate(ValueAnimator animation) {
78 | scaleFloats[index] = (float) animation.getAnimatedValue();
79 | postInvalidate();
80 | }
81 | });
82 | scaleAnim.start();
83 |
84 | ValueAnimator alphaAnim= ValueAnimator.ofInt(255, 210, 122, 255);
85 | alphaAnim.setDuration(durations[i]);
86 | alphaAnim.setRepeatCount(-1);
87 | alphaAnim.setStartDelay(delays[i]);
88 | alphaAnim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
89 | @Override
90 | public void onAnimationUpdate(ValueAnimator animation) {
91 | alphas[index] = (int) animation.getAnimatedValue();
92 | postInvalidate();
93 | }
94 | });
95 | alphaAnim.start();
96 | animators.add(scaleAnim);
97 | animators.add(alphaAnim);
98 | }
99 | return animators;
100 | }
101 |
102 |
103 | }
104 |
--------------------------------------------------------------------------------
/app/src/main/java/com/superrecycleview/library/ui/AnimationActivity.java:
--------------------------------------------------------------------------------
1 | package com.superrecycleview.library.ui;
2 |
3 | import android.content.Intent;
4 | import android.net.Uri;
5 | import android.os.Bundle;
6 | import android.support.v7.app.AppCompatActivity;
7 | import android.support.v7.widget.LinearLayoutManager;
8 | import android.view.Menu;
9 | import android.view.MenuInflater;
10 | import android.view.MenuItem;
11 | import android.view.View;
12 |
13 | import com.superrecycleview.library.R;
14 | import com.superrecycleview.library.adapter.AnimationAdapter;
15 | import com.superrecycleview.superlibrary.adapter.AnimationType;
16 | import com.superrecycleview.superlibrary.recycleview.SuperRecyclerView;
17 |
18 | import java.util.ArrayList;
19 | import java.util.List;
20 |
21 | /**
22 | * Created by super南仔 on 07/28/16.
23 | * blog: http://supercwn.github.io/
24 | * GitHub: https://github.com/supercwn
25 | */
26 | public class AnimationActivity extends AppCompatActivity {
27 |
28 | private SuperRecyclerView superRecyclerView;
29 | private AnimationAdapter mAdapter;
30 | private List dataList = new ArrayList<>();
31 |
32 | @Override
33 | protected void onCreate(Bundle savedInstanceState) {
34 | super.onCreate(savedInstanceState);
35 | setContentView(R.layout.activity_animation_layout);
36 | initView();
37 | initData();
38 | initAdapter();
39 | }
40 |
41 | private void initView() {
42 | superRecyclerView = (SuperRecyclerView) findViewById(R.id.superrecycleview_animation);
43 | LinearLayoutManager layoutManager = new LinearLayoutManager(this);
44 | layoutManager.setOrientation(LinearLayoutManager.VERTICAL);
45 | superRecyclerView.setLayoutManager(layoutManager);
46 | superRecyclerView.setRefreshEnabled(false);
47 | superRecyclerView.setLoadMoreEnabled(false);
48 | View emptyView = findViewById(R.id.tv_empty_view);
49 | superRecyclerView.setEmptyView(emptyView);
50 | }
51 |
52 | private void initData() {
53 | for (int i = 1; i <= 50; i++) {
54 | dataList.add("Animation"+i);
55 | }
56 | }
57 |
58 | private void initAdapter() {
59 | mAdapter = new AnimationAdapter(this,dataList);
60 | mAdapter.setItemAnimation(AnimationType.SLIDE_FROM_LEFT);//设置显示的动画
61 | mAdapter.setShowItemAnimationEveryTime(true);//是否每次都会执行动画,默认是false,该方便测试
62 | superRecyclerView.setAdapter(mAdapter);
63 | }
64 |
65 | @Override
66 | public boolean onCreateOptionsMenu(Menu menu) {
67 | MenuInflater menuInflater = getMenuInflater();
68 | menuInflater.inflate(R.menu.main, menu);
69 | return super.onCreateOptionsMenu(menu);
70 | }
71 |
72 | @Override
73 | public boolean onOptionsItemSelected(MenuItem item) {
74 | switch (item.getItemId()) {
75 | case R.id.action_alpha:
76 | mAdapter.setItemAnimation(AnimationType.ALPHA);
77 | break;
78 | case R.id.action_scale:
79 | mAdapter.setItemAnimation(AnimationType.SCALE);
80 | break;
81 | case R.id.action_slide_from_left:
82 | mAdapter.setItemAnimation(AnimationType.SLIDE_FROM_LEFT);
83 | break;
84 | case R.id.action_slide_from_right:
85 | mAdapter.setItemAnimation(AnimationType.SLIDE_FROM_RIGHT);
86 | break;
87 | case R.id.action_slide_from_bottom:
88 | mAdapter.setItemAnimation(AnimationType.SLIDE_FROM_BOTTOM);
89 | break;
90 | case R.id.action_github:
91 | Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://github.com/supercwn"));
92 | startActivity(browserIntent);
93 | break;
94 | }
95 | return super.onOptionsItemSelected(item);
96 | }
97 | }
98 |
--------------------------------------------------------------------------------
/app/src/main/java/com/superrecycleview/library/ui/RefreshAndLoadMoreActivity.java:
--------------------------------------------------------------------------------
1 |
2 | package com.superrecycleview.library.ui;
3 |
4 | import android.os.Bundle;
5 | import android.os.Handler;
6 | import android.support.v7.app.AppCompatActivity;
7 | import android.support.v7.widget.LinearLayoutManager;
8 |
9 | import com.superrecycleview.library.R;
10 | import com.superrecycleview.library.adapter.RefreshAndLoadMoreAdapter;
11 | import com.superrecycleview.superlibrary.recycleview.ProgressStyle;
12 | import com.superrecycleview.superlibrary.recycleview.SuperRecyclerView;
13 |
14 | import java.util.ArrayList;
15 | import java.util.List;
16 |
17 | /**
18 | * Created by super南仔 on 07/28/16. blog: http://supercwn.github.io/ GitHub:
19 | * https://github.com/supercwn
20 | */
21 | public class RefreshAndLoadMoreActivity extends AppCompatActivity
22 | implements SuperRecyclerView.LoadingListener {
23 |
24 | private SuperRecyclerView superRecyclerView;
25 | private RefreshAndLoadMoreAdapter mAdapter;
26 | private List dataList = new ArrayList<>();
27 | private List tempList = new ArrayList<>();
28 |
29 | @Override
30 | protected void onCreate(Bundle savedInstanceState) {
31 | super.onCreate(savedInstanceState);
32 | setContentView(R.layout.activity_refresh_load_layout);
33 | initView();
34 | dataList = initData(20);
35 | initAdapter();
36 | }
37 |
38 | private void initView() {
39 | superRecyclerView = (SuperRecyclerView) findViewById(R.id.super_recycle_view);
40 | LinearLayoutManager layoutManager = new LinearLayoutManager(this);
41 | layoutManager.setOrientation(LinearLayoutManager.VERTICAL);
42 | superRecyclerView.setLayoutManager(layoutManager);
43 | superRecyclerView.setRefreshEnabled(true);// 可以定制是否开启下拉刷新
44 | superRecyclerView.setLoadMoreEnabled(true);// 可以定制是否开启加载更多
45 | superRecyclerView.setLoadingListener(this);// 下拉刷新,上拉加载的监听
46 | superRecyclerView.setRefreshProgressStyle(ProgressStyle.BallSpinFadeLoader);// 下拉刷新的样式
47 | superRecyclerView.setLoadingMoreProgressStyle(ProgressStyle.BallClipRotate);// 上拉加载的样式
48 | superRecyclerView.setArrowImageView(R.mipmap.iconfont_downgrey);// 设置下拉箭头
49 | }
50 |
51 | private List initData(int size) {
52 | dataList.clear();
53 | for (int i = 1; i <= size; i++) {
54 | dataList.add("数据" + i);
55 | }
56 | return dataList;
57 | }
58 |
59 | // 模拟加载更多的数据
60 | private List getDataList(int size) {
61 | List data = new ArrayList<>();
62 | for (int i = 1; i <= size; i++) {
63 | data.add("新加的数据" + i);
64 | }
65 | return data;
66 | }
67 |
68 | private void initAdapter() {
69 | mAdapter = new RefreshAndLoadMoreAdapter(this, dataList);
70 | superRecyclerView.setAdapter(mAdapter);
71 | }
72 |
73 | @Override
74 | public void onRefresh() {
75 | new Handler().postDelayed(new Runnable() {
76 | @Override
77 | public void run() {
78 | dataList = initData(20);
79 | superRecyclerView.completeRefresh();
80 | mAdapter.notifyDataSetChanged();
81 | }
82 | }, 3000);
83 | }
84 |
85 | @Override
86 | public void onLoadMore() {
87 | if (dataList.size() >= 50) {
88 | superRecyclerView.setNoMore(true);
89 | return;
90 | }
91 | new Handler().postDelayed(new Runnable() {
92 | @Override
93 | public void run() {
94 | tempList.clear();
95 | tempList = getDataList(20);
96 | dataList.addAll(tempList);
97 | superRecyclerView.completeLoadMore();
98 | }
99 | }, 3000);
100 | }
101 | }
102 |
--------------------------------------------------------------------------------
/superlibrary/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.library'
2 | apply plugin: 'com.github.dcendents.android-maven'
3 | apply plugin: 'com.jfrog.bintray'
4 |
5 | version = "1.2.5"
6 | group = "com.supercwn.superrecycleview"
7 |
8 | def siteUrl = 'https://github.com/supercwn/SuperRecycleView' // project homepage
9 | def gitUrl = 'https://github.com/supercwn/SuperRecycleView.git' // project git
10 |
11 | android {
12 | compileSdkVersion 24
13 | buildToolsVersion '25.0.0'
14 |
15 | defaultConfig {
16 | minSdkVersion 14
17 | targetSdkVersion 24
18 | versionCode 1
19 | versionName "1.0"
20 | }
21 | buildTypes {
22 | release {
23 | minifyEnabled false
24 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
25 | }
26 | }
27 | }
28 |
29 | dependencies {
30 | compile fileTree(dir: 'libs', include: ['*.jar'])
31 | testCompile 'junit:junit:4.12'
32 | compile 'com.android.support:appcompat-v7:24.1.0'
33 | compile 'com.github.promeg:tinypinyin:2.0.3' // TinyPinyin核心包,约80KB
34 | compile 'com.android.support:recyclerview-v7:24.0.0'
35 | compile 'com.android.support:design:24.0.0'
36 | }
37 |
38 | install {
39 | repositories.mavenInstaller {
40 | // This generates POM.xml with proper parameters
41 | pom {
42 | project {
43 | packaging 'aar'
44 | // 项目描述
45 | name 'a RecyclerView that implements refresh and loadmore featrues,and you can extends SuperBaseAdapter,you can easy cover data'
46 | // CONFIG // project title
47 | url siteUrl
48 | // Set your license
49 | licenses {
50 | license {
51 | name 'The Apache Software License, Version 2.0'
52 | url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
53 | }
54 | }
55 | developers {
56 | developer {
57 | id 'supercwn'
58 | // #CONFIG# // your user id (you can write your nickname)
59 | name 'weinan.chen'
60 | // #CONFIG# // your user name
61 | email '953267615@qq.com'
62 | // #CONFIG# // your email
63 | }
64 | }
65 | scm {
66 | connection gitUrl
67 | developerConnection gitUrl
68 | url siteUrl
69 | }
70 | }
71 | }
72 | }
73 | }
74 |
75 | task sourcesJar(type: Jar) {
76 | from android.sourceSets.main.java.srcDirs
77 | classifier = 'sources'
78 | }
79 |
80 | task javadoc(type: Javadoc) {
81 | source = android.sourceSets.main.java.srcDirs
82 | classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
83 | }
84 |
85 | task javadocJar(type: Jar, dependsOn: javadoc) {
86 | classifier = 'javadoc'
87 | from javadoc.destinationDir
88 | }
89 |
90 | artifacts {
91 | archives javadocJar
92 | archives sourcesJar
93 | }
94 |
95 | Properties properties = new Properties()
96 | boolean isHasFile = false
97 | if (project.rootProject.file('local.properties') != null) {
98 | isHasFile = true
99 | properties.load(project.rootProject.file('local.properties').newDataInputStream())
100 | }
101 | bintray {
102 | user = isHasFile ? properties.getProperty("bintray.user") : System.getenv("bintray.user")
103 | key = isHasFile ? properties.getProperty("bintray.apikey") : System.getenv("bintray.apikey")
104 | configurations = ['archives']
105 | pkg {
106 | repo = "maven"
107 | name = "superrecycleview"
108 | // #CONFIG# project name in jcenter
109 | websiteUrl = siteUrl
110 | vcsUrl = gitUrl
111 | licenses = ["Apache-2.0"]
112 | publish = true
113 | }
114 | }
115 |
--------------------------------------------------------------------------------