Skip to content
This repository has been archived by the owner on Jan 6, 2025. It is now read-only.

13 improve picture capture #14

Merged
merged 5 commits into from
Mar 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,4 @@ jobs:
api-level: ${{ matrix.api-level }}
arch: x86_64
profile: Nexus 6
script: flutter test integration_test
script: flutter drive --driver=integration_test/driver.dart --target=integration_test/panoramax_test.dart
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ docker-compose up -d

### Redirect WSL port (Only for docker WSL)
```shell
netsh interface portproxy delete v4tov4 listenport=5000 listenaddress=0.0.0.0
netsh interface portproxy add v4tov4 listenport=5000 listenaddress=0.0.0.0 connectport=5000 connectaddress=<your-wsl-ip>
```
To retrieve <your-wsl-ip> execute the following command from your wsl machine :
Expand Down
8 changes: 1 addition & 7 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_MEDIA_LOCATION"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES"/>
<uses-permission android:name="android.permission.READ_MEDIA_VIDEO"/>
<uses-permission android:name="android.permission.CAMERA"/>
<application
android:label="panoramax_mobile"
android:name="${applicationName}"
Expand Down
21 changes: 21 additions & 0 deletions integration_test/driver.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import 'dart:io';
import 'package:integration_test/integration_test_driver.dart';

Future<void> main() async {
integrationDriver();
await addPermission('android.permission.ACCESS_FINE_LOCATION');
await addPermission('android.permission.CAMERA');
}

Future<void> addPermission(String permission) async {
await Process.run(
'adb',
[
'shell',
'pm',
'grant',
'com.example.panoramax_mobile',
permission
],
);
}
35 changes: 35 additions & 0 deletions lib/component/loader.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import 'package:flutter/material.dart';
import 'package:loading_animation_widget/loading_animation_widget.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import '../constant.dart';

class Loader extends StatelessWidget {
final bool shadowBackground;
final Widget message;

const Loader({
super.key,
this.shadowBackground = false,
required this.message
});

@override
Widget build(BuildContext context) {
return Container(
color: this.shadowBackground ?
Color.fromRGBO(0, 0, 0, 50) :
Colors.transparent
,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
LoadingAnimationWidget.staggeredDotsWave(
color: DEFAULT_COLOR,
size: 50,
),
message
],
)
);
}
}
5 changes: 5 additions & 0 deletions lib/constant.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import 'package:flutter/material.dart';

const MaterialColor DEFAULT_COLOR = Colors.indigo;
const String API_HOSTNAME = '10.0.2.2:5000';
const bool API_IS_HTTPS = false;
1 change: 1 addition & 0 deletions lib/l10n/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"capture": "Take a picture",
"switchCamera": "Switch camera",
"createSequenceWithPicture_tooltip": "Create a new sequence with captured pictures",
"waitDuringProcessing": "Processing, please wait...",

"newSequenceNameField": "Name",
"newSequenceNameField_placeholder": "Enter the new sequence name",
Expand Down
1 change: 1 addition & 0 deletions lib/l10n/app_fr.arb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"capture": "Prendre la une photo",
"switchCamera": "Changer de camera",
"createSequenceWithPicture_tooltip": "Créer une nouvelle séquence avec les photos prises",
"waitDuringProcessing": "Traitement en cours, veuillez patienter...",

"newSequenceNameField": "Nom",
"newSequenceNameField_placeholder": "Saisissez le nom de la nouvelle séquence",
Expand Down
6 changes: 4 additions & 2 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,17 @@ import 'package:go_router/go_router.dart';
import 'package:permission_handler/permission_handler.dart';
import 'package:carousel_slider/carousel_slider.dart';
import 'package:loading_btn/loading_btn.dart';

import 'component/loader.dart';
import 'service/api/api.dart';
import 'constant.dart';

part 'component/app_bar.dart';
part 'component/collection_preview.dart';
part 'page/homepage.dart';
part 'page/capture_page.dart';
part 'page/collection_creation_page.dart';
part 'service/routing.dart';
part 'service/permission_helper.dart';


final String DATE_FORMATTER = 'dd/MM/y HH:mm:ss';
Expand All @@ -42,7 +44,7 @@ class PanoramaxApp extends StatelessWidget {
return MaterialApp.router(
title: 'Panoramax',
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.indigo),
colorScheme: ColorScheme.fromSeed(seedColor: DEFAULT_COLOR),
useMaterial3: true,
),
localizationsDelegates: const [
Expand Down
Loading