├── MyApplication ├── .gradle │ └── 3.3 │ │ ├── taskArtifacts │ │ ├── fileHashes.bin │ │ ├── fileSnapshots.bin │ │ ├── taskArtifacts.bin │ │ └── taskArtifacts.lock │ │ └── tasks │ │ └── _app_compileDebugJavaWithJavac │ │ ├── localClassSetAnalysis │ │ ├── localClassSetAnalysis.bin │ │ └── localClassSetAnalysis.lock │ │ └── localJarClasspathSnapshot │ │ ├── localJarClasspathSnapshot.bin │ │ └── localJarClasspathSnapshot.lock ├── .idea │ ├── gradle.xml │ ├── libraries │ │ ├── com_android_support_animated_vector_drawable_25_3_1.xml │ │ ├── com_android_support_appcompat_v7_25_3_1.xml │ │ ├── com_android_support_constraint_constraint_layout_1_0_2.xml │ │ ├── com_android_support_constraint_constraint_layout_solver_1_0_2_jar.xml │ │ ├── com_android_support_recyclerview_v7_25_3_1.xml │ │ ├── com_android_support_support_annotations_25_3_1_jar.xml │ │ ├── com_android_support_support_compat_25_3_1.xml │ │ ├── com_android_support_support_core_ui_25_3_1.xml │ │ ├── com_android_support_support_core_utils_25_3_1.xml │ │ ├── com_android_support_support_fragment_25_3_1.xml │ │ ├── com_android_support_support_media_compat_25_3_1.xml │ │ ├── com_android_support_support_v4_25_3_1.xml │ │ ├── com_android_support_support_vector_drawable_25_3_1.xml │ │ ├── com_android_support_test_espresso_espresso_core_2_2_2.xml │ │ ├── com_android_support_test_espresso_espresso_idling_resource_2_2_2.xml │ │ ├── com_android_support_test_exposed_instrumentation_api_publish_0_5.xml │ │ ├── com_android_support_test_rules_0_5.xml │ │ ├── com_android_support_test_runner_0_5.xml │ │ ├── com_google_code_findbugs_jsr305_2_0_1_jar.xml │ │ ├── com_squareup_javawriter_2_1_1_jar.xml │ │ ├── javax_annotation_javax_annotation_api_1_2_jar.xml │ │ ├── javax_inject_javax_inject_1_jar.xml │ │ ├── junit_junit_4_12_jar.xml │ │ ├── org_hamcrest_hamcrest_core_1_3_jar.xml │ │ ├── org_hamcrest_hamcrest_integration_1_3_jar.xml │ │ └── org_hamcrest_hamcrest_library_1_3_jar.xml │ ├── misc.xml │ ├── modules.xml │ ├── runConfigurations.xml │ └── workspace.xml ├── MyApplication.iml ├── app │ ├── .gitignore │ ├── app.iml │ ├── build.gradle │ ├── proguard-rules.pro │ └── src │ │ ├── androidTest │ │ └── java │ │ │ └── com │ │ │ └── ctrip │ │ │ └── zhshan │ │ │ └── myapplication │ │ │ └── ExampleInstrumentedTest.java │ │ ├── main │ │ ├── AndroidManifest.xml │ │ ├── java │ │ │ └── com │ │ │ │ └── ctrip │ │ │ │ └── zhshan │ │ │ │ └── myapplication │ │ │ │ ├── airStop │ │ │ │ ├── AirStopActivity.java │ │ │ │ ├── CommonUtil.java │ │ │ │ └── NestedScrollView.java │ │ │ │ ├── headerScrollView │ │ │ │ ├── HeaderScrollHelper.java │ │ │ │ └── HeaderScrollView.java │ │ │ │ ├── newSolution │ │ │ │ └── SolutionActivity.java │ │ │ │ └── oldSolution │ │ │ │ ├── CommonUtils.java │ │ │ │ ├── HoveringAdapter.java │ │ │ │ ├── MainActivity.java │ │ │ │ └── MyScrollView.java │ │ └── res │ │ │ ├── drawable │ │ │ ├── cttour_around_travel_border_corner.xml │ │ │ └── ic_launcher.jpg │ │ │ ├── layout │ │ │ ├── activity_hover.xml │ │ │ ├── air_stop_fragment_layout.xml │ │ │ ├── cttour_arount_travel_viewholder_content_layout.xml │ │ │ ├── cttour_arount_travel_viewholder_footer_layout.xml │ │ │ ├── cttour_arount_travel_viewholder_head_layout.xml │ │ │ ├── cttour_vacation_detail_schedule_item.xml │ │ │ └── solution_activity_layout.xml │ │ │ ├── mipmap-hdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-mdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ └── values │ │ │ ├── attrs.xml │ │ │ ├── colors.xml │ │ │ ├── strings.xml │ │ │ └── styles.xml │ │ └── test │ │ └── java │ │ └── com │ │ └── ctrip │ │ └── zhshan │ │ └── myapplication │ │ └── ExampleUnitTest.java ├── build.gradle ├── build │ ├── android-profile │ │ ├── profile-2018-03-19-17-34-07-721.rawproto │ │ ├── profile-2018-03-19-17-34-15-556.rawproto │ │ ├── profile-2018-03-19-17-51-27-951.rawproto │ │ ├── profile-2018-03-19-17-51-49-836.rawproto │ │ ├── profile-2018-03-19-17-52-06-660.rawproto │ │ ├── profile-2018-03-19-17-53-04-850.rawproto │ │ ├── profile-2018-03-19-17-56-25-707.rawproto │ │ ├── profile-2018-03-19-17-59-30-476.rawproto │ │ ├── profile-2018-03-19-18-05-58-643.rawproto │ │ ├── profile-2018-03-19-18-08-30-443.rawproto │ │ ├── profile-2018-03-19-18-10-45-588.rawproto │ │ ├── profile-2018-03-19-18-30-59-513.rawproto │ │ ├── profile-2018-03-19-18-34-37-391.rawproto │ │ ├── profile-2018-03-19-18-35-25-400.rawproto │ │ ├── profile-2018-03-19-18-37-25-248.rawproto │ │ ├── profile-2018-03-19-18-38-25-180.rawproto │ │ ├── profile-2018-03-19-18-39-31-497.rawproto │ │ ├── profile-2018-03-19-18-44-58-856.rawproto │ │ ├── profile-2018-03-19-18-47-13-986.rawproto │ │ └── profile-2018-03-19-18-49-14-570.rawproto │ ├── generated │ │ └── mockable-android-25.jar │ └── intermediates │ │ └── dex-cache │ │ └── cache.xml ├── gradle.properties ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── local.properties └── settings.gradle └── README.md /MyApplication/.gradle/3.3/taskArtifacts/fileHashes.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colinNaive/RecyclerViewScrollView/e56b7f7813cc81c12e252ff6b313a60e2055a0de/MyApplication/.gradle/3.3/taskArtifacts/fileHashes.bin -------------------------------------------------------------------------------- /MyApplication/.gradle/3.3/taskArtifacts/fileSnapshots.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colinNaive/RecyclerViewScrollView/e56b7f7813cc81c12e252ff6b313a60e2055a0de/MyApplication/.gradle/3.3/taskArtifacts/fileSnapshots.bin -------------------------------------------------------------------------------- /MyApplication/.gradle/3.3/taskArtifacts/taskArtifacts.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colinNaive/RecyclerViewScrollView/e56b7f7813cc81c12e252ff6b313a60e2055a0de/MyApplication/.gradle/3.3/taskArtifacts/taskArtifacts.bin -------------------------------------------------------------------------------- /MyApplication/.gradle/3.3/taskArtifacts/taskArtifacts.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colinNaive/RecyclerViewScrollView/e56b7f7813cc81c12e252ff6b313a60e2055a0de/MyApplication/.gradle/3.3/taskArtifacts/taskArtifacts.lock -------------------------------------------------------------------------------- /MyApplication/.gradle/3.3/tasks/_app_compileDebugJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colinNaive/RecyclerViewScrollView/e56b7f7813cc81c12e252ff6b313a60e2055a0de/MyApplication/.gradle/3.3/tasks/_app_compileDebugJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.bin -------------------------------------------------------------------------------- /MyApplication/.gradle/3.3/tasks/_app_compileDebugJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colinNaive/RecyclerViewScrollView/e56b7f7813cc81c12e252ff6b313a60e2055a0de/MyApplication/.gradle/3.3/tasks/_app_compileDebugJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.lock -------------------------------------------------------------------------------- /MyApplication/.gradle/3.3/tasks/_app_compileDebugJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colinNaive/RecyclerViewScrollView/e56b7f7813cc81c12e252ff6b313a60e2055a0de/MyApplication/.gradle/3.3/tasks/_app_compileDebugJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.bin -------------------------------------------------------------------------------- /MyApplication/.gradle/3.3/tasks/_app_compileDebugJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colinNaive/RecyclerViewScrollView/e56b7f7813cc81c12e252ff6b313a60e2055a0de/MyApplication/.gradle/3.3/tasks/_app_compileDebugJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.lock -------------------------------------------------------------------------------- /MyApplication/.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 17 | 18 | -------------------------------------------------------------------------------- /MyApplication/.idea/libraries/com_android_support_animated_vector_drawable_25_3_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /MyApplication/.idea/libraries/com_android_support_appcompat_v7_25_3_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /MyApplication/.idea/libraries/com_android_support_constraint_constraint_layout_1_0_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /MyApplication/.idea/libraries/com_android_support_constraint_constraint_layout_solver_1_0_2_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /MyApplication/.idea/libraries/com_android_support_recyclerview_v7_25_3_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /MyApplication/.idea/libraries/com_android_support_support_annotations_25_3_1_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /MyApplication/.idea/libraries/com_android_support_support_compat_25_3_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /MyApplication/.idea/libraries/com_android_support_support_core_ui_25_3_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /MyApplication/.idea/libraries/com_android_support_support_core_utils_25_3_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /MyApplication/.idea/libraries/com_android_support_support_fragment_25_3_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /MyApplication/.idea/libraries/com_android_support_support_media_compat_25_3_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /MyApplication/.idea/libraries/com_android_support_support_v4_25_3_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /MyApplication/.idea/libraries/com_android_support_support_vector_drawable_25_3_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /MyApplication/.idea/libraries/com_android_support_test_espresso_espresso_core_2_2_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /MyApplication/.idea/libraries/com_android_support_test_espresso_espresso_idling_resource_2_2_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /MyApplication/.idea/libraries/com_android_support_test_exposed_instrumentation_api_publish_0_5.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /MyApplication/.idea/libraries/com_android_support_test_rules_0_5.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /MyApplication/.idea/libraries/com_android_support_test_runner_0_5.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /MyApplication/.idea/libraries/com_google_code_findbugs_jsr305_2_0_1_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /MyApplication/.idea/libraries/com_squareup_javawriter_2_1_1_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /MyApplication/.idea/libraries/javax_annotation_javax_annotation_api_1_2_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /MyApplication/.idea/libraries/javax_inject_javax_inject_1_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /MyApplication/.idea/libraries/junit_junit_4_12_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /MyApplication/.idea/libraries/org_hamcrest_hamcrest_core_1_3_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /MyApplication/.idea/libraries/org_hamcrest_hamcrest_integration_1_3_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /MyApplication/.idea/libraries/org_hamcrest_hamcrest_library_1_3_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /MyApplication/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 16 | 26 | 27 | 28 | 29 | 30 | 31 | 33 | -------------------------------------------------------------------------------- /MyApplication/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /MyApplication/.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /MyApplication/MyApplication.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /MyApplication/app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /MyApplication/app/app.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 8 | 9 | 10 | 11 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | -------------------------------------------------------------------------------- /MyApplication/app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 25 5 | buildToolsVersion "25.0.3" 6 | defaultConfig { 7 | applicationId "com.ctrip.zhshan.myapplication" 8 | minSdkVersion 19 9 | targetSdkVersion 25 10 | versionCode 1 11 | versionName "1.0" 12 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 13 | } 14 | buildTypes { 15 | release { 16 | minifyEnabled false 17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 18 | } 19 | } 20 | } 21 | 22 | dependencies { 23 | compile fileTree(dir: 'libs', include: ['*.jar']) 24 | androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { 25 | exclude group: 'com.android.support', module: 'support-annotations' 26 | }) 27 | compile 'com.android.support.constraint:constraint-layout:1.0.2' 28 | compile 'com.android.support:appcompat-v7:25.3.1' 29 | compile 'com.android.support:recyclerview-v7:25.3.1' 30 | testCompile 'junit:junit:4.12' 31 | } 32 | -------------------------------------------------------------------------------- /MyApplication/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in D:\Softwares\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 | 19 | # Uncomment this to preserve the line number information for 20 | # debugging stack traces. 21 | #-keepattributes SourceFile,LineNumberTable 22 | 23 | # If you keep the line number information, uncomment this to 24 | # hide the original source file name. 25 | #-renamesourcefileattribute SourceFile 26 | -------------------------------------------------------------------------------- /MyApplication/app/src/androidTest/java/com/ctrip/zhshan/myapplication/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package com.ctrip.zhshan.myapplication; 2 | 3 | import android.content.Context; 4 | import android.support.test.InstrumentationRegistry; 5 | import android.support.test.runner.AndroidJUnit4; 6 | 7 | import org.junit.Test; 8 | import org.junit.runner.RunWith; 9 | 10 | import static org.junit.Assert.*; 11 | 12 | /** 13 | * Instrumentation test, which will execute on an Android device. 14 | * 15 | * @see Testing documentation 16 | */ 17 | @RunWith(AndroidJUnit4.class) 18 | public class ExampleInstrumentedTest { 19 | @Test 20 | public void useAppContext() throws Exception { 21 | // Context of the app under test. 22 | Context appContext = InstrumentationRegistry.getTargetContext(); 23 | 24 | assertEquals("com.ctrip.zhshan.myapplication", appContext.getPackageName()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /MyApplication/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /MyApplication/app/src/main/java/com/ctrip/zhshan/myapplication/airStop/AirStopActivity.java: -------------------------------------------------------------------------------- 1 | package com.ctrip.zhshan.myapplication.airStop; 2 | 3 | import android.content.Context; 4 | import android.os.Bundle; 5 | import android.support.v7.app.AppCompatActivity; 6 | import android.view.LayoutInflater; 7 | import android.view.View; 8 | import android.widget.HorizontalScrollView; 9 | import android.widget.LinearLayout; 10 | import android.widget.TextView; 11 | 12 | import com.ctrip.zhshan.myapplication.R; 13 | 14 | /** 15 | * @author Zhenhua on 2018/3/20. 16 | * @email zhshan@ctrip.com ^.^ 17 | */ 18 | 19 | public class AirStopActivity extends AppCompatActivity { 20 | private NestedScrollView mCustomScrollView; 21 | private LinearLayout mTargetContentContainer; 22 | private LinearLayout mOldContentContainer; 23 | private LinearLayout mNewContentContainer; 24 | private HorizontalScrollView mTargetHorizontalScrollView; 25 | 26 | @Override 27 | protected void onCreate(Bundle savedInstanceState) { 28 | super.onCreate(savedInstanceState); 29 | setContentView(R.layout.air_stop_fragment_layout); 30 | init(); 31 | } 32 | 33 | private void init() { 34 | mCustomScrollView = (NestedScrollView) findViewById(R.id.scrollview); 35 | mOldContentContainer = (LinearLayout) findViewById(R.id.horizontal_content); 36 | mTargetContentContainer = (LinearLayout) findViewById(R.id.target_content); 37 | mTargetHorizontalScrollView = (HorizontalScrollView) findViewById(R.id.target_horizontal_scrollview); 38 | initHorizontalScrollView(mTargetContentContainer); 39 | mNewContentContainer = (LinearLayout) findViewById(R.id.horizontal_content_new); 40 | mCustomScrollView.setFixListener(new NestedScrollView.OnFixListener() { 41 | @Override 42 | public void onFix() { 43 | mOldContentContainer.removeView(mTargetHorizontalScrollView); 44 | mNewContentContainer.addView(mTargetHorizontalScrollView); 45 | } 46 | 47 | @Override 48 | public void onDismiss() { 49 | mNewContentContainer.removeView(mTargetHorizontalScrollView); 50 | mOldContentContainer.addView(mTargetHorizontalScrollView); 51 | } 52 | }); 53 | } 54 | 55 | private void initHorizontalScrollView(LinearLayout schedules) { 56 | LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(CommonUtil.dp2px(this, 65), CommonUtil.dp2px(this, 40)); 57 | lp.rightMargin = CommonUtil.dp2px(this, 5f); 58 | lp.leftMargin = CommonUtil.dp2px(this, 5f); 59 | 60 | //情况ScrollView数据 61 | schedules.removeAllViews(); 62 | 63 | //填充ScrollView数据 64 | for (int i = 0; i < 10; i++) { 65 | View item = LayoutInflater.from(this).inflate(R.layout.cttour_vacation_detail_schedule_item, null); 66 | TextView date = (TextView) item.findViewById(R.id.date); 67 | TextView price = (TextView) item.findViewById(R.id.price); 68 | 69 | date.setText("劳动节"); 70 | price.setText("5月1号"); 71 | 72 | schedules.addView(item, lp); 73 | } 74 | } 75 | } 76 | 77 | -------------------------------------------------------------------------------- /MyApplication/app/src/main/java/com/ctrip/zhshan/myapplication/airStop/CommonUtil.java: -------------------------------------------------------------------------------- 1 | package com.ctrip.zhshan.myapplication.airStop; 2 | 3 | import android.content.Context; 4 | import android.graphics.Bitmap; 5 | import android.graphics.BitmapFactory; 6 | import android.util.Base64; 7 | 8 | import java.io.ByteArrayOutputStream; 9 | import java.lang.reflect.Field; 10 | 11 | /** 12 | * Created by xhhe on 2015/12/21. 13 | */ 14 | public class CommonUtil { 15 | 16 | public static String Version = "70700"; 17 | 18 | /** 19 | * 得到屏幕的宽度 20 | * 21 | * @param context 22 | * @return 23 | */ 24 | public static int getScreenWidth(Context context) { 25 | if (null == context) { 26 | return 0; 27 | } 28 | return context.getResources().getDisplayMetrics().widthPixels; 29 | } 30 | 31 | /** 32 | * 得到屏幕的高度 33 | * 34 | * @param context 35 | * @return 36 | */ 37 | public static int getScreenHeight(Context context) { 38 | if (null == context) { 39 | return 0; 40 | } 41 | return context.getResources().getDisplayMetrics().heightPixels; 42 | } 43 | 44 | /** 45 | * 根据手机的分辨率从 dp 的单位 转成为 px(像素) 46 | */ 47 | public static int dp2px(Context context, float dpValue) { 48 | if (null == context) { 49 | return 0; 50 | } 51 | final float scale = context.getResources().getDisplayMetrics().density; 52 | return (int) (dpValue * scale + 0.5f); 53 | } 54 | 55 | /** 56 | * 将sp值转换为px值,保证文字大小不变 57 | * @param context 58 | * @param spValue 59 | * @return 60 | */ 61 | public static int sp2px(Context context, float spValue) { 62 | if (null == context) { 63 | return 0; 64 | } 65 | final float fontScale = context.getResources().getDisplayMetrics().scaledDensity; 66 | return (int) (spValue * fontScale + 0.5f); 67 | } 68 | 69 | /** 70 | * 使用java正则表达式去掉多余的.与0 71 | * 72 | * @param s 73 | * @return 74 | */ 75 | public static String subZeroAndDot(String s) { 76 | if (s == null) return ""; 77 | if (s.indexOf(".") > 0) { 78 | s = s.replaceAll("0+?$", "");//去掉多余的0 79 | s = s.replaceAll("[.]$", "");//如最后一位是.则去掉 80 | } 81 | return s; 82 | } 83 | /** 84 | * 获取状态栏的高度 85 | * @param context 86 | * @return 87 | */ 88 | public static int getBarHeight(Context context){ 89 | Class c = null; 90 | Object obj = null; 91 | Field field = null; 92 | int x = 0, sbar = 38;//默认为38,貌似大部分是这样的 93 | 94 | try { 95 | c = Class.forName("com.android.internal.R$dimen"); 96 | obj = c.newInstance(); 97 | field = c.getField("status_bar_height"); 98 | x = Integer.parseInt(field.get(obj).toString()); 99 | sbar = context.getResources().getDimensionPixelSize(x); 100 | 101 | } catch (Exception e1) { 102 | e1.printStackTrace(); 103 | } 104 | return sbar; 105 | } 106 | /** 107 | * convert base64 to bitmap 108 | * @author Zhenhua created at 2016/11/14 16:48 109 | */ 110 | public static Bitmap base64ToBitmap(String b){ 111 | Bitmap bitmap = null; 112 | try { 113 | byte[] bytes = Base64.decode(b, Base64.DEFAULT); 114 | bitmap = BitmapFactory.decodeByteArray(bytes,0,bytes.length); 115 | }catch (Exception e){ 116 | bitmap = null; 117 | } 118 | 119 | return bitmap; 120 | } 121 | /** 122 | * convert bitmap to base64 123 | * @author Zhenhua created at 2016/11/14 16:48 124 | */ 125 | public static String bitmapToBase64(Bitmap bitmap){ 126 | String b = null; 127 | ByteArrayOutputStream output = null; 128 | try { 129 | output = new ByteArrayOutputStream(); 130 | bitmap.compress(Bitmap.CompressFormat.PNG, 100, output); 131 | byte[] result = output.toByteArray(); 132 | b = Base64.encodeToString(result, Base64.DEFAULT); 133 | }catch (Exception e){ 134 | b = null; 135 | }finally { 136 | try { 137 | output.close(); 138 | }catch (Exception ignored){ 139 | 140 | } 141 | } 142 | return b; 143 | } 144 | 145 | } 146 | -------------------------------------------------------------------------------- /MyApplication/app/src/main/java/com/ctrip/zhshan/myapplication/airStop/NestedScrollView.java: -------------------------------------------------------------------------------- 1 | package com.ctrip.zhshan.myapplication.airStop; 2 | 3 | import android.content.Context; 4 | import android.graphics.Canvas; 5 | import android.util.AttributeSet; 6 | import android.view.MotionEvent; 7 | import android.view.View; 8 | import android.widget.LinearLayout; 9 | import android.widget.ScrollView; 10 | 11 | 12 | /** 13 | * @author Zhenhua on 2017/6/2 09:46. 14 | * @email zhshan@ctrip.com 15 | */ 16 | 17 | public class NestedScrollView extends ScrollView { 18 | private View fixView; 19 | private OnFixListener listener; 20 | private boolean fixed; 21 | 22 | 23 | public NestedScrollView(Context context) { 24 | super(context); 25 | } 26 | 27 | public NestedScrollView(Context context, AttributeSet attrs) { 28 | super(context, attrs); 29 | } 30 | 31 | @Override 32 | protected void dispatchDraw(Canvas canvas) { 33 | super.dispatchDraw(canvas); 34 | if (getScrollY() >= fixView.getTop()) { 35 | fix(); 36 | } else { 37 | dismiss(); 38 | } 39 | } 40 | 41 | @Override 42 | protected void onLayout(boolean changed, int l, int t, int r, int b) { 43 | super.onLayout(changed, l, t, r, b); 44 | if (changed) { 45 | LinearLayout linearLayout = (LinearLayout) getChildAt(0); 46 | if (linearLayout != null) { 47 | for (int i = 0; i < linearLayout.getChildCount(); i++) { 48 | if (linearLayout.getChildAt(i).getTag() != null && linearLayout.getChildAt(i).getTag().equals("fix")) { 49 | fixView = linearLayout.getChildAt(i); 50 | } 51 | } 52 | } 53 | } 54 | } 55 | 56 | public void setFixListener(OnFixListener listener) { 57 | this.listener = listener; 58 | } 59 | 60 | private void fix() { 61 | if (listener != null && !fixed) { 62 | listener.onFix(); 63 | fixed = true; 64 | } 65 | } 66 | 67 | private void dismiss() { 68 | if (listener != null && fixed) { 69 | listener.onDismiss(); 70 | fixed = false; 71 | } 72 | } 73 | 74 | @Override 75 | public boolean dispatchTouchEvent(MotionEvent ev) { 76 | return super.dispatchTouchEvent(ev); 77 | } 78 | 79 | @Override 80 | public boolean onInterceptTouchEvent(MotionEvent ev) { 81 | return super.onInterceptTouchEvent(ev); 82 | } 83 | 84 | public interface OnFixListener { 85 | void onFix(); 86 | 87 | void onDismiss(); 88 | } 89 | 90 | } 91 | -------------------------------------------------------------------------------- /MyApplication/app/src/main/java/com/ctrip/zhshan/myapplication/headerScrollView/HeaderScrollHelper.java: -------------------------------------------------------------------------------- 1 | package com.ctrip.zhshan.myapplication.headerScrollView; 2 | 3 | import android.annotation.SuppressLint; 4 | import android.os.Build; 5 | import android.support.v7.widget.LinearLayoutManager; 6 | import android.support.v7.widget.RecyclerView; 7 | import android.view.View; 8 | import android.webkit.WebView; 9 | import android.widget.AbsListView; 10 | import android.widget.AdapterView; 11 | import android.widget.ScrollView; 12 | 13 | /** 14 | * @author Zhenhua on 2018/03/19 15 | * @email zhshan@ctrip.com ^.^ 16 | */ 17 | public class HeaderScrollHelper { 18 | 19 | private int sysVersion; //当前sdk版本,用于判断api版本 20 | private ScrollableContainer mCurrentScrollableContainer; 21 | 22 | public HeaderScrollHelper() { 23 | sysVersion = Build.VERSION.SDK_INT; 24 | } 25 | 26 | /** 包含有 ScrollView ListView RecyclerView 的组件 */ 27 | public interface ScrollableContainer { 28 | 29 | /** @return ScrollView ListView RecyclerView 或者其他的布局的实例 */ 30 | View getScrollableView(); 31 | } 32 | 33 | public void setCurrentScrollableContainer(ScrollableContainer scrollableContainer) { 34 | this.mCurrentScrollableContainer = scrollableContainer; 35 | } 36 | 37 | private View getScrollableView() { 38 | if (mCurrentScrollableContainer == null) return null; 39 | return mCurrentScrollableContainer.getScrollableView(); 40 | } 41 | 42 | /** 43 | * 判断是否滑动到顶部方法,ScrollAbleLayout根据此方法来做一些逻辑判断 44 | * 目前只实现了AdapterView,ScrollView,RecyclerView 45 | * 需要支持其他view可以自行补充实现 46 | */ 47 | public boolean isTop() { 48 | View scrollableView = getScrollableView(); 49 | if (scrollableView == null) { 50 | throw new NullPointerException("You should call ScrollableHelper.setCurrentScrollableContainer() to set ScrollableContainer."); 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 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 || (firstVisibleItemPosition == 0 && childAt.getTop() == 0)) { 74 | return true; 75 | } 76 | } 77 | } 78 | return false; 79 | } 80 | 81 | private boolean isAdapterViewTop(AdapterView adapterView) { 82 | if (adapterView != null) { 83 | int firstVisiblePosition = adapterView.getFirstVisiblePosition(); 84 | View childAt = adapterView.getChildAt(0); 85 | if (childAt == null || (firstVisiblePosition == 0 && childAt.getTop() == 0)) { 86 | return true; 87 | } 88 | } 89 | return false; 90 | } 91 | 92 | private boolean isScrollViewTop(ScrollView scrollView) { 93 | if (scrollView != null) { 94 | int scrollViewY = scrollView.getScrollY(); 95 | return scrollViewY <= 0; 96 | } 97 | return false; 98 | } 99 | 100 | private boolean isWebViewTop(WebView scrollView) { 101 | if (scrollView != null) { 102 | int scrollViewY = scrollView.getScrollY(); 103 | return scrollViewY <= 0; 104 | } 105 | return false; 106 | } 107 | 108 | /** 109 | * 将特定的view按照初始条件滚动 110 | * 111 | * @param velocityY 初始滚动速度 112 | * @param distance 需要滚动的距离 113 | * @param duration 允许滚动的时间 114 | */ 115 | @SuppressLint("NewApi") 116 | public void smoothScrollBy(int velocityY, int distance, int duration) { 117 | View scrollableView = getScrollableView(); 118 | if (scrollableView instanceof AbsListView) { 119 | AbsListView absListView = (AbsListView) scrollableView; 120 | if (sysVersion >= 21) { 121 | absListView.fling(velocityY); 122 | } else { 123 | absListView.smoothScrollBy(distance, duration); 124 | } 125 | } else if (scrollableView instanceof ScrollView) { 126 | ((ScrollView) scrollableView).fling(velocityY); 127 | } else if (scrollableView instanceof RecyclerView) { 128 | ((RecyclerView) scrollableView).fling(0, velocityY); 129 | } else if (scrollableView instanceof WebView) { 130 | ((WebView) scrollableView).flingScroll(0, velocityY); 131 | } 132 | } 133 | } 134 | -------------------------------------------------------------------------------- /MyApplication/app/src/main/java/com/ctrip/zhshan/myapplication/headerScrollView/HeaderScrollView.java: -------------------------------------------------------------------------------- 1 | package com.ctrip.zhshan.myapplication.headerScrollView; 2 | 3 | import android.annotation.SuppressLint; 4 | import android.content.Context; 5 | import android.content.res.TypedArray; 6 | import android.os.Build; 7 | import android.util.AttributeSet; 8 | import android.view.MotionEvent; 9 | import android.view.VelocityTracker; 10 | import android.view.View; 11 | import android.view.ViewConfiguration; 12 | import android.widget.LinearLayout; 13 | import android.widget.Scroller; 14 | 15 | import com.ctrip.zhshan.myapplication.R; 16 | 17 | /** 18 | * @author Zhenhua on 2018/03/19 19 | * @email zhshan@ctrip.com ^.^ 20 | */ 21 | public class HeaderScrollView extends LinearLayout { 22 | 23 | private static final int DIRECTION_UP = 1; 24 | private static final int DIRECTION_DOWN = 2; 25 | 26 | private int topOffset = 0; //滚动的最大偏移量 27 | 28 | private Scroller mScroller; 29 | private int mTouchSlop; //表示滑动的时候,手的移动要大于这个距离才开始移动控件。 30 | private int mMinimumVelocity; //允许执行一个fling手势动作的最小速度值 31 | private int mMaximumVelocity; //允许执行一个fling手势动作的最大速度值 32 | private int sysVersion; //当前sdk版本,用于判断api版本 33 | private View mHeadView; //需要被滑出的头部 34 | private int mHeadHeight; //滑出头部的高度 35 | private int maxY = 0; //最大滑出的距离,等于 mHeadHeight 36 | private int minY = 0; //最小的距离, 头部在最顶部 37 | private int mCurY; //当前已经滚动的距离 38 | private VelocityTracker mVelocityTracker; 39 | private int mDirection; 40 | private int mLastScrollerY; 41 | private boolean mDisallowIntercept; //是否允许拦截事件 42 | private boolean isClickHead; //当前点击区域是否在头部 43 | private OnScrollListener onScrollListener; //滚动的监听 44 | private HeaderScrollHelper mScrollable; 45 | 46 | public interface OnScrollListener { 47 | void onScroll(int currentY, int maxY); 48 | } 49 | 50 | public void setOnScrollListener(OnScrollListener onScrollListener) { 51 | this.onScrollListener = onScrollListener; 52 | } 53 | 54 | public HeaderScrollView(Context context) { 55 | this(context, null); 56 | } 57 | 58 | public HeaderScrollView(Context context, AttributeSet attrs) { 59 | this(context, attrs, 0); 60 | } 61 | 62 | public HeaderScrollView(Context context, AttributeSet attrs, int defStyleAttr) { 63 | super(context, attrs, defStyleAttr); 64 | 65 | TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.CTTourHeaderScrollView); 66 | topOffset = a.getDimensionPixelSize(R.styleable.CTTourHeaderScrollView_top_offset, topOffset); 67 | a.recycle(); 68 | 69 | mScroller = new Scroller(context); 70 | mScrollable = new HeaderScrollHelper(); 71 | ViewConfiguration configuration = ViewConfiguration.get(context); 72 | mTouchSlop = configuration.getScaledTouchSlop(); //表示滑动的时候,手的移动要大于这个距离才开始移动控件。 73 | mMinimumVelocity = configuration.getScaledMinimumFlingVelocity(); //允许执行一个fling手势动作的最小速度值 74 | mMaximumVelocity = configuration.getScaledMaximumFlingVelocity(); //允许执行一个fling手势动作的最大速度值 75 | sysVersion = Build.VERSION.SDK_INT; 76 | } 77 | 78 | @Override 79 | protected void onFinishInflate() { 80 | super.onFinishInflate(); 81 | if (mHeadView != null && !mHeadView.isClickable()) { 82 | mHeadView.setClickable(true); 83 | } 84 | } 85 | 86 | @Override 87 | protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { 88 | mHeadView = getChildAt(0); 89 | measureChildWithMargins(mHeadView, widthMeasureSpec, 0, MeasureSpec.UNSPECIFIED, 0); 90 | mHeadHeight = mHeadView.getMeasuredHeight(); 91 | maxY = mHeadHeight - topOffset; 92 | //让测量高度加上头部的高度 93 | super.onMeasure(widthMeasureSpec, MeasureSpec.makeMeasureSpec(MeasureSpec.getSize(heightMeasureSpec) + maxY, MeasureSpec.EXACTLY)); 94 | } 95 | 96 | /** @param disallowIntercept 作用同 requestDisallowInterceptTouchEvent */ 97 | public void requestHeaderViewPagerDisallowInterceptTouchEvent(boolean disallowIntercept) { 98 | super.requestDisallowInterceptTouchEvent(disallowIntercept); 99 | mDisallowIntercept = disallowIntercept; 100 | } 101 | 102 | private float mDownX; //第一次按下的x坐标 103 | private float mDownY; //第一次按下的y坐标 104 | private float mLastY; //最后一次移动的Y坐标 105 | private boolean verticalScrollFlag = false; //是否允许垂直滚动 106 | 107 | @Override 108 | public boolean dispatchTouchEvent(MotionEvent ev) { 109 | float currentX = ev.getX(); //当前手指相对于当前view的X坐标 110 | float currentY = ev.getY(); //当前手指相对于当前view的Y坐标 111 | float shiftX = Math.abs(currentX - mDownX); //当前触摸位置与第一次按下位置的X偏移量 112 | float shiftY = Math.abs(currentY - mDownY); //当前触摸位置与第一次按下位置的Y偏移量 113 | float deltaY; //滑动的偏移量,即连续两次进入Move的偏移量 114 | obtainVelocityTracker(ev); //初始化速度追踪器 115 | switch (ev.getAction()) { 116 | //Down事件主要初始化变量 117 | case MotionEvent.ACTION_DOWN: 118 | mDisallowIntercept = false; 119 | verticalScrollFlag = false; 120 | mDownX = currentX; 121 | mDownY = currentY; 122 | mLastY = currentY; 123 | checkIsClickHead((int) currentY, mHeadHeight, getScrollY()); 124 | mScroller.abortAnimation(); 125 | break; 126 | case MotionEvent.ACTION_MOVE: 127 | if (mDisallowIntercept) break; 128 | deltaY = mLastY - currentY; //连续两次进入move的偏移量 129 | mLastY = currentY; 130 | if (shiftX > mTouchSlop && shiftX > shiftY) { 131 | //水平滑动 132 | verticalScrollFlag = false; 133 | } else if (shiftY > mTouchSlop && shiftY > shiftX) { 134 | //垂直滑动 135 | verticalScrollFlag = true; 136 | } 137 | /** 138 | * 这里要注意,对于垂直滑动来说,给出以下三个条件 139 | * 头部没有固定,允许滑动的View处于第一条可见,当前按下的点在头部区域 140 | * 三个条件满足一个即表示需要滚动当前布局,否者不处理,将事件交给子View去处理 141 | */ 142 | if (verticalScrollFlag && (!isStickied() || mScrollable.isTop() || isClickHead)) { 143 | //如果是向下滑,则deltaY小于0,对于scrollBy来说 144 | //正值为向上和向左滑,负值为向下和向右滑,这里要注意 145 | scrollBy(0, (int) (deltaY + 0.5)); 146 | invalidate(); 147 | } 148 | break; 149 | case MotionEvent.ACTION_UP: 150 | if (verticalScrollFlag) { 151 | mVelocityTracker.computeCurrentVelocity(1000, mMaximumVelocity); //1000表示单位,每1000毫秒允许滑过的最大距离是mMaximumVelocity 152 | float yVelocity = mVelocityTracker.getYVelocity(); //获取当前的滑动速度 153 | mDirection = yVelocity > 0 ? DIRECTION_DOWN : DIRECTION_UP; //下滑速度大于0,上滑速度小于0 154 | //根据当前的速度和初始化参数,将滑动的惯性初始化到当前View,至于是否滑动当前View,取决于computeScroll中计算的值 155 | //这里不判断最小速度,确保computeScroll一定至少执行一次 156 | mScroller.fling(0, getScrollY(), 0, -(int) yVelocity, 0, 0, -Integer.MAX_VALUE, Integer.MAX_VALUE); 157 | mLastScrollerY = getScrollY(); 158 | invalidate(); //更新界面,该行代码会导致computeScroll中的代码执行 159 | //阻止快读滑动的时候点击事件的发生,滑动的时候,将Up事件改为Cancel就不会发生点击了 160 | if ((shiftX > mTouchSlop || shiftY > mTouchSlop)) { 161 | if (isClickHead || !isStickied()) { 162 | int action = ev.getAction(); 163 | ev.setAction(MotionEvent.ACTION_CANCEL); 164 | boolean dd = super.dispatchTouchEvent(ev); 165 | ev.setAction(action); 166 | return dd; 167 | } 168 | } 169 | } 170 | recycleVelocityTracker(); 171 | break; 172 | case MotionEvent.ACTION_CANCEL: 173 | recycleVelocityTracker(); 174 | break; 175 | default: 176 | break; 177 | } 178 | //手动将事件传递给子View,让子View自己去处理事件 179 | super.dispatchTouchEvent(ev); 180 | //消费事件,返回True表示当前View需要消费事件,就是事件的TargetView 181 | return true; 182 | } 183 | 184 | private void checkIsClickHead(int downY, int headHeight, int scrollY) { 185 | isClickHead = ((downY + scrollY) <= headHeight); 186 | } 187 | 188 | private void obtainVelocityTracker(MotionEvent event) { 189 | if (mVelocityTracker == null) { 190 | mVelocityTracker = VelocityTracker.obtain(); 191 | } 192 | mVelocityTracker.addMovement(event); 193 | } 194 | 195 | private void recycleVelocityTracker() { 196 | if (mVelocityTracker != null) { 197 | mVelocityTracker.recycle(); 198 | mVelocityTracker = null; 199 | } 200 | } 201 | 202 | @Override 203 | public void computeScroll() { 204 | if (mScroller.computeScrollOffset()) { 205 | final int currY = mScroller.getCurrY(); 206 | if (mDirection == DIRECTION_UP) { 207 | // 手势向上划 208 | if (isStickied()) { 209 | //这里主要是将快速滚动时的速度对接起来,让布局看起来滚动连贯 210 | int distance = mScroller.getFinalY() - currY; //除去布局滚动消耗的时间后,剩余的时间 211 | int duration = calcDuration(mScroller.getDuration(), mScroller.timePassed()); //除去布局滚动的距离后,剩余的距离 212 | mScrollable.smoothScrollBy(getScrollerVelocity(distance, duration), distance, duration); 213 | //外层布局已经滚动到指定位置,不需要继续滚动了 214 | mScroller.abortAnimation(); 215 | return; 216 | } else { 217 | scrollTo(0, currY); //将外层布局滚动到指定位置 218 | invalidate(); //移动完后刷新界面 219 | } 220 | } else { 221 | // 手势向下划,内部View已经滚动到顶了,需要滚动外层的View 222 | if (mScrollable.isTop() || isClickHead) { 223 | int deltaY = (currY - mLastScrollerY); 224 | int toY = getScrollY() + deltaY; 225 | scrollTo(0, toY); 226 | if (mCurY <= minY) { 227 | mScroller.abortAnimation(); 228 | return; 229 | } 230 | } 231 | //向下滑动时,初始状态可能不在顶部,所以要一直重绘,让computeScroll一直调用 232 | //确保代码能进入上面的if判断 233 | invalidate(); 234 | } 235 | mLastScrollerY = currY; 236 | } 237 | } 238 | 239 | @SuppressLint("NewApi") 240 | private int getScrollerVelocity(int distance, int duration) { 241 | if (mScroller == null) { 242 | return 0; 243 | } else if (sysVersion >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) { 244 | return (int) mScroller.getCurrVelocity(); 245 | } else { 246 | return distance / duration; 247 | } 248 | } 249 | 250 | /** 对滑动范围做限制 */ 251 | @Override 252 | public void scrollBy(int x, int y) { 253 | int scrollY = getScrollY(); 254 | int toY = scrollY + y; 255 | if (toY >= maxY) { 256 | toY = maxY; 257 | } else if (toY <= minY) { 258 | toY = minY; 259 | } 260 | y = toY - scrollY; 261 | super.scrollBy(x, y); 262 | } 263 | 264 | /** 对滑动范围做限制 */ 265 | @Override 266 | public void scrollTo(int x, int y) { 267 | if (y >= maxY) { 268 | y = maxY; 269 | } else if (y <= minY) { 270 | y = minY; 271 | } 272 | mCurY = y; 273 | if (onScrollListener != null) { 274 | onScrollListener.onScroll(y, maxY); 275 | } 276 | super.scrollTo(x, y); 277 | } 278 | 279 | /** 头部是否已经固定 */ 280 | public boolean isStickied() { 281 | return mCurY == maxY; 282 | } 283 | 284 | private int calcDuration(int duration, int timepass) { 285 | return duration - timepass; 286 | } 287 | 288 | public int getMaxY() { 289 | return maxY; 290 | } 291 | 292 | public boolean isHeadTop() { 293 | return mCurY == minY; 294 | } 295 | 296 | /** 是否允许下拉,与PTR结合使用 */ 297 | public boolean canPtr() { 298 | return verticalScrollFlag && mCurY == minY && mScrollable.isTop(); 299 | } 300 | 301 | public void setTopOffset(int topOffset) { 302 | this.topOffset = topOffset; 303 | } 304 | 305 | public void setCurrentScrollableContainer(HeaderScrollHelper.ScrollableContainer scrollableContainer) { 306 | mScrollable.setCurrentScrollableContainer(scrollableContainer); 307 | } 308 | } -------------------------------------------------------------------------------- /MyApplication/app/src/main/java/com/ctrip/zhshan/myapplication/newSolution/SolutionActivity.java: -------------------------------------------------------------------------------- 1 | package com.ctrip.zhshan.myapplication.newSolution; 2 | 3 | import android.os.Bundle; 4 | import android.support.annotation.Nullable; 5 | import android.support.v7.app.AppCompatActivity; 6 | import android.support.v7.widget.LinearLayoutManager; 7 | import android.support.v7.widget.RecyclerView; 8 | import android.view.View; 9 | import android.widget.LinearLayout; 10 | 11 | import com.ctrip.zhshan.myapplication.R; 12 | import com.ctrip.zhshan.myapplication.headerScrollView.HeaderScrollHelper; 13 | import com.ctrip.zhshan.myapplication.headerScrollView.HeaderScrollView; 14 | import com.ctrip.zhshan.myapplication.oldSolution.CommonUtils; 15 | import com.ctrip.zhshan.myapplication.oldSolution.HoveringAdapter; 16 | 17 | /** 18 | * @author Zhenhua on 2018/3/19. 19 | * @email zhshan@ctrip.com ^.^ 20 | */ 21 | 22 | public class SolutionActivity extends AppCompatActivity implements HeaderScrollHelper.ScrollableContainer { 23 | private RecyclerView recyclerView; 24 | private HeaderScrollView scrollView; 25 | 26 | @Override 27 | protected void onCreate(@Nullable Bundle savedInstanceState) { 28 | super.onCreate(savedInstanceState); 29 | setContentView(R.layout.solution_activity_layout); 30 | scrollView = (HeaderScrollView) findViewById(R.id.view_hover); 31 | recyclerView = (RecyclerView) findViewById(R.id.recyclerview); 32 | scrollView.setCurrentScrollableContainer(this); 33 | recyclerView = (RecyclerView) findViewById(R.id.recyclerview); 34 | LinearLayoutManager manager = new LinearLayoutManager(this); 35 | manager.setOrientation(LinearLayoutManager.VERTICAL); 36 | recyclerView.setLayoutManager(manager); 37 | //设置recyclerview的高度为屏幕高度-状态栏高度-header高度 38 | recyclerView.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, CommonUtils.getScreenHeight(this) - CommonUtils.getBarHeight(this) - CommonUtils.dp2px(this, 55))); 39 | final String[] data = {"header", "content", "content", "content", "content", "content", "content", "content", "content", "content", "content", "footer", 40 | "header", "content", "content", "content", "content", "content", "content", "content", "content", "content", "content", "footer", 41 | "header", "content", "content", "content", "content", "content", "content", "content", "content", "content", "content", "footer"}; 42 | HoveringAdapter adapter = new HoveringAdapter(this, data); 43 | recyclerView.setAdapter(adapter); 44 | 45 | } 46 | 47 | @Override 48 | public View getScrollableView() { 49 | return recyclerView; 50 | } 51 | } 52 | 53 | -------------------------------------------------------------------------------- /MyApplication/app/src/main/java/com/ctrip/zhshan/myapplication/oldSolution/CommonUtils.java: -------------------------------------------------------------------------------- 1 | package com.ctrip.zhshan.myapplication.oldSolution; 2 | 3 | import android.content.Context; 4 | 5 | import java.lang.reflect.Field; 6 | 7 | /** 8 | * @author Zhenhua on 2017/5/25 10:30. 9 | * @email zhshan@ctrip.com 10 | */ 11 | 12 | public class CommonUtils { 13 | public static int getScreenHeight(Context context) { 14 | if (context == null) { 15 | return 0; 16 | } 17 | return context.getResources().getDisplayMetrics().heightPixels; 18 | } 19 | 20 | /** 21 | * 根据手机的分辨率从 dp 的单位 转成为 px(像素) 22 | */ 23 | public static int dp2px(Context context, float dpValue) { 24 | if (null == context) { 25 | return 0; 26 | } 27 | final float scale = context.getResources().getDisplayMetrics().density; 28 | return (int) (dpValue * scale + 0.5f); 29 | } 30 | 31 | /** 32 | * 获取状态栏的高度 33 | * 34 | * @param context 35 | * @return 36 | */ 37 | public static int getBarHeight(Context context) { 38 | Class c = null; 39 | Object obj = null; 40 | Field field = null; 41 | int x = 0, sbar = 38;//默认为38,貌似大部分是这样的 42 | 43 | try { 44 | c = Class.forName("com.android.internal.R$dimen"); 45 | obj = c.newInstance(); 46 | field = c.getField("status_bar_height"); 47 | x = Integer.parseInt(field.get(obj).toString()); 48 | sbar = context.getResources().getDimensionPixelSize(x); 49 | 50 | } catch (Exception e1) { 51 | e1.printStackTrace(); 52 | } 53 | return sbar; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /MyApplication/app/src/main/java/com/ctrip/zhshan/myapplication/oldSolution/HoveringAdapter.java: -------------------------------------------------------------------------------- 1 | package com.ctrip.zhshan.myapplication.oldSolution; 2 | 3 | import android.content.Context; 4 | import android.support.v7.widget.RecyclerView; 5 | import android.view.LayoutInflater; 6 | import android.view.View; 7 | import android.view.ViewGroup; 8 | import android.widget.TextView; 9 | 10 | import com.ctrip.zhshan.myapplication.R; 11 | 12 | /** 13 | * @author Zhenhua on 2017/5/22 17:30. 14 | * @email zhshan@ctrip.com 15 | */ 16 | 17 | public class HoveringAdapter extends RecyclerView.Adapter { 18 | private Context context; 19 | private String[] data; 20 | 21 | private static final int TYPE_HEADER = 1; 22 | private static final int TYPE_CONTENT = 2; 23 | private static final int TYPE_FOOTER = 3; 24 | 25 | public HoveringAdapter(Context context, String[] data) { 26 | this.context = context; 27 | this.data = data; 28 | } 29 | 30 | @Override 31 | public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { 32 | switch (viewType) { 33 | case TYPE_HEADER: 34 | return new HeaderViewHolder(LayoutInflater.from(context).inflate(R.layout.cttour_arount_travel_viewholder_head_layout, parent, false)); 35 | case TYPE_CONTENT: 36 | return new ContentViewHolder(LayoutInflater.from(context).inflate(R.layout.cttour_arount_travel_viewholder_content_layout, parent, false)); 37 | case TYPE_FOOTER: 38 | return new FooterViewHolder(LayoutInflater.from(context).inflate(R.layout.cttour_arount_travel_viewholder_footer_layout, parent, false)); 39 | default: 40 | return new ContentViewHolder(LayoutInflater.from(context).inflate(R.layout.cttour_arount_travel_viewholder_content_layout, parent, false)); 41 | } 42 | } 43 | 44 | @Override 45 | public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) { 46 | if (holder instanceof ContentViewHolder) { 47 | 48 | } else if (holder instanceof HeaderViewHolder){ 49 | 50 | } else if (holder instanceof FooterViewHolder) { 51 | 52 | } 53 | } 54 | 55 | @Override 56 | public int getItemCount() { 57 | return data.length; 58 | } 59 | 60 | @Override 61 | public int getItemViewType(int position) { 62 | switch (data[position]) { 63 | case "header": 64 | return TYPE_HEADER; 65 | case "content": 66 | return TYPE_CONTENT; 67 | case "footer": 68 | return TYPE_FOOTER; 69 | default: 70 | return TYPE_CONTENT; 71 | } 72 | } 73 | 74 | /***********************Multiple Types of ViewHolders****************************/ 75 | public static class HeaderViewHolder extends RecyclerView.ViewHolder{ 76 | 77 | public TextView text; 78 | public HeaderViewHolder(View itemView) { 79 | super(itemView); 80 | text = (TextView)itemView.findViewById(R.id.text); 81 | } 82 | } 83 | 84 | public static class ContentViewHolder extends RecyclerView.ViewHolder { 85 | public ContentViewHolder(View itemView) { 86 | super(itemView); 87 | } 88 | } 89 | 90 | public static class FooterViewHolder extends RecyclerView.ViewHolder { 91 | public FooterViewHolder(View itemView) { 92 | super(itemView); 93 | } 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /MyApplication/app/src/main/java/com/ctrip/zhshan/myapplication/oldSolution/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.ctrip.zhshan.myapplication.oldSolution; 2 | 3 | import android.content.Intent; 4 | import android.support.v7.app.AppCompatActivity; 5 | import android.os.Bundle; 6 | import android.support.v7.widget.LinearLayoutManager; 7 | import android.support.v7.widget.RecyclerView; 8 | import android.view.View; 9 | import android.widget.LinearLayout; 10 | import android.widget.TextView; 11 | 12 | import com.ctrip.zhshan.myapplication.R; 13 | import com.ctrip.zhshan.myapplication.airStop.AirStopActivity; 14 | import com.ctrip.zhshan.myapplication.newSolution.SolutionActivity; 15 | 16 | import java.util.ArrayList; 17 | import java.util.List; 18 | 19 | public class MainActivity extends AppCompatActivity implements MyScrollView.OnFixHeadListener { 20 | private MyScrollView view_hover; 21 | private RecyclerView recyclerView; 22 | private LinearLayout headBarLayout; 23 | private LinearLayoutManager manager; 24 | private boolean fixedFlag = false, resetFlag = false; 25 | private HoveringAdapter adapter; 26 | private List headTitles = new ArrayList<>(); 27 | private int selectPos = 0; 28 | private TextView other,airStop; 29 | 30 | @Override 31 | protected void onCreate(Bundle savedInstanceState) { 32 | super.onCreate(savedInstanceState); 33 | setContentView(R.layout.activity_hover); 34 | view_hover = (MyScrollView) findViewById(R.id.view_hover); 35 | view_hover.setFixHeadListener(this); 36 | headBarLayout = (LinearLayout) findViewById(R.id.head_bar_linear); 37 | findViewById(R.id.click_to).setOnClickListener(new View.OnClickListener() { 38 | @Override 39 | public void onClick(View v) { 40 | clearlyMove2Position(11); 41 | view_hover.post(new Runnable() { 42 | @Override 43 | public void run() { 44 | view_hover.scrollTo(0, headBarLayout.getTop()); 45 | } 46 | }); 47 | } 48 | }); 49 | other = (TextView) findViewById(R.id.other); 50 | other.setOnClickListener(new View.OnClickListener() { 51 | @Override 52 | public void onClick(View v) { 53 | Intent intent = new Intent(MainActivity.this, SolutionActivity.class); 54 | startActivity(intent); 55 | } 56 | }); 57 | 58 | airStop = (TextView) findViewById(R.id.air_stop); 59 | airStop.setOnClickListener(new View.OnClickListener() { 60 | @Override 61 | public void onClick(View v) { 62 | Intent intent = new Intent(MainActivity.this, AirStopActivity.class); 63 | startActivity(intent); 64 | } 65 | }); 66 | 67 | recyclerView = (RecyclerView) findViewById(R.id.recyclerview); 68 | manager = new LinearLayoutManager(this); 69 | manager.setOrientation(LinearLayoutManager.VERTICAL); 70 | recyclerView.setLayoutManager(manager); 71 | recyclerView.setNestedScrollingEnabled(false); 72 | recyclerView.getLayoutParams().height = CommonUtils.getScreenHeight(this) - CommonUtils.dp2px(this, 50); 73 | final String[] data = {"header", "content", "content", "content", "content", "content", "content", "content", "content", "content", "content", "footer", 74 | "header", "content", "content", "content", "content", "content", "content", "content", "content", "content", "content", "footer", 75 | "header", "content", "content", "content", "content", "content", "content", "content", "content", "content", "content", "footer"}; 76 | adapter = new HoveringAdapter(this, data); 77 | recyclerView.setAdapter(adapter); 78 | 79 | recyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() { 80 | @Override 81 | public void onScrollStateChanged(RecyclerView recyclerView, int newState) { 82 | super.onScrollStateChanged(recyclerView, newState); 83 | int last = manager.findLastVisibleItemPosition(); 84 | int first = manager.findFirstVisibleItemPosition(); 85 | int count = manager.getChildCount(); 86 | 87 | System.out.println("first=" + first + ";last=" + last + ";count=" + count); 88 | } 89 | 90 | }); 91 | } 92 | 93 | //move Method without animation 94 | private void clearlyMove2Position(int pos) { 95 | manager.scrollToPositionWithOffset(pos, 0); 96 | manager.setStackFromEnd(false); 97 | } 98 | 99 | @Override 100 | public void onFix() { 101 | enableNestedScrolling(recyclerView); 102 | } 103 | 104 | @Override 105 | public void onReset() { 106 | disableNestedScrolling(recyclerView); 107 | } 108 | 109 | //Enable nested scrolling of recyclerView in ScrollView 110 | private void enableNestedScrolling(RecyclerView recyclerView) { 111 | if (recyclerView != null) { 112 | if (!fixedFlag) { 113 | setFixedFlag(); 114 | recyclerView.setNestedScrollingEnabled(true); 115 | } 116 | } 117 | } 118 | 119 | //Disable nested scrolling of recyclerView in ScrollView 120 | private void disableNestedScrolling(RecyclerView recyclerView) { 121 | if (recyclerView != null) { 122 | if (!resetFlag) { 123 | setResetFlag(); 124 | recyclerView.setNestedScrollingEnabled(false); 125 | } 126 | } 127 | } 128 | 129 | private void setFixedFlag() { 130 | setFlag(false); 131 | } 132 | 133 | private void setResetFlag() { 134 | setFlag(true); 135 | } 136 | 137 | //True:reset;false:fix 138 | private void setFlag(boolean reset) { 139 | if (reset) { 140 | resetFlag = true; 141 | fixedFlag = false; 142 | } else { 143 | fixedFlag = true; 144 | resetFlag = false; 145 | } 146 | } 147 | } 148 | -------------------------------------------------------------------------------- /MyApplication/app/src/main/java/com/ctrip/zhshan/myapplication/oldSolution/MyScrollView.java: -------------------------------------------------------------------------------- 1 | package com.ctrip.zhshan.myapplication.oldSolution; 2 | 3 | import android.content.Context; 4 | import android.graphics.Canvas; 5 | import android.util.AttributeSet; 6 | import android.view.View; 7 | import android.widget.LinearLayout; 8 | import android.widget.ScrollView; 9 | 10 | /** 11 | * @author Zhenhua on 2017/5/24 11:15. 12 | * @email zhshan@ctrip.com 13 | */ 14 | 15 | public class MyScrollView extends ScrollView { 16 | public MyScrollView(Context context) { 17 | super(context); 18 | } 19 | 20 | public MyScrollView(Context context, AttributeSet attrs) { 21 | super(context, attrs); 22 | } 23 | 24 | public MyScrollView(Context context, AttributeSet attrs, int defStyleAttr) { 25 | super(context, attrs, defStyleAttr); 26 | } 27 | 28 | View view; 29 | 30 | @Override 31 | protected void onLayout(boolean changed, int left, int top, int right, int bottom) { 32 | super.onLayout(changed, left, top, right, bottom); 33 | if(changed){ 34 | LinearLayout v = (LinearLayout) getChildAt(0); 35 | if(v != null){ 36 | for(int i=0;i= view.getTop()){ 50 | fixHead(); 51 | canvas.save(); 52 | canvas.translate(0,getScrollY()); 53 | canvas.clipRect(0,0,view.getWidth(),view.getHeight()); 54 | view.draw(canvas); 55 | canvas.restore(); 56 | }else { 57 | resetHead(); 58 | } 59 | } 60 | 61 | 62 | 63 | 64 | private OnFixHeadListener listener; 65 | 66 | private void fixHead() { 67 | if (listener != null) { 68 | listener.onFix(); 69 | } 70 | } 71 | 72 | private void resetHead() { 73 | if (listener != null) { 74 | listener.onReset(); 75 | } 76 | } 77 | 78 | public void setFixHeadListener(OnFixHeadListener listener) { 79 | this.listener = listener; 80 | } 81 | 82 | public interface OnFixHeadListener { 83 | void onFix(); 84 | void onReset(); 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /MyApplication/app/src/main/res/drawable/cttour_around_travel_border_corner.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 13 | 14 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /MyApplication/app/src/main/res/drawable/ic_launcher.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colinNaive/RecyclerViewScrollView/e56b7f7813cc81c12e252ff6b313a60e2055a0de/MyApplication/app/src/main/res/drawable/ic_launcher.jpg -------------------------------------------------------------------------------- /MyApplication/app/src/main/res/layout/activity_hover.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 11 | 12 | 20 | 21 | 25 | 26 | 34 | 35 | 42 | 43 | 52 | 53 | 62 | 63 | 64 | 65 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | -------------------------------------------------------------------------------- /MyApplication/app/src/main/res/layout/air_stop_fragment_layout.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 12 | 13 | 19 | 20 | 24 | 25 | 31 | 32 | 36 | 37 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 54 | 55 | 60 | 61 | 62 | 63 | 64 | 65 | 70 | -------------------------------------------------------------------------------- /MyApplication/app/src/main/res/layout/cttour_arount_travel_viewholder_content_layout.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 17 | 21 | 30 | 31 | 32 | 33 | 37 | 43 | 49 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /MyApplication/app/src/main/res/layout/cttour_arount_travel_viewholder_footer_layout.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 15 | -------------------------------------------------------------------------------- /MyApplication/app/src/main/res/layout/cttour_arount_travel_viewholder_head_layout.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 14 | -------------------------------------------------------------------------------- /MyApplication/app/src/main/res/layout/cttour_vacation_detail_schedule_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 16 | 17 | 25 | -------------------------------------------------------------------------------- /MyApplication/app/src/main/res/layout/solution_activity_layout.xml: -------------------------------------------------------------------------------- 1 | 9 | 10 | 14 | 15 | 21 | 22 | 30 | 31 | 40 | 41 | 50 | 51 | 52 | 53 | 54 | 55 | 60 | 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /MyApplication/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colinNaive/RecyclerViewScrollView/e56b7f7813cc81c12e252ff6b313a60e2055a0de/MyApplication/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /MyApplication/app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colinNaive/RecyclerViewScrollView/e56b7f7813cc81c12e252ff6b313a60e2055a0de/MyApplication/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /MyApplication/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colinNaive/RecyclerViewScrollView/e56b7f7813cc81c12e252ff6b313a60e2055a0de/MyApplication/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /MyApplication/app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colinNaive/RecyclerViewScrollView/e56b7f7813cc81c12e252ff6b313a60e2055a0de/MyApplication/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /MyApplication/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colinNaive/RecyclerViewScrollView/e56b7f7813cc81c12e252ff6b313a60e2055a0de/MyApplication/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /MyApplication/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colinNaive/RecyclerViewScrollView/e56b7f7813cc81c12e252ff6b313a60e2055a0de/MyApplication/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /MyApplication/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colinNaive/RecyclerViewScrollView/e56b7f7813cc81c12e252ff6b313a60e2055a0de/MyApplication/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /MyApplication/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colinNaive/RecyclerViewScrollView/e56b7f7813cc81c12e252ff6b313a60e2055a0de/MyApplication/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /MyApplication/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colinNaive/RecyclerViewScrollView/e56b7f7813cc81c12e252ff6b313a60e2055a0de/MyApplication/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /MyApplication/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colinNaive/RecyclerViewScrollView/e56b7f7813cc81c12e252ff6b313a60e2055a0de/MyApplication/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /MyApplication/app/src/main/res/values/attrs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /MyApplication/app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #3F51B5 4 | #303F9F 5 | #FF4081 6 | 7 | -------------------------------------------------------------------------------- /MyApplication/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | My Application 3 | 4 | -------------------------------------------------------------------------------- /MyApplication/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /MyApplication/app/src/test/java/com/ctrip/zhshan/myapplication/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package com.ctrip.zhshan.myapplication; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * @see Testing documentation 11 | */ 12 | public class ExampleUnitTest { 13 | @Test 14 | public void addition_isCorrect() throws Exception { 15 | assertEquals(4, 2 + 2); 16 | } 17 | } -------------------------------------------------------------------------------- /MyApplication/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.3.2' 9 | 10 | // NOTE: Do not place your application dependencies here; they belong 11 | // in the individual module build.gradle files 12 | } 13 | } 14 | 15 | allprojects { 16 | repositories { 17 | jcenter() 18 | } 19 | } 20 | 21 | task clean(type: Delete) { 22 | delete rootProject.buildDir 23 | } 24 | -------------------------------------------------------------------------------- /MyApplication/build/android-profile/profile-2018-03-19-17-34-07-721.rawproto: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colinNaive/RecyclerViewScrollView/e56b7f7813cc81c12e252ff6b313a60e2055a0de/MyApplication/build/android-profile/profile-2018-03-19-17-34-07-721.rawproto -------------------------------------------------------------------------------- /MyApplication/build/android-profile/profile-2018-03-19-17-34-15-556.rawproto: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colinNaive/RecyclerViewScrollView/e56b7f7813cc81c12e252ff6b313a60e2055a0de/MyApplication/build/android-profile/profile-2018-03-19-17-34-15-556.rawproto -------------------------------------------------------------------------------- /MyApplication/build/android-profile/profile-2018-03-19-17-51-27-951.rawproto: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colinNaive/RecyclerViewScrollView/e56b7f7813cc81c12e252ff6b313a60e2055a0de/MyApplication/build/android-profile/profile-2018-03-19-17-51-27-951.rawproto -------------------------------------------------------------------------------- /MyApplication/build/android-profile/profile-2018-03-19-17-51-49-836.rawproto: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colinNaive/RecyclerViewScrollView/e56b7f7813cc81c12e252ff6b313a60e2055a0de/MyApplication/build/android-profile/profile-2018-03-19-17-51-49-836.rawproto -------------------------------------------------------------------------------- /MyApplication/build/android-profile/profile-2018-03-19-17-52-06-660.rawproto: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colinNaive/RecyclerViewScrollView/e56b7f7813cc81c12e252ff6b313a60e2055a0de/MyApplication/build/android-profile/profile-2018-03-19-17-52-06-660.rawproto -------------------------------------------------------------------------------- /MyApplication/build/android-profile/profile-2018-03-19-17-53-04-850.rawproto: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colinNaive/RecyclerViewScrollView/e56b7f7813cc81c12e252ff6b313a60e2055a0de/MyApplication/build/android-profile/profile-2018-03-19-17-53-04-850.rawproto -------------------------------------------------------------------------------- /MyApplication/build/android-profile/profile-2018-03-19-17-56-25-707.rawproto: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colinNaive/RecyclerViewScrollView/e56b7f7813cc81c12e252ff6b313a60e2055a0de/MyApplication/build/android-profile/profile-2018-03-19-17-56-25-707.rawproto -------------------------------------------------------------------------------- /MyApplication/build/android-profile/profile-2018-03-19-17-59-30-476.rawproto: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colinNaive/RecyclerViewScrollView/e56b7f7813cc81c12e252ff6b313a60e2055a0de/MyApplication/build/android-profile/profile-2018-03-19-17-59-30-476.rawproto -------------------------------------------------------------------------------- /MyApplication/build/android-profile/profile-2018-03-19-18-05-58-643.rawproto: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colinNaive/RecyclerViewScrollView/e56b7f7813cc81c12e252ff6b313a60e2055a0de/MyApplication/build/android-profile/profile-2018-03-19-18-05-58-643.rawproto -------------------------------------------------------------------------------- /MyApplication/build/android-profile/profile-2018-03-19-18-08-30-443.rawproto: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colinNaive/RecyclerViewScrollView/e56b7f7813cc81c12e252ff6b313a60e2055a0de/MyApplication/build/android-profile/profile-2018-03-19-18-08-30-443.rawproto -------------------------------------------------------------------------------- /MyApplication/build/android-profile/profile-2018-03-19-18-10-45-588.rawproto: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colinNaive/RecyclerViewScrollView/e56b7f7813cc81c12e252ff6b313a60e2055a0de/MyApplication/build/android-profile/profile-2018-03-19-18-10-45-588.rawproto -------------------------------------------------------------------------------- /MyApplication/build/android-profile/profile-2018-03-19-18-30-59-513.rawproto: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colinNaive/RecyclerViewScrollView/e56b7f7813cc81c12e252ff6b313a60e2055a0de/MyApplication/build/android-profile/profile-2018-03-19-18-30-59-513.rawproto -------------------------------------------------------------------------------- /MyApplication/build/android-profile/profile-2018-03-19-18-34-37-391.rawproto: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colinNaive/RecyclerViewScrollView/e56b7f7813cc81c12e252ff6b313a60e2055a0de/MyApplication/build/android-profile/profile-2018-03-19-18-34-37-391.rawproto -------------------------------------------------------------------------------- /MyApplication/build/android-profile/profile-2018-03-19-18-35-25-400.rawproto: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colinNaive/RecyclerViewScrollView/e56b7f7813cc81c12e252ff6b313a60e2055a0de/MyApplication/build/android-profile/profile-2018-03-19-18-35-25-400.rawproto -------------------------------------------------------------------------------- /MyApplication/build/android-profile/profile-2018-03-19-18-37-25-248.rawproto: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colinNaive/RecyclerViewScrollView/e56b7f7813cc81c12e252ff6b313a60e2055a0de/MyApplication/build/android-profile/profile-2018-03-19-18-37-25-248.rawproto -------------------------------------------------------------------------------- /MyApplication/build/android-profile/profile-2018-03-19-18-38-25-180.rawproto: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colinNaive/RecyclerViewScrollView/e56b7f7813cc81c12e252ff6b313a60e2055a0de/MyApplication/build/android-profile/profile-2018-03-19-18-38-25-180.rawproto -------------------------------------------------------------------------------- /MyApplication/build/android-profile/profile-2018-03-19-18-39-31-497.rawproto: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colinNaive/RecyclerViewScrollView/e56b7f7813cc81c12e252ff6b313a60e2055a0de/MyApplication/build/android-profile/profile-2018-03-19-18-39-31-497.rawproto -------------------------------------------------------------------------------- /MyApplication/build/android-profile/profile-2018-03-19-18-44-58-856.rawproto: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colinNaive/RecyclerViewScrollView/e56b7f7813cc81c12e252ff6b313a60e2055a0de/MyApplication/build/android-profile/profile-2018-03-19-18-44-58-856.rawproto -------------------------------------------------------------------------------- /MyApplication/build/android-profile/profile-2018-03-19-18-47-13-986.rawproto: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colinNaive/RecyclerViewScrollView/e56b7f7813cc81c12e252ff6b313a60e2055a0de/MyApplication/build/android-profile/profile-2018-03-19-18-47-13-986.rawproto -------------------------------------------------------------------------------- /MyApplication/build/android-profile/profile-2018-03-19-18-49-14-570.rawproto: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colinNaive/RecyclerViewScrollView/e56b7f7813cc81c12e252ff6b313a60e2055a0de/MyApplication/build/android-profile/profile-2018-03-19-18-49-14-570.rawproto -------------------------------------------------------------------------------- /MyApplication/build/generated/mockable-android-25.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colinNaive/RecyclerViewScrollView/e56b7f7813cc81c12e252ff6b313a60e2055a0de/MyApplication/build/generated/mockable-android-25.jar -------------------------------------------------------------------------------- /MyApplication/build/intermediates/dex-cache/cache.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /MyApplication/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 | org.gradle.jvmargs=-Xmx1536m 13 | 14 | # When configured, Gradle will run in incubating parallel mode. 15 | # This option should only be used with decoupled projects. More details, visit 16 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 17 | # org.gradle.parallel=true 18 | -------------------------------------------------------------------------------- /MyApplication/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colinNaive/RecyclerViewScrollView/e56b7f7813cc81c12e252ff6b313a60e2055a0de/MyApplication/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /MyApplication/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri May 26 16:45:35 CST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip 7 | -------------------------------------------------------------------------------- /MyApplication/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 | -------------------------------------------------------------------------------- /MyApplication/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 | -------------------------------------------------------------------------------- /MyApplication/local.properties: -------------------------------------------------------------------------------- 1 | ## This file is automatically generated by Android Studio. 2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED! 3 | # 4 | # This file must *NOT* be checked into Version Control Systems, 5 | # as it contains information specific to your local configuration. 6 | # 7 | # Location of the SDK. This is only used by Gradle. 8 | # For customization when using a Version Control System, please read the 9 | # header note. 10 | #Mon Mar 19 17:34:00 CST 2018 11 | sdk.dir=/Users/colinambitious/Library/Android/sdk 12 | -------------------------------------------------------------------------------- /MyApplication/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 1、解决RecyclerView与ScrollView滑动冲突 2 | 2、实现RecyclerView悬停导航栏 3 | 3、实现RecyclerView置顶item置顶功能 --------------------------------------------------------------------------------