Project

General

Profile

« Previous | Next » 

Revision 06ba394a

Added by Leszek Koltunski almost 3 years ago

Progress with Updates Dialog; improvement for the MIRR_4 icon.

View differences:

src/main/java/org/distorted/dialogs/RubikDialogUpdateView.java
43 43
///////////////////////////////////////////////////////////////////////////////////////////////////
44 44

  
45 45
  public View createView(Activity act, RubikUpdates.UpdateInfo info, int fontSize, int padding,
46
                         LinearLayout.LayoutParams pImage, LinearLayout.LayoutParams pView,
47
                         LinearLayout.LayoutParams pText, LinearLayout.LayoutParams pButt )
46
                         LinearLayout.LayoutParams pView, LinearLayout.LayoutParams pText, LinearLayout.LayoutParams pButt )
48 47
    {
49 48
    View view = act.getLayoutInflater().inflate(R.layout.dialog_updates_pane, null);
50 49
    TextView title = view.findViewById(R.id.updates_pane_title);
......
55 54
    mIcon = view.findViewById(R.id.updates_pane_image);
56 55
    mIcon.setImageResource(R.drawable.unknown_icon);
57 56

  
58
    mIcon.setLayoutParams(pImage);
59 57
    view.setLayoutParams(pView);
60 58

  
61 59
    title.setTextSize(TypedValue.COMPLEX_UNIT_PX, fontSize);
src/main/java/org/distorted/dialogs/RubikDialogUpdates.java
153 153
      {
154 154
      //mText.setText("Downloading...");
155 155

  
156
      int imagH = (int)(mSize*1.00f);
157 156
      int textH = (int)(mSize*0.27f);
158 157
      int buttH = (int)(mSize*0.35f);
159 158

  
160
      LinearLayout.LayoutParams pI = new LinearLayout.LayoutParams( imagH,imagH );
161 159
      LinearLayout.LayoutParams pV = new LinearLayout.LayoutParams( LinearLayout.LayoutParams.MATCH_PARENT, mSize );
162 160
      pV.setMargins(mMargin, mMargin, mMargin, 0);
163 161
      LinearLayout.LayoutParams pT = new LinearLayout.LayoutParams( LinearLayout.LayoutParams.MATCH_PARENT, textH );
......
171 169
          {
172 170
          RubikUpdates.UpdateInfo info = updates.getCompletedUpdate(i);
173 171
          RubikDialogUpdateView rubikView = new RubikDialogUpdateView();
174
          View pane = rubikView.createView(act,info,mFontSize,mPadding,pI,pV,pT,pB);
172
          View pane = rubikView.createView(act,info,mFontSize,mPadding,pV,pT,pB);
175 173
          mLayout.addView(pane);
176 174
          mPanes.add(rubikView);
177 175
          }
......
182 180
          {
183 181
          RubikUpdates.UpdateInfo info = updates.getStartedUpdate(i);
184 182
          RubikDialogUpdateView rubikView = new RubikDialogUpdateView();
185
          View pane = rubikView.createView(act,info,mFontSize,mPadding,pI,pV,pT,pB);
183
          View pane = rubikView.createView(act,info,mFontSize,mPadding,pV,pT,pB);
186 184
          mLayout.addView(pane);
187 185
          mPanes.add(rubikView);
188 186
          }
src/main/res/layout/dialog_updates_pane.xml
9 9

  
10 10
   	<ImageView
11 11
   	    android:id="@+id/updates_pane_image"
12
   	    android:scaleType="fitCenter"
13
   		android:layout_width="wrap_content"
14
   		android:layout_height="wrap_content"/>
12
   	    android:scaleType="fitXY"
13
   		android:layout_width="0dp"
14
   		android:layout_height="match_parent"
15
   		android:layout_weight="0.5"/>
15 16

  
16 17
   	<LinearLayout
17
   		android:layout_width="match_parent"
18
   		android:layout_width="0dp"
18 19
 		android:layout_height="match_parent"
19 20
 		android:orientation="vertical"
20
 		android:layout_marginStart="8dp">
21
 		android:layout_marginStart="8dp"
22
 		android:layout_weight="1.0">
21 23

  
22 24
		<TextView
23 25
    		android:id="@+id/updates_pane_title"

Also available in: Unified diff