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


Java ShapeDrawable.setIntrinsicHeight方法代碼示例

本文整理匯總了Java中android.graphics.drawable.ShapeDrawable.setIntrinsicHeight方法的典型用法代碼示例。如果您正苦於以下問題:Java ShapeDrawable.setIntrinsicHeight方法的具體用法?Java ShapeDrawable.setIntrinsicHeight怎麽用?Java ShapeDrawable.setIntrinsicHeight使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.graphics.drawable.ShapeDrawable的用法示例。


在下文中一共展示了ShapeDrawable.setIntrinsicHeight方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: buildColorPickerView

import android.graphics.drawable.ShapeDrawable; //導入方法依賴的package包/類
private void buildColorPickerView(View view, int colorCode) {
    view.setVisibility(View.VISIBLE);

    ShapeDrawable biggerCircle = new ShapeDrawable(new OvalShape());
    biggerCircle.setIntrinsicHeight(20);
    biggerCircle.setIntrinsicWidth(20);
    biggerCircle.setBounds(new Rect(0, 0, 20, 20));
    biggerCircle.getPaint().setColor(colorCode);

    ShapeDrawable smallerCircle = new ShapeDrawable(new OvalShape());
    smallerCircle.setIntrinsicHeight(5);
    smallerCircle.setIntrinsicWidth(5);
    smallerCircle.setBounds(new Rect(0, 0, 5, 5));
    smallerCircle.getPaint().setColor(Color.WHITE);
    smallerCircle.setPadding(10, 10, 10, 10);
    Drawable[] drawables = {smallerCircle, biggerCircle};

    LayerDrawable layerDrawable = new LayerDrawable(drawables);

    view.setBackgroundDrawable(layerDrawable);
}
 
開發者ID:eventtus,項目名稱:photo-editor-android,代碼行數:22,代碼來源:ColorPickerAdapter.java

示例2: createOvalShape

import android.graphics.drawable.ShapeDrawable; //導入方法依賴的package包/類
/**
 * Utility methods
 */
private static ShapeDrawable createOvalShape(int size, int color) {
    ShapeDrawable shape = new ShapeDrawable(new OvalShape());
    shape.setIntrinsicHeight(size);
    shape.setIntrinsicWidth(size);
    shape.getPaint().setColor(color);
    return shape;
}
 
開發者ID:ric96,項目名稱:lineagex86,代碼行數:11,代碼來源:ApplicationLightPreference.java

示例3: make

import android.graphics.drawable.ShapeDrawable; //導入方法依賴的package包/類
/**
 * Creates a new circle for the Badge background.
 *
 * @param size  the width and height for the circle
 * @param color the activeIconColor for the circle
 * @return a nice and adorable circle.
 */
static ShapeDrawable make(int size, int color) {
    ShapeDrawable indicator = new ShapeDrawable(new OvalShape());
    indicator.setIntrinsicWidth(size);
    indicator.setIntrinsicHeight(size);
    indicator.getPaint().setColor(color);
    return indicator;
}
 
開發者ID:A-Miracle,項目名稱:QiangHongBao,代碼行數:15,代碼來源:BadgeCircle.java

示例4: change

import android.graphics.drawable.ShapeDrawable; //導入方法依賴的package包/類
private void change() {
    float[] outerR = new float[]{mSize / 2, mSize / 2, mSize / 2, mSize / 2, mSize / 2, mSize / 2, mSize / 2, mSize / 2};
    Shape shape = new RoundRectShape(outerR, null, null);
    ShapeDrawable shapeDrawable = new ShapeDrawable(shape);
    shapeDrawable.setIntrinsicHeight((int) mSize);
    shapeDrawable.setIntrinsicWidth((int) mSize);
    shapeDrawable.setPadding(0, 0, 0, 0);
    shapeDrawable.getPaint().setColor(mColor);
    shapeDrawable.getPaint().setStyle(Paint.Style.FILL);
    setBackgroundDrawable(shapeDrawable);
    setHeight((int) mSize);
    setMinWidth((int) mSize);
}
 
開發者ID:ryanlijianchang,項目名稱:AdPlayBanner,代碼行數:14,代碼來源:PointView.java

示例5: makeShapeDrawable

import android.graphics.drawable.ShapeDrawable; //導入方法依賴的package包/類
/**
 * Make circle drawable for badge background
 *
 * @param color background color
 * @return return colored circle drawable
 */
static ShapeDrawable makeShapeDrawable(int color) {
    ShapeDrawable badgeBackground = new ShapeDrawable(new OvalShape());
    badgeBackground.setIntrinsicWidth(10);
    badgeBackground.setIntrinsicHeight(10);
    badgeBackground.getPaint().setColor(color);
    return badgeBackground;
}
 
開發者ID:sinhaDroid,項目名稱:BlogBookApp,代碼行數:14,代碼來源:BadgeHelper.java

示例6: setCommonTabDivider

import android.graphics.drawable.ShapeDrawable; //導入方法依賴的package包/類
public static void setCommonTabDivider(CommonTabLayout tabLayout, @ColorInt int color, int showDividers, int padding) {
    LinearLayout linearLayout = (LinearLayout) tabLayout.getChildAt(0);
    linearLayout.setDividerPadding(padding);
    RectShape rectShape = new RectShape();
    float density = tabLayout.getResources().getDisplayMetrics().density;
    ShapeDrawable shapeDrawable = new ShapeDrawable(rectShape);
    shapeDrawable.setIntrinsicWidth((int) density);
    shapeDrawable.setIntrinsicHeight((int) density);
    shapeDrawable.getPaint().setColor(color);
    shapeDrawable.getPaint().setStyle(Paint.Style.STROKE);
    linearLayout.setDividerDrawable(shapeDrawable);
    linearLayout.setShowDividers(showDividers);
}
 
開發者ID:angcyo,項目名稱:RLibrary,代碼行數:14,代碼來源:TabLayoutUtil.java


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