├── .gitignore ├── LICENSE ├── LRecyclerview_library ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── com │ │ └── github │ │ └── jdsjlzx │ │ ├── ItemDecoration │ │ ├── DividerDecoration.java │ │ ├── GridItemDecoration.java │ │ ├── LuDividerDecoration.java │ │ ├── LuGridItemDecoration.java │ │ ├── LuSpacesItemDecoration.java │ │ ├── SpacesItemDecoration.java │ │ ├── SpanLookup.java │ │ └── SpanLookupFactory.java │ │ ├── interfaces │ │ ├── ILoadMoreFooter.java │ │ ├── IRefreshHeader.java │ │ ├── OnItemClickListener.java │ │ ├── OnItemLongClickListener.java │ │ ├── OnLoadMoreListener.java │ │ ├── OnNetWorkErrorListener.java │ │ └── OnRefreshListener.java │ │ ├── progressindicator │ │ ├── AVLoadingIndicatorView.java │ │ ├── Indicator.java │ │ └── indicators │ │ │ ├── BallBeatIndicator.java │ │ │ ├── BallClipRotateIndicator.java │ │ │ ├── BallClipRotateMultipleIndicator.java │ │ │ ├── BallClipRotatePulseIndicator.java │ │ │ ├── BallGridBeatIndicator.java │ │ │ ├── BallGridPulseIndicator.java │ │ │ ├── BallPulseIndicator.java │ │ │ ├── BallPulseRiseIndicator.java │ │ │ ├── BallPulseSyncIndicator.java │ │ │ ├── BallRotateIndicator.java │ │ │ ├── BallScaleIndicator.java │ │ │ ├── BallScaleMultipleIndicator.java │ │ │ ├── BallScaleRippleIndicator.java │ │ │ ├── BallScaleRippleMultipleIndicator.java │ │ │ ├── BallSpinFadeLoaderIndicator.java │ │ │ ├── BallTrianglePathIndicator.java │ │ │ ├── BallZigZagDeflectIndicator.java │ │ │ ├── BallZigZagIndicator.java │ │ │ ├── BaseIndicatorController.java │ │ │ ├── CubeTransitionIndicator.java │ │ │ ├── LineScaleIndicator.java │ │ │ ├── LineScalePartyIndicator.java │ │ │ ├── LineScalePulseOutIndicator.java │ │ │ ├── LineScalePulseOutRapidIndicator.java │ │ │ ├── LineSpinFadeLoaderIndicator.java │ │ │ ├── PacmanIndicator.java │ │ │ ├── SemiCircleSpinIndicator.java │ │ │ ├── SquareSpinIndicator.java │ │ │ └── TriangleSkewSpinIndicator.java │ │ ├── recyclerview │ │ ├── AppBarStateChangeListener.java │ │ ├── ExStaggeredGridLayoutManager.java │ │ ├── HeaderSpanSizeLookup.java │ │ ├── LRecyclerView.java │ │ ├── LRecyclerViewAdapter.java │ │ ├── LuRecyclerView.java │ │ ├── LuRecyclerViewAdapter.java │ │ └── ProgressStyle.java │ │ ├── util │ │ ├── LuRecyclerViewUtils.java │ │ ├── RecyclerViewUtils.java │ │ └── WeakHandler.java │ │ └── view │ │ ├── ArrowRefreshHeader.java │ │ ├── LoadingFooter.java │ │ └── SimpleViewSwitcher.java │ └── res │ ├── anim │ ├── floating_action_button_hide.xml │ └── floating_action_button_show.xml │ ├── drawable-hdpi │ ├── ic_loading_rotate.png │ ├── ic_pulltorefresh_arrow.png │ ├── ic_tip.png │ ├── 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 │ └── progressbar.xml │ ├── drawable │ └── progressloading.xml │ ├── layout │ ├── layout_horizontal_recyclerview_footer.xml │ ├── layout_horizontal_recyclerview_footer_end.xml │ ├── layout_horizontal_recyclerview_footer_loading.xml │ ├── layout_horizontal_recyclerview_footer_network_error.xml │ ├── layout_horizontal_recyclerview_refresh_header.xml │ ├── layout_indicator_view.xml │ ├── layout_recyclerview_footer.xml │ ├── layout_recyclerview_footer_end.xml │ ├── layout_recyclerview_footer_loading.xml │ ├── layout_recyclerview_footer_network_error.xml │ ├── layout_recyclerview_refresh_header.xml │ └── layout_recyclerview_swipe_item_default.xml │ ├── values-zh-rCN │ └── strings.xml │ └── values │ ├── attr.xml │ ├── colors.xml │ ├── dimens.xml │ ├── strings.xml │ └── style.xml ├── README.md ├── app ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── com │ │ └── lzx │ │ └── demo │ │ ├── AppContext.java │ │ ├── ItemDecoration │ │ ├── DividerDecoration.java │ │ ├── DoubleHeaderAdapter.java │ │ ├── DoubleHeaderDecoration.java │ │ ├── StickyHeaderAdapter.java │ │ └── StickyHeaderDecoration.java │ │ ├── MainActivity.java │ │ ├── SplashActivity.java │ │ ├── adapter │ │ ├── CategoryAdapter.java │ │ ├── CommentExpandAdapter.java │ │ ├── DataAdapter.java │ │ ├── DoubleHeaderTestAdapter.java │ │ ├── ExpandableItemAdapter.java │ │ ├── ExpandableRecyclerAdapter.java │ │ ├── GoodsAdapter.java │ │ ├── HorizontalDataAdapter.java │ │ ├── HotsAdapter.java │ │ ├── InlineStickyTestAdapter.java │ │ ├── MainAdapter.java │ │ ├── MultipleItemAdapter.java │ │ ├── ProductsAdapter.java │ │ ├── RelatedGoodsAdapter.java │ │ ├── SectionedRecyclerViewAdapter.java │ │ ├── ShopAdapterBase.java │ │ ├── StickyTestAdapter.java │ │ └── SwipeMenuAdapter.java │ │ ├── base │ │ ├── BaseMainActivity.java │ │ ├── BaseMultiAdapter.java │ │ ├── CommentItem.java │ │ ├── Entity.java │ │ ├── ListBaseAdapter.java │ │ └── SuperViewHolder.java │ │ ├── bean │ │ ├── AbstractExpandableItem.java │ │ ├── AnimalObject.java │ │ ├── BannerInfo.java │ │ ├── Category.java │ │ ├── ClickBounds.java │ │ ├── Goods.java │ │ ├── HotList.java │ │ ├── ItemModel.java │ │ ├── Level0Item.java │ │ ├── Level1Item.java │ │ ├── MultiItemEntity.java │ │ ├── MultipleItem.java │ │ ├── Order.java │ │ ├── Person.java │ │ ├── PinnedHeaderEntity.java │ │ ├── Product.java │ │ ├── ProductList.java │ │ ├── StockEntity.java │ │ └── Visitable.java │ │ ├── fragment │ │ ├── BaseDecorationFragment.java │ │ ├── DoubleHeaderFragment.java │ │ ├── InlineStickyHeaderFragment.java │ │ └── StickyHeaderFragment.java │ │ ├── holder │ │ ├── BetterViewHolder.java │ │ ├── CategoryViewHolder.java │ │ ├── HotListViewHolder.java │ │ ├── ProductListViewHolder.java │ │ └── RecyclerViewHolder.java │ │ ├── imageloader │ │ ├── BaseImageLoaderStrategy.java │ │ ├── GlideImageLoaderStrategy.java │ │ ├── ImageLoader.java │ │ ├── ImageLoaderUtil.java │ │ └── PicassoImageLoaderStrategy.java │ │ ├── interfaces │ │ ├── IExpandable.java │ │ ├── OnHeaderClickListener.java │ │ ├── OnItemDragListener.java │ │ ├── OnItemSwipeListener.java │ │ ├── PinnedHeaderNotifyer.java │ │ └── Sectionizer.java │ │ ├── listener │ │ └── OnItemTouchListener.java │ │ ├── multitype │ │ ├── BilibiliActivity.java │ │ ├── ExpandableActivity.java │ │ └── MultiTypeActivity.java │ │ ├── type │ │ ├── ListTypeFactory.java │ │ └── TypeFactory.java │ │ ├── ui │ │ ├── AlipayHomeActivity.java │ │ ├── AlphaChangeActivity.java │ │ ├── BannerHeaderLayoutActivity.java │ │ ├── ClickLoadingFootActivity.java │ │ ├── CollapsingToolbarLayoutActivity.java │ │ ├── CollapsingToolbarLayoutActivity2.java │ │ ├── CommonActivity.java │ │ ├── CoordinatorLayoutActivity.java │ │ ├── CustomLoadingFootActivity.java │ │ ├── EmptyViewActivity.java │ │ ├── EndlessGridLayoutActivity.java │ │ ├── EndlessLinearLayoutActivity.java │ │ ├── EndlessStaggeredGridLayoutActivity.java │ │ ├── ExpandableRecyclerViewOneActivity.java │ │ ├── LinearLayoutActivity.java │ │ ├── LinearLayoutDelActivity.java │ │ ├── ListDragMenuActivity.java │ │ ├── MomentsHeaderActivity.java │ │ ├── MulItemGridLayoutActivity.java │ │ ├── MulItemLinearLayoutActivity.java │ │ ├── Nest2RecyclerViewActivity.java │ │ ├── NestRecyclerViewActivity.java │ │ ├── PartialRefreshActivity.java │ │ ├── PulldownRefreshActivity.java │ │ ├── QzoneHeaderActivity.java │ │ ├── ScrollViewLayoutActivity.java │ │ ├── SectionAnimalActivity.java │ │ ├── SectionCollectionActivity.java │ │ ├── SectionLayoutActivity.java │ │ ├── SpecialLinearLayoutActivity.java │ │ ├── SwipeDeleteActivity.java │ │ ├── SwipeMenuActivity.java │ │ ├── SwipeRefreshLayoutActivity.java │ │ └── WebViewActivity.java │ │ ├── util │ │ ├── AppToast.java │ │ ├── AppUtil.java │ │ ├── DividerHelper.java │ │ ├── HorizontalItemDecorator.java │ │ ├── NetworkUtils.java │ │ ├── PinnedHeaderItemDecoration.java │ │ ├── StatusBarUtil.java │ │ └── TLog.java │ │ └── view │ │ ├── AnchorView.java │ │ ├── ClickLoadingFooter.java │ │ ├── CommonFooter.java │ │ ├── CommonHeader.java │ │ ├── CustLoadingFooter.java │ │ ├── CustomScrollView.java │ │ ├── MomentsRefreshHeader.java │ │ ├── PullScrollView.java │ │ ├── QzoneRefreshHeader.java │ │ ├── SampleFooter.java │ │ ├── SampleHeader.java │ │ └── SwipeMenuView.java │ └── res │ ├── drawable │ ├── circle_green.xml │ ├── divider.xml │ ├── divider_recycler.xml │ ├── ic_group_black_36dp.xml │ ├── ic_keyboard_arrow_right_black_36dp.xml │ ├── ic_person_black_36dp.xml │ ├── ic_photo_default.9.png │ ├── ic_product_default.9.png │ ├── iconfont_downgrey.png │ ├── img_avatar.jpg │ ├── img_header.jpg │ ├── profile_anonymous_user.jpg │ ├── refresh.png │ ├── sample_footer_loading_progress.xml │ ├── selector_green.xml │ ├── selector_purple.xml │ ├── selector_red.xml │ ├── selector_white_preferences_item.xml │ ├── shape_edit_corners_bg.xml │ ├── shape_search.xml │ ├── shape_white_preferences_item.xml │ └── shape_white_preferences_item_pressed.xml │ ├── layout │ ├── activity_alipay_home.xml │ ├── activity_alpha_change.xml │ ├── activity_collapsing_toolbar_layout.xml │ ├── activity_collapsing_toolbar_two_layout.xml │ ├── activity_define.xml │ ├── activity_emptyview.xml │ ├── activity_linear_layout_del.xml │ ├── activity_main.xml │ ├── activity_multi_click_loading.xml │ ├── activity_scrollview.xml │ ├── activity_section.xml │ ├── activity_section_pager.xml │ ├── activity_splash.xml │ ├── activity_webview.xml │ ├── content_main.xml │ ├── fragment_recycler.xml │ ├── header_inline_test.xml │ ├── header_test.xml │ ├── include_title_big.xml │ ├── include_toolbar_search.xml │ ├── include_toolbar_small.xml │ ├── item_child_comment.xml │ ├── item_comment.xml │ ├── item_expandable_lv0.xml │ ├── item_expandable_lv1.xml │ ├── item_inline_test.xml │ ├── item_test.xml │ ├── layout_banner_header.xml │ ├── layout_empty.xml │ ├── layout_goods_related_item.xml │ ├── layout_item_horizontal_list.xml │ ├── layout_item_list.xml │ ├── layout_list_item_animal.xml │ ├── layout_list_item_category.xml │ ├── layout_list_item_goods_related.xml │ ├── layout_list_item_hot.xml │ ├── layout_list_item_nest_inner.xml │ ├── layout_list_item_nest_wrapper.xml │ ├── layout_list_item_pinned_data.xml │ ├── layout_list_item_pinned_header.xml │ ├── layout_list_item_product.xml │ ├── layout_list_section_animal.xml │ ├── list_item_category.xml │ ├── list_item_foot.xml │ ├── list_item_list.xml │ ├── list_item_pic.xml │ ├── list_item_swipe.xml │ ├── list_item_text.xml │ ├── moments_header.xml │ ├── qzone_header.xml │ ├── sample_common_list_footer.xml │ ├── sample_common_list_footer_end.xml │ ├── sample_common_list_footer_loading.xml │ ├── sample_common_list_footer_network_error.xml │ ├── sample_footer.xml │ ├── sample_header.xml │ ├── sample_horizontal_activity.xml │ ├── sample_horizontal_footer.xml │ ├── sample_horizontal_header.xml │ ├── sample_item_card.xml │ ├── sample_item_text.xml │ ├── sample_item_text_horizontal.xml │ ├── sample_ll_activity.xml │ ├── sample_swpierefresh_activity.xml │ ├── special_ll_activity.xml │ ├── super_header_test.xml │ ├── view_anchor.xml │ ├── view_cust_recyclerview_footer.xml │ ├── view_manual_recyclerview_footer.xml │ ├── view_recyclerview_footer_loading.xml │ ├── view_recyclerview_footer_network_error.xml │ └── view_recyclerview_footer_view_manual.xml │ ├── menu │ ├── menu_all_activity.xml │ ├── menu_list_drag.xml │ ├── menu_main.xml │ ├── menu_main_expand.xml │ ├── menu_main_refresh.xml │ ├── menu_partial_refresh.xml │ └── menu_setion.xml │ ├── mipmap-hdpi │ └── ic_launcher.png │ ├── mipmap-mdpi │ └── ic_launcher.png │ ├── mipmap-xhdpi │ ├── bg.jpg │ ├── bg_btn_voice.png │ ├── ic_launcher.png │ ├── ic_location.png │ ├── ic_notice.png │ ├── ic_search.png │ ├── icon.png │ └── slient.jpg │ ├── mipmap-xxhdpi │ ├── arrow_down.png │ ├── bg.jpg │ ├── ic_action_add.png │ ├── ic_action_close.png │ ├── ic_action_delete.png │ ├── ic_action_wechat.png │ ├── ic_arrow.png │ ├── ic_big_chat.png │ ├── ic_big_pay.png │ ├── ic_big_qrcode.png │ ├── ic_big_scan.png │ ├── ic_contact.png │ ├── ic_launcher.png │ ├── ic_plus.png │ ├── ic_search.png │ ├── ic_small_charge.png │ ├── ic_small_money.png │ ├── ic_small_pay.png │ ├── ic_small_scan.png │ ├── img1.jpg │ ├── img2.jpg │ ├── img3.jpg │ ├── img4.jpg │ ├── img5.jpg │ ├── img6.jpg │ ├── img_00.webp │ ├── img_01.webp │ ├── img_10.webp │ ├── img_11.jpg │ ├── loading_bg.jpg │ ├── menu.png │ ├── sample_footer_error.png │ ├── sample_footer_loading.png │ └── smile.png │ ├── mipmap-xxxhdpi │ └── ic_launcher.png │ ├── values-w820dp │ └── dimens.xml │ └── values │ ├── array.xml │ ├── attrs.xml │ ├── colors.xml │ ├── dimens.xml │ ├── ids.xml │ ├── strings.xml │ └── styles.xml ├── art ├── alipay.jpg ├── art1.png ├── art2.png ├── art3.png ├── art4.png ├── art5.png ├── art6.gif ├── art7.png ├── art8.png ├── art9.png ├── pager.gif ├── swipe_1.gif ├── swipe_2.gif ├── swipe_3.gif ├── swipe_4.gif ├── swipe_5.gif ├── swipe_6.gif ├── swipe_7.gif ├── tamic.jpg └── wechat.png ├── build.gradle ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── settings.gradle /.gitignore: -------------------------------------------------------------------------------- 1 | ### Android template 2 | # Built application files 3 | *.apk 4 | *.ap_ 5 | 6 | # Files for the ART/Dalvik VM 7 | *.dex 8 | 9 | # Java class files 10 | *.class 11 | 12 | # Generated files 13 | bin/ 14 | gen/ 15 | out/ 16 | 17 | # Gradle files 18 | .gradle/ 19 | build/ 20 | 21 | # Local configuration file (sdk path, etc) 22 | local.properties 23 | 24 | # Proguard folder generated by Eclipse 25 | proguard/ 26 | 27 | # Log Files 28 | *.log 29 | 30 | # Android Studio Navigation editor temp files 31 | .navigation/ 32 | 33 | # Android Studio captures folder 34 | captures/ 35 | 36 | # Intellij 37 | *.iml 38 | /.idea 39 | 40 | # Keystore files 41 | *.jks 42 | 43 | /art 44 | 45 | -------------------------------------------------------------------------------- /LRecyclerview_library/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | ### Android template 3 | # Built application files 4 | *.apk 5 | *.ap_ 6 | 7 | # Files for the ART/Dalvik VM 8 | *.dex 9 | 10 | # Java class files 11 | *.class 12 | 13 | # Generated files 14 | bin/ 15 | gen/ 16 | out/ 17 | 18 | # Gradle files 19 | .gradle/ 20 | build/ 21 | 22 | # Local configuration file (sdk path, etc) 23 | local.properties 24 | 25 | # Proguard folder generated by Eclipse 26 | proguard/ 27 | 28 | # Log Files 29 | *.log 30 | 31 | # Android Studio Navigation editor temp files 32 | .navigation/ 33 | 34 | # Android Studio captures folder 35 | captures/ 36 | 37 | # Intellij 38 | *.iml 39 | .idea/workspace.xml 40 | 41 | # Keystore files 42 | *.jks 43 | -------------------------------------------------------------------------------- /LRecyclerview_library/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | apply plugin: 'com.github.dcendents.android-maven' 3 | 4 | 5 | android { 6 | compileSdkVersion 27 7 | 8 | defaultConfig { 9 | minSdkVersion 14 10 | targetSdkVersion 27 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 | implementation fileTree(dir: 'libs', include: ['*.jar']) 24 | implementation 'com.android.support:appcompat-v7:27.1.1' 25 | implementation 'com.android.support:recyclerview-v7:27.1.1' 26 | implementation 'com.android.support:design:27.1.1' 27 | } 28 | 29 | 30 | // 指定编码 31 | tasks.withType(JavaCompile) { 32 | options.encoding = "UTF-8" 33 | } 34 | 35 | // 打包源码 36 | task sourcesJar(type: Jar) { 37 | from android.sourceSets.main.java.srcDirs 38 | classifier = 'sources' 39 | } 40 | 41 | task javadoc(type: Javadoc) { 42 | failOnError false 43 | source = android.sourceSets.main.java.sourceFiles 44 | classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) 45 | classpath += configurations.compile 46 | } 47 | 48 | // 制作文档(Javadoc) 49 | task javadocJar(type: Jar, dependsOn: javadoc) { 50 | classifier = 'javadoc' 51 | from javadoc.destinationDir 52 | } 53 | 54 | artifacts { 55 | archives sourcesJar 56 | archives javadocJar 57 | } 58 | -------------------------------------------------------------------------------- /LRecyclerview_library/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /Users/lizhixian/Documents/Android/studio_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 | -------------------------------------------------------------------------------- /LRecyclerview_library/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /LRecyclerview_library/src/main/java/com/github/jdsjlzx/ItemDecoration/SpanLookup.java: -------------------------------------------------------------------------------- 1 | package com.github.jdsjlzx.ItemDecoration; 2 | 3 | public interface SpanLookup { 4 | 5 | /** 6 | * @return number of spans in a row 7 | */ 8 | int getSpanCount(); 9 | 10 | /** 11 | * @param itemPosition 12 | * @return start span for the item at the given adapter position 13 | */ 14 | int getSpanIndex(int itemPosition); 15 | 16 | /** 17 | * @param itemPosition 18 | * @return number of spans the item at the given adapter position occupies 19 | */ 20 | int getSpanSize(int itemPosition); 21 | 22 | } 23 | -------------------------------------------------------------------------------- /LRecyclerview_library/src/main/java/com/github/jdsjlzx/ItemDecoration/SpanLookupFactory.java: -------------------------------------------------------------------------------- 1 | package com.github.jdsjlzx.ItemDecoration; 2 | 3 | import android.support.v7.widget.GridLayoutManager; 4 | 5 | class SpanLookupFactory { 6 | 7 | static SpanLookup singleSpan() { 8 | return new SpanLookup() { 9 | @Override 10 | public int getSpanCount() { 11 | return 1; 12 | } 13 | 14 | @Override 15 | public int getSpanIndex(int itemPosition) { 16 | return 0; 17 | } 18 | 19 | @Override 20 | public int getSpanSize(int itemPosition) { 21 | return 1; 22 | } 23 | }; 24 | } 25 | 26 | static SpanLookup gridLayoutSpanLookup(final GridLayoutManager layoutManager) { 27 | return new SpanLookup() { 28 | @Override 29 | public int getSpanCount() { 30 | return layoutManager.getSpanCount(); 31 | } 32 | 33 | @Override 34 | public int getSpanIndex(int itemPosition) { 35 | return layoutManager.getSpanSizeLookup().getSpanIndex(itemPosition, getSpanCount()); 36 | } 37 | 38 | @Override 39 | public int getSpanSize(int itemPosition) { 40 | return layoutManager.getSpanSizeLookup().getSpanSize(itemPosition); 41 | } 42 | }; 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /LRecyclerview_library/src/main/java/com/github/jdsjlzx/interfaces/ILoadMoreFooter.java: -------------------------------------------------------------------------------- 1 | package com.github.jdsjlzx.interfaces; 2 | 3 | import android.view.View; 4 | 5 | /** 6 | * 加载更多FooterView需要实现的接口 7 | */ 8 | public interface ILoadMoreFooter { 9 | /** 10 | * 状态回调,回复初始设置 11 | */ 12 | void onReset(); 13 | 14 | /** 15 | * 状态回调,加载中 16 | */ 17 | void onLoading(); 18 | 19 | /** 20 | * 状态回调,加载完成 21 | */ 22 | void onComplete(); 23 | 24 | /** 25 | * 状态回调,已全部加载完成 26 | */ 27 | void onNoMore(); 28 | 29 | /** 30 | * 加载更多的View 31 | */ 32 | View getFootView(); 33 | 34 | void setNetworkErrorViewClickListener(OnNetWorkErrorListener listener); 35 | 36 | void setOnClickLoadMoreListener(final OnLoadMoreListener listener); 37 | 38 | enum State { 39 | Normal/**正常*/ 40 | , ManualLoadMore/**手动点击加载*/ 41 | , NoMore/**加载到最底了*/ 42 | , Loading/**加载中..*/ 43 | , NetWorkError/**网络异常*/ 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /LRecyclerview_library/src/main/java/com/github/jdsjlzx/interfaces/IRefreshHeader.java: -------------------------------------------------------------------------------- 1 | package com.github.jdsjlzx.interfaces; 2 | 3 | import android.view.View; 4 | 5 | public interface IRefreshHeader { 6 | 7 | int STATE_NORMAL = 0; 8 | int STATE_RELEASE_TO_REFRESH = 1; 9 | int STATE_REFRESHING = 2; 10 | int STATE_DONE = 3; 11 | 12 | int TYPE_HEADER_NORMAL = 0; 13 | int TYPE_HEADER_MATERIAL = 1; 14 | 15 | void onReset(); 16 | 17 | /** 18 | * 处于可以刷新的状态,已经过了指定距离 19 | */ 20 | void onPrepare(); 21 | 22 | /** 23 | * 正在刷新 24 | */ 25 | void onRefreshing(); 26 | 27 | /** 28 | * 下拉移动 29 | */ 30 | void onMove(float offSet, float sumOffSet); 31 | 32 | /** 33 | * 下拉松开 34 | */ 35 | boolean onRelease(); 36 | 37 | /** 38 | * 下拉刷新完成 39 | */ 40 | void refreshComplete(); 41 | 42 | /** 43 | * 获取HeaderView 44 | */ 45 | View getHeaderView(); 46 | 47 | /** 48 | * 获取Header的显示高度 49 | */ 50 | int getVisibleHeight(); 51 | 52 | /** 53 | * 获取Header的显示宽度,横向滑动时使用 54 | */ 55 | int getVisibleWidth(); 56 | 57 | /** 58 | * 获取Header的类型 59 | */ 60 | int getType(); 61 | } -------------------------------------------------------------------------------- /LRecyclerview_library/src/main/java/com/github/jdsjlzx/interfaces/OnItemClickListener.java: -------------------------------------------------------------------------------- 1 | package com.github.jdsjlzx.interfaces; 2 | 3 | import android.view.View; 4 | 5 | /** 6 | * Click 7 | */ 8 | public interface OnItemClickListener { 9 | void onItemClick(View view, int position); 10 | } 11 | -------------------------------------------------------------------------------- /LRecyclerview_library/src/main/java/com/github/jdsjlzx/interfaces/OnItemLongClickListener.java: -------------------------------------------------------------------------------- 1 | package com.github.jdsjlzx.interfaces; 2 | 3 | import android.view.View; 4 | 5 | /** 6 | * LongClick 7 | */ 8 | 9 | public interface OnItemLongClickListener { 10 | void onItemLongClick(View view , int position); 11 | } 12 | -------------------------------------------------------------------------------- /LRecyclerview_library/src/main/java/com/github/jdsjlzx/interfaces/OnLoadMoreListener.java: -------------------------------------------------------------------------------- 1 | package com.github.jdsjlzx.interfaces; 2 | 3 | /** 4 | * 加载更多事件 5 | * @author jdsjlzx 6 | * @created 2016/9/30 14:09 7 | * 8 | */ 9 | public interface OnLoadMoreListener { 10 | 11 | void onLoadMore(); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /LRecyclerview_library/src/main/java/com/github/jdsjlzx/interfaces/OnNetWorkErrorListener.java: -------------------------------------------------------------------------------- 1 | package com.github.jdsjlzx.interfaces; 2 | 3 | /** 4 | * 网络错误点击事件 5 | * @author jdsjlzx 6 | * @created 20167/1/02 14:17 7 | * 8 | */ 9 | 10 | public interface OnNetWorkErrorListener { 11 | void reload(); 12 | } 13 | -------------------------------------------------------------------------------- /LRecyclerview_library/src/main/java/com/github/jdsjlzx/interfaces/OnRefreshListener.java: -------------------------------------------------------------------------------- 1 | package com.github.jdsjlzx.interfaces; 2 | 3 | /** 4 | * 下拉刷新事件 5 | * @author jdsjlzx 6 | * @created 2016/9/30 14:17 7 | * 8 | */ 9 | 10 | public interface OnRefreshListener { 11 | void onRefresh(); 12 | } 13 | -------------------------------------------------------------------------------- /LRecyclerview_library/src/main/java/com/github/jdsjlzx/progressindicator/indicators/BallScaleRippleIndicator.java: -------------------------------------------------------------------------------- 1 | package com.github.jdsjlzx.progressindicator.indicators; 2 | 3 | import android.animation.ValueAnimator; 4 | import android.graphics.Canvas; 5 | import android.graphics.Paint; 6 | import android.view.animation.LinearInterpolator; 7 | 8 | import java.util.ArrayList; 9 | 10 | /** 11 | * Created by Jack on 2015/10/19. 12 | */ 13 | public class BallScaleRippleIndicator extends BallScaleIndicator { 14 | 15 | 16 | @Override 17 | public void draw(Canvas canvas, Paint paint) { 18 | paint.setStyle(Paint.Style.STROKE); 19 | paint.setStrokeWidth(3); 20 | super.draw(canvas, paint); 21 | } 22 | 23 | @Override 24 | public ArrayList onCreateAnimators() { 25 | ArrayList animators=new ArrayList<>(); 26 | ValueAnimator scaleAnim= ValueAnimator.ofFloat(0,1); 27 | scaleAnim.setInterpolator(new LinearInterpolator()); 28 | scaleAnim.setDuration(1000); 29 | scaleAnim.setRepeatCount(-1); 30 | addUpdateListener(scaleAnim,new ValueAnimator.AnimatorUpdateListener() { 31 | @Override 32 | public void onAnimationUpdate(ValueAnimator animation) { 33 | scale = (float) animation.getAnimatedValue(); 34 | postInvalidate(); 35 | } 36 | }); 37 | 38 | ValueAnimator alphaAnim= ValueAnimator.ofInt(0, 255); 39 | alphaAnim.setInterpolator(new LinearInterpolator()); 40 | alphaAnim.setDuration(1000); 41 | alphaAnim.setRepeatCount(-1); 42 | addUpdateListener(alphaAnim,new ValueAnimator.AnimatorUpdateListener() { 43 | @Override 44 | public void onAnimationUpdate(ValueAnimator animation) { 45 | alpha = (int) animation.getAnimatedValue(); 46 | postInvalidate(); 47 | } 48 | }); 49 | 50 | animators.add(scaleAnim); 51 | animators.add(alphaAnim); 52 | return animators; 53 | } 54 | 55 | } 56 | -------------------------------------------------------------------------------- /LRecyclerview_library/src/main/java/com/github/jdsjlzx/progressindicator/indicators/LineScalePulseOutIndicator.java: -------------------------------------------------------------------------------- 1 | package com.github.jdsjlzx.progressindicator.indicators; 2 | 3 | 4 | import android.animation.ValueAnimator; 5 | 6 | import java.util.ArrayList; 7 | 8 | /** 9 | * Created by Jack on 2015/10/19. 10 | */ 11 | public class LineScalePulseOutIndicator extends LineScaleIndicator { 12 | 13 | @Override 14 | public ArrayList onCreateAnimators() { 15 | ArrayList animators=new ArrayList<>(); 16 | long[] delays=new long[]{500,250,0,250,500}; 17 | for (int i = 0; i < 5; i++) { 18 | final int index=i; 19 | ValueAnimator scaleAnim= ValueAnimator.ofFloat(1,0.3f,1); 20 | scaleAnim.setDuration(900); 21 | scaleAnim.setRepeatCount(-1); 22 | scaleAnim.setStartDelay(delays[i]); 23 | addUpdateListener(scaleAnim,new ValueAnimator.AnimatorUpdateListener() { 24 | @Override 25 | public void onAnimationUpdate(ValueAnimator animation) { 26 | scaleYFloats[index] = (float) animation.getAnimatedValue(); 27 | postInvalidate(); 28 | } 29 | }); 30 | animators.add(scaleAnim); 31 | } 32 | return animators; 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /LRecyclerview_library/src/main/java/com/github/jdsjlzx/progressindicator/indicators/LineScalePulseOutRapidIndicator.java: -------------------------------------------------------------------------------- 1 | package com.github.jdsjlzx.progressindicator.indicators; 2 | 3 | 4 | import android.animation.ValueAnimator; 5 | 6 | import java.util.ArrayList; 7 | 8 | /** 9 | * Created by Jack on 2015/10/19. 10 | */ 11 | public class LineScalePulseOutRapidIndicator extends LineScaleIndicator { 12 | 13 | @Override 14 | public ArrayList onCreateAnimators() { 15 | ArrayList animators=new ArrayList<>(); 16 | long[] delays=new long[]{400,200,0,200,400}; 17 | for (int i = 0; i < 5; i++) { 18 | final int index=i; 19 | ValueAnimator scaleAnim= ValueAnimator.ofFloat(1,0.4f,1); 20 | scaleAnim.setDuration(1000); 21 | scaleAnim.setRepeatCount(-1); 22 | scaleAnim.setStartDelay(delays[i]); 23 | addUpdateListener(scaleAnim,new ValueAnimator.AnimatorUpdateListener() { 24 | @Override 25 | public void onAnimationUpdate(ValueAnimator animation) { 26 | scaleYFloats[index] = (float) animation.getAnimatedValue(); 27 | postInvalidate(); 28 | } 29 | }); 30 | animators.add(scaleAnim); 31 | } 32 | return animators; 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /LRecyclerview_library/src/main/java/com/github/jdsjlzx/progressindicator/indicators/LineSpinFadeLoaderIndicator.java: -------------------------------------------------------------------------------- 1 | package com.github.jdsjlzx.progressindicator.indicators; 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/24. 9 | * Email:81813780@qq.com 10 | */ 11 | public class LineSpinFadeLoaderIndicator extends BallSpinFadeLoaderIndicator { 12 | 13 | 14 | @Override 15 | public void draw(Canvas canvas, Paint paint) { 16 | float radius=getWidth()/10; 17 | for (int i = 0; i < 8; i++) { 18 | canvas.save(); 19 | Point point=circleAt(getWidth(),getHeight(),getWidth()/2.5f-radius,i*(Math.PI/4)); 20 | canvas.translate(point.x, point.y); 21 | canvas.scale(scaleFloats[i], scaleFloats[i]); 22 | canvas.rotate(i*45); 23 | paint.setAlpha(alphas[i]); 24 | RectF rectF=new RectF(-radius,-radius/1.5f,1.5f*radius,radius/1.5f); 25 | canvas.drawRoundRect(rectF,5,5,paint); 26 | canvas.restore(); 27 | } 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /LRecyclerview_library/src/main/java/com/github/jdsjlzx/progressindicator/indicators/SemiCircleSpinIndicator.java: -------------------------------------------------------------------------------- 1 | package com.github.jdsjlzx.progressindicator.indicators; 2 | 3 | import android.animation.ValueAnimator; 4 | import android.graphics.Canvas; 5 | import android.graphics.Paint; 6 | import android.graphics.RectF; 7 | 8 | import com.github.jdsjlzx.progressindicator.Indicator; 9 | 10 | import java.util.ArrayList; 11 | 12 | /** 13 | * Created by Jack on 2015/10/20. 14 | */ 15 | public class SemiCircleSpinIndicator extends Indicator { 16 | 17 | private float degress; 18 | 19 | @Override 20 | public void draw(Canvas canvas, Paint paint) { 21 | canvas.rotate(degress,centerX(),centerY()); 22 | RectF rectF=new RectF(0,0,getWidth(),getHeight()); 23 | canvas.drawArc(rectF,-60,120,false,paint); 24 | } 25 | 26 | @Override 27 | public ArrayList onCreateAnimators() { 28 | ArrayList animators=new ArrayList<>(); 29 | ValueAnimator rotateAnim= ValueAnimator.ofFloat(0,180,360); 30 | addUpdateListener(rotateAnim,new ValueAnimator.AnimatorUpdateListener() { 31 | @Override 32 | public void onAnimationUpdate(ValueAnimator animation) { 33 | degress= (float) animation.getAnimatedValue(); 34 | postInvalidate(); 35 | } 36 | }); 37 | rotateAnim.setDuration(600); 38 | rotateAnim.setRepeatCount(-1); 39 | animators.add(rotateAnim); 40 | return animators; 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /LRecyclerview_library/src/main/java/com/github/jdsjlzx/recyclerview/AppBarStateChangeListener.java: -------------------------------------------------------------------------------- 1 | package com.github.jdsjlzx.recyclerview; 2 | 3 | import android.support.design.widget.AppBarLayout; 4 | 5 | /** 6 | * 7 | * @author lizhixian 8 | * @created 2016/8/26 15:50 9 | * 10 | */ 11 | 12 | public abstract class AppBarStateChangeListener implements AppBarLayout.OnOffsetChangedListener { 13 | 14 | public enum State { 15 | EXPANDED, 16 | COLLAPSED, 17 | IDLE 18 | } 19 | 20 | private State mCurrentState = State.IDLE; 21 | 22 | @Override 23 | public final void onOffsetChanged(AppBarLayout appBarLayout, int i) { 24 | if (i == 0) { 25 | if (mCurrentState != State.EXPANDED) { 26 | onStateChanged(appBarLayout, State.EXPANDED); 27 | } 28 | mCurrentState = State.EXPANDED; 29 | } else if (Math.abs(i) >= appBarLayout.getTotalScrollRange()) { 30 | if (mCurrentState != State.COLLAPSED) { 31 | onStateChanged(appBarLayout, State.COLLAPSED); 32 | } 33 | mCurrentState = State.COLLAPSED; 34 | } else { 35 | if (mCurrentState != State.IDLE) { 36 | onStateChanged(appBarLayout, State.IDLE); 37 | } 38 | mCurrentState = State.IDLE; 39 | } 40 | } 41 | public abstract void onStateChanged(AppBarLayout appBarLayout, State state); 42 | } 43 | 44 | -------------------------------------------------------------------------------- /LRecyclerview_library/src/main/java/com/github/jdsjlzx/recyclerview/HeaderSpanSizeLookup.java: -------------------------------------------------------------------------------- 1 | package com.github.jdsjlzx.recyclerview; 2 | 3 | 4 | import android.support.v7.widget.GridLayoutManager; 5 | 6 | /** 7 | * Created by lizhixian. 8 | *

9 | * RecyclerView为GridLayoutManager时,设置了HeaderView,就会用到这个SpanSizeLookup 10 | */ 11 | public class HeaderSpanSizeLookup extends GridLayoutManager.SpanSizeLookup { 12 | 13 | private LRecyclerViewAdapter adapter; 14 | private int mSpanSize = 1; 15 | 16 | public HeaderSpanSizeLookup(LRecyclerViewAdapter adapter, int spanSize) { 17 | this.adapter = adapter; 18 | this.mSpanSize = spanSize; 19 | } 20 | 21 | @Override 22 | public int getSpanSize(int position) { 23 | boolean isHeaderOrFooter = adapter.isRefreshHeader(position) || adapter.isHeader(position) || adapter.isFooter(position); 24 | return isHeaderOrFooter ? mSpanSize : 1; 25 | } 26 | } -------------------------------------------------------------------------------- /LRecyclerview_library/src/main/java/com/github/jdsjlzx/recyclerview/ProgressStyle.java: -------------------------------------------------------------------------------- 1 | package com.github.jdsjlzx.recyclerview; 2 | 3 | public class ProgressStyle { 4 | public static final int SysProgress = -1; 5 | public static final int BallPulse = 0; 6 | public static final int BallGridPulse = 1; 7 | public static final int BallClipRotate = 2; 8 | public static final int BallClipRotatePulse = 3; 9 | public static final int SquareSpin = 4; 10 | public static final int BallClipRotateMultiple = 5; 11 | public static final int BallPulseRise = 6; 12 | public static final int BallRotate = 7; 13 | public static final int CubeTransition = 8; 14 | public static final int BallZigZag = 9; 15 | public static final int BallZigZagDeflect = 10; 16 | public static final int BallTrianglePath = 11; 17 | public static final int BallScale = 12; 18 | public static final int LineScale = 13; 19 | public static final int LineScaleParty = 14; 20 | public static final int BallScaleMultiple = 15; 21 | public static final int BallPulseSync = 16; 22 | public static final int BallBeat = 17; 23 | public static final int LineScalePulseOut = 18; 24 | public static final int LineScalePulseOutRapid = 19; 25 | public static final int BallScaleRipple = 20; 26 | public static final int BallScaleRippleMultiple = 21; 27 | public static final int BallSpinFadeLoader = 22; 28 | public static final int LineSpinFadeLoader = 23; 29 | public static final int TriangleSkewSpin = 24; 30 | public static final int Pacman = 25; 31 | public static final int BallGridBeat = 26; 32 | public static final int SemiCircleSpin = 27; 33 | 34 | 35 | } 36 | -------------------------------------------------------------------------------- /LRecyclerview_library/src/main/java/com/github/jdsjlzx/util/RecyclerViewUtils.java: -------------------------------------------------------------------------------- 1 | package com.github.jdsjlzx.util; 2 | 3 | import android.support.v7.widget.RecyclerView; 4 | 5 | import com.github.jdsjlzx.recyclerview.LRecyclerViewAdapter; 6 | 7 | /** 8 | * RecyclerView设置Header/Footer所用到的工具类 9 | * @author Lzx 10 | * @created 2016/9/30 10:36 11 | * 12 | */ 13 | public class RecyclerViewUtils { 14 | 15 | /** 16 | * 请使用本方法替代RecyclerView.ViewHolder的getLayoutPosition()方法 17 | * 18 | * @param recyclerView 19 | * @param holder 20 | * @return 21 | */ 22 | public static int getLayoutPosition(RecyclerView recyclerView, RecyclerView.ViewHolder holder) { 23 | RecyclerView.Adapter outerAdapter = recyclerView.getAdapter(); 24 | if (outerAdapter != null && outerAdapter instanceof LRecyclerViewAdapter) { 25 | 26 | int headerViewCounter = ((LRecyclerViewAdapter) outerAdapter).getHeaderViewsCount(); 27 | if (headerViewCounter > 0) { 28 | return holder.getLayoutPosition() - (headerViewCounter + 1); 29 | } 30 | } 31 | 32 | return holder.getLayoutPosition(); 33 | } 34 | 35 | } -------------------------------------------------------------------------------- /LRecyclerview_library/src/main/res/anim/floating_action_button_hide.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | -------------------------------------------------------------------------------- /LRecyclerview_library/src/main/res/anim/floating_action_button_show.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | -------------------------------------------------------------------------------- /LRecyclerview_library/src/main/res/drawable-hdpi/ic_loading_rotate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdsjlzx/LRecyclerView/e4aa22548b3c59d1270d194b52a615c1e38ee45f/LRecyclerview_library/src/main/res/drawable-hdpi/ic_loading_rotate.png -------------------------------------------------------------------------------- /LRecyclerview_library/src/main/res/drawable-hdpi/ic_pulltorefresh_arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdsjlzx/LRecyclerView/e4aa22548b3c59d1270d194b52a615c1e38ee45f/LRecyclerview_library/src/main/res/drawable-hdpi/ic_pulltorefresh_arrow.png -------------------------------------------------------------------------------- /LRecyclerview_library/src/main/res/drawable-hdpi/ic_tip.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdsjlzx/LRecyclerView/e4aa22548b3c59d1270d194b52a615c1e38ee45f/LRecyclerview_library/src/main/res/drawable-hdpi/ic_tip.png -------------------------------------------------------------------------------- /LRecyclerview_library/src/main/res/drawable-hdpi/loading_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdsjlzx/LRecyclerView/e4aa22548b3c59d1270d194b52a615c1e38ee45f/LRecyclerview_library/src/main/res/drawable-hdpi/loading_01.png -------------------------------------------------------------------------------- /LRecyclerview_library/src/main/res/drawable-hdpi/loading_02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdsjlzx/LRecyclerView/e4aa22548b3c59d1270d194b52a615c1e38ee45f/LRecyclerview_library/src/main/res/drawable-hdpi/loading_02.png -------------------------------------------------------------------------------- /LRecyclerview_library/src/main/res/drawable-hdpi/loading_03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdsjlzx/LRecyclerView/e4aa22548b3c59d1270d194b52a615c1e38ee45f/LRecyclerview_library/src/main/res/drawable-hdpi/loading_03.png -------------------------------------------------------------------------------- /LRecyclerview_library/src/main/res/drawable-hdpi/loading_04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdsjlzx/LRecyclerView/e4aa22548b3c59d1270d194b52a615c1e38ee45f/LRecyclerview_library/src/main/res/drawable-hdpi/loading_04.png -------------------------------------------------------------------------------- /LRecyclerview_library/src/main/res/drawable-hdpi/loading_05.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdsjlzx/LRecyclerView/e4aa22548b3c59d1270d194b52a615c1e38ee45f/LRecyclerview_library/src/main/res/drawable-hdpi/loading_05.png -------------------------------------------------------------------------------- /LRecyclerview_library/src/main/res/drawable-hdpi/loading_06.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdsjlzx/LRecyclerView/e4aa22548b3c59d1270d194b52a615c1e38ee45f/LRecyclerview_library/src/main/res/drawable-hdpi/loading_06.png -------------------------------------------------------------------------------- /LRecyclerview_library/src/main/res/drawable-hdpi/loading_07.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdsjlzx/LRecyclerView/e4aa22548b3c59d1270d194b52a615c1e38ee45f/LRecyclerview_library/src/main/res/drawable-hdpi/loading_07.png -------------------------------------------------------------------------------- /LRecyclerview_library/src/main/res/drawable-hdpi/loading_08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdsjlzx/LRecyclerView/e4aa22548b3c59d1270d194b52a615c1e38ee45f/LRecyclerview_library/src/main/res/drawable-hdpi/loading_08.png -------------------------------------------------------------------------------- /LRecyclerview_library/src/main/res/drawable-hdpi/loading_09.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdsjlzx/LRecyclerView/e4aa22548b3c59d1270d194b52a615c1e38ee45f/LRecyclerview_library/src/main/res/drawable-hdpi/loading_09.png -------------------------------------------------------------------------------- /LRecyclerview_library/src/main/res/drawable-hdpi/loading_10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdsjlzx/LRecyclerView/e4aa22548b3c59d1270d194b52a615c1e38ee45f/LRecyclerview_library/src/main/res/drawable-hdpi/loading_10.png -------------------------------------------------------------------------------- /LRecyclerview_library/src/main/res/drawable-hdpi/loading_11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdsjlzx/LRecyclerView/e4aa22548b3c59d1270d194b52a615c1e38ee45f/LRecyclerview_library/src/main/res/drawable-hdpi/loading_11.png -------------------------------------------------------------------------------- /LRecyclerview_library/src/main/res/drawable-hdpi/loading_12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdsjlzx/LRecyclerView/e4aa22548b3c59d1270d194b52a615c1e38ee45f/LRecyclerview_library/src/main/res/drawable-hdpi/loading_12.png -------------------------------------------------------------------------------- /LRecyclerview_library/src/main/res/drawable-hdpi/progressbar.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /LRecyclerview_library/src/main/res/drawable/progressloading.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /LRecyclerview_library/src/main/res/layout/layout_horizontal_recyclerview_footer.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 14 | 15 | 20 | 21 | 26 | 27 | -------------------------------------------------------------------------------- /LRecyclerview_library/src/main/res/layout/layout_horizontal_recyclerview_footer_end.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 16 | -------------------------------------------------------------------------------- /LRecyclerview_library/src/main/res/layout/layout_horizontal_recyclerview_footer_loading.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 15 | 16 | 24 | -------------------------------------------------------------------------------- /LRecyclerview_library/src/main/res/layout/layout_horizontal_recyclerview_footer_network_error.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 13 | 14 | 22 | -------------------------------------------------------------------------------- /LRecyclerview_library/src/main/res/layout/layout_indicator_view.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /LRecyclerview_library/src/main/res/layout/layout_recyclerview_footer.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 14 | 15 | 20 | 21 | 26 | 27 | -------------------------------------------------------------------------------- /LRecyclerview_library/src/main/res/layout/layout_recyclerview_footer_end.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 16 | -------------------------------------------------------------------------------- /LRecyclerview_library/src/main/res/layout/layout_recyclerview_footer_loading.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 15 | 16 | 24 | -------------------------------------------------------------------------------- /LRecyclerview_library/src/main/res/layout/layout_recyclerview_footer_network_error.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 13 | 14 | 22 | -------------------------------------------------------------------------------- /LRecyclerview_library/src/main/res/layout/layout_recyclerview_swipe_item_default.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 16 | 17 | 21 | 22 | 26 | 27 | -------------------------------------------------------------------------------- /LRecyclerview_library/src/main/res/values-zh-rCN/strings.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 | -------------------------------------------------------------------------------- /LRecyclerview_library/src/main/res/values/attr.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /LRecyclerview_library/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #FFB5B5B5 4 | 5 | -------------------------------------------------------------------------------- /LRecyclerview_library/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 0.66dp 4 | 4dp 5 | 6dp 6 | 10dp 7 | 14dp 8 | 18dp 9 | 22dp 10 | 36dp 11 | 40dp 12 | 60dp 13 | 72dp 14 | 15 | 12sp 16 | 14sp 17 | 16sp 18 | 19 | 10dp 20 | 21 | 22 | -------------------------------------------------------------------------------- /LRecyclerview_library/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | Pull to refresh 3 | Refresh when release 4 | Loading... 5 | No more 6 | Refreshing... 7 | Refresh done 8 | Last update time: 9 | 10 | 11 | Loading... 12 | Click to refresh now 13 | Loading done 14 | 15 | Just 16 | seconds ago 17 | minutes ago 18 | hours ago 19 | days ago 20 | mouths ago 21 | years ago 22 | 23 | -------------------------------------------------------------------------------- /LRecyclerview_library/src/main/res/values/style.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 10 | 11 | 18 | 19 | 26 | 27 | -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | ### Android template 3 | # Built application files 4 | *.apk 5 | *.ap_ 6 | 7 | # Files for the ART/Dalvik VM 8 | *.dex 9 | 10 | # Java class files 11 | *.class 12 | 13 | # Generated files 14 | bin/ 15 | gen/ 16 | out/ 17 | 18 | # Gradle files 19 | .gradle/ 20 | build/ 21 | 22 | # Local configuration file (sdk path, etc) 23 | local.properties 24 | 25 | # Proguard folder generated by Eclipse 26 | proguard/ 27 | 28 | # Log Files 29 | *.log 30 | 31 | # Android Studio Navigation editor temp files 32 | .navigation/ 33 | 34 | # Android Studio captures folder 35 | captures/ 36 | 37 | # Intellij 38 | *.iml 39 | .idea/workspace.xml 40 | 41 | # Keystore files 42 | *.jks 43 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 27 5 | 6 | defaultConfig { 7 | applicationId "com.lzx.demo" 8 | minSdkVersion 16 9 | targetSdkVersion 27 10 | versionCode 1 11 | versionName "1.0" 12 | vectorDrawables.useSupportLibrary = true 13 | } 14 | buildTypes { 15 | release { 16 | minifyEnabled false 17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 18 | } 19 | } 20 | } 21 | 22 | dependencies { 23 | implementation fileTree(include: ['*.jar'], dir: 'libs') 24 | implementation 'com.android.support:cardview-v7:27.1.1' 25 | implementation 'com.android.support.constraint:constraint-layout:1.1.0' 26 | implementation 'com.github.bumptech.glide:glide:4.3.1' 27 | annotationProcessor 'com.github.bumptech.glide:compiler:4.3.1' 28 | implementation project(path: ':LRecyclerview_library') 29 | implementation 'com.nineoldandroids:library:2.4.0' 30 | implementation 'com.github.jdsjlzx:banner:1.0.0' 31 | implementation 'com.android.support:design:27.1.1' 32 | } 33 | -------------------------------------------------------------------------------- /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/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/java/com/lzx/demo/AppContext.java: -------------------------------------------------------------------------------- 1 | package com.lzx.demo; 2 | 3 | import android.app.Application; 4 | 5 | 6 | public class AppContext extends Application { 7 | private static AppContext instance ; 8 | 9 | @Override 10 | public void onCreate() { 11 | super.onCreate(); 12 | instance = this; 13 | 14 | } 15 | 16 | public static AppContext getInstance() { 17 | return instance; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /app/src/main/java/com/lzx/demo/ItemDecoration/StickyHeaderAdapter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014 Eduardo Barrenechea 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.lzx.demo.ItemDecoration; 18 | 19 | import android.support.v7.widget.RecyclerView; 20 | import android.view.ViewGroup; 21 | 22 | /** 23 | * The adapter to assist the {@link StickyHeaderDecoration} in creating and binding the header views. 24 | * 25 | * @param the header view holder 26 | */ 27 | public interface StickyHeaderAdapter { 28 | 29 | /** 30 | * Returns the header id for the item at the given position. 31 | * 32 | * @param position the item position 33 | * @return the header id 34 | */ 35 | long getHeaderId(int position); 36 | 37 | /** 38 | * Creates a new header ViewHolder. 39 | * 40 | * @param parent the header's view parent 41 | * @return a view holder for the created view 42 | */ 43 | T onCreateHeaderViewHolder(ViewGroup parent); 44 | 45 | /** 46 | * Updates the header view to reflect the header data for the given position 47 | * @param viewholder the header view holder 48 | * @param position the header's item position 49 | */ 50 | void onBindHeaderViewHolder(T viewholder, int position); 51 | } 52 | -------------------------------------------------------------------------------- /app/src/main/java/com/lzx/demo/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.lzx.demo; 2 | 3 | import android.content.Intent; 4 | import android.os.Bundle; 5 | 6 | import com.lzx.demo.base.BaseMainActivity; 7 | import com.lzx.demo.multitype.MultiTypeActivity; 8 | import com.lzx.demo.ui.CommonActivity; 9 | import com.lzx.demo.ui.CoordinatorLayoutActivity; 10 | import com.lzx.demo.ui.PulldownRefreshActivity; 11 | import com.lzx.demo.ui.SectionCollectionActivity; 12 | import com.lzx.demo.ui.SwipeMenuActivity; 13 | 14 | public class MainActivity extends BaseMainActivity { 15 | 16 | private static final Class[] ACTIVITY = {CommonActivity.class, CoordinatorLayoutActivity.class, MultiTypeActivity.class, SectionCollectionActivity.class, SwipeMenuActivity.class,PulldownRefreshActivity.class}; 17 | private static final String[] TITLE = {"CommonActivity","CoordinatorLayoutActivity","MultiTypeActivity", "SectionCollectionActivity","SwipeMenuActivity","PulldownRefreshActivity"}; 18 | 19 | @Override 20 | public Class[] getActivitys() { 21 | return ACTIVITY; 22 | } 23 | 24 | @Override 25 | public String[] getTitles() { 26 | return TITLE; 27 | } 28 | 29 | @Override 30 | protected void onCreate(Bundle savedInstanceState) { 31 | super.onCreate(savedInstanceState); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /app/src/main/java/com/lzx/demo/adapter/DataAdapter.java: -------------------------------------------------------------------------------- 1 | package com.lzx.demo.adapter; 2 | 3 | import android.content.Context; 4 | import android.text.Editable; 5 | import android.text.TextWatcher; 6 | import android.widget.EditText; 7 | import android.widget.TextView; 8 | 9 | import com.lzx.demo.R; 10 | import com.lzx.demo.base.ListBaseAdapter; 11 | import com.lzx.demo.base.SuperViewHolder; 12 | import com.lzx.demo.bean.ItemModel; 13 | 14 | /** 15 | * Created by Lzx on 2016/12/30. 16 | */ 17 | 18 | public class DataAdapter extends ListBaseAdapter { 19 | 20 | public DataAdapter(Context context) { 21 | super(context); 22 | } 23 | 24 | @Override 25 | public int getLayoutId() { 26 | return R.layout.sample_item_text; 27 | } 28 | 29 | @Override 30 | public void onBindItemHolder(SuperViewHolder holder, int position) { 31 | ItemModel item = mDataList.get(position); 32 | 33 | TextView titleText = holder.getView(R.id.info_text); 34 | titleText.setText(item.title); 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /app/src/main/java/com/lzx/demo/adapter/GoodsAdapter.java: -------------------------------------------------------------------------------- 1 | package com.lzx.demo.adapter; 2 | 3 | import android.content.Context; 4 | import android.widget.TextView; 5 | 6 | import com.lzx.demo.R; 7 | import com.lzx.demo.base.ListBaseAdapter; 8 | import com.lzx.demo.base.SuperViewHolder; 9 | import com.lzx.demo.bean.Goods; 10 | 11 | import java.util.List; 12 | 13 | /** 14 | * Created by lizhixian on 2016/11/19. 15 | */ 16 | 17 | public class GoodsAdapter extends ListBaseAdapter { 18 | 19 | public GoodsAdapter(Context context, List list) { 20 | super(context); 21 | setDataList(list); 22 | } 23 | 24 | @Override 25 | public int getLayoutId() { 26 | return R.layout.layout_list_item_nest_inner; 27 | } 28 | 29 | @Override 30 | public void onBindItemHolder(SuperViewHolder holder, int position) { 31 | TextView titleTextView = holder.getView(R.id.title); 32 | titleTextView.setText(getDataList().get(position).title); 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /app/src/main/java/com/lzx/demo/adapter/HorizontalDataAdapter.java: -------------------------------------------------------------------------------- 1 | package com.lzx.demo.adapter; 2 | 3 | import android.content.Context; 4 | import android.widget.TextView; 5 | 6 | import com.lzx.demo.R; 7 | import com.lzx.demo.base.ListBaseAdapter; 8 | import com.lzx.demo.base.SuperViewHolder; 9 | import com.lzx.demo.bean.ItemModel; 10 | 11 | /** 12 | * Created by Lzx on 2016/12/30. 13 | */ 14 | 15 | public class HorizontalDataAdapter extends ListBaseAdapter { 16 | 17 | public HorizontalDataAdapter(Context context) { 18 | super(context); 19 | } 20 | 21 | @Override 22 | public int getLayoutId() { 23 | return R.layout.sample_item_text_horizontal; 24 | } 25 | 26 | @Override 27 | public void onBindItemHolder(SuperViewHolder holder, int position) { 28 | ItemModel item = mDataList.get(position); 29 | 30 | TextView titleText = holder.getView(R.id.info_text); 31 | titleText.setText(item.title); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /app/src/main/java/com/lzx/demo/adapter/MainAdapter.java: -------------------------------------------------------------------------------- 1 | package com.lzx.demo.adapter; 2 | 3 | import android.support.v7.widget.RecyclerView; 4 | import android.view.LayoutInflater; 5 | import android.view.ViewGroup; 6 | 7 | import com.lzx.demo.bean.Visitable; 8 | import com.lzx.demo.holder.BetterViewHolder; 9 | import com.lzx.demo.type.TypeFactory; 10 | 11 | import java.util.List; 12 | 13 | 14 | /** 15 | * Created by qiu on 11/18/16. 16 | */ 17 | public class MainAdapter extends RecyclerView.Adapter { 18 | 19 | private TypeFactory mTypeFactory; 20 | private List mVisitables; 21 | 22 | public MainAdapter(TypeFactory typeFactory, List visitables) { 23 | mTypeFactory = typeFactory; 24 | mVisitables = visitables; 25 | } 26 | 27 | @Override 28 | public int getItemViewType(int position) { 29 | return mVisitables.get(position).type(mTypeFactory); 30 | } 31 | 32 | @Override 33 | public BetterViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { 34 | return mTypeFactory.onCreateViewHolder(LayoutInflater.from(parent.getContext()).inflate(viewType, parent, false), viewType); 35 | } 36 | 37 | @Override 38 | public void onBindViewHolder(BetterViewHolder holder, int position) { 39 | 40 | holder.bindItem(mVisitables.get(position)); 41 | 42 | } 43 | 44 | @Override 45 | public int getItemCount() { 46 | return mVisitables.size(); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /app/src/main/java/com/lzx/demo/adapter/MultipleItemAdapter.java: -------------------------------------------------------------------------------- 1 | package com.lzx.demo.adapter; 2 | 3 | import android.content.Context; 4 | import android.widget.ImageView; 5 | import android.widget.TextView; 6 | 7 | import com.lzx.demo.R; 8 | import com.lzx.demo.base.BaseMultiAdapter; 9 | import com.lzx.demo.base.SuperViewHolder; 10 | import com.lzx.demo.bean.MultipleItem; 11 | 12 | /** 13 | * Created by Lzx on 2016/12/30. 14 | */ 15 | 16 | public class MultipleItemAdapter extends BaseMultiAdapter { 17 | 18 | public MultipleItemAdapter(Context context) { 19 | super(context); 20 | addItemType(MultipleItem.TEXT, R.layout.list_item_text); 21 | addItemType(MultipleItem.IMG, R.layout.list_item_pic); 22 | } 23 | 24 | @Override 25 | public void onBindItemHolder(SuperViewHolder holder, int position) { 26 | MultipleItem item = getDataList().get(position); 27 | switch (item.getItemType()) { 28 | case MultipleItem.TEXT: 29 | bindTextItem(holder,item); 30 | break; 31 | case MultipleItem.IMG: 32 | bindPicItem(holder,item); 33 | break; 34 | default: 35 | break; 36 | } 37 | 38 | } 39 | 40 | private void bindTextItem(SuperViewHolder holder, MultipleItem item) { 41 | TextView textView = holder.getView(R.id.info_text); 42 | textView.setText(item.getTitle()); 43 | } 44 | 45 | private void bindPicItem(SuperViewHolder holder, MultipleItem item) { 46 | TextView textView = holder.getView(R.id.info_text); 47 | ImageView avatarImage = holder.getView(R.id.avatar_image); 48 | 49 | textView.setText(item.getTitle()); 50 | avatarImage.setImageResource(R.mipmap.icon); 51 | } 52 | 53 | 54 | } 55 | -------------------------------------------------------------------------------- /app/src/main/java/com/lzx/demo/base/CommentItem.java: -------------------------------------------------------------------------------- 1 | package com.lzx.demo.base; 2 | 3 | import com.lzx.demo.adapter.ExpandableRecyclerAdapter; 4 | 5 | import static com.lzx.demo.adapter.CommentExpandAdapter.TYPE_PERSON; 6 | import static com.lzx.demo.adapter.ExpandableRecyclerAdapter.TYPE_HEADER; 7 | 8 | /** 9 | * Created by Lzx on 2016/9/30. 10 | */ 11 | 12 | public class CommentItem extends ExpandableRecyclerAdapter.ListItem { 13 | 14 | public String Text; 15 | 16 | public CommentItem(String group) { 17 | super(TYPE_HEADER); 18 | Text = group; 19 | } 20 | 21 | public CommentItem(String first, String last) { 22 | super(TYPE_PERSON); 23 | Text = first + " " + last; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /app/src/main/java/com/lzx/demo/base/Entity.java: -------------------------------------------------------------------------------- 1 | package com.lzx.demo.base; 2 | 3 | 4 | import java.io.Serializable; 5 | 6 | /** 7 | * 实体类 8 | * 9 | */ 10 | public abstract class Entity implements Serializable{ 11 | public int id; 12 | public int type; // content type 13 | 14 | } 15 | -------------------------------------------------------------------------------- /app/src/main/java/com/lzx/demo/base/SuperViewHolder.java: -------------------------------------------------------------------------------- 1 | package com.lzx.demo.base; 2 | 3 | import android.support.v7.widget.RecyclerView; 4 | import android.util.SparseArray; 5 | import android.view.View; 6 | 7 | /** 8 | * ViewHolder基类 9 | */ 10 | public class SuperViewHolder extends RecyclerView.ViewHolder { 11 | 12 | private SparseArray views; 13 | 14 | public SuperViewHolder(View itemView) { 15 | super(itemView); 16 | this.views = new SparseArray<>(); 17 | } 18 | 19 | @SuppressWarnings("unchecked") 20 | public T getView(int viewId) { 21 | View view = views.get(viewId); 22 | if (view == null) { 23 | view = itemView.findViewById(viewId); 24 | views.put(viewId, view); 25 | } 26 | return (T) view; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /app/src/main/java/com/lzx/demo/bean/AnimalObject.java: -------------------------------------------------------------------------------- 1 | package com.lzx.demo.bean; 2 | 3 | /** 4 | * Created by faudigue on 30/04/2015. 5 | */ 6 | public class AnimalObject { 7 | 8 | public String name; 9 | public String type; 10 | 11 | public AnimalObject(final String name, final String type){ 12 | 13 | this.name = name ; 14 | this.type = type ; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /app/src/main/java/com/lzx/demo/bean/BannerInfo.java: -------------------------------------------------------------------------------- 1 | package com.lzx.demo.bean; 2 | 3 | 4 | 5 | public class BannerInfo { 6 | public String imgUrl; 7 | public String title; 8 | 9 | public BannerInfo(String imgUrl, String title) { 10 | this.imgUrl = imgUrl; 11 | this.title = title; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /app/src/main/java/com/lzx/demo/bean/Category.java: -------------------------------------------------------------------------------- 1 | package com.lzx.demo.bean; 2 | 3 | import com.lzx.demo.type.TypeFactory; 4 | 5 | /** 6 | * Created by lizhixian on 2016/12/24. 7 | */ 8 | 9 | public class Category implements Visitable{ 10 | public String title; 11 | 12 | public Category(String title) { 13 | this.title = title; 14 | } 15 | 16 | @Override 17 | public int type(TypeFactory typeFactory) { 18 | return typeFactory.type(this); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /app/src/main/java/com/lzx/demo/bean/Goods.java: -------------------------------------------------------------------------------- 1 | package com.lzx.demo.bean; 2 | 3 | import com.lzx.demo.base.Entity; 4 | 5 | /** 6 | * Created by lizhixian on 2016/11/19. 7 | */ 8 | 9 | public class Goods extends Entity{ 10 | public String title; 11 | public String price; 12 | } 13 | -------------------------------------------------------------------------------- /app/src/main/java/com/lzx/demo/bean/HotList.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 drakeet. https://github.com/drakeet 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.lzx.demo.bean; 18 | 19 | import android.support.annotation.NonNull; 20 | 21 | import com.lzx.demo.type.TypeFactory; 22 | 23 | import java.util.List; 24 | 25 | public class HotList implements Visitable { 26 | 27 | public List products; 28 | 29 | public HotList(@NonNull List products) {this.products = products;} 30 | 31 | @Override 32 | public int type(TypeFactory typeFactory) { 33 | return typeFactory.type(this); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /app/src/main/java/com/lzx/demo/bean/ItemModel.java: -------------------------------------------------------------------------------- 1 | package com.lzx.demo.bean; 2 | 3 | 4 | import com.lzx.demo.base.Entity; 5 | 6 | public class ItemModel extends Entity { 7 | public long id; 8 | public String title; 9 | public int imgRes; 10 | public String imgUrl; 11 | public int height ; 12 | } -------------------------------------------------------------------------------- /app/src/main/java/com/lzx/demo/bean/Level0Item.java: -------------------------------------------------------------------------------- 1 | package com.lzx.demo.bean; 2 | 3 | 4 | import com.lzx.demo.adapter.ExpandableItemAdapter; 5 | 6 | public class Level0Item extends AbstractExpandableItem implements MultiItemEntity { 7 | public String title; 8 | public String subTitle; 9 | 10 | public Level0Item(String title, String subTitle) { 11 | this.subTitle = subTitle; 12 | this.title = title; 13 | } 14 | 15 | @Override 16 | public int getItemType() { 17 | return ExpandableItemAdapter.TYPE_LEVEL_ZERO; 18 | } 19 | 20 | @Override 21 | public int getLevel() { 22 | return 0; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /app/src/main/java/com/lzx/demo/bean/Level1Item.java: -------------------------------------------------------------------------------- 1 | package com.lzx.demo.bean; 2 | 3 | 4 | import com.lzx.demo.adapter.ExpandableItemAdapter; 5 | 6 | public class Level1Item extends AbstractExpandableItem implements MultiItemEntity{ 7 | public String title; 8 | public String subTitle; 9 | 10 | public Level1Item(String title, String subTitle) { 11 | this.subTitle = subTitle; 12 | this.title = title; 13 | } 14 | 15 | @Override 16 | public int getItemType() { 17 | return ExpandableItemAdapter.TYPE_LEVEL_ONE; 18 | } 19 | 20 | @Override 21 | public int getLevel() { 22 | return 1; 23 | } 24 | } -------------------------------------------------------------------------------- /app/src/main/java/com/lzx/demo/bean/MultiItemEntity.java: -------------------------------------------------------------------------------- 1 | package com.lzx.demo.bean; 2 | 3 | public interface MultiItemEntity { 4 | 5 | int getItemType(); 6 | 7 | } 8 | -------------------------------------------------------------------------------- /app/src/main/java/com/lzx/demo/bean/MultipleItem.java: -------------------------------------------------------------------------------- 1 | package com.lzx.demo.bean; 2 | 3 | public class MultipleItem implements MultiItemEntity { 4 | public static final int TEXT = 1; 5 | public static final int IMG = 2; 6 | public static final int LIST = 3; 7 | public static final int FOOT = 4; 8 | public static final int TEXT_SPAN_SIZE = 1; 9 | public static final int IMG_SPAN_SIZE = 3; 10 | private int itemType; 11 | private int spanSize; 12 | 13 | public static final int FOOT_MY_GROUP = 100; 14 | public static final int FOOT_PUBLIC_GROUP= 101; 15 | 16 | 17 | 18 | public MultipleItem(int itemType) { 19 | this.itemType = itemType; 20 | } 21 | 22 | public MultipleItem(int itemType, int spanSize) { 23 | this.itemType = itemType; 24 | this.spanSize = spanSize; 25 | } 26 | 27 | public int getSpanSize() { 28 | return spanSize; 29 | } 30 | 31 | public void setSpanSize(int spanSize) { 32 | this.spanSize = spanSize; 33 | } 34 | 35 | @Override 36 | public int getItemType() { 37 | return itemType; 38 | } 39 | 40 | private String title; 41 | private int footCategory; 42 | 43 | public String getTitle() { 44 | return title; 45 | } 46 | 47 | public void setTitle(String title) { 48 | this.title = title; 49 | } 50 | 51 | public int getFootCategory() { 52 | return footCategory; 53 | } 54 | 55 | public void setFootCategory(int footCategory) { 56 | this.footCategory = footCategory; 57 | } 58 | 59 | } 60 | -------------------------------------------------------------------------------- /app/src/main/java/com/lzx/demo/bean/Order.java: -------------------------------------------------------------------------------- 1 | package com.lzx.demo.bean; 2 | 3 | import java.util.List; 4 | 5 | /** 6 | * Created by lizhixian on 2016/11/19. 7 | */ 8 | 9 | public class Order { 10 | private String shopName; 11 | private List goodsList; 12 | } 13 | -------------------------------------------------------------------------------- /app/src/main/java/com/lzx/demo/bean/Person.java: -------------------------------------------------------------------------------- 1 | package com.lzx.demo.bean; 2 | 3 | 4 | import com.lzx.demo.adapter.ExpandableItemAdapter; 5 | 6 | 7 | public class Person implements MultiItemEntity{ 8 | 9 | public Person(String name, int age) { 10 | this.age = age; 11 | this.name = name; 12 | } 13 | 14 | public String name; 15 | public int age; 16 | 17 | @Override 18 | public int getItemType() { 19 | return ExpandableItemAdapter.TYPE_ENTITY; 20 | } 21 | } -------------------------------------------------------------------------------- /app/src/main/java/com/lzx/demo/bean/PinnedHeaderEntity.java: -------------------------------------------------------------------------------- 1 | package com.lzx.demo.bean; 2 | 3 | 4 | import com.lzx.demo.base.Entity; 5 | 6 | /** 7 | *

8 | * 大标签实体类,可以将自己想要填充的数据包装进去,同时附带这个数据对应的类型 9 | */ 10 | public class PinnedHeaderEntity extends Entity { 11 | 12 | private T data; 13 | private String pinnedHeaderName; 14 | 15 | public PinnedHeaderEntity(T data, int type, String pinnedHeaderName) { 16 | this.data = data; 17 | super.type = type; 18 | this.pinnedHeaderName = pinnedHeaderName; 19 | } 20 | 21 | public void setData(T data) { 22 | this.data = data; 23 | } 24 | 25 | 26 | public void setPinnedHeaderName(String pinnedHeaderName) { 27 | this.pinnedHeaderName = pinnedHeaderName; 28 | } 29 | 30 | public T getData() { 31 | return data; 32 | } 33 | 34 | public String getPinnedHeaderName() { 35 | return pinnedHeaderName; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /app/src/main/java/com/lzx/demo/bean/Product.java: -------------------------------------------------------------------------------- 1 | package com.lzx.demo.bean; 2 | 3 | /** 4 | * Created by lizhixian on 2016/12/24. 5 | */ 6 | 7 | public class Product{ 8 | public String title; 9 | public int coverResId; 10 | 11 | public Product(String title, int coverResId) { 12 | this.title = title; 13 | this.coverResId = coverResId; 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /app/src/main/java/com/lzx/demo/bean/ProductList.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 drakeet. https://github.com/drakeet 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.lzx.demo.bean; 18 | 19 | import android.support.annotation.NonNull; 20 | 21 | import com.lzx.demo.type.TypeFactory; 22 | 23 | import java.util.List; 24 | 25 | public class ProductList implements Visitable { 26 | 27 | public List products; 28 | 29 | public ProductList(@NonNull List products) {this.products = products;} 30 | 31 | @Override 32 | public int type(TypeFactory typeFactory) { 33 | return typeFactory.type(this); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /app/src/main/java/com/lzx/demo/bean/StockEntity.java: -------------------------------------------------------------------------------- 1 | package com.lzx.demo.bean; 2 | 3 | import java.util.List; 4 | 5 | /** 6 | * Created by Oubowu on 2016/7/27 12:59. 7 | */ 8 | public class StockEntity { 9 | 10 | // 振幅榜 11 | public List amplitude_list; 12 | 13 | // 跌幅榜 14 | public List down_list; 15 | 16 | // 换手率 17 | public List change_list; 18 | 19 | // 涨幅榜 20 | public List increase_list; 21 | 22 | public static class StockInfo { 23 | public double rate; 24 | public String current_price; 25 | public String stock_code; 26 | public String stock_name; 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /app/src/main/java/com/lzx/demo/bean/Visitable.java: -------------------------------------------------------------------------------- 1 | package com.lzx.demo.bean; 2 | 3 | 4 | import com.lzx.demo.type.TypeFactory; 5 | 6 | public interface Visitable { 7 | 8 | int type(TypeFactory typeFactory); 9 | 10 | } 11 | -------------------------------------------------------------------------------- /app/src/main/java/com/lzx/demo/fragment/BaseDecorationFragment.java: -------------------------------------------------------------------------------- 1 | package com.lzx.demo.fragment; 2 | 3 | import android.os.Bundle; 4 | import android.support.annotation.Nullable; 5 | import android.support.v4.app.Fragment; 6 | import android.support.v7.widget.LinearLayoutManager; 7 | import android.support.v7.widget.RecyclerView; 8 | import android.view.LayoutInflater; 9 | import android.view.View; 10 | import android.view.ViewGroup; 11 | 12 | import com.github.jdsjlzx.recyclerview.LRecyclerView; 13 | import com.github.jdsjlzx.recyclerview.LRecyclerViewAdapter; 14 | import com.lzx.demo.ItemDecoration.DividerDecoration; 15 | import com.lzx.demo.R; 16 | 17 | public abstract class BaseDecorationFragment extends Fragment { 18 | 19 | private LRecyclerView mList; 20 | protected LRecyclerViewAdapter mLRecyclerViewAdapter = null; 21 | @Nullable 22 | @Override 23 | public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { 24 | final View view = inflater.inflate(R.layout.fragment_recycler, container, false); 25 | 26 | mList = (LRecyclerView) view.findViewById(R.id.list); 27 | mList.setPullRefreshEnabled(false); 28 | 29 | return view; 30 | } 31 | 32 | @Override 33 | public void onActivityCreated(Bundle savedInstanceState) { 34 | super.onActivityCreated(savedInstanceState); 35 | 36 | final DividerDecoration divider = new DividerDecoration.Builder(this.getActivity()) 37 | .setHeight(R.dimen.default_divider_height) 38 | .setPadding(R.dimen.default_divider_padding) 39 | .setColorResource(R.color.default_header_color) 40 | .build(); 41 | 42 | mList.setHasFixedSize(true); 43 | mList.setLayoutManager(new LinearLayoutManager(this.getActivity())); 44 | mList.addItemDecoration(divider); 45 | 46 | setAdapterAndDecor(mList); 47 | } 48 | 49 | protected abstract void setAdapterAndDecor(RecyclerView list); 50 | } 51 | -------------------------------------------------------------------------------- /app/src/main/java/com/lzx/demo/fragment/InlineStickyHeaderFragment.java: -------------------------------------------------------------------------------- 1 | package com.lzx.demo.fragment; 2 | 3 | import android.support.v7.widget.RecyclerView; 4 | import android.view.MenuItem; 5 | 6 | import com.github.jdsjlzx.recyclerview.LRecyclerViewAdapter; 7 | import com.lzx.demo.ItemDecoration.StickyHeaderDecoration; 8 | import com.lzx.demo.R; 9 | import com.lzx.demo.adapter.InlineStickyTestAdapter; 10 | 11 | public class InlineStickyHeaderFragment 12 | extends BaseDecorationFragment { 13 | 14 | private StickyHeaderDecoration decor; 15 | 16 | @Override 17 | protected void setAdapterAndDecor(RecyclerView list) { 18 | final InlineStickyTestAdapter adapter = new InlineStickyTestAdapter(this.getActivity()); 19 | decor = new StickyHeaderDecoration(adapter, true); 20 | setHasOptionsMenu(true); 21 | 22 | mLRecyclerViewAdapter = new LRecyclerViewAdapter(adapter); 23 | list.setAdapter(mLRecyclerViewAdapter); 24 | list.addItemDecoration(decor, 1); 25 | } 26 | 27 | @Override 28 | public boolean onOptionsItemSelected(MenuItem item) { 29 | if (item.getItemId() == R.id.action_clear_cache) { 30 | decor.clearHeaderCache(); 31 | return true; 32 | } 33 | 34 | return super.onOptionsItemSelected(item); 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /app/src/main/java/com/lzx/demo/holder/BetterViewHolder.java: -------------------------------------------------------------------------------- 1 | package com.lzx.demo.holder; 2 | 3 | import android.support.v7.widget.RecyclerView; 4 | import android.view.View; 5 | 6 | import com.lzx.demo.bean.Visitable; 7 | 8 | public abstract class BetterViewHolder extends RecyclerView.ViewHolder { 9 | 10 | public BetterViewHolder(View itemView) { 11 | super(itemView); 12 | } 13 | 14 | public abstract void bindItem(T t); 15 | } 16 | -------------------------------------------------------------------------------- /app/src/main/java/com/lzx/demo/holder/CategoryViewHolder.java: -------------------------------------------------------------------------------- 1 | package com.lzx.demo.holder; 2 | 3 | import android.view.View; 4 | import android.widget.TextView; 5 | 6 | import com.lzx.demo.R; 7 | import com.lzx.demo.bean.Category; 8 | import com.lzx.demo.bean.Visitable; 9 | 10 | 11 | /** 12 | * Created by lizhixian on 2016/12/24. 13 | */ 14 | 15 | public class CategoryViewHolder extends BetterViewHolder { 16 | 17 | private TextView titleText; 18 | public CategoryViewHolder(View itemView) { 19 | super(itemView); 20 | titleText = (TextView) itemView.findViewById(R.id.title); 21 | } 22 | 23 | @Override 24 | public void bindItem(Visitable visitable) { 25 | Category category = (Category) visitable; 26 | titleText.setText(category.title); 27 | 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /app/src/main/java/com/lzx/demo/holder/HotListViewHolder.java: -------------------------------------------------------------------------------- 1 | package com.lzx.demo.holder; 2 | 3 | import android.support.v7.widget.LinearLayoutManager; 4 | import android.support.v7.widget.RecyclerView; 5 | import android.view.View; 6 | 7 | import com.lzx.demo.R; 8 | import com.lzx.demo.adapter.HotsAdapter; 9 | import com.lzx.demo.bean.HotList; 10 | import com.lzx.demo.bean.Product; 11 | import com.lzx.demo.bean.Visitable; 12 | 13 | import java.util.List; 14 | 15 | 16 | /** 17 | * Created by lizhixian on 2016/12/24. 18 | */ 19 | 20 | public class HotListViewHolder extends BetterViewHolder { 21 | 22 | private RecyclerView recyclerView; 23 | private HotsAdapter adapter; 24 | public HotListViewHolder(View itemView) { 25 | super(itemView); 26 | recyclerView = (RecyclerView) itemView.findViewById(R.id.recycler_view); 27 | LinearLayoutManager layoutManager 28 | = new LinearLayoutManager(itemView.getContext(), LinearLayoutManager.HORIZONTAL, false); 29 | layoutManager.setOrientation(LinearLayoutManager.HORIZONTAL); 30 | recyclerView.setLayoutManager(layoutManager); 31 | adapter = new HotsAdapter(); 32 | recyclerView.setAdapter(adapter); 33 | } 34 | 35 | @Override 36 | public void bindItem(Visitable visitable) { 37 | HotList hotList = (HotList) visitable; 38 | List products = hotList.products; 39 | adapter.setData(products); 40 | adapter.notifyDataSetChanged(); 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /app/src/main/java/com/lzx/demo/holder/ProductListViewHolder.java: -------------------------------------------------------------------------------- 1 | package com.lzx.demo.holder; 2 | 3 | import android.support.v7.widget.GridLayoutManager; 4 | import android.support.v7.widget.RecyclerView; 5 | import android.view.View; 6 | 7 | import com.lzx.demo.R; 8 | import com.lzx.demo.adapter.ProductsAdapter; 9 | import com.lzx.demo.bean.Product; 10 | import com.lzx.demo.bean.ProductList; 11 | import com.lzx.demo.bean.Visitable; 12 | 13 | import java.util.List; 14 | 15 | 16 | /** 17 | * Created by lizhixian on 2016/12/24. 18 | */ 19 | 20 | public class ProductListViewHolder extends BetterViewHolder { 21 | 22 | private RecyclerView recyclerView; 23 | private ProductsAdapter adapter; 24 | public ProductListViewHolder(View itemView) { 25 | super(itemView); 26 | recyclerView = (RecyclerView) itemView.findViewById(R.id.recycler_view); 27 | GridLayoutManager layoutManager = new GridLayoutManager(itemView.getContext(), 2); 28 | recyclerView.setLayoutManager(layoutManager); 29 | recyclerView.setHasFixedSize(true); 30 | adapter = new ProductsAdapter(); 31 | recyclerView.setAdapter(adapter); 32 | } 33 | 34 | @Override 35 | public void bindItem(Visitable visitable) { 36 | ProductList productList = (ProductList) visitable; 37 | List products = productList.products; 38 | adapter.setData(products); 39 | adapter.notifyDataSetChanged(); 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /app/src/main/java/com/lzx/demo/imageloader/BaseImageLoaderStrategy.java: -------------------------------------------------------------------------------- 1 | package com.lzx.demo.imageloader; 2 | 3 | import android.content.Context; 4 | 5 | /** 6 | * Created by Lzx on 2016/12/8. 7 | * abstract class/interface defined to load image 8 | * (Strategy Pattern used here) 9 | */ 10 | 11 | public interface BaseImageLoaderStrategy { 12 | void loadImage(Context context, ImageLoader imageLoader); 13 | } 14 | -------------------------------------------------------------------------------- /app/src/main/java/com/lzx/demo/imageloader/GlideImageLoaderStrategy.java: -------------------------------------------------------------------------------- 1 | package com.lzx.demo.imageloader; 2 | 3 | import android.content.Context; 4 | 5 | import com.bumptech.glide.Glide; 6 | import com.bumptech.glide.load.engine.DiskCacheStrategy; 7 | 8 | /** 9 | * Created by Lzx on 2016/12/8. 10 | * 11 | * using {@link Glide} to load image 12 | * 参考:https://github.com/CameloeAnthony/Ant 13 | */ 14 | 15 | public class GlideImageLoaderStrategy implements BaseImageLoaderStrategy { 16 | @Override 17 | public void loadImage(Context context, ImageLoader imageLoader) { 18 | //if currently not under wifi 19 | if(!ImageLoaderUtil.wifiFlag) { 20 | loadNormal(context,imageLoader); 21 | return; 22 | } 23 | 24 | int strategy = imageLoader.getWifiStrategy(); 25 | 26 | if (strategy == ImageLoaderUtil.LOAD_STRATEGY_ONLY_WIFI) { 27 | int netType = ImageLoaderUtil.getNetWorkType(context); 28 | //if wifi ,load pic 29 | if (netType == ImageLoaderUtil.NETWORKTYPE_WIFI) { 30 | loadNormal(context,imageLoader); 31 | } else { 32 | //if not wifi ,load cache 33 | loadCache(context,imageLoader); 34 | } 35 | } else { 36 | //如果不是在wifi下才加载图片 37 | loadNormal(context,imageLoader); 38 | } 39 | } 40 | 41 | /** 42 | * load image with Glide 43 | */ 44 | private void loadNormal(Context context, ImageLoader imageLoader) { 45 | Glide.with(context) 46 | .load(imageLoader.getUrl()) 47 | .into(imageLoader.getImgView()); 48 | } 49 | 50 | /** 51 | * load cache image with Glide 52 | */ 53 | private void loadCache(Context context, ImageLoader imageLoader) { 54 | 55 | //缓存策略解说: 56 | //all:缓存源资源和转换后的资源 57 | //none:不作任何磁盘缓存 58 | //source:缓存源资源 59 | //result:缓存转换后的资源 60 | Glide.with(context).load(imageLoader.getUrl()).into(imageLoader.getImgView()); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /app/src/main/java/com/lzx/demo/imageloader/PicassoImageLoaderStrategy.java: -------------------------------------------------------------------------------- 1 | package com.lzx.demo.imageloader; 2 | 3 | import android.content.Context; 4 | 5 | /** 6 | * Created by Lzx on 2016/12/8. 7 | * using Picasso to load image 8 | */ 9 | 10 | public class PicassoImageLoaderStrategy implements BaseImageLoaderStrategy { 11 | @Override 12 | public void loadImage(Context context, ImageLoader imageLoader) { 13 | //Todo 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /app/src/main/java/com/lzx/demo/interfaces/IExpandable.java: -------------------------------------------------------------------------------- 1 | package com.lzx.demo.interfaces; 2 | 3 | import java.util.List; 4 | 5 | /** 6 | * implement the interface if the item is expandable 7 | */ 8 | public interface IExpandable { 9 | boolean isExpanded(); 10 | void setExpanded(boolean expanded); 11 | List getSubItems(); 12 | 13 | /** 14 | * Get the level of this item. The level start from 0. 15 | * If you don't care about the level, just return a negative. 16 | */ 17 | int getLevel(); 18 | } 19 | -------------------------------------------------------------------------------- /app/src/main/java/com/lzx/demo/interfaces/OnHeaderClickListener.java: -------------------------------------------------------------------------------- 1 | package com.lzx.demo.interfaces; 2 | 3 | /** 4 | * Created by Oubowu on 2016/7/24 23:53. 5 | *

6 | * 顶部标签点击监听 7 | */ 8 | public interface OnHeaderClickListener { 9 | 10 | void onHeaderClick(int id, int position, T data); 11 | 12 | void onHeaderLongClick(int id, int position, T data); 13 | 14 | void onHeaderDoubleClick(int id, int position, T data); 15 | 16 | } 17 | -------------------------------------------------------------------------------- /app/src/main/java/com/lzx/demo/interfaces/OnItemDragListener.java: -------------------------------------------------------------------------------- 1 | package com.lzx.demo.interfaces; 2 | 3 | import android.support.v7.widget.RecyclerView; 4 | 5 | public interface OnItemDragListener { 6 | void onItemDragStart(RecyclerView.ViewHolder viewHolder, int pos); 7 | void onItemDragMoving(RecyclerView.ViewHolder source, int from, RecyclerView.ViewHolder target, int to); 8 | void onItemDragEnd(RecyclerView.ViewHolder viewHolder, int pos); 9 | 10 | } 11 | -------------------------------------------------------------------------------- /app/src/main/java/com/lzx/demo/interfaces/OnItemSwipeListener.java: -------------------------------------------------------------------------------- 1 | package com.lzx.demo.interfaces; 2 | 3 | import android.graphics.Canvas; 4 | import android.support.v7.widget.RecyclerView; 5 | 6 | public interface OnItemSwipeListener { 7 | 8 | /** 9 | * Called when the swipe action start. 10 | */ 11 | void onItemSwipeStart(RecyclerView.ViewHolder viewHolder, int pos); 12 | 13 | /** 14 | * Called when the swipe action is over. 15 | * If you change the view on the start, you should reset is here, no matter the item has swiped or not. 16 | * @param pos If the view is swiped, pos will be negative. 17 | */ 18 | void clearView(RecyclerView.ViewHolder viewHolder, int pos); 19 | /** 20 | * Called when item is swiped, the view is going to be removed from the adapter. 21 | */ 22 | void onItemSwiped(RecyclerView.ViewHolder viewHolder, int pos); 23 | 24 | /** 25 | * Draw on the empty edge when swipe moving 26 | * @param canvas the empty edge's canvas 27 | * @param viewHolder The ViewHolder which is being interacted by the User or it was 28 | * interacted and simply animating to its original position 29 | * @param dX The amount of horizontal displacement caused by user's action 30 | * @param dY The amount of vertical displacement caused by user's action 31 | * @param isCurrentlyActive True if this view is currently being controlled by the user or 32 | * false it is simply animating back to its original state. 33 | */ 34 | void onItemSwipeMoving(Canvas canvas, RecyclerView.ViewHolder viewHolder, float dX, float dY, boolean isCurrentlyActive); 35 | 36 | } 37 | -------------------------------------------------------------------------------- /app/src/main/java/com/lzx/demo/interfaces/PinnedHeaderNotifyer.java: -------------------------------------------------------------------------------- 1 | package com.lzx.demo.interfaces; 2 | 3 | /** 4 | * Created by lzx 5 | *

6 | * Recycler的Adapter必须继承此接口来告诉ItemDecoration粘性标签的类型和某个位置粘性标签的信息 7 | */ 8 | public interface PinnedHeaderNotifyer { 9 | 10 | boolean isPinnedHeaderType(int viewType); 11 | 12 | T getPinnedHeaderInfo(int position); 13 | 14 | } 15 | -------------------------------------------------------------------------------- /app/src/main/java/com/lzx/demo/interfaces/Sectionizer.java: -------------------------------------------------------------------------------- 1 | package com.lzx.demo.interfaces; 2 | 3 | /** 4 | * Created by faudigue on 28/04/2015. 5 | */ 6 | public interface Sectionizer{ 7 | public String getSectionTitle(T object); 8 | } 9 | -------------------------------------------------------------------------------- /app/src/main/java/com/lzx/demo/multitype/MultiTypeActivity.java: -------------------------------------------------------------------------------- 1 | package com.lzx.demo.multitype; 2 | 3 | import com.lzx.demo.base.BaseMainActivity; 4 | 5 | public class MultiTypeActivity extends BaseMainActivity { 6 | 7 | private static final Class[] ACTIVITY = {BilibiliActivity.class, ExpandableActivity.class}; 8 | private static final String[] TITLE = {"BilibiliActivity","ExpandableActivity"}; 9 | 10 | public Class[] getActivitys() { 11 | return ACTIVITY; 12 | } 13 | 14 | @Override 15 | public String[] getTitles() { 16 | return TITLE; 17 | } 18 | 19 | 20 | } 21 | -------------------------------------------------------------------------------- /app/src/main/java/com/lzx/demo/type/ListTypeFactory.java: -------------------------------------------------------------------------------- 1 | package com.lzx.demo.type; 2 | 3 | import android.view.View; 4 | 5 | import com.lzx.demo.R; 6 | import com.lzx.demo.bean.Category; 7 | import com.lzx.demo.bean.HotList; 8 | import com.lzx.demo.bean.ProductList; 9 | import com.lzx.demo.holder.BetterViewHolder; 10 | import com.lzx.demo.holder.CategoryViewHolder; 11 | import com.lzx.demo.holder.HotListViewHolder; 12 | import com.lzx.demo.holder.ProductListViewHolder; 13 | 14 | 15 | public class ListTypeFactory implements TypeFactory { 16 | 17 | 18 | @Override 19 | public int type(Category category) { 20 | return R.layout.layout_list_item_category; 21 | } 22 | 23 | @Override 24 | public int type(ProductList products) { 25 | return R.layout.layout_item_list; 26 | } 27 | 28 | @Override 29 | public int type(HotList products) { 30 | return R.layout.layout_item_horizontal_list; 31 | } 32 | 33 | @Override 34 | public BetterViewHolder onCreateViewHolder(View itemView, int viewType) { 35 | BetterViewHolder viewHolder = null; 36 | switch (viewType) { 37 | case R.layout.layout_list_item_category: 38 | viewHolder = new CategoryViewHolder(itemView); 39 | break; 40 | case R.layout.layout_item_list: 41 | viewHolder = new ProductListViewHolder(itemView); 42 | break; 43 | case R.layout.layout_item_horizontal_list: 44 | viewHolder = new HotListViewHolder(itemView); 45 | break; 46 | default: 47 | break; 48 | } 49 | 50 | return viewHolder; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /app/src/main/java/com/lzx/demo/type/TypeFactory.java: -------------------------------------------------------------------------------- 1 | package com.lzx.demo.type; 2 | 3 | import android.view.View; 4 | 5 | import com.lzx.demo.bean.Category; 6 | import com.lzx.demo.bean.HotList; 7 | import com.lzx.demo.bean.ProductList; 8 | import com.lzx.demo.holder.BetterViewHolder; 9 | 10 | public interface TypeFactory { 11 | 12 | int type(Category title); 13 | int type(ProductList products); 14 | int type(HotList products); 15 | 16 | BetterViewHolder onCreateViewHolder(View itemView, int viewType); 17 | 18 | } 19 | -------------------------------------------------------------------------------- /app/src/main/java/com/lzx/demo/ui/CoordinatorLayoutActivity.java: -------------------------------------------------------------------------------- 1 | package com.lzx.demo.ui; 2 | 3 | import com.lzx.demo.base.BaseMainActivity; 4 | 5 | public class CoordinatorLayoutActivity extends BaseMainActivity { 6 | 7 | private static final Class[] ACTIVITY = {CollapsingToolbarLayoutActivity.class, CollapsingToolbarLayoutActivity2.class, AlipayHomeActivity.class}; 8 | private static final String[] TITLE = {"CollapsingToolbarLayoutActivity", "CollapsingToolbarLayoutActivity2", "AlipayHomeActivity"}; 9 | 10 | public Class[] getActivitys() { 11 | return ACTIVITY; 12 | } 13 | 14 | @Override 15 | public String[] getTitles() { 16 | return TITLE; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /app/src/main/java/com/lzx/demo/ui/LinearLayoutDelActivity.java: -------------------------------------------------------------------------------- 1 | package com.lzx.demo.ui; 2 | 3 | import android.os.Bundle; 4 | import android.support.v7.app.AppCompatActivity; 5 | import android.view.View; 6 | import android.widget.LinearLayout; 7 | import android.widget.Toast; 8 | 9 | import com.lzx.demo.R; 10 | 11 | public class LinearLayoutDelActivity extends AppCompatActivity { 12 | 13 | @Override 14 | protected void onCreate(Bundle savedInstanceState) { 15 | super.onCreate(savedInstanceState); 16 | setContentView(R.layout.activity_linear_layout_del); 17 | LinearLayout llContent = (LinearLayout) findViewById(R.id.llContent); 18 | llContent.setOnClickListener(new View.OnClickListener() { 19 | @Override 20 | public void onClick(View v) { 21 | Toast.makeText(LinearLayoutDelActivity.this, "内容区域被点击", Toast.LENGTH_SHORT).show(); 22 | } 23 | }); 24 | findViewById(R.id.btnDelete).setOnClickListener(new View.OnClickListener() { 25 | @Override 26 | public void onClick(View v) { 27 | Toast.makeText(LinearLayoutDelActivity.this, "删除按钮被点击", Toast.LENGTH_SHORT).show(); 28 | } 29 | }); 30 | 31 | 32 | LinearLayout llContent2 = (LinearLayout) findViewById(R.id.llContent); 33 | llContent2.setOnClickListener(new View.OnClickListener() { 34 | @Override 35 | public void onClick(View v) { 36 | Toast.makeText(LinearLayoutDelActivity.this, "第二个内容区域被点击", Toast.LENGTH_SHORT).show(); 37 | } 38 | }); 39 | findViewById(R.id.btnDelete2).setOnClickListener(new View.OnClickListener() { 40 | @Override 41 | public void onClick(View v) { 42 | Toast.makeText(LinearLayoutDelActivity.this, "第二个删除按钮被点击", Toast.LENGTH_SHORT).show(); 43 | } 44 | }); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /app/src/main/java/com/lzx/demo/ui/PulldownRefreshActivity.java: -------------------------------------------------------------------------------- 1 | package com.lzx.demo.ui; 2 | 3 | import com.lzx.demo.base.BaseMainActivity; 4 | 5 | public class PulldownRefreshActivity extends BaseMainActivity { 6 | 7 | private static final Class[] ACTIVITY = {ScrollViewLayoutActivity.class, WebViewActivity.class}; 8 | private static final String[] TITLE = {"ScrollViewLayoutActivity","WebViewActivity"}; 9 | 10 | public Class[] getActivitys() { 11 | return ACTIVITY; 12 | } 13 | 14 | @Override 15 | public String[] getTitles() { 16 | return TITLE; 17 | } 18 | 19 | 20 | } 21 | -------------------------------------------------------------------------------- /app/src/main/java/com/lzx/demo/ui/ScrollViewLayoutActivity.java: -------------------------------------------------------------------------------- 1 | package com.lzx.demo.ui; 2 | 3 | import android.os.Bundle; 4 | import android.os.Handler; 5 | import android.support.v7.app.AppCompatActivity; 6 | 7 | import com.github.jdsjlzx.recyclerview.ProgressStyle; 8 | import com.lzx.demo.R; 9 | import com.lzx.demo.view.PullScrollView; 10 | 11 | public class ScrollViewLayoutActivity extends AppCompatActivity { 12 | 13 | @Override 14 | protected void onCreate(Bundle savedInstanceState) { 15 | super.onCreate(savedInstanceState); 16 | setContentView(R.layout.activity_scrollview); 17 | 18 | 19 | final PullScrollView refreshLayout = (PullScrollView) findViewById(R.id.refresh_layout); 20 | //设置头部加载颜色 21 | refreshLayout.setHeaderViewColor(R.color.colorAccent, R.color.dark ,android.R.color.white); 22 | refreshLayout.setRefreshProgressStyle(ProgressStyle.LineSpinFadeLoader); 23 | refreshLayout.setRefreshListener(new PullScrollView.RefreshListener() { 24 | @Override 25 | public void onRefresh() { 26 | new Handler().postDelayed(new Runnable() { 27 | @Override 28 | public void run() { 29 | refreshLayout.setRefreshCompleted(); 30 | } 31 | }, 1000); 32 | } 33 | }); 34 | 35 | refreshLayout.refreshWithPull(); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /app/src/main/java/com/lzx/demo/ui/SectionCollectionActivity.java: -------------------------------------------------------------------------------- 1 | package com.lzx.demo.ui; 2 | 3 | import com.lzx.demo.base.BaseMainActivity; 4 | 5 | public class SectionCollectionActivity extends BaseMainActivity { 6 | 7 | private static final Class[] ACTIVITY = {SectionLayoutActivity.class, SectionAnimalActivity.class}; 8 | private static final String[] TITLE = {"SectionLayoutActivity", "SectionAnimalActivity"}; 9 | 10 | 11 | public Class[] getActivitys() { 12 | return ACTIVITY; 13 | } 14 | 15 | @Override 16 | public String[] getTitles() { 17 | return TITLE; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /app/src/main/java/com/lzx/demo/ui/SwipeMenuActivity.java: -------------------------------------------------------------------------------- 1 | package com.lzx.demo.ui; 2 | 3 | import com.lzx.demo.base.BaseMainActivity; 4 | 5 | public class SwipeMenuActivity extends BaseMainActivity { 6 | 7 | private static final Class[] ACTIVITY = {SwipeDeleteActivity.class, ListDragMenuActivity.class,LinearLayoutDelActivity.class}; 8 | private static final String[] TITLE = {"SwipeDeleteActivity", "ListDragMenuActivity","LinearLayoutDelActivity"}; 9 | 10 | public Class[] getActivitys() { 11 | return ACTIVITY; 12 | } 13 | 14 | @Override 15 | public String[] getTitles() { 16 | return TITLE; 17 | } 18 | 19 | 20 | } 21 | -------------------------------------------------------------------------------- /app/src/main/java/com/lzx/demo/ui/WebViewActivity.java: -------------------------------------------------------------------------------- 1 | package com.lzx.demo.ui; 2 | 3 | import android.os.Bundle; 4 | import android.os.Handler; 5 | import android.support.v7.app.AppCompatActivity; 6 | import android.webkit.WebChromeClient; 7 | import android.webkit.WebView; 8 | import android.webkit.WebViewClient; 9 | 10 | import com.github.jdsjlzx.recyclerview.ProgressStyle; 11 | import com.lzx.demo.R; 12 | import com.lzx.demo.view.PullScrollView; 13 | 14 | public class WebViewActivity extends AppCompatActivity { 15 | 16 | @Override 17 | protected void onCreate(Bundle savedInstanceState) { 18 | super.onCreate(savedInstanceState); 19 | setContentView(R.layout.activity_webview); 20 | 21 | 22 | final PullScrollView refreshLayout = (PullScrollView) findViewById(R.id.refresh_layout); 23 | final WebView webView = (WebView) findViewById(R.id.webview); 24 | webView.getSettings().setJavaScriptEnabled(true); 25 | webView.setWebChromeClient(new WebChromeClient()); 26 | webView.setWebViewClient(new WebViewClient()); 27 | //设置头部加载颜色 28 | refreshLayout.setHeaderViewColor(R.color.colorAccent, R.color.dark ,android.R.color.white); 29 | refreshLayout.setRefreshProgressStyle(ProgressStyle.LineSpinFadeLoader); 30 | refreshLayout.setRefreshListener(new PullScrollView.RefreshListener() { 31 | @Override 32 | public void onRefresh() { 33 | new Handler().postDelayed(new Runnable() { 34 | @Override 35 | public void run() { 36 | webView.loadUrl("http://www.stay4it.com"); 37 | refreshLayout.setRefreshCompleted(); 38 | } 39 | }, 1000); 40 | } 41 | }); 42 | 43 | refreshLayout.refreshWithPull(); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /app/src/main/java/com/lzx/demo/util/AppToast.java: -------------------------------------------------------------------------------- 1 | package com.lzx.demo.util; 2 | 3 | import android.content.Context; 4 | import android.widget.Toast; 5 | 6 | public class AppToast { 7 | 8 | protected static final String TAG = "AppToast"; 9 | public static Toast toast; 10 | /** 11 | * 信息提示 12 | * 13 | * @param context 14 | * @param content 15 | */ 16 | public static void makeToast(Context context, String content) { 17 | if(context==null)return; 18 | if(toast != null) 19 | toast.cancel(); 20 | toast = Toast.makeText(context, content, Toast.LENGTH_LONG); 21 | toast.show(); 22 | } 23 | 24 | public static void makeShortToast(Context context, String content) { 25 | if(context==null)return; 26 | if(toast != null) 27 | toast.cancel(); 28 | toast = Toast.makeText(context, content, Toast.LENGTH_SHORT); 29 | toast.show(); 30 | } 31 | 32 | public static void showShortText(Context context, int resId) { 33 | try { 34 | if(context==null)return; 35 | if(toast != null) 36 | toast.cancel(); 37 | toast = Toast.makeText(context, resId, Toast.LENGTH_SHORT); 38 | toast.show(); 39 | } catch (Exception e) { 40 | } 41 | } 42 | 43 | public static void showShortText(Context context, CharSequence text) { 44 | if(context==null)return; 45 | if(toast != null) 46 | toast.cancel(); 47 | toast = Toast.makeText(context, text, Toast.LENGTH_SHORT); 48 | toast.show(); 49 | } 50 | 51 | public static void showLongText(Context context, int resId) { 52 | try { 53 | if(context==null)return; 54 | if(toast != null) 55 | toast.cancel(); 56 | toast = Toast.makeText(context, resId, Toast.LENGTH_LONG); 57 | toast.show(); 58 | 59 | } catch (Exception e) { 60 | } 61 | } 62 | 63 | 64 | } 65 | -------------------------------------------------------------------------------- /app/src/main/java/com/lzx/demo/util/AppUtil.java: -------------------------------------------------------------------------------- 1 | package com.lzx.demo.util; 2 | 3 | import android.content.Context; 4 | 5 | /** 6 | * Created by lizhixian on 16/7/30. 7 | */ 8 | 9 | public class AppUtil { 10 | 11 | public static int dip2px(Context context, float dpValue) { 12 | final float scale = context.getResources().getDisplayMetrics().density; 13 | return (int) (dpValue * scale + 0.5f); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /app/src/main/java/com/lzx/demo/util/HorizontalItemDecorator.java: -------------------------------------------------------------------------------- 1 | package com.lzx.demo.util; 2 | 3 | import android.graphics.Rect; 4 | import android.support.v7.widget.RecyclerView; 5 | import android.view.View; 6 | 7 | /** 8 | * @author msahakyan 9 | */ 10 | public class HorizontalItemDecorator extends RecyclerView.ItemDecoration { 11 | 12 | private final int mHorizontalSpaceWidth; 13 | 14 | public HorizontalItemDecorator(int horizontalSpaceHeight) { 15 | this.mHorizontalSpaceWidth = horizontalSpaceHeight; 16 | } 17 | 18 | @Override 19 | public void getItemOffsets(Rect outRect, View view, RecyclerView parent, 20 | RecyclerView.State state) { 21 | outRect.left = outRect.right = mHorizontalSpaceWidth; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /app/src/main/java/com/lzx/demo/util/TLog.java: -------------------------------------------------------------------------------- 1 | package com.lzx.demo.util; 2 | 3 | import android.util.Log; 4 | 5 | public class TLog { 6 | public static final String LOG_TAG = "AppLog"; 7 | public static boolean DEBUG = true; 8 | 9 | public TLog() { 10 | } 11 | 12 | public static final void analytics(String log) { 13 | if (DEBUG) 14 | Log.d(LOG_TAG, log); 15 | } 16 | 17 | public static final void error(String log) { 18 | if (DEBUG) 19 | Log.e(LOG_TAG, "" + log); 20 | } 21 | 22 | public static final void log(String log) { 23 | if (DEBUG) 24 | Log.i(LOG_TAG, log); 25 | } 26 | 27 | public static final void log(String tag, String log) { 28 | if (DEBUG) 29 | Log.i(tag, log); 30 | } 31 | 32 | public static final void logv(String log) { 33 | if (DEBUG) 34 | Log.v(LOG_TAG, log); 35 | } 36 | 37 | public static final void warn(String log) { 38 | if (DEBUG) 39 | Log.w(LOG_TAG, log); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /app/src/main/java/com/lzx/demo/view/CommonFooter.java: -------------------------------------------------------------------------------- 1 | package com.lzx.demo.view; 2 | 3 | import android.content.Context; 4 | import android.util.AttributeSet; 5 | import android.widget.RelativeLayout; 6 | 7 | import com.lzx.demo.R; 8 | 9 | 10 | /** 11 | * RecyclerView的FooterView,简单的展示一个View 12 | */ 13 | public class CommonFooter extends RelativeLayout { 14 | 15 | public CommonFooter(Context context,int resId) { 16 | super(context); 17 | init(context, resId); 18 | } 19 | 20 | public CommonFooter(Context context, AttributeSet attrs) { 21 | super(context, attrs); 22 | init(context); 23 | } 24 | 25 | public CommonFooter(Context context, AttributeSet attrs, int defStyleAttr) { 26 | super(context, attrs, defStyleAttr); 27 | init(context); 28 | } 29 | 30 | public void init(Context context) { 31 | 32 | inflate(context, R.layout.layout_recyclerview_footer, this); 33 | } 34 | 35 | public void init(Context context,int resId) { 36 | 37 | inflate(context, resId, this); 38 | } 39 | } -------------------------------------------------------------------------------- /app/src/main/java/com/lzx/demo/view/CommonHeader.java: -------------------------------------------------------------------------------- 1 | package com.lzx.demo.view; 2 | 3 | import android.content.Context; 4 | import android.util.AttributeSet; 5 | import android.widget.RelativeLayout; 6 | 7 | import com.lzx.demo.R; 8 | 9 | 10 | /** 11 | * RecyclerView的HeaderView,简单的展示一个TextView 12 | */ 13 | public class CommonHeader extends RelativeLayout { 14 | 15 | public CommonHeader(Context context,int resId) { 16 | super(context); 17 | init(context,resId); 18 | } 19 | 20 | public CommonHeader(Context context, AttributeSet attrs) { 21 | super(context, attrs); 22 | init(context); 23 | } 24 | 25 | public CommonHeader(Context context, AttributeSet attrs, int defStyleAttr) { 26 | super(context, attrs, defStyleAttr); 27 | init(context); 28 | } 29 | 30 | public void init(Context context) { 31 | 32 | inflate(context, R.layout.sample_header, this); 33 | } 34 | 35 | public void init(Context context,int resId) { 36 | 37 | inflate(context, resId, this); 38 | } 39 | } -------------------------------------------------------------------------------- /app/src/main/java/com/lzx/demo/view/SampleFooter.java: -------------------------------------------------------------------------------- 1 | package com.lzx.demo.view; 2 | 3 | import android.content.Context; 4 | import android.util.AttributeSet; 5 | import android.widget.RelativeLayout; 6 | 7 | import com.lzx.demo.R; 8 | 9 | 10 | /** 11 | * RecyclerView的FooterView,简单的展示一个TextView 12 | */ 13 | public class SampleFooter extends RelativeLayout { 14 | 15 | public SampleFooter(Context context) { 16 | super(context); 17 | init(context); 18 | } 19 | 20 | public SampleFooter(Context context, AttributeSet attrs) { 21 | super(context, attrs); 22 | init(context); 23 | } 24 | 25 | public SampleFooter(Context context, AttributeSet attrs, int defStyleAttr) { 26 | super(context, attrs, defStyleAttr); 27 | init(context); 28 | } 29 | 30 | public void init(Context context) { 31 | 32 | inflate(context, R.layout.sample_footer, this); 33 | } 34 | } -------------------------------------------------------------------------------- /app/src/main/java/com/lzx/demo/view/SampleHeader.java: -------------------------------------------------------------------------------- 1 | package com.lzx.demo.view; 2 | 3 | import android.content.Context; 4 | import android.util.AttributeSet; 5 | import android.widget.RelativeLayout; 6 | 7 | import com.lzx.demo.R; 8 | 9 | /** 10 | * RecyclerView的HeaderView,简单的展示一个TextView 11 | */ 12 | public class SampleHeader extends RelativeLayout { 13 | 14 | public SampleHeader(Context context) { 15 | super(context); 16 | init(context); 17 | } 18 | 19 | public SampleHeader(Context context, AttributeSet attrs) { 20 | super(context, attrs); 21 | init(context); 22 | } 23 | 24 | public SampleHeader(Context context, AttributeSet attrs, int defStyleAttr) { 25 | super(context, attrs, defStyleAttr); 26 | init(context); 27 | } 28 | 29 | public void init(Context context) { 30 | 31 | inflate(context, R.layout.sample_header, this); 32 | } 33 | } -------------------------------------------------------------------------------- /app/src/main/res/drawable/circle_green.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/divider.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/divider_recycler.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_group_black_36dp.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_keyboard_arrow_right_black_36dp.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_person_black_36dp.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_photo_default.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdsjlzx/LRecyclerView/e4aa22548b3c59d1270d194b52a615c1e38ee45f/app/src/main/res/drawable/ic_photo_default.9.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_product_default.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdsjlzx/LRecyclerView/e4aa22548b3c59d1270d194b52a615c1e38ee45f/app/src/main/res/drawable/ic_product_default.9.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/iconfont_downgrey.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdsjlzx/LRecyclerView/e4aa22548b3c59d1270d194b52a615c1e38ee45f/app/src/main/res/drawable/iconfont_downgrey.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/img_avatar.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdsjlzx/LRecyclerView/e4aa22548b3c59d1270d194b52a615c1e38ee45f/app/src/main/res/drawable/img_avatar.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable/img_header.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdsjlzx/LRecyclerView/e4aa22548b3c59d1270d194b52a615c1e38ee45f/app/src/main/res/drawable/img_header.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable/profile_anonymous_user.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdsjlzx/LRecyclerView/e4aa22548b3c59d1270d194b52a615c1e38ee45f/app/src/main/res/drawable/profile_anonymous_user.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable/refresh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdsjlzx/LRecyclerView/e4aa22548b3c59d1270d194b52a615c1e38ee45f/app/src/main/res/drawable/refresh.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/sample_footer_loading_progress.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/selector_green.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/selector_purple.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/selector_red.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/selector_white_preferences_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/shape_edit_corners_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/shape_search.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/shape_white_preferences_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/shape_white_preferences_item_pressed.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_emptyview.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 15 | 16 | 22 | 23 | 24 | 25 | 30 | 31 | 35 | 36 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 15 | 16 | 22 | 23 | 24 | 29 | 30 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_multi_click_loading.xml: -------------------------------------------------------------------------------- 1 | 9 | 10 | 14 | 15 | 21 | 22 | 23 | 24 | 29 | 30 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_section.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_section_pager.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 15 | 16 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_splash.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 20 | 21 | 22 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_webview.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 12 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /app/src/main/res/layout/content_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_recycler.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 14 | 15 | -------------------------------------------------------------------------------- /app/src/main/res/layout/header_inline_test.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 29 | 30 | -------------------------------------------------------------------------------- /app/src/main/res/layout/header_test.xml: -------------------------------------------------------------------------------- 1 | 2 | 14 | 15 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_expandable_lv0.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 19 | 20 | 29 | 30 | 38 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_expandable_lv1.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 19 | 20 | 29 | 30 | 38 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_inline_test.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_test.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | -------------------------------------------------------------------------------- /app/src/main/res/layout/layout_banner_header.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /app/src/main/res/layout/layout_empty.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /app/src/main/res/layout/layout_goods_related_item.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 18 | 19 | -------------------------------------------------------------------------------- /app/src/main/res/layout/layout_item_horizontal_list.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/layout/layout_item_list.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/layout/layout_list_item_animal.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/layout/layout_list_item_category.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 15 | 16 | 19 | 20 | 27 | 28 | 33 | 34 | -------------------------------------------------------------------------------- /app/src/main/res/layout/layout_list_item_goods_related.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | 17 | 18 | 25 | 26 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /app/src/main/res/layout/layout_list_item_hot.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 15 | 16 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /app/src/main/res/layout/layout_list_item_nest_inner.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 14 | 15 | 19 | 20 | -------------------------------------------------------------------------------- /app/src/main/res/layout/layout_list_item_nest_wrapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 14 | 15 | 19 | 20 | 28 | 29 | 33 | 34 | 39 | 40 | 41 | 45 | -------------------------------------------------------------------------------- /app/src/main/res/layout/layout_list_item_pinned_data.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 22 | 23 | 28 | 29 | 34 | 35 | 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /app/src/main/res/layout/layout_list_item_pinned_header.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 19 | 20 | -------------------------------------------------------------------------------- /app/src/main/res/layout/layout_list_item_product.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 15 | 16 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /app/src/main/res/layout/layout_list_section_animal.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 14 | 15 | -------------------------------------------------------------------------------- /app/src/main/res/layout/list_item_category.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 19 | 20 | 24 | -------------------------------------------------------------------------------- /app/src/main/res/layout/list_item_foot.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 13 | 14 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /app/src/main/res/layout/list_item_list.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 19 | 20 | 25 | 26 | -------------------------------------------------------------------------------- /app/src/main/res/layout/list_item_pic.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 18 | 19 | 20 | 25 | 26 | 33 | 34 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /app/src/main/res/layout/list_item_swipe.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 17 | 22 | 23 | 28 | 29 | 30 |