├── .gitignore
├── .idea
├── codeStyles
│ └── Project.xml
├── gradle.xml
├── libraries
│ ├── android_arch_core_common_1_0_0_jar.xml
│ ├── android_arch_lifecycle_common_1_0_0_jar.xml
│ ├── android_arch_lifecycle_runtime_1_0_0.xml
│ ├── com_android_support_animated_vector_drawable_26_1_0.xml
│ ├── com_android_support_appcompat_v7_26_1_0.xml
│ ├── com_android_support_constraint_constraint_layout_1_1_3.xml
│ ├── com_android_support_constraint_constraint_layout_solver_1_1_3_jar.xml
│ ├── com_android_support_design_26_1_0.xml
│ ├── com_android_support_recyclerview_v7_26_1_0.xml
│ ├── com_android_support_support_annotations_26_1_0_jar.xml
│ ├── com_android_support_support_annotations_27_1_1_jar.xml
│ ├── com_android_support_support_compat_26_1_0.xml
│ ├── com_android_support_support_core_ui_26_1_0.xml
│ ├── com_android_support_support_core_utils_26_1_0.xml
│ ├── com_android_support_support_fragment_26_1_0.xml
│ ├── com_android_support_support_media_compat_26_1_0.xml
│ ├── com_android_support_support_v4_26_1_0.xml
│ ├── com_android_support_support_vector_drawable_26_1_0.xml
│ ├── com_android_support_test_espresso_espresso_core_3_0_2.xml
│ ├── com_android_support_test_espresso_espresso_idling_resource_3_0_2.xml
│ ├── com_android_support_test_monitor_1_0_2.xml
│ ├── com_android_support_test_runner_1_0_2.xml
│ ├── com_android_support_transition_26_1_0.xml
│ ├── com_facebook_fresco_drawee_1_13_0.xml
│ ├── com_facebook_fresco_fbcore_1_13_0.xml
│ ├── com_facebook_fresco_fresco_1_13_0.xml
│ ├── com_facebook_fresco_imagepipeline_1_13_0.xml
│ ├── com_facebook_fresco_imagepipeline_base_1_13_0.xml
│ ├── com_facebook_fresco_nativeimagefilters_1_13_0.xml
│ ├── com_facebook_fresco_nativeimagetranscoder_1_13_0.xml
│ ├── com_facebook_soloader_soloader_0_6_0.xml
│ ├── com_google_code_findbugs_jsr305_2_0_1_jar.xml
│ ├── com_parse_bolts_bolts_tasks_1_4_0_jar.xml
│ ├── com_squareup_javawriter_2_1_1_jar.xml
│ ├── javax_inject_javax_inject_1_jar.xml
│ ├── junit_junit_4_12_jar.xml
│ ├── net_sf_kxml_kxml2_2_3_0_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
├── runConfigurations.xml
└── vcs.xml
├── Android_SlidingConflict.iml
├── Android_SlidingConflictDemo.iml
├── README.md
├── app
├── .gitignore
├── app.iml
├── build.gradle
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── example
│ │ └── ruru
│ │ └── android_slidingconflictdemo
│ │ └── ExampleInstrumentedTest.java
│ ├── main
│ ├── AndroidManifest.xml
│ ├── java
│ │ └── com
│ │ │ └── example
│ │ │ └── ruru
│ │ │ └── android_slidingconflictdemo
│ │ │ ├── MainActivity.java
│ │ │ ├── adapter
│ │ │ ├── SubRvAdapter.java
│ │ │ └── SubVpAdapter.java
│ │ │ ├── data
│ │ │ └── DataModel.java
│ │ │ ├── differentDirection
│ │ │ ├── OuterTestActivity.java
│ │ │ ├── SRL_VP.java
│ │ │ ├── VP_LV.java
│ │ │ └── VP_SV.java
│ │ │ ├── differentUI
│ │ │ ├── OutSRL.java
│ │ │ ├── SRL_VP_inner.java
│ │ │ ├── SRL_VP_out_SRL.java
│ │ │ └── SRL_VP_outer.java
│ │ │ ├── fragment
│ │ │ ├── AFragment.java
│ │ │ ├── BFragment.java
│ │ │ ├── CFragment.java
│ │ │ ├── DFragment.java
│ │ │ ├── EFragment.java
│ │ │ ├── FFragment.java
│ │ │ └── GFragment.java
│ │ │ ├── sameDirection
│ │ │ ├── SRL_RV.java
│ │ │ ├── SRL_SV.java
│ │ │ ├── SV_LV.java
│ │ │ ├── SV_RV.java
│ │ │ ├── SV_SV.java
│ │ │ └── VP_VP.java
│ │ │ ├── sameUI
│ │ │ ├── SV_LV_inner.java
│ │ │ ├── SV_LV_outer.java
│ │ │ ├── SV_RV_inner.java
│ │ │ ├── SV_RV_outer.java
│ │ │ ├── SV_SV_inner.java
│ │ │ ├── SV_SV_outer.java
│ │ │ ├── VP_VP_inner.java
│ │ │ └── VP_VP_outer.java
│ │ │ └── test
│ │ │ └── MethodTestActivity.java
│ └── res
│ │ ├── drawable-v24
│ │ └── ic_launcher_foreground.xml
│ │ ├── drawable
│ │ └── ic_launcher_background.xml
│ │ ├── layout
│ │ ├── activity_hsv__lv.xml
│ │ ├── activity_lv_vp.xml
│ │ ├── activity_main.xml
│ │ ├── activity_method_test.xml
│ │ ├── activity_outer_test.xml
│ │ ├── activity_srl_lv.xml
│ │ ├── activity_srl_rv.xml
│ │ ├── activity_srl_sv.xml
│ │ ├── activity_srl_vp.xml
│ │ ├── activity_srl_vp_old.xml
│ │ ├── activity_sv_lv.xml
│ │ ├── activity_sv_rv.xml
│ │ ├── activity_sv_sv.xml
│ │ ├── activity_sv_vp.xml
│ │ ├── activity_vp_lv.xml
│ │ ├── activity_vp_sv_3.xml
│ │ ├── activity_vp_vp.xml
│ │ ├── fragment_a.xml
│ │ ├── fragment_b.xml
│ │ ├── fragment_c.xml
│ │ ├── fragment_d.xml
│ │ ├── fragment_e.xml
│ │ ├── fragment_f.xml
│ │ ├── fragment_g.xml
│ │ └── item.xml
│ │ ├── mipmap-anydpi-v26
│ │ ├── ic_launcher.xml
│ │ └── ic_launcher_round.xml
│ │ ├── mipmap-hdpi
│ │ ├── ic_launcher.png
│ │ ├── ic_launcher_round.png
│ │ └── timg.jpeg
│ │ ├── mipmap-mdpi
│ │ ├── ic_launcher.png
│ │ ├── ic_launcher_round.png
│ │ └── timg.jpeg
│ │ ├── mipmap-xhdpi
│ │ ├── ic_launcher.png
│ │ ├── ic_launcher_round.png
│ │ └── timg.jpeg
│ │ ├── mipmap-xxhdpi
│ │ ├── ic_launcher.png
│ │ ├── ic_launcher_round.png
│ │ └── timg.jpeg
│ │ ├── mipmap-xxxhdpi
│ │ ├── ic_launcher.png
│ │ ├── ic_launcher_round.png
│ │ └── timg.jpeg
│ │ └── values
│ │ ├── colors.xml
│ │ ├── dimens.xml
│ │ ├── strings.xml
│ │ └── styles.xml
│ └── test
│ └── java
│ └── com
│ └── example
│ └── ruru
│ └── android_slidingconflictdemo
│ └── ExampleUnitTest.java
├── build.gradle
├── build
└── android-profile
│ ├── profile-2019-08-07-09-00-35-980.json
│ ├── profile-2019-08-07-09-00-35-980.rawproto
│ ├── profile-2019-08-07-09-00-39-219.json
│ ├── profile-2019-08-07-09-00-39-219.rawproto
│ ├── profile-2019-10-13-17-24-06-199.json
│ ├── profile-2019-10-13-17-24-06-199.rawproto
│ ├── profile-2019-10-13-17-24-16-216.json
│ ├── profile-2019-10-13-17-24-16-216.rawproto
│ ├── profile-2019-10-31-21-50-13-598.json
│ ├── profile-2019-10-31-21-50-13-598.rawproto
│ ├── profile-2019-10-31-21-50-19-877.json
│ ├── profile-2019-10-31-21-50-19-877.rawproto
│ ├── profile-2019-10-31-21-55-02-451.json
│ ├── profile-2019-10-31-21-55-02-451.rawproto
│ ├── profile-2019-10-31-21-55-07-560.json
│ ├── profile-2019-10-31-21-55-07-560.rawproto
│ ├── profile-2019-10-31-22-18-07-464.json
│ ├── profile-2019-10-31-22-18-07-464.rawproto
│ ├── profile-2019-10-31-22-20-17-790.json
│ ├── profile-2019-10-31-22-20-17-790.rawproto
│ ├── profile-2019-10-31-22-20-27-981.json
│ ├── profile-2019-10-31-22-20-27-981.rawproto
│ ├── profile-2019-10-31-22-25-10-371.json
│ ├── profile-2019-10-31-22-25-10-371.rawproto
│ ├── profile-2019-10-31-22-25-59-589.json
│ ├── profile-2019-10-31-22-25-59-589.rawproto
│ ├── profile-2019-10-31-22-26-10-481.json
│ ├── profile-2019-10-31-22-26-10-481.rawproto
│ ├── profile-2019-10-31-22-26-54-538.json
│ ├── profile-2019-10-31-22-26-54-538.rawproto
│ ├── profile-2019-10-31-22-34-54-896.json
│ └── profile-2019-10-31-22-34-54-896.rawproto
├── gradle.properties
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── local.properties
└── settings.gradle
/.gitignore:
--------------------------------------------------------------------------------
1 | # Created by .ignore support plugin (hsz.mobi)
2 |
--------------------------------------------------------------------------------
/.idea/codeStyles/Project.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/.idea/gradle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
11 |
12 |
--------------------------------------------------------------------------------
/.idea/libraries/android_arch_core_common_1_0_0_jar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/.idea/libraries/android_arch_lifecycle_common_1_0_0_jar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/.idea/libraries/android_arch_lifecycle_runtime_1_0_0.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/.idea/libraries/com_android_support_animated_vector_drawable_26_1_0.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/.idea/libraries/com_android_support_appcompat_v7_26_1_0.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/.idea/libraries/com_android_support_constraint_constraint_layout_1_1_3.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/.idea/libraries/com_android_support_constraint_constraint_layout_solver_1_1_3_jar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/.idea/libraries/com_android_support_design_26_1_0.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/.idea/libraries/com_android_support_recyclerview_v7_26_1_0.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/.idea/libraries/com_android_support_support_annotations_26_1_0_jar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/.idea/libraries/com_android_support_support_annotations_27_1_1_jar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/.idea/libraries/com_android_support_support_compat_26_1_0.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/.idea/libraries/com_android_support_support_core_ui_26_1_0.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/.idea/libraries/com_android_support_support_core_utils_26_1_0.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/.idea/libraries/com_android_support_support_fragment_26_1_0.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/.idea/libraries/com_android_support_support_media_compat_26_1_0.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/.idea/libraries/com_android_support_support_v4_26_1_0.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/.idea/libraries/com_android_support_support_vector_drawable_26_1_0.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/.idea/libraries/com_android_support_test_espresso_espresso_core_3_0_2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/.idea/libraries/com_android_support_test_espresso_espresso_idling_resource_3_0_2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/.idea/libraries/com_android_support_test_monitor_1_0_2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/.idea/libraries/com_android_support_test_runner_1_0_2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/.idea/libraries/com_android_support_transition_26_1_0.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/.idea/libraries/com_facebook_fresco_drawee_1_13_0.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/.idea/libraries/com_facebook_fresco_fbcore_1_13_0.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/.idea/libraries/com_facebook_fresco_fresco_1_13_0.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/.idea/libraries/com_facebook_fresco_imagepipeline_1_13_0.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/.idea/libraries/com_facebook_fresco_imagepipeline_base_1_13_0.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/.idea/libraries/com_facebook_fresco_nativeimagefilters_1_13_0.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/.idea/libraries/com_facebook_fresco_nativeimagetranscoder_1_13_0.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/.idea/libraries/com_facebook_soloader_soloader_0_6_0.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/.idea/libraries/com_google_code_findbugs_jsr305_2_0_1_jar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/.idea/libraries/com_parse_bolts_bolts_tasks_1_4_0_jar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/.idea/libraries/com_squareup_javawriter_2_1_1_jar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/.idea/libraries/javax_inject_javax_inject_1_jar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/.idea/libraries/junit_junit_4_12_jar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/.idea/libraries/net_sf_kxml_kxml2_2_3_0_jar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/.idea/libraries/org_hamcrest_hamcrest_core_1_3_jar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/.idea/libraries/org_hamcrest_hamcrest_integration_1_3_jar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/.idea/libraries/org_hamcrest_hamcrest_library_1_3_jar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/.idea/runConfigurations.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Android_SlidingConflict.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/Android_SlidingConflictDemo.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Android_SlidingConflictDemo
2 | ## 同方向和不同方向的Android滑动冲突解决方案
3 |
4 | ### 说明:
5 | 为了文章简洁,下面将用简写代替控件或方法全称。
6 |
7 | 总控件:
8 | * VG 代替 ViewGroup
9 |
10 | 纵向控件:
11 | * SRL 代替 SwipeRefreshLayout
12 | * TL 代替 TabLayout
13 | * SV 代替 ScrollView
14 | * RV 代替 RecyclerView
15 | * LV 代替 ListView
16 |
17 | 横向控件:
18 | * VP 代替 ViewPager
19 | * SM 代替 SlideMenu
20 |
21 |
22 | ### 事件传递:
23 | * disTE 代替 dispatchTouchEvent(事件分发)
24 | * onITE 代替 onInterceptTouchEvent(事件拦截)
25 | * onTE 代替 onTouchEvent(事件消费)
26 | * reDITE 代替 requestDisallowInterceptTouchEvent(子View要求父View不要拦截事件)
27 | * setOTL 代替 setOnTouchListener
28 |
29 |
30 |
31 | 如果大家不了解View的事件分发机制,可以参看文章:
32 |
33 | 深度理解Android事件分发机制:https://www.jianshu.com/p/80a1bb7ced57
34 |
35 | 事件冲突实际上就是对事件分发机制的应用。
36 |
37 |
38 | ### 解决事件冲突总结来看有下列几种方法:
39 | * 父View # onITE 方法:决定事件是否向子View传递。
40 | * 子View # disTE 方法:通过 reDITE 来干预父View事件的分发。
41 | * 子View # setOTL 方法:通过 reDITE 来干预父View事件的分发。
42 | * 注意:标志位在MOVE事件和DOWN事件中都会起作用。
43 |
44 |
45 | ### 滑动冲突分为三种情况:
46 | * 同方向;
47 | * 不同方向;
48 | * 同方向和不同方向混合。
49 |
50 |
51 | ### 同方向:
52 | 核心要点:
53 | * 保证外部滑动的时候只滑动外部,内部滑动的时候只滑动内部。
54 | * 点击事件交给合适的View处理。
55 |
56 | 冲突场景:
57 | * 只有一层能滑动;
58 | * 内外层同时滑动很卡顿。
59 |
60 |
61 |
62 | 1.SRL+SV/RV:没有冲突。
63 |
64 | 分析:
65 |
66 | SRL:重写了onITE方法。向下滑动,Y轴距离大于最小滑动距离,拦截事件,效果正常。
67 |
68 | SV/RV:没有重写disTE方法。向上滚动,效果正常。
69 |
70 |
71 |
72 | 2.SV+SV:有滑动冲突。
73 |
74 | 问题:内部不能滑动。
75 |
76 | 分析:外部Y轴距离大于最小滑动距离,拦截事件,导致内部不能滑动。
77 |
78 |
79 |
80 | 解决:
81 |
82 | **内部拦截:内部滑动时,执行getparent().reDITE(true);**
83 | ```
84 | public class SV_SV_inner extends ScrollView {
85 | public SV_SV_inner(Context context) {
86 | super(context);
87 | }
88 | public SV_SV_inner(Context context, AttributeSet attrs) {
89 | super(context, attrs);
90 | }
91 | @Override
92 | public boolean dispatchTouchEvent(MotionEvent ev) {
93 | getParent().requestDisallowInterceptTouchEvent(true);
94 | return super.dispatchTouchEvent(ev);
95 | }
96 | }
97 | ```
98 |
99 | **外部拦截:**
100 | ```
101 | public class SV_SV_outer extends ScrollView {
102 | public SV_SV_outer(Context context) {
103 | super(context);
104 | }
105 | public SV_SV_outer(Context context, AttributeSet attrs) {
106 | super(context, attrs);
107 | }
108 | @Override
109 | public boolean onInterceptTouchEvent(MotionEvent ev) {
110 | super.onInterceptTouchEvent(ev);
111 | return false;
112 | }
113 | }
114 | ```
115 |
116 |
117 |
118 | 3.SV+RV:有滑动冲突。
119 |
120 | 问题:内层在滑动时,外层也在滑动,滑动很卡顿。
121 |
122 | 分析:
123 |
124 | SV:重写了onInterceptTouchEvent方法。当Y轴移动距离大于最小滑动距离时,就会拦截事件,否则向子View传递。
125 |
126 | RV:没有重写dispatchTouchEvent方法。
127 |
128 |
129 |
130 | 解决:
131 |
132 | **内部拦截:内部滑动时,通过reDITE设置为true使事件向子View分发。**
133 |
134 | 通过打印日志会发现:当内部滑动的时候,外部没有在滑动。效果实现。
135 |
136 | ```
137 | public class SV_RV_inner extends RecyclerView {
138 | public SV_RV_inner(Context context) {
139 | super(context);
140 | }
141 | public SV_RV_inner(Context context, @Nullable AttributeSet attrs) {
142 | super(context, attrs);
143 | }
144 | @Override
145 | public boolean dispatchTouchEvent(MotionEvent ev) {
146 | getParent().requestDisallowInterceptTouchEvent(true);
147 | if (ev.getAction() == MotionEvent.ACTION_MOVE) {
148 | Log.d("SV_RV", "dispatchTouchEvent: 内层在滑动++");
149 | }
150 | return super.dispatchTouchEvent(ev);
151 | }
152 | }
153 | ```
154 |
155 |
156 |
157 | 4.VP+VP:没有滑动冲突。
158 |
159 | 分析:打印日志发现:外部滑动的时候内部没有滑动,内部滑动的时候外部没有滑动。
160 |
161 |
162 |
163 | 综上,同一方向有滑动冲突的有两个例子:
164 | * 只有一层能滑动的例子:SV+SV
165 | * 内外层同时滑动很卡顿的例子:SV+RV
166 |
167 |
168 |
169 | ### 不同方向:
170 |
171 | 核心点:
172 |
173 | 判断谁来拦截:根据滑动是水平滑动还是竖直滑动来判断到底由谁来拦截事件。
174 |
175 | 判断滑动方向:
176 | * 根据滑动过程中两点之间的坐标
177 | * 滑动路径和水平方向所形成的夹角(滑动角度)
178 | * 水平和竖直方向距离差(距离差)(常用)
179 | * 水平和竖直方向速度差(速度差)
180 |
181 | 滑动冲突出现的根本原因:
182 | * 上层View拦截了下层View导致下层View无法滑动。
183 |
184 |
185 |
186 | 1.SRL+VP:
187 |
188 | 问题:VP左下右下滑动时,SRL也在上下滑动。SRL拦截掉了VP的滑动事件。
189 |
190 | 分析:SRL源码:Y轴大于最小滑动距离时,父View拦截事件,否则不拦截。
191 |
192 |
193 |
194 | 解决:
195 |
196 | **内部拦截:**
197 |
198 | SRL_VP_outer:
199 | ```
200 | public class SRL_VP_outer extends SwipeRefreshLayout {
201 | public SRL_VP_outer(Context context) {
202 | super(context);
203 | }
204 | public SRL_VP_outer(Context context, AttributeSet attrs) {
205 | super(context, attrs);
206 | }
207 | @Override
208 | public boolean onInterceptTouchEvent(MotionEvent ev) {
209 | if (ev.getAction() == MotionEvent.ACTION_DOWN) {
210 | super.onInterceptTouchEvent(ev);
211 | return false;
212 | }
213 | return super.onInterceptTouchEvent(ev);
214 | }
215 | }
216 | ```
217 |
218 | SRL_VP_inner:
219 | ```
220 | public class SRL_VP_inner extends ViewPager {
221 | private float startX;
222 | private float startY;
223 | private float x;
224 | private float y;
225 | private float deltaX;
226 | private float deltaY;
227 | public SRL_VP_inner(Context context) {
228 | super(context);
229 | }
230 | public SRL_VP_inner(Context context, AttributeSet attrs) {
231 | super(context, attrs);
232 | }
233 | @Override
234 | public boolean dispatchTouchEvent(MotionEvent ev) {
235 | switch (ev.getAction()) {
236 | case MotionEvent.ACTION_DOWN:
237 | startX = ev.getX();
238 | startY = ev.getY();
239 | //注释1
240 | ViewCompat.setNestedScrollingEnabled(this, true);
241 | getParent().requestDisallowInterceptTouchEvent(true);
242 | break;
243 | case MotionEvent.ACTION_MOVE:
244 | x = ev.getX();
245 | y = ev.getY();
246 | deltaX = Math.abs(x - startX);
247 | deltaY = Math.abs(y - startY);
248 | if (deltaX < deltaY) {
249 | getParent().requestDisallowInterceptTouchEvent(false);
250 | }
251 | break;
252 | case MotionEvent.ACTION_UP:
253 | case MotionEvent.ACTION_CANCEL:
254 | break;
255 | }
256 | return super.dispatchTouchEvent(ev);
257 | }
258 | }
259 | ```
260 | 注释1:
261 |
262 | * 因为SRL重写了requestDisallowInterceptTouchEvent这个方法,
263 |
264 | * ViewCompat.isNestedScrollingEnabled(mTarget)默认为false,
265 |
266 | * 导致super.requestDisallowInterceptTouchEvent(b)不执行,
267 |
268 | * 所以要设置ViewCompat.isNestedScrollingEnabled为true。
269 |
270 |
271 | 内部解决第一种方法:VP内部加这句:ViewCompat.setNestedScrollingEnabled(this, true);
272 |
273 | 内部解决第二种方法:重写SRL#reDITE。
274 |
275 | 因为SRL继承ViewGroup类,
276 |
277 | 所以仿照ViewGroup的reDITE重写SRL的reDITE方法,不写super,class拿到变量名”mGroupFlags”。
278 |
279 | ```
280 | @Override
281 | public void requestDisallowInterceptTouchEvent(boolean disallowIntercept) {
282 | // super.requestDisallowInterceptTouchEvent(b);
283 | Class cls = ViewGroup.class;
284 | try {
285 | Field field = cls.getField("mGroupFlags");
286 | int c = (int) field.get(this);
287 | if (disallowIntercept) {
288 | field.set(this, 2900051);
289 | } else {
290 | field.set(this, 2245715);
291 | }
292 | } catch (NoSuchFieldException e) {
293 | e.printStackTrace();
294 | } catch (IllegalAccessException e) {
295 | e.printStackTrace();
296 | }
297 | }
298 | ```
299 |
300 | **外部拦截:**
301 |
302 | 参考链接:https://blog.csdn.net/u010386612/article/details/50548977
303 |
304 | SRL_VP_out_SRL:
305 | ```
306 | public class SRL_VP_out_SRL extends SwipeRefreshLayout {
307 | private boolean mIsBeingDragged;
308 | private float initialX;
309 | private float initialY;
310 | private float x;
311 | private float y;
312 | private float deltaX;
313 | private float deltaY;
314 | private int mTouchSlop;
315 | boolean isVpDragged = false;
316 | public SRL_VP_out_SRL(Context context) {
317 | super(context);
318 | }
319 | public SRL_VP_out_SRL(Context context, AttributeSet attrs) {
320 | super(context, attrs);
321 | mTouchSlop = ViewConfiguration.get(context).getScaledTouchSlop();
322 | }
323 | @Override
324 | public boolean onInterceptTouchEvent(MotionEvent ev) {
325 | switch (ev.getAction()) {
326 | case MotionEvent.ACTION_DOWN:
327 | initialX = ev.getX();
328 | initialY = ev.getY();
329 | isVpDragged = false;
330 | break;
331 | case MotionEvent.ACTION_MOVE:
332 | //只要手指不离开就一直返回false
333 | if (isVpDragged)
334 | return false;
335 | x = ev.getX();
336 | y = ev.getY();
337 | deltaX = Math.abs(x - initialX);
338 | deltaY = Math.abs(y - initialY);
339 | if (deltaX > deltaY) {
340 | isVpDragged = true;
341 | return false;
342 | }
343 | break;
344 | case MotionEvent.ACTION_UP:
345 | case MotionEvent.ACTION_CANCEL:
346 | isVpDragged = false;
347 | break;
348 | }
349 | return super.onInterceptTouchEvent(ev);
350 | }
351 | }
352 | ```
353 |
354 |
355 | 2.SV+VP:没有冲突。
356 |
357 |
358 |
359 | 3.VP+SV:没有冲突。
360 |
361 |
362 |
363 | 4.VP+LV:没有冲突。
364 |
365 |
366 |
--------------------------------------------------------------------------------
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/app/app.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 | generateDebugSources
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
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 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
--------------------------------------------------------------------------------
/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 26
5 | defaultConfig {
6 | applicationId "com.example.ruru.android_slidingconflictdemo"
7 | minSdkVersion 23
8 | targetSdkVersion 26
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(dir: 'libs', include: ['*.jar'])
23 | implementation 'com.android.support:appcompat-v7:26.1.0'
24 | implementation 'com.android.support.constraint:constraint-layout:1.1.3'
25 | implementation 'com.android.support:support-v4:26.1.0'
26 | implementation 'com.android.support:design:26.1.0'
27 | testImplementation 'junit:junit:4.12'
28 | androidTestImplementation 'com.android.support.test:runner:1.0.2'
29 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
30 | implementation 'com.facebook.fresco:fresco:1.13.0'
31 | }
32 |
--------------------------------------------------------------------------------
/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/src/androidTest/java/com/example/ruru/android_slidingconflictdemo/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.example.ruru.android_slidingconflictdemo;
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 | * Instrumented 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.example.ruru.android_slidingconflictdemo", appContext.getPackageName());
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/ruru/android_slidingconflictdemo/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.example.ruru.android_slidingconflictdemo;
2 |
3 | import android.content.Intent;
4 | import android.os.Bundle;
5 | import android.support.v7.app.AppCompatActivity;
6 | import android.view.View;
7 |
8 | import com.example.ruru.android_slidingconflictdemo.differentDirection.OuterTestActivity;
9 | import com.example.ruru.android_slidingconflictdemo.differentDirection.SRL_VP;
10 | import com.example.ruru.android_slidingconflictdemo.differentDirection.VP_LV;
11 | import com.example.ruru.android_slidingconflictdemo.differentDirection.VP_SV;
12 | import com.example.ruru.android_slidingconflictdemo.sameDirection.SRL_RV;
13 | import com.example.ruru.android_slidingconflictdemo.sameDirection.SRL_SV;
14 | import com.example.ruru.android_slidingconflictdemo.sameDirection.SV_RV;
15 | import com.example.ruru.android_slidingconflictdemo.sameDirection.SV_SV;
16 | import com.example.ruru.android_slidingconflictdemo.sameDirection.VP_VP;
17 | import com.example.ruru.android_slidingconflictdemo.test.MethodTestActivity;
18 |
19 |
20 | public class MainActivity extends AppCompatActivity {
21 |
22 | @Override
23 | protected void onCreate(Bundle savedInstanceState) {
24 | super.onCreate(savedInstanceState);
25 | setContentView(R.layout.activity_main);
26 | }
27 |
28 | //SameDirection
29 | public void SRL_SV(View v) {
30 | startActivity(new Intent(this, SRL_SV.class));
31 | }
32 |
33 | public void SRL_RV(View v) {
34 | startActivity(new Intent(this, SRL_RV.class));
35 | }
36 |
37 | public void SV_SV(View v) {
38 | startActivity(new Intent(this, SV_SV.class));
39 | }
40 |
41 | public void SV_RV(View v) {
42 | startActivity(new Intent(this, SV_RV.class));
43 | }
44 |
45 | // public void SV_LV(View v) {
46 | // startActivity(new Intent(this, SV_LV.class));
47 | // }
48 |
49 | public void VP_VP(View v) {
50 | startActivity(new Intent(this, VP_VP.class));
51 | }
52 |
53 | //DifferentDirection
54 | public void SRL_VP(View v) {
55 | startActivity(new Intent(this, SRL_VP.class));
56 | }
57 |
58 | public void VP_SV(View v) {
59 | startActivity(new Intent(this, VP_SV.class));
60 | }
61 |
62 | public void VP_LV(View v) {
63 | startActivity(new Intent(this, VP_LV.class));
64 | }
65 |
66 | public void out_test(View v) {
67 | startActivity(new Intent(this, OuterTestActivity.class));
68 | }
69 |
70 | //test
71 | public void METHOD_TEST(View v) {
72 | startActivity(new Intent(this, MethodTestActivity.class));
73 | }
74 | }
75 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/ruru/android_slidingconflictdemo/adapter/SubRvAdapter.java:
--------------------------------------------------------------------------------
1 | package com.example.ruru.android_slidingconflictdemo.adapter;
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.example.ruru.android_slidingconflictdemo.R;
11 |
12 | import java.util.List;
13 |
14 | public class SubRvAdapter extends RecyclerView.Adapter {
15 |
16 | private Context context;
17 | private List list;
18 | private final LayoutInflater inflater;
19 |
20 | public SubRvAdapter(Context context, List list) {
21 | this.context = context;
22 | this.list = list;
23 | inflater = LayoutInflater.from(context);
24 | }
25 |
26 | @Override
27 | public MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
28 | View view = inflater.inflate(R.layout.item, parent, false);
29 | return new MyViewHolder(view);
30 | }
31 |
32 | @Override
33 | public void onBindViewHolder(MyViewHolder holder, int position) {
34 | holder.tv.setText(list.get(position));
35 | }
36 |
37 | @Override
38 | public int getItemCount() {
39 | return list.size();
40 | }
41 |
42 | class MyViewHolder extends RecyclerView.ViewHolder {
43 |
44 | private final TextView tv;
45 |
46 | public MyViewHolder(View itemView) {
47 | super(itemView);
48 |
49 | tv = itemView.findViewById(R.id.tv);
50 |
51 | }
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/ruru/android_slidingconflictdemo/adapter/SubVpAdapter.java:
--------------------------------------------------------------------------------
1 | package com.example.ruru.android_slidingconflictdemo.adapter;
2 |
3 | import android.support.v4.app.Fragment;
4 | import android.support.v4.app.FragmentManager;
5 | import android.support.v4.app.FragmentPagerAdapter;
6 |
7 | import java.util.List;
8 |
9 | public class SubVpAdapter extends FragmentPagerAdapter {
10 |
11 | private List list;
12 |
13 | public SubVpAdapter(FragmentManager fm, List list) {
14 | super(fm);
15 | this.list = list;
16 | }
17 |
18 | @Override
19 | public Fragment getItem(int position) {
20 | return list.get(position);
21 | }
22 |
23 | @Override
24 | public int getCount() {
25 | return list.size();
26 | }
27 |
28 | @Override
29 | public CharSequence getPageTitle(int position) {
30 | return position == 0 ? "左边" : "右边";
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/ruru/android_slidingconflictdemo/data/DataModel.java:
--------------------------------------------------------------------------------
1 | package com.example.ruru.android_slidingconflictdemo.data;
2 |
3 | import android.support.v4.app.Fragment;
4 |
5 | import com.example.ruru.android_slidingconflictdemo.fragment.AFragment;
6 | import com.example.ruru.android_slidingconflictdemo.fragment.BFragment;
7 | import com.example.ruru.android_slidingconflictdemo.fragment.CFragment;
8 | import com.example.ruru.android_slidingconflictdemo.fragment.DFragment;
9 | import com.example.ruru.android_slidingconflictdemo.fragment.EFragment;
10 | import com.example.ruru.android_slidingconflictdemo.fragment.FFragment;
11 | import com.example.ruru.android_slidingconflictdemo.fragment.GFragment;
12 |
13 | import java.util.ArrayList;
14 | import java.util.List;
15 |
16 | public class DataModel {
17 |
18 | public static List getStringList1() {
19 | List list = new ArrayList<>();
20 | for (int i = 0; i < 50; i++) {
21 | list.add("item" + i);
22 | }
23 | return list;
24 | }
25 |
26 | public static List getStringList2() {
27 | List list = new ArrayList<>();
28 | for (int i = 0; i < 20; i++) {
29 | list.add("你好" + i);
30 | }
31 | return list;
32 | }
33 |
34 | public static List getFragmentList1() {
35 | List list = new ArrayList();
36 | list.add(new AFragment());
37 | list.add(new BFragment());
38 | return list;
39 | }
40 |
41 | public static List getFragmentList2() {
42 | List list = new ArrayList();
43 | list.add(new CFragment());
44 | list.add(new DFragment());
45 | return list;
46 | }
47 |
48 | public static List getFragmentList3() {
49 | List list = new ArrayList();
50 | list.add(new FFragment());
51 | list.add(new CFragment());
52 | return list;
53 | }
54 |
55 | public static List getFragmentList4() {
56 | List list = new ArrayList();
57 | list.add(new EFragment());
58 | list.add(new GFragment());
59 | return list;
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/ruru/android_slidingconflictdemo/differentDirection/OuterTestActivity.java:
--------------------------------------------------------------------------------
1 | package com.example.ruru.android_slidingconflictdemo.differentDirection;
2 |
3 | import android.support.v7.app.AppCompatActivity;
4 | import android.os.Bundle;
5 |
6 | import com.example.ruru.android_slidingconflictdemo.R;
7 | import com.example.ruru.android_slidingconflictdemo.differentUI.OutSRL;
8 | import com.example.ruru.android_slidingconflictdemo.differentUI.SRL_VP_inner;
9 | import com.example.ruru.android_slidingconflictdemo.differentUI.SRL_VP_outer;
10 |
11 | public class OuterTestActivity extends AppCompatActivity {
12 |
13 | private OutSRL swipeRefreshLayout;
14 |
15 | @Override
16 | protected void onCreate(Bundle savedInstanceState) {
17 | super.onCreate(savedInstanceState);
18 | setContentView(R.layout.activity_outer_test);
19 |
20 | initView();
21 | }
22 |
23 | private void initView() {
24 | swipeRefreshLayout = (OutSRL) findViewById(R.id.swipeRefreshLayout);
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/ruru/android_slidingconflictdemo/differentDirection/SRL_VP.java:
--------------------------------------------------------------------------------
1 | package com.example.ruru.android_slidingconflictdemo.differentDirection;
2 |
3 | import android.os.Bundle;
4 | import android.support.v4.view.ViewPager;
5 | import android.support.v4.widget.SwipeRefreshLayout;
6 | import android.support.v7.app.AppCompatActivity;
7 |
8 | import com.example.ruru.android_slidingconflictdemo.R;
9 | import com.example.ruru.android_slidingconflictdemo.adapter.SubVpAdapter;
10 | import com.example.ruru.android_slidingconflictdemo.data.DataModel;
11 | import com.example.ruru.android_slidingconflictdemo.differentUI.SRL_VP_out_SRL;
12 | import com.example.ruru.android_slidingconflictdemo.differentUI.SRL_VP_outer;
13 | import com.example.ruru.android_slidingconflictdemo.differentUI.SRL_VP_inner;
14 |
15 | public class SRL_VP extends AppCompatActivity {
16 |
17 | private SRL_VP_outer swipeRefreshLayout;
18 | private SRL_VP_inner viewPager;
19 |
20 | @Override
21 | protected void onCreate(Bundle savedInstanceState) {
22 | super.onCreate(savedInstanceState);
23 | setContentView(R.layout.activity_srl_vp);
24 | initView();
25 | initData();
26 | }
27 |
28 | private void initView() {
29 | swipeRefreshLayout = (SRL_VP_outer) findViewById(R.id.swipeRefreshLayout);
30 | viewPager = (SRL_VP_inner) findViewById(R.id.viewPager);
31 | }
32 |
33 | private void initData() {
34 | viewPager.setAdapter(new SubVpAdapter(getSupportFragmentManager(), DataModel.getFragmentList1()));
35 | swipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
36 | @Override
37 | public void onRefresh() {
38 | swipeRefreshLayout.setRefreshing(false);
39 | }
40 | });
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/ruru/android_slidingconflictdemo/differentDirection/VP_LV.java:
--------------------------------------------------------------------------------
1 | package com.example.ruru.android_slidingconflictdemo.differentDirection;
2 |
3 | import android.os.Bundle;
4 | import android.support.v4.view.ViewPager;
5 | import android.support.v7.app.AppCompatActivity;
6 |
7 | import com.example.ruru.android_slidingconflictdemo.R;
8 | import com.example.ruru.android_slidingconflictdemo.adapter.SubVpAdapter;
9 | import com.example.ruru.android_slidingconflictdemo.data.DataModel;
10 |
11 | public class VP_LV extends AppCompatActivity {
12 |
13 | private ViewPager viewPager;
14 |
15 | @Override
16 | protected void onCreate(Bundle savedInstanceState) {
17 | super.onCreate(savedInstanceState);
18 | setContentView(R.layout.activity_vp_lv);
19 | initView();
20 | initData();
21 | }
22 |
23 | private void initView() {
24 | viewPager = findViewById(R.id.viewPager);
25 | }
26 |
27 | private void initData() {
28 | viewPager.setAdapter(new SubVpAdapter(getSupportFragmentManager(), DataModel.getFragmentList4()));
29 | }
30 | }
31 |
32 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/ruru/android_slidingconflictdemo/differentDirection/VP_SV.java:
--------------------------------------------------------------------------------
1 | package com.example.ruru.android_slidingconflictdemo.differentDirection;
2 |
3 | import android.os.Bundle;
4 | import android.support.v4.view.ViewPager;
5 | import android.support.v7.app.AppCompatActivity;
6 |
7 | import com.example.ruru.android_slidingconflictdemo.R;
8 | import com.example.ruru.android_slidingconflictdemo.adapter.SubVpAdapter;
9 | import com.example.ruru.android_slidingconflictdemo.data.DataModel;
10 |
11 | public class VP_SV extends AppCompatActivity {
12 |
13 | private ViewPager viewPager;
14 |
15 | @Override
16 | protected void onCreate(Bundle savedInstanceState) {
17 | super.onCreate(savedInstanceState);
18 | setContentView(R.layout.activity_vp_sv_3);
19 | initView();
20 | initData();
21 | }
22 |
23 | private void initView() {
24 | viewPager = findViewById(R.id.viewPager);
25 | }
26 |
27 | private void initData() {
28 | viewPager.setAdapter(new SubVpAdapter(getSupportFragmentManager(), DataModel.getFragmentList3()));
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/ruru/android_slidingconflictdemo/differentUI/OutSRL.java:
--------------------------------------------------------------------------------
1 | package com.example.ruru.android_slidingconflictdemo.differentUI;
2 |
3 | import android.content.Context;
4 | import android.support.v4.widget.SwipeRefreshLayout;
5 | import android.util.AttributeSet;
6 | import android.util.Log;
7 | import android.view.MotionEvent;
8 |
9 | public class OutSRL extends SwipeRefreshLayout {
10 |
11 | public OutSRL(Context context) {
12 | super(context);
13 | }
14 |
15 | public OutSRL(Context context, AttributeSet attrs) {
16 | super(context, attrs);
17 | }
18 |
19 | @Override
20 | public boolean dispatchTouchEvent(MotionEvent ev) {
21 | Log.d(getClass().getName(), "dispatchTouchEvent: ++");
22 | return super.dispatchTouchEvent(ev);
23 | }
24 |
25 | @Override
26 | public boolean onInterceptTouchEvent(MotionEvent ev) {
27 | Log.d(getClass().getName(), "onInterceptTouchEvent: ++");
28 | return true;
29 | }
30 |
31 | @Override
32 | public boolean onTouchEvent(MotionEvent ev) {
33 | Log.d(getClass().getName(), "onTouchEvent: ++");
34 | return super.onTouchEvent(ev);
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/ruru/android_slidingconflictdemo/differentUI/SRL_VP_inner.java:
--------------------------------------------------------------------------------
1 | package com.example.ruru.android_slidingconflictdemo.differentUI;
2 |
3 | import android.content.Context;
4 | import android.support.v4.view.ViewCompat;
5 | import android.support.v4.view.ViewPager;
6 | import android.util.AttributeSet;
7 | import android.util.Log;
8 | import android.view.MotionEvent;
9 |
10 | public class SRL_VP_inner extends ViewPager {
11 |
12 | private float startX;
13 | private float startY;
14 | private float x;
15 | private float y;
16 | private float deltaX;
17 | private float deltaY;
18 |
19 | public SRL_VP_inner(Context context) {
20 | super(context);
21 | }
22 |
23 | public SRL_VP_inner(Context context, AttributeSet attrs) {
24 | super(context, attrs);
25 | }
26 |
27 | @Override
28 | public boolean dispatchTouchEvent(MotionEvent ev) {
29 | switch (ev.getAction()) {
30 | case MotionEvent.ACTION_DOWN:
31 | startX = ev.getX();
32 | startY = ev.getY();
33 | ViewCompat.setNestedScrollingEnabled(this, true);
34 | getParent().requestDisallowInterceptTouchEvent(true);
35 | break;
36 | case MotionEvent.ACTION_MOVE:
37 | x = ev.getX();
38 | y = ev.getY();
39 | deltaX = Math.abs(x - startX);
40 | deltaY = Math.abs(y - startY);
41 | if (deltaX < deltaY) {
42 | getParent().requestDisallowInterceptTouchEvent(false);
43 | }
44 | break;
45 | case MotionEvent.ACTION_UP:
46 | case MotionEvent.ACTION_CANCEL:
47 | break;
48 | }
49 | return super.dispatchTouchEvent(ev);
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/ruru/android_slidingconflictdemo/differentUI/SRL_VP_out_SRL.java:
--------------------------------------------------------------------------------
1 | package com.example.ruru.android_slidingconflictdemo.differentUI;
2 |
3 | import android.content.Context;
4 | import android.support.v4.widget.SwipeRefreshLayout;
5 | import android.util.AttributeSet;
6 | import android.view.MotionEvent;
7 | import android.view.ViewConfiguration;
8 |
9 | public class SRL_VP_out_SRL extends SwipeRefreshLayout {
10 |
11 | private boolean mIsBeingDragged;
12 | private float initialX;
13 | private float initialY;
14 | private float x;
15 | private float y;
16 | private float deltaX;
17 | private float deltaY;
18 | private int mTouchSlop;
19 | boolean isVpDragged = false;
20 |
21 | public SRL_VP_out_SRL(Context context) {
22 | super(context);
23 | }
24 |
25 | public SRL_VP_out_SRL(Context context, AttributeSet attrs) {
26 | super(context, attrs);
27 | mTouchSlop = ViewConfiguration.get(context).getScaledTouchSlop();
28 | }
29 |
30 | @Override
31 | public boolean onInterceptTouchEvent(MotionEvent ev) {
32 | switch (ev.getAction()) {
33 | case MotionEvent.ACTION_DOWN:
34 | initialX = ev.getX();
35 | initialY = ev.getY();
36 | isVpDragged = false;
37 | break;
38 | case MotionEvent.ACTION_MOVE:
39 | //只要手指不离开就一直返回false
40 | if (isVpDragged)
41 | return false;
42 | x = ev.getX();
43 | y = ev.getY();
44 | deltaX = Math.abs(x - initialX);
45 | deltaY = Math.abs(y - initialY);
46 | if (deltaX > deltaY) {
47 | isVpDragged = true;
48 | return false;
49 | }
50 | break;
51 | case MotionEvent.ACTION_UP:
52 | case MotionEvent.ACTION_CANCEL:
53 | isVpDragged = false;
54 | break;
55 | }
56 | return super.onInterceptTouchEvent(ev);
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/ruru/android_slidingconflictdemo/differentUI/SRL_VP_outer.java:
--------------------------------------------------------------------------------
1 | package com.example.ruru.android_slidingconflictdemo.differentUI;
2 |
3 | import android.content.Context;
4 | import android.support.v4.widget.SwipeRefreshLayout;
5 | import android.util.AttributeSet;
6 | import android.util.Log;
7 | import android.view.MotionEvent;
8 | import android.view.ViewGroup;
9 |
10 | import java.lang.reflect.Field;
11 |
12 | public class SRL_VP_outer extends SwipeRefreshLayout {
13 | public SRL_VP_outer(Context context) {
14 | super(context);
15 | }
16 |
17 | public SRL_VP_outer(Context context, AttributeSet attrs) {
18 | super(context, attrs);
19 | }
20 |
21 | @Override
22 | public boolean onInterceptTouchEvent(MotionEvent ev) {
23 | if (ev.getAction() == MotionEvent.ACTION_DOWN) {
24 | super.onInterceptTouchEvent(ev);
25 | return false;
26 | }
27 | return super.onInterceptTouchEvent(ev);
28 | }
29 |
30 | @Override
31 | public void requestDisallowInterceptTouchEvent(boolean disallowIntercept) {
32 | // super.requestDisallowInterceptTouchEvent(b);
33 | Class cls = ViewGroup.class;
34 | try {
35 | Field field = cls.getField("mGroupFlags");
36 | int c = (int) field.get(this);
37 | if (disallowIntercept) {
38 | field.set(this, 2900051);
39 | } else {
40 | field.set(this, 2245715);
41 | }
42 | } catch (NoSuchFieldException e) {
43 | e.printStackTrace();
44 | } catch (IllegalAccessException e) {
45 | e.printStackTrace();
46 | }
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/ruru/android_slidingconflictdemo/fragment/AFragment.java:
--------------------------------------------------------------------------------
1 | package com.example.ruru.android_slidingconflictdemo.fragment;
2 |
3 | import android.os.Bundle;
4 | import android.support.v4.app.Fragment;
5 | import android.view.LayoutInflater;
6 | import android.view.View;
7 | import android.view.ViewGroup;
8 |
9 | import com.example.ruru.android_slidingconflictdemo.R;
10 |
11 | public class AFragment extends Fragment {
12 |
13 | public AFragment() {
14 | // Required empty public constructor
15 | }
16 |
17 | @Override
18 | public void onCreate(Bundle savedInstanceState) {
19 | super.onCreate(savedInstanceState);
20 |
21 | }
22 |
23 | @Override
24 | public View onCreateView(LayoutInflater inflater, ViewGroup container,
25 | Bundle savedInstanceState) {
26 | return inflater.inflate(R.layout.fragment_a, container, false);
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/ruru/android_slidingconflictdemo/fragment/BFragment.java:
--------------------------------------------------------------------------------
1 | package com.example.ruru.android_slidingconflictdemo.fragment;
2 |
3 |
4 | import android.os.Bundle;
5 | import android.support.v4.app.Fragment;
6 | import android.view.LayoutInflater;
7 | import android.view.View;
8 | import android.view.ViewGroup;
9 |
10 | import com.example.ruru.android_slidingconflictdemo.R;
11 |
12 | /**
13 | * A simple {@link Fragment} subclass.
14 | */
15 | public class BFragment extends Fragment {
16 |
17 |
18 | public BFragment() {
19 | // Required empty public constructor
20 | }
21 |
22 |
23 | @Override
24 | public View onCreateView(LayoutInflater inflater, ViewGroup container,
25 | Bundle savedInstanceState) {
26 | // Inflate the layout for this fragment
27 | return inflater.inflate(R.layout.fragment_b, container, false);
28 | }
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/ruru/android_slidingconflictdemo/fragment/CFragment.java:
--------------------------------------------------------------------------------
1 | package com.example.ruru.android_slidingconflictdemo.fragment;
2 |
3 |
4 | import android.os.Bundle;
5 | import android.support.v4.app.Fragment;
6 | import android.view.LayoutInflater;
7 | import android.view.View;
8 | import android.view.ViewGroup;
9 |
10 | import com.example.ruru.android_slidingconflictdemo.R;
11 |
12 | /**
13 | * A simple {@link Fragment} subclass.
14 | */
15 | public class CFragment extends Fragment {
16 |
17 | @Override
18 | public View onCreateView(LayoutInflater inflater, ViewGroup container,
19 | Bundle savedInstanceState) {
20 | return inflater.inflate(R.layout.fragment_c, container, false);
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/ruru/android_slidingconflictdemo/fragment/DFragment.java:
--------------------------------------------------------------------------------
1 | package com.example.ruru.android_slidingconflictdemo.fragment;
2 |
3 | import android.os.Bundle;
4 | import android.support.v4.app.Fragment;
5 | import android.view.LayoutInflater;
6 | import android.view.View;
7 | import android.view.ViewGroup;
8 |
9 | import com.example.ruru.android_slidingconflictdemo.R;
10 |
11 | public class DFragment extends Fragment {
12 |
13 | @Override
14 | public View onCreateView(LayoutInflater inflater, ViewGroup container,
15 | Bundle savedInstanceState) {
16 | return inflater.inflate(R.layout.fragment_d, container, false);
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/ruru/android_slidingconflictdemo/fragment/EFragment.java:
--------------------------------------------------------------------------------
1 | package com.example.ruru.android_slidingconflictdemo.fragment;
2 |
3 |
4 | import android.os.Bundle;
5 | import android.support.v4.app.Fragment;
6 | import android.view.LayoutInflater;
7 | import android.view.View;
8 | import android.view.ViewGroup;
9 | import android.widget.ArrayAdapter;
10 | import android.widget.ListView;
11 |
12 | import com.example.ruru.android_slidingconflictdemo.R;
13 | import com.example.ruru.android_slidingconflictdemo.data.DataModel;
14 |
15 | import java.util.List;
16 |
17 | /**
18 | * ListView
19 | */
20 | public class EFragment extends Fragment {
21 |
22 |
23 | public EFragment() {
24 | // Required empty public constructor
25 | }
26 |
27 |
28 | @Override
29 | public View onCreateView(LayoutInflater inflater, ViewGroup container,
30 | Bundle savedInstanceState) {
31 | View view = inflater.inflate(R.layout.fragment_e, container, false);
32 | ListView listView = view.findViewById(R.id.listView);
33 | listView.setAdapter(new ArrayAdapter(getActivity(), R.layout.item, R.id.tv, DataModel.getStringList1()));
34 | return view;
35 | }
36 |
37 | }
38 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/ruru/android_slidingconflictdemo/fragment/FFragment.java:
--------------------------------------------------------------------------------
1 | package com.example.ruru.android_slidingconflictdemo.fragment;
2 |
3 | import android.os.Bundle;
4 | import android.support.v4.app.Fragment;
5 | import android.view.LayoutInflater;
6 | import android.view.View;
7 | import android.view.ViewGroup;
8 |
9 | import com.example.ruru.android_slidingconflictdemo.R;
10 |
11 | /**
12 | * 有ScrollView
13 | */
14 | public class FFragment extends Fragment {
15 |
16 | @Override
17 | public View onCreateView(LayoutInflater inflater, ViewGroup container,
18 | Bundle savedInstanceState) {
19 | return inflater.inflate(R.layout.fragment_f, container, false);
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/ruru/android_slidingconflictdemo/fragment/GFragment.java:
--------------------------------------------------------------------------------
1 | package com.example.ruru.android_slidingconflictdemo.fragment;
2 |
3 |
4 | import android.os.Bundle;
5 | import android.support.v4.app.Fragment;
6 | import android.view.LayoutInflater;
7 | import android.view.View;
8 | import android.view.ViewGroup;
9 | import android.widget.ArrayAdapter;
10 | import android.widget.ListView;
11 |
12 | import com.example.ruru.android_slidingconflictdemo.R;
13 | import com.example.ruru.android_slidingconflictdemo.data.DataModel;
14 |
15 | /**
16 | * ListView
17 | */
18 | public class GFragment extends Fragment {
19 |
20 |
21 | public GFragment() {
22 | // Required empty public constructor
23 | }
24 |
25 |
26 | @Override
27 | public View onCreateView(LayoutInflater inflater, ViewGroup container,
28 | Bundle savedInstanceState) {
29 | View view = inflater.inflate(R.layout.fragment_g, container, false);
30 | ListView listView = view.findViewById(R.id.listView);
31 | listView.setAdapter(new ArrayAdapter(getActivity(), R.layout.item, R.id.tv, DataModel.getStringList2()));
32 | return view;
33 | }
34 |
35 | }
36 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/ruru/android_slidingconflictdemo/sameDirection/SRL_RV.java:
--------------------------------------------------------------------------------
1 | package com.example.ruru.android_slidingconflictdemo.sameDirection;
2 |
3 | import android.os.Bundle;
4 | import android.support.v4.widget.SwipeRefreshLayout;
5 | import android.support.v7.app.AppCompatActivity;
6 | import android.support.v7.widget.LinearLayoutManager;
7 | import android.support.v7.widget.RecyclerView;
8 | import android.util.Log;
9 | import android.view.ViewTreeObserver;
10 |
11 | import com.example.ruru.android_slidingconflictdemo.R;
12 | import com.example.ruru.android_slidingconflictdemo.adapter.SubRvAdapter;
13 | import com.example.ruru.android_slidingconflictdemo.data.DataModel;
14 |
15 | public class SRL_RV extends AppCompatActivity {
16 |
17 | private SwipeRefreshLayout mRefreshLayout;
18 | private RecyclerView mRecyclerView;
19 |
20 | @Override
21 | protected void onCreate(Bundle savedInstanceState) {
22 | super.onCreate(savedInstanceState);
23 | setContentView(R.layout.activity_srl_rv);
24 |
25 | initView();
26 | initData();
27 | }
28 |
29 | private void initView() {
30 | mRefreshLayout = findViewById(R.id.swipeRefreshLayout);
31 | mRecyclerView = findViewById(R.id.recyclerView);
32 | }
33 |
34 | private void initData() {
35 | mRecyclerView.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false));
36 | mRecyclerView.setAdapter(new SubRvAdapter(this, DataModel.getStringList1()));
37 |
38 | mRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
39 | @Override
40 | public void onRefresh() {
41 |
42 | mRefreshLayout.setRefreshing(false);
43 | }
44 | });
45 |
46 | mRecyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() {
47 | @Override
48 | public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
49 | super.onScrollStateChanged(recyclerView, newState);
50 |
51 | // Log.d("SRL_RV", "recyclerViewTime=" + new Date().getTime());
52 | Log.d("SRL_RV", "recyclerView 正在滚动");
53 | }
54 | });
55 |
56 | mRefreshLayout.getViewTreeObserver().addOnScrollChangedListener(new ViewTreeObserver.OnScrollChangedListener() {
57 | @Override
58 | public void onScrollChanged() {
59 | Log.d("SRL_RV", "swipeRefreshLayout 正在滚动");
60 | }
61 | });
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/ruru/android_slidingconflictdemo/sameDirection/SRL_SV.java:
--------------------------------------------------------------------------------
1 | package com.example.ruru.android_slidingconflictdemo.sameDirection;
2 |
3 | import android.os.Bundle;
4 | import android.support.v4.widget.SwipeRefreshLayout;
5 | import android.support.v7.app.AppCompatActivity;
6 | import android.util.Log;
7 | import android.view.View;
8 | import android.view.ViewTreeObserver;
9 | import android.widget.ArrayAdapter;
10 | import android.widget.ListView;
11 | import android.widget.ScrollView;
12 |
13 | import com.example.ruru.android_slidingconflictdemo.R;
14 | import com.example.ruru.android_slidingconflictdemo.data.DataModel;
15 |
16 | import java.util.Date;
17 |
18 | public class SRL_SV extends AppCompatActivity {
19 |
20 | private SwipeRefreshLayout mRefreshLayout;
21 | private ScrollView mScrollView;
22 |
23 | @Override
24 | protected void onCreate(Bundle savedInstanceState) {
25 | super.onCreate(savedInstanceState);
26 | setContentView(R.layout.activity_srl_sv);
27 |
28 | mRefreshLayout = findViewById(R.id.mRefreshLayout);
29 | mScrollView = findViewById(R.id.mScrollView);
30 |
31 | mRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
32 | @Override
33 | public void onRefresh() {
34 |
35 | Log.d("SRL_SV", "refreshTime=" + new Date().getTime());
36 |
37 | mRefreshLayout.setRefreshing(false);
38 | }
39 | });
40 |
41 | mRefreshLayout.getViewTreeObserver().addOnScrollChangedListener(new ViewTreeObserver.OnScrollChangedListener() {
42 | @Override
43 | public void onScrollChanged() {
44 | Log.d("SRL_SV", "swipeRefreshLayout 正在滚动");
45 | }
46 | });
47 |
48 | mScrollView.getViewTreeObserver().addOnScrollChangedListener(new ViewTreeObserver.OnScrollChangedListener() {
49 | @Override
50 | public void onScrollChanged() {
51 | if (mScrollView.getScrollY() == 0) {
52 |
53 | Log.d("SRL_SV", "scrollTime=" + new Date().getTime());
54 | Log.d("SRL_SV", "scrollView 正在滚动");
55 |
56 | }
57 | }
58 | });
59 |
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/ruru/android_slidingconflictdemo/sameDirection/SV_LV.java:
--------------------------------------------------------------------------------
1 | package com.example.ruru.android_slidingconflictdemo.sameDirection;
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.ListView;
10 |
11 | import com.example.ruru.android_slidingconflictdemo.R;
12 | import com.example.ruru.android_slidingconflictdemo.adapter.SubRvAdapter;
13 | import com.example.ruru.android_slidingconflictdemo.data.DataModel;
14 | import com.example.ruru.android_slidingconflictdemo.sameUI.SV_LV_inner;
15 |
16 | public class SV_LV extends AppCompatActivity {
17 |
18 | private SV_LV_inner rv;
19 |
20 | @Override
21 | protected void onCreate(@Nullable Bundle savedInstanceState) {
22 | super.onCreate(savedInstanceState);
23 | setContentView(R.layout.activity_sv_lv);
24 |
25 | initView();
26 | }
27 |
28 | private void initView() {
29 | rv = findViewById(R.id.rv);
30 | rv.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false));
31 | rv.setAdapter(new SubRvAdapter(this, DataModel.getStringList2()));
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/ruru/android_slidingconflictdemo/sameDirection/SV_RV.java:
--------------------------------------------------------------------------------
1 | package com.example.ruru.android_slidingconflictdemo.sameDirection;
2 |
3 | import android.os.Bundle;
4 | import android.support.v7.app.AppCompatActivity;
5 | import android.support.v7.widget.LinearLayoutManager;
6 |
7 | import com.example.ruru.android_slidingconflictdemo.R;
8 | import com.example.ruru.android_slidingconflictdemo.adapter.SubRvAdapter;
9 | import com.example.ruru.android_slidingconflictdemo.data.DataModel;
10 | import com.example.ruru.android_slidingconflictdemo.sameUI.SV_RV_inner;
11 | import com.example.ruru.android_slidingconflictdemo.sameUI.SV_RV_outer;
12 |
13 | public class SV_RV extends AppCompatActivity {
14 |
15 | private SV_RV_outer mScrollView;
16 | private SV_RV_inner mRecyclerView;
17 |
18 | @Override
19 | protected void onCreate(Bundle savedInstanceState) {
20 | super.onCreate(savedInstanceState);
21 | setContentView(R.layout.activity_sv_rv);
22 |
23 | initView();
24 | initData();
25 | }
26 |
27 | private void initView() {
28 | mScrollView = findViewById(R.id.scrollView);
29 | mRecyclerView = findViewById(R.id.recyclerView);
30 | }
31 |
32 | private void initData() {
33 | mRecyclerView.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false));
34 | mRecyclerView.setAdapter(new SubRvAdapter(this, DataModel.getStringList1()));
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/ruru/android_slidingconflictdemo/sameDirection/SV_SV.java:
--------------------------------------------------------------------------------
1 | package com.example.ruru.android_slidingconflictdemo.sameDirection;
2 |
3 | import android.os.Bundle;
4 | import android.support.annotation.Nullable;
5 | import android.support.v7.app.AppCompatActivity;
6 |
7 | import com.example.ruru.android_slidingconflictdemo.R;
8 |
9 | public class SV_SV extends AppCompatActivity {
10 |
11 | @Override
12 | protected void onCreate(@Nullable Bundle savedInstanceState) {
13 | super.onCreate(savedInstanceState);
14 | setContentView(R.layout.activity_sv_sv);
15 |
16 |
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/ruru/android_slidingconflictdemo/sameDirection/VP_VP.java:
--------------------------------------------------------------------------------
1 | package com.example.ruru.android_slidingconflictdemo.sameDirection;
2 |
3 | import android.os.Bundle;
4 | import android.support.v4.view.ViewPager;
5 | import android.support.v7.app.AppCompatActivity;
6 |
7 | import com.example.ruru.android_slidingconflictdemo.R;
8 | import com.example.ruru.android_slidingconflictdemo.adapter.SubVpAdapter;
9 | import com.example.ruru.android_slidingconflictdemo.data.DataModel;
10 | import com.example.ruru.android_slidingconflictdemo.sameUI.VP_VP_inner;
11 |
12 | public class VP_VP extends AppCompatActivity {
13 |
14 | private ViewPager mViewPager1;
15 | private VP_VP_inner mViewPager2;
16 |
17 | @Override
18 | protected void onCreate(Bundle savedInstanceState) {
19 | super.onCreate(savedInstanceState);
20 | setContentView(R.layout.activity_vp_vp);
21 |
22 | initView();
23 | initData();
24 | }
25 |
26 | private void initData() {
27 | mViewPager1.setAdapter(new SubVpAdapter(getSupportFragmentManager(), DataModel.getFragmentList1()));
28 | mViewPager2.setAdapter(new SubVpAdapter(getSupportFragmentManager(), DataModel.getFragmentList2()));
29 | }
30 |
31 | private void initView() {
32 | mViewPager1 = findViewById(R.id.viewPager1);
33 | mViewPager2 = findViewById(R.id.viewPager2);
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/ruru/android_slidingconflictdemo/sameUI/SV_LV_inner.java:
--------------------------------------------------------------------------------
1 | package com.example.ruru.android_slidingconflictdemo.sameUI;
2 |
3 | import android.content.Context;
4 | import android.support.v7.widget.RecyclerView;
5 | import android.util.AttributeSet;
6 | import android.view.MotionEvent;
7 | import android.widget.ListView;
8 |
9 | public class SV_LV_inner extends RecyclerView {
10 | public SV_LV_inner(Context context) {
11 | super(context);
12 | }
13 |
14 | public SV_LV_inner(Context context, AttributeSet attrs) {
15 | super(context, attrs);
16 | }
17 |
18 | @Override
19 | public boolean dispatchTouchEvent(MotionEvent ev) {
20 | return super.dispatchTouchEvent(ev);
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/ruru/android_slidingconflictdemo/sameUI/SV_LV_outer.java:
--------------------------------------------------------------------------------
1 | package com.example.ruru.android_slidingconflictdemo.sameUI;
2 |
3 | import android.content.Context;
4 | import android.util.AttributeSet;
5 | import android.view.MotionEvent;
6 | import android.widget.ScrollView;
7 |
8 | public class SV_LV_outer extends ScrollView {
9 | public SV_LV_outer(Context context) {
10 | super(context);
11 | }
12 |
13 | public SV_LV_outer(Context context, AttributeSet attrs) {
14 | super(context, attrs);
15 | }
16 |
17 | @Override
18 | public boolean onInterceptTouchEvent(MotionEvent ev) {
19 | return super.onInterceptTouchEvent(ev);
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/ruru/android_slidingconflictdemo/sameUI/SV_RV_inner.java:
--------------------------------------------------------------------------------
1 | package com.example.ruru.android_slidingconflictdemo.sameUI;
2 |
3 | import android.content.Context;
4 | import android.support.annotation.Nullable;
5 | import android.support.v7.widget.RecyclerView;
6 | import android.util.AttributeSet;
7 | import android.util.Log;
8 | import android.view.MotionEvent;
9 |
10 | public class SV_RV_inner extends RecyclerView {
11 |
12 | public SV_RV_inner(Context context) {
13 | super(context);
14 | }
15 |
16 | public SV_RV_inner(Context context, @Nullable AttributeSet attrs) {
17 | super(context, attrs);
18 | }
19 |
20 | @Override
21 | public boolean dispatchTouchEvent(MotionEvent ev) {
22 | getParent().requestDisallowInterceptTouchEvent(true);
23 | if (ev.getAction() == MotionEvent.ACTION_MOVE) {
24 | Log.d("SV_RV", "dispatchTouchEvent: 内层在滑动++");
25 | }
26 | return super.dispatchTouchEvent(ev);
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/ruru/android_slidingconflictdemo/sameUI/SV_RV_outer.java:
--------------------------------------------------------------------------------
1 | package com.example.ruru.android_slidingconflictdemo.sameUI;
2 |
3 | import android.content.Context;
4 | import android.util.AttributeSet;
5 | import android.util.Log;
6 | import android.view.MotionEvent;
7 | import android.widget.ScrollView;
8 |
9 | public class SV_RV_outer extends ScrollView {
10 |
11 | public SV_RV_outer(Context context) {
12 | super(context);
13 | }
14 |
15 | public SV_RV_outer(Context context, AttributeSet attrs) {
16 | super(context, attrs);
17 | }
18 |
19 | @Override
20 | public boolean onInterceptTouchEvent(MotionEvent ev) {
21 | if (ev.getAction() == MotionEvent.ACTION_MOVE) {
22 | Log.d("SV_RV", "onInterceptTouchEvent: 外层在滑动+");
23 | }
24 | return super.onInterceptTouchEvent(ev);
25 | }
26 |
27 | @Override
28 | public boolean onTouchEvent(MotionEvent ev) {
29 | if (ev.getAction() == MotionEvent.ACTION_MOVE) {
30 | Log.d("SV_RV", "onInterceptTouchEvent: 外层在滑动++");
31 | }
32 | return super.onTouchEvent(ev);
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/ruru/android_slidingconflictdemo/sameUI/SV_SV_inner.java:
--------------------------------------------------------------------------------
1 | package com.example.ruru.android_slidingconflictdemo.sameUI;
2 |
3 | import android.content.Context;
4 | import android.util.AttributeSet;
5 | import android.view.MotionEvent;
6 | import android.widget.ScrollView;
7 |
8 | import static android.view.MotionEvent.ACTION_DOWN;
9 | import static android.view.MotionEvent.ACTION_MOVE;
10 |
11 | public class SV_SV_inner extends ScrollView {
12 | public SV_SV_inner(Context context) {
13 | super(context);
14 | }
15 |
16 | public SV_SV_inner(Context context, AttributeSet attrs) {
17 | super(context, attrs);
18 | }
19 |
20 | @Override
21 | public boolean dispatchTouchEvent(MotionEvent ev) {
22 | return super.dispatchTouchEvent(ev);
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/ruru/android_slidingconflictdemo/sameUI/SV_SV_outer.java:
--------------------------------------------------------------------------------
1 | package com.example.ruru.android_slidingconflictdemo.sameUI;
2 |
3 | import android.content.Context;
4 | import android.util.AttributeSet;
5 | import android.view.MotionEvent;
6 | import android.widget.ScrollView;
7 |
8 | public class SV_SV_outer extends ScrollView {
9 | public SV_SV_outer(Context context) {
10 | super(context);
11 | }
12 |
13 | public SV_SV_outer(Context context, AttributeSet attrs) {
14 | super(context, attrs);
15 | }
16 |
17 | @Override
18 | public boolean onInterceptTouchEvent(MotionEvent ev) {
19 | super.onInterceptTouchEvent(ev);
20 | return false;
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/ruru/android_slidingconflictdemo/sameUI/VP_VP_inner.java:
--------------------------------------------------------------------------------
1 | package com.example.ruru.android_slidingconflictdemo.sameUI;
2 |
3 | import android.content.Context;
4 | import android.support.v4.view.ViewPager;
5 | import android.util.AttributeSet;
6 | import android.util.Log;
7 | import android.view.MotionEvent;
8 |
9 | public class VP_VP_inner extends ViewPager {
10 |
11 | public VP_VP_inner(Context context) {
12 | super(context);
13 | }
14 |
15 | public VP_VP_inner(Context context, AttributeSet attributeSet) {
16 | super(context, attributeSet);
17 | }
18 |
19 | @Override
20 | public boolean dispatchTouchEvent(MotionEvent ev) {
21 | /*switch (ev.getAction()) {
22 | case MotionEvent.ACTION_DOWN:
23 | getParent().requestDisallowInterceptTouchEvent(true);
24 | break;
25 | case MotionEvent.ACTION_MOVE:
26 | int curPosition = this.getCurrentItem();
27 | int count = this.getAdapter().getCount();
28 | if (curPosition == count - 1 || curPosition == 0) {
29 | getParent().requestDisallowInterceptTouchEvent(false);
30 | } else {
31 | getParent().requestDisallowInterceptTouchEvent(true);
32 | }
33 | break;
34 | case MotionEvent.ACTION_UP:
35 | case MotionEvent.ACTION_CANCEL:
36 | break;
37 | }*/
38 | if (ev.getAction() == MotionEvent.ACTION_MOVE) {
39 | Log.d("VP_VP", "dispatchTouchEvent: 内部在滑动++");
40 | }
41 | return super.dispatchTouchEvent(ev);
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/ruru/android_slidingconflictdemo/sameUI/VP_VP_outer.java:
--------------------------------------------------------------------------------
1 | package com.example.ruru.android_slidingconflictdemo.sameUI;
2 |
3 | import android.content.Context;
4 | import android.support.v4.view.ViewPager;
5 | import android.util.AttributeSet;
6 | import android.util.Log;
7 | import android.view.MotionEvent;
8 |
9 | public class VP_VP_outer extends ViewPager {
10 | public VP_VP_outer(Context context) {
11 | super(context);
12 | }
13 |
14 | public VP_VP_outer(Context context, AttributeSet attrs) {
15 | super(context, attrs);
16 | }
17 |
18 | @Override
19 | public boolean onInterceptTouchEvent(MotionEvent ev) {
20 | if (ev.getAction() == MotionEvent.ACTION_MOVE) {
21 | Log.d("VP_VP", "onInterceptTouchEvent: 外部在滑动+");
22 | }
23 | return super.onInterceptTouchEvent(ev);
24 | }
25 |
26 | @Override
27 | public boolean onTouchEvent(MotionEvent ev) {
28 | if (ev.getAction() == MotionEvent.ACTION_MOVE) {
29 | Log.d("VP_VP", "onInterceptTouchEvent: 外部在滑动++");
30 | }
31 | return super.onTouchEvent(ev);
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/ruru/android_slidingconflictdemo/test/MethodTestActivity.java:
--------------------------------------------------------------------------------
1 | package com.example.ruru.android_slidingconflictdemo.test;
2 |
3 | import android.os.Bundle;
4 | import android.support.v7.app.AppCompatActivity;
5 | import android.util.Log;
6 | import android.view.MotionEvent;
7 | import android.view.View;
8 | import android.widget.Button;
9 | import android.widget.LinearLayout;
10 |
11 | import com.example.ruru.android_slidingconflictdemo.R;
12 |
13 | public class MethodTestActivity extends AppCompatActivity {
14 |
15 | private LinearLayout ll;
16 | private Button button;
17 |
18 | @Override
19 | protected void onCreate(Bundle savedInstanceState) {
20 | super.onCreate(savedInstanceState);
21 | setContentView(R.layout.activity_method_test);
22 |
23 | initView();
24 | initData();
25 | }
26 |
27 | private void initData() {
28 | ll.setOnTouchListener(new View.OnTouchListener() {
29 | @Override
30 | public boolean onTouch(View v, MotionEvent event) {
31 | Log.d("mt", "onTouch++");
32 | return false;
33 | }
34 | });
35 |
36 | ll.setOnClickListener(new View.OnClickListener() {
37 | @Override
38 | public void onClick(View v) {
39 | Log.d("mt", "onClick++");
40 | }
41 | });
42 | }
43 |
44 | private void initView() {
45 | ll = findViewById(R.id.ll);
46 | button = findViewById(R.id.button);
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
1 |
7 |
12 |
13 |
19 |
22 |
25 |
26 |
27 |
28 |
34 |
35 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_launcher_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
15 |
20 |
25 |
30 |
35 |
40 |
45 |
50 |
55 |
60 |
65 |
70 |
75 |
80 |
85 |
90 |
95 |
100 |
105 |
110 |
115 |
120 |
125 |
130 |
135 |
140 |
145 |
150 |
155 |
160 |
165 |
170 |
171 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_hsv__lv.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_lv_vp.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
12 |
13 |
17 |
18 |
23 |
24 |
29 |
30 |
35 |
36 |
41 |
42 |
47 |
48 |
53 |
54 |
59 |
60 |
65 |
66 |
67 |
72 |
73 |
78 |
79 |
84 |
85 |
90 |
91 |
96 |
97 |
102 |
103 |
108 |
109 |
110 |
111 |
112 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_method_test.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
15 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_outer_test.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
12 |
13 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_srl_lv.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
10 |
11 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_srl_rv.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
12 |
13 |
17 |
18 |
22 |
23 |
27 |
28 |
32 |
33 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_srl_sv.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
13 |
14 |
18 |
19 |
23 |
24 |
29 |
30 |
35 |
36 |
41 |
42 |
47 |
48 |
53 |
54 |
59 |
60 |
65 |
66 |
71 |
72 |
77 |
78 |
83 |
84 |
89 |
90 |
95 |
96 |
101 |
102 |
107 |
108 |
113 |
114 |
119 |
120 |
125 |
126 |
131 |
132 |
137 |
138 |
143 |
144 |
149 |
150 |
155 |
156 |
161 |
162 |
167 |
168 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_srl_vp.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_srl_vp_old.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
15 |
16 |
17 |
18 |
27 |
28 |
38 |
39 |
49 |
50 |
51 |
58 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_sv_lv.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
9 |
10 |
17 |
18 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_sv_rv.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
16 |
17 |
21 |
22 |
27 |
28 |
33 |
34 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_sv_sv.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
10 |
11 |
18 |
19 |
26 |
27 |
34 |
35 |
42 |
43 |
50 |
51 |
58 |
59 |
66 |
67 |
74 |
75 |
82 |
83 |
86 |
87 |
91 |
92 |
93 |
100 |
101 |
108 |
109 |
116 |
117 |
124 |
125 |
132 |
133 |
140 |
141 |
148 |
149 |
156 |
157 |
158 |
159 |
160 |
161 |
168 |
169 |
176 |
177 |
184 |
185 |
192 |
193 |
200 |
201 |
208 |
209 |
216 |
217 |
224 |
225 |
232 |
233 |
240 |
241 |
248 |
249 |
256 |
257 |
258 |
259 |
260 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_sv_vp.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
13 |
14 |
18 |
19 |
20 |
21 |
25 |
26 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_vp_lv.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 | >
13 |
14 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_vp_sv_3.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
12 |
13 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_vp_vp.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
13 |
14 |
20 |
21 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_a.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_b.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_c.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
13 |
14 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_d.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
13 |
14 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_e.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
12 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_f.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
12 |
13 |
18 |
19 |
23 |
24 |
29 |
30 |
34 |
35 |
39 |
40 |
44 |
45 |
49 |
50 |
54 |
55 |
59 |
60 |
64 |
65 |
69 |
70 |
74 |
75 |
76 |
77 |
78 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_g.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
12 |
13 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/2211785113/Android_SlidingConflict/f385696960c26b132c411036e9b1bb95a63dfcf8/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/2211785113/Android_SlidingConflict/f385696960c26b132c411036e9b1bb95a63dfcf8/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/timg.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/2211785113/Android_SlidingConflict/f385696960c26b132c411036e9b1bb95a63dfcf8/app/src/main/res/mipmap-hdpi/timg.jpeg
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/2211785113/Android_SlidingConflict/f385696960c26b132c411036e9b1bb95a63dfcf8/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/2211785113/Android_SlidingConflict/f385696960c26b132c411036e9b1bb95a63dfcf8/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/timg.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/2211785113/Android_SlidingConflict/f385696960c26b132c411036e9b1bb95a63dfcf8/app/src/main/res/mipmap-mdpi/timg.jpeg
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/2211785113/Android_SlidingConflict/f385696960c26b132c411036e9b1bb95a63dfcf8/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/2211785113/Android_SlidingConflict/f385696960c26b132c411036e9b1bb95a63dfcf8/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/timg.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/2211785113/Android_SlidingConflict/f385696960c26b132c411036e9b1bb95a63dfcf8/app/src/main/res/mipmap-xhdpi/timg.jpeg
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/2211785113/Android_SlidingConflict/f385696960c26b132c411036e9b1bb95a63dfcf8/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/2211785113/Android_SlidingConflict/f385696960c26b132c411036e9b1bb95a63dfcf8/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/timg.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/2211785113/Android_SlidingConflict/f385696960c26b132c411036e9b1bb95a63dfcf8/app/src/main/res/mipmap-xxhdpi/timg.jpeg
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/2211785113/Android_SlidingConflict/f385696960c26b132c411036e9b1bb95a63dfcf8/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/2211785113/Android_SlidingConflict/f385696960c26b132c411036e9b1bb95a63dfcf8/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/timg.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/2211785113/Android_SlidingConflict/f385696960c26b132c411036e9b1bb95a63dfcf8/app/src/main/res/mipmap-xxxhdpi/timg.jpeg
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3F51B5
4 | #303F9F
5 | #FF4081
6 | #3CB371
7 |
8 |
--------------------------------------------------------------------------------
/app/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 50dp
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Android_SlidingConflictDemo
3 |
4 |
5 | Hello blank fragment
6 | A fragment
7 | B fragment
8 | C fragment
9 | D fragment
10 | F fragment
11 |
12 | 左侧
13 | 右侧
14 |
15 | first
16 | second
17 | three
18 | four
19 |
20 |
--------------------------------------------------------------------------------
/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/test/java/com/example/ruru/android_slidingconflictdemo/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.example.ruru.android_slidingconflictdemo;
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 | }
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 |
5 | repositories {
6 | google()
7 | jcenter()
8 | }
9 | dependencies {
10 | classpath 'com.android.tools.build:gradle:3.0.1'
11 |
12 | // NOTE: Do not place your application dependencies here; they belong
13 | // in the individual module build.gradle files
14 | }
15 | }
16 |
17 | allprojects {
18 | repositories {
19 | google()
20 | jcenter()
21 | }
22 | }
23 |
24 | task clean(type: Delete) {
25 | delete rootProject.buildDir
26 | }
27 |
--------------------------------------------------------------------------------
/build/android-profile/profile-2019-08-07-09-00-35-980.json:
--------------------------------------------------------------------------------
1 | [{"pid":0,"ph":"i","name":"Memory sample","ts":1565139634465000,"args":{"JVM stats":"heap_memory_usage: 358192136\nnon_heap_memory_usage: 137847120\nloaded_class_count: 15417\nthread_count: 21\ngarbage_collection_stats {\n name: \"PS Scavenge\"\n gc_collections: 0\n gc_time: 0\n}\ngarbage_collection_stats {\n name: \"PS MarkSweep\"\n gc_collections: 0\n gc_time: 0\n}\n"}},{"pid":0,"ph":"i","name":"Memory sample","ts":1565139635980000,"args":{"JVM stats":"heap_memory_usage: 270544744\nnon_heap_memory_usage: 139546200\nloaded_class_count: 15450\nthread_count: 21\ngarbage_collection_stats {\n name: \"PS Scavenge\"\n gc_collections: 1\n gc_time: 36\n}\ngarbage_collection_stats {\n name: \"PS MarkSweep\"\n gc_collections: 0\n gc_time: 0\n}\n"}},{"pid":1,"tid":6,"id":2,"name":"base plugin project configure","args":{"span_id":"2","project":"id: 1\nandroid_plugin_version: \"3.0.1\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n"},"ph":"X","ts":1565139634466000,"dur":7000},{"pid":1,"tid":6,"id":3,"name":"base plugin project base extension creation","args":{"span_id":"3","project":"id: 1\nandroid_plugin_version: \"3.0.1\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n"},"ph":"X","ts":1565139634473000,"dur":33000},{"pid":1,"tid":6,"id":5,"name":"task manager create tasks","args":{"span_id":"5","project":"id: 1\nandroid_plugin_version: \"3.0.1\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n"},"ph":"X","ts":1565139634506000,"dur":6000},{"pid":1,"tid":6,"id":4,"name":"base plugin project tasks creation","args":{"span_id":"4","project":"id: 1\nandroid_plugin_version: \"3.0.1\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n"},"ph":"X","ts":1565139634506000,"dur":6000},{"pid":1,"tid":6,"id":8,"name":"variant manager create variants","args":{"span_id":"8","project":"id: 1\nandroid_plugin_version: \"3.0.1\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n"},"ph":"X","ts":1565139635490000,"dur":5000},{"pid":1,"tid":6,"id":9,"name":"variant manager create tests tasks","args":{"span_id":"9","project":"id: 1\nandroid_plugin_version: \"3.0.1\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n"},"ph":"X","ts":1565139635495000,"dur":100},{"pid":1,"tid":6,"id":11,"name":"app task manager create merge manifest task","args":{"span_id":"11","project":"id: 1\nandroid_plugin_version: \"3.0.1\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 23\n}\ntarget_sdk_version {\n api_level: 26\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1565139635496000,"dur":1000},{"pid":1,"tid":6,"id":12,"name":"app task manager create generate res values task","args":{"span_id":"12","project":"id: 1\nandroid_plugin_version: \"3.0.1\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 23\n}\ntarget_sdk_version {\n api_level: 26\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1565139635497000,"dur":100},{"pid":1,"tid":6,"id":13,"name":"app task manager create create renderscript task","args":{"span_id":"13","project":"id: 1\nandroid_plugin_version: \"3.0.1\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 23\n}\ntarget_sdk_version {\n api_level: 26\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1565139635497000,"dur":37000},{"pid":1,"tid":6,"id":14,"name":"app task manager create merge resources task","args":{"span_id":"14","project":"id: 1\nandroid_plugin_version: \"3.0.1\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 23\n}\ntarget_sdk_version {\n api_level: 26\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1565139635534000,"dur":2000},{"pid":1,"tid":6,"id":15,"name":"app task manager create merge assets task","args":{"span_id":"15","project":"id: 1\nandroid_plugin_version: \"3.0.1\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 23\n}\ntarget_sdk_version {\n api_level: 26\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1565139635536000,"dur":100},{"pid":1,"tid":6,"id":16,"name":"app task manager create build config task","args":{"span_id":"16","project":"id: 1\nandroid_plugin_version: \"3.0.1\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 23\n}\ntarget_sdk_version {\n api_level: 26\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1565139635536000,"dur":100},{"pid":1,"tid":6,"id":17,"name":"app task manager create process res task","args":{"span_id":"17","project":"id: 1\nandroid_plugin_version: \"3.0.1\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 23\n}\ntarget_sdk_version {\n api_level: 26\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1565139635536000,"dur":3000},{"pid":1,"tid":6,"id":18,"name":"app task manager create aidl task","args":{"span_id":"18","project":"id: 1\nandroid_plugin_version: \"3.0.1\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 23\n}\ntarget_sdk_version {\n api_level: 26\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1565139635539000,"dur":1000},{"pid":1,"tid":6,"id":19,"name":"app task manager create shader task","args":{"span_id":"19","project":"id: 1\nandroid_plugin_version: \"3.0.1\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 23\n}\ntarget_sdk_version {\n api_level: 26\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1565139635540000,"dur":100},{"pid":1,"tid":6,"id":20,"name":"app task manager create ndk task","args":{"span_id":"20","project":"id: 1\nandroid_plugin_version: \"3.0.1\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 23\n}\ntarget_sdk_version {\n api_level: 26\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1565139635540000,"dur":1000},{"pid":1,"tid":6,"id":21,"name":"app task manager create external native build task","args":{"span_id":"21","project":"id: 1\nandroid_plugin_version: \"3.0.1\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 23\n}\ntarget_sdk_version {\n api_level: 26\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1565139635541000,"dur":100},{"pid":1,"tid":6,"id":22,"name":"app task manager create merge jnilibs folders task","args":{"span_id":"22","project":"id: 1\nandroid_plugin_version: \"3.0.1\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 23\n}\ntarget_sdk_version {\n api_level: 26\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1565139635541000,"dur":1000},{"pid":1,"tid":6,"id":23,"name":"app task manager create compile task","args":{"span_id":"23","project":"id: 1\nandroid_plugin_version: \"3.0.1\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 23\n}\ntarget_sdk_version {\n api_level: 26\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1565139635542000,"dur":4000},{"pid":1,"tid":6,"id":24,"name":"app task manager create packaging task","args":{"span_id":"24","project":"id: 1\nandroid_plugin_version: \"3.0.1\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 23\n}\ntarget_sdk_version {\n api_level: 26\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1565139635551000,"dur":2000},{"pid":1,"tid":6,"id":25,"name":"app task manager create lint task","args":{"span_id":"25","project":"id: 1\nandroid_plugin_version: \"3.0.1\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 23\n}\ntarget_sdk_version {\n api_level: 26\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1565139635553000,"dur":100},{"pid":1,"tid":6,"id":10,"name":"variant manager create tasks for variant","args":{"span_id":"10","project":"id: 1\nandroid_plugin_version: \"3.0.1\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 23\n}\ntarget_sdk_version {\n api_level: 26\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1565139635495000,"dur":58000},{"pid":1,"tid":6,"id":26,"name":"variant manager create tasks for variant","args":{"span_id":"26","project":"id: 1\nandroid_plugin_version: \"3.0.1\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n"},"ph":"X","ts":1565139635553000,"dur":3000},{"pid":1,"tid":6,"id":28,"name":"app task manager create merge manifest task","args":{"span_id":"28","project":"id: 1\nandroid_plugin_version: \"3.0.1\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 23\n}\ntarget_sdk_version {\n api_level: 26\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1565139635557000,"dur":100},{"pid":1,"tid":6,"id":29,"name":"app task manager create generate res values task","args":{"span_id":"29","project":"id: 1\nandroid_plugin_version: \"3.0.1\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 23\n}\ntarget_sdk_version {\n api_level: 26\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1565139635557000,"dur":1000},{"pid":1,"tid":6,"id":30,"name":"app task manager create create renderscript task","args":{"span_id":"30","project":"id: 1\nandroid_plugin_version: \"3.0.1\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 23\n}\ntarget_sdk_version {\n api_level: 26\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1565139635558000,"dur":1000},{"pid":1,"tid":6,"id":31,"name":"app task manager create merge resources task","args":{"span_id":"31","project":"id: 1\nandroid_plugin_version: \"3.0.1\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 23\n}\ntarget_sdk_version {\n api_level: 26\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1565139635559000,"dur":100},{"pid":1,"tid":6,"id":32,"name":"app task manager create merge assets task","args":{"span_id":"32","project":"id: 1\nandroid_plugin_version: \"3.0.1\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 23\n}\ntarget_sdk_version {\n api_level: 26\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1565139635559000,"dur":100},{"pid":1,"tid":6,"id":33,"name":"app task manager create build config task","args":{"span_id":"33","project":"id: 1\nandroid_plugin_version: \"3.0.1\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 23\n}\ntarget_sdk_version {\n api_level: 26\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1565139635559000,"dur":100},{"pid":1,"tid":6,"id":34,"name":"app task manager create process res task","args":{"span_id":"34","project":"id: 1\nandroid_plugin_version: \"3.0.1\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 23\n}\ntarget_sdk_version {\n api_level: 26\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1565139635559000,"dur":1000},{"pid":1,"tid":6,"id":35,"name":"app task manager create aidl task","args":{"span_id":"35","project":"id: 1\nandroid_plugin_version: \"3.0.1\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 23\n}\ntarget_sdk_version {\n api_level: 26\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1565139635560000,"dur":1000},{"pid":1,"tid":6,"id":36,"name":"app task manager create shader task","args":{"span_id":"36","project":"id: 1\nandroid_plugin_version: \"3.0.1\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 23\n}\ntarget_sdk_version {\n api_level: 26\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1565139635561000,"dur":100},{"pid":1,"tid":6,"id":37,"name":"app task manager create ndk task","args":{"span_id":"37","project":"id: 1\nandroid_plugin_version: \"3.0.1\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 23\n}\ntarget_sdk_version {\n api_level: 26\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1565139635561000,"dur":100},{"pid":1,"tid":6,"id":38,"name":"app task manager create external native build task","args":{"span_id":"38","project":"id: 1\nandroid_plugin_version: \"3.0.1\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 23\n}\ntarget_sdk_version {\n api_level: 26\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1565139635561000,"dur":100},{"pid":1,"tid":6,"id":39,"name":"app task manager create merge jnilibs folders task","args":{"span_id":"39","project":"id: 1\nandroid_plugin_version: \"3.0.1\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 23\n}\ntarget_sdk_version {\n api_level: 26\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1565139635561000,"dur":1000},{"pid":1,"tid":6,"id":40,"name":"app task manager create compile task","args":{"span_id":"40","project":"id: 1\nandroid_plugin_version: \"3.0.1\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 23\n}\ntarget_sdk_version {\n api_level: 26\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1565139635562000,"dur":1000},{"pid":1,"tid":6,"id":41,"name":"app task manager create packaging task","args":{"span_id":"41","project":"id: 1\nandroid_plugin_version: \"3.0.1\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 23\n}\ntarget_sdk_version {\n api_level: 26\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1565139635564000,"dur":1000},{"pid":1,"tid":6,"id":42,"name":"app task manager create lint task","args":{"span_id":"42","project":"id: 1\nandroid_plugin_version: \"3.0.1\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 23\n}\ntarget_sdk_version {\n api_level: 26\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1565139635565000,"dur":100},{"pid":1,"tid":6,"id":27,"name":"variant manager create tasks for variant","args":{"span_id":"27","project":"id: 1\nandroid_plugin_version: \"3.0.1\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 23\n}\ntarget_sdk_version {\n api_level: 26\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1565139635556000,"dur":9000},{"pid":1,"tid":6,"id":43,"name":"variant manager create tasks for variant","args":{"span_id":"43","project":"id: 1\nandroid_plugin_version: \"3.0.1\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n"},"ph":"X","ts":1565139635565000,"dur":2000},{"pid":1,"tid":6,"id":44,"name":"variant manager create tasks for variant","args":{"span_id":"44","project":"id: 1\nandroid_plugin_version: \"3.0.1\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n"},"ph":"X","ts":1565139635567000,"dur":6000},{"pid":1,"tid":6,"id":7,"name":"variant manager create android tasks","args":{"span_id":"7","project":"id: 1\nandroid_plugin_version: \"3.0.1\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n"},"ph":"X","ts":1565139635490000,"dur":84000},{"pid":1,"tid":6,"id":45,"name":"variant manager external native config values","args":{"span_id":"45","project":"id: 1\nandroid_plugin_version: \"3.0.1\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n"},"ph":"X","ts":1565139635574000,"dur":100},{"pid":1,"tid":6,"id":6,"name":"base plugin create android tasks","args":{"span_id":"6","project":"id: 1\nandroid_plugin_version: \"3.0.1\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n"},"ph":"X","ts":1565139634517000,"dur":1057000},{"pid":1,"tid":6,"id":46,"name":"base plugin build finished","args":{"span_id":"46","project":"id: 1\nandroid_plugin_version: \"3.0.1\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n"},"ph":"X","ts":1565139635977000,"dur":100}]
--------------------------------------------------------------------------------
/build/android-profile/profile-2019-08-07-09-00-35-980.rawproto:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/2211785113/Android_SlidingConflict/f385696960c26b132c411036e9b1bb95a63dfcf8/build/android-profile/profile-2019-08-07-09-00-35-980.rawproto
--------------------------------------------------------------------------------
/build/android-profile/profile-2019-08-07-09-00-39-219.rawproto:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/2211785113/Android_SlidingConflict/f385696960c26b132c411036e9b1bb95a63dfcf8/build/android-profile/profile-2019-08-07-09-00-39-219.rawproto
--------------------------------------------------------------------------------
/build/android-profile/profile-2019-10-13-17-24-06-199.rawproto:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/2211785113/Android_SlidingConflict/f385696960c26b132c411036e9b1bb95a63dfcf8/build/android-profile/profile-2019-10-13-17-24-06-199.rawproto
--------------------------------------------------------------------------------
/build/android-profile/profile-2019-10-13-17-24-16-216.rawproto:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/2211785113/Android_SlidingConflict/f385696960c26b132c411036e9b1bb95a63dfcf8/build/android-profile/profile-2019-10-13-17-24-16-216.rawproto
--------------------------------------------------------------------------------
/build/android-profile/profile-2019-10-31-21-50-13-598.rawproto:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/2211785113/Android_SlidingConflict/f385696960c26b132c411036e9b1bb95a63dfcf8/build/android-profile/profile-2019-10-31-21-50-13-598.rawproto
--------------------------------------------------------------------------------
/build/android-profile/profile-2019-10-31-21-50-19-877.rawproto:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/2211785113/Android_SlidingConflict/f385696960c26b132c411036e9b1bb95a63dfcf8/build/android-profile/profile-2019-10-31-21-50-19-877.rawproto
--------------------------------------------------------------------------------
/build/android-profile/profile-2019-10-31-21-55-02-451.rawproto:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/2211785113/Android_SlidingConflict/f385696960c26b132c411036e9b1bb95a63dfcf8/build/android-profile/profile-2019-10-31-21-55-02-451.rawproto
--------------------------------------------------------------------------------
/build/android-profile/profile-2019-10-31-21-55-07-560.rawproto:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/2211785113/Android_SlidingConflict/f385696960c26b132c411036e9b1bb95a63dfcf8/build/android-profile/profile-2019-10-31-21-55-07-560.rawproto
--------------------------------------------------------------------------------
/build/android-profile/profile-2019-10-31-22-18-07-464.rawproto:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/2211785113/Android_SlidingConflict/f385696960c26b132c411036e9b1bb95a63dfcf8/build/android-profile/profile-2019-10-31-22-18-07-464.rawproto
--------------------------------------------------------------------------------
/build/android-profile/profile-2019-10-31-22-20-17-790.rawproto:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/2211785113/Android_SlidingConflict/f385696960c26b132c411036e9b1bb95a63dfcf8/build/android-profile/profile-2019-10-31-22-20-17-790.rawproto
--------------------------------------------------------------------------------
/build/android-profile/profile-2019-10-31-22-20-27-981.rawproto:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/2211785113/Android_SlidingConflict/f385696960c26b132c411036e9b1bb95a63dfcf8/build/android-profile/profile-2019-10-31-22-20-27-981.rawproto
--------------------------------------------------------------------------------
/build/android-profile/profile-2019-10-31-22-25-10-371.rawproto:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/2211785113/Android_SlidingConflict/f385696960c26b132c411036e9b1bb95a63dfcf8/build/android-profile/profile-2019-10-31-22-25-10-371.rawproto
--------------------------------------------------------------------------------
/build/android-profile/profile-2019-10-31-22-25-59-589.rawproto:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/2211785113/Android_SlidingConflict/f385696960c26b132c411036e9b1bb95a63dfcf8/build/android-profile/profile-2019-10-31-22-25-59-589.rawproto
--------------------------------------------------------------------------------
/build/android-profile/profile-2019-10-31-22-26-10-481.rawproto:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/2211785113/Android_SlidingConflict/f385696960c26b132c411036e9b1bb95a63dfcf8/build/android-profile/profile-2019-10-31-22-26-10-481.rawproto
--------------------------------------------------------------------------------
/build/android-profile/profile-2019-10-31-22-26-54-538.rawproto:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/2211785113/Android_SlidingConflict/f385696960c26b132c411036e9b1bb95a63dfcf8/build/android-profile/profile-2019-10-31-22-26-54-538.rawproto
--------------------------------------------------------------------------------
/build/android-profile/profile-2019-10-31-22-34-54-896.rawproto:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/2211785113/Android_SlidingConflict/f385696960c26b132c411036e9b1bb95a63dfcf8/build/android-profile/profile-2019-10-31-22-34-54-896.rawproto
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/2211785113/Android_SlidingConflict/f385696960c26b132c411036e9b1bb95a63dfcf8/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Thu Apr 18 21:05:56 CST 2019
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-4.1-all.zip
7 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/local.properties:
--------------------------------------------------------------------------------
1 | ## This file must *NOT* be checked into Version Control Systems,
2 | # as it contains information specific to your local configuration.
3 | #
4 | # Location of the SDK. This is only used by Gradle.
5 | # For customization when using a Version Control System, please read the
6 | # header note.
7 | #Wed May 15 10:05:03 CST 2019
8 | ndk.dir=/Users/liangyaru/Library/Android/sdk/ndk-bundle
9 | sdk.dir=/Users/liangyaru/Library/Android/sdk
10 |
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
--------------------------------------------------------------------------------