Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
org.benoitharrault.colors
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
android
org.benoitharrault.colors
Commits
b73d6e37
Commit
b73d6e37
authored
3 years ago
by
Benoît Harrault
Browse files
Options
Downloads
Patches
Plain Diff
Disable buttons while fill animation is in progress
parent
d8557737
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!15
Resolve "Disable fill buttons while animation is in progress"
Pipeline
#2804
passed
3 years ago
Stage: update
Stage: build-debug
Changes
4
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
android/gradle.properties
+2
-2
2 additions, 2 deletions
android/gradle.properties
lib/entities/cell.dart
+3
-1
3 additions, 1 deletion
lib/entities/cell.dart
lib/provider/data.dart
+7
-0
7 additions, 0 deletions
lib/provider/data.dart
lib/utils/board_utils.dart
+2
-0
2 additions, 0 deletions
lib/utils/board_utils.dart
with
14 additions
and
3 deletions
android/gradle.properties
+
2
−
2
View file @
b73d6e37
org.gradle.jvmargs
=
-Xmx1536M
android.useAndroidX
=
true
android.enableJetifier
=
true
app.versionName
=
0.0.1
4
app.versionCode
=
1
4
app.versionName
=
0.0.1
5
app.versionCode
=
1
5
This diff is collapsed.
Click to expand it.
lib/entities/cell.dart
+
3
−
1
View file @
b73d6e37
...
...
@@ -39,7 +39,9 @@ class Cell {
fit:
BoxFit
.
fill
),
onTap:
()
{
if
(
!
myProvider
.
animationInProgress
)
{
BoardUtils
.
fillBoardFromFirstCell
(
myProvider
,
this
.
value
);
}
},
)
);
...
...
This diff is collapsed.
Click to expand it.
lib/provider/data.dart
+
7
−
0
View file @
b73d6e37
...
...
@@ -32,6 +32,7 @@ class Data extends ChangeNotifier {
// Game data
bool
_gameIsRunning
=
false
;
bool
_animationInProgress
=
false
;
bool
_gameWon
=
false
;
int
_boardSize
=
0
;
int
_colorsCount
=
0
;
...
...
@@ -224,6 +225,12 @@ class Data extends ChangeNotifier {
notifyListeners
();
}
bool
get
animationInProgress
=
>
_animationInProgress
;
void
updateAnimationInProgress
(
bool
animationInProgress
)
{
_animationInProgress
=
animationInProgress
;
notifyListeners
();
}
void
resetGame
()
{
_gameIsRunning
=
false
;
_gameWon
=
false
;
...
...
This diff is collapsed.
Click to expand it.
lib/utils/board_utils.dart
+
2
−
0
View file @
b73d6e37
...
...
@@ -66,6 +66,7 @@ class BoardUtils {
Timer
_timerAnimateBoard
;
const
interval
=
const
Duration
(
milliseconds:
10
);
int
cellIndex
=
0
;
myProvider
.
updateAnimationInProgress
(
true
);
_timerAnimateBoard
=
new
Timer
.
periodic
(
interval
,
(
Timer
timer
)
{
...
...
@@ -81,6 +82,7 @@ class BoardUtils {
myProvider
.
updateProgress
(
progressAfterMove
);
myProvider
.
incrementMovesCount
();
myProvider
.
updateAnimationInProgress
(
false
);
if
(
BoardUtils
.
checkBoardIsSolved
(
myProvider
))
{
myProvider
.
updateGameWon
(
true
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment