Revision c02235d5
Added by Leszek Koltunski 6 months ago
src/main/java/org/distorted/main/MainActivity.java | ||
---|---|---|
53 | 53 |
|
54 | 54 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
55 | 55 |
|
56 |
public class MainActivity extends AppCompatActivity implements RubikNetwork.Updatee |
|
56 |
public class MainActivity extends AppCompatActivity implements RubikNetwork.Updatee, RubikDialogScores.ScoresInvoker
|
|
57 | 57 |
{ |
58 | 58 |
public static final float RATIO_BAR = 0.080f; |
59 | 59 |
public static final int FLAGS = View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION |
... | ... | |
69 | 69 |
private int mScreenWidth; |
70 | 70 |
private TextView mBubbleUpdates; |
71 | 71 |
private int mNumUpdates; |
72 |
private int mCurrentObject; |
|
72 | 73 |
private MainScrollGrid mGrid; |
73 | 74 |
|
74 | 75 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
81 | 82 |
setContentView(R.layout.main); |
82 | 83 |
hideNavigationBar(); |
83 | 84 |
|
85 |
mCurrentObject = 0; |
|
84 | 86 |
mJustStarted = true; |
85 | 87 |
mFirebaseAnalytics = FirebaseAnalytics.getInstance(this); |
86 | 88 |
|
... | ... | |
89 | 91 |
|
90 | 92 |
mCurrVersion = getAppVers(); |
91 | 93 |
|
94 |
mBubbleUpdates = findViewById(R.id.bubbleUpdates); |
|
95 |
mBubbleUpdates.setVisibility(View.INVISIBLE); |
|
96 |
mNumUpdates = 0; |
|
97 |
|
|
92 | 98 |
Thread thread = new Thread() |
93 | 99 |
{ |
94 | 100 |
public void run() |
... | ... | |
239 | 245 |
SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this); |
240 | 246 |
restorePreferences(preferences,mJustStarted); |
241 | 247 |
|
242 |
mBubbleUpdates = findViewById(R.id.bubbleUpdates); |
|
243 |
mBubbleUpdates.setVisibility(View.INVISIBLE); |
|
244 |
mNumUpdates = 0; |
|
248 |
RubikNetwork network = RubikNetwork.getInstance(); |
|
249 |
network.signUpForUpdates(this); |
|
245 | 250 |
|
246 | 251 |
if( mJustStarted ) |
247 | 252 |
{ |
248 | 253 |
mJustStarted = false; |
249 | 254 |
|
250 |
RubikNetwork network = RubikNetwork.getInstance(); |
|
251 |
network.signUpForUpdates(this); |
|
252 | 255 |
network.downloadUpdates(this); |
253 | 256 |
RubikScores scores = RubikScores.getInstance(); |
254 | 257 |
scores.incrementNumRuns(); |
... | ... | |
359 | 362 |
return mFirebaseAnalytics; |
360 | 363 |
} |
361 | 364 |
|
365 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
366 |
|
|
367 |
public int getObjectOrdinal() |
|
368 |
{ |
|
369 |
return mCurrentObject; |
|
370 |
} |
|
371 |
|
|
372 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
373 |
|
|
374 |
public void setCurrentObject(int current) |
|
375 |
{ |
|
376 |
mCurrentObject = current; |
|
377 |
} |
|
378 |
|
|
362 | 379 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
363 | 380 |
|
364 | 381 |
public void switchToTutorial(int objectOrdinal) |
Also available in: Unified diff
progress