mirror of
https://github.com/vodemn/m3_lightmeter.git
synced 2024-12-04 21:30:39 +00:00
Compare commits
No commits in common. "36d7e081f1239c5a52481ebd4d5a5be77ba35cd4" and "f62f658be8462830f98826d45058cb4c1a4353d1" have entirely different histories.
36d7e081f1
...
f62f658be8
13 changed files with 46 additions and 177 deletions
40
.github/workflows/create_release.yml
vendored
40
.github/workflows/create_release.yml
vendored
|
@ -18,6 +18,10 @@ on:
|
|||
description: "Version"
|
||||
required: true
|
||||
type: string
|
||||
release-notes:
|
||||
description: "Release notes"
|
||||
required: true
|
||||
type: string
|
||||
run-integration-tests:
|
||||
description: "Run integration tests"
|
||||
required: true
|
||||
|
@ -56,9 +60,25 @@ jobs:
|
|||
stage-backend: false
|
||||
version: ${{ inputs.version }}
|
||||
|
||||
generate-release-notes:
|
||||
name: Generate release notes
|
||||
needs: [build-android, build-ios]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Generate release notes
|
||||
run: |
|
||||
echo ${{ inputs.release-notes }} > whatsnew-en-US.md
|
||||
perl -i -pe 's/\s{1}(-{1})/\n$1/g' whatsnew-en-US.md
|
||||
|
||||
- name: Upload merged_native_libs.zip to artifacts
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: whatsnew-en-US
|
||||
path: whatsnew-en-US.md
|
||||
|
||||
create-github-release:
|
||||
name: Create Github release
|
||||
needs: [build-android, build-ios]
|
||||
needs: [generate-release-notes]
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
|
@ -92,16 +112,21 @@ jobs:
|
|||
- name: Rename apk
|
||||
run: mv app-prod-release.apk m3_lightmeter.apk
|
||||
|
||||
- name: Download release notes
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: whatsnew-en-US
|
||||
|
||||
- uses: ncipollo/release-action@v1.12.0
|
||||
with:
|
||||
artifacts: "m3_lightmeter.apk"
|
||||
skipIfReleaseExists: true
|
||||
tag: "v${{ github.event.inputs.version }}"
|
||||
bodyFile: "assets/release_notes/release_notes_en_${{ inputs.version }}.md"
|
||||
bodyFile: "whatsnew-en-US.md"
|
||||
|
||||
create-google-play-release:
|
||||
name: Create Google Play release
|
||||
needs: [build-android, build-ios]
|
||||
needs: [generate-release-notes]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
@ -118,9 +143,14 @@ jobs:
|
|||
unzip app-prod-release.aab
|
||||
(cd base/lib && zip -r "$OLDPWD/merged_native_libs.zip" .)
|
||||
|
||||
- name: Download release notes
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: whatsnew-en-US
|
||||
|
||||
- name: Move release notes to a folder
|
||||
run: |
|
||||
mv assets/release_notes/release_notes_en_${{ inputs.version }}.md whatsnew-en-US
|
||||
mv whatsnew-en-US.md whatsnew-en-US
|
||||
mkdir whatsnew
|
||||
mv whatsnew-en-US whatsnew
|
||||
|
||||
|
@ -147,7 +177,7 @@ jobs:
|
|||
|
||||
upload-to-app-store:
|
||||
name: Upload to App Store
|
||||
needs: [build-android, build-ios]
|
||||
needs: [generate-release-notes]
|
||||
runs-on: macos-13
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
|
|
@ -24,8 +24,8 @@ Without further delay behold my new Lightmeter app inspired by Material You (a.k
|
|||
|
||||
<p float="center">
|
||||
<img src="screenshots/generated/android/android/light_metering-reflected.png" width="18.8%" />
|
||||
<img src="screenshots/generated/android/android/light_timer.png" width="18.8%" />
|
||||
<img src="screenshots/generated/android/android/light_settings.png" width="18.8%" />
|
||||
<img src="screenshots/generated/android/android/light_timer.png" width="18.8%" />
|
||||
<img src="screenshots/generated/android/android/light_equipment-profiles.png" width="18.8%" />
|
||||
<img src="screenshots/generated/android/android/dark_metering-reflected.png" width="18.8%" />
|
||||
</p>
|
||||
|
|
|
@ -1,4 +0,0 @@
|
|||
- [Pro] Added a timer for shooting long exposures without leaving the app, just tap the necessary shutter speed in the list.
|
||||
- Long exposure values are no longer limited by 1" and are generated to match the list of aperture values.
|
||||
- Refined the app's color palette & unified icons across the app.
|
||||
- Added release notes dialog.
|
|
@ -1,4 +0,0 @@
|
|||
- [Pro] Добавлен таймер для удобства съёмки при длительных выдержках. Достаточно просто нажать на нужное значение в списке экспозиционных пар.
|
||||
- Длинные выдержки больше не ограничены 1" и генерируются в соответствии со значениями диафрагмы.
|
||||
- Переработана цветовая палитра приложения и унифицированы иконки.
|
||||
- Добавлен список изменений.
|
|
@ -7,7 +7,6 @@ import 'package:lightmeter/platform_config.dart';
|
|||
import 'package:lightmeter/providers/user_preferences_provider.dart';
|
||||
import 'package:lightmeter/screens/metering/flow_metering.dart';
|
||||
import 'package:lightmeter/screens/settings/flow_settings.dart';
|
||||
import 'package:lightmeter/screens/shared/release_notes_dialog/flow_dialog_release_notes.dart';
|
||||
import 'package:lightmeter/screens/timer/flow_timer.dart';
|
||||
|
||||
class Application extends StatelessWidget {
|
||||
|
@ -42,7 +41,7 @@ class Application extends StatelessWidget {
|
|||
),
|
||||
initialRoute: "metering",
|
||||
routes: {
|
||||
"metering": (_) => const ReleaseNotesFlow(child: MeteringFlow()),
|
||||
"metering": (_) => const MeteringFlow(),
|
||||
"settings": (_) => const SettingsFlow(),
|
||||
"timer": (context) => TimerFlow(args: ModalRoute.of(context)!.settings.arguments! as TimerFlowArgs),
|
||||
},
|
||||
|
|
|
@ -32,8 +32,6 @@ class UserPreferencesService {
|
|||
static const primaryColorKey = "primaryColor";
|
||||
static const dynamicColorKey = "dynamicColor";
|
||||
|
||||
static const seenChangelogVersionKey = "seenChangelogVersion";
|
||||
|
||||
final SharedPreferences _sharedPreferences;
|
||||
|
||||
UserPreferencesService(this._sharedPreferences) {
|
||||
|
@ -159,7 +157,4 @@ class UserPreferencesService {
|
|||
|
||||
bool get dynamicColor => _sharedPreferences.getBool(dynamicColorKey) ?? false;
|
||||
set dynamicColor(bool value) => _sharedPreferences.setBool(dynamicColorKey, value);
|
||||
|
||||
String get seenChangelogVersion => _sharedPreferences.getString(seenChangelogVersionKey) ?? '';
|
||||
set seenChangelogVersion(String value) => _sharedPreferences.setString(seenChangelogVersionKey, value);
|
||||
}
|
||||
|
|
|
@ -119,15 +119,5 @@
|
|||
"tooltipUseLightSensor": "Use lightsensor",
|
||||
"tooltipUseCamera": "Use camera",
|
||||
"tooltipOpenSettings": "Open settings",
|
||||
"exposurePair": "Exposure pair",
|
||||
"whatsnew": "What's new?",
|
||||
"changesInVersion": "Changes in version {version}:",
|
||||
"@changesInVersion": {
|
||||
"placeholders": {
|
||||
"version": {
|
||||
"type": "String"
|
||||
}
|
||||
}
|
||||
},
|
||||
"close": "Close"
|
||||
"exposurePair": "Exposure pair"
|
||||
}
|
|
@ -1,6 +1,5 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:lightmeter/generated/l10n.dart';
|
||||
import 'package:lightmeter/screens/shared/release_notes_dialog/widget_dialog_release_notes.dart';
|
||||
import 'package:package_info_plus/package_info_plus.dart';
|
||||
|
||||
class VersionListTile extends StatelessWidget {
|
||||
|
@ -8,18 +7,14 @@ class VersionListTile extends StatelessWidget {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return FutureBuilder<PackageInfo>(
|
||||
future: PackageInfo.fromPlatform(),
|
||||
builder: (context, snapshot) => ListTile(
|
||||
leading: const Icon(Icons.info_outline),
|
||||
title: Text(S.of(context).version),
|
||||
onTap: snapshot.data != null
|
||||
? () => showDialog(
|
||||
context: context,
|
||||
builder: (_) => ReleaseNotesDialog(version: snapshot.data!.version),
|
||||
)
|
||||
: null,
|
||||
trailing: Text(S.of(context).versionNumber(snapshot.data?.version ?? '', snapshot.data?.buildNumber ?? '')),
|
||||
return ListTile(
|
||||
leading: const Icon(Icons.info_outline),
|
||||
title: Text(S.of(context).version),
|
||||
trailing: FutureBuilder<PackageInfo>(
|
||||
future: PackageInfo.fromPlatform(),
|
||||
builder: (context, snapshot) => snapshot.data != null
|
||||
? Text(S.of(context).versionNumber(snapshot.data!.version, snapshot.data!.buildNumber))
|
||||
: const SizedBox.shrink(),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
|
@ -1,27 +0,0 @@
|
|||
import 'dart:async';
|
||||
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:lightmeter/data/shared_prefs_service.dart';
|
||||
import 'package:lightmeter/screens/shared/release_notes_dialog/state_release_notes.dart';
|
||||
import 'package:package_info_plus/package_info_plus.dart';
|
||||
|
||||
class ReleaseNotesBloc extends Cubit<ReleaseNotesState> {
|
||||
final UserPreferencesService _userPreferencesService;
|
||||
|
||||
ReleaseNotesBloc(this._userPreferencesService) : super(const HiddenReleaseNotesDialogState()) {
|
||||
_showDialogIfNeeded();
|
||||
}
|
||||
|
||||
Future<void> _showDialogIfNeeded() async {
|
||||
PackageInfo.fromPlatform().then((value) {
|
||||
emit(ShowReleaseNotesDialogState(value.version));
|
||||
if (value.version != _userPreferencesService.seenChangelogVersion) {
|
||||
emit(ShowReleaseNotesDialogState(value.version));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void setChangelogVersion() {
|
||||
_userPreferencesService.seenChangelogVersion = (state as ShowReleaseNotesDialogState).version;
|
||||
}
|
||||
}
|
|
@ -1,30 +0,0 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:lightmeter/providers/services_provider.dart';
|
||||
import 'package:lightmeter/screens/shared/release_notes_dialog/bloc_release_notes.dart';
|
||||
import 'package:lightmeter/screens/shared/release_notes_dialog/state_release_notes.dart';
|
||||
import 'package:lightmeter/screens/shared/release_notes_dialog/widget_dialog_release_notes.dart';
|
||||
|
||||
class ReleaseNotesFlow extends StatelessWidget {
|
||||
final Widget child;
|
||||
|
||||
const ReleaseNotesFlow({required this.child, super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BlocProvider(
|
||||
create: (context) => ReleaseNotesBloc(ServicesProvider.of(context).userPreferencesService),
|
||||
child: BlocListener<ReleaseNotesBloc, ReleaseNotesState>(
|
||||
listener: (context, state) {
|
||||
if (state is ShowReleaseNotesDialogState) {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (_) => ReleaseNotesDialog(version: state.version),
|
||||
).then((_) => context.read<ReleaseNotesBloc>().setChangelogVersion());
|
||||
}
|
||||
},
|
||||
child: child,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
|
@ -1,16 +0,0 @@
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
@immutable
|
||||
sealed class ReleaseNotesState {
|
||||
const ReleaseNotesState();
|
||||
}
|
||||
|
||||
class HiddenReleaseNotesDialogState extends ReleaseNotesState {
|
||||
const HiddenReleaseNotesDialogState();
|
||||
}
|
||||
|
||||
class ShowReleaseNotesDialogState extends ReleaseNotesState {
|
||||
final String version;
|
||||
|
||||
const ShowReleaseNotesDialogState(this.version);
|
||||
}
|
|
@ -1,58 +0,0 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart' show rootBundle;
|
||||
import 'package:lightmeter/data/models/supported_locale.dart';
|
||||
import 'package:lightmeter/generated/l10n.dart';
|
||||
import 'package:lightmeter/providers/user_preferences_provider.dart';
|
||||
import 'package:lightmeter/res/dimens.dart';
|
||||
|
||||
class ReleaseNotesDialog extends StatelessWidget {
|
||||
final String version;
|
||||
|
||||
const ReleaseNotesDialog({required this.version, super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AlertDialog(
|
||||
title: Text(S.of(context).whatsnew),
|
||||
content: SingleChildScrollView(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
S.of(context).changesInVersion(version),
|
||||
style: Theme.of(context).textTheme.titleSmall,
|
||||
),
|
||||
const SizedBox(height: Dimens.grid8),
|
||||
FutureBuilder<String>(
|
||||
future: loadReleaseNotes(context),
|
||||
builder: (context, snapshot) => Text(snapshot.data ?? ''),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: Navigator.of(context).pop,
|
||||
child: Text(S.of(context).close),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Future<String> loadReleaseNotes(BuildContext context) async {
|
||||
late final String localeName;
|
||||
|
||||
switch (UserPreferencesProvider.localeOf(context)) {
|
||||
case SupportedLocale.ru:
|
||||
localeName = SupportedLocale.ru.name;
|
||||
default:
|
||||
localeName = SupportedLocale.en.name;
|
||||
}
|
||||
|
||||
try {
|
||||
return rootBundle.loadString('assets/release_notes/release_notes_${localeName}_$version.md');
|
||||
} catch (e) {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
}
|
|
@ -68,7 +68,6 @@ flutter:
|
|||
uses-material-design: true
|
||||
assets:
|
||||
- assets/camera_stub_image.jpg
|
||||
- assets/release_notes/
|
||||
|
||||
flutter_intl:
|
||||
enabled: true
|
||||
|
|
Loading…
Reference in a new issue