Skip to content

Commit

Permalink
引导蒙层
Browse files Browse the repository at this point in the history
  • Loading branch information
qiushi123 committed Jun 1, 2016
0 parents commit 05c56a8
Show file tree
Hide file tree
Showing 36 changed files with 1,259 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
*.iml
.gradle
/local.properties
/.idea/workspace.xml
/.idea/libraries
.DS_Store
/build
/captures
/.idea
38 changes: 38 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# GuideView
新手引导视图,初次打开页面时显示。


*使用图片


ImageView iv = new ImageView(this);
iv.setImageResource(R.drawable.img_new_task_guide);
RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(
ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
iv.setLayoutParams(params);

![image](https://github.com/laxian/GuideView/blob/develop/app/snapshot1.jpeg)

*使用文字

TextView iv = new TextView(this);
iv.setText("欢迎使用");
iv.setTextColor(getResources().getColor(R.color.white));
![image](https://github.com/laxian/GuideView/blob/develop/app/snapshot2.jpeg)

*显示GuideView

GuideView.Builder
.newInstance(this) // 必须调用
.setTargetView(view) // 必须调用,设置需要Guide的View
.setCustomTipsView(iv) // 必须调用,设置GuideView,可以使任意View的实例,比如ImageView 或者TextView
.setDirction(GuideView.Direction.LEFT_BOTTOM) // 设置GuideView 相对于TargetView的位置,有八种,不设置则默认在屏幕左上角
.setBackGround(getResources().getColor(R.color.shadow)) // 设置背景颜色,默认透明
.setOnclickExit(null) // 设置点击消失,可以传入一个Callback,执行被点击后的操作
.setRadius(32) // 设置圆形透明区域半径,默认是targetView的显示矩形的半径
.setCenter(300, 300) // 设置圆心,默认是targetView的中心
.setOffset(200, 60) // 设置偏移,一般用于微调GuideView的位置
.showOnce() // 设置首次显示,设置后,显示一次后,不再显示
.build() // 必须调用,Buider模式,返回GuideView实例
.show(); // 必须调用,显示GuideView
1 change: 1 addition & 0 deletions app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
28 changes: 28 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 23
buildToolsVersion '23.0.2'
defaultConfig {
applicationId "com.laxian.guideview"
minSdkVersion 16
targetSdkVersion 19
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
}
}

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.+'
compile 'com.android.support:design:23.+'
}
17 changes: 17 additions & 0 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in D:\Android\Sdk/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# Add any project specific keep options here:

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
Binary file added app/snapshot1.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/snapshot2.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions app/src/androidTest/java/com/laxian/guideview/ApplicationTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.laxian.guideview;

import android.app.Application;
import android.test.ApplicationTestCase;

/**
* <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a>
*/
public class ApplicationTest extends ApplicationTestCase<Application> {
public ApplicationTest() {
super(Application.class);
}
}
23 changes: 23 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.laxian.guideview">

<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:theme="@style/AppTheme.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>

</manifest>
Loading

0 comments on commit 05c56a8

Please sign in to comment.