Revision 99b8a069
Added by Leszek Koltunski almost 3 years ago
src/main/java/org/distorted/dialogs/RubikDialogUpdateView.java | ||
---|---|---|
46 | 46 |
|
47 | 47 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
48 | 48 |
|
49 |
public View createView(Activity act, RubikUpdates.UpdateInfo info, int fontSize, boolean isNew, |
|
49 |
public View createView(Activity act, RubikUpdates.UpdateInfo info, int fontSize, int padding, boolean isNew,
|
|
50 | 50 |
LinearLayout.LayoutParams pImage, LinearLayout.LayoutParams pView, |
51 | 51 |
LinearLayout.LayoutParams pText, LinearLayout.LayoutParams pButt ) |
52 | 52 |
{ |
... | ... | |
83 | 83 |
description.setLayoutParams(pText); |
84 | 84 |
button.setLayoutParams(pButt); |
85 | 85 |
|
86 |
mView.setPadding(padding,padding,padding,padding); |
|
87 |
|
|
86 | 88 |
return mView; |
87 | 89 |
} |
88 | 90 |
} |
src/main/java/org/distorted/dialogs/RubikDialogUpdates.java | ||
---|---|---|
47 | 47 |
{ |
48 | 48 |
private TextView mText; |
49 | 49 |
private LinearLayout mLayout; |
50 |
private int mMargin, mSize, mFontSize; |
|
50 |
private int mMargin, mSize, mFontSize, mPadding;
|
|
51 | 51 |
|
52 | 52 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
53 | 53 |
|
... | ... | |
82 | 82 |
int h= displaymetrics.heightPixels; |
83 | 83 |
final float titleSize= w*RubikActivity.MENU_BIG_TEXT_SIZE; |
84 | 84 |
final float okSize = w*RubikActivity.DIALOG_BUTTON_SIZE; |
85 |
mMargin = (int)(w*RubikActivity.MEDIUM_MARGIN); |
|
86 |
mSize = (int)(h*0.14f); |
|
87 |
mFontSize = (int)(h*0.02f); |
|
85 |
mMargin = (int)(w*RubikActivity.MEDIUM_MARGIN); |
|
86 |
mSize = (int)(h*0.14f); |
|
87 |
mFontSize = (int)(h*0.02f); |
|
88 |
mPadding = (int)(h*0.01f); |
|
88 | 89 |
|
89 | 90 |
TextView title = (TextView) inflater.inflate(R.layout.dialog_title, null); |
90 | 91 |
title.setTextSize(TypedValue.COMPLEX_UNIT_PX, titleSize); |
... | ... | |
166 | 167 |
{ |
167 | 168 |
RubikUpdates.UpdateInfo info = updates.getNewUpdate(i); |
168 | 169 |
RubikDialogUpdateView rubikView = new RubikDialogUpdateView(); |
169 |
View pane = rubikView.createView(act,info,mFontSize,true,pI,pV,pT,pB); |
|
170 |
View pane = rubikView.createView(act,info,mFontSize,mPadding,true,pI,pV,pT,pB);
|
|
170 | 171 |
mLayout.addView(pane); |
171 | 172 |
} |
172 | 173 |
for(int i=0; i<numU; i++) |
173 | 174 |
{ |
174 | 175 |
RubikUpdates.UpdateInfo info = updates.getUpdUpdate(i); |
175 | 176 |
RubikDialogUpdateView rubikView = new RubikDialogUpdateView(); |
176 |
View pane = rubikView.createView(act,info,mFontSize,false,pI,pV,pT,pB); |
|
177 |
View pane = rubikView.createView(act,info,mFontSize,mPadding,false,pI,pV,pT,pB);
|
|
177 | 178 |
mLayout.addView(pane); |
178 | 179 |
} |
179 | 180 |
} |
src/main/res/layout/dialog_updates.xml | ||
---|---|---|
11 | 11 |
android:layout_width="match_parent" |
12 | 12 |
android:layout_height="wrap_content" |
13 | 13 |
android:background="@color/black" |
14 |
android:paddingBottom="10dp"
|
|
14 |
android:paddingBottom="8dp"
|
|
15 | 15 |
android:orientation="vertical"> |
16 | 16 |
|
17 | 17 |
<TextView |
Also available in: Unified diff
Downloading updates: dialog progress.