Revision 05c20dad
Added by Leszek Koltunski about 3 years ago
src/main/java/org/distorted/main/RubikActivity.java | ||
---|---|---|
260 | 260 |
BlockController.onResume(); |
261 | 261 |
RubikSurfaceView view = findViewById(R.id.rubikSurfaceView); |
262 | 262 |
view.onResume(); |
263 |
view.initialize(); |
|
264 | 263 |
restorePreferences(); |
265 | 264 |
ScreenList.setScreen(this); |
266 | 265 |
unblockEverything(); |
src/main/java/org/distorted/main/RubikSurfaceView.java | ||
---|---|---|
29 | 29 |
|
30 | 30 |
import com.google.firebase.crashlytics.FirebaseCrashlytics; |
31 | 31 |
|
32 |
import org.distorted.library.main.DistortedScreen; |
|
33 | 32 |
import org.distorted.library.type.Static4D; |
34 | 33 |
|
35 | 34 |
import org.distorted.objectlib.helpers.ObjectSurfaceView; |
36 |
import org.distorted.objectlib.helpers.TwistyActivity; |
|
37 | 35 |
import org.distorted.objectlib.main.ObjectControl; |
38 | 36 |
import org.distorted.objectlib.main.ObjectPreRender; |
39 |
import org.distorted.objectlib.main.Movement; |
|
40 | 37 |
|
41 | 38 |
import org.distorted.screens.ScreenList; |
42 | 39 |
|
... | ... | |
120 | 117 |
} |
121 | 118 |
} |
122 | 119 |
|
123 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
124 |
|
|
125 |
public void setMovement(Movement movement) |
|
126 |
{ |
|
127 |
mObjectController.setMovement(movement); |
|
128 |
} |
|
129 |
|
|
130 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
131 |
|
|
132 |
public void setQuat() |
|
133 |
{ |
|
134 |
mObjectController.setQuat(); |
|
135 |
} |
|
136 |
|
|
137 | 120 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
138 | 121 |
|
139 | 122 |
public Static4D getQuat() |
... | ... | |
143 | 126 |
|
144 | 127 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
145 | 128 |
|
146 |
public TwistyActivity getActivity() |
|
147 |
{ |
|
148 |
return (TwistyActivity)getContext(); |
|
149 |
} |
|
150 |
|
|
151 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
152 |
|
|
153 |
public DistortedScreen getScreen() |
|
154 |
{ |
|
155 |
return mRenderer.getScreen(); |
|
156 |
} |
|
157 |
|
|
158 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
159 |
|
|
160 |
public void initialize() |
|
129 |
@Override |
|
130 |
public void onResume() |
|
161 | 131 |
{ |
132 |
super.onResume(); |
|
162 | 133 |
mObjectController.initialize(); |
163 | 134 |
} |
164 | 135 |
|
src/main/java/org/distorted/tutorials/TutorialActivity.java | ||
---|---|---|
34 | 34 |
|
35 | 35 |
import org.distorted.library.main.DistortedLibrary; |
36 | 36 |
|
37 |
import org.distorted.library.main.DistortedScreen; |
|
37 | 38 |
import org.distorted.objectlib.main.ObjectPreRender; |
38 | 39 |
import org.distorted.objectlib.main.ObjectType; |
39 | 40 |
import org.distorted.objectlib.main.TwistyObject; |
... | ... | |
205 | 206 |
BlockController.onResume(); |
206 | 207 |
TutorialSurfaceView view = findViewById(R.id.tutorialSurfaceView); |
207 | 208 |
view.onResume(); |
208 |
view.initialize(); |
|
209 | 209 |
restorePreferences(); |
210 | 210 |
|
211 | 211 |
if( mWebView!=null ) mWebView.onResume(); |
... | ... | |
290 | 290 |
return view.getPreRender(); |
291 | 291 |
} |
292 | 292 |
|
293 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
294 |
|
|
295 |
public DistortedScreen getScreen() |
|
296 |
{ |
|
297 |
TutorialSurfaceView view = findViewById(R.id.tutorialSurfaceView); |
|
298 |
TutorialRenderer renderer = view.getRenderer(); |
|
299 |
return renderer.getScreen(); |
|
300 |
} |
|
301 |
|
|
293 | 302 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
294 | 303 |
|
295 | 304 |
public boolean isLocked() |
src/main/java/org/distorted/tutorials/TutorialObjectStateActioner.java | ||
---|---|---|
1 | 1 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
2 |
// Copyright 2019 Leszek Koltunski //
|
|
2 |
// Copyright 2021 Leszek Koltunski //
|
|
3 | 3 |
// // |
4 | 4 |
// This file is part of Magic Cube. // |
5 | 5 |
// // |
src/main/java/org/distorted/tutorials/TutorialSurfaceView.java | ||
---|---|---|
29 | 29 |
|
30 | 30 |
import com.google.firebase.crashlytics.FirebaseCrashlytics; |
31 | 31 |
|
32 |
import org.distorted.library.main.DistortedScreen; |
|
33 |
import org.distorted.library.type.Static4D; |
|
34 |
|
|
35 | 32 |
import org.distorted.objectlib.main.ObjectControl; |
36 | 33 |
import org.distorted.objectlib.helpers.ObjectSurfaceView; |
37 |
import org.distorted.objectlib.helpers.TwistyActivity; |
|
38 |
import org.distorted.objectlib.main.Movement; |
|
39 | 34 |
import org.distorted.objectlib.main.ObjectPreRender; |
40 | 35 |
|
41 | 36 |
import static org.distorted.objectlib.main.ObjectControl.MODE_ROTATE; |
... | ... | |
122 | 117 |
|
123 | 118 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
124 | 119 |
|
125 |
public void setMovement(Movement movement) |
|
126 |
{ |
|
127 |
mObjectController.setMovement(movement); |
|
128 |
} |
|
129 |
|
|
130 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
131 |
|
|
132 |
public void setQuat() |
|
133 |
{ |
|
134 |
mObjectController.setQuat(); |
|
135 |
} |
|
136 |
|
|
137 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
138 |
|
|
139 |
public Static4D getQuat() |
|
140 |
{ |
|
141 |
return mObjectController.getQuat(); |
|
142 |
} |
|
143 |
|
|
144 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
145 |
|
|
146 |
public TwistyActivity getActivity() |
|
147 |
{ |
|
148 |
return (TwistyActivity)getContext(); |
|
149 |
} |
|
150 |
|
|
151 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
152 |
|
|
153 |
public DistortedScreen getScreen() |
|
154 |
{ |
|
155 |
return mRenderer.getScreen(); |
|
156 |
} |
|
157 |
|
|
158 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
159 |
|
|
160 |
public void initialize() |
|
120 |
@Override |
|
121 |
public void onResume() |
|
161 | 122 |
{ |
123 |
super.onResume(); |
|
162 | 124 |
mObjectController.initialize(); |
163 | 125 |
} |
164 | 126 |
|
Also available in: Unified diff
Simplifications