自定义引导蒙层控件,支持全屏模式和targetView模式

效果图



全屏模式
1. setOnlyOnceTag  是否只显示一次的标识
2. setBackgroundColor  引导蒙层区域外的背景色
3. setBackgroundResource  引导蒙层区域外的颜色id
4. addDrawable  添加蒙层图片的资源id
5. setOnDisplayListener  监听显示、消失、多次显示的事件
6. show  显示引导蒙层
7. hide  隐藏蒙层

        new QGuideView.Builder(this)
                .setOnlyOnceTag(this.getClass().getSimpleName())
                .setBackgroundColor(Color.parseColor("#80000000"))
//                .setTargetView(findViewById(R.id.hello_tv))
                .addDrawable(R.drawable.ic_launcher_foreground)
                .addDrawable(R.drawable.ic_launcher_background)
                .setOnDisplayListener(new QGuideView.OnDisplayListener() {
                    @Override
                    public void onShow(QGuideView guideView) {
                    }

                    @Override
                    public void onReappear(boolean isReappear) {
                    }

                    @Override
                    public void onDismiss() {
                    }
                })
                .build().show();

targetView模式(自行拓展)

1. setTargetView  引导蒙层要在哪个view上展示

new QGuideView.Builder(this)
        .setOnlyOnceTag(this.getClass().getSimpleName())
        .setBackgroundColor(Color.parseColor("#80000000"))
        .setTargetView(findViewById(R.id.hello_tv))
        .addDrawable(R.drawable.ic_launcher_foreground)
        .addDrawable(R.drawable.ic_launcher_background)
        .setOnDisplayListener(new QGuideView.OnDisplayListener() {
            @Override
            public void onShow(QGuideView guideView) {
            }

            @Override
            public void onReappear(boolean isReappear) {
            }

            @Override
            public void onDismiss() {
            }
        })
        .build().show();

https://github.com/272664150/QGuideView

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值