├── .gitignore
├── LICENSE
├── README.md
├── ScrollableLayout
├── .gitignore
├── app
│ ├── .gitignore
│ ├── build.gradle
│ ├── proguard-rules.pro
│ └── src
│ │ ├── androidTest
│ │ └── java
│ │ │ └── com
│ │ │ └── scrollablelayout
│ │ │ └── ApplicationTest.java
│ │ └── main
│ │ ├── AndroidManifest.xml
│ │ ├── java
│ │ └── com
│ │ │ └── scrollablelayout
│ │ │ └── simple
│ │ │ ├── BaseFragment.java
│ │ │ ├── MainActivity.java
│ │ │ ├── RecyclerViewGridSimpleFragment.java
│ │ │ ├── RecyclerViewSimpleFragment.java
│ │ │ ├── TestActivity.java
│ │ │ ├── gridimageview
│ │ │ ├── AspectImageView.java
│ │ │ ├── ClickListener.java
│ │ │ └── ForegroundImageView.java
│ │ │ └── recyclerloadmore
│ │ │ ├── EndlessRecyclerOnScrollListener.java
│ │ │ ├── LoadingFooter.java
│ │ │ ├── OnLoadMoreListener.java
│ │ │ └── RecyclerLoadMoreAdapater.java
│ │ └── res
│ │ ├── drawable-xhdpi
│ │ ├── finger_1.jpg
│ │ ├── finger_10.jpg
│ │ ├── finger_11.jpg
│ │ ├── finger_2.jpg
│ │ ├── finger_3.jpg
│ │ ├── finger_4.jpg
│ │ ├── finger_5.jpg
│ │ ├── finger_6.jpg
│ │ ├── finger_7.jpg
│ │ ├── finger_8.jpg
│ │ ├── finger_9.jpg
│ │ ├── g1.jpg
│ │ ├── g10.jpg
│ │ ├── g11.jpg
│ │ ├── g12.jpg
│ │ ├── g13.jpg
│ │ ├── g14.jpg
│ │ ├── g15.jpg
│ │ ├── g16.jpg
│ │ ├── g17.jpg
│ │ ├── g18.jpg
│ │ ├── g19.jpg
│ │ ├── g2.jpg
│ │ ├── g20.jpg
│ │ ├── g21.jpg
│ │ ├── g22.jpg
│ │ ├── g23.jpg
│ │ ├── g24.jpg
│ │ ├── g25.jpg
│ │ ├── g26.jpg
│ │ ├── g27.jpg
│ │ ├── g28.jpg
│ │ ├── g29.jpg
│ │ ├── g3.jpg
│ │ ├── g30.jpg
│ │ ├── g31.jpg
│ │ ├── g32.jpg
│ │ ├── g33.jpg
│ │ ├── g34.jpg
│ │ ├── g35.jpg
│ │ ├── g36.jpg
│ │ ├── g37.jpg
│ │ ├── g38.jpg
│ │ ├── g39.jpg
│ │ ├── g4.jpg
│ │ ├── g40.jpg
│ │ ├── g41.jpg
│ │ ├── g42.jpg
│ │ ├── g43.jpg
│ │ ├── g44.jpg
│ │ ├── g45.jpg
│ │ ├── g46.jpg
│ │ ├── g47.jpg
│ │ ├── g48.jpg
│ │ ├── g49.jpg
│ │ ├── g5.jpg
│ │ ├── g50.jpg
│ │ ├── g51.jpg
│ │ ├── g52.jpg
│ │ ├── g53.jpg
│ │ ├── g54.jpg
│ │ ├── g55.jpg
│ │ ├── g56.jpg
│ │ ├── g57.jpg
│ │ ├── g58.jpg
│ │ ├── g59.jpg
│ │ ├── g6.jpg
│ │ ├── g60.jpg
│ │ ├── g61.jpg
│ │ ├── g62.jpg
│ │ ├── g63.jpg
│ │ ├── g64.jpg
│ │ ├── g65.jpg
│ │ ├── g66.jpg
│ │ ├── g67.jpg
│ │ ├── g68.jpg
│ │ ├── g69.jpg
│ │ ├── g7.jpg
│ │ ├── g70.jpg
│ │ ├── g71.jpg
│ │ ├── g72.jpg
│ │ ├── g73.jpg
│ │ ├── g74.jpg
│ │ ├── g75.jpg
│ │ ├── g76.jpg
│ │ ├── g77.jpg
│ │ ├── g78.jpg
│ │ ├── g79.jpg
│ │ ├── g8.jpg
│ │ ├── g80.jpg
│ │ ├── g81.jpg
│ │ ├── g82.jpg
│ │ ├── g83.jpg
│ │ ├── g84.jpg
│ │ ├── g85.jpg
│ │ ├── g86.jpg
│ │ ├── g87.jpg
│ │ ├── g88.jpg
│ │ ├── g89.jpg
│ │ ├── g9.jpg
│ │ ├── g90.jpg
│ │ └── ic_launcher.png
│ │ ├── drawable
│ │ ├── flickr_image_background.xml
│ │ ├── rectangle_left.xml
│ │ ├── rectangle_left_select.xml
│ │ ├── rectangle_right.xml
│ │ ├── rectangle_right_select.xml
│ │ └── slidingtab_bg.xml
│ │ ├── layout
│ │ ├── activity_main.xml
│ │ ├── activity_test.xml
│ │ ├── content_main.xml
│ │ ├── fragment_common_recycler.xml
│ │ ├── griditem_image.xml
│ │ ├── ic_headerbar.xml
│ │ ├── item_recycler_footer_end.xml
│ │ ├── item_recycler_footer_loading.xml
│ │ ├── item_recycler_footer_network_error.xml
│ │ ├── item_recyclerview.xml
│ │ ├── tabitem_slidingtab.xml
│ │ ├── view_navigationbar.xml
│ │ ├── view_recycler_footer.xml
│ │ └── view_userinfo_header.xml
│ │ ├── menu
│ │ └── menu_main.xml
│ │ ├── mipmap-mdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xhdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xxhdpi
│ │ ├── ic_launcher.png
│ │ ├── icon_avatar.png
│ │ ├── icon_avatar_none.png
│ │ ├── icon_collect.png
│ │ ├── icon_expand_select.png
│ │ ├── icon_sex.png
│ │ ├── icon_user_editprofile.png
│ │ ├── icon_user_follow.png
│ │ └── icon_user_msg.png
│ │ ├── mipmap-xxxhdpi
│ │ └── ic_launcher.png
│ │ ├── values-v21
│ │ └── styles.xml
│ │ ├── values-w820dp
│ │ └── dimens.xml
│ │ └── values
│ │ ├── attrs.xml
│ │ ├── colors.xml
│ │ ├── dimens.xml
│ │ ├── ids.xml
│ │ ├── strings.xml
│ │ └── styles.xml
├── build.gradle
├── gradle.properties
├── gradle
│ └── wrapper
│ │ ├── gradle-wrapper.jar
│ │ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── library
│ ├── .gitignore
│ ├── build.gradle
│ └── src
│ │ └── main
│ │ ├── AndroidManifest.xml
│ │ └── java
│ │ └── com
│ │ └── scrollablelayout
│ │ ├── ScrollableHelper.java
│ │ └── ScrollableLayout.java
└── settings.gradle
└── output
├── p1.jpg
├── p2.jpg
├── p3.jpg
├── p4.jpg
├── p5.jpg
├── p6.jpg
├── show.gif
├── simple.apk
└── slow.gif
/.gitignore:
--------------------------------------------------------------------------------
1 | # built application files
2 | *.ap_
3 |
4 | # files for the dex VM
5 | *.dex
6 |
7 | # Java class files
8 | *.class
9 |
10 | # generated files
11 | bin/
12 | gen/
13 |
14 | # Local configuration file (sdk path, etc)
15 | local.properties
16 |
17 | # Eclipse project files
18 | .classpath
19 | .project
20 |
21 | # Proguard folder generated by Eclipse
22 | proguard/
23 |
24 | # Intellij project files
25 | *.iml
26 | *.ipr
27 | *.iws
28 | .idea/
29 |
30 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction, and
10 | distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by the copyright
13 | owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all other entities
16 | that control, are controlled by, or are under common control with that entity.
17 | For the purposes of this definition, "control" means (i) the power, direct or
18 | indirect, to cause the direction or management of such entity, whether by
19 | contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the
20 | outstanding shares, or (iii) beneficial ownership of such entity.
21 |
22 | "You" (or "Your") shall mean an individual or Legal Entity exercising
23 | permissions granted by this License.
24 |
25 | "Source" form shall mean the preferred form for making modifications, including
26 | but not limited to software source code, documentation source, and configuration
27 | files.
28 |
29 | "Object" form shall mean any form resulting from mechanical transformation or
30 | translation of a Source form, including but not limited to compiled object code,
31 | generated documentation, and conversions to other media types.
32 |
33 | "Work" shall mean the work of authorship, whether in Source or Object form, made
34 | available under the License, as indicated by a copyright notice that is included
35 | in or attached to the work (an example is provided in the Appendix below).
36 |
37 | "Derivative Works" shall mean any work, whether in Source or Object form, that
38 | is based on (or derived from) the Work and for which the editorial revisions,
39 | annotations, elaborations, or other modifications represent, as a whole, an
40 | original work of authorship. For the purposes of this License, Derivative Works
41 | shall not include works that remain separable from, or merely link (or bind by
42 | name) to the interfaces of, the Work and Derivative Works thereof.
43 |
44 | "Contribution" shall mean any work of authorship, including the original version
45 | of the Work and any modifications or additions to that Work or Derivative Works
46 | thereof, that is intentionally submitted to Licensor for inclusion in the Work
47 | by the copyright owner or by an individual or Legal Entity authorized to submit
48 | on behalf of the copyright owner. For the purposes of this definition,
49 | "submitted" means any form of electronic, verbal, or written communication sent
50 | to the Licensor or its representatives, including but not limited to
51 | communication on electronic mailing lists, source code control systems, and
52 | issue tracking systems that are managed by, or on behalf of, the Licensor for
53 | the purpose of discussing and improving the Work, but excluding communication
54 | that is conspicuously marked or otherwise designated in writing by the copyright
55 | owner as "Not a Contribution."
56 |
57 | "Contributor" shall mean Licensor and any individual or Legal Entity on behalf
58 | of whom a Contribution has been received by Licensor and subsequently
59 | incorporated within the Work.
60 |
61 | 2. Grant of Copyright License.
62 |
63 | Subject to the terms and conditions of this License, each Contributor hereby
64 | grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
65 | irrevocable copyright license to reproduce, prepare Derivative Works of,
66 | publicly display, publicly perform, sublicense, and distribute the Work and such
67 | Derivative Works in Source or Object form.
68 |
69 | 3. Grant of Patent License.
70 |
71 | Subject to the terms and conditions of this License, each Contributor hereby
72 | grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
73 | irrevocable (except as stated in this section) patent license to make, have
74 | made, use, offer to sell, sell, import, and otherwise transfer the Work, where
75 | such license applies only to those patent claims licensable by such Contributor
76 | that are necessarily infringed by their Contribution(s) alone or by combination
77 | of their Contribution(s) with the Work to which such Contribution(s) was
78 | submitted. If You institute patent litigation against any entity (including a
79 | cross-claim or counterclaim in a lawsuit) alleging that the Work or a
80 | Contribution incorporated within the Work constitutes direct or contributory
81 | patent infringement, then any patent licenses granted to You under this License
82 | for that Work shall terminate as of the date such litigation is filed.
83 |
84 | 4. Redistribution.
85 |
86 | You may reproduce and distribute copies of the Work or Derivative Works thereof
87 | in any medium, with or without modifications, and in Source or Object form,
88 | provided that You meet the following conditions:
89 |
90 | You must give any other recipients of the Work or Derivative Works a copy of
91 | this License; and
92 | You must cause any modified files to carry prominent notices stating that You
93 | changed the files; and
94 | You must retain, in the Source form of any Derivative Works that You distribute,
95 | all copyright, patent, trademark, and attribution notices from the Source form
96 | of the Work, excluding those notices that do not pertain to any part of the
97 | Derivative Works; and
98 | If the Work includes a "NOTICE" text file as part of its distribution, then any
99 | Derivative Works that You distribute must include a readable copy of the
100 | attribution notices contained within such NOTICE file, excluding those notices
101 | that do not pertain to any part of the Derivative Works, in at least one of the
102 | following places: within a NOTICE text file distributed as part of the
103 | Derivative Works; within the Source form or documentation, if provided along
104 | with the Derivative Works; or, within a display generated by the Derivative
105 | Works, if and wherever such third-party notices normally appear. The contents of
106 | the NOTICE file are for informational purposes only and do not modify the
107 | License. You may add Your own attribution notices within Derivative Works that
108 | You distribute, alongside or as an addendum to the NOTICE text from the Work,
109 | provided that such additional attribution notices cannot be construed as
110 | modifying the License.
111 | You may add Your own copyright statement to Your modifications and may provide
112 | additional or different license terms and conditions for use, reproduction, or
113 | distribution of Your modifications, or for any such Derivative Works as a whole,
114 | provided Your use, reproduction, and distribution of the Work otherwise complies
115 | with the conditions stated in this License.
116 |
117 | 5. Submission of Contributions.
118 |
119 | Unless You explicitly state otherwise, any Contribution intentionally submitted
120 | for inclusion in the Work by You to the Licensor shall be under the terms and
121 | conditions of this License, without any additional terms or conditions.
122 | Notwithstanding the above, nothing herein shall supersede or modify the terms of
123 | any separate license agreement you may have executed with Licensor regarding
124 | such Contributions.
125 |
126 | 6. Trademarks.
127 |
128 | This License does not grant permission to use the trade names, trademarks,
129 | service marks, or product names of the Licensor, except as required for
130 | reasonable and customary use in describing the origin of the Work and
131 | reproducing the content of the NOTICE file.
132 |
133 | 7. Disclaimer of Warranty.
134 |
135 | Unless required by applicable law or agreed to in writing, Licensor provides the
136 | Work (and each Contributor provides its Contributions) on an "AS IS" BASIS,
137 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied,
138 | including, without limitation, any warranties or conditions of TITLE,
139 | NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are
140 | solely responsible for determining the appropriateness of using or
141 | redistributing the Work and assume any risks associated with Your exercise of
142 | permissions under this License.
143 |
144 | 8. Limitation of Liability.
145 |
146 | In no event and under no legal theory, whether in tort (including negligence),
147 | contract, or otherwise, unless required by applicable law (such as deliberate
148 | and grossly negligent acts) or agreed to in writing, shall any Contributor be
149 | liable to You for damages, including any direct, indirect, special, incidental,
150 | or consequential damages of any character arising as a result of this License or
151 | out of the use or inability to use the Work (including but not limited to
152 | damages for loss of goodwill, work stoppage, computer failure or malfunction, or
153 | any and all other commercial damages or losses), even if such Contributor has
154 | been advised of the possibility of such damages.
155 |
156 | 9. Accepting Warranty or Additional Liability.
157 |
158 | While redistributing the Work or Derivative Works thereof, You may choose to
159 | offer, and charge a fee for, acceptance of support, warranty, indemnity, or
160 | other liability obligations and/or rights consistent with this License. However,
161 | in accepting such obligations, You may act only on Your own behalf and on Your
162 | sole responsibility, not on behalf of any other Contributor, and only if You
163 | agree to indemnify, defend, and hold each Contributor harmless for any liability
164 | incurred by, or claims asserted against, such Contributor by reason of your
165 | accepting any such warranty or additional liability.
166 |
167 | END OF TERMS AND CONDITIONS
168 |
169 | APPENDIX: How to apply the Apache License to your work
170 |
171 | To apply the Apache License to your work, attach the following boilerplate
172 | notice, with the fields enclosed by brackets "{}" replaced with your own
173 | identifying information. (Don't include the brackets!) The text should be
174 | enclosed in the appropriate comment syntax for the file format. We also
175 | recommend that a file or class name and description of purpose be included on
176 | the same "printed page" as the copyright notice for easier identification within
177 | third-party archives.
178 |
179 | Copyright 2015 无舵航程
180 |
181 | Licensed under the Apache License, Version 2.0 (the "License");
182 | you may not use this file except in compliance with the License.
183 | You may obtain a copy of the License at
184 |
185 | http://www.apache.org/licenses/LICENSE-2.0
186 |
187 | Unless required by applicable law or agreed to in writing, software
188 | distributed under the License is distributed on an "AS IS" BASIS,
189 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
190 | See the License for the specific language governing permissions and
191 | limitations under the License.
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | ScrollableLayout
2 | ======================
3 |
4 | > j.s 🇨🇳
5 |
6 |
7 | easy to add a headview for any view and supports sticking the navigator on the top when ItemView scrolls.
8 |
9 | fork and change on [https://github.com/cpoopc/ScrollableLayout](https://github.com/cpoopc/ScrollableLayout)
10 |
11 | scrolling is not smooth, especially on some models .
12 |
13 | another choice 「 [w446108264/StickHeaderLayout](https://github.com/w446108264/StickHeaderLayout) 」
14 |
15 | # Features
16 |
17 | * API > 11
18 | * Support ViewPager, RecyclerView, ScrollView, ListView, WebView
19 | * Support pulltoRefresh and loadmore
20 | * Support dynamic headview
21 | * Easy to add a headview for any view
22 |
23 | 
24 |
25 |
26 | # Screen Recrod
27 |
28 |
29 |
30 |
31 |
32 |
33 | # Samples
34 |
35 | You can [download a sample APK](https://github.com/w446108264/ScrollableLayout/raw/master/output/simple.apk)
36 |
37 |
38 | # Gradle Dependency
39 |
40 | Users of your library will need add the jitpack.io repository:
41 |
42 | ```xml
43 | allprojects {
44 | repositories {
45 | jcenter()
46 | maven { url "https://jitpack.io" }
47 | }
48 | }
49 | ```
50 |
51 | and:
52 |
53 | ```xml
54 | dependencies {
55 | compile 'com.github.w446108264:ScrollableLayout:1.0.3'
56 | }
57 | ```
58 |
59 |
60 | # Sample Usage
61 |
62 |
63 |
64 | ```xml
65 |
70 |
71 |
72 |
79 |
80 |
83 |
90 |
91 |
92 |
97 |
98 |
99 | ```
100 |
101 | ```java
102 | // please see the demo
103 | sl_root = (ScrollableLayout) findViewById(R.id.sl_root);
104 | listview = (ListView) findViewById(R.id.vp_scroll);
105 | sl_root.getHelper().setCurrentScrollableContainer(listview);
106 |
107 | ```
108 |
109 |
110 | # Contact & Help
111 |
112 | Please fell free to contact me if there is any problem when using the library.
113 |
114 | * email: shengjun8486@gmail.com
115 |
116 |
117 |
118 |
--------------------------------------------------------------------------------
/ScrollableLayout/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | /.idea/workspace.xml
5 | /.idea/libraries
6 | .DS_Store
7 | /build
8 | /captures
9 |
--------------------------------------------------------------------------------
/ScrollableLayout/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/ScrollableLayout/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 23
5 | buildToolsVersion "23.0.2"
6 |
7 | defaultConfig {
8 | applicationId "com.scrollablelayout.simple"
9 | minSdkVersion 11
10 | targetSdkVersion 23
11 | versionCode 1
12 | versionName "1.0"
13 | }
14 | buildTypes {
15 | release {
16 | minifyEnabled false
17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
18 | }
19 | }
20 | }
21 |
22 | dependencies {
23 | compile project(':library')
24 | compile 'com.android.support:appcompat-v7:23.1.1'
25 | compile 'com.android.support:design:23.1.1'
26 | compile 'in.srain.cube:ultra-ptr:1.0.11'
27 | compile 'com.android.support:cardview-v7:23.1.1'
28 | compile 'com.github.bumptech.glide:glide:3.6.1'
29 | }
30 |
--------------------------------------------------------------------------------
/ScrollableLayout/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 /Users/sj/Library/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 |
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/androidTest/java/com/scrollablelayout/ApplicationTest.java:
--------------------------------------------------------------------------------
1 | package com.scrollablelayout;
2 |
3 | import android.app.Application;
4 | import android.test.ApplicationTestCase;
5 |
6 | /**
7 | * Testing Fundamentals
8 | */
9 | public class ApplicationTest extends ApplicationTestCase {
10 | public ApplicationTest() {
11 | super(Application.class);
12 | }
13 | }
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
11 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/java/com/scrollablelayout/simple/BaseFragment.java:
--------------------------------------------------------------------------------
1 | package com.scrollablelayout.simple;
2 |
3 |
4 | import android.support.v4.app.Fragment;
5 |
6 | import com.scrollablelayout.ScrollableHelper;
7 |
8 |
9 | /**
10 | * A simple {@link Fragment} subclass.
11 | */
12 | public abstract class BaseFragment extends Fragment implements ScrollableHelper.ScrollableContainer{
13 |
14 | public abstract void pullToRefresh();
15 | public abstract void refreshComplete();
16 | }
17 |
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/java/com/scrollablelayout/simple/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.scrollablelayout.simple;
2 |
3 | import android.content.Intent;
4 | import android.graphics.Color;
5 | import android.net.Uri;
6 | import android.os.Bundle;
7 | import android.support.v4.app.Fragment;
8 | import android.support.v4.app.FragmentManager;
9 | import android.support.v4.app.FragmentPagerAdapter;
10 | import android.support.v4.view.ViewPager;
11 | import android.support.v7.app.AppCompatActivity;
12 | import android.view.View;
13 | import android.view.Window;
14 | import android.view.WindowManager;
15 | import android.widget.ImageView;
16 | import android.widget.RelativeLayout;
17 | import android.widget.TextView;
18 |
19 | import com.scrollablelayout.ScrollableLayout;
20 |
21 | import java.util.ArrayList;
22 | import java.util.List;
23 |
24 | import in.srain.cube.views.ptr.PtrClassicFrameLayout;
25 | import in.srain.cube.views.ptr.PtrDefaultHandler;
26 | import in.srain.cube.views.ptr.PtrFrameLayout;
27 | import in.srain.cube.views.ptr.PtrHandler;
28 |
29 | public class MainActivity extends AppCompatActivity implements ViewPager.OnPageChangeListener, PtrHandler, View.OnClickListener {
30 |
31 | private PtrClassicFrameLayout pfl_root;
32 | private ScrollableLayout sl_root;
33 | private ViewPager vp_scroll;
34 | private TextView tv_title;
35 | private TextView tv_right;
36 | private ImageView iv_spit;
37 | private TextView tv_name;
38 | private TextView tv_signature;
39 | private ImageView iv_avatar;
40 | private RelativeLayout ly_page1;
41 | private TextView tv_page1;
42 | private RelativeLayout ly_page2;
43 | private TextView tv_page2;
44 |
45 | private float titleMaxScrollHeight;
46 | private float hearderMaxHeight;
47 | private float avatarTop;
48 | private float maxScrollHeight;
49 | private final List fragmentList = new ArrayList<>();
50 |
51 | @Override
52 | protected void onCreate(Bundle savedInstanceState) {
53 | this.requestWindowFeature(Window.FEATURE_NO_TITLE);
54 | this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
55 | super.onCreate(savedInstanceState);
56 | setContentView(R.layout.activity_main);
57 | initView();
58 | }
59 |
60 | private void initView() {
61 | pfl_root = (PtrClassicFrameLayout) findViewById(R.id.pfl_root);
62 | sl_root = (ScrollableLayout) findViewById(R.id.sl_root);
63 | vp_scroll = (ViewPager) findViewById(R.id.vp_scroll);
64 | tv_title = (TextView) findViewById(R.id.tv_title);
65 | tv_right = (TextView) findViewById(R.id.tv_right);
66 | iv_spit = (ImageView) findViewById(R.id.iv_spit);
67 | tv_name = (TextView) findViewById(R.id.tv_name);
68 | tv_signature = (TextView) findViewById(R.id.tv_signature);
69 | iv_avatar = (ImageView) findViewById(R.id.iv_avatar);
70 |
71 | ly_page1 = (RelativeLayout) findViewById(R.id.ly_page1);
72 | tv_page1 = (TextView) findViewById(R.id.tv_page1);
73 | ly_page2 = (RelativeLayout) findViewById(R.id.ly_page2);
74 | tv_page2 = (TextView) findViewById(R.id.tv_page2);
75 |
76 | iv_spit.setVisibility(View.GONE);
77 | tv_title.setTranslationY(-1000);
78 | sl_root.setOnScrollListener(new ScrollableLayout.OnScrollListener() {
79 | @Override
80 | public void onScroll(int translationY, int maxY) {
81 | translationY = -translationY;
82 | if (titleMaxScrollHeight == 0) {
83 | titleMaxScrollHeight = ((View) tv_title.getParent()).getBottom() - tv_title.getTop();
84 | maxScrollHeight = hearderMaxHeight + titleMaxScrollHeight;
85 | }
86 | if (hearderMaxHeight == 0) {
87 | hearderMaxHeight = tv_name.getTop();
88 | maxScrollHeight = hearderMaxHeight + titleMaxScrollHeight;
89 | }
90 | if (avatarTop == 0) {
91 | avatarTop = iv_avatar.getTop();
92 | }
93 |
94 | int alpha = 0;
95 | int baseAlpha = 60;
96 | if (0 > avatarTop + translationY) {
97 | alpha = Math.min(255, (int) (Math.abs(avatarTop + translationY) * (255 - baseAlpha) / (hearderMaxHeight - avatarTop) + baseAlpha));
98 | iv_spit.setVisibility(View.VISIBLE);
99 | } else {
100 | iv_spit.setVisibility(View.GONE);
101 | }
102 |
103 | iv_spit.getBackground().setAlpha(alpha);
104 |
105 | tv_title.setTranslationY(Math.max(0, maxScrollHeight + translationY));
106 | }
107 | });
108 |
109 | pfl_root.setEnabledNextPtrAtOnce(true);
110 | pfl_root.setLastUpdateTimeRelateObject(this);
111 | pfl_root.setPtrHandler(this);
112 | pfl_root.setKeepHeaderWhenRefresh(true);
113 |
114 | CommonFragementPagerAdapter commonFragementPagerAdapter = new CommonFragementPagerAdapter(getSupportFragmentManager());
115 | fragmentList.add(RecyclerViewSimpleFragment.newInstance());
116 | fragmentList.add(RecyclerViewGridSimpleFragment.newInstance());
117 | vp_scroll.setAdapter(commonFragementPagerAdapter);
118 | vp_scroll.addOnPageChangeListener(this);
119 | sl_root.getHelper().setCurrentScrollableContainer(fragmentList.get(0));
120 |
121 | tv_right.setOnClickListener(this);
122 | tv_signature.setOnClickListener(this);
123 | ly_page1.setOnClickListener(this);
124 | ly_page2.setOnClickListener(this);
125 | }
126 |
127 | @Override
128 | public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) { }
129 |
130 | @Override
131 | public void onPageSelected(int position) {
132 | sl_root.getHelper().setCurrentScrollableContainer(fragmentList.get(position));
133 | if (position == 0) {
134 | ly_page1.setBackgroundResource(R.drawable.rectangle_left_select);
135 | tv_page1.setTextColor(Color.parseColor("#ffffff"));
136 | ly_page2.setBackgroundResource(R.drawable.rectangle_right);
137 | tv_page2.setTextColor(Color.parseColor("#435356"));
138 | } else {
139 | ly_page1.setBackgroundResource(R.drawable.rectangle_left);
140 | tv_page1.setTextColor(Color.parseColor("#435356"));
141 | ly_page2.setBackgroundResource(R.drawable.rectangle_right_select);
142 | tv_page2.setTextColor(Color.parseColor("#ffffff"));
143 | }
144 | }
145 |
146 | @Override
147 | public void onPageScrollStateChanged(int state) { }
148 |
149 | @Override
150 | public boolean checkCanDoRefresh(PtrFrameLayout frame, View content, View header) {
151 | if (vp_scroll.getCurrentItem() == 0 && sl_root.isCanPullToRefresh()) {
152 | return PtrDefaultHandler.checkContentCanBePulledDown(frame, content, header);
153 | }
154 | return false;
155 | }
156 |
157 | @Override
158 | public void onRefreshBegin(PtrFrameLayout frame) {
159 | if (fragmentList.size() > vp_scroll.getCurrentItem()) {
160 | fragmentList.get(vp_scroll.getCurrentItem()).pullToRefresh();
161 | }
162 | }
163 |
164 | public void refreshComplete() {
165 | if (pfl_root != null) {
166 | pfl_root.refreshComplete();
167 | }
168 | }
169 |
170 | @Override
171 | public void onClick(View v) {
172 | switch (v.getId()) {
173 | case R.id.tv_signature:
174 | Uri uri = Uri.parse(tv_signature.getText().toString());
175 | Intent intent = new Intent(Intent.ACTION_VIEW, uri);
176 | startActivity(intent);
177 | break;
178 | case R.id.tv_right:
179 | startActivity(new Intent(MainActivity.this, TestActivity.class));
180 | break;
181 | case R.id.ly_page1:
182 | vp_scroll.setCurrentItem(0);
183 | break;
184 | case R.id.ly_page2:
185 | vp_scroll.setCurrentItem(1);
186 | break;
187 | }
188 | }
189 |
190 | public class CommonFragementPagerAdapter extends FragmentPagerAdapter {
191 |
192 | public CommonFragementPagerAdapter(FragmentManager fm) {
193 | super(fm);
194 | }
195 |
196 | @Override
197 | public Fragment getItem(int position) {
198 | return getCount() > position ? fragmentList.get(position) : null;
199 | }
200 |
201 | @Override
202 | public int getCount() {
203 | return fragmentList == null ? 0 : fragmentList.size();
204 | }
205 | }
206 | }
207 |
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/java/com/scrollablelayout/simple/RecyclerViewGridSimpleFragment.java:
--------------------------------------------------------------------------------
1 | package com.scrollablelayout.simple;
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.GridLayoutManager;
7 | import android.support.v7.widget.RecyclerView;
8 | import android.view.LayoutInflater;
9 | import android.view.View;
10 | import android.view.ViewGroup;
11 | import android.widget.ImageView;
12 |
13 | import com.bumptech.glide.Glide;
14 |
15 | import java.util.ArrayList;
16 | import java.util.List;
17 |
18 | /**
19 | * A simple {@link Fragment} subclass.
20 | */
21 | public class RecyclerViewGridSimpleFragment extends BaseFragment {
22 |
23 | private View view;
24 | private RecyclerView recyclerView;
25 |
26 | public static RecyclerViewGridSimpleFragment newInstance() {
27 | RecyclerViewGridSimpleFragment fragment = new RecyclerViewGridSimpleFragment();
28 | return fragment;
29 | }
30 |
31 | @Nullable
32 | @Override
33 | public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
34 | view = inflater.inflate(R.layout.fragment_common_recycler, null);
35 | initRecyclerView(view);
36 | return view;
37 | }
38 |
39 | public void initRecyclerView(View view) {
40 | recyclerView = (RecyclerView) view.findViewById(R.id.v_scroll);
41 | recyclerView.setOverScrollMode(View.OVER_SCROLL_NEVER);
42 |
43 | GridLayoutManager mLayoutMgr = new GridLayoutManager(getActivity(), 3);
44 | recyclerView.setLayoutManager(mLayoutMgr);
45 |
46 | PhotoAdapter recyclerAdapter = new PhotoAdapter();
47 | recyclerAdapter.setPhotos(createItemList());
48 | recyclerView.setAdapter(recyclerAdapter);
49 | }
50 |
51 | private List createItemList() {
52 | List list = new ArrayList<>();
53 | list.add(new RecyclerBean("", R.drawable.g1));
54 | list.add(new RecyclerBean("", R.drawable.g2));
55 | list.add(new RecyclerBean("", R.drawable.g3));
56 | list.add(new RecyclerBean("", R.drawable.g4));
57 | list.add(new RecyclerBean("", R.drawable.g5));
58 | list.add(new RecyclerBean("", R.drawable.g6));
59 | list.add(new RecyclerBean("", R.drawable.g7));
60 | list.add(new RecyclerBean("", R.drawable.g8));
61 | list.add(new RecyclerBean("", R.drawable.g9));
62 | list.add(new RecyclerBean("", R.drawable.g10));
63 | list.add(new RecyclerBean("", R.drawable.g11));
64 | list.add(new RecyclerBean("", R.drawable.g12));
65 | list.add(new RecyclerBean("", R.drawable.g13));
66 | list.add(new RecyclerBean("", R.drawable.g14));
67 | list.add(new RecyclerBean("", R.drawable.g15));
68 | list.add(new RecyclerBean("", R.drawable.g16));
69 | list.add(new RecyclerBean("", R.drawable.g17));
70 | list.add(new RecyclerBean("", R.drawable.g18));
71 | list.add(new RecyclerBean("", R.drawable.g19));
72 | list.add(new RecyclerBean("", R.drawable.g20));
73 | list.add(new RecyclerBean("", R.drawable.g21));
74 | list.add(new RecyclerBean("", R.drawable.g22));
75 | list.add(new RecyclerBean("", R.drawable.g23));
76 | list.add(new RecyclerBean("", R.drawable.g24));
77 | list.add(new RecyclerBean("", R.drawable.g25));
78 | list.add(new RecyclerBean("", R.drawable.g26));
79 | list.add(new RecyclerBean("", R.drawable.g27));
80 | list.add(new RecyclerBean("", R.drawable.g28));
81 | list.add(new RecyclerBean("", R.drawable.g29));
82 | list.add(new RecyclerBean("", R.drawable.g30));
83 | list.add(new RecyclerBean("", R.drawable.g31));
84 | list.add(new RecyclerBean("", R.drawable.g32));
85 | list.add(new RecyclerBean("", R.drawable.g33));
86 | list.add(new RecyclerBean("", R.drawable.g34));
87 | list.add(new RecyclerBean("", R.drawable.g35));
88 | list.add(new RecyclerBean("", R.drawable.g36));
89 | list.add(new RecyclerBean("", R.drawable.g37));
90 | list.add(new RecyclerBean("", R.drawable.g38));
91 | list.add(new RecyclerBean("", R.drawable.g39));
92 | list.add(new RecyclerBean("", R.drawable.g40));
93 | list.add(new RecyclerBean("", R.drawable.g41));
94 | list.add(new RecyclerBean("", R.drawable.g42));
95 | list.add(new RecyclerBean("", R.drawable.g43));
96 | list.add(new RecyclerBean("", R.drawable.g44));
97 | list.add(new RecyclerBean("", R.drawable.g45));
98 | list.add(new RecyclerBean("", R.drawable.g46));
99 | list.add(new RecyclerBean("", R.drawable.g47));
100 | list.add(new RecyclerBean("", R.drawable.g48));
101 | list.add(new RecyclerBean("", R.drawable.g49));
102 | list.add(new RecyclerBean("", R.drawable.g50));
103 | list.add(new RecyclerBean("", R.drawable.g51));
104 | list.add(new RecyclerBean("", R.drawable.g52));
105 | list.add(new RecyclerBean("", R.drawable.g53));
106 | list.add(new RecyclerBean("", R.drawable.g54));
107 | list.add(new RecyclerBean("", R.drawable.g55));
108 | list.add(new RecyclerBean("", R.drawable.g56));
109 | list.add(new RecyclerBean("", R.drawable.g57));
110 | list.add(new RecyclerBean("", R.drawable.g58));
111 | list.add(new RecyclerBean("", R.drawable.g59));
112 | list.add(new RecyclerBean("", R.drawable.g60));
113 | list.add(new RecyclerBean("", R.drawable.g61));
114 | list.add(new RecyclerBean("", R.drawable.g62));
115 | list.add(new RecyclerBean("", R.drawable.g63));
116 | list.add(new RecyclerBean("", R.drawable.g64));
117 | list.add(new RecyclerBean("", R.drawable.g65));
118 | list.add(new RecyclerBean("", R.drawable.g66));
119 | list.add(new RecyclerBean("", R.drawable.g67));
120 | list.add(new RecyclerBean("", R.drawable.g68));
121 | list.add(new RecyclerBean("", R.drawable.g69));
122 | list.add(new RecyclerBean("", R.drawable.g70));
123 | list.add(new RecyclerBean("", R.drawable.g71));
124 | list.add(new RecyclerBean("", R.drawable.g72));
125 | list.add(new RecyclerBean("", R.drawable.g73));
126 | list.add(new RecyclerBean("", R.drawable.g74));
127 | list.add(new RecyclerBean("", R.drawable.g75));
128 | list.add(new RecyclerBean("", R.drawable.g76));
129 | list.add(new RecyclerBean("", R.drawable.g77));
130 | list.add(new RecyclerBean("", R.drawable.g78));
131 | list.add(new RecyclerBean("", R.drawable.g79));
132 | list.add(new RecyclerBean("", R.drawable.g80));
133 | list.add(new RecyclerBean("", R.drawable.g81));
134 | list.add(new RecyclerBean("", R.drawable.g82));
135 | list.add(new RecyclerBean("", R.drawable.g83));
136 | list.add(new RecyclerBean("", R.drawable.g84));
137 | list.add(new RecyclerBean("", R.drawable.g85));
138 | list.add(new RecyclerBean("", R.drawable.g86));
139 | list.add(new RecyclerBean("", R.drawable.g87));
140 | list.add(new RecyclerBean("", R.drawable.g88));
141 | list.add(new RecyclerBean("", R.drawable.g89));
142 | list.add(new RecyclerBean("", R.drawable.g90));
143 | return list;
144 | }
145 |
146 | @Override
147 | public View getScrollableView() {
148 | return recyclerView;
149 | }
150 |
151 | @Override
152 | public void pullToRefresh() { }
153 |
154 | @Override
155 | public void refreshComplete() { }
156 |
157 | public class RecyclerBean {
158 | public String title;
159 | public int icon;
160 |
161 | public RecyclerBean(String title, int icon) {
162 | this.title = title;
163 | this.icon = icon;
164 | }
165 | }
166 |
167 | public class PhotoAdapter extends RecyclerView.Adapter {
168 |
169 | protected PhotoAdapter() {
170 | super();
171 | }
172 |
173 | List imgLists = new ArrayList<>();
174 |
175 | public void setPhotos(List photos) {
176 | imgLists = photos;
177 | notifyDataSetChanged();
178 | }
179 |
180 | @Override
181 | public PhotoViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
182 | return new PhotoViewHolder(parent);
183 | }
184 |
185 | @Override
186 | public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
187 | if (holder instanceof PhotoViewHolder) {
188 | ((PhotoViewHolder) holder).image.setTag(R.id.tag_item, position);
189 | Glide.with(holder.itemView.getContext())
190 | .load(imgLists.get(position).icon)
191 | .centerCrop()
192 | .crossFade()
193 | .dontAnimate()
194 | .into(((PhotoViewHolder) holder).image);
195 | }
196 | }
197 |
198 | @Override
199 | public int getItemCount() {
200 | return imgLists == null ? 0 : imgLists.size();
201 | }
202 |
203 | public class PhotoViewHolder extends RecyclerView.ViewHolder {
204 | public final ImageView image;
205 |
206 | public PhotoViewHolder(ViewGroup parent) {
207 | super(LayoutInflater.from(parent.getContext()).inflate(R.layout.griditem_image, parent, false));
208 | image = (ImageView) itemView;
209 | }
210 | }
211 | }
212 | }
213 |
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/java/com/scrollablelayout/simple/RecyclerViewSimpleFragment.java:
--------------------------------------------------------------------------------
1 | package com.scrollablelayout.simple;
2 |
3 | import android.content.Context;
4 | import android.os.Bundle;
5 | import android.support.annotation.Nullable;
6 | import android.support.v4.app.Fragment;
7 | import android.support.v7.widget.LinearLayoutManager;
8 | import android.support.v7.widget.RecyclerView;
9 | import android.view.LayoutInflater;
10 | import android.view.View;
11 | import android.view.ViewGroup;
12 | import android.widget.ImageView;
13 | import android.widget.TextView;
14 |
15 | import com.scrollablelayout.simple.recyclerloadmore.EndlessRecyclerOnScrollListener;
16 | import com.scrollablelayout.simple.recyclerloadmore.LoadingFooter;
17 | import com.scrollablelayout.simple.recyclerloadmore.RecyclerLoadMoreAdapater;
18 |
19 | import java.util.ArrayList;
20 | import java.util.List;
21 |
22 | /**
23 | * A simple {@link Fragment} subclass.
24 | */
25 | public class RecyclerViewSimpleFragment extends BaseFragment {
26 |
27 | private View view;
28 | private RecyclerView recyclerView;
29 | private final List allDataSource = new ArrayList<>();
30 | private int lastPosition = 0;
31 | private int size = 5;
32 | private LoadingFooter mLoadingFooter;
33 | private RecyclerAdapter recyclerAdapter;
34 |
35 | public static RecyclerViewSimpleFragment newInstance() {
36 | RecyclerViewSimpleFragment fragment = new RecyclerViewSimpleFragment();
37 | return fragment;
38 | }
39 |
40 | @Nullable
41 | @Override
42 | public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
43 | view = inflater.inflate(R.layout.fragment_common_recycler, null);
44 | initDataSource();
45 | initRecyclerView(view);
46 | return view;
47 | }
48 |
49 | public void initRecyclerView(View view) {
50 | recyclerView = (RecyclerView) view.findViewById(R.id.v_scroll);
51 | recyclerView.setOverScrollMode(View.OVER_SCROLL_NEVER);
52 |
53 | LinearLayoutManager mLayoutMgr = new LinearLayoutManager(getContext());
54 | recyclerView.setLayoutManager(mLayoutMgr);
55 |
56 | recyclerAdapter = new RecyclerAdapter();
57 | recyclerView.setAdapter(recyclerAdapter);
58 | recyclerView.addOnScrollListener(mOnScrollListener);
59 |
60 | if (mLoadingFooter == null) {
61 | mLoadingFooter = new LoadingFooter(getContext());
62 | recyclerAdapter.setFooterView(mLoadingFooter);
63 | }
64 |
65 | getDataTask();
66 | }
67 |
68 | private void initDataSource() {
69 | allDataSource.add(new RecyclerBean("为人民服务", R.drawable.finger_1));
70 | allDataSource.add(new RecyclerBean("yahoo~~", R.drawable.finger_2));
71 | allDataSource.add(new RecyclerBean("We will give everyone a free Mi band", R.drawable.finger_3));
72 | allDataSource.add(new RecyclerBean("呦西呦西", R.drawable.finger_4));
73 | allDataSource.add(new RecyclerBean("比我聪明没我帅", R.drawable.finger_5));
74 | allDataSource.add(new RecyclerBean("我只拿一个人头", R.drawable.finger_6));
75 | allDataSource.add(new RecyclerBean("嗯哼", R.drawable.finger_7));
76 | allDataSource.add(new RecyclerBean("你好", R.drawable.finger_8));
77 | allDataSource.add(new RecyclerBean("半边天%&¥@¥", R.drawable.finger_9));
78 | allDataSource.add(new RecyclerBean("不想上班是全世界的最常想的事", R.drawable.finger_10));
79 | allDataSource.add(new RecyclerBean("!!!", R.drawable.finger_11));
80 | }
81 |
82 | @Override
83 | public View getScrollableView() {
84 | return recyclerView;
85 | }
86 |
87 | @Override
88 | public void pullToRefresh() {
89 | lastPosition = 0;
90 | getDataTask();
91 | }
92 |
93 | @Override
94 | public void refreshComplete() {
95 | if (getActivity() instanceof MainActivity) {
96 | ((MainActivity) getActivity()).refreshComplete();
97 | }
98 | }
99 |
100 | private EndlessRecyclerOnScrollListener mOnScrollListener = new EndlessRecyclerOnScrollListener(2) {
101 | @Override
102 | public void onLoadMore(View view) {
103 | super.onLoadMore(view);
104 | getDataTask(false);
105 | }
106 | };
107 |
108 | public void getDataTask() {
109 | getDataTask(true);
110 | }
111 |
112 | public void getDataTask(final boolean isClear) {
113 | if (mLoadingFooter.getState() == LoadingFooter.State.Loading || (!isClear && mLoadingFooter.getState() == LoadingFooter.State.TheEnd)) {
114 | return;
115 | }
116 | mLoadingFooter.setState(LoadingFooter.State.Loading);
117 |
118 | view.postDelayed(new Runnable() {
119 | @Override
120 | public void run() {
121 | refreshComplete();
122 | recyclerAdapter.setFooterView(mLoadingFooter);
123 | if (isClear) {
124 | recyclerAdapter.clear();
125 | }
126 | List result = getData();
127 | if (result == null || result.size() < size) {
128 | mLoadingFooter.setState(LoadingFooter.State.TheEnd, false);
129 | recyclerAdapter.removeFooterView();
130 | } else {
131 | mLoadingFooter.setState(LoadingFooter.State.Normal);
132 | }
133 | if (result != null && result.size() > 0) {
134 | recyclerAdapter.addAll(result);
135 | lastPosition = lastPosition + result.size();
136 | }
137 | }
138 | }, 1000);
139 | }
140 |
141 | public List getData() {
142 | try {
143 | int end = (lastPosition + size) > allDataSource.size() ? allDataSource.size() : (lastPosition + size);
144 | return allDataSource.subList(lastPosition, end);
145 | } catch (Exception e) {
146 | e.printStackTrace();
147 | }
148 | return null;
149 | }
150 |
151 | public class RecyclerBean {
152 | public String title;
153 | public int icon;
154 |
155 | public RecyclerBean(String title, int icon) {
156 | this.title = title;
157 | this.icon = icon;
158 | }
159 | }
160 |
161 | public class RecyclerAdapter extends RecyclerLoadMoreAdapater {
162 |
163 | @Override
164 | public RecyclerView.ViewHolder onCreateViewHolderSuper(ViewGroup viewGroup, int viewType) {
165 | Context context = viewGroup.getContext();
166 | View view = LayoutInflater.from(context).inflate(R.layout.item_recyclerview, viewGroup, false);
167 | return new RecyclerItemViewHolder(view);
168 | }
169 |
170 | @Override
171 | public void onBindViewHolderSuper(RecyclerView.ViewHolder viewHolder, int position) {
172 | RecyclerItemViewHolder holder = (RecyclerItemViewHolder) viewHolder;
173 | holder.tvTitle.setText(mDataList.get(viewHolder.getLayoutPosition()).title);
174 | holder.ivIcon.setBackgroundResource(mDataList.get(viewHolder.getLayoutPosition()).icon);
175 | }
176 |
177 | private class RecyclerItemViewHolder extends RecyclerView.ViewHolder {
178 |
179 | private final TextView tvTitle;
180 | private final ImageView ivIcon;
181 |
182 | public RecyclerItemViewHolder(View itemView) {
183 | super(itemView);
184 | tvTitle = (TextView) itemView.findViewById(R.id.tv_title);
185 | ivIcon = (ImageView) itemView.findViewById(R.id.iv_icon);
186 | }
187 | }
188 | }
189 | }
190 |
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/java/com/scrollablelayout/simple/TestActivity.java:
--------------------------------------------------------------------------------
1 | package com.scrollablelayout.simple;
2 |
3 | import android.content.Intent;
4 | import android.net.Uri;
5 | import android.os.Bundle;
6 | import android.support.v7.app.AppCompatActivity;
7 | import android.view.View;
8 | import android.widget.ArrayAdapter;
9 | import android.widget.ListView;
10 | import android.widget.TextView;
11 |
12 | import com.scrollablelayout.ScrollableLayout;
13 |
14 | public class TestActivity extends AppCompatActivity {
15 |
16 | private TextView tv_title;
17 | private ScrollableLayout sl_root;
18 | private ListView listview;
19 |
20 | @Override
21 | protected void onCreate(Bundle savedInstanceState) {
22 | super.onCreate(savedInstanceState);
23 | setContentView(R.layout.activity_test);
24 | initView();
25 | }
26 |
27 | private void initView() {
28 | sl_root = (ScrollableLayout) findViewById(R.id.sl_root);
29 | listview = (ListView) findViewById(R.id.vp_scroll);
30 | tv_title = (TextView) findViewById(R.id.tv_title);
31 |
32 | int size = 100;
33 | String[] stringArray = new String[size];
34 | for (int i = 0; i < size; ++i) {
35 | stringArray[i] = ""+i;
36 | }
37 | ArrayAdapter adapter = new ArrayAdapter<>(this, android.R.layout.simple_list_item_1, stringArray);
38 | listview.setAdapter(adapter);
39 | sl_root.getHelper().setCurrentScrollableContainer(listview);
40 |
41 | TextView tv = (TextView) findViewById(R.id.tv_right);
42 | tv.setText("Github");
43 | tv.setOnClickListener(new View.OnClickListener() {
44 | @Override
45 | public void onClick(View v) {
46 | Uri uri = Uri.parse("https://github.com/w446108264/ScrollableLayout");
47 | Intent intent = new Intent(Intent.ACTION_VIEW, uri);
48 | startActivity(intent);
49 | }
50 | });
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/java/com/scrollablelayout/simple/gridimageview/AspectImageView.java:
--------------------------------------------------------------------------------
1 | package com.scrollablelayout.simple.gridimageview;
2 |
3 | import android.content.Context;
4 | import android.content.res.TypedArray;
5 | import android.util.AttributeSet;
6 |
7 | import com.scrollablelayout.simple.R;
8 |
9 |
10 | public class AspectImageView extends ForegroundImageView {
11 |
12 | public static final float DEFAULT_ASPECT = 16f / 9f;
13 |
14 | private static final int VERTICAL = 0;
15 | private static final int HORIZONTAL = 0;
16 |
17 | private float aspect = DEFAULT_ASPECT;
18 |
19 | public AspectImageView(Context context) {
20 | super(context);
21 | }
22 |
23 | public AspectImageView(Context context, AttributeSet attrs) {
24 | super(context, attrs);
25 |
26 | TypedArray a = context.obtainStyledAttributes(attrs, new int[]{R.attr.aspect});
27 | aspect = a.getFloat(0, aspect);
28 | a.recycle();
29 | }
30 |
31 | @Override
32 | protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
33 | int w = MeasureSpec.getSize(widthMeasureSpec);
34 | int wMode = MeasureSpec.getMode(widthMeasureSpec);
35 | int h = MeasureSpec.getSize(heightMeasureSpec);
36 | int hMode = MeasureSpec.getMode(heightMeasureSpec);
37 |
38 | if (wMode == MeasureSpec.EXACTLY || wMode == MeasureSpec.AT_MOST) {
39 | h = calculate(w, aspect, VERTICAL);
40 | } else if (hMode == MeasureSpec.EXACTLY || hMode == MeasureSpec.AT_MOST) {
41 | w = calculate(h, aspect, HORIZONTAL);
42 | } else {
43 | throw new IllegalArgumentException("Either width or height should have exact value");
44 | }
45 |
46 | int specW = MeasureSpec.makeMeasureSpec(w, MeasureSpec.EXACTLY);
47 | int specH = MeasureSpec.makeMeasureSpec(h, MeasureSpec.EXACTLY);
48 |
49 | super.onMeasure(specW, specH);
50 | }
51 |
52 | private int calculate(int size, float aspect, int direction) {
53 | int wp = getPaddingLeft() + getPaddingRight();
54 | int hp = getPaddingTop() + getPaddingBottom();
55 | return direction == VERTICAL
56 | ? Math.round((size - wp) / aspect) + hp
57 | : Math.round((size - hp) * aspect) + wp;
58 | }
59 |
60 | }
61 |
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/java/com/scrollablelayout/simple/gridimageview/ClickListener.java:
--------------------------------------------------------------------------------
1 | package com.scrollablelayout.simple.gridimageview;
2 |
3 | public interface ClickListener {
4 | void onClick(int index);
5 | void onLongClick(int index);
6 | }
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/java/com/scrollablelayout/simple/gridimageview/ForegroundImageView.java:
--------------------------------------------------------------------------------
1 | package com.scrollablelayout.simple.gridimageview;
2 |
3 | import android.content.Context;
4 | import android.content.res.TypedArray;
5 | import android.graphics.Canvas;
6 | import android.graphics.drawable.Drawable;
7 | import android.support.annotation.DrawableRes;
8 | import android.support.annotation.NonNull;
9 | import android.support.v4.content.ContextCompat;
10 | import android.util.AttributeSet;
11 | import android.widget.ImageView;
12 |
13 | import com.scrollablelayout.simple.R;
14 |
15 |
16 | /**
17 | * An ImageView which supports a foreground drawable.
18 | *
19 | * From: https://gist.github.com/JakeWharton/0a251d67649305d84e8a
20 | */
21 | public class ForegroundImageView extends ImageView {
22 | private Drawable foreground;
23 |
24 | public ForegroundImageView(Context context) {
25 | this(context, null);
26 | }
27 |
28 | public ForegroundImageView(Context context, AttributeSet attrs) {
29 | super(context, attrs);
30 |
31 | TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.ForegroundImageView);
32 | Drawable foreground = a.getDrawable(R.styleable.ForegroundImageView_android_foreground);
33 | if (foreground != null) {
34 | setForeground(foreground);
35 | }
36 | a.recycle();
37 | }
38 |
39 | /**
40 | * Supply a drawable resource that is to be rendered on top of all of the child
41 | * views in the frame layout.
42 | *
43 | * @param drawableResId The drawable resource to be drawn on top of the children.
44 | */
45 | public void setForegroundResource(@DrawableRes int drawableResId) {
46 | setForeground(ContextCompat.getDrawable(getContext(), drawableResId));
47 | }
48 |
49 | /**
50 | * Supply a Drawable that is to be rendered on top of all of the child
51 | * views in the frame layout.
52 | *
53 | * @param drawable The Drawable to be drawn on top of the children.
54 | */
55 | public void setForeground(Drawable drawable) {
56 | if (foreground == drawable) {
57 | return;
58 | }
59 | if (foreground != null) {
60 | foreground.setCallback(null);
61 | unscheduleDrawable(foreground);
62 | }
63 |
64 | foreground = drawable;
65 |
66 | if (drawable != null) {
67 | drawable.setCallback(this);
68 | if (drawable.isStateful()) {
69 | drawable.setState(getDrawableState());
70 | }
71 | }
72 | requestLayout();
73 | invalidate();
74 | }
75 |
76 | @Override
77 | protected boolean verifyDrawable(Drawable who) {
78 | return super.verifyDrawable(who) || who == foreground;
79 | }
80 |
81 | @Override
82 | public void jumpDrawablesToCurrentState() {
83 | super.jumpDrawablesToCurrentState();
84 | if (foreground != null) foreground.jumpToCurrentState();
85 | }
86 |
87 | @Override
88 | protected void drawableStateChanged() {
89 | super.drawableStateChanged();
90 | if (foreground != null && foreground.isStateful()) {
91 | foreground.setState(getDrawableState());
92 | }
93 | }
94 |
95 | @Override
96 | protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
97 | super.onMeasure(widthMeasureSpec, heightMeasureSpec);
98 | if (foreground != null) {
99 | foreground.setBounds(0, 0, getMeasuredWidth(), getMeasuredHeight());
100 | invalidate();
101 | }
102 | }
103 |
104 | @Override
105 | protected void onSizeChanged(int w, int h, int oldw, int oldh) {
106 | super.onSizeChanged(w, h, oldw, oldh);
107 | if (foreground != null) {
108 | foreground.setBounds(0, 0, w, h);
109 | invalidate();
110 | }
111 | }
112 |
113 | @Override
114 | public void draw(@NonNull Canvas canvas) {
115 | super.draw(canvas);
116 |
117 | if (foreground != null) {
118 | foreground.draw(canvas);
119 | }
120 | }
121 | }
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/java/com/scrollablelayout/simple/recyclerloadmore/EndlessRecyclerOnScrollListener.java:
--------------------------------------------------------------------------------
1 | package com.scrollablelayout.simple.recyclerloadmore;
2 |
3 | import android.support.v7.widget.GridLayoutManager;
4 | import android.support.v7.widget.LinearLayoutManager;
5 | import android.support.v7.widget.RecyclerView;
6 | import android.support.v7.widget.StaggeredGridLayoutManager;
7 | import android.view.View;
8 |
9 | public class EndlessRecyclerOnScrollListener extends RecyclerView.OnScrollListener implements OnLoadMoreListener {
10 |
11 | protected LayoutManagerType layoutManagerType;
12 |
13 | private int[] lastPositions;
14 |
15 | private int lastVisibleItemPosition;
16 |
17 | private int currentScrollState = 0;
18 |
19 | private int minPositionToEndless = 1;
20 |
21 | public EndlessRecyclerOnScrollListener(){ }
22 |
23 | public EndlessRecyclerOnScrollListener(int minPositionToEndless){
24 | this.minPositionToEndless = minPositionToEndless;
25 | }
26 |
27 | @Override
28 | public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
29 | super.onScrolled(recyclerView, dx, dy);
30 |
31 | RecyclerView.LayoutManager layoutManager = recyclerView.getLayoutManager();
32 |
33 | if (layoutManagerType == null) {
34 | if (layoutManager instanceof LinearLayoutManager) {
35 | layoutManagerType = LayoutManagerType.LinearLayout;
36 | } else if (layoutManager instanceof GridLayoutManager) {
37 | layoutManagerType = LayoutManagerType.GridLayout;
38 | } else if (layoutManager instanceof StaggeredGridLayoutManager) {
39 | layoutManagerType = LayoutManagerType.StaggeredGridLayout;
40 | } else {
41 | throw new RuntimeException("Unsupported LayoutManager used. Valid ones are LinearLayoutManager, GridLayoutManager and StaggeredGridLayoutManager");
42 | }
43 | }
44 |
45 | switch (layoutManagerType) {
46 | case LinearLayout:
47 | lastVisibleItemPosition = ((LinearLayoutManager) layoutManager).findLastVisibleItemPosition();
48 | break;
49 | case GridLayout:
50 | lastVisibleItemPosition = ((GridLayoutManager) layoutManager).findLastVisibleItemPosition();
51 | break;
52 | case StaggeredGridLayout:
53 | StaggeredGridLayoutManager staggeredGridLayoutManager = (StaggeredGridLayoutManager) layoutManager;
54 | if (lastPositions == null) {
55 | lastPositions = new int[staggeredGridLayoutManager.getSpanCount()];
56 | }
57 | staggeredGridLayoutManager.findLastVisibleItemPositions(lastPositions);
58 | lastVisibleItemPosition = findMax(lastPositions);
59 | break;
60 | }
61 | }
62 |
63 | @Override
64 | public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
65 | super.onScrollStateChanged(recyclerView, newState);
66 | currentScrollState = newState;
67 | RecyclerView.LayoutManager layoutManager = recyclerView.getLayoutManager();
68 | int visibleItemCount = layoutManager.getChildCount();
69 | int totalItemCount = layoutManager.getItemCount();
70 | if ((visibleItemCount > 0 && currentScrollState == RecyclerView.SCROLL_STATE_IDLE && (lastVisibleItemPosition) >= totalItemCount - minPositionToEndless)) {
71 | onLoadMore(recyclerView);
72 | }
73 | }
74 |
75 | private int findMax(int[] lastPositions) {
76 | int max = lastPositions[0];
77 | for (int value : lastPositions) {
78 | if (value > max) {
79 | max = value;
80 | }
81 | }
82 | return max;
83 | }
84 |
85 | @Override
86 | public void onLoadMore(final View view) { }
87 |
88 | public enum LayoutManagerType {
89 | LinearLayout,
90 | StaggeredGridLayout,
91 | GridLayout
92 | }
93 | }
94 |
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/java/com/scrollablelayout/simple/recyclerloadmore/LoadingFooter.java:
--------------------------------------------------------------------------------
1 | package com.scrollablelayout.simple.recyclerloadmore;
2 |
3 | import android.content.Context;
4 | import android.util.AttributeSet;
5 | import android.view.View;
6 | import android.view.ViewStub;
7 | import android.widget.ProgressBar;
8 | import android.widget.RelativeLayout;
9 | import android.widget.TextView;
10 |
11 | import com.scrollablelayout.simple.R;
12 |
13 | public class LoadingFooter extends RelativeLayout {
14 |
15 | protected State mState = State.Normal;
16 | private View mLoadingView;
17 | private View mNetworkErrorView;
18 | private View mTheEndView;
19 | private ProgressBar mLoadingProgress;
20 | private TextView mLoadingText;
21 |
22 | public LoadingFooter(Context context) {
23 | this(context, null);
24 | }
25 |
26 | public LoadingFooter(Context context, AttributeSet attrs) {
27 | this(context, attrs, 0);
28 | }
29 |
30 | public LoadingFooter(Context context, AttributeSet attrs, int defStyleAttr) {
31 | super(context, attrs, defStyleAttr);
32 | init(context);
33 | }
34 |
35 | public void init(Context context) {
36 | inflate(context, R.layout.view_recycler_footer, this);
37 | setOnClickListener(null);
38 | setState(State.Normal, true);
39 | }
40 |
41 | public State getState() {
42 | return mState;
43 | }
44 |
45 | public void setState(State status) {
46 | setState(status, true);
47 | }
48 |
49 | public void setState(State status, boolean showView) {
50 | if (mState == status) {
51 | return;
52 | }
53 | mState = status;
54 | switch (status) {
55 | case Normal:
56 | setOnClickListener(null);
57 | if (mLoadingView != null) {
58 | mLoadingView.setVisibility(GONE);
59 | }
60 |
61 | if (mTheEndView != null) {
62 | mTheEndView.setVisibility(GONE);
63 | }
64 |
65 | if (mNetworkErrorView != null) {
66 | mNetworkErrorView.setVisibility(GONE);
67 | }
68 | break;
69 | case Loading:
70 | setOnClickListener(null);
71 | if (mTheEndView != null) {
72 | mTheEndView.setVisibility(GONE);
73 | }
74 |
75 | if (mNetworkErrorView != null) {
76 | mNetworkErrorView.setVisibility(GONE);
77 | }
78 |
79 | if (mLoadingView == null) {
80 | ViewStub viewStub = (ViewStub) findViewById(R.id.loading_viewstub);
81 | mLoadingView = viewStub.inflate();
82 |
83 | mLoadingProgress = (ProgressBar) mLoadingView.findViewById(R.id.pg_loading);
84 | mLoadingText = (TextView) mLoadingView.findViewById(R.id.tv_loaddata);
85 | } else {
86 | mLoadingView.setVisibility(VISIBLE);
87 | }
88 | mLoadingView.setVisibility(showView ? VISIBLE : GONE);
89 | mLoadingProgress.setVisibility(View.VISIBLE);
90 | break;
91 | case TheEnd:
92 | setOnClickListener(null);
93 | if (mLoadingView != null) {
94 | mLoadingView.setVisibility(GONE);
95 | }
96 |
97 | if (mNetworkErrorView != null) {
98 | mNetworkErrorView.setVisibility(GONE);
99 | }
100 |
101 | if (mTheEndView == null) {
102 | ViewStub viewStub = (ViewStub) findViewById(R.id.end_viewstub);
103 | mTheEndView = viewStub.inflate();
104 | } else {
105 | mTheEndView.setVisibility(VISIBLE);
106 | }
107 |
108 | mTheEndView.setVisibility(showView ? VISIBLE : GONE);
109 | break;
110 | case NetWorkError:
111 | if (mLoadingView != null) {
112 | mLoadingView.setVisibility(GONE);
113 | }
114 |
115 | if (mTheEndView != null) {
116 | mTheEndView.setVisibility(GONE);
117 | }
118 |
119 | if (mNetworkErrorView == null) {
120 | ViewStub viewStub = (ViewStub) findViewById(R.id.network_error_viewstub);
121 | mNetworkErrorView = viewStub.inflate();
122 | } else {
123 | mNetworkErrorView.setVisibility(VISIBLE);
124 | }
125 | mNetworkErrorView.setVisibility(showView ? VISIBLE : GONE);
126 | break;
127 | default:
128 | break;
129 | }
130 | }
131 |
132 | public enum State {
133 | Normal, TheEnd, Loading, NetWorkError
134 | }
135 | }
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/java/com/scrollablelayout/simple/recyclerloadmore/OnLoadMoreListener.java:
--------------------------------------------------------------------------------
1 | package com.scrollablelayout.simple.recyclerloadmore;
2 |
3 | import android.view.View;
4 |
5 | public interface OnLoadMoreListener {
6 | void onLoadMore(View view);
7 | }
8 |
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/java/com/scrollablelayout/simple/recyclerloadmore/RecyclerLoadMoreAdapater.java:
--------------------------------------------------------------------------------
1 | package com.scrollablelayout.simple.recyclerloadmore;
2 |
3 |
4 | import android.support.annotation.NonNull;
5 | import android.support.v7.widget.RecyclerView;
6 | import android.view.View;
7 | import android.view.ViewGroup;
8 | import android.widget.FrameLayout;
9 |
10 | import java.util.ArrayList;
11 | import java.util.List;
12 |
13 |
14 | /**
15 | * Created by sj on 15/11/26.
16 | */
17 | public abstract class RecyclerLoadMoreAdapater extends RecyclerView.Adapter {
18 |
19 | private static final int TYPE_FOOTER = Integer.MIN_VALUE + 1;
20 |
21 | private FrameLayout footerView;
22 | private View footerContentView;
23 | protected boolean isShowFooter = false;
24 | protected final List mDataList = new ArrayList<>();
25 |
26 | protected RecyclerLoadMoreAdapater() { }
27 |
28 | public List getDataList() {
29 | return this.mDataList;
30 | }
31 |
32 | public void addAll(@NonNull List data) {
33 | this.mDataList.addAll(data);
34 | this.notifyDataSetChanged();
35 | }
36 |
37 | public void clear() {
38 | this.mDataList.clear();
39 | }
40 |
41 | public int getItemCount() {
42 | int count = mDataList == null ? 0 : this.mDataList.size();
43 | return count + getFooterCount();
44 | }
45 |
46 | @Override
47 | public final RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
48 | if (viewType == TYPE_FOOTER) {
49 | if (footerView == null) {
50 | footerView = new FrameLayout(parent.getContext());
51 | parent.addView(footerView);
52 | if (footerContentView != null) {
53 | footerView.addView(footerContentView);
54 | }
55 | }
56 | return new RecyclerPlaceViewHolder(footerView);
57 | }
58 | return onCreateViewHolderSuper(parent, viewType);
59 | }
60 |
61 | @Override
62 | public final int getItemViewType(int position) {
63 | if (isShowFooter && position == getItemCount() - getFooterCount()) {
64 | return TYPE_FOOTER;
65 | }
66 | return getItemViewTypeSuper(position);
67 | }
68 |
69 | @Override
70 | public final void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
71 | if (position != getItemCount() - getFooterCount()) {
72 | onBindViewHolderSuper(holder, position);
73 | }
74 | }
75 |
76 | public int getFooterCount() {
77 | if (isShowFooter) {
78 | return 1;
79 | }
80 | return 0;
81 | }
82 |
83 | public void setFooterView(View view) {
84 | footerContentView = view;
85 | isShowFooter = true;
86 | if (footerView != null && footerView.getChildCount() == 0) {
87 | footerView.addView(footerContentView);
88 | }
89 | }
90 |
91 | public void removeFooterView() {
92 | isShowFooter = false;
93 | notifyDataSetChanged();
94 | }
95 |
96 | private class RecyclerPlaceViewHolder extends RecyclerView.ViewHolder {
97 | public RecyclerPlaceViewHolder(View itemView) {
98 | super(itemView);
99 | }
100 | }
101 |
102 | public abstract RecyclerView.ViewHolder onCreateViewHolderSuper(ViewGroup viewGroup, int viewType);
103 |
104 | public int getItemViewTypeSuper(int position) {
105 | return super.getItemViewType(position);
106 | }
107 |
108 | public void onBindViewHolderSuper(RecyclerView.ViewHolder holder, int position) { }
109 | }
110 |
111 |
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/drawable-xhdpi/finger_1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/drawable-xhdpi/finger_1.jpg
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/drawable-xhdpi/finger_10.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/drawable-xhdpi/finger_10.jpg
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/drawable-xhdpi/finger_11.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/drawable-xhdpi/finger_11.jpg
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/drawable-xhdpi/finger_2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/drawable-xhdpi/finger_2.jpg
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/drawable-xhdpi/finger_3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/drawable-xhdpi/finger_3.jpg
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/drawable-xhdpi/finger_4.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/drawable-xhdpi/finger_4.jpg
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/drawable-xhdpi/finger_5.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/drawable-xhdpi/finger_5.jpg
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/drawable-xhdpi/finger_6.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/drawable-xhdpi/finger_6.jpg
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/drawable-xhdpi/finger_7.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/drawable-xhdpi/finger_7.jpg
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/drawable-xhdpi/finger_8.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/drawable-xhdpi/finger_8.jpg
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/drawable-xhdpi/finger_9.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/drawable-xhdpi/finger_9.jpg
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/drawable-xhdpi/g1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/drawable-xhdpi/g1.jpg
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/drawable-xhdpi/g10.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/drawable-xhdpi/g10.jpg
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/drawable-xhdpi/g11.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/drawable-xhdpi/g11.jpg
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/drawable-xhdpi/g12.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/drawable-xhdpi/g12.jpg
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/drawable-xhdpi/g13.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/drawable-xhdpi/g13.jpg
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/drawable-xhdpi/g14.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/drawable-xhdpi/g14.jpg
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/drawable-xhdpi/g15.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/drawable-xhdpi/g15.jpg
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/drawable-xhdpi/g16.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/drawable-xhdpi/g16.jpg
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/drawable-xhdpi/g17.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/drawable-xhdpi/g17.jpg
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/drawable-xhdpi/g18.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/drawable-xhdpi/g18.jpg
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/drawable-xhdpi/g19.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/drawable-xhdpi/g19.jpg
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/drawable-xhdpi/g2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/drawable-xhdpi/g2.jpg
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/drawable-xhdpi/g20.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/drawable-xhdpi/g20.jpg
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/drawable-xhdpi/g21.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/drawable-xhdpi/g21.jpg
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/drawable-xhdpi/g22.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/drawable-xhdpi/g22.jpg
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/drawable-xhdpi/g23.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/drawable-xhdpi/g23.jpg
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/drawable-xhdpi/g24.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/drawable-xhdpi/g24.jpg
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/drawable-xhdpi/g25.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/drawable-xhdpi/g25.jpg
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/drawable-xhdpi/g26.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/drawable-xhdpi/g26.jpg
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/drawable-xhdpi/g27.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/drawable-xhdpi/g27.jpg
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/drawable-xhdpi/g28.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/drawable-xhdpi/g28.jpg
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/drawable-xhdpi/g29.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/drawable-xhdpi/g29.jpg
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/drawable-xhdpi/g3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/drawable-xhdpi/g3.jpg
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/drawable-xhdpi/g30.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/drawable-xhdpi/g30.jpg
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/drawable-xhdpi/g31.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/drawable-xhdpi/g31.jpg
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/drawable-xhdpi/g32.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/drawable-xhdpi/g32.jpg
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/drawable-xhdpi/g33.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/drawable-xhdpi/g33.jpg
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/drawable-xhdpi/g34.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/drawable-xhdpi/g34.jpg
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/drawable-xhdpi/g35.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/drawable-xhdpi/g35.jpg
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/drawable-xhdpi/g36.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/drawable-xhdpi/g36.jpg
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/drawable-xhdpi/g37.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/drawable-xhdpi/g37.jpg
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/drawable-xhdpi/g38.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/drawable-xhdpi/g38.jpg
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/drawable-xhdpi/g39.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/drawable-xhdpi/g39.jpg
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/drawable-xhdpi/g4.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/drawable-xhdpi/g4.jpg
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/drawable-xhdpi/g40.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/drawable-xhdpi/g40.jpg
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/drawable-xhdpi/g41.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/drawable-xhdpi/g41.jpg
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/drawable-xhdpi/g42.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/drawable-xhdpi/g42.jpg
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/drawable-xhdpi/g43.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/drawable-xhdpi/g43.jpg
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/drawable-xhdpi/g44.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/drawable-xhdpi/g44.jpg
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/drawable-xhdpi/g45.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/drawable-xhdpi/g45.jpg
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/drawable-xhdpi/g46.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/drawable-xhdpi/g46.jpg
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/drawable-xhdpi/g47.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/drawable-xhdpi/g47.jpg
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/drawable-xhdpi/g48.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/drawable-xhdpi/g48.jpg
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/drawable-xhdpi/g49.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/drawable-xhdpi/g49.jpg
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/drawable-xhdpi/g5.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/drawable-xhdpi/g5.jpg
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/drawable-xhdpi/g50.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/drawable-xhdpi/g50.jpg
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/drawable-xhdpi/g51.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/drawable-xhdpi/g51.jpg
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/drawable-xhdpi/g52.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/drawable-xhdpi/g52.jpg
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/drawable-xhdpi/g53.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/drawable-xhdpi/g53.jpg
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/drawable-xhdpi/g54.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/drawable-xhdpi/g54.jpg
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/drawable-xhdpi/g55.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/drawable-xhdpi/g55.jpg
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/drawable-xhdpi/g56.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/drawable-xhdpi/g56.jpg
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/drawable-xhdpi/g57.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/drawable-xhdpi/g57.jpg
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/drawable-xhdpi/g58.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/drawable-xhdpi/g58.jpg
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/drawable-xhdpi/g59.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/drawable-xhdpi/g59.jpg
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/drawable-xhdpi/g6.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/drawable-xhdpi/g6.jpg
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/drawable-xhdpi/g60.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/drawable-xhdpi/g60.jpg
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/drawable-xhdpi/g61.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/drawable-xhdpi/g61.jpg
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/drawable-xhdpi/g62.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/drawable-xhdpi/g62.jpg
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/drawable-xhdpi/g63.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/drawable-xhdpi/g63.jpg
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/drawable-xhdpi/g64.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/drawable-xhdpi/g64.jpg
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/drawable-xhdpi/g65.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/drawable-xhdpi/g65.jpg
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/drawable-xhdpi/g66.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/drawable-xhdpi/g66.jpg
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/drawable-xhdpi/g67.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/drawable-xhdpi/g67.jpg
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/drawable-xhdpi/g68.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/drawable-xhdpi/g68.jpg
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/drawable-xhdpi/g69.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/drawable-xhdpi/g69.jpg
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/drawable-xhdpi/g7.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/drawable-xhdpi/g7.jpg
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/drawable-xhdpi/g70.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/drawable-xhdpi/g70.jpg
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/drawable-xhdpi/g71.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/drawable-xhdpi/g71.jpg
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/drawable-xhdpi/g72.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/drawable-xhdpi/g72.jpg
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/drawable-xhdpi/g73.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/drawable-xhdpi/g73.jpg
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/drawable-xhdpi/g74.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/drawable-xhdpi/g74.jpg
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/drawable-xhdpi/g75.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/drawable-xhdpi/g75.jpg
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/drawable-xhdpi/g76.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/drawable-xhdpi/g76.jpg
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/drawable-xhdpi/g77.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/drawable-xhdpi/g77.jpg
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/drawable-xhdpi/g78.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/drawable-xhdpi/g78.jpg
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/drawable-xhdpi/g79.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/drawable-xhdpi/g79.jpg
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/drawable-xhdpi/g8.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/drawable-xhdpi/g8.jpg
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/drawable-xhdpi/g80.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/drawable-xhdpi/g80.jpg
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/drawable-xhdpi/g81.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/drawable-xhdpi/g81.jpg
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/drawable-xhdpi/g82.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/drawable-xhdpi/g82.jpg
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/drawable-xhdpi/g83.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/drawable-xhdpi/g83.jpg
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/drawable-xhdpi/g84.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/drawable-xhdpi/g84.jpg
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/drawable-xhdpi/g85.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/drawable-xhdpi/g85.jpg
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/drawable-xhdpi/g86.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/drawable-xhdpi/g86.jpg
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/drawable-xhdpi/g87.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/drawable-xhdpi/g87.jpg
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/drawable-xhdpi/g88.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/drawable-xhdpi/g88.jpg
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/drawable-xhdpi/g89.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/drawable-xhdpi/g89.jpg
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/drawable-xhdpi/g9.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/drawable-xhdpi/g9.jpg
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/drawable-xhdpi/g90.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/drawable-xhdpi/g90.jpg
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/drawable-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/drawable-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/drawable/flickr_image_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/drawable/rectangle_left.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | -
7 |
8 |
9 |
10 |
11 |
12 | -
13 |
14 |
17 |
22 |
23 |
24 |
25 |
26 | -
30 |
31 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/drawable/rectangle_left_select.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | -
4 |
5 |
6 |
7 |
8 |
9 |
10 | -
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/drawable/rectangle_right.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | -
7 |
8 |
9 |
10 |
11 |
12 | -
13 |
14 |
17 |
22 |
23 |
24 |
25 |
26 | -
30 |
31 |
32 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/drawable/rectangle_right_select.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | -
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 | -
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/drawable/slidingtab_bg.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
13 |
14 |
25 |
26 |
31 |
32 |
36 |
37 |
41 |
42 |
47 |
48 |
49 |
50 |
51 |
52 |
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/layout/activity_test.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
12 |
13 |
18 |
19 |
26 |
27 |
34 |
35 |
40 |
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/layout/content_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
14 |
15 |
19 |
20 |
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/layout/fragment_common_recycler.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/layout/griditem_image.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/layout/ic_headerbar.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
18 |
19 |
31 |
32 |
38 |
39 |
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/layout/item_recycler_footer_end.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
14 |
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/layout/item_recycler_footer_loading.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
13 |
14 |
20 |
21 |
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/layout/item_recycler_footer_network_error.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/layout/item_recyclerview.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
16 |
17 |
21 |
22 |
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/layout/tabitem_slidingtab.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
20 |
21 |
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/layout/view_navigationbar.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
15 |
16 |
22 |
23 |
30 |
31 |
40 |
41 |
42 |
48 |
49 |
56 |
57 |
66 |
67 |
68 |
69 |
76 |
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/layout/view_recycler_footer.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
14 |
15 |
20 |
21 |
26 |
27 |
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/layout/view_userinfo_header.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
13 |
14 |
24 |
25 |
36 |
37 |
45 |
46 |
52 |
53 |
61 |
62 |
70 |
71 |
72 |
78 |
79 |
90 |
91 |
103 |
104 |
113 |
114 |
122 |
123 |
132 |
133 |
143 |
144 |
145 |
153 |
154 |
168 |
169 |
170 |
181 |
182 |
192 |
193 |
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/menu/menu_main.xml:
--------------------------------------------------------------------------------
1 |
11 |
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/mipmap-xxhdpi/icon_avatar.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/mipmap-xxhdpi/icon_avatar.png
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/mipmap-xxhdpi/icon_avatar_none.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/mipmap-xxhdpi/icon_avatar_none.png
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/mipmap-xxhdpi/icon_collect.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/mipmap-xxhdpi/icon_collect.png
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/mipmap-xxhdpi/icon_expand_select.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/mipmap-xxhdpi/icon_expand_select.png
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/mipmap-xxhdpi/icon_sex.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/mipmap-xxhdpi/icon_sex.png
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/mipmap-xxhdpi/icon_user_editprofile.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/mipmap-xxhdpi/icon_user_editprofile.png
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/mipmap-xxhdpi/icon_user_follow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/mipmap-xxhdpi/icon_user_follow.png
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/mipmap-xxhdpi/icon_user_msg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/mipmap-xxhdpi/icon_user_msg.png
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/values-v21/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
8 |
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/values-w820dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 64dp
6 |
7 |
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/values/attrs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3F51B5
4 | #303F9F
5 | #FF4081
6 |
7 |
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 16dp
4 | 16dp
5 | 16dp
6 |
7 |
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/values/ids.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | ScrollableLayout
3 | Settings
4 |
5 |
--------------------------------------------------------------------------------
/ScrollableLayout/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
8 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/ScrollableLayout/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | repositories {
5 | jcenter()
6 | }
7 | dependencies {
8 | classpath 'com.android.tools.build:gradle:2.0.0'
9 | classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3'
10 |
11 | // NOTE: Do not place your application dependencies here; they belong
12 | // in the individual module build.gradle files
13 | }
14 | }
15 |
16 | allprojects {
17 | repositories {
18 | jcenter()
19 | }
20 | }
21 |
22 | task clean(type: Delete) {
23 | delete rootProject.buildDir
24 | }
25 |
--------------------------------------------------------------------------------
/ScrollableLayout/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Gradle settings configured through the IDE *will override*
5 | # any settings specified in this file.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m
13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
14 |
15 | # When configured, Gradle will run in incubating parallel mode.
16 | # This option should only be used with decoupled projects. More details, visit
17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
18 | # org.gradle.parallel=true
--------------------------------------------------------------------------------
/ScrollableLayout/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/ScrollableLayout/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/ScrollableLayout/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Mon Apr 11 12:52:13 CST 2016
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip
7 |
--------------------------------------------------------------------------------
/ScrollableLayout/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
10 | DEFAULT_JVM_OPTS=""
11 |
12 | APP_NAME="Gradle"
13 | APP_BASE_NAME=`basename "$0"`
14 |
15 | # Use the maximum available, or set MAX_FD != -1 to use that value.
16 | MAX_FD="maximum"
17 |
18 | warn ( ) {
19 | echo "$*"
20 | }
21 |
22 | die ( ) {
23 | echo
24 | echo "$*"
25 | echo
26 | exit 1
27 | }
28 |
29 | # OS specific support (must be 'true' or 'false').
30 | cygwin=false
31 | msys=false
32 | darwin=false
33 | case "`uname`" in
34 | CYGWIN* )
35 | cygwin=true
36 | ;;
37 | Darwin* )
38 | darwin=true
39 | ;;
40 | MINGW* )
41 | msys=true
42 | ;;
43 | esac
44 |
45 | # Attempt to set APP_HOME
46 | # Resolve links: $0 may be a link
47 | PRG="$0"
48 | # Need this for relative symlinks.
49 | while [ -h "$PRG" ] ; do
50 | ls=`ls -ld "$PRG"`
51 | link=`expr "$ls" : '.*-> \(.*\)$'`
52 | if expr "$link" : '/.*' > /dev/null; then
53 | PRG="$link"
54 | else
55 | PRG=`dirname "$PRG"`"/$link"
56 | fi
57 | done
58 | SAVED="`pwd`"
59 | cd "`dirname \"$PRG\"`/" >/dev/null
60 | APP_HOME="`pwd -P`"
61 | cd "$SAVED" >/dev/null
62 |
63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
64 |
65 | # Determine the Java command to use to start the JVM.
66 | if [ -n "$JAVA_HOME" ] ; then
67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
68 | # IBM's JDK on AIX uses strange locations for the executables
69 | JAVACMD="$JAVA_HOME/jre/sh/java"
70 | else
71 | JAVACMD="$JAVA_HOME/bin/java"
72 | fi
73 | if [ ! -x "$JAVACMD" ] ; then
74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
75 |
76 | Please set the JAVA_HOME variable in your environment to match the
77 | location of your Java installation."
78 | fi
79 | else
80 | JAVACMD="java"
81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
82 |
83 | Please set the JAVA_HOME variable in your environment to match the
84 | location of your Java installation."
85 | fi
86 |
87 | # Increase the maximum file descriptors if we can.
88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
89 | MAX_FD_LIMIT=`ulimit -H -n`
90 | if [ $? -eq 0 ] ; then
91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
92 | MAX_FD="$MAX_FD_LIMIT"
93 | fi
94 | ulimit -n $MAX_FD
95 | if [ $? -ne 0 ] ; then
96 | warn "Could not set maximum file descriptor limit: $MAX_FD"
97 | fi
98 | else
99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
100 | fi
101 | fi
102 |
103 | # For Darwin, add options to specify how the application appears in the dock
104 | if $darwin; then
105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
106 | fi
107 |
108 | # For Cygwin, switch paths to Windows format before running java
109 | if $cygwin ; then
110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
112 | JAVACMD=`cygpath --unix "$JAVACMD"`
113 |
114 | # We build the pattern for arguments to be converted via cygpath
115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
116 | SEP=""
117 | for dir in $ROOTDIRSRAW ; do
118 | ROOTDIRS="$ROOTDIRS$SEP$dir"
119 | SEP="|"
120 | done
121 | OURCYGPATTERN="(^($ROOTDIRS))"
122 | # Add a user-defined pattern to the cygpath arguments
123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
125 | fi
126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
127 | i=0
128 | for arg in "$@" ; do
129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
131 |
132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
134 | else
135 | eval `echo args$i`="\"$arg\""
136 | fi
137 | i=$((i+1))
138 | done
139 | case $i in
140 | (0) set -- ;;
141 | (1) set -- "$args0" ;;
142 | (2) set -- "$args0" "$args1" ;;
143 | (3) set -- "$args0" "$args1" "$args2" ;;
144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
150 | esac
151 | fi
152 |
153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
154 | function splitJvmOpts() {
155 | JVM_OPTS=("$@")
156 | }
157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
159 |
160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
161 |
--------------------------------------------------------------------------------
/ScrollableLayout/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/ScrollableLayout/library/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/ScrollableLayout/library/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.library'
2 | apply plugin: 'com.github.dcendents.android-maven'
3 |
4 | group='com.github.w446108264'
5 |
6 | android {
7 | compileSdkVersion 23
8 | buildToolsVersion "23.0.2"
9 |
10 | defaultConfig {
11 | minSdkVersion 11
12 | targetSdkVersion 23
13 | versionCode 1
14 | versionName "1.0"
15 | }
16 | buildTypes {
17 | release {
18 | minifyEnabled false
19 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
20 | }
21 | }
22 | }
23 |
24 | dependencies {
25 | compile 'com.android.support:recyclerview-v7:22.1.1'
26 | }
27 |
--------------------------------------------------------------------------------
/ScrollableLayout/library/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/ScrollableLayout/library/src/main/java/com/scrollablelayout/ScrollableHelper.java:
--------------------------------------------------------------------------------
1 | package com.scrollablelayout;
2 |
3 |
4 | import android.annotation.SuppressLint;
5 | import android.support.v7.widget.LinearLayoutManager;
6 | import android.support.v7.widget.RecyclerView;
7 | import android.view.View;
8 | import android.view.ViewGroup;
9 | import android.webkit.WebView;
10 | import android.widget.AbsListView;
11 | import android.widget.AdapterView;
12 | import android.widget.ScrollView;
13 |
14 | public class ScrollableHelper {
15 |
16 | private View mCurrentScrollableView;
17 |
18 | private ScrollableContainer mCurrentScrollableCainer;
19 |
20 | private int sysVersion = android.os.Build.VERSION.SDK_INT;
21 |
22 | /**
23 | * a viewgroup whitch contains ScrollView/ListView/RecycelerView..
24 | */
25 | public interface ScrollableContainer {
26 | /**
27 | * @return ScrollView/ListView/RecycelerView..'s instance
28 | */
29 | View getScrollableView();
30 | }
31 |
32 | public void setCurrentScrollableContainer(ScrollableContainer scrollableContainer) {
33 | this.mCurrentScrollableCainer = scrollableContainer;
34 | }
35 |
36 | public void setCurrentScrollableContainer(View view) {
37 | this.mCurrentScrollableView = view;
38 | }
39 |
40 | private View getScrollableView() {
41 | if (mCurrentScrollableCainer == null) {
42 | return mCurrentScrollableView;
43 | }
44 | return mCurrentScrollableCainer.getScrollableView();
45 | }
46 |
47 | public boolean isTop() {
48 | View scrollableView = getScrollableView();
49 | if (scrollableView == null) {
50 | return false;
51 | }
52 | if (scrollableView instanceof AdapterView) {
53 | return isAdapterViewTop((AdapterView) scrollableView);
54 | }
55 | if (scrollableView instanceof ScrollView) {
56 | return isScrollViewTop((ScrollView) scrollableView);
57 | }
58 | if (scrollableView instanceof RecyclerView) {
59 | return isRecyclerViewTop((RecyclerView) scrollableView);
60 | }
61 | if (scrollableView instanceof WebView) {
62 | return isWebViewTop((WebView) scrollableView);
63 | }
64 | throw new IllegalStateException("scrollableView must be a instance of AdapterView|ScrollView|RecyclerView");
65 | }
66 |
67 | private static boolean isRecyclerViewTop(RecyclerView recyclerView) {
68 | if (recyclerView != null) {
69 | RecyclerView.LayoutManager layoutManager = recyclerView.getLayoutManager();
70 | if (layoutManager instanceof LinearLayoutManager) {
71 | int firstVisibleItemPosition = ((LinearLayoutManager) layoutManager).findFirstVisibleItemPosition();
72 | View childAt = recyclerView.getChildAt(0);
73 | if (childAt == null) {
74 | return true;
75 | }
76 | if (firstVisibleItemPosition == 0) {
77 | ViewGroup.MarginLayoutParams lp = (ViewGroup.MarginLayoutParams) childAt.getLayoutParams();
78 | int topMargin = lp.topMargin;
79 | int top = childAt.getTop();
80 | if (top >= topMargin) {
81 | return true;
82 | }
83 | }
84 | }
85 | }
86 | return false;
87 | }
88 |
89 | private static boolean isAdapterViewTop(AdapterView adapterView) {
90 | if (adapterView != null) {
91 | int firstVisiblePosition = adapterView.getFirstVisiblePosition();
92 | View childAt = adapterView.getChildAt(0);
93 | if (childAt == null || (firstVisiblePosition == 0 && childAt != null && childAt.getTop() == 0)) {
94 | return true;
95 | }
96 | }
97 | return false;
98 | }
99 |
100 | private static boolean isScrollViewTop(ScrollView scrollView) {
101 | if (scrollView != null) {
102 | int scrollViewY = scrollView.getScrollY();
103 | return scrollViewY <= 0;
104 | }
105 | return false;
106 | }
107 |
108 | private static boolean isWebViewTop(WebView scrollView) {
109 | if (scrollView != null) {
110 | int scrollViewY = scrollView.getScrollY();
111 | return scrollViewY <= 0;
112 | }
113 | return false;
114 | }
115 |
116 | @SuppressLint("NewApi")
117 | public void smoothScrollBy(int velocityY, int distance, int duration) {
118 | View scrollableView = getScrollableView();
119 | if (scrollableView instanceof AbsListView) {
120 | AbsListView absListView = (AbsListView) scrollableView;
121 | if (sysVersion >= 21) {
122 | absListView.fling(velocityY);
123 | } else {
124 | absListView.smoothScrollBy(distance, duration);
125 | }
126 | } else if (scrollableView instanceof ScrollView) {
127 | ((ScrollView) scrollableView).fling(velocityY);
128 | } else if (scrollableView instanceof RecyclerView) {
129 | ((RecyclerView) scrollableView).fling(0, velocityY);
130 | } else if (scrollableView instanceof WebView) {
131 | ((WebView)scrollableView).flingScroll(0,velocityY);
132 | }
133 | }
134 | }
135 |
--------------------------------------------------------------------------------
/ScrollableLayout/library/src/main/java/com/scrollablelayout/ScrollableLayout.java:
--------------------------------------------------------------------------------
1 | package com.scrollablelayout;
2 |
3 |
4 | import android.annotation.TargetApi;
5 | import android.content.Context;
6 | import android.os.Build;
7 | import android.support.v4.view.ViewPager;
8 | import android.util.AttributeSet;
9 | import android.view.MotionEvent;
10 | import android.view.VelocityTracker;
11 | import android.view.View;
12 | import android.view.ViewConfiguration;
13 | import android.widget.LinearLayout;
14 | import android.widget.Scroller;
15 |
16 | /**
17 | * Created by cpoopc(303727604@qq.com) on 2015-02-10.
18 | */
19 | public class ScrollableLayout extends LinearLayout {
20 |
21 | private Context context;
22 | private Scroller mScroller;
23 | private float mDownX;
24 | private float mDownY;
25 | private float mLastX;
26 | private float mLastY;
27 | private VelocityTracker mVelocityTracker;
28 | private int mTouchSlop;
29 | private int mMinimumVelocity;
30 | private int mMaximumVelocity;
31 |
32 | private boolean mIsHorizontalScrolling;
33 | private float x_down;
34 | private float y_down;
35 | private float x_move;
36 | private float y_move;
37 | private float moveDistanceX;
38 | private float moveDistanceY;
39 |
40 | private View mHeadView;
41 | private ViewPager childViewPager;
42 |
43 | private DIRECTION mDirection;
44 | private int mHeadHeight;
45 | private int mScrollY;
46 | private int sysVersion;
47 | private boolean flag1, flag2;
48 | private int mLastScrollerY;
49 | private boolean mDisallowIntercept;
50 |
51 | private int minY = 0;
52 | private int maxY = 0;
53 |
54 | private int mCurY;
55 | private boolean isClickHead;
56 | private int mScrollMinY = 10;
57 |
58 | enum DIRECTION {
59 | UP,
60 | DOWN
61 | }
62 |
63 | public interface OnScrollListener {
64 | void onScroll(int currentY, int maxY);
65 | }
66 |
67 | private OnScrollListener onScrollListener;
68 |
69 | public void setOnScrollListener(OnScrollListener onScrollListener) {
70 | this.onScrollListener = onScrollListener;
71 | }
72 |
73 | private ScrollableHelper mHelper;
74 |
75 | public ScrollableHelper getHelper() {
76 | return mHelper;
77 | }
78 |
79 | public ScrollableLayout(Context context) { this(context, null); }
80 |
81 | public ScrollableLayout(Context context, AttributeSet attrs) {
82 | this(context, attrs, 0);
83 | }
84 |
85 | public ScrollableLayout(Context context, AttributeSet attrs, int defStyleAttr) {
86 | super(context, attrs, defStyleAttr);
87 | this.context = context;
88 | mHelper = new ScrollableHelper();
89 | mScroller = new Scroller(context);
90 | final ViewConfiguration configuration = ViewConfiguration.get(context);
91 | mTouchSlop = configuration.getScaledTouchSlop();
92 | mMinimumVelocity = configuration.getScaledMinimumFlingVelocity();
93 | mMaximumVelocity = configuration.getScaledMaximumFlingVelocity();
94 | sysVersion = Build.VERSION.SDK_INT;
95 | setOrientation(VERTICAL);
96 | }
97 |
98 | @Override
99 | protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
100 | mHeadView = getChildAt(0);
101 | if(mHeadView != null){
102 | measureChildWithMargins(mHeadView, widthMeasureSpec, 0, MeasureSpec.UNSPECIFIED, 0);
103 | maxY = mHeadView.getMeasuredHeight();
104 | mHeadHeight = mHeadView.getMeasuredHeight();
105 | }
106 | super.onMeasure(widthMeasureSpec, MeasureSpec.makeMeasureSpec(MeasureSpec.getSize(heightMeasureSpec) + maxY, MeasureSpec.EXACTLY));
107 | }
108 |
109 | @Override
110 | protected void onFinishInflate() {
111 | if (mHeadView != null && !mHeadView.isClickable()) {
112 | mHeadView.setClickable(true);
113 | }
114 | int childCount = getChildCount();
115 | for (int i = 0; i < childCount; i++) {
116 | View childAt = getChildAt(i);
117 | if (childAt != null && childAt instanceof ViewPager) {
118 | childViewPager = (ViewPager) childAt;
119 | }
120 | }
121 | super.onFinishInflate();
122 | }
123 |
124 | @Override
125 | public boolean dispatchTouchEvent(MotionEvent ev) {
126 | float currentX = ev.getX();
127 | float currentY = ev.getY();
128 | float deltaY;
129 | int shiftX;
130 | int shiftY;
131 | shiftX = (int) Math.abs(currentX - mDownX);
132 | shiftY = (int) Math.abs(currentY - mDownY);
133 | switch (ev.getAction()) {
134 | case MotionEvent.ACTION_DOWN:
135 | mDisallowIntercept = false;
136 | mIsHorizontalScrolling = false;
137 | x_down = ev.getRawX();
138 | y_down = ev.getRawY();
139 | flag1 = true;
140 | flag2 = true;
141 | mDownX = currentX;
142 | mDownY = currentY;
143 | mLastX = currentX;
144 | mLastY = currentY;
145 | mScrollY = getScrollY();
146 | checkIsClickHead((int) currentY, mHeadHeight, getScrollY());
147 | initOrResetVelocityTracker();
148 | mVelocityTracker.addMovement(ev);
149 | mScroller.forceFinished(true);
150 | break;
151 | case MotionEvent.ACTION_MOVE:
152 | if (mDisallowIntercept) {
153 | break;
154 | }
155 | initVelocityTrackerIfNotExists();
156 | mVelocityTracker.addMovement(ev);
157 | deltaY = mLastY - currentY;
158 | if (flag1) {
159 | if (shiftX > mTouchSlop && shiftX > shiftY) {
160 | flag1 = false;
161 | flag2 = false;
162 | } else if (shiftY > mTouchSlop && shiftY > shiftX) {
163 | flag1 = false;
164 | flag2 = true;
165 | }
166 | }
167 |
168 | if (flag2 && shiftY > mTouchSlop && shiftY > shiftX && (!isSticked() || mHelper.isTop())) {
169 | if (childViewPager != null) {
170 | childViewPager.requestDisallowInterceptTouchEvent(true);
171 | }
172 | scrollBy(0, (int) (deltaY + 0.5));
173 | }
174 | mLastX = currentX;
175 | mLastY = currentY;
176 | x_move = ev.getRawX();
177 | y_move = ev.getRawY();
178 | moveDistanceX = (int) (x_move - x_down);
179 | moveDistanceY = (int) (y_move - y_down);
180 | if (Math.abs(moveDistanceY) > mScrollMinY && (Math.abs(moveDistanceY) * 0.1 > Math.abs(moveDistanceX))) {
181 | mIsHorizontalScrolling = false;
182 | } else {
183 | mIsHorizontalScrolling = true;
184 | }
185 | break;
186 | case MotionEvent.ACTION_UP:
187 | if (flag2 && shiftY > shiftX && shiftY > mTouchSlop) {
188 | mVelocityTracker.computeCurrentVelocity(1000, mMaximumVelocity);
189 | float yVelocity = -mVelocityTracker.getYVelocity();
190 | if (Math.abs(yVelocity) > mMinimumVelocity) {
191 | mDirection = yVelocity > 0 ? DIRECTION.UP : DIRECTION.DOWN;
192 | if (mDirection == DIRECTION.UP && isSticked()) {
193 | } else {
194 | mScroller.fling(0, getScrollY(), 0, (int) yVelocity, 0, 0, -Integer.MAX_VALUE, Integer.MAX_VALUE);
195 | mScroller.computeScrollOffset();
196 | mLastScrollerY = getScrollY();
197 | invalidate();
198 | }
199 | }
200 | if (isClickHead || !isSticked()) {
201 | int action = ev.getAction();
202 | ev.setAction(MotionEvent.ACTION_CANCEL);
203 | boolean dd = super.dispatchTouchEvent(ev);
204 | ev.setAction(action);
205 | return dd;
206 | }
207 | }
208 | break;
209 | case MotionEvent.ACTION_CANCEL:
210 | if (flag2 && isClickHead && (shiftX > mTouchSlop || shiftY > mTouchSlop)) {
211 | int action = ev.getAction();
212 | ev.setAction(MotionEvent.ACTION_CANCEL);
213 | boolean dd = super.dispatchTouchEvent(ev);
214 | ev.setAction(action);
215 | return dd;
216 | }
217 | break;
218 | default:
219 | break;
220 | }
221 | super.dispatchTouchEvent(ev);
222 | return true;
223 | }
224 |
225 | @TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH)
226 | private int getScrollerVelocity(int distance, int duration) {
227 | if (mScroller == null) {
228 | return 0;
229 | } else if (sysVersion >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
230 | return (int) mScroller.getCurrVelocity();
231 | } else {
232 | return distance / duration;
233 | }
234 | }
235 |
236 | @Override
237 | public void computeScroll() {
238 | if (mScroller.computeScrollOffset()) {
239 | final int currY = mScroller.getCurrY();
240 | if (mDirection == DIRECTION.UP) {
241 | if (isSticked()) {
242 | int distance = mScroller.getFinalY() - currY;
243 | int duration = calcDuration(mScroller.getDuration(), mScroller.timePassed());
244 | mHelper.smoothScrollBy(getScrollerVelocity(distance, duration), distance, duration);
245 | mScroller.forceFinished(true);
246 | return;
247 | } else {
248 | scrollTo(0, currY);
249 | }
250 | } else {
251 | if (mHelper.isTop()) {
252 | int deltaY = (currY - mLastScrollerY);
253 | int toY = getScrollY() + deltaY;
254 | scrollTo(0, toY);
255 | if (mCurY <= minY) {
256 | mScroller.forceFinished(true);
257 | return;
258 | }
259 | }
260 | invalidate();
261 | }
262 | mLastScrollerY = currY;
263 | }
264 | }
265 |
266 | @Override
267 | public void scrollBy(int x, int y) {
268 | int scrollY = getScrollY();
269 | int toY = scrollY + y;
270 | if (toY >= maxY) {
271 | toY = maxY;
272 | } else if (toY <= minY) {
273 | toY = minY;
274 | }
275 | y = toY - scrollY;
276 | super.scrollBy(x, y);
277 | }
278 |
279 | @Override
280 | public void scrollTo(int x, int y) {
281 | if (y >= maxY) {
282 | y = maxY;
283 | } else if (y <= minY) {
284 | y = minY;
285 | }
286 | mCurY = y;
287 | if (onScrollListener != null) {
288 | onScrollListener.onScroll(y, maxY);
289 | }
290 | super.scrollTo(x, y);
291 | }
292 |
293 | private void initOrResetVelocityTracker() {
294 | if (mVelocityTracker == null) {
295 | mVelocityTracker = VelocityTracker.obtain();
296 | } else {
297 | mVelocityTracker.clear();
298 | }
299 | }
300 |
301 | private void initVelocityTrackerIfNotExists() {
302 | if (mVelocityTracker == null) {
303 | mVelocityTracker = VelocityTracker.obtain();
304 | }
305 | }
306 |
307 | private void recycleVelocityTracker() {
308 | if (mVelocityTracker != null) {
309 | mVelocityTracker.recycle();
310 | mVelocityTracker = null;
311 | }
312 | }
313 |
314 | private void checkIsClickHead(int downY, int headHeight, int scrollY) {
315 | isClickHead = downY + scrollY <= headHeight;
316 | }
317 |
318 | private int calcDuration(int duration, int timepass) {
319 | return duration - timepass;
320 | }
321 |
322 | public void requestScrollableLayoutDisallowInterceptTouchEvent(boolean disallowIntercept) {
323 | super.requestDisallowInterceptTouchEvent(disallowIntercept);
324 | mDisallowIntercept = disallowIntercept;
325 | }
326 |
327 | public boolean isSticked() {
328 | return mCurY == maxY;
329 | }
330 |
331 | public int getMaxY() {
332 | return maxY;
333 | }
334 |
335 | public void setScrollMinY(int y) {
336 | mScrollMinY = y;
337 | }
338 |
339 | public boolean isCanPullToRefresh() {
340 | if (getScrollY() <= 0 && mHelper.isTop() && !mIsHorizontalScrolling) {
341 | return true;
342 | }
343 | return false;
344 | }
345 | }
346 |
--------------------------------------------------------------------------------
/ScrollableLayout/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app', ':library'
2 |
--------------------------------------------------------------------------------
/output/p1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/output/p1.jpg
--------------------------------------------------------------------------------
/output/p2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/output/p2.jpg
--------------------------------------------------------------------------------
/output/p3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/output/p3.jpg
--------------------------------------------------------------------------------
/output/p4.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/output/p4.jpg
--------------------------------------------------------------------------------
/output/p5.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/output/p5.jpg
--------------------------------------------------------------------------------
/output/p6.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/output/p6.jpg
--------------------------------------------------------------------------------
/output/show.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/output/show.gif
--------------------------------------------------------------------------------
/output/simple.apk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/output/simple.apk
--------------------------------------------------------------------------------
/output/slow.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w446108264/ScrollableLayout/a4753028046660c3ade03defacc177b801c8d467/output/slow.gif
--------------------------------------------------------------------------------