Project

General

Profile

« Previous | Next » 

Revision 8bf8fe70

Added by Leszek Koltunski almost 3 years ago

Progress with ConfigScreen.

View differences:

src/main/java/org/distorted/config/ConfigScreen.java
52 52
  private TransparentImageButton mBackButton, mObjectButton, mPrevButton, mNextButton;
53 53
  private TextView mMovesText;
54 54
  private PopupWindow mObjectPopup;
55
  private LinearLayout mDetailsLayout, mComplexLayout, mMeshLayout;
55 56
  private int mObjectOrdinal;
56 57
  private int mColCount, mRowCount, mMaxRowCount;
57 58
  private int mObjectSize;
......
316 317
    mMovesText.setText(act.getString(R.string.mo_placeholder,mObjectOrdinal+1,NUM_OBJECTS));
317 318
    }
318 319

  
320

  
321
///////////////////////////////////////////////////////////////////////////////////////////////////
322

  
323
  private LinearLayout createLayout(ConfigActivity act, final int marginT, final int marginB, final int marginS, final int color)
324
    {
325
    LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,200);//LinearLayout.LayoutParams.WRAP_CONTENT);
326
    params.bottomMargin = marginB;
327
    params.topMargin    = marginT;
328
    params.leftMargin   = marginS;
329
    params.rightMargin  = marginS;
330

  
331
    LinearLayout layout = new LinearLayout(act);
332
    layout.setLayoutParams(params);
333
    layout.setBackgroundColor(color);
334

  
335
    return layout;
336
    }
337

  
338
///////////////////////////////////////////////////////////////////////////////////////////////////
339

  
340
  private void setupDetailsLayout(ConfigActivity act, final float width)
341
    {
342

  
343
    }
344

  
345
///////////////////////////////////////////////////////////////////////////////////////////////////
346

  
347
  private void setupComplexLayout(ConfigActivity act, final float width)
348
    {
349

  
350

  
351
    }
352

  
353
///////////////////////////////////////////////////////////////////////////////////////////////////
354

  
355
  private void setupMeshLayout(ConfigActivity act, final float width)
356
    {
357

  
358

  
359
    }
360

  
319 361
///////////////////////////////////////////////////////////////////////////////////////////////////
320
// TODO: info pane
321 362

  
322 363
  private void setupInfo(ConfigActivity act)
323 364
    {
365
    int width = act.getScreenWidthInPixels();
324 366

  
367
    setupDetailsLayout(act,width);
368
    setupComplexLayout(act,width);
369
    setupMeshLayout(act,width);
325 370
    }
326 371

  
327 372
///////////////////////////////////////////////////////////////////////////////////////////////////
......
366 411
    layout.addView(layoutMid);
367 412
    layout.addView(layoutRight);
368 413

  
369
    setupInfo(act);
414
    int color = act.getResources().getColor(R.color.light_grey);
415
    int margin = (int)(1.5f*width*RubikActivity.PADDING);
416

  
417
    mDetailsLayout = createLayout(act,2*margin,  margin, 2*margin, color);
418
    mComplexLayout = createLayout(act,  margin,  margin, 2*margin, color);
419
    mMeshLayout    = createLayout(act,  margin,2*margin, 2*margin, color);
420

  
421
    LinearLayout configLayout = act.findViewById(R.id.configLayout);
422
    configLayout.removeAllViews();
423
    configLayout.addView(mDetailsLayout);
424
    configLayout.addView(mComplexLayout);
425
    configLayout.addView(mMeshLayout);
370 426
    }
371 427
}
src/main/res/layout/config.xml
11 11
        android:layout_height="0dp"
12 12
        android:layout_weight="1"/>
13 13

  
14
    <ScrollView
15
        android:id="@+id/configScroll"
14
    <LinearLayout
16 15
        android:layout_width="match_parent"
17 16
        android:layout_height="0dp"
18
        android:layout_weight="1"/>
17
        android:layout_weight="1"
18
        android:orientation="horizontal"
19
        android:background="@color/light_grey">
20

  
21
        <ScrollView
22
           android:id="@+id/configScroll"
23
           android:layout_width="match_parent"
24
           android:layout_height="match_parent"
25
           android:layout_marginLeft="10dp"
26
           android:layout_marginRight="10dp"
27
           android:background="@color/grey">
28

  
29
           <LinearLayout
30
               android:id="@+id/configLayout"
31
               android:layout_width="match_parent"
32
               android:layout_height="wrap_content"
33
               android:layout_marginLeft="0dp"
34
               android:layout_marginRight="0dp"
35
               android:background="@color/grey"
36
               android:orientation="vertical" >
37
          </LinearLayout>
38

  
39
        </ScrollView>
40

  
41
    </LinearLayout>
19 42

  
20 43
    <LinearLayout
21 44
        android:id="@+id/lowerBar"

Also available in: Unified diff