Project

General

Profile

« Previous | Next » 

Revision cb6d9c37

Added by Leszek Koltunski over 2 years ago

Simplify and spped up the tutorials dialog

View differences:

src/main/java/org/distorted/dialogs/RubikDialogTutorialView.java
112 112
///////////////////////////////////////////////////////////////////////////////////////////////////
113 113

  
114 114
  private View createRow(final RubikActivity act, int countryID, final String desc, final String url,
115
                         final String auth, int width, final ObjectType obj, int colorB, int colorT)
115
                         final String auth, int size, final ObjectType obj, int colorB, int colorT)
116 116
    {
117
    float textSize = 0.5f*size;
117 118
    View row = inflate( act, R.layout.dialog_tutorial_row, null);
118
    Button butt = row.findViewById(R.id.tutorialButton);
119 119

  
120
    LinearLayout layout = row.findViewById(R.id.tutorialLayout);
121
    layout.setMinimumHeight(size);
122

  
123
    Button butt = row.findViewById(R.id.tutorialButton);
120 124
    butt.setText(R.string.view);
121 125
    butt.setTextColor(colorT);
122 126
    butt.setBackgroundColor(colorB);
123
    butt.setTextSize(TypedValue.COMPLEX_UNIT_PX, 0.5f*width);
124
    butt.setHeight(width);
127
    butt.setTextSize(TypedValue.COMPLEX_UNIT_PX, textSize);
128
    butt.setHeight(size);
125 129

  
126 130
    butt.setOnClickListener( new View.OnClickListener()
127 131
      {
......
142 146
    image.setImageResource(id);
143 147

  
144 148
    TextView author = row.findViewById(R.id.tutorialAuthor);
145
    author.setTextSize(TypedValue.COMPLEX_UNIT_PX, 0.5f*width);
149
    author.setTextSize(TypedValue.COMPLEX_UNIT_PX, textSize);
146 150
    author.setText(auth);
147 151

  
148 152
    TextView title  = row.findViewById(R.id.tutorialTitle);
149
    title.setTextSize(TypedValue.COMPLEX_UNIT_PX, 0.5f*width);
153
    title.setTextSize(TypedValue.COMPLEX_UNIT_PX, textSize);
150 154
    title.setText(desc);
151 155

  
152 156
    return row;

Also available in: Unified diff