Skip to content

Commit 47bb238

Browse files
authored
Merge pull request #227 from Piwigo/Redisgn-select-copy-move-modal
Redesign select copy move modal Add decorated box and move chevron to the start of the list
2 parents bb128cc + 5a23623 commit 47bb238

13 files changed

Lines changed: 230 additions & 243 deletions

.fvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"flutter": "3.32.8"
2+
"flutter": "3.35.5"
33
}

android/app/build.gradle.kts

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
12
import java.util.Properties
23
import java.io.FileInputStream
34

@@ -25,14 +26,23 @@ android {
2526
//compileSdkVersion flutter.compileSdkVersion
2627
//ndkVersion = flutter.ndkVersion
2728
compileSdk = 36
28-
ndkVersion = "29.0.13599879"
29+
ndkVersion = "29.0.14206865 "
30+
31+
val compileJavaVersion = JavaVersion.VERSION_17
32+
val kotlinJvmTarget = JvmTarget.JVM_17
2933

3034
compileOptions {
3135
// Flag to enable support for the new language APIs
3236
isCoreLibraryDesugaringEnabled = true
3337
// Sets Java compatibility to Java 17
34-
sourceCompatibility = JavaVersion.VERSION_17
35-
targetCompatibility = JavaVersion.VERSION_17
38+
sourceCompatibility = compileJavaVersion
39+
targetCompatibility = compileJavaVersion
40+
}
41+
42+
kotlin {
43+
compilerOptions {
44+
jvmTarget = kotlinJvmTarget
45+
}
3646
}
3747

3848
defaultConfig {
@@ -65,6 +75,6 @@ flutter {
6575
}
6676

6777
dependencies {
68-
implementation("androidx.window:window:1.4.0")
78+
implementation("androidx.window:window:1.5.0")
6979
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.1.5")
7080
}

android/build.gradle.kts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ allprojects {
55
}
66
}
77

8-
val newBuildDir: Directory = rootProject.layout.buildDirectory.dir("../../build").get()
8+
val newBuildDir: Directory = rootProject.layout.buildDirectory
9+
.dir("../../build")
10+
.get()
911
rootProject.layout.buildDirectory.value(newBuildDir)
1012

1113
subprojects {

android/gradle.properties

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@
1111
# https://developer.android.com/r/tools/gradle-multi-project-decoupled-projects
1212
# org.gradle.parallel=true
1313
#Tue Apr 22 14:46:56 CEST 2025
14-
android.enableJetifier=true
15-
android.jetifier.ignorelist=bcprov-jdk15on
1614
android.nonFinalResIds=false
1715
android.nonTransitiveRClass=false
1816
android.useAndroidX=true
19-
org.gradle.jvmargs=-Xmx2048M -Dkotlin.daemon.jvm.options\="-Xmx2048M"
17+
org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError

android/settings.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ pluginManagement {
1919
plugins {
2020
id("org.gradle.toolchains.foojay-resolver-convention") version "1.0.0"
2121
id("dev.flutter.flutter-plugin-loader") version "1.0.0"
22-
id("com.android.application") version "8.12.1" apply false
23-
id("org.jetbrains.kotlin.android") version "2.2.0" apply false
22+
id("com.android.application") version "8.13.0" apply false
23+
id("org.jetbrains.kotlin.android") version "2.2.20" apply false
2424
}
2525

2626
include(":app")

docs/CONTRIBUTING.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,13 @@ flutter config --no-analytics
1818

1919
Using [fvm](https://fvm.app/) :
2020
```sh
21-
fvm install 2.27.4
21+
fvm install 3.27.4
2222
cd <Project-dir>
23-
fvm use 2.27.4
23+
fvm use 3.27.4
2424
```
2525

2626
### Android Studio
2727

28-
*(Optional - enable wayland support)* : Add `-Dawt.toolkit.name=WLToolkit` to the Custom VM Options.
29-
3028
Install the flutter plugin and restart, then go to **Settings > Languages & Framework > Android SDK > SDK Tools** and install the following :
3129

3230
- Android SDK Build-Tools
@@ -48,6 +46,13 @@ If Android studio doesn't pickup the path of the flutter toolchain or dart :
4846
In **Settings > Languages & Framework > Flutter** set the flutter SDK path using the absolute path of your install.
4947
And in **Settings > Languages & Framework > Dart** specify the Dark SDK path `<Absolute-Flutter-Path>/bin/cache/dart-sdk`
5048

49+
## Debugging
50+
51+
By default running the app via Android Studio or `flutter run` will use the debug APK (located in `build/app/outputs/flutter-apk/app-debug.apk`).
52+
Background tasks are done with [workmanager](https://docs.page/fluttercommunity/flutter_workmanager) debugging must be enabled via the kotlin flag `WorkmanagerDebug.setCurrent(LoggingDebugHandler())`
53+
54+
See more info in https://docs.page/fluttercommunity/flutter_workmanager/debugging
55+
5156
## Contributing guidelines
5257

5358
Contribution must target the `develop` branch and must have documented changes.
@@ -56,6 +61,4 @@ if you are fixing an existing issue or bug, tag it in your merge request (exampl
5661

5762
if you are doing maintenance work, be sure to add the changelog of the libraries you are updating.
5863

59-
Translation are done via [crowdin](https://crowdin.com/project/piwigo-ng)
60-
61-
64+
Translation are done via [crowdin](https://crowdin.com/project/piwigo-ng)

l10n.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
synthetic-package: false
21
arb-dir: l10n
32
template-arb-file: app_en.arb
43
untranslated-messages-file: l10n/untranslated.json

lib/components/modals/select_move_or_copy_modal.dart

Lines changed: 56 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import 'package:piwigo_ng/models/album_model.dart';
44
import 'package:piwigo_ng/network/albums.dart';
55
import 'package:piwigo_ng/network/api_error.dart';
66
import 'package:piwigo_ng/utils/localizations.dart';
7+
import 'package:piwigo_ng/utils/resources.dart';
78

89
class SelectMoveOrCopyModal extends StatefulWidget {
910
const SelectMoveOrCopyModal({
@@ -38,7 +39,8 @@ class _SelectMoveOrCopyModalState extends State<SelectMoveOrCopyModal> {
3839
_disabledAlbums = [
3940
if (widget.album != null) widget.album!.id,
4041
if (parentAlbums.length == 1 || widget.isImage) 0,
41-
if (!widget.isImage && parentAlbums.length > 1) int.parse(parentAlbums[parentAlbums.length - 2]),
42+
if (!widget.isImage && parentAlbums.length > 1)
43+
int.parse(parentAlbums[parentAlbums.length - 2]),
4244
];
4345

4446
super.initState();
@@ -199,55 +201,64 @@ class _ExpansionAlbumTileState extends State<ExpansionAlbumTile> {
199201
widget.onTap?.call(widget.album);
200202
},
201203
child: SizedBox(
202-
height: 48.0,
203-
child: Row(
204-
crossAxisAlignment: CrossAxisAlignment.stretch,
205-
children: [
206-
Expanded(
207-
child: Padding(
208-
padding: const EdgeInsets.symmetric(horizontal: 16.0),
209-
child: Align(
210-
alignment: Alignment.centerLeft,
204+
height: 48.0,
205+
child: Row(
206+
spacing: 2,
207+
children: [
208+
Padding(padding: EdgeInsetsGeometry.only(left: 10.0)),
209+
if (widget.index > 1) ...[
210+
Padding(
211+
padding: EdgeInsetsGeometry.only(
212+
left: 30.0 * (widget.index - 1)))
213+
],
214+
if (widget.album.children.isNotEmpty && !widget.isParent) ...[
215+
GestureDetector(
216+
behavior: HitTestBehavior.opaque,
217+
onTap: () => setState(() {
218+
_expanded = !_expanded;
219+
}),
220+
child: AnimatedRotation(
221+
turns: _expanded ? 0.25 : 0, //Rotate by 90°,
222+
duration: const Duration(milliseconds: 200),
223+
child: Icon(Icons.chevron_right),
224+
)),
225+
],
226+
Expanded(
211227
child: Text(
212-
"${List.generate(widget.index, (index) => ' ').join()} > ${widget.index > 0 ? ' ' : ''}${widget.album.name}",
213-
overflow: TextOverflow.ellipsis,
214-
style: _disabled ? Theme.of(context).textTheme.bodySmall : Theme.of(context).textTheme.bodyMedium,
215-
),
216-
),
217-
),
218-
),
219-
if (widget.album.children.isNotEmpty && !widget.isParent)
220-
GestureDetector(
221-
behavior: HitTestBehavior.opaque,
222-
onTap: () => setState(() {
223-
_expanded = !_expanded;
224-
}),
225-
child: Padding(
226-
padding: const EdgeInsets.symmetric(horizontal: 8.0),
227-
child: Row(
228-
crossAxisAlignment: CrossAxisAlignment.stretch,
229-
children: [
230-
Center(
231-
child: Text(
232-
appStrings.albumCount(widget.album.nbCategories),
228+
"${widget.album.name}",
229+
overflow: TextOverflow.ellipsis,
230+
style: _disabled
231+
? Theme.of(context).textTheme.bodySmall
232+
: Theme.of(context).textTheme.bodyMedium,
233+
)),
234+
if (widget.album.children.isNotEmpty && !widget.isParent) ...[
235+
DecoratedBox(
236+
decoration: BoxDecoration(
237+
color: Theme.of(context).colorScheme.surface,
238+
borderRadius: BorderRadius.circular(5)),
239+
child: Padding(
240+
padding: EdgeInsetsGeometry.symmetric(
241+
horizontal: 8,
242+
),
243+
child: Row(spacing: 4, children: [
244+
Text(
245+
'${widget.album.nbCategories}',
233246
style: TextStyle(
234-
color: Theme.of(context).primaryColor.withValues(alpha: 0.7),
247+
color: Theme.of(context).colorScheme.inverseSurface,
235248
fontSize: 14,
236249
),
237250
),
238-
),
239-
AnimatedRotation(
240-
duration: const Duration(milliseconds: 200),
241-
turns: _expanded ? -0.25 : 0.25,
242-
child: Icon(Icons.chevron_right),
243-
),
244-
],
245-
),
246-
),
247-
),
248-
],
249-
),
250-
),
251+
Icon(
252+
Icons.folder,
253+
size: 15,
254+
color: Theme.of(context).colorScheme.inverseSurface,
255+
),
256+
]),
257+
)),
258+
Padding(padding: EdgeInsetsGeometry.only(right: 8))
259+
],
260+
],
261+
)),
251262
);
252263

253264
Widget get _divider => Divider(

lib/services/auto_upload_manager.dart

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import 'package:dio/dio.dart';
77
import 'package:dio_cookie_manager/dio_cookie_manager.dart';
88
import 'package:flutter/foundation.dart';
99
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
10-
import 'package:heif_converter/heif_converter.dart';
1110
import 'package:piwigo_ng/models/album_model.dart';
1211
import 'package:piwigo_ng/models/status_model.dart';
1312
import 'package:piwigo_ng/network/api_client.dart';
@@ -91,17 +90,6 @@ class AutoUploadManager {
9190
// Remove folders and links
9291
List<File> files = dirFiles.where((file) => file is File).map<File>((e) => e as File).toList();
9392

94-
// Convert heic/heif files to .jpg
95-
for (File file in files) {
96-
if (file.path.endsWith('.heic') || file.path.endsWith('.heif')) {
97-
debugPrint("${file.path} is Heic/Heif ! Converting to jpg... ");
98-
String? jpgPath = await HeifConverter.convert(file.path, format: 'jpg');
99-
if (jpgPath != null) {
100-
files.remove(file);
101-
files.add(File(jpgPath));
102-
}
103-
}
104-
}
10593
debugPrint("List files: ${files.toString()}");
10694
await autoUploadPhotos(files);
10795
return true;
@@ -462,8 +450,5 @@ void callbackDispatcher() {
462450
}
463451

464452
void initializeWorkManager() {
465-
Workmanager().initialize(
466-
callbackDispatcher, // The top level function, aka callbackDispatcher
467-
isInDebugMode: kDebugMode,
468-
);
453+
Workmanager().initialize(callbackDispatcher); // The top level function, aka callbackDispatcher
469454
}

lib/utils/image_actions.dart

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import 'dart:io';
22

33
import 'package:flutter/material.dart';
44
import 'package:flutter_image_compress/flutter_image_compress.dart';
5-
import 'package:heif_converter/heif_converter.dart';
65
import 'package:image_picker/image_picker.dart';
76
import 'package:path_provider/path_provider.dart';
87
import 'package:piwigo_ng/components/dialogs/confirm_dialog.dart';
@@ -71,11 +70,6 @@ Future<List<XFile>?> onPickImages() async {
7170
if (Preferences.getAvailableFileTypes
7271
.contains(file.name.split('.').last)) {
7372
files.add(file);
74-
} else if (file.name.endsWith('.heic') || file.name.endsWith('.heif')) {
75-
String? jpgPath = await HeifConverter.convert(file.path, format: 'jpg');
76-
if (jpgPath != null) {
77-
files.add(XFile(jpgPath));
78-
}
7973
}
8074
}
8175
return files;
@@ -100,12 +94,6 @@ Future<XFile?> onTakePhoto(BuildContext context) async {
10094
imageQuality: (Preferences.getUploadQuality * 100).round(),
10195
requestFullMetadata: !Preferences.getRemoveMetadata,
10296
);
103-
if (image != null) {
104-
String? jpgPath = await HeifConverter.convert(image.path, format: 'jpg');
105-
if (jpgPath != null) {
106-
image = XFile(jpgPath);
107-
}
108-
}
10997
break;
11098
case 1:
11199
image = await _picker.pickVideo(source: ImageSource.camera);

0 commit comments

Comments
 (0)