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


Java NinePatchDrawable.getPadding方法代码示例

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


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

示例1: ForegroundRelativeLayout

import android.graphics.drawable.NinePatchDrawable; //导入方法依赖的package包/类
public ForegroundRelativeLayout(Context context, AttributeSet attrs, int defStyle) {
	super(context, attrs, defStyle);

	TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.ForegroundRelativeLayout,
			defStyle, 0);

	final Drawable d = a.getDrawable(R.styleable.ForegroundRelativeLayout_foreground);
	if (d != null) {
		setForeground(d);
	}

	a.recycle();

	if (this.getBackground() instanceof NinePatchDrawable) {
		final NinePatchDrawable npd = (NinePatchDrawable) this.getBackground();
		mRectPadding = new Rect();
		if (npd.getPadding(mRectPadding)) {
		 mUseBackgroundPadding = true;
		}
	}
}
 
开发者ID:runtimeco,项目名称:Android-DFU-App,代码行数:22,代码来源:ForegroundRelativeLayout.java

示例2: ForegroundLinearLayout

import android.graphics.drawable.NinePatchDrawable; //导入方法依赖的package包/类
public ForegroundLinearLayout(Context context, AttributeSet attrs, int defStyle) {
	super(context, attrs, defStyle);

	TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.ForegroundRelativeLayout,
			defStyle, 0);

	final Drawable d = a.getDrawable(R.styleable.ForegroundRelativeLayout_foreground);
	if (d != null) {
		setForeground(d);
	}

	a.recycle();

	if (this.getBackground() instanceof NinePatchDrawable) {
		final NinePatchDrawable npd = (NinePatchDrawable) this.getBackground();
		mRectPadding = new Rect();
		if (npd.getPadding(mRectPadding)) {
		 mUseBackgroundPadding = true;
		}
	}
}
 
开发者ID:runtimeco,项目名称:Android-DFU-App,代码行数:22,代码来源:ForegroundLinearLayout.java

示例3: BubbleRessources

import android.graphics.drawable.NinePatchDrawable; //导入方法依赖的package包/类
public BubbleRessources(Context context) {
	backgroundColor = Color.argb(255, 0, 0, 0);
	textPaint = new Paint(Paint.LINEAR_TEXT_FLAG | Paint.ANTI_ALIAS_FLAG);
	textPaint.setColor(Color.WHITE);
	final int LABEL_TEXT_SIZE_DP = 13; // DP
	textPaint.setTextSize(TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,
			LABEL_TEXT_SIZE_DP, context.getResources().getDisplayMetrics()));
	textPaint.setShadowLayer(2, 1, 1, Color.BLACK);
	labelBackground = (NinePatchDrawable) context.getResources().getDrawable(R.drawable.bubble_text_background);
	labelPadding = new Rect();
	labelBackground.getPadding(labelPadding);
	bubbleGlow = context.getResources().getDrawable(R.drawable.bubble_glow_256);
	bubbleImages = new Drawable[4];
	bubbleImages[0] = context.getResources().getDrawable(R.drawable.bubble_32);
	bubbleImages[1] = context.getResources().getDrawable(R.drawable.bubble_64);
	bubbleImages[2] = context.getResources().getDrawable(R.drawable.bubble_128);
	bubbleImages[3] = context.getResources().getDrawable(R.drawable.bubble_256);
	discoveryBubble = context.getResources().getDrawable(R.drawable.similar_bubble);
	colorFilters = new ColorFilters(Mode.MULTIPLY);
}
 
开发者ID:spectralmind,项目名称:sonarflow-android,代码行数:21,代码来源:BubbleRessources.java

示例4: ForegroundLinearLayout

import android.graphics.drawable.NinePatchDrawable; //导入方法依赖的package包/类
public ForegroundLinearLayout(Context context, AttributeSet attrs, int defStyle) {
	super(context, attrs, defStyle);

	TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.ForegroundLinearLayout,
			defStyle, 0);

	final Drawable d = a.getDrawable(R.styleable.ForegroundRelativeLayout_foreground);
	if (d != null) {
		setForeground(d);
	}

	a.recycle();

	if (this.getBackground() instanceof NinePatchDrawable) {
		final NinePatchDrawable npd = (NinePatchDrawable) this.getBackground();
		mRectPadding = new Rect();
		if (npd.getPadding(mRectPadding)) {
		 mUseBackgroundPadding = true;
		}
	}
}
 
开发者ID:NordicSemiconductor,项目名称:Android-nRF-Toolbox,代码行数:22,代码来源:ForegroundLinearLayout.java

示例5: ForegroundRelativeLayout

import android.graphics.drawable.NinePatchDrawable; //导入方法依赖的package包/类
public ForegroundRelativeLayout(Context context, AttributeSet attrs, int defStyle) {
    super(context, attrs, defStyle);

    TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.ForegroundRelativeLayout, defStyle, 0);

    final Drawable d = a.getDrawable(R.styleable.ForegroundRelativeLayout_foreground);
    if (d != null) {
        setForeground(d);
    }

    a.recycle();

    if (this.getBackground() instanceof NinePatchDrawable) {
        final NinePatchDrawable npd = (NinePatchDrawable) this.getBackground();
        if (npd != null) {
            mRectPadding = new Rect();
            if (npd.getPadding(mRectPadding)) {
                mUseBackgroundPadding = true;
            }
        }
    }
}
 
开发者ID:cesards,项目名称:SandBox,代码行数:23,代码来源:ForegroundRelativeLayout.java

示例6: updateNinePatchBounds

import android.graphics.drawable.NinePatchDrawable; //导入方法依赖的package包/类
private void updateNinePatchBounds(NinePatchDrawable ninePatch, int childLeft, int childTop, int childRight, int childBottom) {
    if (ninePatch == null) {
        return;
    }

    final Rect t = mTempRect;
    ninePatch.getPadding(t);
    ninePatch.setBounds(
            childLeft - t.left, childTop - t.top,
            childRight + t.right, childBottom + t.bottom);
}
 
开发者ID:h6ah4i,项目名称:android-materialshadowninepatch,代码行数:12,代码来源:MaterialShadowContainerView.java

示例7: a

import android.graphics.drawable.NinePatchDrawable; //导入方法依赖的package包/类
public static void a(Context paramContext)
{
  if (h) {
    return;
  }
  h = true;
  Resources localResources = paramContext.getResources();
  Paint localPaint1 = new Paint();
  s = localPaint1;
  localPaint1.setFilterBitmap(true);
  s.setColorFilter(a(0.99F));
  Paint localPaint2 = new Paint();
  t = localPaint2;
  localPaint2.setFilterBitmap(true);
  t.setAlpha(128);
  t.setColorFilter(a(0.2F));
  u = efj.B(paramContext, aau.Ad);
  TextPaint localTextPaint = new TextPaint(u);
  v = localTextPaint;
  localTextPaint.setAlpha(128);
  b = efj.i(paramContext);
  m = efj.s(paramContext, 2);
  Bitmap localBitmap = BitmapFactory.decodeResource(localResources, efj.NY);
  a = localBitmap;
  j = (localBitmap.getWidth() - b) / 2;
  i = BitmapFactory.decodeResource(localResources, efj.NZ);
  k = localResources.getDimensionPixelOffset(efj.NW);
  l = localResources.getDimensionPixelOffset(efj.NV);
  n = (NinePatchDrawable)localResources.getDrawable(efj.Oa);
  NinePatchDrawable localNinePatchDrawable = (NinePatchDrawable)localResources.getDrawable(efj.Oa);
  o = localNinePatchDrawable;
  localNinePatchDrawable.setAlpha(128);
  p = new Rect();
  n.getPadding(p);
  q = BitmapFactory.decodeResource(localResources, efj.Oc);
  r = BitmapFactory.decodeResource(localResources, efj.Ob);
  int i1 = localResources.getDimensionPixelOffset(efj.NU);
  int i2 = localResources.getDimensionPixelOffset(efj.NX);
  int i3 = a.getHeight() + k;
  int i4 = i3 - i1;
  int i5 = i4 - (q.getHeight() - i2) / 2;
  c = a.getWidth() + l;
  d = Math.max(i3, i5 + q.getHeight());
  float f1 = a.getWidth() / 2;
  float f2 = i4;
  e = new PointF(f1 / c, f2 / d);
}
 
开发者ID:ChiangC,项目名称:FMTech,代码行数:48,代码来源:ikb.java


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