admin
2022-08-09 399ac289f80b7a40aa4210341db6b447cacdcf14
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
package com.app.hubert.guide.model;
 
import android.graphics.RectF;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import android.view.View;
 
/**
 * Created by hubert on 2018/6/6.
 */
public class HighlightRectF implements HighLight {
 
    private RectF rectF;
    private Shape shape;
    private int round;
    private HighlightOptions options;
 
    public HighlightRectF(@NonNull RectF rectF, @NonNull Shape shape, int round) {
        this.rectF = rectF;
        this.shape = shape;
        this.round = round;
    }
 
    public void setOptions(HighlightOptions options) {
        this.options = options;
    }
 
    @Override
    public Shape getShape() {
        return shape;
    }
 
    @Override
    public RectF getRectF(View view) {
        return rectF;
    }
 
    @Override
    public float getRadius() {
        return Math.min(rectF.width() / 2, rectF.height() / 2);
    }
 
    @Override
    public int getRound() {
        return round;
    }
 
    @Override
    public HighlightOptions getOptions() {
        return options;
    }
}