diff --git a/android/gradle.properties b/android/gradle.properties index 957c40bc42f3a742d2266dc3a403ad014458ba3f..777ac2de0980e935649cf32bd85097eaf789185a 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -1,5 +1,5 @@ org.gradle.jvmargs=-Xmx1536M android.useAndroidX=true android.enableJetifier=true -app.versionName=0.0.15 -app.versionCode=15 +app.versionName=0.0.16 +app.versionCode=16 diff --git a/lib/entities/cell.dart b/lib/entities/cell.dart index db64fe3da8cc674ce906691be13baa28f3d5e78d..e284b70e373c7f0896306a818bea857833c0be13 100644 --- a/lib/entities/cell.dart +++ b/lib/entities/cell.dart @@ -39,7 +39,7 @@ class Cell { fit: BoxFit.fill ), onTap: () { - if (!myProvider.animationInProgress) { + if (!myProvider.animationInProgress && myProvider.getFirstCellValue() != this.value) { BoardUtils.fillBoardFromFirstCell(myProvider, this.value); } }, diff --git a/lib/provider/data.dart b/lib/provider/data.dart index fcb9770337638d7737296937bff4f42fec5d5ec5..bc47c16cfee36cfee43837a0d67157223f88d71a 100644 --- a/lib/provider/data.dart +++ b/lib/provider/data.dart @@ -179,6 +179,10 @@ class Data extends ChangeNotifier { notifyListeners(); } + int getFirstCellValue() { + return _cells[0][0].value; + } + int get movesCount => _movesCount; void updateMovesCount(int movesCount) { _movesCount = movesCount; diff --git a/lib/utils/board_utils.dart b/lib/utils/board_utils.dart index b91858c68b70c00a65b6bd3eed52bddd13667ed1..85aab4022dbf834faf2973074995eb843bddc649 100644 --- a/lib/utils/board_utils.dart +++ b/lib/utils/board_utils.dart @@ -81,7 +81,10 @@ class BoardUtils { myProvider.updateProgressDelta(progressDelta); myProvider.updateProgress(progressAfterMove); - myProvider.incrementMovesCount(); + if (progressDelta != 0) { + myProvider.incrementMovesCount(); + } + myProvider.updateAnimationInProgress(false); if (BoardUtils.checkBoardIsSolved(myProvider)) {