Project

General

Profile

« Previous | Next » 

Revision 7e9be46d

Added by Leszek Koltunski over 8 years ago

Improve Fragment3D app some more!

View differences:

src/main/java/org/distorted/examples/fragment3d/Fragment3DActivity.java
41 41
import org.distorted.library.DistortedCubes;
42 42
import org.distorted.library.DistortedObject;
43 43
import org.distorted.library.EffectNames;
44
import org.distorted.library.EffectTypes;
45
import org.distorted.library.type.Dynamic1D;
46
import org.distorted.library.type.Dynamic3D;
47

  
48
import java.util.ArrayList;
44 49

  
45 50
///////////////////////////////////////////////////////////////////////////////////////////////////
46 51

  
......
67 72

  
68 73
  // fields needed for the second 'apply fragment effects' screen
69 74
  //
70
  private SeekBar bar;
71
  private TextView textChroma, textAlpha, textBrightness, textSaturation, textCenter;
72
  private int chromaL, chromaR, chromaG, chromaB;
73
  private int alphaL;
74
  private int brightnessL;
75
  private int saturationL;
75
  private TextView textCenter;
76 76
  private int centerX, centerY;
77

  
78
  private float fchromaL, fchromaR, fchromaG, fchromaB;
79
  private float falphaL;
80
  private float fbrightnessL;
81
  private float fsaturationL;
82 77
  private float fcenterX, fcenterY;
83
  private EffectNames[] effects = new EffectNames[4];
78
  private ArrayList<Fragment3DEffect> mEffects;
84 79

  
85 80
///////////////////////////////////////////////////////////////////////////////////////////////////
86 81
    
......
89 84
    {
90 85
    super.onCreate(savedState);
91 86

  
87
    mEffects = new ArrayList<>();
88

  
92 89
    setContentView(R.layout.objectpickerlayout);
93 90

  
94 91
    mColsPicker = (NumberPicker)findViewById(R.id.objectpicker_cols);
......
195 192

  
196 193
///////////////////////////////////////////////////////////////////////////////////////////////////
197 194

  
198
  public void onClick(View view)
195
  public int getBitmap()
199 196
    {
200
    Button tmp = (Button)view;
201
    int id = tmp.getId();
202
    mShape[id] = !mShape[id];
203
    tmp.setBackgroundColor(mShape[id] ? COLOR_ON:COLOR_OFF);
197
    return mBitmap;
204 198
    }
205 199

  
206 200
///////////////////////////////////////////////////////////////////////////////////////////////////
207 201

  
208
  public int getBitmap()
202
  public void onClick(View view)
209 203
    {
210
    return mBitmap;
204
    Button tmp = (Button)view;
205
    int id = tmp.getId();
206
    mShape[id] = !mShape[id];
207
    tmp.setBackgroundColor(mShape[id] ? COLOR_ON:COLOR_OFF);
211 208
    }
212 209

  
213 210
///////////////////////////////////////////////////////////////////////////////////////////////////
214 211

  
215 212
  public void Continue(View v)
216 213
    {
214
    firstScreen = false;
215

  
217 216
    if( mObjectType==1 )
218 217
      {
219
      firstScreen = false;
220 218
      mObject = new DistortedBitmap(100,100,mNumCols);
221
      setContentView(R.layout.fragment3dlayout);
222
      Default(null);
219
      setFragmentView();
223 220
      }
224 221
    else
225 222
      {
......
249 246

  
250 247
    mObject = new DistortedCubes(mNumCols, str, 10);
251 248

  
252
    setContentView(R.layout.fragment3dlayout);
253
    Default(null);
249
    setFragmentView();
254 250
    }
255 251

  
256 252

  
......
281 277
///////////////////////////////////////////////////////////////////////////////////////////////////
282 278
// 'second screen' methods
283 279

  
284
  public void Default(View view)
280
  private void setFragmentView()
285 281
    {
286
    effects[0] = EffectNames.CHROMA;
287
    effects[1] = EffectNames.ALPHA;
288
    effects[2] = EffectNames.BRIGHTNESS;
289
    effects[3] = EffectNames.SATURATION;
290
    
291
    chromaL = 0;
292
    chromaR = 0;
293
    chromaG = 0;
294
    chromaB = 0;
282
    final View view = getLayoutInflater().inflate(R.layout.fragment3dlayout, null);
295 283

  
296
    alphaL     = 0;
297
    brightnessL= 0;
298
    saturationL= 0;
284
    setContentView(view);
299 285

  
300 286
    centerX = 50;
301 287
    centerY = 50;
302 288

  
303
    textCenter = (TextView)findViewById(R.id.fragment3dcenterText);
289
    textCenter = (TextView)view.findViewById(R.id.fragment3dcenterText);
304 290
    computeCenter();
305 291
    setCenterText();
306 292

  
307
    setBar(R.id.fragment3dcenterX, centerX);
308
    setBar(R.id.fragment3dcenterY, centerY);
309

  
310
    addViews();
311
    }
312
    
313
///////////////////////////////////////////////////////////////////////////////////////////////////
314
    
315
  private void addViews()
316
    {
317
    LinearLayout layout = (LinearLayout)findViewById(R.id.fragment3dlayout);
318
    
319
    layout.removeAllViews();
320
      
321
    View chroma    = getLayoutInflater().inflate(R.layout.fragment3dchroma    , null);
322
    View alpha     = getLayoutInflater().inflate(R.layout.fragment3dalpha     , null);
323
    View brightness= getLayoutInflater().inflate(R.layout.fragment3dbrightness, null);
324
    View saturation= getLayoutInflater().inflate(R.layout.fragment3dsaturation, null);
325
     
326
    for( int i=effects.length-1 ; i>=0 ; i-- )
327
      {
328
      switch(effects[i])
329
        {
330
        case CHROMA     : layout.addView(chroma    , 0); break;
331
        case ALPHA      : layout.addView(alpha     , 0); break;
332
        case BRIGHTNESS : layout.addView(brightness, 0); break;
333
        case SATURATION : layout.addView(saturation, 0); break;
334
        }
335
      }
336
      
337
    textChroma    = (TextView)findViewById(R.id.fragment3dchromaText);
338
    textAlpha     = (TextView)findViewById(R.id.fragment3dalphaText);
339
    textBrightness= (TextView)findViewById(R.id.fragment3dbrightnessText);
340
    textSaturation= (TextView)findViewById(R.id.fragment3dsaturationText);
341
     
342
    setChromaText();
343
    setAlphaText();
344
    setBrightnessText();
345
    setSaturationText();
346
      
347
    setBar(R.id.fragment3dchromaBar1, chromaL);
348
    setBar(R.id.fragment3dchromaBar2, chromaR);
349
    setBar(R.id.fragment3dchromaBar3, chromaG);
350
    setBar(R.id.fragment3dchromaBar4, chromaB);
351

  
352
    setBar(R.id.fragment3dalphaBar1     , alphaL);
353
    setBar(R.id.fragment3dbrightnessBar1, brightnessL);
354
    setBar(R.id.fragment3dsaturationBar1, saturationL);
355

  
356
    Fragment3DSurfaceView view = (Fragment3DSurfaceView)findViewById(R.id.fragment3dSurfaceView);
357
    view.getRenderer().setOrder(effects);
358
    }
359

  
360
///////////////////////////////////////////////////////////////////////////////////////////////////
361

  
362
  private void moveUp(EffectNames name)
363
    {
364
    int len = effects.length-1;
365
    int index = -1;
293
    SeekBar bar;
366 294

  
367
    for(int i=0; i<=len; i++)
368
      {
369
      if( effects[i]==name )
370
        {
371
        index=i;
372
        break;
373
        }
374
      }
375

  
376
    if( index==0 )
377
      {
378
      for(int i=0; i<len; i++)
379
        effects[i] = effects[i+1];
380

  
381
      effects[len] = name;
382
      }
383
    else if( index>0 )
384
      {
385
      effects[index]   = effects[index-1];
386
      effects[index-1] = name;
387
      }
388

  
389
    addViews();
390
    }
391

  
392
///////////////////////////////////////////////////////////////////////////////////////////////////
295
    bar = (SeekBar)view.findViewById(R.id.fragment3dcenterX);
296
    bar.setOnSeekBarChangeListener(this);
297
    bar.setProgress(centerX);
393 298

  
394
  public void ButtonChroma(View v)
395
    {
396
    moveUp(EffectNames.CHROMA);
299
    bar = (SeekBar)view.findViewById(R.id.fragment3dcenterY);
300
    bar.setOnSeekBarChangeListener(this);
301
    bar.setProgress(centerY);
397 302
    }
398 303

  
399 304
///////////////////////////////////////////////////////////////////////////////////////////////////
400 305

  
401
  public void ButtonAlpha(View v)
306
  public void newChroma(View v)
402 307
    {
403
    moveUp(EffectNames.ALPHA);
404
    }
308
    Fragment3DEffect chroma = new Fragment3DEffect(EffectNames.CHROMA);
309
    mEffects.add(chroma);
405 310

  
406
///////////////////////////////////////////////////////////////////////////////////////////////////
407

  
408
  public void ButtonBrightness(View v)
409
    {
410
    moveUp(EffectNames.BRIGHTNESS);
411
    }
311
    View view = chroma.createView(this);
312
    LinearLayout layout = (LinearLayout)findViewById(R.id.fragment3dlayout);
313
    layout.addView(view,0);
412 314

  
413
///////////////////////////////////////////////////////////////////////////////////////////////////
315
    Dynamic1D dyn1 = chroma.getDyn1();
316
    Dynamic3D dyn3 = chroma.getDyn3();
414 317

  
415
  public void ButtonSaturation(View v)
416
    {
417
    moveUp(EffectNames.SATURATION);
318
    mObject.chroma(dyn1,dyn3);
418 319
    }
419 320

  
420 321
///////////////////////////////////////////////////////////////////////////////////////////////////
421 322

  
422
  private void setBar(int id, int value)
323
  public void newAlpha(View v)
423 324
    {
424
    bar = (SeekBar)findViewById(id);
425
    bar.setOnSeekBarChangeListener(this);
426
    bar.setProgress(value);
427
    }
428

  
429
///////////////////////////////////////////////////////////////////////////////////////////////////
325
    Fragment3DEffect alpha = new Fragment3DEffect(EffectNames.ALPHA);
326
    mEffects.add(alpha);
430 327

  
431
  private void computeChroma()
432
    {
433
    Fragment3DSurfaceView view = (Fragment3DSurfaceView)findViewById(R.id.fragment3dSurfaceView);
434
    Fragment3DRenderer renderer = view.getRenderer();
328
    View view = alpha.createView(this);
329
    LinearLayout layout = (LinearLayout)findViewById(R.id.fragment3dlayout);
330
    layout.addView(view,0);
435 331

  
436
    fchromaL = chromaL/100.0f;
437
    fchromaR = chromaR*255/100.0f;
438
    fchromaG = chromaG*255/100.0f;
439
    fchromaB = chromaB*255/100.0f;
332
    Dynamic1D dyn1 = alpha.getDyn1();
440 333

  
441
    renderer.setChroma( fchromaL, fchromaR, fchromaG, fchromaB );
334
    mObject.alpha(dyn1);
442 335
    }
443 336

  
444 337
///////////////////////////////////////////////////////////////////////////////////////////////////
445 338

  
446
  private void setChromaText()
339
  public void newBrightness(View v)
447 340
    {
448
    fchromaL = ((int)(100*fchromaL))/100.0f;
449
    fchromaR = (float)((int)fchromaR);
450
    fchromaG = (float)((int)fchromaG);
451
    fchromaB = (float)((int)fchromaB);
341
    Fragment3DEffect brightness = new Fragment3DEffect(EffectNames.BRIGHTNESS);
342
    mEffects.add(brightness);
452 343

  
453
    textChroma.setText("chroma("+fchromaL+"( "+fchromaR+" , "+fchromaG+" , "+fchromaB+" )");
454
    }
455

  
456
///////////////////////////////////////////////////////////////////////////////////////////////////
457

  
458
  private void computeAlpha()
459
    {
460
    Fragment3DSurfaceView view = (Fragment3DSurfaceView)findViewById(R.id.fragment3dSurfaceView);
344
    View view = brightness.createView(this);
345
    LinearLayout layout = (LinearLayout)findViewById(R.id.fragment3dlayout);
346
    layout.addView(view,0);
461 347

  
462
    falphaL = alphaL/100.0f;
348
    Dynamic1D dyn1 = brightness.getDyn1();
463 349

  
464
    view.getRenderer().setAlpha(falphaL);
350
    mObject.brightness(dyn1);
465 351
    }
466 352

  
467 353
///////////////////////////////////////////////////////////////////////////////////////////////////
468 354

  
469
  private void setAlphaText()
355
  public void newSaturation(View v)
470 356
    {
471
    falphaL = ((int)(100*falphaL))/100.0f;
472

  
473
    textAlpha.setText("alpha("+falphaL+")");
474
    }
357
    Fragment3DEffect saturation = new Fragment3DEffect(EffectNames.SATURATION);
358
    mEffects.add(saturation);
475 359

  
476
///////////////////////////////////////////////////////////////////////////////////////////////////
477

  
478
  private void computeBrightness()
479
    {
480
    Fragment3DSurfaceView view = (Fragment3DSurfaceView)findViewById(R.id.fragment3dSurfaceView);
360
    View view = saturation.createView(this);
361
    LinearLayout layout = (LinearLayout)findViewById(R.id.fragment3dlayout);
362
    layout.addView(view,0);
481 363

  
482
    fbrightnessL = brightnessL/100.0f;
364
    Dynamic1D dyn1 = saturation.getDyn1();
483 365

  
484
    view.getRenderer().setBrightness( fbrightnessL );
366
    mObject.saturation(dyn1);
485 367
    }
486 368

  
487 369
///////////////////////////////////////////////////////////////////////////////////////////////////
488 370

  
489
  private void setBrightnessText()
371
  public void removeAll(View v)
490 372
    {
491
    fbrightnessL = ((int)(100*fbrightnessL))/100.0f;
492

  
493
    textBrightness.setText("brightness("+fbrightnessL+")");
494
    }
495

  
496
///////////////////////////////////////////////////////////////////////////////////////////////////
497

  
498
  private void computeSaturation()
499
    {
500
    Fragment3DSurfaceView view = (Fragment3DSurfaceView)findViewById(R.id.fragment3dSurfaceView);
501

  
502
    fsaturationL = saturationL/100.0f;
503

  
504
    view.getRenderer().setSaturation( fsaturationL );
505
    }
506
    
507
///////////////////////////////////////////////////////////////////////////////////////////////////
508

  
509
  private void setSaturationText()
510
    {
511
    fsaturationL = ((int)(100*fsaturationL))/100.0f;
512

  
513
    textSaturation.setText("saturation("+fsaturationL+")");
373
    mEffects.clear();
374
    LinearLayout layout = (LinearLayout)findViewById(R.id.fragment3dlayout);
375
    layout.removeAllViews();
376
    mObject.abortEffects(EffectTypes.FRAGMENT);
514 377
    }
515 378

  
516 379
///////////////////////////////////////////////////////////////////////////////////////////////////
......
599 462
    {
600 463
    switch (bar.getId())
601 464
      {
602
      case R.id.fragment3dcenterX       : centerX    = progress; computeCenter()    ; setCenterText()    ; break;
603
      case R.id.fragment3dcenterY       : centerY    = progress; computeCenter()    ; setCenterText()    ; break;
604
      case R.id.fragment3dchromaBar1    : chromaL    = progress; computeChroma()    ; setChromaText()    ; break;
605
      case R.id.fragment3dchromaBar2    : chromaR    = progress; computeChroma()    ; setChromaText()    ; break;
606
      case R.id.fragment3dchromaBar3    : chromaG    = progress; computeChroma()    ; setChromaText()    ; break;
607
      case R.id.fragment3dchromaBar4    : chromaB    = progress; computeChroma()    ; setChromaText()    ; break;
608
      case R.id.fragment3dalphaBar1     : alphaL     = progress; computeAlpha()     ; setAlphaText()     ; break;
609
      case R.id.fragment3dbrightnessBar1: brightnessL= progress; computeBrightness(); setBrightnessText(); break;
610
      case R.id.fragment3dsaturationBar1: saturationL= progress; computeSaturation(); setSaturationText(); break;
465
      case R.id.fragment3dcenterX: centerX    = progress; computeCenter()    ; setCenterText()    ; break;
466
      case R.id.fragment3dcenterY: centerY    = progress; computeCenter()    ; setCenterText()    ; break;
611 467
      }
612 468
    }
613 469

  
src/main/java/org/distorted/examples/fragment3d/Fragment3DEffect.java
75 75
    {
76 76
    switch(mName)
77 77
      {
78
      case CHROMA    : mInter[0] = 100;
78
      case CHROMA    : mInter[0] =   0;
79 79
                       mInter[1] =   0;
80 80
                       mInter[2] =   0;
81 81
                       mInter[3] =   0;
......
115 115
  public Fragment3DEffect(EffectNames name)
116 116
    {
117 117
    mName = name;
118
    mDimension = name.getDimension();
119

  
120
    mInter = new int[mDimension];
121
    mSeek  = new SeekBar[mDimension];
122

  
123
    mDyn1 = new Dynamic1D();
124
    mSta1 = new Static1D(0);
125
    mDyn1.add(mSta1);
126 118

  
127 119
    if( mName==EffectNames.CHROMA )
128 120
      {
121
      mDimension = 4;
129 122
      mDyn3 = new Dynamic3D();
130 123
      mSta3 = new Static3D(0,0,0);
131 124
      mDyn3.add(mSta3);
132 125
      }
133 126
    else
134 127
      {
128
      mDimension = 1;
135 129
      mDyn3 = null;
136 130
      mSta3 = null;
137 131
      }
132

  
133
    mInter = new int[mDimension];
134
    mSeek  = new SeekBar[mDimension];
135

  
136
    mDyn1 = new Dynamic1D();
137
    mSta1 = new Static1D(0);
138
    mDyn1.add(mSta1);
139
    }
140

  
141
///////////////////////////////////////////////////////////////////////////////////////////////////
142

  
143
  public Dynamic1D getDyn1()
144
    {
145
    return mDyn1;
138 146
    }
139 147

  
140 148
///////////////////////////////////////////////////////////////////////////////////////////////////
141 149

  
142
  public void addView(Activity act, LinearLayout layout)
150
  public Dynamic3D getDyn3()
151
    {
152
    return mDyn3;
153
    }
154

  
155
///////////////////////////////////////////////////////////////////////////////////////////////////
156

  
157
  public View createView(Activity act)
143 158
    {
144 159
    View effect;
145 160

  
......
168 183
               mSeek[3] = (SeekBar)effect.findViewById(R.id.effect4dbar3);
169 184
               break;
170 185
      default: android.util.Log.e("Fragment3DEffect", "dimension "+mDimension+" not supported!");
171
               return;
186
               return null;
172 187
      }
173 188

  
174 189
    setDefaultInter();
......
181 196
      mSeek[i].setProgress( mInter[i] );
182 197
      }
183 198

  
184
    layout.addView(effect, 0);
199
    return effect;
185 200
    }
186 201

  
187 202
///////////////////////////////////////////////////////////////////////////////////////////////////
......
194 209
    if ( mDimension>=4 && bar.getId()==mSeek[3].getId() ) mInter[3] = progress;
195 210

  
196 211
    fillStatics();
212
    setText();
197 213
    }
198 214

  
199 215
///////////////////////////////////////////////////////////////////////////////////////////////////
src/main/java/org/distorted/examples/fragment3d/Fragment3DRenderer.java
61 61

  
62 62
    private DynamicQuat mQuatInt1, mQuatInt2;
63 63

  
64
    private EffectNames[] order;
65

  
66
    private Dynamic2D mCenterInter;
67
    private Dynamic3D mChromaInter, mMoveInter;
68
    private Dynamic1D mChromaLevelInter, mAlphaInter, mBrightnessInter, mSaturationInter;
69

  
70
    private Static2D mCenterPoint;
71
    private Static3D mChromaPoint, mMovePoint;
72
    private Static1D mChromaLevel, mAlphaPoint, mBrightnessPoint, mSaturationPoint;
64
    private Dynamic3D mMoveInter;
65
    private Static3D mMovePoint;
73 66

  
74 67
    Static4D mQuat1, mQuat2;
75 68
    int mScreenMin;
76 69

  
77
///////////////////////////////////////////////////////////////////////////////////////////////////
78

  
79
    public void setChroma(float level, float r, float g, float b)
80
      {
81
      mChromaLevel.set(level);
82
      mChromaPoint.set(r, g, b);
83
      }
84
    
85
///////////////////////////////////////////////////////////////////////////////////////////////////
86

  
87
    public void setAlpha(float level)
88
      {
89
      mAlphaPoint.set(level);
90
      }
91
     
92
///////////////////////////////////////////////////////////////////////////////////////////////////
93

  
94
    public void setBrightness(float level)
95
      {
96
      mBrightnessPoint.set(level);
97
      }
98
    
99
///////////////////////////////////////////////////////////////////////////////////////////////////
100

  
101
    public void setSaturation(float level)
102
      {
103
      mSaturationPoint.set(level);
104
      }
105

  
106 70
///////////////////////////////////////////////////////////////////////////////////////////////////
107 71

  
108 72
    public void setCenter(float x, float y)
......
110 74
      x = (0.012f*x-0.1f)*mObjWidth;
111 75
      y = (0.012f*y-0.1f)*mObjHeight;
112 76

  
113
      mCenterPoint.set(x,y);
114 77
      mMovePoint.set(mFactorObj*x,mFactorObj*y,0);
115 78
      }
116 79

  
117
///////////////////////////////////////////////////////////////////////////////////////////////////
118

  
119
    public void setOrder(EffectNames[] effects)
120
      {
121
      order = effects;
122
      setFragmentEffects();
123
      }
124
      
125
///////////////////////////////////////////////////////////////////////////////////////////////////
126

  
127
    private void setFragmentEffects()
128
      {
129
      mObject.abortEffects(EffectTypes.FRAGMENT);
130

  
131
      for( int i=0; i<=order.length-1 ; i++ )
132
        {
133
        switch(order[i])
134
          {
135
          case CHROMA    : mObject.chroma    ( mChromaLevelInter , mChromaInter) ; break;
136
          case ALPHA     : mObject.alpha     ( mAlphaInter                     ) ; break;
137
          case BRIGHTNESS: mObject.brightness( mBrightnessInter                ) ; break;
138
          case SATURATION: mObject.saturation( mSaturationInter                ) ; break;
139
          }
140
        }
141
      }
142
    
143 80
///////////////////////////////////////////////////////////////////////////////////////////////////
144 81

  
145 82
    public Fragment3DRenderer(GLSurfaceView v)
......
152 89
      mObjWidth = mObject.getWidth();
153 90
      mObjHeight= mObject.getHeight();
154 91

  
155
      mCenterPoint    = new Static2D(0,0);
156
      mMovePoint      = new Static3D(0,0,0);
157
      mChromaPoint    = new Static3D(0,0,0);
158
      mChromaLevel    = new Static1D(0);
159
      mAlphaPoint     = new Static1D(1);
160
      mBrightnessPoint= new Static1D(1);
161
      mSaturationPoint= new Static1D(0.5f);
162

  
163
      mCenterInter     = new Dynamic2D();
164
      mMoveInter       = new Dynamic3D();
165
      mChromaInter     = new Dynamic3D();
166
      mChromaLevelInter= new Dynamic1D();
167
      mAlphaInter      = new Dynamic1D();
168
      mBrightnessInter = new Dynamic1D();
169
      mSaturationInter = new Dynamic1D();
170

  
171
      mCenterInter.add(mCenterPoint);
92
      mMovePoint= new Static3D(0,0,0);
93
      mMoveInter= new Dynamic3D();
172 94
      mMoveInter.add(mMovePoint);
173
      mChromaInter.add(mChromaPoint);
174
      mChromaLevelInter.add(mChromaLevel);
175
      mAlphaInter.add(mAlphaPoint);
176
      mBrightnessInter.add(mBrightnessPoint);
177
      mSaturationInter.add(mSaturationPoint);
178 95

  
179 96
      mQuat1 = new Static4D(0,0,0,1);  // unity
180 97
      mQuat2 = new Static4D(0,0,0,1);  // quaternions
......
246 163
      mCenter.move(mMoveInter);
247 164
      mCenter.scale(mFactorCen);
248 165

  
249
      setFragmentEffects();
250

  
251 166
      Distorted.onSurfaceChanged(width, height); 
252 167
      }
253 168

  
src/main/res/layout/effect1d.xml
22 22
            android:layout_marginLeft="5dp"
23 23
            android:layout_marginRight="5dp" />
24 24

  
25

  
26
        <View
27
            android:layout_height="3dip"
28
            android:background="#777777"
29
            android:layout_width="match_parent"
30
            />
31

  
25 32
</LinearLayout>
src/main/res/layout/effect2d.xml
29 29
            android:layout_marginEnd="5dp"
30 30
            android:layout_marginLeft="5dp"
31 31
            android:layout_marginRight="5dp" />
32

  
33
        <View
34
            android:layout_height="3dip"
35
            android:background="#777777"
36
            android:layout_width="match_parent"
37
            />
38

  
32 39
</LinearLayout>
src/main/res/layout/effect3d.xml
36 36
            android:layout_marginEnd="5dp"
37 37
            android:layout_marginLeft="5dp"
38 38
            android:layout_marginRight="5dp" />
39

  
40
        <View
41
            android:layout_height="3dip"
42
            android:background="#777777"
43
            android:layout_width="match_parent"
44
            />
45

  
39 46
</LinearLayout>
src/main/res/layout/effect4d.xml
44 44
            android:layout_marginEnd="5dp"
45 45
            android:layout_marginLeft="5dp"
46 46
            android:layout_marginRight="5dp" />
47

  
48
        <View
49
            android:layout_height="3dip"
50
            android:background="#777777"
51
            android:layout_width="match_parent"
52
            />
53

  
47 54
</LinearLayout>
src/main/res/layout/fragment3dalpha.xml
1
<?xml version="1.0" encoding="utf-8"?>
2
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3
              android:id="@+id/fragment3dRowAlpha"
4
              android:layout_width="match_parent"
5
              android:layout_height="wrap_content"
6
              android:orientation="horizontal">
7

  
8
    <LinearLayout
9
        android:layout_width="0dp"
10
        android:layout_height="wrap_content"
11
        android:layout_weight="0.8"
12
        android:orientation="vertical" >
13

  
14
        <TextView
15
            android:id="@+id/fragment3dalphaText"
16
            android:layout_width="wrap_content"
17
            android:layout_height="wrap_content"
18
            android:layout_marginEnd="5dp"
19
            android:layout_marginStart="5dp"
20
            android:layout_marginTop="3dp"
21
            />
22

  
23
        <SeekBar
24
            android:id="@+id/fragment3dalphaBar1"
25
            android:layout_width="fill_parent"
26
            android:layout_height="wrap_content"
27
            android:layout_marginEnd="5dp"
28
            android:layout_marginLeft="5dp"
29
            android:layout_marginRight="5dp" />
30
    </LinearLayout>
31

  
32
    <Button
33
        android:id="@+id/fragment3dUpAlpha"
34
        android:layout_width="60dp"
35
        android:layout_height="fill_parent"
36
        android:onClick="ButtonAlpha"
37
        android:text="@string/Up" />
38
</LinearLayout>
src/main/res/layout/fragment3dbrightness.xml
1
<?xml version="1.0" encoding="utf-8"?>
2

  
3
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
4
              android:id="@+id/fragment3dRowBrightness"
5
              android:orientation="horizontal"
6
              android:layout_width="match_parent"
7
              android:layout_height="wrap_content" >
8

  
9
    <LinearLayout
10
        android:layout_width="0dp"
11
        android:layout_height="match_parent"
12
        android:layout_weight="0.70"
13
        android:orientation="vertical" >
14

  
15
        <TextView
16
            android:id="@+id/fragment3dbrightnessText"
17
            android:layout_width="wrap_content"
18
            android:layout_height="wrap_content"
19
            android:layout_marginEnd="5dp"
20
            android:layout_marginStart="5dp"
21
            android:layout_marginTop="3dp" />
22

  
23
        <SeekBar
24
            android:id="@+id/fragment3dbrightnessBar1"
25
            android:layout_width="fill_parent"
26
            android:layout_height="wrap_content"
27
            android:layout_gravity="end"
28
            android:layout_marginEnd="5dp"
29
            android:layout_marginLeft="5dp"
30
            android:layout_marginRight="5dp" />
31

  
32
    </LinearLayout>
33

  
34
    <Button
35
        android:id="@+id/fragment3dUpBrightness"
36
        android:layout_width="60dp"
37
        android:layout_height="fill_parent"
38
        android:onClick="ButtonBrightness"
39
        android:text="@string/Up" />
40

  
41
</LinearLayout>
src/main/res/layout/fragment3dchroma.xml
1
<?xml version="1.0" encoding="utf-8"?>
2

  
3
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
4
              android:id="@+id/fragment3dRowChroma"
5
              android:orientation="horizontal"
6
              android:layout_width="match_parent"
7
              android:layout_height="wrap_content" >
8
    <LinearLayout
9
        android:layout_width="0dp"
10
        android:layout_height="match_parent"
11
        android:layout_weight="0.70"
12
        android:orientation="vertical" >
13

  
14
        <TextView
15
            android:id="@+id/fragment3dchromaText"
16
            android:layout_width="wrap_content"
17
            android:layout_height="wrap_content"
18
            android:layout_marginEnd="5dp"
19
            android:layout_marginStart="5dp"
20
            android:layout_marginTop="3dp" />
21

  
22
        <SeekBar
23
            android:id="@+id/fragment3dchromaBar1"
24
            android:layout_width="fill_parent"
25
            android:layout_height="wrap_content"
26
            android:layout_gravity="end"
27
            android:layout_marginEnd="5dp"
28
            android:layout_marginLeft="5dp"
29
            android:layout_marginRight="5dp" />
30

  
31
        <LinearLayout
32
            android:orientation="horizontal"
33
            android:layout_width="match_parent"
34
            android:layout_height="match_parent">
35

  
36
            <SeekBar
37
                android:id="@+id/fragment3dchromaBar2"
38
                android:layout_width="fill_parent"
39
                android:layout_height="wrap_content"
40
                android:layout_marginLeft="5dp"
41
                android:layout_marginRight="5dp"
42
                android:layout_weight="0.33"/>
43

  
44
            <SeekBar
45
                android:id="@+id/fragment3dchromaBar3"
46
                android:layout_width="fill_parent"
47
                android:layout_height="wrap_content"
48
                android:layout_marginEnd="5dp"
49
                android:layout_marginLeft="5dp"
50
                android:layout_marginRight="5dp"
51
                android:layout_weight="0.33"/>
52

  
53
            <SeekBar
54
                android:id="@+id/fragment3dchromaBar4"
55
                android:layout_width="fill_parent"
56
                android:layout_height="wrap_content"
57
                android:layout_marginRight="5dp"
58
                android:layout_marginLeft="5dp"
59
                android:layout_weight="0.33"/>
60

  
61
        </LinearLayout>
62

  
63
    </LinearLayout>
64

  
65
    <Button
66
        android:id="@+id/fragment3dUpChroma"
67
        android:layout_width="60dp"
68
        android:layout_height="fill_parent"
69
        android:onClick="ButtonChroma"
70
        android:text="@string/Up" />
71

  
72
</LinearLayout>
src/main/res/layout/fragment3dlayout.xml
13 13
    <LinearLayout
14 14
        android:orientation="horizontal"
15 15
        android:layout_width="match_parent"
16
        android:layout_height="wrap_content"
17
        android:layout_marginBottom="5dp"
18
        android:background="@android:color/holo_green_dark">
16
        android:layout_height="50dp"
17
        android:layout_gravity="center">
18

  
19
        <Button
20
            android:layout_width="wrap_content"
21
            android:layout_height="wrap_content"
22
            android:text="@string/reset"
23
            android:id="@+id/buttonRemove"
24
            android:onClick="removeAll"
25
            />
26

  
27
        <Button
28
            android:layout_width="wrap_content"
29
            android:layout_height="wrap_content"
30
            android:text="@string/chroma"
31
            android:id="@+id/buttonChroma"
32
            android:onClick="newChroma"/>
33

  
34
        <Button
35
            android:layout_width="wrap_content"
36
            android:layout_height="wrap_content"
37
            android:text="@string/alpha"
38
            android:id="@+id/buttonAlpha"
39
            android:onClick="newAlpha"/>
40

  
41
        <Button
42
            android:layout_width="wrap_content"
43
            android:layout_height="wrap_content"
44
            android:text="@string/brightness"
45
            android:id="@+id/buttonBrightness"
46
            android:onClick="newBrightness"/>
47

  
48
        <Button
49
            android:layout_width="wrap_content"
50
            android:layout_height="wrap_content"
51
            android:text="@string/saturation"
52
            android:id="@+id/buttonSaturation"
53
            android:onClick="newSaturation"/>
54
    </LinearLayout>
55

  
56
    <LinearLayout
57
        android:orientation="vertical"
58
        android:layout_width="fill_parent"
59
        android:layout_height="50dp"
60
        >
61

  
62
        <TextView
63
            android:id="@+id/fragment3dcenterText"
64
            android:layout_width="wrap_content"
65
            android:layout_height="wrap_content"
66
            android:layout_marginEnd="5dp"
67
            android:layout_marginStart="5dp"
68
            android:layout_marginTop="3dp"
69
            />
19 70

  
20 71
        <LinearLayout
21
            android:orientation="vertical"
22
            android:layout_width="0dp"
72
            android:orientation="horizontal"
73
            android:layout_width="match_parent"
23 74
            android:layout_height="match_parent"
24
            android:layout_weight="0.8">
75
            >
25 76

  
26
            <TextView
27
                android:id="@+id/fragment3dcenterText"
28
                android:layout_width="wrap_content"
77
            <SeekBar
78
                android:layout_width="fill_parent"
29 79
                android:layout_height="wrap_content"
30
                android:layout_marginEnd="5dp"
31
                android:layout_marginStart="5dp"
32
                android:layout_marginTop="3dp"
33
                />
34

  
35
            <LinearLayout
36
                android:orientation="horizontal"
37
                android:layout_width="match_parent"
38
                android:layout_height="match_parent"
39
                >
40

  
41
                <SeekBar
42
                    android:layout_width="fill_parent"
43
                    android:layout_height="wrap_content"
44
                    android:id="@+id/fragment3dcenterX"
45
                    android:layout_weight="0.5"
46
                    android:paddingLeft="5dp"
47
                    android:paddingRight="3dp"/>
48

  
49
                <SeekBar
50
                    android:layout_width="fill_parent"
51
                    android:layout_height="wrap_content"
52
                    android:id="@+id/fragment3dcenterY"
53
                    android:layout_weight="0.5"
54
                    android:paddingLeft="3dp"
55
                    android:paddingRight="5dp"/>
56
            </LinearLayout>
80
                android:id="@+id/fragment3dcenterX"
81
                android:layout_weight="0.5"
82
                android:paddingLeft="5dp"
83
                android:paddingRight="3dp"/>
57 84

  
85
            <SeekBar
86
                android:layout_width="fill_parent"
87
                android:layout_height="wrap_content"
88
                android:id="@+id/fragment3dcenterY"
89
                android:layout_weight="0.5"
90
                android:paddingLeft="3dp"
91
                android:paddingRight="5dp"/>
58 92
        </LinearLayout>
59 93

  
60
        <Button
61
            android:id="@+id/buttonDefault"
62
            android:layout_width="60dp"
63
            android:layout_height="wrap_content"
64
            android:onClick="Default"
65
            android:text="@string/reset"
66
            android:layout_gravity="right"
67
            android:layout_marginTop="3dp"/>
68 94
    </LinearLayout>
69 95

  
96
    <View
97
        android:layout_height="4dip"
98
        android:background="#777777"
99
        android:layout_width="match_parent"
100
        />
101

  
70 102
    <ScrollView
71 103
        android:id="@+id/fragment3dscrollView"
72 104
        android:layout_width="match_parent"
73 105
        android:layout_height="0dp"
74
        android:layout_weight="0.82" >
106
        android:layout_weight="0.82"
107
        >
75 108

  
76 109
        <LinearLayout
77 110
            android:id="@+id/fragment3dlayout"
src/main/res/layout/fragment3dsaturation.xml
1
<?xml version="1.0" encoding="utf-8"?>
2

  
3
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
4
              android:id="@+id/fragment3dRowSaturation"
5
              android:orientation="horizontal"
6
              android:layout_width="match_parent"
7
              android:layout_height="wrap_content" >
8

  
9
    <LinearLayout
10
        android:layout_width="0dp"
11
        android:layout_height="match_parent"
12
        android:layout_weight="0.70"
13
        android:orientation="vertical" >
14

  
15
        <TextView
16
            android:id="@+id/fragment3dsaturationText"
17
            android:layout_width="wrap_content"
18
            android:layout_height="wrap_content"
19
            android:layout_marginEnd="5dp"
20
            android:layout_marginStart="5dp"
21
            android:layout_marginTop="3dp" />
22

  
23
        <SeekBar
24
            android:id="@+id/fragment3dsaturationBar1"
25
            android:layout_width="fill_parent"
26
            android:layout_height="wrap_content"
27
            android:layout_gravity="end"
28
            android:layout_marginEnd="5dp"
29
            android:layout_marginLeft="5dp"
30
            android:layout_marginRight="5dp" />
31

  
32
    </LinearLayout>
33

  
34
    <Button
35
        android:id="@+id/fragment3dUpSaturation"
36
        android:layout_width="60dp"
37
        android:layout_height="fill_parent"
38
        android:onClick="ButtonSaturation"
39
        android:text="@string/Up" />
40

  
41
</LinearLayout>

Also available in: Unified diff