Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

这样设置的参数,layout内的子view怎样才可以获取到点击事件呢?现在findview后点击无法响应,就是R.layout.handle_guide_four这个布局 #185

Open
roybill opened this issue Jan 6, 2021 · 1 comment

Comments

@roybill
Copy link

roybill commented Jan 6, 2021

.setLabel("第四层")
.addGuidePage(GuidePage.newInstance()
.addHighLight(mFastLayout,HighLight.Shape.ROUND_RECTANGLE,10,0,new RelativeGuide(R.layout.handle_guide_four,
Gravity.TOP, 0))
.setEverywhereCancelable(false) //是否点击任意位置消失引导页,默认true
// .setLayoutRes(R.layout.handle_guide_four,R.id.btn_handle_guid_four_next)
.setOnLayoutInflatedListener(new OnLayoutInflatedListener() {
@OverRide
public void onLayoutInflated(View view, Controller controller) {
TextView finish = view.findViewById(R.id.tv_handle_guid_four_finish);
finish.getPaint().setFlags(Paint.UNDERLINE_TEXT_FLAG); //下划线
finish.setOnClickListener(new View.OnClickListener() {
@OverRide
public void onClick(View view) {
controller.remove();//跳过
}
});
view.findViewById(R.id.btn_handle_guid_four_next).setOnClickListener(new View.OnClickListener() {
@OverRide
public void onClick(View v) {
controller.showPage(4);//点击显示第五层
}
});
}
}))

@Gracefulwind
Copy link

Gracefulwind commented Aug 26, 2021

我看了源码里,GuidePage的setLayoutRes()方法可以设置多个id,但是这些id添加的remove方法是关闭当前蒙版page的:
在GuideLayout的初始化里,addCustomToLayout(GuidePage guidePage)方法中对我们加入的id的处理是调用remove方法,而这个方法只会dismiss当前的page。这个方法是对应GuidePage的setEverywhereCancelable方法的。至于关闭所有GuidePage的方法我并没有找到。按addCustomToLayout里View填充的方式来看对于xml中的id没有其他入口可以做处理的。
我感觉要实现这个功能的话得改源码了,要么在new GuidePage的时候,除了入layoutId外还可以直接入View,要么添加set(id, OnclickListener)方法。不知道其他老哥有没找到入口的

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants