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


Java Outline.setOval方法代码示例

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


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

示例1: clipPathInternal

import android.graphics.Outline; //导入方法依赖的package包/类
private void clipPathInternal() {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        ViewOutlineProvider viewOutlineProvider = new ViewOutlineProvider() {
            @Override
            @SuppressWarnings("NewApi")
            public void getOutline(View view, Outline outline) {
                outline.setOval(0, 0, getWidth(), getHeight());
            }
        };

        setOutlineProvider(viewOutlineProvider);
        setClipToOutline(true);
    } else {
        onSizeChanged(getWidth(), getHeight(), 0, 0);
        setLayerType(View.LAYER_TYPE_SOFTWARE, null);
    }
    invalidate();
}
 
开发者ID:doodeec,项目名称:ovalimageview,代码行数:19,代码来源:OvalImageView.java

示例2: drawElevation

import android.graphics.Outline; //导入方法依赖的package包/类
/**
 * Draws the elevation around the main circle
 * <p>
 * Stroke corrective is used due to ambiguity in drawing stroke in
 * combination with elevation enabled (for API 21 and higher only.
 * In such case there is no possibility to determine the accurate
 * <b>Action Button</b> size, so width and height must be corrected
 * <p>
 * This logic may be changed in future if the better solution is found
 */
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
protected void drawElevation() {
	float halfSize = getSize() / 2;
	final int left = (int) (calculateCenterX() - halfSize);
	final int top = (int) (calculateCenterY() - halfSize);
	final int right = (int) (calculateCenterX() + halfSize);
	final int bottom = (int) (calculateCenterY() + halfSize);
	ViewOutlineProvider provider = new ViewOutlineProvider() {
		@Override
		public void getOutline(View view, Outline outline) {
			outline.setOval(left, top, right, bottom);
		}
	};
	setOutlineProvider(provider);
	LOGGER.trace("Drawn the Action Button elevation");
}
 
开发者ID:Scalified,项目名称:fab,代码行数:27,代码来源:ActionButton.java

示例3: onCreateView

import android.graphics.Outline; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    final View root = inflater.inflate(R.layout.fragment_explorer, container, false);
    mListView = (ListView) root.findViewById(R.id.list_view);
    mFabPaste = (ImageButton) root.findViewById(R.id.fab_paste);
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        //Outline
        final ViewOutlineProvider viewOutlineProvider = new ViewOutlineProvider() {

            @Override
            public void getOutline(View view, Outline outline) {
                final int size = getResources().getDimensionPixelSize(R.dimen.fab_size);
                outline.setOval(0, 0, size, size);
            }
        };
        mFabPaste.setOutlineProvider(viewOutlineProvider);
    }
    return root;
}
 
开发者ID:NightlyNexus,项目名称:FileHeaven,代码行数:21,代码来源:ExplorerFragment.java

示例4: getOutline

import android.graphics.Outline; //导入方法依赖的package包/类
@Override
public void getOutline(View view, Outline outline) {
    outline.setOval(view.getPaddingLeft(),
            view.getPaddingTop(),
            view.getWidth() - view.getPaddingRight(),
            view.getHeight() - view.getPaddingBottom());
}
 
开发者ID:gejiaheng,项目名称:Protein,代码行数:8,代码来源:ViewUtils.java

示例5: getOutline

import android.graphics.Outline; //导入方法依赖的package包/类
@Override
public void getOutline(View view, Outline outline) {
    Rect rect = new Rect();
    view.getGlobalVisibleRect(rect);

    Rect selfRect = RectUtils.getOvalRect(rect);

    if(mRect!=null){
        selfRect = mRect;
    }
    outline.setOval(selfRect);
}
 
开发者ID:jiajunhui,项目名称:PlayerBase,代码行数:13,代码来源:RenderViewOvalRectOutlineProvider.java

示例6: onSizeChanged

import android.graphics.Outline; //导入方法依赖的package包/类
@Override
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
    super.onSizeChanged(w, h, oldw, oldh);
    ViewOutlineProvider viewOutlineProvider = new ViewOutlineProvider() {
        @Override
        public void getOutline(View view, Outline outline) {
            outline.setOval(0, 0, view.getWidth(), view.getHeight());
        }
    };
    setOutlineProvider(viewOutlineProvider);
    setClipToOutline(true);
}
 
开发者ID:The-WebOps-Club,项目名称:saarang-iosched,代码行数:13,代码来源:AddToScheduleFABFrameLayout.java

示例7: getOutline

import android.graphics.Outline; //导入方法依赖的package包/类
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
@Override
public void getOutline(Outline outline) {
	Rect bounds = getBounds();
	int radius = (int) ((Math.min(bounds.width(), bounds.height()) / 2) * 0.95f);
	int cx = bounds.centerX();
	int cy = bounds.centerY();
	outline.setOval(cx - radius, cy - radius, cx + radius, cy + radius);
}
 
开发者ID:Mishiranu,项目名称:Dashchan,代码行数:10,代码来源:ThemeChoiceDrawable.java

示例8: makeShapeByOutline

import android.graphics.Outline; //导入方法依赖的package包/类
@Override
@TargetApi(21)
public void makeShapeByOutline(ShapeImageView view, Outline outline) {
    final int width = view.getMeasuredWidth();
    final int height = view.getMeasuredHeight();
    final int radius = width > height ? height : width;
    final int left = (width - radius) / 2;
    final int top = (height - radius) / 2;
    final int right = left + radius;
    final int bottom = top + radius;
    outline.setOval(left, top, right, bottom);
}
 
开发者ID:AlexMofer,项目名称:ProjectX,代码行数:13,代码来源:CircleImageShape.java

示例9: onSizeChanged

import android.graphics.Outline; //导入方法依赖的package包/类
@Override
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
    super.onSizeChanged(w, h, oldw, oldh);
    Outline outline = new Outline();
    outline.setOval(0, 0, w, h);
    setOutline(outline);
    setClipToOutline(true);
}
 
开发者ID:ramonrabello,项目名称:devfestnorte-app,代码行数:9,代码来源:AddToScheduleFABFrameLayout.java

示例10: setOutlines

import android.graphics.Outline; //导入方法依赖的package包/类
private void setOutlines(View v) {
    int size = getResources().getDimensionPixelSize(R.dimen.floating_button_size);

    Outline outline = new Outline();
    outline.setOval(0, 0, size, size);

    v.setOutline(outline);
    v.animate().alpha(1.0f);
}
 
开发者ID:luciofm,项目名称:qconrio,代码行数:10,代码来源:RevealCodeFragment.java

示例11: setOutlines

import android.graphics.Outline; //导入方法依赖的package包/类
private void setOutlines(int star, int info) {
    final int size = getResources().getDimensionPixelSize(R.dimen.floating_button_size);

    final ViewOutlineProvider vop = new ViewOutlineProvider() {
        @Override
        public void getOutline(View view, Outline outline) {
            outline.setOval(0, 0, size, size);
        }
    };

    findViewById(star).setOutlineProvider(vop);
    findViewById(info).setOutlineProvider(vop);
}
 
开发者ID:rahulparsani,项目名称:google-io-2014-compat,代码行数:14,代码来源:DetailActivityL.java

示例12: getOutline

import android.graphics.Outline; //导入方法依赖的package包/类
@Override
      public void getOutline(View view, Outline outline) 
{
          outline.setOval(view.getPaddingLeft(), view.getPaddingTop(), view.getWidth() - view.getPaddingRight(), view.getHeight() - view.getPaddingBottom());
      }
 
开发者ID:MSay2,项目名称:Mire,代码行数:6,代码来源:ViewUtils.java

示例13: getOutline

import android.graphics.Outline; //导入方法依赖的package包/类
@Override
public void getOutline(Outline outline) {
  copyBounds(mRect);
  outline.setOval(mRect);
}
 
开发者ID:commonsguy,项目名称:cwac-crossport,代码行数:6,代码来源:CircularBorderDrawableLollipop.java

示例14: getOutline

import android.graphics.Outline; //导入方法依赖的package包/类
public void getOutline(Outline outline) {
    copyBounds(this.mRect);
    outline.setOval(this.mRect);
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:5,代码来源:CircularBorderDrawableLollipop.java

示例15: getOutline

import android.graphics.Outline; //导入方法依赖的package包/类
@Override
public void getOutline(View view, Outline outline) {
    outline.setOval(0, 0, width, height);
}
 
开发者ID:TaRGroup,项目名称:CoolApk-Console,代码行数:5,代码来源:BezelImageView.java


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