All Projects → smuyyh → Easyguideview

smuyyh / Easyguideview

Licence: apache-2.0
Android app新手引导,任意View高亮提示,简单易用

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Easyguideview

Bioc Refcard
Bioconductor cheat sheet
Stars: ✭ 152 (-14.61%)
Mutual labels:  guide
Go Advice
List of advice and tricks for Go ʕ◔ϖ◔ʔ
Stars: ✭ 2,233 (+1154.49%)
Mutual labels:  guide
Fe Performance Journey
🚵 a Journey of Performance Optimizing in Frontend 🚀
Stars: ✭ 169 (-5.06%)
Mutual labels:  guide
Restful Api With Laravel Definitive Guide
Repository with the base code for the course "RESTful API with Laravel - Definitive-Guide"
Stars: ✭ 156 (-12.36%)
Mutual labels:  guide
Fe
《我的职业是前端工程师》 - Ebook:I'm a FrontEnd Developer
Stars: ✭ 1,970 (+1006.74%)
Mutual labels:  guide
An Idiots Guide To Installing Arch On A Lenovo Carbon X1 Gen 6
so you wanted to install arch huh
Stars: ✭ 165 (-7.3%)
Mutual labels:  guide
Guide To Allyship
Guide to Allyship, an open source guide teaching you how to be a better ally.
Stars: ✭ 144 (-19.1%)
Mutual labels:  guide
Ado guideview
Stars: ✭ 176 (-1.12%)
Mutual labels:  guide
Hackintosh
Hackintosh v3 (i7-9700K + Radeon RX 5700 XT) - Clover Configuration + Kexts
Stars: ✭ 162 (-8.99%)
Mutual labels:  guide
Interview
Everything you need to prepare for your technical interview
Stars: ✭ 14,788 (+8207.87%)
Mutual labels:  guide
Vim Galore
🎓 All things Vim!
Stars: ✭ 12,610 (+6984.27%)
Mutual labels:  guide
Pharo Wiki
Wiki related to the Pharo programming language and environment.
Stars: ✭ 161 (-9.55%)
Mutual labels:  guide
Java Telegram Bot Tutorial
Java Telegram Bot Tutorial. Feel free to submit issue if you found a mistake.
Stars: ✭ 165 (-7.3%)
Mutual labels:  guide
Rakuguide
The Raku Guide
Stars: ✭ 155 (-12.92%)
Mutual labels:  guide
Docker Workshop
Docker workshop
Stars: ✭ 174 (-2.25%)
Mutual labels:  guide
Digital video introduction
A hands-on introduction to video technology: image, video, codec (av1, vp9, h265) and more (ffmpeg encoding).
Stars: ✭ 12,184 (+6744.94%)
Mutual labels:  guide
Hackthebox
Notes Taken for HTB Machines & InfoSec Community.
Stars: ✭ 167 (-6.18%)
Mutual labels:  guide
React Redux Typescript Realworld App
RealWorld App implementation based on "react-redux-typescript-guide"
Stars: ✭ 178 (+0%)
Mutual labels:  guide
Guideview
A guideView implements using the DialogFragment
Stars: ✭ 176 (-1.12%)
Mutual labels:  guide
Cehv10 Notes
📕 Both personal and public notes for EC-Council's CEHv10 312-50, because its thousands of pages/slides of boredom, and a braindump to many
Stars: ✭ 170 (-4.49%)
Mutual labels:  guide

EasyGuideView

Android app新手引导高亮提示,简单易用

效果

添加依赖

compile 'com.yuyh.easyguideview:library:1.2.2'

基本使用

// 须在View绘制完成之后调用,否则可能无法准确显示
// offsetX:正数代表从屏幕左侧往右偏移距离,负数表示从屏幕右侧往左偏移距离。Constant.CENTER 表示居中
// offsetY:同理。正数由上到下,负数由下到上。Constant.CENTER 表示居中
public void show(){
    EasyGuide easyGuide = new EasyGuide.Builder(MainActivity.this)
            // 增加View高亮区域,可同时显示多个
            .addHightArea(view, HShape.CIRCLE)
            // 添加箭头指示
            .addIndicator(R.drawable.right_top, loc[0], loc[1] + view.getHeight())
            // 复杂的提示布局,建议通过此方法,较容易控制
            .addView(createTipsView(), 0, loc[1] + view.getHeight(),
                            new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
                            ViewGroup.LayoutParams.WRAP_CONTENT))
            // 设置提示信息,默认居中。若需调整,可采用addView形式
            .addMessage("点击菜单显示", 14)
            // 设置确定按钮,默认居中显示在Message下面
            .setPositiveButton("朕知道了~", 15, onClickListener)
            // 是否点击任意区域消失,默认true
            .dismissAnyWhere(true)
            // 若点击作用在高亮区域,是否执行高亮区域的点击事件,默认false
            .performViewClick(true)
            .build();

    easyGuide.show();
}

private View createTipsView() {

    View view = LayoutInflater.from(this).inflate(R.layout.tips_view, null);

    ImageView ivIsee = (ImageView) view.findViewById(R.id.ivIsee);
    ivIsee.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            if (easyGuide != null) {
                easyGuide.dismiss();
            }
        }
    });

    return view;
}

如何判断绘制完成?可重写activity的void onWindowFocusChanged(boolean hasFocus)方法,建议使用以下方式:

// 等待高亮View加载完成之后再调用显示引导层,例如对于hightLightView高亮来说:
hightLightView.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
    @Override
    public void onGlobalLayout() {// 加载完成后回调

        // 务必取消监听,否则会多次调用
        if (Build.VERSION.SDK_INT > Build.VERSION_CODES.JELLY_BEAN) {
            hightLightView.getViewTreeObserver().removeOnGlobalLayoutListener(this);
        } else {
            hightLightView.getViewTreeObserver().removeGlobalOnLayoutListener(this);
        }

        // TODO 显示高亮布局!

    }
});

新手引导层状态改变监听

easyGuide.setOnStateChangedListener(new OnStateChangedListener() {
    @Override
    public void onShow() {

    }

    @Override
    public void onDismiss() {

    }

    @Override
    public void onHeightlightViewClick(View view) {
        Log.i("TAG", "点击了view:" + view.getId());
    }
});

LICENSES

Copyright (C) 2016 smuyyh

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
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].