Revision d433b50e
Added by Leszek Koltunski over 2 years ago
src/main/java/org/distorted/tutorials/TutorialActivity.java | ||
---|---|---|
39 | 39 |
import org.distorted.library.main.DistortedLibrary; |
40 | 40 |
|
41 | 41 |
import org.distorted.objectlib.main.ObjectControl; |
42 |
import org.distorted.objectlib.main.ObjectType; |
|
43 | 42 |
|
44 | 43 |
import org.distorted.main.R; |
45 | 44 |
import org.distorted.dialogs.RubikDialogError; |
45 |
import org.distorted.objects.RubikObjectList; |
|
46 | 46 |
|
47 | 47 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
48 | 48 |
|
... | ... | |
197 | 197 |
|
198 | 198 |
if( mWebView!=null ) mWebView.onResume(); |
199 | 199 |
|
200 |
if( mObjectOrdinal>=0 && mObjectOrdinal< ObjectType.NUM_OBJECTS )
|
|
200 |
if( mObjectOrdinal>=0 && mObjectOrdinal< RubikObjectList.getNumObjects() )
|
|
201 | 201 |
{ |
202 |
ObjectType obj = ObjectType.getObject(mObjectOrdinal); |
|
203 |
changeIfDifferent(obj,view.getObjectControl()); |
|
202 |
changeIfDifferent(mObjectOrdinal,view.getObjectControl()); |
|
204 | 203 |
} |
205 | 204 |
} |
206 | 205 |
|
... | ... | |
223 | 222 |
|
224 | 223 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
225 | 224 |
|
226 |
private void changeIfDifferent(ObjectType type,ObjectControl control)
|
|
225 |
private void changeIfDifferent(int objectOrdinal,ObjectControl control)
|
|
227 | 226 |
{ |
228 |
InputStream jsonStream = ObjectJson.getStream(type,this);
|
|
229 |
InputStream meshStream = ObjectMesh.getStream(type,this);
|
|
230 |
control.changeIfDifferent(type.ordinal(),jsonStream,meshStream);
|
|
227 |
InputStream jsonStream = ObjectJson.getStream(this,objectOrdinal);
|
|
228 |
InputStream meshStream = ObjectMesh.getStream(this,objectOrdinal);
|
|
229 |
control.changeIfDifferent(objectOrdinal,jsonStream,meshStream);
|
|
231 | 230 |
} |
232 | 231 |
|
233 | 232 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
Also available in: Unified diff
In the 'magic' app, ObjectType is now only used in RubikObject and RubikObjectList classes and nowhere else.
This is a major step towards being able to download objects from an online repository.