当前位置: 首页>>代码示例>>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;未经允许,请勿转载。