diff --git a/android/gradle.properties b/android/gradle.properties index 818e87b23b224ced309ae5c147e5ed827826e237..db7a1ee2908d6e94aeb319e1c1b548a8bb245891 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.2 -app.versionCode=2 +app.versionName=0.0.3 +app.versionCode=3 diff --git a/assets/icons/button_restart.png b/assets/icons/button_restart.png index 389eabc630dcb6d973aae1b616e1783dbc414ca6..7c52b13b4e4d34bc58fea4b71ed7e0872c759bf1 100644 Binary files a/assets/icons/button_restart.png and b/assets/icons/button_restart.png differ diff --git a/fastlane/metadata/android/en-US/changelogs/3.txt b/fastlane/metadata/android/en-US/changelogs/3.txt new file mode 100644 index 0000000000000000000000000000000000000000..3c8a935834dc8b63f158e39f3a50780c5c837adf --- /dev/null +++ b/fastlane/metadata/android/en-US/changelogs/3.txt @@ -0,0 +1 @@ +Add a restart game button in title bar, improve layout diff --git a/fastlane/metadata/android/fr-FR/changelogs/3.txt b/fastlane/metadata/android/fr-FR/changelogs/3.txt new file mode 100644 index 0000000000000000000000000000000000000000..96f04d6aacc88aa5b8e21b99d0dd28c046fe15d9 --- /dev/null +++ b/fastlane/metadata/android/fr-FR/changelogs/3.txt @@ -0,0 +1 @@ +Ajout d'un bouton pour recommencer la partie dans la barre de titre, amélioration de l'agencement diff --git a/icons/button_restart.svg b/icons/button_restart.svg index 1d18f3b4122b5df597f3be46abfd0770affb3ca6..0b857a676c3d9ec6f3679eaf3ed1b050c999c3cd 100644 --- a/icons/button_restart.svg +++ b/icons/button_restart.svg @@ -1,2 +1,2 @@ <?xml version="1.0" encoding="UTF-8"?> -<svg enable-background="new 0 0 100 100" version="1.1" viewBox="0 0 93.665 93.676" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><rect x=".44662" y=".89101" width="92.772" height="91.894" ry="11.689" fill="#49a1ee" stroke="#fff" stroke-width=".238"/><switch transform="matrix(.69484 0 0 .69484 12.09 12.096)" fill="#fefeff" stroke="#105ca1" stroke-width="5.7567"><foreignObject width="1" height="1" requiredExtensions="http://ns.adobe.com/AdobeIllustrator/10.0/"/><g fill="#fefeff" stroke="#105ca1" stroke-width="5.7567"><g fill="#fefeff" stroke="#105ca1" stroke-width="5.7567"><path d="m43.3 91.8-18.3 5.5c-2.5 0.7-5.1-0.7-5.9-3.1-0.7-2.5 0.7-5.1 3.1-5.9l6.8-2c-12.4-7.3-20.8-20.8-20.8-36.3 0-17.3 10.6-32.2 25.6-38.6 3.1-1.3 6.6 1 6.6 4.3 0 1.9-1.1 3.6-2.8 4.3-11.8 5-20 16.5-20 30 0 12.2 6.8 22.9 16.8 28.4l-2.4-8.1c-0.7-2.5 0.7-5.1 3.1-5.9 2.5-0.7 5.1 0.7 5.9 3.1l5.5 18.3c0.7 2.6-0.7 5.2-3.2 6z"/><path d="m77.7 11.7-6.8 2c12.5 7.3 20.9 20.8 20.9 36.3 0 17.3-10.6 32.2-25.6 38.6-3.1 1.3-6.6-1-6.6-4.3 0-1.9 1.1-3.6 2.8-4.3 11.8-5 20-16.5 20-30 0-12.2-6.8-22.9-16.8-28.4l2.4 8.1c0.7 2.5-0.7 5.1-3.1 5.9-2.5 0.7-5.1-0.7-5.9-3.1l-5.5-18.3c-0.7-2.5 0.7-5.1 3.2-5.9l18.3-5.6c2.5-0.7 5.1 0.7 5.9 3.1 0.7 2.5-0.7 5.2-3.2 5.9z"/></g></g></switch></svg> +<svg enable-background="new 0 0 100 100" version="1.1" viewBox="0 0 93.665 93.676" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><rect x=".44662" y=".89101" width="92.772" height="91.894" ry="11.689" fill="#ee494c" stroke="#fff" stroke-width=".238"/><switch transform="matrix(.69484 0 0 .69484 12.09 12.096)" fill="#fffefe" stroke="#a11010" stroke-width="5.7567"><foreignObject width="1" height="1" requiredExtensions="http://ns.adobe.com/AdobeIllustrator/10.0/"/><g fill="#fffefe" stroke="#a11010" stroke-width="5.7567"><g fill="#fffefe" stroke="#a11010" stroke-width="5.7567"><path d="m43.3 91.8-18.3 5.5c-2.5 0.7-5.1-0.7-5.9-3.1-0.7-2.5 0.7-5.1 3.1-5.9l6.8-2c-12.4-7.3-20.8-20.8-20.8-36.3 0-17.3 10.6-32.2 25.6-38.6 3.1-1.3 6.6 1 6.6 4.3 0 1.9-1.1 3.6-2.8 4.3-11.8 5-20 16.5-20 30 0 12.2 6.8 22.9 16.8 28.4l-2.4-8.1c-0.7-2.5 0.7-5.1 3.1-5.9 2.5-0.7 5.1 0.7 5.9 3.1l5.5 18.3c0.7 2.6-0.7 5.2-3.2 6z"/><path d="m77.7 11.7-6.8 2c12.5 7.3 20.9 20.8 20.9 36.3 0 17.3-10.6 32.2-25.6 38.6-3.1 1.3-6.6-1-6.6-4.3 0-1.9 1.1-3.6 2.8-4.3 11.8-5 20-16.5 20-30 0-12.2-6.8-22.9-16.8-28.4l2.4 8.1c0.7 2.5-0.7 5.1-3.1 5.9-2.5 0.7-5.1-0.7-5.9-3.1l-5.5-18.3c-0.7-2.5 0.7-5.1 3.2-5.9l18.3-5.6c2.5-0.7 5.1 0.7 5.9 3.1 0.7 2.5-0.7 5.2-3.2 5.9z"/></g></g></switch></svg> diff --git a/lib/main.dart b/lib/main.dart index 75b66dec53ff27807ac716bfa2717d328bffcbad..e94e129be20160d27253c6c4d109cdf0aae87cf5 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -5,6 +5,7 @@ import 'dart:async'; import 'package:async/async.dart'; +import 'package:flutter/material.dart'; import 'package:flutter/services.dart' show SystemChrome, DeviceOrientation; import 'package:flutter/widgets.dart'; @@ -19,11 +20,7 @@ import 'thinking_indicator.dart'; void main() { WidgetsFlutterBinding.ensureInitialized(); - SystemChrome.setEnabledSystemUIOverlays([]); - SystemChrome.setPreferredOrientations([ - DeviceOrientation.portraitUp, - DeviceOrientation.portraitDown, - ]); + SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]); runApp(FlutterFlipApp()); } @@ -33,14 +30,14 @@ void main() { class FlutterFlipApp extends StatelessWidget { @override Widget build(BuildContext context) { - return WidgetsApp( - color: Color(0xffffffff), // Mandatory background color. - onGenerateRoute: (settings) { - return PageRouteBuilder<dynamic>( - settings: settings, - pageBuilder: (context, animation, secondaryAnimation) => GameScreen(), - ); - }, + + return MaterialApp( + debugShowCheckedModeBanner: false, + theme: ThemeData( + primaryColor: Colors.blue, + visualDensity: VisualDensity.adaptivePlatformDensity, + ), + home: GameScreen(), ); } } @@ -149,7 +146,7 @@ class _GameScreenState extends State<GameScreen> { return Container( padding: const EdgeInsets.symmetric( vertical: 3.0, - horizontal: 30.0, + horizontal: 25.0, ), decoration: (model.player == player) ? Styling.activePlayerIndicator @@ -157,8 +154,8 @@ class _GameScreenState extends State<GameScreen> { child: Row( children: <Widget>[ SizedBox( - width: 30.0, - height: 30.0, + width: 25.0, + height: 25.0, child: Image( image: AssetImage(assetImageName), fit: BoxFit.fill, @@ -171,7 +168,7 @@ class _GameScreenState extends State<GameScreen> { scoreText, textAlign: TextAlign.center, style: TextStyle( - fontSize: 50.0, + fontSize: 35.0, color: Color(0xff000000), ), ), @@ -282,6 +279,7 @@ class _GameScreenState extends State<GameScreen> { children: [ TableRow( children: [ + Column(children: [ decorationImage ]), Column(children: [ decorationImage ]), Column(children: [ GestureDetector( @@ -294,6 +292,7 @@ class _GameScreenState extends State<GameScreen> { ) ]), Column(children: [ decorationImage ]), + Column(children: [ decorationImage ]), ], ), ] @@ -303,20 +302,42 @@ class _GameScreenState extends State<GameScreen> { // Builds out the Widget tree using the most recent GameModel from the stream. Widget _buildWidgets(BuildContext context, GameModel model) { - return Container( - padding: EdgeInsets.only(top: 30.0, left: 15.0, right: 15.0), - decoration: Styling.mainWidgetDecoration, - child: SafeArea( - child: Column( - children: [ - _buildScoreBoxes(model), - SizedBox(height: 10), - _buildGameBoardDisplay(context, model), - SizedBox(height: 10), - _buildThinkingIndicator(model), - SizedBox(height: 30), - if (model.gameIsOver) _buildEndGameWidget(model), - ], + return Scaffold( + appBar: AppBar( + actions: [ + FlatButton( + child: Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(4), + border: Border.all( + color: Colors.blue, + width: 4, + ), + ), + margin: EdgeInsets.all(8), + child: Image( + image: AssetImage('assets/icons/button_restart.png'), + fit: BoxFit.fill + ), + ), + onPressed: () => _restartController.add(GameModel(board: GameBoard())), + ) + ], + ), + body: Container( + padding: EdgeInsets.only(top: 5.0, left: 5.0, right: 5.0), + decoration: Styling.mainWidgetDecoration, + child: SafeArea( + child: Column( + children: [ + _buildScoreBoxes(model), + SizedBox(height: 5), + _buildGameBoardDisplay(context, model), + SizedBox(height: 5), + _buildThinkingIndicator(model), + if (model.gameIsOver) _buildEndGameWidget(model), + ], + ), ), ), ); diff --git a/lib/thinking_indicator.dart b/lib/thinking_indicator.dart index ad3478099d4b49a83c57a4bd09b69e75a0ad6c4b..ed62cc34f25e12762e5f1fe41a3ef649519633af 100644 --- a/lib/thinking_indicator.dart +++ b/lib/thinking_indicator.dart @@ -41,8 +41,8 @@ class _ThinkingIndicatorState child: SizedBox( height: widget.height, child: Opacity( - opacity: _opacityTween!.evaluate(animation!), - child: _opacityTween!.evaluate(animation!) != 0 + opacity: _opacityTween!.evaluate(animation), + child: _opacityTween!.evaluate(animation) != 0 ? _AnimatedCircles( color: widget.color, height: widget.height,