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


Java Outline.setRoundRect方法代码示例

本文整理汇总了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);
        }
    }
 
开发者ID:QuarkWorks,项目名称:RoundedFrameLayout-Android,代码行数:26,代码来源:RoundedFrameLayout.java

示例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);
}
 
开发者ID:romainguy,项目名称:google-io-2014,代码行数:19,代码来源:CardFrameLayout.java

示例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
        );
    }
}
 
开发者ID:TeamBrainStorm,项目名称:SimpleUILauncher,代码行数:14,代码来源:PageIndicatorDots.java

示例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);
}
 
开发者ID:archos-sa,项目名称:aos-Video,代码行数:10,代码来源:RoundedRectHelperApi21.java

示例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);
}
 
开发者ID:material-components,项目名称:material-components-android,代码行数:13,代码来源:ChipDrawable.java

示例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);
}
 
开发者ID:linroid,项目名称:FilterMenu,代码行数:11,代码来源:FilterMenuLayout.java

示例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);
}
 
开发者ID:jzhu1224,项目名称:DeckView,代码行数:9,代码来源:AnimateableDeckChildViewBounds.java

示例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);
}
 
开发者ID:sephiroth74,项目名称:android-target-tooltip,代码行数:12,代码来源:TooltipTextDrawable.java

示例9: getOutline

import android.graphics.Outline; //导入方法依赖的package包/类
@Override
public void getOutline(Outline outline) {
    outline.setRoundRect(mBoundsI, mRadius);
}
 
开发者ID:stytooldex,项目名称:pius1,代码行数:5,代码来源:RoundRectDrawable.java

示例10: getOutline

import android.graphics.Outline; //导入方法依赖的package包/类
@Override
public void getOutline(View v, Outline outline) {
    outline.setRoundRect(mOutline, mOutlineRadius);
}
 
开发者ID:enricocid,项目名称:LaunchEnr,代码行数:5,代码来源:RevealOutlineAnimation.java

示例11: getOutline

import android.graphics.Outline; //导入方法依赖的package包/类
@Override
public void getOutline(Outline outline) {
    outline.setRoundRect(getBounds(), cornerRadius);
}
 
开发者ID:AdityaAnand1,项目名称:Morphing-Material-Dialogs,代码行数:5,代码来源:MorphDrawable.java

示例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);
}
 
开发者ID:monkeywiiu,项目名称:Discover,代码行数:7,代码来源:CircleImageView.java

示例13: getOutline

import android.graphics.Outline; //导入方法依赖的package包/类
@Override
   public void getOutline(@NonNull Outline outline)
{
       outline.setRoundRect(getBounds(), cornerRadius);
   }
 
开发者ID:MSay2,项目名称:Mire,代码行数:6,代码来源:MorphDrawable.java

示例14: getOutline

import android.graphics.Outline; //导入方法依赖的package包/类
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
@Override
public void getOutline(Outline outline) {
    outline.setRoundRect(getBounds(), cornerRadius);
}
 
开发者ID:li-yu,项目名称:Huahui-Android,代码行数:6,代码来源:MorphDrawable.java

示例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);
}
 
开发者ID:WGPlaner,项目名称:wg_planer,代码行数:7,代码来源:CircularImageView.java


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