├── .circleci └── config.yml ├── .gitignore ├── .travis.yml ├── GIF.gif ├── LICENSE ├── README.md ├── app ├── .gitignore ├── build.gradle ├── proguard-rules.pro ├── release │ ├── app-release.apk │ └── output.json └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── king │ │ └── guide │ │ └── app │ │ └── ExampleInstrumentedTest.kt │ ├── main │ ├── AndroidManifest.xml │ ├── ic_launcher-web.png │ ├── java │ │ └── com │ │ │ └── king │ │ │ └── guide │ │ │ └── app │ │ │ └── MainActivity.kt │ └── res │ │ ├── drawable-v24 │ │ └── ic_launcher_foreground.xml │ │ ├── drawable-xxhdpi │ │ ├── btn_done.png │ │ ├── guide_page_1.png │ │ ├── guide_page_2.png │ │ ├── guide_page_3.png │ │ └── guide_page_4.png │ │ ├── drawable │ │ ├── ic_launcher_background.xml │ │ ├── indicator.xml │ │ └── indicator_radius.xml │ │ ├── layout │ │ └── activity_main.xml │ │ ├── mipmap-anydpi-v26 │ │ ├── ic_launcher.xml │ │ └── ic_launcher_round.xml │ │ ├── mipmap-hdpi │ │ ├── ic_launcher.png │ │ ├── ic_launcher_foreground.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-mdpi │ │ ├── ic_launcher.png │ │ ├── ic_launcher_foreground.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xhdpi │ │ ├── ic_launcher.png │ │ ├── ic_launcher_foreground.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxhdpi │ │ ├── ic_launcher.png │ │ ├── ic_launcher_foreground.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxxhdpi │ │ ├── ic_launcher.png │ │ ├── ic_launcher_foreground.png │ │ └── ic_launcher_round.png │ │ └── values │ │ ├── colors.xml │ │ ├── ic_launcher_background.xml │ │ ├── strings.xml │ │ └── styles.xml │ └── test │ └── java │ └── com │ └── king │ └── guide │ └── app │ └── ExampleUnitTest.kt ├── build.gradle ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── guidepage ├── .gitignore ├── bintray.gradle ├── build.gradle ├── consumer-rules.pro ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── king │ │ └── guide │ │ └── guidepage │ │ └── ExampleInstrumentedTest.kt │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── com │ │ │ └── king │ │ │ └── guide │ │ │ └── guidepage │ │ │ ├── GuidePage.kt │ │ │ ├── GuidePageActivity.kt │ │ │ ├── GuidePageAdapter.kt │ │ │ ├── GuidePageSpec.kt │ │ │ └── IndicatorConfig.kt │ └── res │ │ ├── anim │ │ ├── gp_anim_in.xml │ │ └── gp_anim_out.xml │ │ ├── drawable │ │ ├── gp_indicator_drawable.xml │ │ └── gp_skip_background.xml │ │ ├── layout │ │ ├── gp_guide_page_activity.xml │ │ └── gp_guide_page_item.xml │ │ ├── values-v19 │ │ └── styles.xml │ │ ├── values-v21 │ │ └── styles.xml │ │ ├── values-zh │ │ └── strings.xml │ │ └── values │ │ ├── colors.xml │ │ ├── dimens.xml │ │ ├── strings.xml │ │ └── styles.xml │ └── test │ └── java │ └── com │ └── king │ └── guide │ └── guidepage │ └── ExampleUnitTest.kt ├── settings.gradle └── versions.gradle /.circleci/config.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | jobs: 3 | build: 4 | working_directory: ~/code 5 | docker: 6 | - image: circleci/android:api-29 7 | environment: 8 | JVM_OPTS: -Xmx3200m 9 | steps: 10 | - checkout 11 | - restore_cache: 12 | key: jars-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }} 13 | - run: 14 | name: Download Dependencies 15 | command: ./gradlew androidDependencies 16 | - save_cache: 17 | paths: 18 | - ~/.gradle 19 | key: jars-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }} 20 | - run: 21 | name: Run Tests 22 | command: ./gradlew lint test 23 | - store_artifacts: 24 | path: app/build/reports 25 | destination: reports 26 | - store_test_results: 27 | path: app/build/test-results -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea 5 | .DS_Store 6 | /build 7 | /captures 8 | .externalNativeBuild 9 | .cxx 10 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: android 2 | dist: trusty 3 | jdk: oraclejdk8 4 | sudo: false 5 | 6 | env: 7 | global: 8 | - ANDROID_API_LEVEL=29 9 | - ANDROID_BUILD_TOOLS_VERSION=29.0.2 10 | - TRAVIS_SECURE_ENV_VARS=true 11 | 12 | before_install: 13 | - chmod +x gradlew 14 | - mkdir "$ANDROID_HOME/licenses" || true 15 | # Hack to accept Android licenses 16 | - yes | sdkmanager "platforms;android-$ANDROID_API_LEVEL" 17 | 18 | 19 | android: 20 | components: 21 | # The BuildTools version used by your project 22 | - tools 23 | - platform-tools 24 | - build-tools-$ANDROID_BUILD_TOOLS_VERSION 25 | # The SDK version used to compile your project 26 | - android-$ANDROID_API_LEVEL 27 | - extra-android-m2repository 28 | - extra-google-android-support 29 | 30 | script: 31 | - ./gradlew clean 32 | - ./gradlew assembleRelease -------------------------------------------------------------------------------- /GIF.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenly1314/GuidePage/648ac49e95c8bac713c16142a87678dc658e1050/GIF.gif -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2019 Jenly Yu 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # GuidePage 2 | 3 | ![Image](app/src/main/ic_launcher-web.png) 4 | 5 | [![JitPack](https://img.shields.io/jitpack/v/github/jenly1314/GuidePage?logo=jitpack)](https://jitpack.io/#jenly1314/GuidePage) 6 | [![Download](https://img.shields.io/badge/download-APK-brightgreen?logo=github)](https://raw.githubusercontent.com/jenly1314/GuidePage/master/app/release/app-release.apk) 7 | [![API](https://img.shields.io/badge/API-16%2B-brightgreen?logo=android)](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) 8 | [![License](https://img.shields.io/github/license/jenly1314/GuidePage?logo=open-source-initiative)](https://opensource.org/licenses/mit) 9 | 10 | 11 | GuidePage for Android 是一个App欢迎引导页。一般用于首次打开App时场景,通过引导页指南,概述App特色等相关信息 12 | 13 | ## 功能介绍 14 | - [x] 链式调用,简单易用 15 | - [x] 自定义配置,满足各种需求 16 | 17 | 18 | ## 效果展示 19 | ![Image](GIF.gif) 20 | 21 | > 你也可以直接下载 [演示App](https://raw.githubusercontent.com/jenly1314/GuidePage/master/app/release/app-release.apk) 体验效果 22 | 23 | ## 引入 24 | 25 | ### Gradle: 26 | 27 | 1. 在Project的 **build.gradle** 或 **setting.gradle** 中添加远程仓库 28 | 29 | ```gradle 30 | repositories { 31 | //... 32 | mavenCentral() 33 | maven { url 'https://jitpack.io' } 34 | } 35 | ``` 36 | 37 | 2. 在Module的 **build.gradle** 中添加依赖项 38 | 39 | ```gradle 40 | implementation 'com.github.jenly1314:GuidePage:1.0.0' 41 | ``` 42 | 43 | ## 使用 44 | 45 | ### 代码示例 46 | 47 | ```Kotlin 48 | //简单调用示例 49 | GuidePage.load(intArrayOf(R.drawable.guide_page_1,R.drawable.guide_page_2,R.drawable.guide_page_3,R.drawable.guide_page_4)) 50 | .pageDoneDrawableResource(R.drawable.btn_done) 51 | .start(this)//Activity or Fragment 52 | ``` 53 | 54 | ```Kotlin 55 | //Demo中的调用示例 56 | GuidePage.load(intArrayOf(R.drawable.guide_page_1,R.drawable.guide_page_2,R.drawable.guide_page_3,R.drawable.guide_page_4)) 57 | .pageDoneDrawableResource(R.drawable.btn_done) 58 | // .indicatorDrawableResource(R.drawable.indicator_radius) 59 | // .indicatorSize(this,6f)//默认5dp 60 | .showSkip(v.id == R.id.btn1)//是否显示“跳过” 61 | .lastPageHideSkip(true)//最后一页是否隐藏“跳过” 62 | .onGuidePageChangeCallback(object : GuidePage.OnGuidePageChangeCallback{//引导页改变回调接口 63 | 64 | override fun onPageDone(skip: Boolean) { 65 | //TODO 当点击完成(立即体验)或者右上角的跳过时,触发此回调方法 66 | //这里可以执行您的逻辑,比如跳转到APP首页或者登陆页 67 | if(skip){ 68 | Toast.makeText(this@MainActivity,"跳过",Toast.LENGTH_SHORT).show() 69 | }else{ 70 | Toast.makeText(this@MainActivity,"立即体验",Toast.LENGTH_SHORT).show() 71 | } 72 | } 73 | 74 | }) 75 | .start(this)//Activity or Fragment 76 | 77 | ``` 78 | 79 | ### 相关说明 80 | 81 | > * 通过**GuidePage**链式调用,可以满足一些基本需求场景。 82 | 83 | > * 当**GuidePage**中提供的配置无法满足需求时,可通过资源命名相同方式去自定义配置,即:资源覆盖方式。如**dimens**、**styles**等对应的资源。 84 | 85 | 86 | 更多使用详情,请查看[app](app)中的源码使用示例或直接查看 [API帮助文档](https://jitpack.io/com/github/jenly1314/GuidePage/latest/javadoc/) 87 | 88 | ## 相关推荐 89 | - [SpinCounterView](https://github.com/jenly1314/SpinCounterView) 一个类似码表变化的旋转计数器动画控件。 90 | - [CounterView](https://github.com/jenly1314/CounterView) 一个数字变化效果的计数器视图控件。 91 | - [RadarView](https://github.com/jenly1314/RadarView) 一个雷达扫描动画后,然后展示得分效果的控件。 92 | - [SuperTextView](https://github.com/jenly1314/SuperTextView) 一个在TextView的基础上扩展了几种动画效果的控件。 93 | - [LoadingView](https://github.com/jenly1314/LoadingView) 一个圆弧加载过渡动画,圆弧个数,大小,弧度,渐变颜色,完全可配。 94 | - [WaveView](https://github.com/jenly1314/WaveView) 一个水波纹动画控件视图,支持波纹数,波纹振幅,波纹颜色,波纹速度,波纹方向等属性完全可配。 95 | - [GiftSurfaceView](https://github.com/jenly1314/GiftSurfaceView) 一个适用于直播间送礼物拼图案的动画控件。 96 | - [FlutteringLayout](https://github.com/jenly1314/FlutteringLayout) 一个适用于直播间点赞桃心飘动效果的控件。 97 | - [DragPolygonView](https://github.com/jenly1314/DragPolygonView) 一个支持可拖动多边形,支持通过拖拽多边形的角改变其形状的任意多边形控件。 98 | - [CircleProgressView](https://github.com/jenly1314/CircleProgressView) 一个圆形的进度动画控件,动画效果纵享丝滑。 99 | - [ArcSeekBar](https://github.com/jenly1314/ArcSeekBar) 一个弧形的拖动条进度控件,配置参数完全可定制化。 100 | - [DrawBoard](https://github.com/jenly1314/DrawBoard) 一个自定义View实现的画板;方便对图片进行编辑和各种涂鸦相关操作。 101 | - [compose-component](https://github.com/jenly1314/compose-component) 一个Jetpack Compose的组件库;主要提供了一些小组件,便于快速使用。 102 | 103 | ## 版本日志 104 | 105 | #### v1.0.0:2019-12-24 106 | * GuidePage初始版本 107 | 108 | --- 109 | 110 | ![footer](https://jenly1314.github.io/page/footer.svg) 111 | 112 | -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | apply plugin: 'kotlin-android' 4 | 5 | apply plugin: 'kotlin-android-extensions' 6 | 7 | android { 8 | compileSdkVersion build_versions.compileSdk 9 | buildToolsVersion build_versions.buildTools 10 | defaultConfig { 11 | applicationId "com.king.guide.app" 12 | minSdkVersion build_versions.minSdk 13 | targetSdkVersion build_versions.targetSdk 14 | versionCode app_version.versionCode 15 | versionName app_version.versionName 16 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 17 | multiDexEnabled true 18 | 19 | } 20 | buildTypes { 21 | release { 22 | minifyEnabled false 23 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' 24 | } 25 | } 26 | } 27 | 28 | 29 | dependencies { 30 | implementation fileTree(dir: 'libs', include: ['*.jar']) 31 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$versions.kotlin" 32 | implementation "androidx.appcompat:appcompat:$versions.appcompat" 33 | implementation "androidx.core:core-ktx:$versions.core_ktx" 34 | testImplementation "junit:junit:$versions.junit" 35 | androidTestImplementation "androidx.test:runner:$versions.runner" 36 | androidTestImplementation "androidx.test.espresso:espresso-core:$versions.espresso_core" 37 | 38 | implementation "androidx.constraintlayout:constraintlayout:$versions.constraintlayout" 39 | implementation project(path: ':guidepage') 40 | } 41 | -------------------------------------------------------------------------------- /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/release/app-release.apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenly1314/GuidePage/648ac49e95c8bac713c16142a87678dc658e1050/app/release/app-release.apk -------------------------------------------------------------------------------- /app/release/output.json: -------------------------------------------------------------------------------- 1 | [{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":1,"versionName":"1.0.0","enabled":true,"outputFile":"app-release.apk","fullName":"release","baseName":"release"},"path":"app-release.apk","properties":{}}] -------------------------------------------------------------------------------- /app/src/androidTest/java/com/king/guide/app/ExampleInstrumentedTest.kt: -------------------------------------------------------------------------------- 1 | package com.king.guide.app 2 | 3 | import androidx.test.platform.app.InstrumentationRegistry 4 | import androidx.test.ext.junit.runners.AndroidJUnit4 5 | 6 | import org.junit.Test 7 | import org.junit.runner.RunWith 8 | 9 | import org.junit.Assert.* 10 | 11 | /** 12 | * Instrumented test, which will execute on an Android device. 13 | * 14 | * See [testing documentation](http://d.android.com/tools/testing). 15 | */ 16 | @RunWith(AndroidJUnit4::class) 17 | class ExampleInstrumentedTest { 18 | @Test 19 | fun useAppContext() { 20 | // Context of the app under test. 21 | val appContext = InstrumentationRegistry.getInstrumentation().targetContext 22 | assertEquals("com.king.guide.app", appContext.packageName) 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 12 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /app/src/main/ic_launcher-web.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenly1314/GuidePage/648ac49e95c8bac713c16142a87678dc658e1050/app/src/main/ic_launcher-web.png -------------------------------------------------------------------------------- /app/src/main/java/com/king/guide/app/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.king.guide.app 2 | 3 | import android.content.pm.ActivityInfo 4 | import android.os.Bundle 5 | import android.view.View 6 | import android.widget.Toast 7 | import androidx.appcompat.app.AppCompatActivity 8 | import com.king.guide.guidepage.GuidePage 9 | 10 | /** 11 | * GuidePage通过链式调用的方式 12 | * @author Jenly 13 | */ 14 | class MainActivity : AppCompatActivity() { 15 | 16 | override fun onCreate(savedInstanceState: Bundle?) { 17 | super.onCreate(savedInstanceState) 18 | setContentView(R.layout.activity_main) 19 | } 20 | 21 | 22 | fun onClick(v: View){ 23 | //GuidePage链式调用 24 | GuidePage.load(intArrayOf(R.drawable.guide_page_1,R.drawable.guide_page_2,R.drawable.guide_page_3,R.drawable.guide_page_4)) 25 | .pageDoneDrawableResource(R.drawable.btn_done) 26 | // .indicatorDrawableResource(R.drawable.indicator_radius) 27 | // .indicatorSize(this,6f)//默认5dp 28 | .showSkip(v.id == R.id.btn1)//是否显示“跳过” 29 | .lastPageHideSkip(true)//最后一页是否隐藏“跳过” 30 | .onGuidePageChangeCallback(object : GuidePage.OnGuidePageChangeCallback{//引导页改变回调接口 31 | 32 | override fun onPageDone(skip: Boolean) { 33 | //TODO 当点击完成(立即体验)或者右上角的跳过时,触发此回调方法 34 | //这里可以执行您的逻辑,比如跳转到APP首页或者登陆页 35 | if(skip){ 36 | Toast.makeText(this@MainActivity,"跳过",Toast.LENGTH_SHORT).show() 37 | }else{ 38 | Toast.makeText(this@MainActivity,"立即体验",Toast.LENGTH_SHORT).show() 39 | } 40 | } 41 | 42 | }) 43 | .start(this)//Activity or Fragment 44 | } 45 | 46 | 47 | } 48 | -------------------------------------------------------------------------------- /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-xxhdpi/btn_done.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenly1314/GuidePage/648ac49e95c8bac713c16142a87678dc658e1050/app/src/main/res/drawable-xxhdpi/btn_done.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/guide_page_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenly1314/GuidePage/648ac49e95c8bac713c16142a87678dc658e1050/app/src/main/res/drawable-xxhdpi/guide_page_1.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/guide_page_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenly1314/GuidePage/648ac49e95c8bac713c16142a87678dc658e1050/app/src/main/res/drawable-xxhdpi/guide_page_2.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/guide_page_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenly1314/GuidePage/648ac49e95c8bac713c16142a87678dc658e1050/app/src/main/res/drawable-xxhdpi/guide_page_3.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/guide_page_4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenly1314/GuidePage/648ac49e95c8bac713c16142a87678dc658e1050/app/src/main/res/drawable-xxhdpi/guide_page_4.png -------------------------------------------------------------------------------- /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/indicator.xml: -------------------------------------------------------------------------------- 1 | 3 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/indicator_radius.xml: -------------------------------------------------------------------------------- 1 | 3 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 |