Revision 314e9ff0
Added by Leszek Koltunski over 2 years ago
src/main/java/org/distorted/config/ConfigActivity.java | ||
---|---|---|
19 | 19 |
|
20 | 20 |
package org.distorted.config; |
21 | 21 |
|
22 |
import java.io.InputStream; |
|
23 |
|
|
22 | 24 |
import android.os.Build; |
23 | 25 |
import android.os.Bundle; |
24 | 26 |
import android.util.DisplayMetrics; |
... | ... | |
26 | 28 |
import android.view.ViewGroup; |
27 | 29 |
import android.view.WindowManager; |
28 | 30 |
import android.widget.LinearLayout; |
29 |
|
|
30 | 31 |
import androidx.appcompat.app.AppCompatActivity; |
31 |
|
|
32 | 32 |
import com.google.firebase.analytics.FirebaseAnalytics; |
33 | 33 |
|
34 |
import org.distorted.dialogs.RubikDialogError; |
|
35 |
import org.distorted.dmesh.ObjectMesh; |
|
36 |
import org.distorted.jsons.ObjectJson; |
|
37 | 34 |
import org.distorted.library.main.DistortedLibrary; |
38 |
import org.distorted.main.R; |
|
39 | 35 |
import org.distorted.objectlib.main.ObjectControl; |
36 |
import org.distorted.main.R; |
|
37 |
import org.distorted.dialogs.RubikDialogError; |
|
40 | 38 |
import org.distorted.objects.RubikObject; |
41 | 39 |
import org.distorted.objects.RubikObjectList; |
42 | 40 |
|
43 |
import java.io.InputStream; |
|
44 |
|
|
45 | 41 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
46 | 42 |
|
47 | 43 |
public class ConfigActivity extends AppCompatActivity |
... | ... | |
211 | 207 |
{ |
212 | 208 |
if( object!=null ) |
213 | 209 |
{ |
214 |
int jsonID = object.getJsonID();
|
|
215 |
int meshID = object.getMeshID();
|
|
216 |
|
|
217 |
int meshState = object.getMeshState();
|
|
210 |
int ordinal = object.getOrdinal();
|
|
211 |
int meshState = object.getMeshState();
|
|
212 |
InputStream jsonStream = object.getObjectStream(this); |
|
213 |
InputStream meshStream = object.getMeshStream(this);
|
|
218 | 214 |
|
219 |
InputStream jsonStream = ObjectJson.getObjectStream(jsonID,this); |
|
220 |
InputStream meshStream = ObjectMesh.getMeshStream(meshID,this); |
|
221 |
|
|
222 |
control.changeIfDifferent(object.getOrdinal(),meshState,jsonStream,meshStream); |
|
215 |
control.changeIfDifferent(ordinal,meshState,jsonStream,meshStream); |
|
223 | 216 |
} |
224 | 217 |
} |
225 | 218 |
|
... | ... | |
245 | 238 |
ConfigSurfaceView view = findViewById(R.id.configSurfaceView); |
246 | 239 |
ObjectControl control = view.getObjectControl(); |
247 | 240 |
|
248 |
int jsonID = object.getJsonID(); |
|
249 |
int meshID = object.getMeshID(); |
|
250 |
|
|
251 |
int meshState = object.getMeshState(); |
|
252 |
|
|
253 |
InputStream jsonStream = ObjectJson.getObjectStream(jsonID,this); |
|
254 |
InputStream meshStream = ObjectMesh.getMeshStream(meshID,this); |
|
241 |
int ordinal = object.getOrdinal(); |
|
242 |
int meshState = object.getMeshState(); |
|
243 |
InputStream jsonStream = object.getObjectStream(this); |
|
244 |
InputStream meshStream = object.getMeshStream(this); |
|
255 | 245 |
|
256 |
control.changeObject(object.getOrdinal(),meshState,jsonStream,meshStream);
|
|
246 |
control.changeObject(ordinal,meshState,jsonStream,meshStream);
|
|
257 | 247 |
} |
258 | 248 |
} |
259 | 249 |
|
Also available in: Unified diff
Refactor RubikObject in preparation for creating RubikObjects from DownloadedObjects.