51 |
51 |
private int mNumScramble;
|
52 |
52 |
private int mMeshState;
|
53 |
53 |
private int mExtrasOrdinal;
|
54 |
|
private Drawable mIconD;
|
|
54 |
private Drawable mStaticIconD, mRescaledIconD;
|
55 |
55 |
|
56 |
56 |
///////////////////////////////////////////////////////////////////////////////////////////////////
|
57 |
57 |
|
... | ... | |
77 |
77 |
mObjectMinor = JsonWriter.VERSION_OBJECT_MINOR;
|
78 |
78 |
mExtrasMinor = JsonWriter.VERSION_EXTRAS_MINOR;
|
79 |
79 |
|
80 |
|
mIconD = null;
|
|
80 |
mStaticIconD = null;
|
|
81 |
mRescaledIconD= null;
|
81 |
82 |
}
|
82 |
83 |
|
83 |
84 |
///////////////////////////////////////////////////////////////////////////////////////////////////
|
... | ... | |
86 |
87 |
{
|
87 |
88 |
android.util.Log.e("D", "new downloaded RubikObject "+object.shortName+" added");
|
88 |
89 |
|
89 |
|
|
90 |
90 |
mLowerName = object.shortName;
|
91 |
91 |
mUpperName = object.shortName.toUpperCase();
|
92 |
92 |
mNumScramble = object.numScrambles;
|
... | ... | |
134 |
134 |
|
135 |
135 |
///////////////////////////////////////////////////////////////////////////////////////////////////
|
136 |
136 |
|
137 |
|
private void createIconDrawable(Activity act)
|
|
137 |
private void createStaticIconDrawable(Activity act)
|
|
138 |
{
|
|
139 |
if( mIconID>0 )
|
|
140 |
{
|
|
141 |
mStaticIconD = act.getDrawable(mIconID);
|
|
142 |
}
|
|
143 |
else
|
|
144 |
{
|
|
145 |
RubikFiles files = RubikFiles.getInstance();
|
|
146 |
Bitmap bmp = files.getIcon(act,mLowerName+".png");
|
|
147 |
mStaticIconD = new BitmapDrawable(act.getResources(), bmp);
|
|
148 |
}
|
|
149 |
}
|
|
150 |
|
|
151 |
///////////////////////////////////////////////////////////////////////////////////////////////////
|
|
152 |
|
|
153 |
private void createRescaledIconDrawable(Activity act)
|
138 |
154 |
{
|
139 |
155 |
if( mIconID>0 )
|
140 |
156 |
{
|
141 |
|
mIconD = act.getDrawable(mIconID);
|
|
157 |
mRescaledIconD = act.getDrawable(mIconID);
|
142 |
158 |
}
|
143 |
159 |
else
|
144 |
160 |
{
|
145 |
161 |
RubikFiles files = RubikFiles.getInstance();
|
146 |
162 |
Bitmap bmp = files.getIcon(act,mLowerName+".png");
|
147 |
|
mIconD = new BitmapDrawable(act.getResources(), bmp);
|
|
163 |
mRescaledIconD = new BitmapDrawable(act.getResources(), bmp);
|
148 |
164 |
}
|
149 |
165 |
}
|
150 |
166 |
|
... | ... | |
216 |
232 |
|
217 |
233 |
public void setIconTo(Activity act,ImageButton button)
|
218 |
234 |
{
|
219 |
|
if( mIconD==null ) createIconDrawable(act);
|
220 |
|
button.setBackground(mIconD);
|
|
235 |
if( mStaticIconD==null ) createStaticIconDrawable(act);
|
|
236 |
button.setBackground(mStaticIconD);
|
221 |
237 |
}
|
222 |
238 |
|
223 |
239 |
///////////////////////////////////////////////////////////////////////////////////////////////////
|
224 |
240 |
|
225 |
241 |
public void setIconTo(Activity act,ImageView view)
|
226 |
242 |
{
|
227 |
|
if( mIconD==null ) createIconDrawable(act);
|
228 |
|
view.setImageDrawable(mIconD);
|
|
243 |
if( mRescaledIconD==null ) createRescaledIconDrawable(act);
|
|
244 |
view.setImageDrawable(mRescaledIconD);
|
229 |
245 |
}
|
230 |
246 |
|
231 |
247 |
///////////////////////////////////////////////////////////////////////////////////////////////////
|
Downloaded Objects: bugfixes