1 package mhr.appandroid.views.pathpicker;
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.appandroid.views.brushpicker.RoundBrushPickerView;
8 import mhr.appandroid.views.brushpicker.RoundBrushPickerView.RoundBrushPickerEvent;
9 import mhr.appandroid.views.brushpicker.RoundBrushPickerView.RoundBrushPickerViewEventListener;
10 import mhr.appcore.bitmap.Depth;
11 import mhr.appcore.bitmap.NBitmap;
12 import mhr.appcore.blending.Blender;
13 import mhr.appcore.generators.BrushGenerator;
14 import mhr.appcore.utils.Rect;
15 import android.app.Activity;
16 import android.content.Context;
17 import android.graphics.BitmapFactory;
18 import android.graphics.BitmapShader;
19 import android.graphics.Paint;
20 import android.graphics.Shader.TileMode;
21 import android.os.Bundle;
22 import android.os.Parcelable;
23 import android.util.AttributeSet;
24 import android.view.View;
25 import android.view.View.OnClickListener;
26 import android.widget.Button;
27 import android.widget.CheckBox;
28 import android.widget.CompoundButton;
29 import android.widget.FrameLayout;
30 import android.widget.SeekBar;
31 import android.widget.TextView;
32 import android.widget.CompoundButton.OnCheckedChangeListener;
33 import android.widget.SeekBar.OnSeekBarChangeListener;
59 EVENT_LIVE_PREVIEW_STATE_CHANGED
135 ((Activity) getContext()).getLayoutInflater().inflate(
R.layout.view_path_picker,
this,
true);
136 }
catch (ClassCastException exc) {
138 TextView tv =
new TextView(getContext());
139 tv.setText(
"Prewiew not available, requires Activity to be Context.");
145 opacitySB = (SeekBar) findViewById(
R.id.OpacityValueSB);
146 flowSB = (SeekBar) findViewById(
R.id.FlowValueSB);
147 spacingSB = (SeekBar) findViewById(
R.id.SpacingValueSB);
149 opacityTV = (TextView) findViewById(
R.id.OpacityValueTV);
150 flowTV = (TextView) findViewById(
R.id.FlowValueTV);
151 spacingTV = (TextView) findViewById(
R.id.SpacingValueTV);
153 selectBtn = (Button) findViewById(
R.id.PathPickerSelectBtn);
154 cancelBtn = (Button) findViewById(
R.id.PathPickerCancelBtn);
160 BitmapShader bsh =
new BitmapShader(BitmapFactory.decodeResource(getResources(),
R.drawable.checkboard), TileMode.REPEAT, TileMode.REPEAT);
164 opacitySB.setOnSeekBarChangeListener(
this);
165 flowSB.setOnSeekBarChangeListener(
this);
166 spacingSB.setOnSeekBarChangeListener(
this);
198 super(context, attrs);
203 super(context, attrs, defStyle);
255 for (
int i = 0; i <= iMax; i += space) {
272 if (maskCanvas == null) {
319 if (forceParam != null) {
396 if (this.brush != null) {
400 this.brush =
new NBitmap(brush);