1 package mhr.appandroid.views.brushpicker;
3 import mhr.appandroid.R;
4 import mhr.appandroid.adapters.APDBitmap;
5 import mhr.appandroid.views.MaskView;
6 import mhr.appandroid.views.MaskView.OnMaskCanvasChangedListener;
7 import mhr.appcore.bitmap.Depth;
8 import mhr.appcore.bitmap.NBitmap;
9 import mhr.appcore.generators.BrushGenerator;
10 import android.app.Activity;
11 import android.content.Context;
12 import android.graphics.BitmapFactory;
13 import android.graphics.BitmapShader;
14 import android.graphics.Paint;
15 import android.graphics.Shader.TileMode;
16 import android.util.AttributeSet;
17 import android.view.View;
18 import android.view.View.OnClickListener;
19 import android.widget.Button;
20 import android.widget.CheckBox;
21 import android.widget.CompoundButton;
22 import android.widget.CompoundButton.OnCheckedChangeListener;
23 import android.widget.FrameLayout;
24 import android.widget.SeekBar;
25 import android.widget.SeekBar.OnSeekBarChangeListener;
26 import android.widget.TextView;
53 EVENT_LIVE_PREVIEW_STATE_CHANGED
99 ((Activity) getContext()).getLayoutInflater().inflate(
R.layout.view_brush_picker,
this,
true);
100 }
catch (ClassCastException exc) {
102 TextView tv =
new TextView(getContext());
103 tv.setText(
"Prewiew not available, requires Activity to be Context.");
109 sizeSB = (SeekBar) findViewById(
R.id.SizeValueSB);
110 hardnessSB = (SeekBar) findViewById(
R.id.HardnessValueSB);
111 livePreviewChB = (CheckBox) findViewById(
R.id.RoundBrushLivePreviewChckB);
112 sizeTV = (TextView) findViewById(
R.id.SizeValueTV);
113 hardnessTV = (TextView) findViewById(
R.id.HardnessValueTV);
115 selectBtn = (Button) findViewById(
R.id.RoundBrushPickerSelectBtn);
116 cancelBtn = (Button) findViewById(
R.id.RoundBrushPickerCancelBtn);
122 BitmapShader bsh =
new BitmapShader(BitmapFactory.decodeResource(getResources(),
R.drawable.checkboard), TileMode.REPEAT, TileMode.REPEAT);
126 sizeSB.setOnSeekBarChangeListener(
this);
162 super(context, attrs);
167 super(context, attrs, defStyle);
232 if (maskCanvas == null) {