当前位置: 首页>>代码示例>>Java>>正文


Java Outline.setConvexPath方法代码示例

本文整理汇总了Java中android.graphics.Outline.setConvexPath方法的典型用法代码示例。如果您正苦于以下问题:Java Outline.setConvexPath方法的具体用法?Java Outline.setConvexPath怎么用?Java Outline.setConvexPath使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.graphics.Outline的用法示例。


在下文中一共展示了Outline.setConvexPath方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getOutlineProvider

import android.graphics.Outline; //导入方法依赖的package包/类
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
@Override
public ViewOutlineProvider getOutlineProvider() {
    shadowpath = new Path();
    if (config.getRadius() == 0) {
        shadowpath = path;
    } else {
        rect = new Rect(0, 0, (int) width, (int) height);
        RectF r = new RectF(rect);
        shadowpath.addRoundRect(r, config.getRadius(), config.getRadius(), Path.Direction.CCW);
        shadowpath.op(path, shadowpath, Path.Op.INTERSECT);
    }
    return new ViewOutlineProvider() {
        @Override
        public void getOutline(View view, Outline outline) {
            if (path.isConvex()) {
                outline.setConvexPath(shadowpath);
            }
        }
    };
}
 
开发者ID:akshay2211,项目名称:Oblique,代码行数:22,代码来源:ObliqueView.java

示例2: init

import android.graphics.Outline; //导入方法依赖的package包/类
private void init() {
    setWillNotDraw(false);

    mPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
    mPaint.setStyle(Paint.Style.FILL);

    mPath = new Path();

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        mViewOutlineProvider = new ViewOutlineProvider() {
            @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
            @Override
            public void getOutline(View view, Outline outline) {
                if (mPath.isConvex()) outline.setConvexPath(mPath);
            }
        };

    }
}
 
开发者ID:imallan,项目名称:JellyRefreshLayout,代码行数:20,代码来源:JellyLayout.java

示例3: getOutlineProvider

import android.graphics.Outline; //导入方法依赖的package包/类
@Override
public ViewOutlineProvider getOutlineProvider() {
    return new ViewOutlineProvider() {
        @Override
        public void getOutline(View view, Outline outline) {
            outline.setConvexPath(outlinePath);
        }
    };
}
 
开发者ID:tranleduy2000,项目名称:screenfilter,代码行数:10,代码来源:DiagonalLayout.java

示例4: getOutlineProvider

import android.graphics.Outline; //导入方法依赖的package包/类
@Override
public ViewOutlineProvider getOutlineProvider() {
	return new ViewOutlineProvider() {
		@Override
		public void getOutline(View view, Outline outline) {
			outline.setConvexPath(outlinePath);
		}
	};
}
 
开发者ID:drakeet,项目名称:WeiboFixer,代码行数:10,代码来源:DiagonalLayout.java

示例5: getOutline

import android.graphics.Outline; //导入方法依赖的package包/类
@Override
public void getOutline(@NonNull Outline outline) {
  if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
    if (mPathForBorderOutline == null) {
      mNeedUpdatePath = true;
    }
    updateBorderOutline();
    outline.setConvexPath(mPathForBorderOutline);
  }
}
 
开发者ID:amap-demo,项目名称:weex-3d-map,代码行数:11,代码来源:BorderDrawable.java

示例6: getOutlineProvider

import android.graphics.Outline; //导入方法依赖的package包/类
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
@Override
public ViewOutlineProvider getOutlineProvider() {
    return new ViewOutlineProvider() {
        @Override
        public void getOutline(View view, Outline outline) {
            outline.setConvexPath(outlinePath);
        }
    };
}
 
开发者ID:HanyeeWang,项目名称:GeekZone,代码行数:11,代码来源:DiagonalLayout.java

示例7: getOutline

import android.graphics.Outline; //导入方法依赖的package包/类
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
@Override
public void getOutline(Outline outline) {
  if (arcPath == null || !arcPath.isConvex()) {
    super.getOutline(outline);
  } else {
    outline.setConvexPath(arcPath);
  }
}
 
开发者ID:xzg8023,项目名称:ArcLayout-master,代码行数:10,代码来源:ArcDrawable.java

示例8: getOutline

import android.graphics.Outline; //导入方法依赖的package包/类
@Override
public void getOutline(View view, Outline outline) {
    outline.setConvexPath(path);
    if (alpha >= 1.0f) {
        alpha = 0.99f;
    } else if (alpha < 0.0f) {
        alpha = 0.0f;
    }
    outline.setAlpha(alpha);
}
 
开发者ID:harjot-oberai,项目名称:MaterialShadows,代码行数:11,代码来源:CustomViewOutlineProvider.java

示例9: getOutline

import android.graphics.Outline; //导入方法依赖的package包/类
@Override
public void getOutline(Outline outline) {
  if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
    super.getOutline(outline);
    return;
  }
  if ((!YogaConstants.isUndefined(mBorderRadius) && mBorderRadius > 0) || mBorderCornerRadii != null) {
    updatePath();

    outline.setConvexPath(mPathForBorderRadiusOutline);
  } else {
    outline.setRect(getBounds());
  }
}
 
开发者ID:qq565999484,项目名称:RNLearn_Project1,代码行数:15,代码来源:ReactViewBackgroundDrawable.java

示例10: init

import android.graphics.Outline; //导入方法依赖的package包/类
private void init() {
    float dSize = TypedValue.applyDimension(
            TypedValue.COMPLEX_UNIT_SP,
            15,
            getContext().getResources().getDisplayMetrics());
    tBuilder = new StringBuilder("");
    setText("");
    mTpaint = new TextPaint();
    mTpaint.setColor(Color.BLUE);
    mTpaint.setAntiAlias(true);
    mTpaint.setTextSize(dSize);
    mTpaint.setStyle(Paint.Style.FILL);
    tRect = new Rect();
    setWillNotDraw(false);
    mPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
    mPaint.setStyle(Paint.Style.FILL);
    mPaint.setFilterBitmap(true);
    camera = new Camera();
    matrix = new Matrix();
    mPath = new Path();

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        mViewOutlineProvider = new ViewOutlineProvider() {
            @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
            @Override
            public void getOutline(View view, Outline outline) {
                if (mPath.isConvex()) outline.setConvexPath(mPath);
            }
        };

    }
}
 
开发者ID:YoneHsiung,项目名称:WavePullLayout,代码行数:33,代码来源:HeaderLayout.java

示例11: getOutline

import android.graphics.Outline; //导入方法依赖的package包/类
@Override
public void getOutline(Outline outline) {
  if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
    super.getOutline(outline);
    return;
  }
  if((!CSSConstants.isUndefined(mBorderRadius) && mBorderRadius > 0) || mBorderCornerRadii != null) {
    updatePath();

    outline.setConvexPath(mPathForBorderRadiusOutline);
  } else {
    outline.setRect(getBounds());
  }
}
 
开发者ID:john1jan,项目名称:ReactNativeSignatureExample,代码行数:15,代码来源:ReactViewBackgroundDrawable.java

示例12: getOutline

import android.graphics.Outline; //导入方法依赖的package包/类
@Override
public void getOutline(Outline outline) {
    if (buildConvexPath().isConvex()) {
        outline.setConvexPath(buildConvexPath());
    } else {
        super.getOutline(outline);
    }
}
 
开发者ID:captain-miao,项目名称:OptionRoundCardview,代码行数:9,代码来源:OptRoundRectDrawable.java

示例13: getOutlineProvider

import android.graphics.Outline; //导入方法依赖的package包/类
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
@Override
public ViewOutlineProvider getOutlineProvider() {
    return new ViewOutlineProvider() {
        @Override
        public void getOutline(View view, Outline outline) {
            try {
                outline.setConvexPath(PathProvider.getOutlinePath(width, height, curvatureHeight, curvatureDirection, gravity));
            } catch (Exception e) {
                Log.d("Outline Path", e.getMessage());
            }
        }
    };
}
 
开发者ID:developer-shivam,项目名称:Crescento,代码行数:15,代码来源:CrescentoImageView.java

示例14: getOutlineProvider

import android.graphics.Outline; //导入方法依赖的package包/类
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
@Override
public ViewOutlineProvider getOutlineProvider() {
    return new ViewOutlineProvider() {
        @Override
        public void getOutline(View view, Outline outline) {
            try {
                outline.setConvexPath(PathProvider.getOutlinePath(width, height, curvatureHeight, 0, 0));
            } catch (Exception e) {
                Log.d("Outline Path", e.getMessage());
            }
        }
    };
}
 
开发者ID:developer-shivam,项目名称:Crescento,代码行数:15,代码来源:CrescentoContainer.java

示例15: getOutlineProvider

import android.graphics.Outline; //导入方法依赖的package包/类
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
@Override
public ViewOutlineProvider getOutlineProvider() {
    return new ViewOutlineProvider() {
        @Override
        public void getOutline(View view, Outline outline) {
            outline.setConvexPath(PathProvider.getOutlinePath(width, height, curvatureHeight,
                    getPaddingTop(), getPaddingBottom(), getPaddingLeft(), getPaddingRight()));
        }
    };
}
 
开发者ID:huoyabingqian,项目名称:Crescento-master,代码行数:12,代码来源:CrescentoImageView.java


注:本文中的android.graphics.Outline.setConvexPath方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。