Drawable getMinimumHeight - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Drawable getMinimumHeight method.

This code example shows how to use the following methods:draw, getMinimumHeight, getMinimumWidth, getPadding, setBounds
        boolean drawBackground = background != null;
        boolean drawText = (text != null) && (textPaint != null);
 
        Rect padding = new Rect();
        if (drawBackground) {
            background.getPadding(padding);
            minWidth = Math.max(minWidth, background.getMinimumWidth());
            minHeight = Math.max(minHeight, background.getMinimumHeight());
        } 
 
        int ascent = 0;
        int descent = 0;
        int measuredTextWidth = 0;
        if (drawText) {
            // Paint.ascent is negative, so negate it. 
            ascent = (int) Math.ceil(-textPaint.ascent());
            descent = (int) Math.ceil(textPaint.descent());
            measuredTextWidth = (int) Math.ceil(textPaint.measureText(text));
        } 
        int textHeight = ascent + descent;

7
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:draw, getMinimumHeight, getMinimumWidth, setBounds
		 
		if(!isTextCalculated && this.isInflated){
			isTextCalculated = true;
			//Get the maximum allowed width of the text to use on the map 
			int layoutPadding = (int)(30 * density);
			this.arrowWidth = arrowMore.getMinimumWidth();
			this.arrowHeight = arrowMore.getMinimumHeight();
			int maxWidth = this.mapView.getWidth()-this.imageWidth-2*VFOverlayItem.paddingX - layoutPadding - arrowWidth;
			int breakTextIndexTop = 1000;
			int breakTextIndexSub = 1000;
			 
			int maxLength = Math.max(this.topTextBoxRect.width(), this.subTextBoxRect.width());
			if(maxLength > maxWidth){
				breakTextIndexTop = topTextPaint.breakText(this.itemName, true, maxWidth, null);
				if(this.itemDesc != null){
					breakTextIndexSub = subTextPaint.breakText(this.itemDesc, true, maxWidth, null);
				} 
			} 
			 
			if(breakTextIndexTop < this.itemName.length()-1){ //-1 becouse we don't what to remove one char to set .. 

6
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:draw, getMinimumHeight, getMinimumWidth
This code example shows how to use the following methods:getMinimumHeight
        return mDrawable.getMinimumWidth();
    } 
 
    @Override 
    public int getMinimumHeight() { 
        return mDrawable.getMinimumHeight();
    } 
 
    @Override 
    public boolean getPadding(Rect padding) {
        return mDrawable.getPadding(padding);
    } 
 
    /** {@inheritDoc} */ 
    public void invalidateDrawable(Drawable who) {
        invalidateSelf();
    } 
 
    /** {@inheritDoc} */ 
    public void scheduleDrawable(Drawable who, Runnable what, long when) {
6
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:draw, getMinimumHeight, getMinimumWidth, getPadding, setBounds
        boolean drawBackground = background != null;
        boolean drawText = (text != null) && (textPaint != null);
 
        Rect padding = new Rect();
        if (drawBackground) {
            background.getPadding(padding);
            minWidth = Math.max(minWidth, background.getMinimumWidth());
            minHeight = Math.max(minHeight, background.getMinimumHeight());
        } 
 
        int ascent = 0;
        int descent = 0;
        int measuredTextWidth = 0;
        if (drawText) {
            // Paint.ascent is negative, so negate it. 
            ascent = (int) Math.ceil(-textPaint.ascent());
            descent = (int) Math.ceil(textPaint.descent());
            measuredTextWidth = (int) Math.ceil(textPaint.measureText(text));
        } 
        int textHeight = ascent + descent;

6
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:getMinimumHeight, getMinimumWidth
This code example shows how to use the following methods:draw, getMinimumHeight, setBounds
    		myPosition = mapView.getProjection().toPixels(geoPoint, null);
			canvas.drawCircle(myPosition.x, myPosition.y, accurancyRad, accurancyPaint);
			canvas.drawCircle(myPosition.x, myPosition.y, accurancyRad, circlePaint);
    	} 
    	else { 
    		int halfGpsWH = gpsPointer.getMinimumHeight() / 2;
			gpsPointer.setBounds(myPosition.x - halfGpsWH , myPosition.y-halfGpsWH, myPosition.x+halfGpsWH, myPosition.y + halfGpsWH);
			gpsPointer.draw(canvas);
		} 
    	 
    	if(animationState != NOT_ANIMATING){
    		return true; 
    	} 
    	else return false; 
    } 
     
     
     
	public void locationUpdate(LocationInformation location, LocationProvider provider) {
		int myPoslat = (int)(location.getMC2Position().getDecimalLatitude()*1000000);
6
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:getMinimumHeight, getMinimumWidth
        assertNotNull(mAbsoluteLayout);
    } 
     
    public void doMinimumSizeTest(View view) throws Exception {
        assertTrue(view.getClass().getSimpleName() + " should respect the background Drawable's minimum width",
                view.getWidth() >= mBackgroundDrawable.getMinimumWidth());
        assertTrue(view.getClass().getSimpleName() + " should respect the background Drawable's minimum height",
                view.getHeight() >= mBackgroundDrawable.getMinimumHeight());
    } 
 
    @MediumTest 
    public void testTextViewMinimumSize() throws Exception { 
        doMinimumSizeTest(mTextView);
    } 
     
    @MediumTest 
    public void testLinearLayoutMinimumSize() throws Exception { 
        doMinimumSizeTest(mLinearLayout);
    } 
     
6
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:getMinimumHeight, setCallback
        } else { 
            needUpdate = false;
        } 
 
        if (d != null) {
            d.setCallback(this);
 
            // Make sure the ProgressBar is always tall enough 
            int drawableHeight = d.getMinimumHeight();
            if (mMaxHeight < drawableHeight) {
                mMaxHeight = drawableHeight;
                requestLayout();
            } 
        } 
        mProgressDrawable = d;
        if (!mIndeterminate) {
            mCurrentDrawable = d;
            postInvalidate(); 
        } 
 
6
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:getMinimumHeight
		return mDrawable.getIntrinsicWidth();
	} 
 
	@Override 
	public int getMinimumHeight() { 
		return mDrawable.getMinimumHeight();
	} 
 
	@Override 
	public int getMinimumWidth() { 
		return mDrawable.getMinimumWidth();
	} 
 
	@Override 
	public boolean getPadding( Rect padding ) {
		return mDrawable.getPadding( padding );
	} 
 
	@Override 
	public void setBounds( int left, int top, int right, int bottom ) {
6
CodeRank
Connect your IDE to all the code out there  Get Codota for Java

Related Drawable getMinimumHeight Questions & Answers:

getMinimumHeight Method Overview
Returns the minimum height suggested by this Drawable.
See Code Examples for other Android Drawable Methods: