Project

General

Profile

« Previous | Next » 

Revision 369a0fce

Added by Leszek Koltunski over 2 years ago

Progress with central menu popup.

View differences:

src/main/java/org/distorted/screens/RubikScreenPlay.java
70 70
  private PopupWindow mObjectPopup, mMenuPopup;
71 71
  private WeakReference<RubikActivity> mWeakAct;
72 72
  private TextView mBubbleUpdates;
73
  private int mObjectSize, mMenuLayoutWidth, mMenuLayoutHeight, mMenuButtonHeight;
73
  private int mObjectSize, mMenuLayoutWidth, mMenuLayoutHeight, mMenuButtonHeight, mMenuTextSize;
74 74
  private int mLevelValue;
75 75
  private int mColCount, mRowCount, mMaxRowCount;
76 76
  private int mUpperBarHeight;
......
94 94
    mUpperBarHeight = act.getHeightUpperBar();
95 95

  
96 96
    mMenuButtonHeight = (int)(mScreenWidth*RubikActivity.MENU_BUTTON_HEIGHT);
97
    mMenuTextSize     = (int)(mScreenWidth*RubikActivity.MENU_BIG_TEXT_SIZE);
97 98

  
98 99
    mRowCount = (numObjects + NUM_COLUMNS-1) / NUM_COLUMNS;
99 100
    mColCount = NUM_COLUMNS;
......
381 382
    int padding = (int)(width*RubikActivity.MEDIUM_MARGIN);
382 383

  
383 384
    mMenuLayoutWidth = (int)(width*0.6f);
384
    mMenuLayoutHeight= (int)( padding + NUM_BUTTONS*(mMenuButtonHeight+padding) + 4*mMenuButtonHeight+5*padding);
385
    mMenuLayoutHeight= (int)( padding + NUM_BUTTONS*(mMenuButtonHeight+padding) + 4*mMenuButtonHeight+6*padding);
385 386

  
386 387
    layout.setPadding(padding,0,padding,0);
387 388

  
388 389
    Button highScores = layout.findViewById(R.id.menuHighScores);
390
    highScores.setTextSize(TypedValue.COMPLEX_UNIT_PX, mMenuTextSize);
389 391
    highScores.setOnClickListener( new View.OnClickListener()
390 392
        {
391 393
        @Override
......
403 405
        });
404 406

  
405 407
    Button prettyPatterns = layout.findViewById(R.id.menuPrettyPatterns);
408
    prettyPatterns.setTextSize(TypedValue.COMPLEX_UNIT_PX, mMenuTextSize);
406 409
    prettyPatterns.setOnClickListener( new View.OnClickListener()
407 410
        {
408 411
        @Override
......
415 418
        });
416 419

  
417 420
    Button solver = layout.findViewById(R.id.menuSolver);
421
    solver.setTextSize(TypedValue.COMPLEX_UNIT_PX, mMenuTextSize);
418 422
    solver.setOnClickListener( new View.OnClickListener()
419 423
        {
420 424
        @Override
......
426 430
        });
427 431

  
428 432
    Button tutorials = layout.findViewById(R.id.menuTutorials);
433
    tutorials.setTextSize(TypedValue.COMPLEX_UNIT_PX, mMenuTextSize);
429 434
    tutorials.setOnClickListener( new View.OnClickListener()
430 435
        {
431 436
        @Override
......
438 443
        });
439 444

  
440 445
    Button about = layout.findViewById(R.id.menuAbout);
446
    about.setTextSize(TypedValue.COMPLEX_UNIT_PX, mMenuTextSize);
441 447
    about.setOnClickListener( new View.OnClickListener()
442 448
        {
443 449
        @Override
......
449 455
          }
450 456
        });
451 457

  
458
    TextView levels = layout.findViewById(R.id.menuLevels);
459
    levels.setTextSize(TypedValue.COMPLEX_UNIT_PX, mMenuTextSize);
460

  
452 461
    setupLevelButtons(act,layout,padding);
453 462
    }
454 463

  
......
462 471
    params.setMargins(padding/2,0,padding/2,0);
463 472

  
464 473
    Button level1 = layout.findViewById(R.id.level1);
474
    level1.setTextSize(TypedValue.COMPLEX_UNIT_PX, mMenuTextSize);
465 475
    level1.setLayoutParams(params);
466 476
    setupLevelButton(act,level1,1);
467 477
    Button level2 = layout.findViewById(R.id.level2);
478
    level2.setTextSize(TypedValue.COMPLEX_UNIT_PX, mMenuTextSize);
468 479
    level2.setLayoutParams(params);
469 480
    setupLevelButton(act,level2,2);
470 481
    Button level3 = layout.findViewById(R.id.level3);
482
    level3.setTextSize(TypedValue.COMPLEX_UNIT_PX, mMenuTextSize);
471 483
    level3.setLayoutParams(params);
472 484
    setupLevelButton(act,level3,3);
473 485
    Button level4 = layout.findViewById(R.id.level4);
486
    level4.setTextSize(TypedValue.COMPLEX_UNIT_PX, mMenuTextSize);
474 487
    level4.setLayoutParams(params);
475 488
    setupLevelButton(act,level4,4);
476 489
    Button level5 = layout.findViewById(R.id.level5);
490
    level5.setTextSize(TypedValue.COMPLEX_UNIT_PX, mMenuTextSize);
477 491
    level5.setLayoutParams(params);
478 492
    setupLevelButton(act,level5,5);
479 493
    Button level6 = layout.findViewById(R.id.level6);
494
    level6.setTextSize(TypedValue.COMPLEX_UNIT_PX, mMenuTextSize);
480 495
    level6.setLayoutParams(params);
481 496
    setupLevelButton(act,level6,6);
482 497
    Button level7 = layout.findViewById(R.id.level7);
498
    level7.setTextSize(TypedValue.COMPLEX_UNIT_PX, mMenuTextSize);
483 499
    level7.setLayoutParams(params);
484 500
    setupLevelButton(act,level7,7);
485 501
    Button level8 = layout.findViewById(R.id.level8);
502
    level8.setTextSize(TypedValue.COMPLEX_UNIT_PX, mMenuTextSize);
486 503
    level8.setLayoutParams(params);
487 504
    setupLevelButton(act,level8,8);
488 505
    Button levelM = layout.findViewById(R.id.levelM);
506
    levelM.setTextSize(TypedValue.COMPLEX_UNIT_PX, mMenuTextSize);
489 507
    levelM.setLayoutParams(params);
490 508
    setupLevelButton(act,levelM,9);
491 509
    }
src/main/res/layout/popup_menu.xml
67 67
      android:gravity="center"/>
68 68

  
69 69
   <TextView
70
       android:id="@+id/menuLevels"
70 71
       android:layout_width="match_parent"
71 72
       android:text="@string/levels"
72 73
       android:layout_height="0dp"

Also available in: Unified diff