Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • 70-improve-app-metadata
  • master
  • Release_0.0.28_28
  • Release_0.0.29_29
  • Release_0.0.30_30
  • Release_0.0.31_31
  • Release_0.0.32_32
  • Release_0.0.33_33
  • Release_0.0.34_34
  • Release_0.0.35_35
  • Release_0.0.36_36
  • Release_0.0.37_37
  • Release_0.0.38_38
  • Release_0.0.39_39
  • Release_0.0.40_40
  • Release_0.0.41_41
  • Release_0.0.42_42
  • Release_0.0.43_43
  • Release_0.0.44_44
  • Release_0.0.45_45
  • Release_0.0.46_46
  • Release_0.0.47_47
  • Release_0.0.48_48
  • Release_0.0.49_49
  • Release_0.0.50_50
  • Release_0.0.51_51
  • Release_0.0.52_52
  • Release_0.0.53_53
  • Release_0.0.54_54
  • Release_0.0.55_55
  • Release_0.0.56_56
  • Release_0.0.57_57
  • Release_0.0.58_58
  • Release_0.0.59_59
  • Release_0.0.60_60
  • Release_0.0.61_61
  • Release_0.1.0_62
  • Release_0.1.1_63
  • Release_0.2.0_64
  • Release_0.2.1_65
  • Release_0.3.0_66
  • Release_0.3.1_67
  • Release_0.4.0_68
  • Release_0.4.1_69
  • Release_0.4.2_70
  • Release_0.5.0_71
  • Release_0.6.0_72
  • Release_0.7.0_73
  • Release_0.8.0_74
  • Release_0.8.1_75
  • Release_0.8.2_76
  • Release_0.9.0_77
52 results

Target

Select target project
  • android/org.benoitharrault.puzzlegame
1 result
Select Git revision
  • 70-improve-app-metadata
  • master
  • Release_0.0.28_28
  • Release_0.0.29_29
  • Release_0.0.30_30
  • Release_0.0.31_31
  • Release_0.0.32_32
  • Release_0.0.33_33
  • Release_0.0.34_34
  • Release_0.0.35_35
  • Release_0.0.36_36
  • Release_0.0.37_37
  • Release_0.0.38_38
  • Release_0.0.39_39
  • Release_0.0.40_40
  • Release_0.0.41_41
  • Release_0.0.42_42
  • Release_0.0.43_43
  • Release_0.0.44_44
  • Release_0.0.45_45
  • Release_0.0.46_46
  • Release_0.0.47_47
  • Release_0.0.48_48
  • Release_0.0.49_49
  • Release_0.0.50_50
  • Release_0.0.51_51
  • Release_0.0.52_52
  • Release_0.0.53_53
  • Release_0.0.54_54
  • Release_0.0.55_55
  • Release_0.0.56_56
  • Release_0.0.57_57
  • Release_0.0.58_58
  • Release_0.0.59_59
  • Release_0.0.60_60
  • Release_0.0.61_61
  • Release_0.1.0_62
  • Release_0.1.1_63
  • Release_0.2.0_64
  • Release_0.2.1_65
  • Release_0.3.0_66
  • Release_0.3.1_67
  • Release_0.4.0_68
  • Release_0.4.1_69
  • Release_0.4.2_70
  • Release_0.5.0_71
  • Release_0.6.0_72
  • Release_0.7.0_73
  • Release_0.8.0_74
  • Release_0.8.1_75
  • Release_0.8.2_76
  • Release_0.9.0_77
52 results
Show changes
Showing
with 56 additions and 34 deletions
assets/images/personal_b87fcb24c5d44e1328cddd66b75bc119.png

240 KiB

assets/images/personal_b89b9d4366696fe1623b5b5d4f10f0fc.png

149 KiB

assets/images/personal_b961b8d3386fa525ac754eea04b32003.png

217 KiB

assets/images/personal_c0eb4eb4d39d58eecebc3218a56f6148.png

93.1 KiB

assets/images/personal_c132137e54f68136af709edd6a8f602d.png

192 KiB

assets/images/personal_d5f3483ee2a8598123a0d0a9a965aea0.png

214 KiB

assets/images/personal_e9da5393d39bebb0a5d393b4c55366a5.png

118 KiB

assets/images/personal_efc2a3bf7597c3991afa800c4515a515.png

220 KiB

assets/images/personal_f4059dfc787363cc3437be52a47779a0.png

138 KiB

assets/images/personal_fb47095d9556e3e7f00711afe128d5b2.png

156 KiB

assets/ui/tip-hidden.png

9.9 KiB

...@@ -5,7 +5,7 @@ import '../entities/tile.dart'; ...@@ -5,7 +5,7 @@ import '../entities/tile.dart';
class Data extends ChangeNotifier { class Data extends ChangeNotifier {
// application configuration // application configuration
int _tilesCount = 3; int _tilesCount = 4;
// application data // application data
List _images = []; List _images = [];
...@@ -14,6 +14,7 @@ class Data extends ChangeNotifier { ...@@ -14,6 +14,7 @@ class Data extends ChangeNotifier {
// application state // application state
bool _shuffling = false; bool _shuffling = false;
bool _displayTipImage = false;
String get image => _image; String get image => _image;
...@@ -50,6 +51,13 @@ class Data extends ChangeNotifier { ...@@ -50,6 +51,13 @@ class Data extends ChangeNotifier {
notifyListeners(); notifyListeners();
} }
bool get displayTipImage => _displayTipImage;
set updateDisplayTipImage(bool value) {
_displayTipImage = value;
notifyListeners();
}
void swapTiles(List<int> tile1, List<int> tile2) { void swapTiles(List<int> tile1, List<int> tile2) {
int indexTile1 = _tiles.indexWhere((tile) => ((tile.currentCol == tile1[0]) && (tile.currentRow == tile1[1]))); int indexTile1 = _tiles.indexWhere((tile) => ((tile.currentCol == tile1[0]) && (tile.currentRow == tile1[1])));
int indexTile2 = _tiles.indexWhere((tile) => ((tile.currentCol == tile2[0]) && (tile.currentRow == tile2[1]))); int indexTile2 = _tiles.indexWhere((tile) => ((tile.currentCol == tile2[0]) && (tile.currentRow == tile2[1])));
......
...@@ -14,9 +14,15 @@ class Home extends StatelessWidget { ...@@ -14,9 +14,15 @@ class Home extends StatelessWidget {
static const String id = 'home'; static const String id = 'home';
double _tipImageSize = 100; double _tipImageSize = 100;
int _selectImageColumnsCount = 2;
Future<void> resetGame(Data myProvider) async { Future<void> resetGame(Data myProvider) async {
myProvider.updateImage = ''; myProvider.updateImage = '';
myProvider.updateDisplayTipImage = false;
}
void toggleDisplayTipImage(Data myProvider) {
myProvider.updateDisplayTipImage = !myProvider.displayTipImage;
} }
String getImageAssetName(String imageCode) { String getImageAssetName(String imageCode) {
...@@ -51,10 +57,10 @@ class Home extends StatelessWidget { ...@@ -51,10 +57,10 @@ class Home extends StatelessWidget {
child: FlatButton( child: FlatButton(
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(4),
border: Border.all( border: Border.all(
color: Colors.blue[200], color: Colors.blue[200],
width: 8, width: 4,
), ),
), ),
margin: EdgeInsets.all(2), margin: EdgeInsets.all(2),
...@@ -77,26 +83,22 @@ class Home extends StatelessWidget { ...@@ -77,26 +83,22 @@ class Home extends StatelessWidget {
List images = myProvider.images; List images = myProvider.images;
return Container( return Container(
padding: EdgeInsets.all(5), padding: EdgeInsets.all(2),
child: ListView( child: ListView(
children: [ children: [
Table( Table(
defaultColumnWidth: IntrinsicColumnWidth(), defaultColumnWidth: IntrinsicColumnWidth(),
children: [ children: [
for (var imageIndex = 0; imageIndex < images.length; imageIndex+=2) for (var imageIndex = 0; imageIndex < images.length; imageIndex += _selectImageColumnsCount)
TableRow( TableRow(
children: [ children: [
Column( for (var columnIndex = 0; columnIndex < _selectImageColumnsCount; columnIndex++)
children: [ Column(
_buildImageSelectorItem(myProvider, images[imageIndex], size, tileImageSize) children: [
] if (imageIndex + columnIndex < images.length)
), _buildImageSelectorItem(myProvider, images[imageIndex + columnIndex], size, tileImageSize)
Column( ]
children: [ ),
if (imageIndex+1 < images.length)
_buildImageSelectorItem(myProvider, images[imageIndex+1], size, tileImageSize)
]
),
] ]
), ),
], ],
...@@ -233,21 +235,30 @@ class Home extends StatelessWidget { ...@@ -233,21 +235,30 @@ class Home extends StatelessWidget {
Container _buildTipWidget(Data myProvider) { Container _buildTipWidget(Data myProvider) {
return Container( return Container(
margin: EdgeInsets.all(4), child: FlatButton(
padding: EdgeInsets.all(4), child: Container(
decoration: BoxDecoration( margin: EdgeInsets.all(4),
color: Colors.blue, padding: EdgeInsets.all(4),
borderRadius: BorderRadius.circular(4), decoration: BoxDecoration(
border: Border.all( color: Colors.blue,
color: Colors.blue, borderRadius: BorderRadius.circular(4),
width: 4, border: Border.all(
color: Colors.blue,
width: 4,
),
),
child: Image(
image: AssetImage(
myProvider.displayTipImage
? getImageAssetName(myProvider.image)
: 'assets/ui/tip-hidden.png'
),
width: _tipImageSize,
height: _tipImageSize,
fit: BoxFit.fill
),
), ),
), onPressed: () => toggleDisplayTipImage(myProvider),
child: Image(
image: AssetImage(getImageAssetName(myProvider.image)),
width: _tipImageSize,
height: _tipImageSize,
fit: BoxFit.fill
), ),
); );
} }
...@@ -291,7 +302,7 @@ class Home extends StatelessWidget { ...@@ -291,7 +302,7 @@ class Home extends StatelessWidget {
var content; var content;
double _selectorImageSize = MediaQuery.of(context).size.width / 3; double _selectorImageSize = (MediaQuery.of(context).size.width - 140) / _selectImageColumnsCount;
double _tileImageSize = (MediaQuery.of(context).size.width - 70) / _myProvider.tilesCount; double _tileImageSize = (MediaQuery.of(context).size.width - 70) / _myProvider.tilesCount;
if (_myProvider.shuffling) { if (_myProvider.shuffling) {
......
...@@ -21,3 +21,4 @@ flutter: ...@@ -21,3 +21,4 @@ flutter:
assets: assets:
- assets/files/ - assets/files/
- assets/images/ - assets/images/
- assets/ui/
...@@ -10,8 +10,8 @@ IMAGES_RAW_FOLDER="${IMAGES_CACHE_FOLDER}/01_raw_images" ...@@ -10,8 +10,8 @@ IMAGES_RAW_FOLDER="${IMAGES_CACHE_FOLDER}/01_raw_images"
IMAGES_OPTIMIZED_FOLDER="${IMAGES_CACHE_FOLDER}/02_optimized_images" IMAGES_OPTIMIZED_FOLDER="${IMAGES_CACHE_FOLDER}/02_optimized_images"
RESIZE_OPTION="640x640" RESIZE_OPTION="640x640"
CROP_PARAMETERS="-auto-orient -trim +repage -gravity center -background white -extent ${RESIZE_OPTION}^" CROP_PARAMETERS="-auto-orient +repage -gravity center -background white -extent ${RESIZE_OPTION}^"
CONVERT_OPTIONS="-alpha off +dither -colors 256 -depth 4" CONVERT_OPTIONS="-alpha off -dither FloydSteinberg -colors 256 -depth 4"
OPTIPNG_OPTIONS="-preserve -quiet -o7" OPTIPNG_OPTIONS="-preserve -quiet -o7"
...@@ -26,8 +26,10 @@ IMAGES="$(find "${IMAGES_RAW_FOLDER}" -type f -name "*.??g" | sort)" ...@@ -26,8 +26,10 @@ IMAGES="$(find "${IMAGES_RAW_FOLDER}" -type f -name "*.??g" | sort)"
while read -r INPUT_FILE; do while read -r INPUT_FILE; do
if [[ -n "${INPUT_FILE}" ]]; then if [[ -n "${INPUT_FILE}" ]]; then
CATEGORY="$(basename "$(dirname "${INPUT_FILE}")")"
echo "CATEGORY: ${CATEGORY}"
HASH="$(echo "${INPUT_FILE%.*}" | md5sum | cut -c1-32)" HASH="$(echo "${INPUT_FILE%.*}" | md5sum | cut -c1-32)"
OUTPUT_FILE="${IMAGES_OPTIMIZED_FOLDER}/${HASH}.png" OUTPUT_FILE="${IMAGES_OPTIMIZED_FOLDER}/${CATEGORY}_${HASH}.png"
echo " OUTPUT_FILE: ${OUTPUT_FILE}" echo " OUTPUT_FILE: ${OUTPUT_FILE}"
if [[ -f "${OUTPUT_FILE}" ]]; then if [[ -f "${OUTPUT_FILE}" ]]; then
......