17 |
18 |
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 | # IDE (e.g. Android Studio) users:
3 | # Gradle settings configured through the IDE *will override*
4 | # any settings specified in this file.
5 | # For more details on how to configure your build environment visit
6 | # http://www.gradle.org/docs/current/userguide/build_environment.html
7 | # Specifies the JVM arguments used for the daemon process.
8 | # The setting is particularly useful for tweaking memory settings.
9 | org.gradle.jvmargs=-Xmx1536m
10 | # When configured, Gradle will run in incubating parallel mode.
11 | # This option should only be used with decoupled projects. More details, visit
12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
13 | # org.gradle.parallel=true
14 |
--------------------------------------------------------------------------------
/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
22 |
--------------------------------------------------------------------------------
/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 27
5 | defaultConfig {
6 | applicationId "video.zhangyue.com.sample"
7 | minSdkVersion 15
8 | targetSdkVersion 27
9 | versionCode 1
10 | versionName "1.0"
11 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
12 | }
13 | buildTypes {
14 | release {
15 | minifyEnabled false
16 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
17 | }
18 | }
19 | }
20 |
21 | dependencies {
22 | implementation fileTree(include: ['*.jar'], dir: 'libs')
23 | implementation 'com.chw.android:widget:3.0.3'
24 | implementation 'com.android.support:support-v4:27.1.1'
25 | implementation 'com.android.support:recyclerview-v7:27.1.1'
26 | }
27 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
12 |
13 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/README_CN.md:
--------------------------------------------------------------------------------
1 | # widget
2 | [English document](README.md)
3 | 开发这个控件库是为了致力于提升android原生控件的一些性能及体验
4 |
5 | 
6 |
7 | # 效果
8 | 这次添加的顶部图片过度拉伸效果是仿ios的appstore中的图片过度拉伸效果。
9 |
10 | 
11 |
12 | * 继承RecycleView,保留RecycleView原本的特性
13 | * 根据RecycleView的滚动item时动态调整各item的top位置及head的scale值,不触发requestLayout。
14 | * 处理了head收起展开的各种极端情况,确保head不会只露出半个
15 | * 处理了RecycleView的快速抛动情况,确保fling到head时head的位置能正常
16 |
17 |
18 |
19 | # 集成
20 | 需要集成v4和v7两个库,以及这里的效果库
21 |
22 | implementation 'com.chw.android:widget:3.0.3'
23 | implementation 'com.android.support:support-v4:27.1.1'
24 | implementation 'com.android.support:recyclerview-v7:27.1.1'
25 |
26 | # 使用
27 |
28 | 使用起来十分简单,将RecycleView换成WeRecycleView即可,设置滑动模式
29 |
30 | mRecycleView.setScrollMode(WeRecycleView.SCROLL_SCALE_HEAD);
31 | mRecycleView.setMaxScale(4f);
32 |
33 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2024 chengweidev
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # widget
2 | [中文文档](README_CN.md)
3 | The development of this control library is intended to enhance the performance and experience of Android native controls.
4 |
5 | 
6 |
7 | # Effect
8 | The overstretched effect of the top picture added is the overstretching effect of the picture imitated by IOS Appstore.
9 |
10 | 
11 |
12 | * Extend RecycleView, retaining its original features
13 | * According to the rolling item of RecycleView, it dynamically adjusts the top position of each item and scale value of head, and does not trigger requestLayout.
14 | * Head has handled all kinds of extreme situations that have been deployed to ensure that head will not reveal only half of them.
15 | * The fast throw motion of RecycleView is processed to ensure that the position of head can be normal when fling to head.
16 |
17 |
18 |
19 | # Integrate
20 | You need to integrate the V4 and V7 libraries, and the effect libraries here
21 |
22 | implementation 'com.chw.android:widget:3.0.3'
23 | implementation 'com.android.support:support-v4:27.1.1'
24 | implementation 'com.android.support:recyclerview-v7:27.1.1'
25 |
26 | # Use
27 |
28 | It is very simple to use, change the RecycleView to WeRecycleView, and set the sliding mode.
29 |
30 | mRecycleView.setScrollMode(WeRecycleView.SCROLL_SCALE_HEAD);
31 | mRecycleView.setMaxScale(4f);
32 |
33 |
--------------------------------------------------------------------------------
/.idea/inspectionProfiles/Project_Default.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |