huburt-Hu / NewbieGuide

Android 快速实现新手引导层的库,通过简洁链式调用,一行代码实现引导层的显示
Apache License 2.0
3.56k stars 520 forks source link

请问如何点击高亮控件然后取消页面 #143

Open neimengwuyanzu opened 5 years ago

thisleo commented 5 years ago
Controller controller = null;
            Builder builder = NewbieGuide.with(this);
            HighlightOptions options = new HighlightOptions.Builder()
                    .setOnClickListener(new View.OnClickListener() {
                        @Override
                        public void onClick(View v) {
                            if (controller != null) {
                                    controller.remove();
                                }
                        }
                    })
                    .build();

            GuidePage page = GuidePage.newInstance()
                    .addHighLightWithOptions(llRewardWeek, options)
                    .setLayoutRes(R.layout.view_guide_simple)
                    .setEverywhereCancelable(true);
            builder.addGuidePage(page);
            builder.setLabel("autumn_guide");
            builder.alwaysShow(true);
            controller = builder.build();
            controller.show();

这样关闭, 另附上作者简书地址: https://www.jianshu.com/p/5e80c7aee1fc