Revision b88cdd91
Added by Leszek Koltunski over 2 years ago
src/main/java/org/distorted/network/RubikUpdates.java | ||
---|---|---|
19 | 19 |
|
20 | 20 |
package org.distorted.network; |
21 | 21 |
|
22 |
///////////////////////////////////////////////////////////////////////////////////////////////////
|
|
23 |
|
|
22 |
import java.util.ArrayList;
|
|
23 |
import android.graphics.Bitmap; |
|
24 | 24 |
import org.distorted.objects.RubikObjectList; |
25 | 25 |
|
26 |
import java.util.ArrayList;
|
|
26 |
///////////////////////////////////////////////////////////////////////////////////////////////////
|
|
27 | 27 |
|
28 | 28 |
public class RubikUpdates |
29 | 29 |
{ |
... | ... | |
37 | 37 |
public final int mPercent; |
38 | 38 |
public final boolean mUpdateObject; |
39 | 39 |
public final boolean mUpdateExtras; |
40 |
public Bitmap mIcon; |
|
40 | 41 |
|
41 | 42 |
public UpdateInfo(String shortName, String longName, String description, int objectMinor, |
42 | 43 |
int extrasMinor, int percent, boolean updateO, boolean updateE) |
... | ... | |
49 | 50 |
mPercent = percent; |
50 | 51 |
mUpdateObject = updateO; |
51 | 52 |
mUpdateExtras = updateE; |
53 |
|
|
54 |
mIcon = null; |
|
52 | 55 |
} |
53 | 56 |
} |
54 | 57 |
|
... | ... | |
133 | 136 |
if( numLines>=1 ) |
134 | 137 |
{ |
135 | 138 |
mUrl = lines[0]; |
139 |
if( !mUrl.endsWith("/") ) mUrl += "/"; |
|
140 |
|
|
136 | 141 |
for(int line=1; line<numLines; line++) |
137 | 142 |
{ |
138 | 143 |
String[] elements = lines[line].split(","); |
... | ... | |
183 | 188 |
return mStarted.size(); |
184 | 189 |
} |
185 | 190 |
|
191 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
192 |
|
|
193 |
public Bitmap getCompletedIcon(int ordinal) |
|
194 |
{ |
|
195 |
return mCompleted.get(ordinal).mIcon; |
|
196 |
} |
|
197 |
|
|
198 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
199 |
|
|
200 |
public Bitmap getStartedIcon(int ordinal) |
|
201 |
{ |
|
202 |
return mStarted.get(ordinal).mIcon; |
|
203 |
} |
|
204 |
|
|
205 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
206 |
|
|
207 |
public String getCompletedURL(int ordinal) |
|
208 |
{ |
|
209 |
UpdateInfo info = mCompleted.get(ordinal); |
|
210 |
return info!=null ? mUrl + info.mObjectShortName + ".png" : null; |
|
211 |
} |
|
212 |
|
|
213 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
214 |
|
|
215 |
public String getStartedURL(int ordinal) |
|
216 |
{ |
|
217 |
UpdateInfo info = mStarted.get(ordinal); |
|
218 |
return info!=null ? mUrl + info.mObjectShortName + ".png" : null; |
|
219 |
} |
|
220 |
|
|
221 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
222 |
|
|
223 |
public void setCompletedIcon(int ordinal, Bitmap icon) |
|
224 |
{ |
|
225 |
UpdateInfo info = mCompleted.get(ordinal); |
|
226 |
info.mIcon = icon; |
|
227 |
} |
|
228 |
|
|
229 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
230 |
|
|
231 |
public void setStartedIcon(int ordinal, Bitmap icon) |
|
232 |
{ |
|
233 |
UpdateInfo info = mStarted.get(ordinal); |
|
234 |
info.mIcon = icon; |
|
235 |
} |
|
236 |
|
|
186 | 237 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
187 | 238 |
|
188 | 239 |
public void showDebug() |
Also available in: Unified diff
Download Update icons.