Skip to content

Commit

Permalink
Merge branch 'main' into feature/36-document-validation
Browse files Browse the repository at this point in the history
# Conflicts:
#	lib/di.config.dart
#	lib/ui/screens/preview_document_screen.dart
  • Loading branch information
Matej-Hlatky committed Nov 17, 2024
2 parents caa7224 + e8b3fef commit a586e8b
Show file tree
Hide file tree
Showing 13 changed files with 201 additions and 70 deletions.
9 changes: 8 additions & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,10 @@ android {

signingConfigs {
release {
storeFile file(System.getenv("AVM_KEYSTORE_FILE"))
def keystorePath = System.getenv("AVM_KEYSTORE_FILE")
if (keystorePath != null) {
storeFile file(keystorePath)
}
storePassword System.getenv("AVM_KEYSTORE_PASSWORD")
keyAlias System.getenv("AVM_KEY_ALIAS")
keyPassword System.getenv("AVM_KEY_PASSWORD")
Expand All @@ -71,6 +74,10 @@ android {
signingConfig signingConfigs.release
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}

debug {
// no signing config for debug builds
}
}
ndkVersion "25.1.8937393"
}
Expand Down
1 change: 1 addition & 0 deletions devtools_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
extensions:
42 changes: 42 additions & 0 deletions lib/l10n/app_localizations.dart
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,48 @@ abstract class AppLocalizations {
/// **'Podpísať iným certifikátom'**
String get buttonSignWithDifferentCertificateLabel;

/// No description provided for @buttonMenuLabelSemantics.
///
/// In sk, this message translates to:
/// **'Otvoriť menu'**
String get buttonMenuLabelSemantics;

/// No description provided for @qrCodeScannerTorchOnSemantics.
///
/// In sk, this message translates to:
/// **'Zapnúť blesk'**
String get qrCodeScannerTorchOnSemantics;

/// No description provided for @qrCodeScannerTorchOffSemantics.
///
/// In sk, this message translates to:
/// **'Vypnúť blesk'**
String get qrCodeScannerTorchOffSemantics;

/// No description provided for @qrCodeScannerBackSemantics.
///
/// In sk, this message translates to:
/// **'Späť'**
String get qrCodeScannerBackSemantics;

/// No description provided for @qrCodeScannerOpenSemantics.
///
/// In sk, this message translates to:
/// **'Podpísať vzdialený dokument pomocou QR kódu'**
String get qrCodeScannerOpenSemantics;

/// No description provided for @shareDocumentPreviewSemantics.
///
/// In sk, this message translates to:
/// **'Zdieľať náhľad dokumentu'**
String get shareDocumentPreviewSemantics;

/// No description provided for @previewDocumentSemantics.
///
/// In sk, this message translates to:
/// **'Náhľad dokumentu'**
String get previewDocumentSemantics;

/// No description provided for @deepLinkParseErrorMessage.
///
/// In sk, this message translates to:
Expand Down
21 changes: 21 additions & 0 deletions lib/l10n/app_localizations_sk.dart
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,27 @@ class AppLocalizationsSk extends AppLocalizations {
@override
String get buttonSignWithDifferentCertificateLabel => 'Podpísať iným certifikátom';

@override
String get buttonMenuLabelSemantics => 'Otvoriť menu';

@override
String get qrCodeScannerTorchOnSemantics => 'Zapnúť blesk';

@override
String get qrCodeScannerTorchOffSemantics => 'Vypnúť blesk';

@override
String get qrCodeScannerBackSemantics => 'Späť';

@override
String get qrCodeScannerOpenSemantics => 'Podpísať vzdialený dokument pomocou QR kódu';

@override
String get shareDocumentPreviewSemantics => 'Zdieľať náhľad dokumentu';

@override
String get previewDocumentSemantics => 'Náhľad dokumentu';

@override
String deepLinkParseErrorMessage(Object error) {
return 'Nepodporovaný alebo nesprávny odkaz:\n$error';
Expand Down
7 changes: 7 additions & 0 deletions lib/l10n/app_sk.arb
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@
"buttonSelectCertificateLabel": "Vybrať certifikát",
"buttonSignWithCertificateLabel": "Podpísať ako {subject}",
"buttonSignWithDifferentCertificateLabel": "Podpísať iným certifikátom",
"buttonMenuLabelSemantics": "Otvoriť menu",
"qrCodeScannerTorchOnSemantics": "Zapnúť blesk",
"qrCodeScannerTorchOffSemantics": "Vypnúť blesk",
"qrCodeScannerBackSemantics": "Späť",
"qrCodeScannerOpenSemantics": "Podpísať vzdialený dokument pomocou QR kódu",
"shareDocumentPreviewSemantics": "Zdieľať náhľad dokumentu",
"previewDocumentSemantics": "Náhľad dokumentu",

"deepLinkParseErrorMessage": "Nepodporovaný alebo nesprávny odkaz:\n{error}",
"stepIndicatorText": "Krok {stepNumber} z {totalSteps}",
Expand Down
11 changes: 7 additions & 4 deletions lib/ui/screens/about_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,13 @@ class _Body extends StatelessWidget {

final child = Column(
children: [
Text(
strings.appName,
textAlign: TextAlign.center,
style: Theme.of(context).textTheme.headlineLarge,
Semantics(
header: true,
child: Text(
strings.appName,
textAlign: TextAlign.center,
style: Theme.of(context).textTheme.headlineLarge,
),
),
const SizedBox(height: 16),
const AppVersionText(),
Expand Down
28 changes: 17 additions & 11 deletions lib/ui/screens/main_menu_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,15 @@ class MainMenuScreen extends StatelessWidget {
const Spacer(flex: 1),
Padding(
padding: const EdgeInsets.only(bottom: 20),
child: Text(
strings.menuTitle,
style: const TextStyle(
fontSize: 20,
fontWeight: FontWeight.w700,
letterSpacing: 0.15,
child: Semantics(
header: true,
child: Text(
strings.menuTitle,
style: const TextStyle(
fontSize: 20,
fontWeight: FontWeight.w700,
letterSpacing: 0.15,
),
),
),
),
Expand Down Expand Up @@ -157,11 +160,14 @@ class _MenuItem extends StatelessWidget {

return Padding(
padding: const EdgeInsets.symmetric(vertical: 4),
child: InkWell(
onTap: onPressed,
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 8),
child: text,
child: Semantics(
button: true,
child: InkWell(
onTap: onPressed,
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 8),
child: text,
),
),
),
);
Expand Down
30 changes: 20 additions & 10 deletions lib/ui/screens/main_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -233,21 +233,31 @@ AppBar _MainAppBar({
return AppBar(
foregroundColor: kMainAppBarForegroundColor,
backgroundColor: kMainAppBarBackgroundColor,
leading: IconButton(
icon: SvgPicture.asset(
'assets/icons/menu.svg',
colorFilter: colorFilter,
leading: Semantics(
button: true,
excludeSemantics: true,
label: context.strings.buttonMenuLabelSemantics,
child: IconButton(
icon: SvgPicture.asset(
'assets/icons/menu.svg',
colorFilter: colorFilter,
),
onPressed: onMenuPressed,
),
onPressed: onMenuPressed,
),
actions: [
if (showQrCodeScannerIcon)
IconButton(
icon: SvgPicture.asset(
'assets/icons/qr_code_scanner.svg',
colorFilter: colorFilter,
Semantics(
label: context.strings.qrCodeScannerOpenSemantics,
button: true,
excludeSemantics: true,
child: IconButton(
icon: SvgPicture.asset(
'assets/icons/qr_code_scanner.svg',
colorFilter: colorFilter,
),
onPressed: onQrCodeScannerPressed,
),
onPressed: onQrCodeScannerPressed,
),
],
title: Builder(builder: (context) {
Expand Down
13 changes: 9 additions & 4 deletions lib/ui/screens/preview_document_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,15 @@ class PreviewDocumentScreen extends StatelessWidget {
title: Text(context.strings.previewDocumentTitle),
actions: [
if (file != null)
IconButton(
onPressed: () => _onShareRequested(context),
icon: const Icon(Icons.share_outlined),
color: Theme.of(context).colorScheme.primary,
Semantics(
label: context.strings.shareDocumentPreviewSemantics,
excludeSemantics: true,
button: true,
child: IconButton(
onPressed: () => _onShareRequested(context),
icon: const Icon(Icons.share_outlined),
color: Theme.of(context).colorScheme.primary,
),
),
],
),
Expand Down
36 changes: 26 additions & 10 deletions lib/ui/screens/qr_code_scanner_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,18 @@ class _QRCodeScannerScreenState extends State<QRCodeScannerScreen> {
padding: kScreenMargin.copyWith(
top: MediaQuery.of(context).padding.top,
),
child: SquareButton(
onPressed: () {
Navigator.maybePop(context);
},
child: Icon(
Icons.arrow_back,
color: Theme.of(context).colorScheme.onBackground,
child: Semantics(
label: context.strings.qrCodeScannerBackSemantics,
button: true,
excludeSemantics: true,
child: SquareButton(
onPressed: () {
Navigator.maybePop(context);
},
child: Icon(
Icons.arrow_back,
color: Theme.of(context).colorScheme.onBackground,
),
),
),
),
Expand Down Expand Up @@ -93,9 +98,20 @@ class _QRCodeScannerScreenState extends State<QRCodeScannerScreen> {
TorchState.on => Icons.flashlight_off,
};

return Icon(
icon,
color: Theme.of(context).colorScheme.onBackground,
final semanticsLabel = switch (torchState) {
TorchState.off =>
context.strings.qrCodeScannerTorchOnSemantics,
TorchState.on =>
context.strings.qrCodeScannerTorchOffSemantics,
};

return Semantics(
button: true,
label: semanticsLabel,
child: Icon(
icon,
color: Theme.of(context).colorScheme.onBackground,
),
);
},
),
Expand Down
17 changes: 10 additions & 7 deletions lib/ui/screens/settings_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -187,12 +187,15 @@ class _ValueListenableBoundTile<T> extends StatelessWidget {
builder: (context, value, _) {
final summary = summaryGetter(setting.value);

return PreferenceTile(
title: title,
summary: summary,
onPressed: () {
_onEditItemRequested(context, value);
},
return Semantics(
button: true,
child: PreferenceTile(
title: title,
summary: summary,
onPressed: () {
_onEditItemRequested(context, value);
},
),
);
},
);
Expand Down Expand Up @@ -238,7 +241,7 @@ class _ValueListenableBoundTile<T> extends StatelessWidget {
);

return AlertDialog(
title: Text(title),
title: Semantics(header: true, child: Text(title)),
content: content,
);
},
Expand Down
28 changes: 16 additions & 12 deletions lib/ui/widgets/option_picker.dart
Original file line number Diff line number Diff line change
Expand Up @@ -55,18 +55,22 @@ class OptionPicker<T> extends StatelessWidget {
),
);

return Material(
child: InkWell(
onTap: () {
onValueChanged(value);
},
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
radio,
const SizedBox(width: 8),
label,
],
return Semantics(
checked: value == selectedValue,
inMutuallyExclusiveGroup: true,
child: Material(
child: InkWell(
onTap: () {
onValueChanged(value);
},
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
ExcludeSemantics(child: radio),
const SizedBox(width: 8),
label,
],
),
),
),
);
Expand Down
28 changes: 17 additions & 11 deletions lib/ui/widgets/signature_type_picker.dart
Original file line number Diff line number Diff line change
Expand Up @@ -88,18 +88,24 @@ class _ListItem extends StatelessWidget {
);

// NOT using RadioListTile because need to scale-up and style Radio
return ListTile(
onTap: (canSelect ? onSelected : null),
enabled: enabled,
leading: Transform.scale(
scale: kRadioScale,
child: radio,
return Semantics(
checked: value == selectedValue,
inMutuallyExclusiveGroup: true,
excludeSemantics: true,
label: "$titleText, $subtitleText",
child: ListTile(
onTap: (canSelect ? onSelected : null),
enabled: enabled,
leading: Transform.scale(
scale: kRadioScale,
child: radio,
),
title: Text(
titleText,
style: const TextStyle(fontWeight: FontWeight.bold),
),
subtitle: Text(subtitleText),
),
title: Text(
titleText,
style: const TextStyle(fontWeight: FontWeight.bold),
),
subtitle: Text(subtitleText),
);
}
}
Expand Down

0 comments on commit a586e8b

Please sign in to comment.