diff --git a/android/app/build.gradle b/android/app/build.gradle index 1246b72..ce5fbfa 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -49,7 +49,7 @@ android { defaultConfig { minSdkVersion 23 - targetSdkVersion 34 + targetSdkVersion 35 ndk { debugSymbolLevel 'FULL' abiFilters 'armeabi-v7a', 'arm64-v8a' diff --git a/iap/lib/src/data/equipment_profile_service.dart b/iap/lib/src/data/equipment_profile_service.dart index f6d8d4f..019f9a8 100644 --- a/iap/lib/src/data/equipment_profile_service.dart +++ b/iap/lib/src/data/equipment_profile_service.dart @@ -20,6 +20,7 @@ class EquipmentProfilesStorageService { List? apertureValues, List? shutterSpeedValues, double? lensZoom, + double? exposureOffset, bool? isUsed, }) async {} diff --git a/lib/l10n/intl_de.arb b/lib/l10n/intl_de.arb index 620c140..34f4039 100644 --- a/lib/l10n/intl_de.arb +++ b/lib/l10n/intl_de.arb @@ -69,6 +69,8 @@ "isoValuesFilterDescription": "Wähle die anzuzeigenden ISO Werte aus. (Beispielsweise die Meistverwendeten)", "lensZoom": "Objektiv-Zoom", "lensZoomDescription": "Wähle den Zoom, relativ zur Handykamera, dass mit dem Sucher der Kamera übereinstimmt.", + "exposureOffset": "Belichtungskorrektur", + "exposureOffsetDescription": "Stellen Sie die Belichtungskorrektur ein, um die genauesten Ergebnisse für die jeweilige Kamera zu erzielen.", "equipmentProfile": "Ausrüstungsprofil", "equipmentProfiles": "Ausrüstungsprofile", "tapToAdd": "Tippe zum Hinzufügen", @@ -170,11 +172,10 @@ "editPhotoTitle": "Foto bearbeiten", "date": "Datum", "ndFilter": "ND Filter", - "film": "Film", "note": "Notiz", "notSet": "Nicht gesetzt", "location": "Standort", "noMapsAppFound": "Keine Kartenanwendung gefunden.", "logbook": "Fototagebuch", "noPhotos": "Keine Fotos" -} \ No newline at end of file +} diff --git a/lib/l10n/intl_en.arb b/lib/l10n/intl_en.arb index d0c8974..0c6d47c 100644 --- a/lib/l10n/intl_en.arb +++ b/lib/l10n/intl_en.arb @@ -69,6 +69,8 @@ "isoValuesFilterDescription": "Select the ISO values to display. These may be your most commonly used values or those supported by your camera.", "lensZoom": "Lens zoom", "lensZoomDescription": "Set the zoom level relative to the phone's camera to match your camera's viewfinder.", + "exposureOffset": "Exposure offset", + "exposureOffsetDescription": "Set the exposure offset to get the most accurate results for the given camera.", "equipmentProfile": "Equipment profile", "equipmentProfiles": "Equipment profiles", "tapToAdd": "Tap to add", @@ -170,11 +172,10 @@ "editPhotoTitle": "Edit Photo", "date": "Date", "ndFilter": "ND Filter", - "film": "Film", "note": "Note", "notSet": "Not set", "location": "Location", "noMapsAppFound": "No maps application found.", "logbook": "Logbook", "noPhotos": "No photos" -} \ No newline at end of file +} diff --git a/lib/l10n/intl_fr.arb b/lib/l10n/intl_fr.arb index c195f3c..59dadd3 100644 --- a/lib/l10n/intl_fr.arb +++ b/lib/l10n/intl_fr.arb @@ -33,7 +33,7 @@ "calibration": "Calibration", "calibrationMessage": "La précision des lectures mesurées par cette application dépend entièrement du matériel de l'appareil. Par conséquent, envisagez de tester cette application et de configurer les valeurs d'étalonnage des EV qui vous donneront les résultats de mesure souhaités.", "calibrationMessageCameraOnly": "La précision des lectures mesurées par cette application dépend entièrement de la caméra arrière de l'appareil. Par conséquent, envisagez de tester cette application et de configurer une valeur d'étalonnage EV qui vous donnera les résultats de mesure souhaités.", - "camera": "Appareil photo", + "camera": "Caméra", "lightSensor": "Capteur de lumière", "showEv100": "Montrer EV\u2081\u2080\u2080", "meteringScreenLayout": "Disposition de l'écran de mesure", @@ -69,6 +69,8 @@ "isoValuesFilterDescription": "Sélectionnez les valeurs ISO à afficher. Ce sont peut-être vos valeurs les plus couramment utilisées ou celles prises en charge par votre caméra.", "lensZoom": "Zoom sur l'objectif", "lensZoomDescription": "Réglez le niveau de zoom par rapport à l'appareil photo du téléphone pour qu'il corresponde au viseur de votre appareil photo.", + "exposureOffset": "Décalage d’exposition", + "exposureOffsetDescription": "Définissez le décalage d’exposition pour obtenir les résultats les plus précis selon l’appareil photo.", "equipmentProfile": "Profil de l'équipement", "equipmentProfiles": "Profils de l'équipement", "tapToAdd": "Appuie pour ajouter", @@ -161,11 +163,10 @@ "editPhotoTitle": "Modifier la photo", "date": "Date", "ndFilter": "Filtre ND", - "film": "Film", "note": "Note", "notSet": "Non défini", "location": "Emplacement", "noMapsAppFound": "Aucune application de cartes trouvée.", "logbook": "Carnet photo", "noPhotos": "Aucune photo" -} \ No newline at end of file +} diff --git a/lib/l10n/intl_ru.arb b/lib/l10n/intl_ru.arb index 78a4bb6..a815bc2 100644 --- a/lib/l10n/intl_ru.arb +++ b/lib/l10n/intl_ru.arb @@ -69,6 +69,8 @@ "isoValuesFilterDescription": "Выберите значения ISO для отображения. Это может быть наиболее часто используемые значения или значения, поддерживаемые вашей камерой.", "lensZoom": "Зум объектива", "lensZoomDescription": "Установите уровень зума относительно камеры телефона, чтобы он соответствовал видоискателю вашей камеры.", + "exposureOffset": "Смещение экспозиции", + "exposureOffsetDescription": "Установите смещение экспозиции для получения наиболее точных результатов с данной камерой.", "equipmentProfile": "Оборудование", "equipmentProfiles": "Профили оборудования", "tapToAdd": "Нажмите, чтобы добавить", @@ -160,11 +162,10 @@ "editPhotoTitle": "Редактировать фото", "date": "Дата", "ndFilter": "ND фильтр", - "film": "Плёнка", "note": "Заметка", "notSet": "Не задано", "location": "Местоположение", "noMapsAppFound": "Приложение карт не найдено.", "logbook": "Фотожурнал", "noPhotos": "Нет фотографий" -} \ No newline at end of file +} diff --git a/lib/l10n/intl_zh.arb b/lib/l10n/intl_zh.arb index 0e395c8..ca4dc9d 100644 --- a/lib/l10n/intl_zh.arb +++ b/lib/l10n/intl_zh.arb @@ -69,6 +69,8 @@ "isoValuesFilterDescription": "选择要显示的 ISO 范围。", "lensZoom": "镜头变焦", "lensZoomDescription": "设置相对于手机摄像头的变焦焦距,使其与相机取景相匹配。", + "exposureOffset": "曝光补偿", + "exposureOffsetDescription": "设置曝光补偿,以获得针对所用相机的最准确结果。", "equipmentProfile": "设备配置", "equipmentProfiles": "设备配置", "tapToAdd": "点击添加", @@ -158,11 +160,10 @@ "editPhotoTitle": "编辑照片", "date": "日期", "ndFilter": "ND 滤镜", - "film": "胶片", "note": "备注", "notSet": "未设置", "location": "位置", "noMapsAppFound": "未找到地图应用程序。", "logbook": "拍照日志", "noPhotos": "没有照片" -} \ No newline at end of file +} diff --git a/lib/providers/equipment_profile_provider.dart b/lib/providers/equipment_profile_provider.dart index a4a569c..f0b51e4 100644 --- a/lib/providers/equipment_profile_provider.dart +++ b/lib/providers/equipment_profile_provider.dart @@ -73,13 +73,13 @@ class EquipmentProfilesProviderState extends State { final oldProfile = _customProfiles[profile.id]!.value; await widget.storageService.updateEquipmentProfile( id: profile.id, - name: oldProfile.name != profile.name ? profile.name : null, - apertureValues: oldProfile.apertureValues != profile.apertureValues ? profile.apertureValues : null, - shutterSpeedValues: - oldProfile.shutterSpeedValues != profile.shutterSpeedValues ? profile.shutterSpeedValues : null, - isoValues: oldProfile.isoValues != profile.isoValues ? profile.isoValues : null, - ndValues: oldProfile.ndValues != profile.ndValues ? profile.ndValues : null, - lensZoom: oldProfile.lensZoom != profile.lensZoom ? profile.lensZoom : null, + name: oldProfile.name.changedOrNull(profile.name), + apertureValues: oldProfile.apertureValues.changedOrNull(profile.apertureValues), + shutterSpeedValues: oldProfile.shutterSpeedValues.changedOrNull(profile.shutterSpeedValues), + isoValues: oldProfile.isoValues.changedOrNull(profile.isoValues), + ndValues: oldProfile.ndValues.changedOrNull(profile.ndValues), + lensZoom: oldProfile.lensZoom.changedOrNull(profile.lensZoom), + exposureOffset: oldProfile.exposureOffset.changedOrNull(profile.exposureOffset), ); _customProfiles[profile.id] = (value: profile, isUsed: _customProfiles[profile.id]!.isUsed); setState(() {}); @@ -183,3 +183,9 @@ class EquipmentProfiles extends InheritedModel<_EquipmentProfilesModelAspect> { const DeepCollectionEquality().equals(oldWidget.profiles, profiles)); } } + +extension on Object { + T? changedOrNull(T newValue) { + return this != newValue ? newValue : null; + } +} diff --git a/lib/screens/equipment_profile_edit/bloc_equipment_profile_edit.dart b/lib/screens/equipment_profile_edit/bloc_equipment_profile_edit.dart index 0627bee..6f60f81 100644 --- a/lib/screens/equipment_profile_edit/bloc_equipment_profile_edit.dart +++ b/lib/screens/equipment_profile_edit/bloc_equipment_profile_edit.dart @@ -42,6 +42,7 @@ class EquipmentProfileEditBloc extends Bloc _onExposureOffsetChanged(EquipmentProfileExposureOffsetChangedEvent event, Emitter emit) async { + _newEquipmentProfile = _newEquipmentProfile.copyWith(exposureOffset: event.exposureOffset); + emit( + state.copyWith( + exposureOffset: event.exposureOffset, + canSave: _canSave(state.name, event.exposureOffset), + ), + ); + } + Future _onSave(EquipmentProfileSaveEvent _, Emitter emit) async { emit(state.copyWith(isLoading: true)); if (_isEdit) { @@ -143,6 +156,7 @@ class EquipmentProfileEditBloc extends Bloc _ApertureValuesListTileBuilder(), _ShutterSpeedValuesListTileBuilder(), _LensZoomListTileBuilder(), + _ExposureOffsetListTileBuilder(), ], ), ), @@ -246,7 +249,7 @@ class _LensZoomListTileBuilder extends StatelessWidget { title: S.of(context).lensZoom, description: S.of(context).lensZoomDescription, value: state.lensZoom, - range: const RangeValues(1, 7), + range: CameraContainerBloc.zoomMaxRange, valueAdapter: (context, value) => value.toZoom(context), onChanged: (value) { context.read().add(EquipmentProfileLensZoomChangedEvent(value)); @@ -255,3 +258,24 @@ class _LensZoomListTileBuilder extends StatelessWidget { ); } } + +class _ExposureOffsetListTileBuilder extends StatelessWidget { + const _ExposureOffsetListTileBuilder(); + + @override + Widget build(BuildContext context) { + return BlocBuilder( + builder: (context, state) => SliderPickerListTile( + icon: Icons.light_mode_outlined, + title: S.of(context).exposureOffset, + description: S.of(context).exposureOffsetDescription, + value: state.exposureOffset, + range: CameraContainerBloc.exposureMaxRange, + valueAdapter: (context, value) => S.of(context).evValue(value.toStringSignedAsFixed(1)), + onChanged: (value) { + context.read().add(EquipmentProfileExposureOffsetChangedEvent(value)); + }, + ), + ); + } +} diff --git a/lib/screens/equipment_profile_edit/state_equipment_profile_edit.dart b/lib/screens/equipment_profile_edit/state_equipment_profile_edit.dart index 5002a84..4727fbd 100644 --- a/lib/screens/equipment_profile_edit/state_equipment_profile_edit.dart +++ b/lib/screens/equipment_profile_edit/state_equipment_profile_edit.dart @@ -7,6 +7,7 @@ class EquipmentProfileEditState { final List shutterSpeedValues; final List isoValues; final double lensZoom; + final double exposureOffset; final bool canSave; final bool isLoading; final EquipmentProfile? profileToCopy; @@ -18,6 +19,7 @@ class EquipmentProfileEditState { required this.shutterSpeedValues, required this.isoValues, required this.lensZoom, + required this.exposureOffset, required this.canSave, this.isLoading = false, this.profileToCopy, @@ -30,6 +32,7 @@ class EquipmentProfileEditState { List? shutterSpeedValues, List? isoValues, double? lensZoom, + double? exposureOffset, bool? canSave, bool? isLoading, EquipmentProfile? profileToCopy, @@ -41,6 +44,7 @@ class EquipmentProfileEditState { shutterSpeedValues: shutterSpeedValues ?? this.shutterSpeedValues, isoValues: isoValues ?? this.isoValues, lensZoom: lensZoom ?? this.lensZoom, + exposureOffset: exposureOffset ?? this.exposureOffset, canSave: canSave ?? this.canSave, isLoading: isLoading ?? this.isLoading, profileToCopy: profileToCopy ?? this.profileToCopy, diff --git a/lib/screens/metering/components/camera_container/bloc_container_camera.dart b/lib/screens/metering/components/camera_container/bloc_container_camera.dart index 7e8897d..39ce20d 100644 --- a/lib/screens/metering/components/camera_container/bloc_container_camera.dart +++ b/lib/screens/metering/components/camera_container/bloc_container_camera.dart @@ -29,11 +29,11 @@ class CameraContainerBloc extends EvSourceBlocBase _zoomRange!.end) { _currentZoom = _zoomRange!.start; diff --git a/lib/screens/metering/components/camera_container/components/camera_controls/components/zoom_slider/widget_slider_zoom.dart b/lib/screens/metering/components/camera_container/components/camera_controls/components/zoom_slider/widget_slider_zoom.dart index 96d3a68..dec2851 100644 --- a/lib/screens/metering/components/camera_container/components/camera_controls/components/zoom_slider/widget_slider_zoom.dart +++ b/lib/screens/metering/components/camera_container/components/camera_controls/components/zoom_slider/widget_slider_zoom.dart @@ -21,7 +21,7 @@ class ZoomSlider extends StatelessWidget { range: range, value: value, onChanged: onChanged, - icon: Icons.search_outlined, + icon: Icons.zoom_in_outlined, defaultValue: EquipmentProfiles.selectedOf(context).lensZoom, rulerValueAdapter: (value) => value.toStringAsFixed(0), valueAdapter: (value) => value.toZoom(context), diff --git a/pubspec.yaml b/pubspec.yaml index 8b6f49b..3fa98fb 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -33,11 +33,11 @@ dependencies: m3_lightmeter_iap: git: url: "https://github.com/vodemn/m3_lightmeter_iap" - ref: v2.1.3 + ref: v2.2.0 m3_lightmeter_resources: git: url: "https://github.com/vodemn/m3_lightmeter_resources" - ref: v2.1.0 + ref: v2.2.0 material_color_utilities: 0.12.0 package_info_plus: 8.1.3 permission_handler: 11.3.1 diff --git a/scripts/update_goldens.sh b/scripts/update_goldens.sh index 05d1ea6..73eeb3f 100644 --- a/scripts/update_goldens.sh +++ b/scripts/update_goldens.sh @@ -1,6 +1,6 @@ defaults -currentHost write -g AppleFontSmoothing -int 0 goldens=$(find ./test -name "*_golden_test.dart" -print) for f in $goldens; do - flutter test "$f" --dart-define cameraStubImage=assets/camera_stub_image.jpg --update-goldens + fvm flutter test "$f" --dart-define cameraStubImage=assets/camera_stub_image.jpg --update-goldens done defaults -currentHost write -g AppleFontSmoothing -int 3 diff --git a/test/screens/metering/goldens/metering_screen.png b/test/screens/metering/goldens/metering_screen.png index c08f2d4..af30a24 100644 Binary files a/test/screens/metering/goldens/metering_screen.png and b/test/screens/metering/goldens/metering_screen.png differ