Project

General

Profile

« Previous | Next » 

Revision 05c044a5

Added by Leszek Koltunski almost 2 years ago

Reinstall the latest Android Studio, latest gradle; reconfigure all project to match and compile.

View differences:

build.gradle
30 30
            manifestPlaceholders = [crashlyticsCollectionEnabled:"false"]
31 31
        }
32 32
    }
33
    namespace 'org.distorted.main'
33 34

  
34 35
}
35 36

  
src/main/AndroidManifest.xml
1
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2
    package="org.distorted.main">
1
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
3 2

  
4 3
    <uses-feature android:glEsVersion="0x00030000" android:required="true" />
5 4
    <uses-feature android:name="android.hardware.faketouch" android:required="true" />
src/main/java/org/distorted/dialogs/RubikDialogScoresView.java
136 136
    TextView textName = row.findViewById(R.id.scoresScrambleRowName);
137 137
    TextView textTime = row.findViewById(R.id.scoresScrambleRowTime);
138 138

  
139
    imgCoun.setImageResource(countryID!=0 ? countryID : R.drawable.un);
139
    imgCoun.setImageResource(countryID!=0 ? countryID : org.distorted.flags.R.drawable.unknown);
140 140
    textName.setText(name);
141 141
    textTime.setText(time);
142 142

  
src/main/java/org/distorted/dialogs/RubikDialogTutorialView.java
73 73
        reader.parseJsonTutorial(jsonStream);
74 74
        tutorials = reader.getTutorials();
75 75
        }
76
      catch(Exception ex)
77
        {
78
        tutorials = null;
79
        }
76
      catch(Exception ignored) { }
80 77
      }
81 78

  
82 79
    if( tutorials!=null )
......
151 148
      });
152 149

  
153 150
    ImageView image = row.findViewById(R.id.tutorialCountry);
154
    int id = countryID!=0 ? countryID : R.drawable.un;
151
    int id = countryID!=0 ? countryID : org.distorted.flags.R.drawable.unknown;
155 152
    image.setImageResource(id);
156 153

  
157 154
    TextView author = row.findViewById(R.id.tutorialAuthor);
src/main/java/org/distorted/objects/RubikObjectList.java
16 16
import android.content.SharedPreferences;
17 17

  
18 18
import org.distorted.external.RubikFiles;
19
//import org.distorted.external.RubikScores;
19
import org.distorted.external.RubikScores;
20 20
import org.distorted.main.RubikActivity;
21 21
import org.distorted.objectlib.main.ObjectSignatures;
22 22
import org.distorted.objectlib.main.ObjectType;
......
24 24
import static org.distorted.objectlib.main.TwistyObject.MESH_NICE;
25 25
import static org.distorted.objectlib.main.ObjectType.NUM_OBJECTS;
26 26
import static org.distorted.main.RubikActivity.SHOW_DOWNLOADED_DEBUG;
27
//import static org.distorted.main.RubikActivity.SHOW_SOLVED_DEBUG;
28 27
import static org.distorted.screens.RubikScreenPlay.LEVELS_SHOWN;
29 28

  
30 29
///////////////////////////////////////////////////////////////////////////////////////////////////
......
156 155
    }
157 156

  
158 157
///////////////////////////////////////////////////////////////////////////////////////////////////
159
/*
158

  
160 159
  private static void restoreFreedObjects(SharedPreferences preferences)
161 160
    {
161
    /*
162 162
    mFreeSolvedObjects = preferences.getString("rol_freeSolved", "");
163 163
    mFreeBoughtObjects = preferences.getString("rol_freeBought", "");
164 164

  
......
201 201
        if( o!=null ) o.markFree();
202 202
        }
203 203
      }
204
     */
204 205
    }
205 206

  
206 207
///////////////////////////////////////////////////////////////////////////////////////////////////
207 208

  
208 209
  private static int getNumUnclaimedSolves()
209 210
    {
211
    /*
210 212
    RubikScores scores = RubikScores.getInstance();
211 213
    int numMAXes = scores.numberOfSolvedMAXes();
212 214
    return numMAXes-mNumFreeSolved;
215
     */
216

  
217
    return 0;
213 218
    }
214 219

  
215 220
///////////////////////////////////////////////////////////////////////////////////////////////////
......
218 223
    {
219 224
    RubikScores scores = RubikScores.getInstance();
220 225
    int numObjects = RubikObjectList.getNumObjects();
221
    int level = LEVELS_SHOWN;
222 226
    int ret = 0;
223 227

  
224 228
    for(int obj=0; obj<numObjects; obj++)
225 229
      {
226 230
      RubikObject object = getObject(obj);
227 231

  
228
      if( object!=null && !object.isFree() && scores.isSolved(obj,level) )
232
      if( object!=null && !object.isFree() && scores.isSolved(obj,LEVELS_SHOWN) )
229 233
        {
230 234
        solveObject(object.getUpperName());
231 235
        ret++;
......
257 261

  
258 262
  public static boolean solveObject(RubikObject object, String shortName)
259 263
    {
264
    /*
260 265
    if( object!=null && !object.isFree() )
261 266
      {
262 267
      if( SHOW_SOLVED_DEBUG ) android.util.Log.e("D", "object "+shortName+" marked as solved");
......
266 271
      mNumFreeSolved++;
267 272
      return true;
268 273
      }
269

  
274
    */
270 275
    return false;
271 276
    }
272
*/
277

  
273 278
///////////////////////////////////////////////////////////////////////////////////////////////////
274 279
// PUBLIC API
275 280

  
......
358 363
        }
359 364
      }
360 365
    }
361
/*
366

  
362 367
///////////////////////////////////////////////////////////////////////////////////////////////////
363 368

  
364 369
  public static boolean allAlreadyBought()
365 370
    {
366
    return mFreeBoughtObjects.equals("*");
371
    //return mFreeBoughtObjects.equals("*");
372
    return false;
367 373
    }
368 374

  
369 375
///////////////////////////////////////////////////////////////////////////////////////////////////
......
391 397

  
392 398
  public static void buyAll()
393 399
    {
400
    /*
394 401
    mFreeBoughtObjects = "*";
395 402
    if( SHOW_SOLVED_DEBUG ) android.util.Log.e("D", "all objects marked as bought");
396 403

  
......
399 406
      RubikObject o = mObjects.get(i);
400 407
      o.markFree();
401 408
      }
409
    */
402 410
    }
403 411

  
404 412
///////////////////////////////////////////////////////////////////////////////////////////////////
405 413

  
406 414
  public static boolean buyObject(String shortName)
407 415
    {
416
    /*
408 417
    RubikObject o = getObject(shortName);
409 418

  
410 419
    if( o!=null && !o.isFree() )
......
415 424
      mFreeBoughtObjects += add;
416 425
      return true;
417 426
      }
418

  
427
    */
419 428
    return false;
420 429
    }
421 430

  
......
426 435
    RubikObject object = getObject(shortName);
427 436
    return solveObject(object,shortName);
428 437
    }
429
*/
438

  
430 439
///////////////////////////////////////////////////////////////////////////////////////////////////
431 440

  
432 441
  public static void savePreferences(SharedPreferences.Editor editor)
......
531 540
    mObject = getOrdinal(objName);
532 541
    if( mObject<0 || mObject>=mNumObjects ) mObject = DEF_OBJECT;
533 542

  
534
//    if( justStarted) restoreFreedObjects(preferences);
543
    if( justStarted) restoreFreedObjects(preferences);
535 544
    }
536 545

  
537 546
///////////////////////////////////////////////////////////////////////////////////////////////////
......
552 561
    }
553 562

  
554 563
///////////////////////////////////////////////////////////////////////////////////////////////////
555
/*
564

  
556 565
  public static void setObjectFreeState()
557 566
    {
558 567
    int numUnclaimed = getNumUnclaimedSolves();
......
564 573
      if( stillUnclaimed>0) markAsFree(stillUnclaimed);
565 574
      }
566 575
    }
567
*/
576

  
568 577
///////////////////////////////////////////////////////////////////////////////////////////////////
569 578

  
570 579
  public static boolean setCurrObject(int ordinal)

Also available in: Unified diff