Revision 1237d25d
Added by Leszek Koltunski over 2 years ago
src/main/java/org/distorted/tutorials/TutorialActivity.java | ||
---|---|---|
50 | 50 |
{ |
51 | 51 |
private static final String URL = "https://www.youtube.com/embed/"; |
52 | 52 |
|
53 |
private static final int ACTIVITY_NUMBER = 1; |
|
53 | 54 |
public static final float BAR_RATIO = 0.17f; |
54 | 55 |
public static final float DIALOG_BUTTON_SIZE = 0.06f; |
55 | 56 |
public static final float MENU_BIG_TEXT_SIZE = 0.05f; |
... | ... | |
63 | 64 |
private FirebaseAnalytics mFirebaseAnalytics; |
64 | 65 |
private static int mScreenWidth, mScreenHeight; |
65 | 66 |
private int mCurrentApiVersion; |
66 |
private TutorialScreen mState;
|
|
67 |
private TutorialScreen mScreen;
|
|
67 | 68 |
private String mURL; |
68 | 69 |
private int mObjectOrdinal; |
69 | 70 |
private TutorialWebView mWebView; |
... | ... | |
74 | 75 |
protected void onCreate(Bundle savedState) |
75 | 76 |
{ |
76 | 77 |
super.onCreate(savedState); |
77 |
DistortedLibrary.onCreate(1);
|
|
78 |
DistortedLibrary.onCreate(ACTIVITY_NUMBER);
|
|
78 | 79 |
setTheme(R.style.MaterialThemeNoActionBar); |
79 | 80 |
setContentView(R.layout.tutorial); |
80 | 81 |
|
... | ... | |
137 | 138 |
paramsR.width = (int)(width*BAR_RATIO); |
138 | 139 |
viewR.setLayoutParams(paramsR); |
139 | 140 |
|
140 |
if( mState==null ) mState = new TutorialScreen();
|
|
141 |
if( mScreen==null ) mScreen = new TutorialScreen();
|
|
141 | 142 |
|
142 |
mState.createRightPane(this);
|
|
143 |
mScreen.createRightPane(this);
|
|
143 | 144 |
|
144 | 145 |
WebView videoView = findViewById(R.id.tutorialVideoView); |
145 | 146 |
mWebView = new TutorialWebView(videoView); |
... | ... | |
181 | 182 |
|
182 | 183 |
if( mWebView!=null ) mWebView.onPause(); |
183 | 184 |
|
184 |
DistortedLibrary.onPause(1);
|
|
185 |
DistortedLibrary.onPause(ACTIVITY_NUMBER);
|
|
185 | 186 |
} |
186 | 187 |
|
187 | 188 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
190 | 191 |
protected void onResume() |
191 | 192 |
{ |
192 | 193 |
super.onResume(); |
193 |
DistortedLibrary.onResume(1);
|
|
194 |
DistortedLibrary.onResume(ACTIVITY_NUMBER);
|
|
194 | 195 |
TutorialSurfaceView view = findViewById(R.id.tutorialSurfaceView); |
195 | 196 |
view.onResume(); |
196 | 197 |
|
... | ... | |
209 | 210 |
protected void onDestroy() |
210 | 211 |
{ |
211 | 212 |
super.onDestroy(); |
212 |
DistortedLibrary.onDestroy(1);
|
|
213 |
DistortedLibrary.onDestroy(ACTIVITY_NUMBER);
|
|
213 | 214 |
} |
214 | 215 |
|
215 | 216 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
233 | 234 |
|
234 | 235 |
TutorialScreen getState() |
235 | 236 |
{ |
236 |
return mState;
|
|
237 |
return mScreen;
|
|
237 | 238 |
} |
238 | 239 |
|
239 | 240 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
Also available in: Unified diff
Beginnings of the ConfigActivity.