Project

General

Profile

« Previous | Next » 

Revision 054fbee1

Added by Leszek Koltunski almost 4 years ago

Reinvent the Pattern Dialog (Part 2)

View differences:

src/main/java/org/distorted/patterns/RubikPattern.java
32 32
{
33 33
  private static final int DURATION_MILLIS = 750;
34 34

  
35
  private int[] numCategories   = new int[NUM_OBJECTS];
36
  private int[] currentCategory = new int[NUM_OBJECTS];
37
  private int[] currentScrollPos= new int[NUM_OBJECTS];
35
  private int[] numCategories    = new int[NUM_OBJECTS];
36
  private int[] currentCategory  = new int[NUM_OBJECTS];
37
  private int[] currentVisiblePos= new int[NUM_OBJECTS];
38
  private int[] currentExpanded  = new int[NUM_OBJECTS];
38 39

  
39 40
  private List<List<Category>> mCategories;
40 41
  private static RubikPattern mThis;
......
361 362

  
362 363
      mCategories.add(list);
363 364
      numCategories[i]=patStrings.length;
365

  
366
      currentExpanded[i] = -1;
364 367
      }
365 368
    }
366 369

  
......
418 421

  
419 422
///////////////////////////////////////////////////////////////////////////////////////////////////
420 423

  
421
  public void rememberState(int tab, int cat, int scrollPos)
424
  public void rememberState(int tab, int cat, int scrollPos, int expanded)
422 425
    {
423 426
    if( tab>=0 && tab<NUM_OBJECTS )
424 427
      {
425
      currentCategory[tab] = cat;
426
      currentScrollPos[tab]= scrollPos;
428
      currentCategory[tab]  = cat;
429
      currentVisiblePos[tab]= scrollPos;
430
      currentExpanded[tab]  = expanded;
427 431
      }
428 432
    }
429 433

  
......
436 440

  
437 441
///////////////////////////////////////////////////////////////////////////////////////////////////
438 442

  
439
  public int recallScrollPos(int tab)
443
  public int recallVisiblePos(int tab)
444
    {
445
    return tab>=0 && tab<NUM_OBJECTS ? currentVisiblePos[tab] : 0;
446
    }
447

  
448
///////////////////////////////////////////////////////////////////////////////////////////////////
449

  
450
  public int recallExpanded(int tab)
440 451
    {
441
    return tab>=0 && tab<NUM_OBJECTS ? currentScrollPos[tab] : 0;
452
    return tab>=0 && tab<NUM_OBJECTS ? currentExpanded[tab] : -1;
442 453
    }
443 454

  
444 455
///////////////////////////////////////////////////////////////////////////////////////////////////

Also available in: Unified diff