本文整理汇总了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);
}
}
};
}
示例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);
}
};
}
}
示例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);
}
};
}
示例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);
}
};
}
示例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);
}
}
示例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);
}
};
}
示例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);
}
}
示例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);
}
示例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());
}
}
示例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);
}
};
}
}
示例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());
}
}
示例12: getOutline
import android.graphics.Outline; //导入方法依赖的package包/类
@Override
public void getOutline(Outline outline) {
if (buildConvexPath().isConvex()) {
outline.setConvexPath(buildConvexPath());
} else {
super.getOutline(outline);
}
}
示例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());
}
}
};
}
示例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());
}
}
};
}
示例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()));
}
};
}