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

高亮部分如能支持加线框更完美~~~~ #51

Closed
ghost opened this issue Jun 28, 2018 · 3 comments
Closed

高亮部分如能支持加线框更完美~~~~ #51

ghost opened this issue Jun 28, 2018 · 3 comments

Comments

@ghost
Copy link

ghost commented Jun 28, 2018

例如:
856b4daf-f846-4e93-ac2f-1d1cb23e212f

@huburt-Hu
Copy link
Owner

v2.4.0版本实现了你的需求。

首先构建一个HighlightOptions,并设置OnHighlightDrewListener:

HighlightOptions options = new HighlightOptions.Builder()
        .setOnHighlightDrewListener(new OnHighlightDrewListener() {
            @Override
            public void onHighlightDrew(Canvas canvas, RectF rectF) {
                Paint paint = new Paint();
                paint.setColor(Color.WHITE);
                paint.setStyle(Paint.Style.STROKE);
                paint.setStrokeWidth(10);
                paint.setPathEffect(new DashPathEffect(new float[]{20, 20}, 0));
                canvas.drawCircle(rectF.centerX(), rectF.centerY(), rectF.width() / 2 + 10, paint);
            }
        })
        .build();

onHighlightDrew方法会在引导层绘制高亮之后马上回调,可通过canvas,以及给定的高亮区域rectF,绘制想要任何视图,例如上述示例中完成的issue提出的虚线。

然后与高亮区域点击事件类似,传入highlight以及option到addHighLightWithOptions方法中:

GuidePage page = GuidePage.newInstance().addHighLightWithOptions(btnRelative, options);

@DanteAndroid
Copy link

请问你是如何实现 箭头指向高亮的 view 的

@LittleLiByte
Copy link

如何绘制个半圆?

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

3 participants