Project

General

Profile

« Previous | Next » 

Revision c41c5ae3

Added by Leszek Koltunski over 2 years ago

Bandaged 3x3: progress with saving.

View differences:

src/main/java/org/distorted/bandaged/BandagedCreatorObjectView.java
42 42
    LayoutInflater inflater = act.getLayoutInflater();
43 43
    mPane = (LinearLayout) inflater.inflate(R.layout.bandaged_pane, null);
44 44

  
45
    int width      = act.getScreenWidthInPixels();
46
    int lMargin    = (int)(width*RubikActivity.LARGE_MARGIN);
47
    int buttonSize = (int)(width*RubikActivity.BUTTON_TEXT_SIZE);
45
    int width    = act.getScreenWidthInPixels();
46
    int lMargin  = (int)(width*RubikActivity.LARGE_MARGIN);
47
    int textSize = (int)(width*RubikActivity.BUTTON_TEXT_SIZE);
48 48

  
49 49
    LinearLayout.LayoutParams params = new LinearLayout.LayoutParams( (int)(width*0.35f), LinearLayout.LayoutParams.MATCH_PARENT);
50 50
    params.bottomMargin = lMargin;
......
56 56

  
57 57
    LinearLayout bottom = mPane.findViewById(R.id.bandagedCreatorObjectLayout);
58 58

  
59
    TransparentButton plaButton = new TransparentButton(act, R.string.play, buttonSize);
59
    TransparentButton plaButton = new TransparentButton(act, R.string.play, textSize);
60 60

  
61
    final int icon = RubikActivity.getDrawable(R.drawable.ui_small_menu,R.drawable.ui_medium_menu, R.drawable.ui_big_menu, R.drawable.ui_huge_menu);
62
    LinearLayout.LayoutParams paramsB = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,LinearLayout.LayoutParams.MATCH_PARENT,1.0f);
61
    final int icon = RubikActivity.getDrawable(R.drawable.ui_small_trash,R.drawable.ui_medium_trash, R.drawable.ui_big_trash, R.drawable.ui_huge_trash);
62
    LinearLayout.LayoutParams paramsB = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,LinearLayout.LayoutParams.MATCH_PARENT,3.0f);
63 63
    TransparentImageButton delButton = new TransparentImageButton(act, icon, TransparentImageButton.GRAVITY_MIDDLE, paramsB);
64 64

  
65 65
    bottom.addView(plaButton);
src/main/java/org/distorted/helpers/TransparentButton.java
31 31
@SuppressLint("ViewConstructor")
32 32
public class TransparentButton extends MaterialButton
33 33
{
34
   public TransparentButton(Context context, int resId, float size)
34
   public TransparentButton(Context context, int resId, float textSize)
35
      {
36
      this(context, resId, textSize, 1.0f);
37
      }
38

  
39
///////////////////////////////////////////////////////////////////////////////////////////////////
40

  
41
   public TransparentButton(Context context, int resId, float textSize, float weight)
35 42
      {
36 43
      super(context);
37 44

  
38
      LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,LinearLayout.LayoutParams.MATCH_PARENT, 1.0f);
45
      LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,LinearLayout.LayoutParams.MATCH_PARENT, weight);
39 46

  
40 47
      setLayoutParams(params);
41 48
      setPadding(0,0,0,0);
42
      setTextSize(TypedValue.COMPLEX_UNIT_PX, size);
49
      setTextSize(TypedValue.COMPLEX_UNIT_PX, textSize);
43 50
      setText(resId);
44 51

  
45 52
      TypedValue outValue = new TypedValue();

Also available in: Unified diff