Project

General

Profile

« Previous | Next » 

Revision 0873a75a

Added by Leszek Koltunski about 3 years ago

Add info pane: some progress2.

View differences:

src/main/java/org/distorted/screens/RubikScreenPlay.java
71 71
  private static final float LAST_BUTTON = 1.5f;
72 72
  private static final int[] mLocation = new int[2];
73 73

  
74
  private TransparentImageButton mObjButton, mMenuButton, mSolveButton, mScrambleButton, mDetailsButton;
74
  private TransparentImageButton mObjButton, mMenuButton, mSolveButton, mScrambleButton;
75 75
  private TransparentButton mPlayButton;
76 76
  private PopupWindow mObjectPopup, mMenuPopup, mPlayPopup;
77 77
  private ObjectType mObject = DEF_OBJECT;
......
258 258
    objectGrid.setRowCount(mRowCount);
259 259

  
260 260
    LinearLayout bottomLayout = view.findViewById(R.id.bottomLayout);
261
    setupDetailsButton(act,layoutH);
262
    bottomLayout.addView(mDetailsButton);
261
    setupBottomLayout(act,bottomLayout,layoutH);
263 262

  
264 263
    ViewGroup.LayoutParams paramsB = bottomLayout.getLayoutParams();
265 264
    paramsB.height = layoutH;
......
406 405

  
407 406
///////////////////////////////////////////////////////////////////////////////////////////////////
408 407

  
409
  void setupDetailsButton(final RubikActivity act, int width)
408
  void setupBottomLayout(final RubikActivity act, final LinearLayout layout, int width)
410 409
    {
411
    int icon = RubikActivity.getDrawable(R.drawable.ui_small_cube_solve_new,R.drawable.ui_medium_cube_solve_new, R.drawable.ui_big_cube_solve_new, R.drawable.ui_huge_cube_solve_new);
412
    LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(width,LinearLayout.LayoutParams.MATCH_PARENT);
413
    mDetailsButton = new TransparentImageButton(act, icon, TransparentImageButton.GRAVITY_MIDDLE, params);
410
    int icon1 = RubikActivity.getDrawable(R.drawable.ui_small_cube_solve_new,R.drawable.ui_medium_cube_solve_new, R.drawable.ui_big_cube_solve_new, R.drawable.ui_huge_cube_solve_new);
411
    LinearLayout.LayoutParams params1 = new LinearLayout.LayoutParams(width,LinearLayout.LayoutParams.MATCH_PARENT,1.0f);
412
    TransparentImageButton buttonTut = new TransparentImageButton(act, icon1, TransparentImageButton.GRAVITY_MIDDLE, params1);
413

  
414
    int icon2 = RubikActivity.getDrawable(R.drawable.ui_small_cube_solve_new,R.drawable.ui_medium_cube_solve_new, R.drawable.ui_big_cube_solve_new, R.drawable.ui_huge_cube_solve_new);
415
    LinearLayout.LayoutParams params2 = new LinearLayout.LayoutParams(width,LinearLayout.LayoutParams.MATCH_PARENT,1.0f);
416
    TransparentImageButton buttonDet = new TransparentImageButton(act, icon2, TransparentImageButton.GRAVITY_MIDDLE, params2);
414 417

  
415
    mDetailsButton.setOnClickListener( new View.OnClickListener()
418
    buttonTut.setOnClickListener( new View.OnClickListener()
416 419
      {
417 420
      @Override
418 421
      public void onClick(View v)
419 422
        {
420
        android.util.Log.e("D", "DETAILS CLICKED!!");
423
        android.util.Log.e("D", "BUTTON TUT CLICKED!!");
421 424
        }
422 425
      });
426

  
427
    buttonDet.setOnClickListener( new View.OnClickListener()
428
      {
429
      @Override
430
      public void onClick(View v)
431
        {
432
        android.util.Log.e("D", "BUTTON DET CLICKED!!");
433
        }
434
      });
435

  
436
    LinearLayout.LayoutParams paramsNul = new LinearLayout.LayoutParams(width,LinearLayout.LayoutParams.MATCH_PARENT,1.0f);
437
    Button buttonNul = new Button(act);
438
    buttonNul.setLayoutParams(paramsNul);
439
    buttonNul.setVisibility(View.INVISIBLE);
440

  
441
    layout.addView(buttonTut);
442
    layout.addView(buttonNul);
443
    layout.addView(buttonDet);
423 444
    }
424 445

  
425 446
///////////////////////////////////////////////////////////////////////////////////////////////////
src/main/res/layout/popup_object_scrollless.xml
19 19
       android:layout_weight="1"
20 20
       android:paddingEnd="5dp"
21 21
       android:paddingStart="5dp"
22
       android:gravity="end"
23 22
       android:orientation="horizontal">
24 23

  
25 24
   </LinearLayout>
src/main/res/layout/popup_object_withscroll.xml
26 26
       android:layout_weight="1"
27 27
       android:paddingEnd="5dp"
28 28
       android:paddingStart="5dp"
29
       android:gravity="end"
30 29
       android:orientation="horizontal">
31 30

  
32 31
   </LinearLayout>

Also available in: Unified diff