當前位置: 首頁>>代碼示例>>Java>>正文


Java Outline.setConvexPath方法代碼示例

本文整理匯總了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);
            }
        }
    };
}
 
開發者ID:akshay2211,項目名稱:Oblique,代碼行數:22,代碼來源:ObliqueView.java

示例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);
            }
        };

    }
}
 
開發者ID:imallan,項目名稱:JellyRefreshLayout,代碼行數:20,代碼來源:JellyLayout.java

示例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);
        }
    };
}
 
開發者ID:tranleduy2000,項目名稱:screenfilter,代碼行數:10,代碼來源:DiagonalLayout.java

示例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);
		}
	};
}
 
開發者ID:drakeet,項目名稱:WeiboFixer,代碼行數:10,代碼來源:DiagonalLayout.java

示例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);
  }
}
 
開發者ID:amap-demo,項目名稱:weex-3d-map,代碼行數:11,代碼來源:BorderDrawable.java

示例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);
        }
    };
}
 
開發者ID:HanyeeWang,項目名稱:GeekZone,代碼行數:11,代碼來源:DiagonalLayout.java

示例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);
  }
}
 
開發者ID:xzg8023,項目名稱:ArcLayout-master,代碼行數:10,代碼來源:ArcDrawable.java

示例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);
}
 
開發者ID:harjot-oberai,項目名稱:MaterialShadows,代碼行數:11,代碼來源:CustomViewOutlineProvider.java

示例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());
  }
}
 
開發者ID:qq565999484,項目名稱:RNLearn_Project1,代碼行數:15,代碼來源:ReactViewBackgroundDrawable.java

示例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);
            }
        };

    }
}
 
開發者ID:YoneHsiung,項目名稱:WavePullLayout,代碼行數:33,代碼來源:HeaderLayout.java

示例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());
  }
}
 
開發者ID:john1jan,項目名稱:ReactNativeSignatureExample,代碼行數:15,代碼來源:ReactViewBackgroundDrawable.java

示例12: getOutline

import android.graphics.Outline; //導入方法依賴的package包/類
@Override
public void getOutline(Outline outline) {
    if (buildConvexPath().isConvex()) {
        outline.setConvexPath(buildConvexPath());
    } else {
        super.getOutline(outline);
    }
}
 
開發者ID:captain-miao,項目名稱:OptionRoundCardview,代碼行數:9,代碼來源:OptRoundRectDrawable.java

示例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());
            }
        }
    };
}
 
開發者ID:developer-shivam,項目名稱:Crescento,代碼行數:15,代碼來源:CrescentoImageView.java

示例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());
            }
        }
    };
}
 
開發者ID:developer-shivam,項目名稱:Crescento,代碼行數:15,代碼來源:CrescentoContainer.java

示例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()));
        }
    };
}
 
開發者ID:huoyabingqian,項目名稱:Crescento-master,代碼行數:12,代碼來源:CrescentoImageView.java


注:本文中的android.graphics.Outline.setConvexPath方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。