Back to project page treedo.
The source code is released under:
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE Version 2, December 2004 Everyone is permitted to copy and distribute verbatim or modified copies of this license document, ...
If you think the Android project treedo listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.mbonnin.treedo; // w ww . j av a 2 s .c o m import android.app.ActionBar; import android.content.Context; import android.graphics.Canvas; import android.graphics.Paint; import android.view.View; import android.view.ViewGroup; /** * Created by martin on 13/11/14. */ public class SpacerView extends View { private int mWidth; private int mHeight; public SpacerView(Context context) { super(context); } public void setFixedWidth(int width) { mWidth = width; } public void setFixedHeight(int height) { mHeight = height; } public int getFixedHeight() { return mHeight; } @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { int width; if (mWidth == ViewGroup.LayoutParams.MATCH_PARENT && (MeasureSpec.getMode(widthMeasureSpec) == MeasureSpec.AT_MOST || MeasureSpec.getMode(widthMeasureSpec) == MeasureSpec.EXACTLY)) { width = MeasureSpec.getSize(widthMeasureSpec); } else { width = mWidth; } setMeasuredDimension(width, mHeight); } @Override protected void onDraw(Canvas canvas) { /*Paint p = new Paint(); p.setStyle(Paint.Style.FILL); p.setARGB(255, 255, 255, 255); canvas.drawRect(0, 0, canvas.getWidth(), canvas.getHeight(), p);*/ } }