SearchView.java 文件源码

java
阅读 28 收藏 0 点赞 0 评论 0

项目:Learn 作者:
/**
 * 初始化 Path
 */
private void initPath() {
    mSearchPath = new Path();
    mCirclePath = new Path();
    mMeasure = new PathMeasure();

    RectF oval1 = new RectF(-50, -50, 50, 50);
    mSearchPath.addArc(oval1, 45, 359.9f); // 放大镜的圆框

    RectF oval2 = new RectF(-100, -100, 100, 100);
    mCirclePath.addArc(oval2, 45, 359.9f); // 搜索的圆圈

    float[] pos = new float[2];
    mMeasure.setPath(mCirclePath, false);
    mMeasure.getPosTan(0, pos, null); // 放大镜手柄的末端

    mSearchPath.lineTo(pos[0], pos[1]); // 放大镜的手柄
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号