mirror of
https://github.com/vodemn/m3_lightmeter.git
synced 2024-11-23 16:00:41 +00:00
integrated EV100 setting to UI
This commit is contained in:
parent
33f1a84910
commit
abd33ed963
10 changed files with 56 additions and 3 deletions
|
@ -34,6 +34,7 @@
|
||||||
"calibrationMessageCameraOnly": "The accuracy of the readings measured by this application depends entirely on the rear camera of the device. Therefore, consider testing this application and setting up an EV calibration value that will give you the desired measurement results.",
|
"calibrationMessageCameraOnly": "The accuracy of the readings measured by this application depends entirely on the rear camera of the device. Therefore, consider testing this application and setting up an EV calibration value that will give you the desired measurement results.",
|
||||||
"camera": "Camera",
|
"camera": "Camera",
|
||||||
"lightSensor": "Light sensor",
|
"lightSensor": "Light sensor",
|
||||||
|
"showEv100": "Show EV\u2081\u2080\u2080",
|
||||||
"meteringScreenLayout": "Metering screen layout",
|
"meteringScreenLayout": "Metering screen layout",
|
||||||
"meteringScreenLayoutHint": "Hide elements on the metering screen that you don't need so that they don't waste exposure pairs list space.",
|
"meteringScreenLayoutHint": "Hide elements on the metering screen that you don't need so that they don't waste exposure pairs list space.",
|
||||||
"meteringScreenLayoutHintEquipmentProfiles": "Equipment profile picker",
|
"meteringScreenLayoutHintEquipmentProfiles": "Equipment profile picker",
|
||||||
|
|
|
@ -34,6 +34,7 @@
|
||||||
"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.",
|
"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": "Caméra",
|
"camera": "Caméra",
|
||||||
"lightSensor": "Capteur de lumière",
|
"lightSensor": "Capteur de lumière",
|
||||||
|
"showEv100": "Montrer EV\u2081\u2080\u2080",
|
||||||
"meteringScreenLayout": "Disposition de l'écran de mesure",
|
"meteringScreenLayout": "Disposition de l'écran de mesure",
|
||||||
"meteringScreenLayoutHint": "Masquer les éléments sur l'écran de mesure dont vous n'avez pas besoin pour qu'ils ne gaspillent pas de l'espace dans les paires d'exposition.",
|
"meteringScreenLayoutHint": "Masquer les éléments sur l'écran de mesure dont vous n'avez pas besoin pour qu'ils ne gaspillent pas de l'espace dans les paires d'exposition.",
|
||||||
"meteringScreenLayoutHintEquipmentProfiles": "Sélecteur de profil de l'équipement",
|
"meteringScreenLayoutHintEquipmentProfiles": "Sélecteur de profil de l'équipement",
|
||||||
|
|
|
@ -34,6 +34,7 @@
|
||||||
"calibrationMessageCameraOnly": "Точность измерений данного приложения полностью зависит от точности камеры вашего устройства. Поэтому рекомендуется самостоятельно подобрать калибровочное значение, которое даст желаемый результат измерений.",
|
"calibrationMessageCameraOnly": "Точность измерений данного приложения полностью зависит от точности камеры вашего устройства. Поэтому рекомендуется самостоятельно подобрать калибровочное значение, которое даст желаемый результат измерений.",
|
||||||
"camera": "Камера",
|
"camera": "Камера",
|
||||||
"lightSensor": "Датчик освещённости",
|
"lightSensor": "Датчик освещённости",
|
||||||
|
"showEv100": "Показывать EV\u2081\u2080\u2080",
|
||||||
"meteringScreenLayout": "Элементы главного экрана",
|
"meteringScreenLayout": "Элементы главного экрана",
|
||||||
"meteringScreenLayoutHint": "Здесь вы можете скрыть некоторые ненужные или неиспользуемые элементы с главного экрана.",
|
"meteringScreenLayoutHint": "Здесь вы можете скрыть некоторые ненужные или неиспользуемые элементы с главного экрана.",
|
||||||
"meteringScreenLayoutHintEquipmentProfiles": "Выбор профиля оборудования",
|
"meteringScreenLayoutHintEquipmentProfiles": "Выбор профиля оборудования",
|
||||||
|
|
|
@ -34,6 +34,7 @@
|
||||||
"calibrationMessageCameraOnly": "此应用程序测量读数的准确s性完全取决于设备的后置摄像头。因此,请考虑测试此应用并手动设置 EV 校准,以获得准确的测量结果。",
|
"calibrationMessageCameraOnly": "此应用程序测量读数的准确s性完全取决于设备的后置摄像头。因此,请考虑测试此应用并手动设置 EV 校准,以获得准确的测量结果。",
|
||||||
"camera": "摄像头",
|
"camera": "摄像头",
|
||||||
"lightSensor": "光传感器",
|
"lightSensor": "光传感器",
|
||||||
|
"showEv100": "显示 EV\u2081\u2080\u2080",
|
||||||
"meteringScreenLayout": "布局",
|
"meteringScreenLayout": "布局",
|
||||||
"meteringScreenLayoutHint": "隐藏不需要的元素,以免浪费曝光列表空间",
|
"meteringScreenLayoutHint": "隐藏不需要的元素,以免浪费曝光列表空间",
|
||||||
"meteringScreenLayoutHintEquipmentProfiles": "设备配置选择",
|
"meteringScreenLayoutHintEquipmentProfiles": "设备配置选择",
|
||||||
|
|
|
@ -1,15 +1,20 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:lightmeter/generated/l10n.dart';
|
import 'package:lightmeter/generated/l10n.dart';
|
||||||
|
import 'package:lightmeter/providers/user_preferences_provider.dart';
|
||||||
import 'package:lightmeter/res/dimens.dart';
|
import 'package:lightmeter/res/dimens.dart';
|
||||||
import 'package:lightmeter/screens/shared/filled_circle/widget_circle_filled.dart';
|
import 'package:lightmeter/screens/shared/filled_circle/widget_circle_filled.dart';
|
||||||
|
|
||||||
|
const String _subscript100 = '\u2081\u2080\u2080';
|
||||||
|
|
||||||
class MeteringMeasureButton extends StatefulWidget {
|
class MeteringMeasureButton extends StatefulWidget {
|
||||||
final double? ev;
|
final double? ev;
|
||||||
|
final double? ev100;
|
||||||
final bool isMetering;
|
final bool isMetering;
|
||||||
final VoidCallback onTap;
|
final VoidCallback onTap;
|
||||||
|
|
||||||
const MeteringMeasureButton({
|
const MeteringMeasureButton({
|
||||||
required this.ev,
|
required this.ev,
|
||||||
|
required this.ev100,
|
||||||
required this.isMetering,
|
required this.isMetering,
|
||||||
required this.onTap,
|
required this.onTap,
|
||||||
super.key,
|
super.key,
|
||||||
|
@ -61,7 +66,7 @@ class _MeteringMeasureButtonState extends State<MeteringMeasureButton> {
|
||||||
color: Theme.of(context).colorScheme.onSurface,
|
color: Theme.of(context).colorScheme.onSurface,
|
||||||
size: Dimens.grid72 - Dimens.grid8,
|
size: Dimens.grid72 - Dimens.grid8,
|
||||||
child: Center(
|
child: Center(
|
||||||
child: widget.ev != null ? _EvValueText(ev: widget.ev!) : null,
|
child: widget.ev != null ? _EvValueText(ev: widget.ev!, ev100: widget.ev100!) : null,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -83,16 +88,32 @@ class _MeteringMeasureButtonState extends State<MeteringMeasureButton> {
|
||||||
|
|
||||||
class _EvValueText extends StatelessWidget {
|
class _EvValueText extends StatelessWidget {
|
||||||
final double ev;
|
final double ev;
|
||||||
|
final double ev100;
|
||||||
|
|
||||||
const _EvValueText({required this.ev});
|
const _EvValueText({
|
||||||
|
required this.ev,
|
||||||
|
required this.ev100,
|
||||||
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final theme = Theme.of(context);
|
final theme = Theme.of(context);
|
||||||
return Text(
|
return Text(
|
||||||
'${ev.toStringAsFixed(1)}\n${S.of(context).ev}',
|
_text(context),
|
||||||
style: theme.textTheme.bodyMedium?.copyWith(color: theme.colorScheme.surface),
|
style: theme.textTheme.bodyMedium?.copyWith(color: theme.colorScheme.surface),
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String _text(BuildContext context) {
|
||||||
|
final bool showEv100 = UserPreferencesProvider.showEv100Of(context);
|
||||||
|
final StringBuffer buffer = StringBuffer()
|
||||||
|
..writeAll([
|
||||||
|
(showEv100 ? ev100 : ev).toStringAsFixed(1),
|
||||||
|
'\n',
|
||||||
|
S.of(context).ev,
|
||||||
|
if (showEv100) _subscript100,
|
||||||
|
]);
|
||||||
|
return buffer.toString();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,7 @@ import 'package:lightmeter/screens/metering/components/bottom_controls/widget_bo
|
||||||
|
|
||||||
class MeteringBottomControlsProvider extends StatelessWidget {
|
class MeteringBottomControlsProvider extends StatelessWidget {
|
||||||
final double? ev;
|
final double? ev;
|
||||||
|
final double? ev100;
|
||||||
final bool isMetering;
|
final bool isMetering;
|
||||||
final VoidCallback? onSwitchEvSourceType;
|
final VoidCallback? onSwitchEvSourceType;
|
||||||
final VoidCallback onMeasure;
|
final VoidCallback onMeasure;
|
||||||
|
@ -12,6 +13,7 @@ class MeteringBottomControlsProvider extends StatelessWidget {
|
||||||
|
|
||||||
const MeteringBottomControlsProvider({
|
const MeteringBottomControlsProvider({
|
||||||
required this.ev,
|
required this.ev,
|
||||||
|
required this.ev100,
|
||||||
required this.isMetering,
|
required this.isMetering,
|
||||||
required this.onSwitchEvSourceType,
|
required this.onSwitchEvSourceType,
|
||||||
required this.onMeasure,
|
required this.onMeasure,
|
||||||
|
@ -35,6 +37,7 @@ class MeteringBottomControlsProvider extends StatelessWidget {
|
||||||
),
|
),
|
||||||
child: MeteringBottomControls(
|
child: MeteringBottomControls(
|
||||||
ev: ev,
|
ev: ev,
|
||||||
|
ev100: ev100,
|
||||||
isMetering: isMetering,
|
isMetering: isMetering,
|
||||||
onSwitchEvSourceType: onSwitchEvSourceType,
|
onSwitchEvSourceType: onSwitchEvSourceType,
|
||||||
onMeasure: onMeasure,
|
onMeasure: onMeasure,
|
||||||
|
|
|
@ -7,6 +7,7 @@ import 'package:lightmeter/screens/metering/components/bottom_controls/component
|
||||||
|
|
||||||
class MeteringBottomControls extends StatelessWidget {
|
class MeteringBottomControls extends StatelessWidget {
|
||||||
final double? ev;
|
final double? ev;
|
||||||
|
final double? ev100;
|
||||||
final bool isMetering;
|
final bool isMetering;
|
||||||
final VoidCallback? onSwitchEvSourceType;
|
final VoidCallback? onSwitchEvSourceType;
|
||||||
final VoidCallback onMeasure;
|
final VoidCallback onMeasure;
|
||||||
|
@ -14,6 +15,7 @@ class MeteringBottomControls extends StatelessWidget {
|
||||||
|
|
||||||
const MeteringBottomControls({
|
const MeteringBottomControls({
|
||||||
required this.ev,
|
required this.ev,
|
||||||
|
required this.ev100,
|
||||||
required this.isMetering,
|
required this.isMetering,
|
||||||
required this.onSwitchEvSourceType,
|
required this.onSwitchEvSourceType,
|
||||||
required this.onMeasure,
|
required this.onMeasure,
|
||||||
|
@ -58,6 +60,7 @@ class MeteringBottomControls extends StatelessWidget {
|
||||||
const Spacer(),
|
const Spacer(),
|
||||||
MeteringMeasureButton(
|
MeteringMeasureButton(
|
||||||
ev: ev,
|
ev: ev,
|
||||||
|
ev100: ev100,
|
||||||
isMetering: isMetering,
|
isMetering: isMetering,
|
||||||
onTap: onMeasure,
|
onTap: onMeasure,
|
||||||
),
|
),
|
||||||
|
|
|
@ -40,6 +40,7 @@ class MeteringScreen extends StatelessWidget {
|
||||||
BlocBuilder<MeteringBloc, MeteringState>(
|
BlocBuilder<MeteringBloc, MeteringState>(
|
||||||
builder: (context, state) => MeteringBottomControlsProvider(
|
builder: (context, state) => MeteringBottomControlsProvider(
|
||||||
ev: state is MeteringDataState ? state.ev : null,
|
ev: state is MeteringDataState ? state.ev : null,
|
||||||
|
ev100: state is MeteringDataState ? state.ev100 : null,
|
||||||
isMetering: state.isMetering,
|
isMetering: state.isMetering,
|
||||||
onSwitchEvSourceType: ServicesProvider.of(context).environment.hasLightSensor
|
onSwitchEvSourceType: ServicesProvider.of(context).environment.hasLightSensor
|
||||||
? UserPreferencesProvider.of(context).toggleEvSourceType
|
? UserPreferencesProvider.of(context).toggleEvSourceType
|
||||||
|
|
|
@ -0,0 +1,19 @@
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:lightmeter/generated/l10n.dart';
|
||||||
|
import 'package:lightmeter/providers/user_preferences_provider.dart';
|
||||||
|
import 'package:lightmeter/res/dimens.dart';
|
||||||
|
|
||||||
|
class ShowEv100ListTile extends StatelessWidget {
|
||||||
|
const ShowEv100ListTile({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return SwitchListTile(
|
||||||
|
secondary: const Icon(Icons.adjust),
|
||||||
|
title: Text(S.of(context).showEv100),
|
||||||
|
value: UserPreferencesProvider.showEv100Of(context),
|
||||||
|
onChanged: (_) => UserPreferencesProvider.of(context).toggleShowEV100(),
|
||||||
|
contentPadding: const EdgeInsets.symmetric(horizontal: Dimens.paddingM),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
|
@ -6,6 +6,7 @@ import 'package:lightmeter/screens/settings/components/metering/components/equip
|
||||||
import 'package:lightmeter/screens/settings/components/metering/components/films/widget_list_tile_films.dart';
|
import 'package:lightmeter/screens/settings/components/metering/components/films/widget_list_tile_films.dart';
|
||||||
import 'package:lightmeter/screens/settings/components/metering/components/fractional_stops/widget_list_tile_fractional_stops.dart';
|
import 'package:lightmeter/screens/settings/components/metering/components/fractional_stops/widget_list_tile_fractional_stops.dart';
|
||||||
import 'package:lightmeter/screens/settings/components/metering/components/metering_screen_layout/widget_list_tile_metering_screen_layout.dart';
|
import 'package:lightmeter/screens/settings/components/metering/components/metering_screen_layout/widget_list_tile_metering_screen_layout.dart';
|
||||||
|
import 'package:lightmeter/screens/settings/components/metering/components/show_ev_100/widget_list_tile_show_ev_100.dart';
|
||||||
import 'package:lightmeter/screens/settings/components/shared/settings_section/widget_settings_section.dart';
|
import 'package:lightmeter/screens/settings/components/shared/settings_section/widget_settings_section.dart';
|
||||||
|
|
||||||
class MeteringSettingsSection extends StatelessWidget {
|
class MeteringSettingsSection extends StatelessWidget {
|
||||||
|
@ -18,6 +19,7 @@ class MeteringSettingsSection extends StatelessWidget {
|
||||||
children: const [
|
children: const [
|
||||||
StopTypeListTile(),
|
StopTypeListTile(),
|
||||||
CalibrationListTile(),
|
CalibrationListTile(),
|
||||||
|
ShowEv100ListTile(),
|
||||||
MeteringScreenLayoutListTile(),
|
MeteringScreenLayoutListTile(),
|
||||||
EquipmentProfilesListTile(),
|
EquipmentProfilesListTile(),
|
||||||
FilmsListTile(),
|
FilmsListTile(),
|
||||||
|
|
Loading…
Reference in a new issue