當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。