本文整理汇总了Java中android.graphics.Outline.setRoundRect方法的典型用法代码示例。如果您正苦于以下问题:Java Outline.setRoundRect方法的具体用法?Java Outline.setRoundRect怎么用?Java Outline.setRoundRect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.graphics.Outline
的用法示例。
在下文中一共展示了Outline.setRoundRect方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initialize
import android.graphics.Outline; //导入方法依赖的package包/类
private void initialize() {
borderPath = new Path();
oval = new RectF();
borderPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
borderPaint.setStyle(Paint.Style.STROKE);
// ViewOutlineProvider does not support clipping customized path
if (canUseViewOutlineProvider()) {
ViewOutlineProvider provider = new ViewOutlineProvider() {
@Override
public void getOutline(View view, Outline outline) {
if (canUseViewOutlineProvider()) {
float radius = Math.max(0, cornerRadius);
outline.setRoundRect(0, 0, getWidth(), getHeight(), radius);
}
}
};
setOutlineProvider(provider);
setClipToOutline(true);
}
}
示例2: onSizeChanged
import android.graphics.Outline; //导入方法依赖的package包/类
@Override
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
super.onSizeChanged(w, h, oldw, oldh);
final float radius = getResources().getDimensionPixelSize(R.dimen.card_corner_radius);
final int vw = w;
final int vh = h;
final ViewOutlineProvider vop = new ViewOutlineProvider() {
@Override
public void getOutline(View view, Outline outline) {
outline.setRoundRect(0, 0, vw, vh, radius);
}
};
setOutlineProvider(vop);
setClipToOutline(true);
}
示例3: getOutline
import android.graphics.Outline; //导入方法依赖的package包/类
@Override
public void getOutline(View view, Outline outline) {
if (mEntryAnimationRadiusFactors == null) {
RectF activeRect = getActiveRect();
outline.setRoundRect(
(int) activeRect.left,
(int) activeRect.top,
(int) activeRect.right,
(int) activeRect.bottom,
mDotRadius
);
}
}
示例4: getOutline
import android.graphics.Outline; //导入方法依赖的package包/类
@Override
public void getOutline(View view, Outline outline) {
if (sCornerRadius == 0) {
sCornerRadius = view.getResources().getDimensionPixelSize(
R.dimen.lb_rounded_rect_corner_radius);
}
outline.setRoundRect(0, 0, view.getWidth(), view.getHeight(), sCornerRadius);
outline.setAlpha(1f);
}
示例5: getOutline
import android.graphics.Outline; //导入方法依赖的package包/类
@Override
@TargetApi(VERSION_CODES.LOLLIPOP)
public void getOutline(@NonNull Outline outline) {
Rect bounds = getBounds();
if (!bounds.isEmpty()) {
outline.setRoundRect(bounds, chipCornerRadius);
} else {
outline.setRoundRect(0, 0, getIntrinsicWidth(), getIntrinsicHeight(), chipCornerRadius);
}
outline.setAlpha(getAlpha() / 255f);
}
示例6: getOutline
import android.graphics.Outline; //导入方法依赖的package包/类
@Override
public void getOutline(View view, Outline outline) {
int radius = (int) (collapsedRadius + (expandedRadius - collapsedRadius) * expandProgress);
Rect area = new Rect(
center.x - radius,
center.y - radius,
center.x + radius,
center.y + radius);
outline.setRoundRect(area, radius);
}
示例7: getOutline
import android.graphics.Outline; //导入方法依赖的package包/类
@Override
public void getOutline(View view, Outline outline) {
outline.setAlpha(mMinAlpha + mAlpha / (1f - mMinAlpha));
outline.setRoundRect(mClipRect.left, mClipRect.top,
mSourceView.getWidth() - mClipRect.right,
mSourceView.getHeight() - mClipRect.bottom,
mCornerRadius);
}
示例8: getOutline
import android.graphics.Outline; //导入方法依赖的package包/类
@TargetApi (Build.VERSION_CODES.LOLLIPOP)
@Override
public void getOutline(Outline outline) {
copyBounds(outlineRect);
outlineRect.inset(padding, padding);
outline.setRoundRect(outlineRect, getRadius());
if (getAlpha() < 255) {
outline.setAlpha(0);
}
//outline.setAlpha(getAlpha() / ALPHA_MAX);
}
示例9: getOutline
import android.graphics.Outline; //导入方法依赖的package包/类
@Override
public void getOutline(Outline outline) {
outline.setRoundRect(mBoundsI, mRadius);
}
示例10: getOutline
import android.graphics.Outline; //导入方法依赖的package包/类
@Override
public void getOutline(View v, Outline outline) {
outline.setRoundRect(mOutline, mOutlineRadius);
}
示例11: getOutline
import android.graphics.Outline; //导入方法依赖的package包/类
@Override
public void getOutline(Outline outline) {
outline.setRoundRect(getBounds(), cornerRadius);
}
示例12: getOutline
import android.graphics.Outline; //导入方法依赖的package包/类
@Override
public void getOutline(View view, Outline outline) {
Rect bounds = new Rect();
mBorderRect.roundOut(bounds);
outline.setRoundRect(bounds, bounds.width() / 2.0f);
}
示例13: getOutline
import android.graphics.Outline; //导入方法依赖的package包/类
@Override
public void getOutline(@NonNull Outline outline)
{
outline.setRoundRect(getBounds(), cornerRadius);
}
示例14: getOutline
import android.graphics.Outline; //导入方法依赖的package包/类
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
@Override
public void getOutline(Outline outline) {
outline.setRoundRect(getBounds(), cornerRadius);
}
示例15: getOutline
import android.graphics.Outline; //导入方法依赖的package包/类
@Override
public void getOutline(View view, Outline outline) {
Rect bounds = new Rect();
mBoundsRect.roundOut(bounds);
outline.setRoundRect(bounds, bounds.width() / 2.0f);
}