Project

General

Profile

Download (16 KB) Statistics
| Branch: | Tag: | Revision:

magiccube / src / main / java / org / distorted / main / MainActivity.java @ b710a574

1 0c52af30 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
2 1c04d054 leszek
// Copyright 2023 Leszek Koltunski                                                               //
3 0c52af30 Leszek Koltunski
//                                                                                               //
4 fdec60a3 Leszek Koltunski
// This file is part of Magic Cube.                                                              //
5 0c52af30 Leszek Koltunski
//                                                                                               //
6 296219b4 Leszek Koltunski
// Magic Cube is proprietary software licensed under an EULA which you should have received      //
7
// along with the code. If not, check https://distorted.org/magic/License-Magic-Cube.html        //
8 0c52af30 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
9
10 1f9772f3 Leszek Koltunski
package org.distorted.main;
11 0c52af30 Leszek Koltunski
12 b6468abb Leszek Koltunski
import android.content.Intent;
13 33499c56 Leszek Koltunski
import android.content.SharedPreferences;
14 4c9947bd Leszek Koltunski
import android.content.pm.PackageInfo;
15
import android.content.pm.PackageManager;
16 b42c8399 leszek
import android.content.res.Configuration;
17 b1e9596b Leszek Koltunski
import android.os.Build;
18 0c52af30 Leszek Koltunski
import android.os.Bundle;
19 e3c74c0f Leszek Koltunski
import android.util.DisplayMetrics;
20 1c04d054 leszek
import android.util.TypedValue;
21 fd0b901a Leszek Koltunski
import android.view.DisplayCutout;
22 0254cfd7 Leszek Koltunski
import android.view.View;
23 1cb36646 Leszek Koltunski
import android.view.ViewGroup;
24 c9556e1e Leszek Koltunski
import android.view.WindowManager;
25 1cb36646 Leszek Koltunski
import android.widget.LinearLayout;
26 1c04d054 leszek
import android.widget.ScrollView;
27
import android.widget.TextView;
28 0c52af30 Leszek Koltunski
29 b42c8399 leszek
import androidx.annotation.NonNull;
30 e019c70b Leszek Koltunski
import androidx.appcompat.app.AppCompatActivity;
31 ada8ab26 leszek
import androidx.preference.PreferenceManager;
32 e019c70b Leszek Koltunski
33 1b3cbd5b Leszek Koltunski
import com.google.firebase.analytics.FirebaseAnalytics;
34 a59f38d6 Leszek Koltunski
import com.google.firebase.inappmessaging.FirebaseInAppMessaging;
35 1b3cbd5b Leszek Koltunski
36 9530f6b0 Leszek Koltunski
import org.distorted.bandaged.BandagedCreatorActivity;
37 1c04d054 leszek
import org.distorted.config.ConfigActivity;
38 e71baee1 Leszek Koltunski
import org.distorted.dialogs.RubikDialogAbout;
39 1c04d054 leszek
import org.distorted.dialogs.RubikDialogCreators;
40
import org.distorted.dialogs.RubikDialogExit;
41
import org.distorted.dialogs.RubikDialogScores;
42
import org.distorted.dialogs.RubikDialogUpdates;
43 acabdd83 Leszek Koltunski
import org.distorted.external.RubikNetwork;
44 1c04d054 leszek
import org.distorted.external.RubikScores;
45
import org.distorted.external.RubikUpdates;
46
import org.distorted.messaging.RubikInAppMessanging;
47 d433b50e Leszek Koltunski
import org.distorted.objects.RubikObjectList;
48 e9245b7b leszek
import org.distorted.patternui.PatternActivity;
49 cb30e768 leszek
import org.distorted.solverui.SolverActivity;
50 eaf87d1d Leszek Koltunski
import org.distorted.tutorials.TutorialActivity;
51 211b48f2 Leszek Koltunski
52 0c52af30 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
53
54 1c04d054 leszek
public class MainActivity extends AppCompatActivity implements RubikNetwork.Updatee
55 0c52af30 Leszek Koltunski
{
56 1c04d054 leszek
    public static final float RATIO_BAR = 0.080f;
57 af7b68e6 Leszek Koltunski
    public static final int FLAGS =  View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
58 ffd68f35 Leszek Koltunski
                                   | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
59
                                   | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
60
                                   | View.SYSTEM_UI_FLAG_FULLSCREEN
61
                                   | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;
62
63 c3ffcf58 Leszek Koltunski
    private boolean mJustStarted;
64 1b3cbd5b Leszek Koltunski
    private FirebaseAnalytics mFirebaseAnalytics;
65 0254cfd7 Leszek Koltunski
    private int mCurrentApiVersion;
66 d05e7629 Leszek Koltunski
    private String mOldVersion, mCurrVersion;
67 b42c8399 leszek
    private int mScreenWidth;
68 1c04d054 leszek
    private TextView mBubbleUpdates;
69
    private int mNumUpdates;
70
    private MainScrollGrid mGrid;
71 c3ffcf58 Leszek Koltunski
72
///////////////////////////////////////////////////////////////////////////////////////////////////
73
74 0c52af30 Leszek Koltunski
    @Override
75 34747dd1 Leszek Koltunski
    protected void onCreate(Bundle savedState)
76 0c52af30 Leszek Koltunski
      {
77 34747dd1 Leszek Koltunski
      super.onCreate(savedState);
78 dd874ae8 Leszek Koltunski
      setTheme(R.style.MaterialThemeNoActionBar);
79 cb30e768 leszek
      setContentView(R.layout.main);
80 a7327225 leszek
      hideNavigationBar();
81 c3ffcf58 Leszek Koltunski
82
      mJustStarted = true;
83 1b3cbd5b Leszek Koltunski
      mFirebaseAnalytics = FirebaseAnalytics.getInstance(this);
84 e3c74c0f Leszek Koltunski
85 e8f6670f Leszek Koltunski
      cutoutHack();
86 1c04d054 leszek
      computeHeights();
87 a59f38d6 Leszek Koltunski
88 e9e744f7 Leszek Koltunski
      mCurrVersion = getAppVers();
89
90 83018ac4 Leszek Koltunski
      Thread thread = new Thread()
91
        {
92
        public void run()
93
          {
94
          RubikInAppMessanging listener = new RubikInAppMessanging();
95
          FirebaseInAppMessaging.getInstance().addClickListener(listener);
96
          }
97
        };
98
99
      thread.start();
100 0254cfd7 Leszek Koltunski
      }
101
102 598de3ee Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
103
// this does not include possible insets
104
105 1c04d054 leszek
    private void computeHeights()
106 598de3ee Leszek Koltunski
      {
107 b42c8399 leszek
      LinearLayout.LayoutParams pU = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, 0, RATIO_BAR);
108 214e301a Leszek Koltunski
      LinearLayout layoutTop = findViewById(R.id.upperBar);
109 b42c8399 leszek
      layoutTop.setLayoutParams(pU);
110 1c04d054 leszek
111 b42c8399 leszek
      LinearLayout.LayoutParams pS = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, 0, 1-2*RATIO_BAR);
112 1c04d054 leszek
      ScrollView scroll = findViewById(R.id.objectScroll);
113 b42c8399 leszek
      scroll.setLayoutParams(pS);
114
115
      LinearLayout.LayoutParams pL = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, 0, RATIO_BAR);
116
      LinearLayout layoutBot = findViewById(R.id.lowerBar);
117
      layoutBot.setLayoutParams(pL);
118 598de3ee Leszek Koltunski
      }
119
120 0254cfd7 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
121
122
    private void hideNavigationBar()
123
      {
124 c9556e1e Leszek Koltunski
      mCurrentApiVersion = Build.VERSION.SDK_INT;
125 0254cfd7 Leszek Koltunski
126
      if(mCurrentApiVersion >= Build.VERSION_CODES.KITKAT)
127
        {
128
        final View decorView = getWindow().getDecorView();
129
130 c9556e1e Leszek Koltunski
        decorView.setSystemUiVisibility(FLAGS);
131
132 0254cfd7 Leszek Koltunski
        decorView.setOnSystemUiVisibilityChangeListener(new View.OnSystemUiVisibilityChangeListener()
133
          {
134
          @Override
135
          public void onSystemUiVisibilityChange(int visibility)
136
            {
137
            if((visibility & View.SYSTEM_UI_FLAG_FULLSCREEN) == 0)
138
              {
139 ffd68f35 Leszek Koltunski
              decorView.setSystemUiVisibility(FLAGS);
140 0254cfd7 Leszek Koltunski
              }
141
            }
142
          });
143
        }
144
      }
145
146 1cb36646 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
147
148
    @Override
149
    public void onAttachedToWindow()
150
      {
151 fd0b901a Leszek Koltunski
      super.onAttachedToWindow();
152
153 b42c8399 leszek
      getWindowWidth(getResources().getConfiguration());
154
      mGrid = new MainScrollGrid();
155
      mGrid.createGrid(this,mScreenWidth);
156
157 ada8ab26 leszek
      if( Build.VERSION.SDK_INT >= Build.VERSION_CODES.P )
158 e8f6670f Leszek Koltunski
        {
159
        DisplayCutout cutout = getWindow().getDecorView().getRootWindowInsets().getDisplayCutout();
160
        int insetHeight = cutout!=null ? cutout.getSafeInsetTop() : 0;
161
162 b42c8399 leszek
        if( insetHeight>0 )
163
          {
164
          LinearLayout.LayoutParams pH = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, 0, RATIO_BAR);
165
          LinearLayout layoutHid = findViewById(R.id.hiddenBar);
166
          layoutHid.setLayoutParams(pH);
167
168
          LinearLayout.LayoutParams pS = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, 0, 1-3*RATIO_BAR);
169
          ScrollView scroll = findViewById(R.id.objectScroll);
170
          scroll.setLayoutParams(pS);
171
          }
172 e8f6670f Leszek Koltunski
        }
173 1cb36646 Leszek Koltunski
      }
174
175 0254cfd7 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
176 e8f6670f Leszek Koltunski
// do not avoid cutouts
177 c9556e1e Leszek Koltunski
178 e8f6670f Leszek Koltunski
    private void cutoutHack()
179 c9556e1e Leszek Koltunski
      {
180 ada8ab26 leszek
      if( Build.VERSION.SDK_INT >= Build.VERSION_CODES.P )
181 c9556e1e Leszek Koltunski
        {
182
        getWindow().getAttributes().layoutInDisplayCutoutMode = WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES;
183
        }
184
      }
185
186 b42c8399 leszek
///////////////////////////////////////////////////////////////////////////////////////////////////
187
188
    private void getWindowWidth(Configuration conf)
189
      {
190
      int dpi = getResources().getDisplayMetrics().densityDpi;
191
      float conv = ((float) dpi/DisplayMetrics.DENSITY_DEFAULT);
192
193
      mScreenWidth = (int) (conf.screenWidthDp*conv + 0.5f);
194
      }
195
196 c9556e1e Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
197 0254cfd7 Leszek Koltunski
198
    @Override
199
    public void onWindowFocusChanged(boolean hasFocus)
200
      {
201
      super.onWindowFocusChanged(hasFocus);
202
203 ada8ab26 leszek
      if( mCurrentApiVersion >= Build.VERSION_CODES.KITKAT && hasFocus )
204 0254cfd7 Leszek Koltunski
        {
205 ffd68f35 Leszek Koltunski
        getWindow().getDecorView().setSystemUiVisibility(FLAGS);
206 0254cfd7 Leszek Koltunski
        }
207
      }
208
209 b42c8399 leszek
///////////////////////////////////////////////////////////////////////////////////////////////////
210
211
    @Override
212
    public void onConfigurationChanged(@NonNull Configuration conf)
213
      {
214
      super.onConfigurationChanged(conf);
215
216
      getWindowWidth(conf);
217
      mGrid.updateGrid(this,mScreenWidth);
218
      }
219
220 0c52af30 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
221
    
222
    @Override
223
    protected void onPause() 
224
      {
225 82f42eeb Leszek Koltunski
      super.onPause();
226 6a083c6a Leszek Koltunski
      RubikNetwork.onPause();
227 33499c56 Leszek Koltunski
      savePreferences();
228 0c52af30 Leszek Koltunski
      }
229
230
///////////////////////////////////////////////////////////////////////////////////////////////////
231
    
232
    @Override
233
    protected void onResume() 
234
      {
235
      super.onResume();
236 51853bf2 Leszek Koltunski
237 6142069a Leszek Koltunski
      SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this);
238
      restorePreferences(preferences,mJustStarted);
239 1c04d054 leszek
240
      mBubbleUpdates = findViewById(R.id.bubbleUpdates);
241
      mBubbleUpdates.setVisibility(View.INVISIBLE);
242
      mNumUpdates = 0;
243
244
      RubikNetwork network = RubikNetwork.getInstance();
245
      network.signUpForUpdates(this);
246
      network.downloadUpdates(this);
247
248 c3ffcf58 Leszek Koltunski
      if( mJustStarted )
249
        {
250
        mJustStarted = false;
251 82ce8e64 Leszek Koltunski
        RubikScores scores = RubikScores.getInstance();
252
        scores.incrementNumRuns();
253
        scores.setCountry(this);
254 c3ffcf58 Leszek Koltunski
        }
255
256 ada8ab26 leszek
      if( !mOldVersion.equals(mCurrVersion) ) displayNovelties();
257 0c52af30 Leszek Koltunski
      }
258 d05e7629 Leszek Koltunski
259
///////////////////////////////////////////////////////////////////////////////////////////////////
260
261 1c89e2a7 Leszek Koltunski
    private void displayNovelties()
262 d05e7629 Leszek Koltunski
      {
263 1c89e2a7 Leszek Koltunski
      Bundle bundle = new Bundle();
264 34d6b123 Leszek Koltunski
      bundle.putString("argument",mOldVersion);
265 e71baee1 Leszek Koltunski
      RubikDialogAbout newDialog = new RubikDialogAbout();
266 1c89e2a7 Leszek Koltunski
      newDialog.setArguments(bundle);
267 e71baee1 Leszek Koltunski
      newDialog.show(getSupportFragmentManager(), RubikDialogAbout.getDialogTag() );
268 d05e7629 Leszek Koltunski
      }
269
270 0c52af30 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
271
    
272
    @Override
273
    protected void onDestroy() 
274
      {
275
      super.onDestroy();
276
      }
277
278 4c9947bd Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
279
280 b20e89d2 Leszek Koltunski
    private String getAppVers()
281 4c9947bd Leszek Koltunski
      {
282 b20e89d2 Leszek Koltunski
      try
283
        {
284
        PackageInfo pInfo = getPackageManager().getPackageInfo( getPackageName(), 0);
285
        return pInfo.versionName;
286
        }
287 1c04d054 leszek
      catch( PackageManager.NameNotFoundException e )
288 b20e89d2 Leszek Koltunski
        {
289
        return "unknown";
290
        }
291 4c9947bd Leszek Koltunski
      }
292
293 33499c56 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
294
295
    private void savePreferences()
296
      {
297
      SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this);
298
      SharedPreferences.Editor editor = preferences.edit();
299
300 e9e744f7 Leszek Koltunski
      editor.putString("appVersion", mCurrVersion );
301 b1e9596b Leszek Koltunski
302 400ff34d Leszek Koltunski
      RubikObjectList.savePreferences(editor);
303 2e3488f6 Leszek Koltunski
304 7480fbab Leszek Koltunski
      boolean success = editor.commit();
305
      if( !success ) android.util.Log.e("D", "Failed to save preferences");
306 33499c56 Leszek Koltunski
      }
307
308
///////////////////////////////////////////////////////////////////////////////////////////////////
309
310 6142069a Leszek Koltunski
    private void restorePreferences(SharedPreferences preferences, boolean justStarted)
311 33499c56 Leszek Koltunski
      {
312 d05e7629 Leszek Koltunski
      mOldVersion = preferences.getString("appVersion","");
313 872307fe Leszek Koltunski
314 7480fbab Leszek Koltunski
      RubikObjectList.restorePreferences(this,preferences,justStarted);
315 e9e744f7 Leszek Koltunski
      RubikScores scores = RubikScores.getInstance();
316
317
      if( scores.isVerified() )
318
        {
319
        FirebaseAnalytics analytics = getAnalytics();
320
        analytics.setUserId(scores.getName());
321
        }
322
      }
323 ee4e7896 Leszek Koltunski
324 e9e744f7 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
325 ee4e7896 Leszek Koltunski
326 b42c8399 leszek
    private void updateBubble(int num)
327 e9e744f7 Leszek Koltunski
      {
328 b42c8399 leszek
      runOnUiThread(new Runnable()
329
        {
330
        @Override
331
        public void run()
332
          {
333
          mNumUpdates = num;
334 00fcfefa Leszek Koltunski
335 b42c8399 leszek
          if( num>0 )
336
            {
337
            String shownNum = String.valueOf(num);
338
            mBubbleUpdates.setText(shownNum);
339
            mBubbleUpdates.setVisibility(View.VISIBLE);
340
            int height = (int)(0.05f*mScreenWidth);
341
            mBubbleUpdates.setTextSize(TypedValue.COMPLEX_UNIT_PX,height);
342
            }
343
          else
344
            {
345
            mBubbleUpdates.setVisibility(View.INVISIBLE);
346
            }
347
          }
348
        });
349 f3e12931 Leszek Koltunski
      }
350
351 2e3488f6 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
352 b42c8399 leszek
// PUBLIC API
353 2d9fc972 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
354
355 b42c8399 leszek
    public FirebaseAnalytics getAnalytics()
356 2d9fc972 Leszek Koltunski
      {
357 b42c8399 leszek
      return mFirebaseAnalytics;
358 2d9fc972 Leszek Koltunski
      }
359
360 1b3cbd5b Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
361
362 b710a574 leszek
    public void switchToTutorial(int objectOrdinal)
363 1b3cbd5b Leszek Koltunski
      {
364 1c04d054 leszek
      Intent intent = new Intent(this, TutorialActivity.class);
365
      intent.putExtra("obj", objectOrdinal);
366
      startActivity(intent);
367 1b3cbd5b Leszek Koltunski
      }
368
369 598de3ee Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
370
371 1c04d054 leszek
    public void switchToConfig(int objectOrdinal)
372 598de3ee Leszek Koltunski
      {
373 1c04d054 leszek
      Intent intent = new Intent(this, ConfigActivity.class);
374
      intent.putExtra("obj", objectOrdinal);
375
      startActivity(intent);
376 598de3ee Leszek Koltunski
      }
377
378 a6d3b158 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
379
380 1c04d054 leszek
    public void switchToBandagedCreator(int objectOrdinal)
381 aa171dee Leszek Koltunski
      {
382 1c04d054 leszek
      Intent intent = new Intent(this, BandagedCreatorActivity.class);
383
      intent.putExtra("obj", objectOrdinal);
384
      startActivity(intent);
385 8becce57 Leszek Koltunski
      }
386
387 d7f0c07d Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
388
389 cb30e768 leszek
    public void switchToSolver(int objectOrdinal)
390 d7f0c07d Leszek Koltunski
      {
391 cb30e768 leszek
      Intent intent = new Intent(this, SolverActivity.class);
392 1c04d054 leszek
      intent.putExtra("obj", objectOrdinal);
393
      startActivity(intent);
394 d7f0c07d Leszek Koltunski
      }
395
396 e9245b7b leszek
///////////////////////////////////////////////////////////////////////////////////////////////////
397
398
    public void switchToPattern(int objectOrdinal)
399
      {
400
      Intent intent = new Intent(this, PatternActivity.class);
401
      intent.putExtra("obj", objectOrdinal);
402
      startActivity(intent);
403
      }
404
405 8ba7aeb1 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
406
407 1c04d054 leszek
    public void onScores(View v)
408 8ba7aeb1 Leszek Koltunski
      {
409 1c04d054 leszek
      Bundle sBundle = new Bundle();
410
      sBundle.putString("argument", "false");
411
      RubikDialogScores scores = new RubikDialogScores();
412
      scores.setArguments(sBundle);
413
      scores.show(getSupportFragmentManager(), null);
414 aa171dee Leszek Koltunski
      }
415
416
///////////////////////////////////////////////////////////////////////////////////////////////////
417
418 1c04d054 leszek
    public void onUpdates(View v)
419 769d7b9f Leszek Koltunski
      {
420 1c04d054 leszek
      RubikDialogUpdates diag = new RubikDialogUpdates();
421
      diag.show( getSupportFragmentManager(), RubikDialogUpdates.getDialogTag() );
422 b20e89d2 Leszek Koltunski
      }
423
424
///////////////////////////////////////////////////////////////////////////////////////////////////
425 7eae2d49 Leszek Koltunski
426 1c04d054 leszek
    public void onExit(View v)
427 b20e89d2 Leszek Koltunski
      {
428 1c04d054 leszek
      RubikDialogExit diag = new RubikDialogExit();
429
      diag.show(getSupportFragmentManager(), null);
430 2e8ec627 Leszek Koltunski
      }
431
432 b1e9596b Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
433
434 1c04d054 leszek
    public void onAbout(View v)
435 b6468abb Leszek Koltunski
      {
436 1c04d054 leszek
      RubikDialogAbout diag = new RubikDialogAbout();
437
      diag.show(getSupportFragmentManager(), null);
438 b6468abb Leszek Koltunski
      }
439 1237d25d Leszek Koltunski
440
///////////////////////////////////////////////////////////////////////////////////////////////////
441
442 1c04d054 leszek
    public void onBandage(View v)
443 1237d25d Leszek Koltunski
      {
444 1c04d054 leszek
      RubikDialogCreators diag = new RubikDialogCreators();
445
      diag.show(getSupportFragmentManager(), RubikDialogCreators.getDialogTag() );
446 9530f6b0 Leszek Koltunski
      }
447
448 c7238c67 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
449
450 1c04d054 leszek
    public void receiveUpdate(RubikUpdates updates)
451 c7238c67 Leszek Koltunski
      {
452 1c04d054 leszek
      int num = updates.getCompletedNumber();
453
      updateBubble(num);
454 c7238c67 Leszek Koltunski
      }
455
456 41a5dd89 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
457
458 1c04d054 leszek
    public void objectDownloaded(String shortName)
459 41a5dd89 Leszek Koltunski
      {
460 1c04d054 leszek
      mNumUpdates--;
461
      updateBubble(mNumUpdates);
462 b42c8399 leszek
      mGrid.updateGrid(this,mScreenWidth);
463 41a5dd89 Leszek Koltunski
      }
464 67d7fb28 Leszek Koltunski
465
///////////////////////////////////////////////////////////////////////////////////////////////////
466
467 1c04d054 leszek
    public int getType()
468 67d7fb28 Leszek Koltunski
      {
469 1c04d054 leszek
      return 0;
470 67d7fb28 Leszek Koltunski
      }
471
472
///////////////////////////////////////////////////////////////////////////////////////////////////
473
474 1c04d054 leszek
    public void errorUpdate()
475 67d7fb28 Leszek Koltunski
      {
476 1c04d054 leszek
      android.util.Log.e("D", "NewRubikActivity: Error receiving downloaded objects update");
477 67d7fb28 Leszek Koltunski
      }
478 0c52af30 Leszek Koltunski
}