├── .gitignore ├── README.md ├── app-debug.apk ├── app ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── wobiancao │ │ └── guidedemo │ │ └── ExampleInstrumentedTest.java │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── com │ │ │ └── wobiancao │ │ │ └── guidedemo │ │ │ ├── FixedSpeedScroller.java │ │ │ ├── LazyLoadFragment.java │ │ │ ├── MainActivity.java │ │ │ ├── MyInterceptViewPager.java │ │ │ ├── adapter │ │ │ ├── MyFragmentPagerAdapter.java │ │ │ └── TextPagerAdapter.java │ │ │ └── fragment │ │ │ ├── FragmentOnePage.java │ │ │ ├── FragmentThreePage.java │ │ │ └── FragmentTwoPage.java │ └── res │ │ ├── anim │ │ ├── alpha.xml │ │ ├── trans_three_bottom_up.xml │ │ └── trans_two_bottom_up.xml │ │ ├── drawable-v24 │ │ └── ic_launcher_foreground.xml │ │ ├── drawable │ │ ├── a0c.9.png │ │ ├── circle_gray.xml │ │ ├── circle_main.xml │ │ ├── ic_launcher_background.xml │ │ ├── shape_color_next.xml │ │ └── shape_gradient_login.xml │ │ ├── layout │ │ ├── activity_main.xml │ │ ├── frgamnet_onepage.xml │ │ ├── frgamnet_threepage.xml │ │ ├── frgamnet_twopage.xml │ │ └── pager_adapter_text.xml │ │ ├── mipmap-anydpi-v26 │ │ ├── ic_launcher.xml │ │ └── ic_launcher_round.xml │ │ ├── mipmap-hdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-mdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxhdpi │ │ ├── b42.png │ │ ├── b43.png │ │ ├── b44.png │ │ ├── b45.9.png │ │ ├── b49.png │ │ ├── b4_.png │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ └── values │ │ ├── colors.xml │ │ ├── dimens.xml │ │ ├── strings.xml │ │ └── styles.xml │ └── test │ └── java │ └── com │ └── wobiancao │ └── guidedemo │ └── ExampleUnitTest.java ├── build.gradle ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── settings.gradle /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/libraries 5 | /.idea/modules.xml 6 | /.idea/workspace.xml 7 | .DS_Store 8 | */build 9 | /captures 10 | .externalNativeBuild 11 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Music163GuideDemo 2 | 3 | `开始之前先看效果 左边为网易云的效果 右边为我实现的效果` 4 | 5 | ![网易云原效果](https://upload-images.jianshu.io/upload_images/1216032-a99c749c85e18ce6.GIF?imageMogr2/auto-orient/strip) 6 | ![我实现的效果](https://upload-images.jianshu.io/upload_images/1216032-cb76b5abebceedb3.GIF?imageMogr2/auto-orient/strip) 7 | 8 | 质量有所压缩,具体可去下载网易云音乐自行查看效果 9 | 10 | [本demo apk文件下载](https://github.com/wobiancao/Music163GuideDemo/blob/master/app-debug.apk) 11 | 12 | #### 分析 13 | - 目测布局:分为两个viewpager,上面展示文字的viewpager和下面的图片viewpager; 14 | - 进一步观察:上面的文字viewpager滑动有延迟,而图片viewpager是没有滑动自带动画的,而且都没有自带滑动手势效果; 15 | - 分析得出:两个viewpager都拦截滑动事件,文字viewpager需要设置切换时间,有动画效果,图片viewpager去掉自带动画; 16 | - 分析图片viewpager动画效果,都是两张图片,一张背景,一张上浮图片;打开之后,背景:透明度由0到1;上浮图片:由下往上冒出;第三张图片,头像上浮之外还有个变小的过程 17 | 18 | `分析完毕,接下来具体实现` 19 | 20 | #### 实现 21 | 22 | - 先实现viewpager滑动拦截,拦截点击事件就行,具体看代码不多说 23 | ``` 24 | public class MyInterceptViewPager extends ViewPager { 25 | private boolean isScrollable = true; 26 | 27 | public MyInterceptViewPager(Context context) { 28 | super(context); 29 | } 30 | 31 | public MyInterceptViewPager(Context context, AttributeSet attrs) { 32 | super(context, attrs); 33 | } 34 | 35 | 36 | @Override 37 | public boolean onTouchEvent(MotionEvent ev) { 38 | return isScrollable && super.onTouchEvent(ev); 39 | } 40 | 41 | @Override 42 | public boolean onInterceptTouchEvent(MotionEvent ev) { 43 | return isScrollable && super.onInterceptTouchEvent(ev); 44 | } 45 | 46 | @Override 47 | public void setCurrentItem(int item) { 48 | super.setCurrentItem(item, false);//表示切换的时候,不需要切换时间。 49 | } 50 | 51 | @Override 52 | public void setCurrentItem(int item, boolean smoothScroll) { 53 | super.setCurrentItem(item, smoothScroll); 54 | } 55 | } 56 | ``` 57 | - 通过反射,实现viewpager切换动画速度修改,新建一个类继承于Scroller 58 | ``` 59 | public class FixedSpeedScroller extends Scroller { 60 | private int mDuration = 1500; 61 | 62 | public FixedSpeedScroller(Context context) { 63 | super(context); 64 | } 65 | 66 | public FixedSpeedScroller(Context context, Interpolator interpolator) { 67 | super(context, interpolator); 68 | } 69 | 70 | @Override 71 | public void startScroll(int startX, int startY, int dx, int dy, int duration) { 72 | // Ignore received duration, use fixed one instead 73 | super.startScroll(startX, startY, dx, dy, mDuration); 74 | } 75 | 76 | @Override 77 | public void startScroll(int startX, int startY, int dx, int dy) { 78 | // Ignore received duration, use fixed one instead 79 | super.startScroll(startX, startY, dx, dy, mDuration); 80 | } 81 | 82 | public void setmDuration(int time) { 83 | mDuration = time; 84 | } 85 | 86 | public int getmDuration() { 87 | return mDuration; 88 | } 89 | } 90 | 91 | ``` 92 | - 具体使用 93 | ``` 94 | try { 95 | Field field = ViewPager.class.getDeclaredField("mScroller"); 96 | field.setAccessible(true); 97 | FixedSpeedScroller scrollerText = new FixedSpeedScroller(this, new AccelerateInterpolator()); 98 | field.set(mTextViewPager, scrollerText); 99 | scrollerText.setmDuration(400); 100 | } catch (Exception e) { 101 | 102 | } 103 | ``` 104 | - 实现两个viewpager的联动,根据横向滑动距离和方向判断是否应该翻页 105 | ``` 106 | mTouchLayout.setOnTouchListener(new View.OnTouchListener() { 107 | float startX; 108 | float startY;//没有用到 109 | float endX; 110 | float endY;//没有用到 111 | @Override 112 | public boolean onTouch(View v, MotionEvent event) { 113 | switch (event.getAction()) { 114 | case MotionEvent.ACTION_DOWN: 115 | startX = event.getX(); 116 | startY = event.getY(); 117 | break; 118 | case MotionEvent.ACTION_UP: 119 | endX = event.getX(); 120 | endY = event.getY(); 121 | WindowManager windowManager = (WindowManager) getApplicationContext().getSystemService(Context.WINDOW_SERVICE); 122 | Point size = new Point(); 123 | windowManager.getDefaultDisplay().getSize(size); 124 | int width = size.x; 125 | if (startX - endX >= (width / 8)){// startX - endX 大于0 且大于宽的1/8 可以往后翻页 126 | if (pageIndex == 0){ 127 | mImageViewPager.setCurrentItem(1); 128 | mTextPager.setCurrentItem(1, true); 129 | }else if (pageIndex == 1){ 130 | mImageViewPager.setCurrentItem(2); 131 | mTextPager.setCurrentItem(2, true); 132 | } 133 | }else if (endX - startX >= (width / 8)){ // endX - startX 大于0 且大于宽的1/8 可以往前翻页 134 | if (pageIndex == 2){ 135 | mImageViewPager.setCurrentItem(1); 136 | mTextPager.setCurrentItem(1, true); 137 | }else if (pageIndex == 1){ 138 | mImageViewPager.setCurrentItem(0); 139 | mTextPager.setCurrentItem(0, true); 140 | } 141 | } 142 | 143 | break; 144 | } 145 | return true; 146 | } 147 | }); 148 | ``` 149 | 150 | #### 最后 151 | 152 | - 本demo资源来自解压网易云音乐apk,因为喜欢,所以模仿。 153 | 154 | - 如果本demo对你有帮助,来个共赢的事吧,扫个红包也没损失↓↓↓ 155 | 156 | ![1547192479521.jpg](https://upload-images.jianshu.io/upload_images/1216032-fee6451bd19e7f3e.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/240) 157 | 158 | 159 | -------------------------------------------------------------------------------- /app-debug.apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wobiancao/Music163GuideDemo/a698b1fdd8709ef0f3c07455f4b4a15f50993eee/app-debug.apk -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 28 5 | defaultConfig { 6 | applicationId "com.wobiancao.guidedemo" 7 | minSdkVersion 21 8 | targetSdkVersion 28 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:28.0.0' 24 | implementation 'com.android.support.constraint:constraint-layout:1.1.3' 25 | testImplementation 'junit:junit:4.12' 26 | androidTestImplementation 'com.android.support.test:runner:1.0.2' 27 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' 28 | implementation 'com.android.support:cardview-v7:28.0.0' 29 | } 30 | -------------------------------------------------------------------------------- /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/wobiancao/guidedemo/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package com.wobiancao.guidedemo; 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() { 21 | // Context of the app under test. 22 | Context appContext = InstrumentationRegistry.getTargetContext(); 23 | 24 | assertEquals("com.wobiancao.guidedemo", appContext.getPackageName()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /app/src/main/java/com/wobiancao/guidedemo/FixedSpeedScroller.java: -------------------------------------------------------------------------------- 1 | package com.wobiancao.guidedemo; 2 | 3 | import android.content.Context; 4 | import android.view.animation.Interpolator; 5 | import android.widget.Scroller; 6 | /** 7 | * Created by wobiancao on 19/1/11. 8 | */ 9 | public class FixedSpeedScroller extends Scroller { 10 | private int mDuration = 1500; 11 | 12 | public FixedSpeedScroller(Context context) { 13 | super(context); 14 | } 15 | 16 | public FixedSpeedScroller(Context context, Interpolator interpolator) { 17 | super(context, interpolator); 18 | } 19 | 20 | @Override 21 | public void startScroll(int startX, int startY, int dx, int dy, int duration) { 22 | // Ignore received duration, use fixed one instead 23 | super.startScroll(startX, startY, dx, dy, mDuration); 24 | } 25 | 26 | @Override 27 | public void startScroll(int startX, int startY, int dx, int dy) { 28 | // Ignore received duration, use fixed one instead 29 | super.startScroll(startX, startY, dx, dy, mDuration); 30 | } 31 | 32 | public void setmDuration(int time) { 33 | mDuration = time; 34 | } 35 | 36 | public int getmDuration() { 37 | return mDuration; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /app/src/main/java/com/wobiancao/guidedemo/LazyLoadFragment.java: -------------------------------------------------------------------------------- 1 | package com.wobiancao.guidedemo; 2 | 3 | import android.os.Bundle; 4 | import android.support.annotation.Nullable; 5 | import android.support.v4.app.Fragment; 6 | import android.text.TextUtils; 7 | import android.view.LayoutInflater; 8 | import android.view.View; 9 | import android.view.ViewGroup; 10 | import android.widget.Toast; 11 | /** 12 | * Created by wobiancao on 19/1/11. 13 | */ 14 | public abstract class LazyLoadFragment extends Fragment { 15 | /** 16 | * 视图是否已经初初始化 17 | */ 18 | protected boolean isInit = false; 19 | protected boolean isLoad = false; 20 | protected final String TAG = "LazyLoadFragment"; 21 | private View view; 22 | 23 | @Nullable 24 | @Override 25 | public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { 26 | view = inflater.inflate(setContentView(), container, false); 27 | isInit = true; 28 | initView(savedInstanceState); 29 | isCanLoadData(); 30 | return view; 31 | } 32 | 33 | protected abstract void initView(Bundle savedInstanceState); 34 | 35 | 36 | @Override 37 | public void setUserVisibleHint(boolean isVisibleToUser) { 38 | super.setUserVisibleHint(isVisibleToUser); 39 | isCanLoadData(); 40 | } 41 | 42 | /** 43 | * 是否可以加载数据 44 | * 可以加载数据的条件: 45 | * 1.视图已经初始化 46 | * 2.视图对用户可见 47 | */ 48 | private void isCanLoadData() { 49 | if (!isInit) { 50 | return; 51 | } 52 | 53 | if (getUserVisibleHint()) { 54 | lazyLoad(); 55 | isLoad = true; 56 | } else { 57 | if (isLoad) { 58 | stopLoad(); 59 | } 60 | } 61 | } 62 | 63 | /** 64 | * 视图销毁的时候讲Fragment是否初始化的状态变为false 65 | */ 66 | @Override 67 | public void onDestroyView() { 68 | super.onDestroyView(); 69 | isInit = false; 70 | isLoad = false; 71 | 72 | } 73 | 74 | protected void showToast(String message) { 75 | if (!TextUtils.isEmpty(message)) { 76 | Toast.makeText(getContext(), message, Toast.LENGTH_SHORT).show(); 77 | } 78 | 79 | } 80 | 81 | /** 82 | * 设置Fragment要显示的布局 83 | * 84 | * @return 布局的layoutId 85 | */ 86 | protected abstract int setContentView(); 87 | 88 | /** 89 | * 获取设置的布局 90 | * 91 | * @return 92 | */ 93 | protected View getContentView() { 94 | return view; 95 | } 96 | 97 | /** 98 | * 找出对应的控件 99 | * 100 | * @param id 101 | * @param 102 | * @return 103 | */ 104 | protected T findViewById(int id) { 105 | 106 | return (T) getContentView().findViewById(id); 107 | } 108 | 109 | /** 110 | * 当视图初始化并且对用户可见的时候去真正的加载数据 111 | */ 112 | protected abstract void lazyLoad(); 113 | 114 | /** 115 | * 当视图已经对用户不可见并且加载过数据,如果需要在切换到其他页面时停止加载数据,可以覆写此方法 116 | */ 117 | protected void stopLoad() { 118 | } 119 | } 120 | 121 | -------------------------------------------------------------------------------- /app/src/main/java/com/wobiancao/guidedemo/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.wobiancao.guidedemo; 2 | 3 | import android.annotation.SuppressLint; 4 | import android.content.Context; 5 | import android.graphics.Point; 6 | import android.os.Bundle; 7 | import android.support.v4.view.ViewPager; 8 | import android.support.v7.app.AppCompatActivity; 9 | import android.view.MotionEvent; 10 | import android.view.View; 11 | import android.view.WindowManager; 12 | import android.view.animation.AccelerateInterpolator; 13 | import android.widget.ImageView; 14 | import android.widget.RelativeLayout; 15 | import android.widget.Toast; 16 | 17 | import com.wobiancao.guidedemo.adapter.MyFragmentPagerAdapter; 18 | import com.wobiancao.guidedemo.adapter.TextPagerAdapter; 19 | 20 | import java.lang.reflect.Field; 21 | 22 | /** 23 | * Created by wobiancao on 19/1/11. 24 | */ 25 | public class MainActivity extends AppCompatActivity { 26 | public static boolean SHOW_TWO_ANIM = true;//第二个界面是否展示动画 网易云音乐 3->2时 2没展示动画效果 27 | MyInterceptViewPager mTextPager;//文字 28 | MyInterceptViewPager mImageViewPager;//图片 29 | RelativeLayout mTouchLayout;//点击分发 30 | ImageView mIndicatorOne, mIndicatorTwo, mIndicatorThree; 31 | int pageIndex = 0; 32 | @SuppressLint("ClickableViewAccessibility") 33 | @Override 34 | protected void onCreate(Bundle savedInstanceState) { 35 | super.onCreate(savedInstanceState); 36 | setContentView(R.layout.activity_main); 37 | mTextPager = findViewById(R.id.main_text_pager); 38 | mImageViewPager = findViewById(R.id.main_image_pager); 39 | mTouchLayout = findViewById(R.id.main_touch_layout); 40 | mIndicatorOne = findViewById(R.id.main_indicator_one); 41 | mIndicatorTwo = findViewById(R.id.main_indicator_two); 42 | mIndicatorThree = findViewById(R.id.main_indicator_three); 43 | try { 44 | Field field = ViewPager.class.getDeclaredField("mScroller");//反射 45 | field.setAccessible(true); 46 | FixedSpeedScroller scrollerText = new FixedSpeedScroller(this, new AccelerateInterpolator()); 47 | field.set(mTextPager, scrollerText); 48 | scrollerText.setmDuration(350); 49 | } catch (Exception e) { 50 | 51 | } 52 | MyFragmentPagerAdapter fragmentPagerAdapter = new MyFragmentPagerAdapter(getSupportFragmentManager()); 53 | TextPagerAdapter textPagerAdapter = new TextPagerAdapter(); 54 | mTextPager.setAdapter(textPagerAdapter); 55 | mImageViewPager.setAdapter(fragmentPagerAdapter); 56 | mImageViewPager.setOnPageChangeListener(new ViewPager.OnPageChangeListener() { 57 | @Override 58 | public void onPageScrolled(int i, float v, int i1) { 59 | 60 | } 61 | 62 | @Override 63 | public void onPageSelected(int i) { 64 | pageIndex = i; 65 | mIndicatorOne.setImageDrawable(getResources().getDrawable(R.drawable.circle_gray)); 66 | mIndicatorTwo.setImageDrawable(getResources().getDrawable(R.drawable.circle_gray)); 67 | mIndicatorThree.setImageDrawable(getResources().getDrawable(R.drawable.circle_gray)); 68 | switch (i){ 69 | case 0: 70 | SHOW_TWO_ANIM = true; 71 | mIndicatorOne.setImageDrawable(getResources().getDrawable(R.drawable.circle_main)); 72 | break; 73 | case 1: 74 | mIndicatorTwo.setImageDrawable(getResources().getDrawable(R.drawable.circle_main)); 75 | break; 76 | case 2: 77 | SHOW_TWO_ANIM = false; 78 | mIndicatorThree.setImageDrawable(getResources().getDrawable(R.drawable.circle_main)); 79 | break; 80 | } 81 | 82 | } 83 | 84 | @Override 85 | public void onPageScrollStateChanged(int i) { 86 | 87 | } 88 | }); 89 | //点击分发 实现两个viewpager的联动,根据横向滑动距离和方向判断是否应该翻页 90 | mTouchLayout.setOnTouchListener(new View.OnTouchListener() { 91 | float startX; 92 | float startY;//没有用到 93 | float endX; 94 | float endY;//没有用到 95 | @Override 96 | public boolean onTouch(View v, MotionEvent event) { 97 | switch (event.getAction()) { 98 | case MotionEvent.ACTION_DOWN: 99 | startX = event.getX(); 100 | startY = event.getY(); 101 | break; 102 | case MotionEvent.ACTION_UP: 103 | endX = event.getX(); 104 | endY = event.getY(); 105 | WindowManager windowManager = (WindowManager) getApplicationContext().getSystemService(Context.WINDOW_SERVICE); 106 | Point size = new Point(); 107 | windowManager.getDefaultDisplay().getSize(size); 108 | int width = size.x; 109 | if (startX - endX >= (width / 8)){// startX - endX 大于0 且大于宽的1/8 可以往后翻页 110 | if (pageIndex == 0){ 111 | mImageViewPager.setCurrentItem(1); 112 | mTextPager.setCurrentItem(1, true); 113 | }else if (pageIndex == 1){ 114 | mImageViewPager.setCurrentItem(2); 115 | mTextPager.setCurrentItem(2, true); 116 | } 117 | }else if (endX - startX >= (width / 8)){ // endX - startX 大于0 且大于宽的1/8 可以往前翻页 118 | if (pageIndex == 2){ 119 | mImageViewPager.setCurrentItem(1); 120 | mTextPager.setCurrentItem(1, true); 121 | }else if (pageIndex == 1){ 122 | mImageViewPager.setCurrentItem(0); 123 | mTextPager.setCurrentItem(0, true); 124 | } 125 | } 126 | 127 | break; 128 | } 129 | return true; 130 | } 131 | }); 132 | } 133 | 134 | public void onLogin(View view) { 135 | Toast.makeText(this, "登录/注册", Toast.LENGTH_SHORT).show(); 136 | } 137 | 138 | public void onMain(View view) { 139 | Toast.makeText(this, "立即体验", Toast.LENGTH_SHORT).show(); 140 | } 141 | } 142 | -------------------------------------------------------------------------------- /app/src/main/java/com/wobiancao/guidedemo/MyInterceptViewPager.java: -------------------------------------------------------------------------------- 1 | package com.wobiancao.guidedemo; 2 | 3 | import android.content.Context; 4 | import android.support.v4.view.ViewPager; 5 | import android.util.AttributeSet; 6 | import android.view.MotionEvent; 7 | 8 | /** 9 | * Created by wobiancao on 19/1/11. 10 | */ 11 | public class MyInterceptViewPager extends ViewPager { 12 | private boolean isScrollable = true; 13 | 14 | public MyInterceptViewPager(Context context) { 15 | super(context); 16 | } 17 | 18 | public MyInterceptViewPager(Context context, AttributeSet attrs) { 19 | super(context, attrs); 20 | } 21 | 22 | 23 | @Override 24 | public boolean onTouchEvent(MotionEvent ev) { 25 | return isScrollable && super.onTouchEvent(ev); 26 | } 27 | 28 | @Override 29 | public boolean onInterceptTouchEvent(MotionEvent ev) { 30 | return isScrollable && super.onInterceptTouchEvent(ev); 31 | } 32 | 33 | @Override 34 | public void setCurrentItem(int item) { 35 | super.setCurrentItem(item, false);//表示切换的时候,不需要切换时间。 36 | } 37 | 38 | @Override 39 | public void setCurrentItem(int item, boolean smoothScroll) { 40 | super.setCurrentItem(item, smoothScroll); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /app/src/main/java/com/wobiancao/guidedemo/adapter/MyFragmentPagerAdapter.java: -------------------------------------------------------------------------------- 1 | package com.wobiancao.guidedemo.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 com.wobiancao.guidedemo.fragment.FragmentOnePage; 8 | import com.wobiancao.guidedemo.fragment.FragmentThreePage; 9 | import com.wobiancao.guidedemo.fragment.FragmentTwoPage; 10 | /** 11 | * Created by wobiancao on 19/1/11. 12 | */ 13 | public class MyFragmentPagerAdapter extends FragmentPagerAdapter{ 14 | private final static int PAGE_COUNT = 3; 15 | 16 | public MyFragmentPagerAdapter(FragmentManager fm) { 17 | super(fm); 18 | } 19 | 20 | @Override 21 | public Fragment getItem(int i) { 22 | Fragment itemFragment = null; 23 | switch (i){ 24 | case 0: 25 | itemFragment = FragmentOnePage.newInstance(); 26 | break; 27 | case 1: 28 | itemFragment = FragmentTwoPage.newInstance(); 29 | break; 30 | case 2: 31 | itemFragment = FragmentThreePage.newInstance(); 32 | break; 33 | default: 34 | break; 35 | } 36 | 37 | return itemFragment; 38 | } 39 | 40 | @Override 41 | public int getCount() { 42 | return PAGE_COUNT; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /app/src/main/java/com/wobiancao/guidedemo/adapter/TextPagerAdapter.java: -------------------------------------------------------------------------------- 1 | package com.wobiancao.guidedemo.adapter; 2 | 3 | 4 | import android.support.v4.view.PagerAdapter; 5 | import android.view.LayoutInflater; 6 | import android.view.View; 7 | import android.view.ViewGroup; 8 | import android.widget.ImageView; 9 | import android.widget.TextView; 10 | 11 | import com.wobiancao.guidedemo.R; 12 | 13 | 14 | /** 15 | * Created by wobiancao on 19/1/11. 16 | */ 17 | public class TextPagerAdapter extends PagerAdapter { 18 | private final static int PAGE_COUNT = 3; 19 | @Override 20 | public Object instantiateItem(ViewGroup collection, int position) { 21 | View view = LayoutInflater.from(collection.getContext()).inflate(R.layout.pager_adapter_text, null); 22 | TextView mTitle = view.findViewById(R.id.pager_text_title); 23 | TextView mInfo = view.findViewById(R.id.pager_text_info); 24 | switch (position) { 25 | case 0: 26 | mTitle.setText(collection.getResources().getString(R.string.guid_text_one_title)); 27 | mInfo.setText(collection.getResources().getString(R.string.guid_text_one_info)); 28 | break; 29 | case 1: 30 | mTitle.setText(collection.getResources().getString(R.string.guid_text_two_title)); 31 | mInfo.setText(collection.getResources().getString(R.string.guid_text_two_info)); 32 | break; 33 | case 2: 34 | mTitle.setText(collection.getResources().getString(R.string.guid_text_three_title)); 35 | mInfo.setText(collection.getResources().getString(R.string.guid_text_three_info)); 36 | break; 37 | default: 38 | break; 39 | } 40 | 41 | collection.addView(view); 42 | return view; 43 | } 44 | 45 | @Override 46 | public void destroyItem(ViewGroup collection, int position, Object view) { 47 | collection.removeView((View) view); 48 | } 49 | 50 | @Override 51 | public int getCount() { 52 | return PAGE_COUNT; 53 | } 54 | 55 | @Override 56 | public boolean isViewFromObject(View view, Object object) { 57 | return view == object; 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /app/src/main/java/com/wobiancao/guidedemo/fragment/FragmentOnePage.java: -------------------------------------------------------------------------------- 1 | package com.wobiancao.guidedemo.fragment; 2 | 3 | import android.os.Bundle; 4 | import android.widget.ImageView; 5 | 6 | import com.wobiancao.guidedemo.LazyLoadFragment; 7 | import com.wobiancao.guidedemo.R; 8 | /** 9 | * Created by wobiancao on 19/1/11. 10 | */ 11 | public class FragmentOnePage extends LazyLoadFragment { 12 | ImageView mBgView; 13 | ImageView mShowView; 14 | 15 | public static FragmentOnePage newInstance() { 16 | FragmentOnePage page = new FragmentOnePage(); 17 | Bundle args = new Bundle(); 18 | page.setArguments(args); 19 | return page; 20 | } 21 | 22 | @Override 23 | protected void initView(Bundle savedInstanceState) { 24 | mBgView = findViewById(R.id.image_one_bg); 25 | mShowView = findViewById(R.id.image_one_show); 26 | } 27 | 28 | @Override 29 | protected int setContentView() { 30 | return R.layout.frgamnet_onepage; 31 | } 32 | 33 | @Override 34 | protected void lazyLoad() { 35 | 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /app/src/main/java/com/wobiancao/guidedemo/fragment/FragmentThreePage.java: -------------------------------------------------------------------------------- 1 | package com.wobiancao.guidedemo.fragment; 2 | 3 | import android.os.Bundle; 4 | import android.view.View; 5 | import android.view.animation.Animation; 6 | import android.view.animation.AnimationUtils; 7 | import android.widget.ImageView; 8 | 9 | import com.wobiancao.guidedemo.LazyLoadFragment; 10 | import com.wobiancao.guidedemo.MainActivity; 11 | import com.wobiancao.guidedemo.R; 12 | /** 13 | * Created by wobiancao on 19/1/11. 14 | */ 15 | public class FragmentThreePage extends LazyLoadFragment { 16 | ImageView mBgView; 17 | ImageView mShowView; 18 | Animation mShowAnim, mAlphaAnim; 19 | 20 | public static FragmentThreePage newInstance() { 21 | FragmentThreePage page = new FragmentThreePage(); 22 | Bundle args = new Bundle(); 23 | page.setArguments(args); 24 | return page; 25 | } 26 | 27 | @Override 28 | protected void initView(Bundle savedInstanceState) { 29 | mBgView = findViewById(R.id.image_three_bg); 30 | mShowView = findViewById(R.id.image_three_show); 31 | mShowAnim = AnimationUtils.loadAnimation(getActivity(), R.anim.trans_three_bottom_up); 32 | mAlphaAnim = AnimationUtils.loadAnimation(getActivity(), R.anim.alpha); 33 | mBgView.setVisibility(View.INVISIBLE); 34 | mShowView.setVisibility(View.INVISIBLE); 35 | 36 | } 37 | 38 | @Override 39 | protected int setContentView() { 40 | return R.layout.frgamnet_threepage; 41 | } 42 | 43 | @Override 44 | protected void lazyLoad() { 45 | MainActivity.SHOW_TWO_ANIM = false; 46 | mBgView.post(new Runnable() { 47 | @Override 48 | public void run() { 49 | mBgView.postDelayed(new Runnable() { 50 | @Override 51 | public void run() { 52 | mBgView.startAnimation(mAlphaAnim); 53 | mBgView.setVisibility(View.VISIBLE); 54 | } 55 | }, 250); 56 | 57 | mShowView.startAnimation(mShowAnim); 58 | mShowView.setVisibility(View.VISIBLE); 59 | } 60 | }); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /app/src/main/java/com/wobiancao/guidedemo/fragment/FragmentTwoPage.java: -------------------------------------------------------------------------------- 1 | package com.wobiancao.guidedemo.fragment; 2 | 3 | import android.os.Bundle; 4 | import android.view.View; 5 | import android.view.animation.Animation; 6 | import android.view.animation.AnimationUtils; 7 | import android.widget.ImageView; 8 | 9 | import com.wobiancao.guidedemo.LazyLoadFragment; 10 | import com.wobiancao.guidedemo.MainActivity; 11 | import com.wobiancao.guidedemo.R; 12 | /** 13 | * Created by wobiancao on 19/1/11. 14 | */ 15 | public class FragmentTwoPage extends LazyLoadFragment { 16 | ImageView mBgView; 17 | ImageView mShowView; 18 | ImageView mHeadView; 19 | Animation mShowAnim, mAlphaAnim; 20 | 21 | public static FragmentTwoPage newInstance() { 22 | FragmentTwoPage page = new FragmentTwoPage(); 23 | Bundle args = new Bundle(); 24 | page.setArguments(args); 25 | return page; 26 | } 27 | 28 | @Override 29 | protected void initView(Bundle savedInstanceState) { 30 | mBgView = findViewById(R.id.image_two_bg); 31 | mShowView = findViewById(R.id.image_two_show); 32 | mHeadView = findViewById(R.id.image_two_head); 33 | mShowAnim = AnimationUtils.loadAnimation(getActivity(), R.anim.trans_two_bottom_up); 34 | mAlphaAnim = AnimationUtils.loadAnimation(getActivity(), R.anim.alpha); 35 | } 36 | 37 | @Override 38 | protected int setContentView() { 39 | return R.layout.frgamnet_twopage; 40 | } 41 | 42 | @Override 43 | protected void lazyLoad() { 44 | if (MainActivity.SHOW_TWO_ANIM){ 45 | mBgView.setVisibility(View.INVISIBLE); 46 | mShowView.setVisibility(View.INVISIBLE); 47 | mHeadView.setVisibility(View.INVISIBLE); 48 | mBgView.post(new Runnable() { 49 | @Override 50 | public void run() { 51 | mBgView.postDelayed(new Runnable() { 52 | @Override 53 | public void run() { 54 | mBgView.startAnimation(mAlphaAnim); 55 | mBgView.setVisibility(View.VISIBLE); 56 | mHeadView.startAnimation(mAlphaAnim); 57 | mHeadView.setVisibility(View.VISIBLE); 58 | } 59 | }, 250); 60 | mShowView.startAnimation(mShowAnim); 61 | mShowView.setVisibility(View.VISIBLE); 62 | 63 | } 64 | }); 65 | } else { 66 | mBgView.setVisibility(View.VISIBLE); 67 | mShowView.setVisibility(View.VISIBLE); 68 | mHeadView.setVisibility(View.VISIBLE); 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /app/src/main/res/anim/alpha.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /app/src/main/res/anim/trans_three_bottom_up.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 17 | 18 | -------------------------------------------------------------------------------- /app/src/main/res/anim/trans_two_bottom_up.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | -------------------------------------------------------------------------------- /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/a0c.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wobiancao/Music163GuideDemo/a698b1fdd8709ef0f3c07455f4b4a15f50993eee/app/src/main/res/drawable/a0c.9.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/circle_gray.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | 10 | 11 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/circle_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | 10 | 11 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /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/drawable/shape_color_next.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/shape_gradient_login.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 15 | 16 | 21 | 22 | 23 | 30 | 31 | 32 | 33 | 41 | 42 | 43 | 44 | 48 | 49 | 55 | 56 | 62 | 68 | 74 | 80 | 81 | 82 | 87 | 88 | 99 | 100 | 110 | 111 | 112 | -------------------------------------------------------------------------------- /app/src/main/res/layout/frgamnet_onepage.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 15 | 19 | 26 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /app/src/main/res/layout/frgamnet_threepage.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 16 | 20 | 27 | 28 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /app/src/main/res/layout/frgamnet_twopage.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 15 | 19 | 26 | 36 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /app/src/main/res/layout/pager_adapter_text.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 15 | 23 | 24 | -------------------------------------------------------------------------------- /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/wobiancao/Music163GuideDemo/a698b1fdd8709ef0f3c07455f4b4a15f50993eee/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wobiancao/Music163GuideDemo/a698b1fdd8709ef0f3c07455f4b4a15f50993eee/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wobiancao/Music163GuideDemo/a698b1fdd8709ef0f3c07455f4b4a15f50993eee/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wobiancao/Music163GuideDemo/a698b1fdd8709ef0f3c07455f4b4a15f50993eee/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wobiancao/Music163GuideDemo/a698b1fdd8709ef0f3c07455f4b4a15f50993eee/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wobiancao/Music163GuideDemo/a698b1fdd8709ef0f3c07455f4b4a15f50993eee/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/b42.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wobiancao/Music163GuideDemo/a698b1fdd8709ef0f3c07455f4b4a15f50993eee/app/src/main/res/mipmap-xxhdpi/b42.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/b43.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wobiancao/Music163GuideDemo/a698b1fdd8709ef0f3c07455f4b4a15f50993eee/app/src/main/res/mipmap-xxhdpi/b43.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/b44.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wobiancao/Music163GuideDemo/a698b1fdd8709ef0f3c07455f4b4a15f50993eee/app/src/main/res/mipmap-xxhdpi/b44.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/b45.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wobiancao/Music163GuideDemo/a698b1fdd8709ef0f3c07455f4b4a15f50993eee/app/src/main/res/mipmap-xxhdpi/b45.9.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/b49.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wobiancao/Music163GuideDemo/a698b1fdd8709ef0f3c07455f4b4a15f50993eee/app/src/main/res/mipmap-xxhdpi/b49.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/b4_.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wobiancao/Music163GuideDemo/a698b1fdd8709ef0f3c07455f4b4a15f50993eee/app/src/main/res/mipmap-xxhdpi/b4_.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wobiancao/Music163GuideDemo/a698b1fdd8709ef0f3c07455f4b4a15f50993eee/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wobiancao/Music163GuideDemo/a698b1fdd8709ef0f3c07455f4b4a15f50993eee/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wobiancao/Music163GuideDemo/a698b1fdd8709ef0f3c07455f4b4a15f50993eee/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wobiancao/Music163GuideDemo/a698b1fdd8709ef0f3c07455f4b4a15f50993eee/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #3F51B5 4 | #303F9F 5 | #FF4081 6 | #fff75446 7 | #ffffff 8 | #eecc0000 9 | #c8c8c8 10 | #fff1f2f3 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 130dp 4 | 120dp 5 | 60dp 6 | 70dp 7 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | Music163GuideDemo 3 | 个 性 推 荐 4 | 每 天 为 你 良 心 推 荐 最 合 口 味 的 好 音 乐 5 | 精 彩 评 论 6 | 9 亿 多 条 有 趣 的 故 事,听 歌 再 不 孤 单 7 | 精 选 视 频 8 | 音 乐 热 点,娱 乐 资 讯 尽 收 眼 底 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /app/src/test/java/com/wobiancao/guidedemo/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package com.wobiancao.guidedemo; 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() { 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.1.3' 11 | 12 | 13 | // NOTE: Do not place your application dependencies here; they belong 14 | // in the individual module build.gradle files 15 | } 16 | } 17 | 18 | allprojects { 19 | repositories { 20 | google() 21 | jcenter() 22 | } 23 | } 24 | 25 | task clean(type: Delete) { 26 | delete rootProject.buildDir 27 | } 28 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | # IDE (e.g. Android Studio) users: 3 | # Gradle settings configured through the IDE *will override* 4 | # any settings specified in this file. 5 | # For more details on how to configure your build environment visit 6 | # http://www.gradle.org/docs/current/userguide/build_environment.html 7 | # Specifies the JVM arguments used for the daemon process. 8 | # The setting is particularly useful for tweaking memory settings. 9 | org.gradle.jvmargs=-Xmx1536m 10 | # When configured, Gradle will run in incubating parallel mode. 11 | # This option should only be used with decoupled projects. More details, visit 12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 13 | # org.gradle.parallel=true 14 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wobiancao/Music163GuideDemo/a698b1fdd8709ef0f3c07455f4b4a15f50993eee/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Thu Jan 10 16:38:29 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.4-all.zip 7 | -------------------------------------------------------------------------------- /gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Attempt to set APP_HOME 10 | # Resolve links: $0 may be a link 11 | PRG="$0" 12 | # Need this for relative symlinks. 13 | while [ -h "$PRG" ] ; do 14 | ls=`ls -ld "$PRG"` 15 | link=`expr "$ls" : '.*-> \(.*\)$'` 16 | if expr "$link" : '/.*' > /dev/null; then 17 | PRG="$link" 18 | else 19 | PRG=`dirname "$PRG"`"/$link" 20 | fi 21 | done 22 | SAVED="`pwd`" 23 | cd "`dirname \"$PRG\"`/" >/dev/null 24 | APP_HOME="`pwd -P`" 25 | cd "$SAVED" >/dev/null 26 | 27 | APP_NAME="Gradle" 28 | APP_BASE_NAME=`basename "$0"` 29 | 30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 31 | DEFAULT_JVM_OPTS="" 32 | 33 | # Use the maximum available, or set MAX_FD != -1 to use that value. 34 | MAX_FD="maximum" 35 | 36 | warn () { 37 | echo "$*" 38 | } 39 | 40 | die () { 41 | echo 42 | echo "$*" 43 | echo 44 | exit 1 45 | } 46 | 47 | # OS specific support (must be 'true' or 'false'). 48 | cygwin=false 49 | msys=false 50 | darwin=false 51 | nonstop=false 52 | case "`uname`" in 53 | CYGWIN* ) 54 | cygwin=true 55 | ;; 56 | Darwin* ) 57 | darwin=true 58 | ;; 59 | MINGW* ) 60 | msys=true 61 | ;; 62 | NONSTOP* ) 63 | nonstop=true 64 | ;; 65 | esac 66 | 67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 68 | 69 | # Determine the Java command to use to start the JVM. 70 | if [ -n "$JAVA_HOME" ] ; then 71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 72 | # IBM's JDK on AIX uses strange locations for the executables 73 | JAVACMD="$JAVA_HOME/jre/sh/java" 74 | else 75 | JAVACMD="$JAVA_HOME/bin/java" 76 | fi 77 | if [ ! -x "$JAVACMD" ] ; then 78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 79 | 80 | Please set the JAVA_HOME variable in your environment to match the 81 | location of your Java installation." 82 | fi 83 | else 84 | JAVACMD="java" 85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 86 | 87 | Please set the JAVA_HOME variable in your environment to match the 88 | location of your Java installation." 89 | fi 90 | 91 | # Increase the maximum file descriptors if we can. 92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then 93 | MAX_FD_LIMIT=`ulimit -H -n` 94 | if [ $? -eq 0 ] ; then 95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 96 | MAX_FD="$MAX_FD_LIMIT" 97 | fi 98 | ulimit -n $MAX_FD 99 | if [ $? -ne 0 ] ; then 100 | warn "Could not set maximum file descriptor limit: $MAX_FD" 101 | fi 102 | else 103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 104 | fi 105 | fi 106 | 107 | # For Darwin, add options to specify how the application appears in the dock 108 | if $darwin; then 109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 110 | fi 111 | 112 | # For Cygwin, switch paths to Windows format before running java 113 | if $cygwin ; then 114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 116 | JAVACMD=`cygpath --unix "$JAVACMD"` 117 | 118 | # We build the pattern for arguments to be converted via cygpath 119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 120 | SEP="" 121 | for dir in $ROOTDIRSRAW ; do 122 | ROOTDIRS="$ROOTDIRS$SEP$dir" 123 | SEP="|" 124 | done 125 | OURCYGPATTERN="(^($ROOTDIRS))" 126 | # Add a user-defined pattern to the cygpath arguments 127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 129 | fi 130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 131 | i=0 132 | for arg in "$@" ; do 133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 135 | 136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 138 | else 139 | eval `echo args$i`="\"$arg\"" 140 | fi 141 | i=$((i+1)) 142 | done 143 | case $i in 144 | (0) set -- ;; 145 | (1) set -- "$args0" ;; 146 | (2) set -- "$args0" "$args1" ;; 147 | (3) set -- "$args0" "$args1" "$args2" ;; 148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 154 | esac 155 | fi 156 | 157 | # Escape application args 158 | save () { 159 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done 160 | echo " " 161 | } 162 | APP_ARGS=$(save "$@") 163 | 164 | # Collect all arguments for the java command, following the shell quoting and substitution rules 165 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" 166 | 167 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong 168 | if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then 169 | cd "$(dirname "$0")" 170 | fi 171 | 172 | exec "$JAVACMD" "$@" 173 | -------------------------------------------------------------------------------- /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 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS= 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 Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | 53 | :win9xME_args 54 | @rem Slurp the command line arguments. 55 | set CMD_LINE_ARGS= 56 | set _SKIP=2 57 | 58 | :win9xME_args_slurp 59 | if "x%~1" == "x" goto execute 60 | 61 | set CMD_LINE_ARGS=%* 62 | 63 | :execute 64 | @rem Setup the command line 65 | 66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 67 | 68 | @rem Execute Gradle 69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 70 | 71 | :end 72 | @rem End local scope for the variables with windows NT shell 73 | if "%ERRORLEVEL%"=="0" goto mainEnd 74 | 75 | :fail 76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 77 | rem the _cmd.exe /c_ return code! 78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 79 | exit /b 1 80 | 81 | :mainEnd 82 | if "%OS%"=="Windows_NT" endlocal 83 | 84 | :omega 85 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | --------------------------------------------------------------------------------