zhangjianhd / Noviceguide
Licence: apache-2.0
Android无侵入式引导提示 【博客地址:https://www.jianshu.com/p/94b73f314ab8】
Stars: ✭ 109
Programming Languages
java
68154 projects - #9 most used programming language
Labels
Projects that are alternatives of or similar to Noviceguide
Awesome Vuetify
🎉 The best resources related to Vuetify
Stars: ✭ 1,189 (+990.83%)
Mutual labels: guide
Build and test examples
Examples of build scripts and unit test frameworks for various languages, and how these can be used with the Jenkins continuous integration server. Contact: @mikej888
Stars: ✭ 104 (-4.59%)
Mutual labels: guide
Core
D Language online tour (https://tour.dlang.org/) and online editor (https://run.dlang.io/)
Stars: ✭ 89 (-18.35%)
Mutual labels: guide
Pc Optimization Hub
collection of various resources devoted to performance and input lag optimization
Stars: ✭ 55 (-49.54%)
Mutual labels: guide
Deepin Develop Guide
deepin develop guide(containing development environment configuration and debian package tutorial)
Stars: ✭ 90 (-17.43%)
Mutual labels: guide
Clean Architecture
A (work-in-progress) guide to the methodology behind Made Tech Flavoured Clean Architecture
Stars: ✭ 101 (-7.34%)
Mutual labels: guide
Globbing
Introduction to "globbing" or glob matching, a programming concept that allows "filepath expansion" and matching using wildcards.
Stars: ✭ 86 (-21.1%)
Mutual labels: guide
The Practical Linux Hardening Guide
This guide details creating a secure Linux production system. OpenSCAP (C2S/CIS, STIG).
Stars: ✭ 8,790 (+7964.22%)
Mutual labels: guide
Go Compression.github.io
The Hitchhiker's Guide to Compression
Stars: ✭ 106 (-2.75%)
Mutual labels: guide
Pyspark Cheatsheet
🐍 Quick reference guide to common patterns & functions in PySpark.
Stars: ✭ 108 (-0.92%)
Mutual labels: guide
Java8 Guides Tutorials
Java 8 Guides and Tutorials - A lot of awesome examples using Java 8 features like Stream, Lambda, Functional Interface, Date and Time API and much more
Stars: ✭ 100 (-8.26%)
Mutual labels: guide
Android无侵入式引导提示-NoviceGuide
优点
代码无侵入式,不需要处理原来的布局以及逻辑,只要在需要显示的地方像显示一个dialog一样配置好然后调用show方法即可
依赖方法
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
dependencies {
implementation 'com.github.ZhangJian96:NoviceGuide:1.0.0'
}
api
NoviceGuide.Builder的api | 方法说明 |
---|---|
focusView | 出现引导高亮显示的View(一般是引导描述的按钮等) |
setPadding | 设置高亮区域在View周边padding |
setRadius | 设置高亮部分的圆角(默认0,就是矩形),当设置超过View半径就会是圆(类比drawable的Radius) |
setRelyActivity | 当前引导所依附的Activity(因为原理是拿到Activity的android.R.id.content。所以目前只支持对属于Activity的View做处理,这也是后期优化点) |
setLayout(int layout,DecorateInflate decorateInflate) | 设置引导显示提示的布局,内部处理好inflate的过程,同时提供DecorateInflate回调装饰inflate后的View,不需要可以传null |
setPassId | 设置上方法提供的不居中“跳过”的按钮id,可不设置,不设置的时候需要自己在DecorateInflate回调中自己处理好调用dismiss()的逻辑。注意:在使用NoviceGuideSet构建一条链的引导时,请设置该方法,交给NoviceGuideSet内部自己去处理链的跳转步骤 |
build | 返回NoviceGuide对象 |
NoviceGuide | 方法说明 |
---|---|
show | 将设置好的NoviceGuide显示出来 |
dismiss | 关闭引导,一般情况无需使用者调用,由内部处理好 |
NoviceGuideSet | 方法说明 |
---|---|
addGuide(NoviceGuide NoviceGuide) | 添加引导链其中的一个步骤 |
show | 显示引导,点击PassView后按添加顺序依次展示 |
范例
创建一个引导:
new NoviceGuide.Builder(MainActivity.this)
.focusView(binding.btnGuide)
.setRadius(1000) //显示出圆形
.setRelyActivity(MainActivity.this)
.setLayout(R.layout.layout_btn_guide, new DecorateInflate() {
@Override
public void onInflate(final NoviceGuide noviceGuide, View inflaterView) {
inflaterView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
noviceGuide.dismiss();
}
});
}
})
.build()
.show();
如果是一系列的步骤引导,你可以使用NoviceGuideSet
NoviceGuide noviceGuide1 = new NoviceGuide.Builder(MainActivity.this)
.focusView(binding.tvBtn1)
.setPadding(5, 5, 5, 5)
.setRadius(15)
.setRelyActivity(MainActivity.this)
.setLayout(R.layout.layout_guide, null)
.setPassId(R.id.iv_know)
.build();
NoviceGuide noviceGuide2 = new NoviceGuide.Builder(MainActivity.this)
.focusView(binding.tvBtn2)
.setPadding(5, 5, 5, 5)
.setRadius(15)
.setRelyActivity(MainActivity.this)
.setLayout(R.layout.layout_guide, null)
.setPassId(R.id.iv_know)
.build();
NoviceGuideSet noviceGuideSet = new NoviceGuideSet();
noviceGuideSet.addGuide(noviceGuide1);
noviceGuideSet.addGuide(noviceGuide1);
noviceGuideSet.show();
效果
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].