Project

General

Profile

« Previous | Next » 

Revision 3b1e9c7e

Added by Leszek Koltunski almost 6 years ago

Progress with Effects3D app.

View differences:

src/main/java/org/distorted/examples/effects3d/Effects3DEffect.java
63 63

  
64 64
class Effects3DEffect implements SeekBar.OnSeekBarChangeListener
65 65
  {
66
  private static final int BACKGROUND_ODD = 0xff555555;
67
  private static final int BACKGROUND_EVEN= 0xff333333;
68

  
66 69
  private WeakReference<Effects3DActivity2> mAct;
67 70

  
68 71
  private EffectName mName;
......
385 388
    mTextRegion.setText("region ("+f0+","+f1+","+f2+","+f3+")");
386 389
    }
387 390

  
391
///////////////////////////////////////////////////////////////////////////////////////////////////
392

  
393
  void setBackground(int pos)
394
    {
395
    int color = (pos%2==1 ? BACKGROUND_ODD:BACKGROUND_EVEN);
396

  
397
    if( mEffect!=null ) mEffect.setBackgroundColor(color);
398
    if( mCenter!=null ) mCenter.setBackgroundColor(color);
399
    if( mRegion!=null ) mRegion.setBackgroundColor(color);
400
    }
401

  
388 402
///////////////////////////////////////////////////////////////////////////////////////////////////
389 403

  
390 404
  Effects3DEffect(EffectName name, Effects3DActivity2 act)
......
477 491

  
478 492
///////////////////////////////////////////////////////////////////////////////////////////////////
479 493

  
480
  View createView()
494
  View createView(int num)
481 495
    {
482 496
    SeekBar[] seek = new SeekBar[mDimension];
483 497

  
......
535 549
               mSeekID[4] = seek[4].getId();
536 550
               mButton    = mEffect.findViewById(R.id.button5dRemove);
537 551
               break;
538
      default: android.util.Log.e("Matrix3DEffect", "dimension "+mDimension+" not supported!");
552
      default: android.util.Log.e("Effects3DEffect", "dimension "+mDimension+" not supported!");
539 553
               return null;
540 554
      }
541 555

  
556
    mEffect.setBackgroundColor( num%2==1 ? BACKGROUND_EVEN: BACKGROUND_ODD );
557

  
542 558
    setDefaultInter();
543 559

  
544 560
    for(int i=0; i<mDimension; i++)
......
552 568

  
553 569
///////////////////////////////////////////////////////////////////////////////////////////////////
554 570

  
555
  View createRegion()
571
  View createRegion(int num)
556 572
    {
557 573
    Effects3DActivity2 act = mAct.get();
558 574

  
559 575
    mRegion = act.getLayoutInflater().inflate(R.layout.effectregion, null);
576
    mRegion.setBackgroundColor( num%2==1 ? BACKGROUND_EVEN: BACKGROUND_ODD );
560 577

  
561 578
    SeekBar[] seek = new SeekBar[4];
562 579

  
......
587 604

  
588 605
///////////////////////////////////////////////////////////////////////////////////////////////////
589 606

  
590
  View createCenter()
607
  View createCenter(int num)
591 608
    {
592 609
    Effects3DActivity2 act = mAct.get();
593 610

  
594 611
    mCenter = act.getLayoutInflater().inflate(R.layout.effectcenter, null);
612
    mCenter.setBackgroundColor( num%2==1 ? BACKGROUND_EVEN: BACKGROUND_ODD );
595 613

  
596 614
    SeekBar[] seek = new SeekBar[3];
597 615

  

Also available in: Unified diff