nc-photos/app/lib/widget/changelog.dart

412 lines
11 KiB
Dart
Raw Normal View History

2022-07-17 21:35:35 +02:00
import 'package:flutter/material.dart';
import 'package:logging/logging.dart';
import 'package:nc_photos/theme.dart';
class ChangelogArguments {
const ChangelogArguments(this.fromVersion);
final int fromVersion;
}
class Changelog extends StatelessWidget {
static const routeName = "/changelog";
static Route buildRoute(ChangelogArguments args) => MaterialPageRoute(
builder: (context) => Changelog.fromArgs(args),
);
static bool hasContent(int fromVersion) =>
_changelogs.keys.first > fromVersion;
const Changelog({
Key? key,
this.fromVersion,
}) : super(key: key);
Changelog.fromArgs(ChangelogArguments args, {Key? key})
: this(
key: key,
fromVersion: args.fromVersion,
);
@override
build(BuildContext context) => AppTheme(
child: Scaffold(
appBar: _buildAppBar(),
body: Builder(builder: (context) => _buildContent(context)),
),
);
AppBar _buildAppBar() => AppBar(
title: const Text("Changelog"),
);
Widget _buildContent(BuildContext context) => ListView.builder(
itemCount: _changelogs.length,
itemBuilder: _buildItem,
);
Widget _buildItem(BuildContext context, int i) {
try {
final version = _changelogs.keys.elementAt(i);
return ExpansionTile(
key: PageStorageKey(i),
title: Text((version / 10).toStringAsFixed(1)),
initiallyExpanded:
fromVersion == null ? (i == 0) : (version > fromVersion!),
expandedCrossAxisAlignment: CrossAxisAlignment.start,
expandedAlignment: Alignment.topLeft,
childrenPadding: const EdgeInsets.fromLTRB(16, 8, 16, 24),
children: _changelogs[version]!(context),
);
} catch (e, stackTrace) {
_log.severe("[_buildItem] Uncaught exception", e, stackTrace);
return const SizedBox();
}
}
final int? fromVersion;
static final _log = Logger("widget.changelog.Changelog");
}
2022-07-22 11:55:38 +02:00
List<Widget> _buildChangelog460(BuildContext context) {
return [
_subSectionHighlight("IMPORTANT"),
_bulletGroup(const Text(
"Completely reworked the cache database, the app will perform a full resync with server from scratch")),
_bulletGroup(const Text(
"(LDAP user only) Previously the username is used in place of user ID incorrectly, this is now fixed but albums created before may become broken. Please recreate them if that's the case. Sorry for your inconvenience")),
_sectionPadding(),
_subSection("Improvements"),
_bulletGroup(const Text(
"Improved performance working with a large collection of photos")),
_bulletGroup(
const Text("New image editor"),
[
const Text(
"Adjust image brightness, contrast, white point, black point, saturation, warmth and tint")
],
),
_bulletGroup(
const Text("Double tap to exit"),
[
const Text("Settings > Miscellaneous > Double tap to exit"),
],
),
_bulletGroup(
const Text("Replace account info in the app bar with customized label"),
[
const Text("Settings > Account > Label"),
],
),
_sectionPadding(),
_subSection("Localization"),
_bulletGroup(const Text("Updated Finnish (by pHamala)")),
_bulletGroup(const Text("Updated Spanish (by luckkmaxx)")),
_sectionPadding(),
_subSection("Known issues"),
_bulletGroup(const Text(
"Google Maps is temporarily disabled due to a bug in the Maps SDK. The app will use OSM as the only map provider until the bug is fixed")),
];
}
2022-07-17 21:35:35 +02:00
List<Widget> _buildChangelogCompat(BuildContext context, int majorVersion) {
var change = _oldChangelogs[majorVersion - 1];
if (change != null) {
try {
// remove the 1st line showing the version number repeatedly
change = change.substring(change.indexOf("\n")).trim();
} catch (_) {
change = _oldChangelogs[majorVersion - 1];
}
}
return [Text(change ?? "n/a")];
}
2022-07-22 11:55:38 +02:00
Widget _sectionPadding() => const SizedBox(height: 16);
Widget _subSection(String label) => Text(
label,
style: const TextStyle(fontSize: 16),
);
Widget _subSectionHighlight(String label) => Text(
label,
style: const TextStyle(fontSize: 16, color: Colors.red),
);
Widget _bulletGroup(Widget main, [List<Widget> children = const []]) => Padding(
padding: const EdgeInsets.symmetric(vertical: 2),
child: Column(
children: [
_bulletPoint(main),
...children.map((s) => _subBulletPoint(s)),
],
),
);
Widget _bulletPoint(Widget child) => Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const SizedBox(width: 4),
const Text(_bullet),
const SizedBox(width: 4),
Expanded(child: child),
],
);
Widget _subBulletPoint(Widget child) => Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const SizedBox(width: 24),
const Text(_bullet),
const SizedBox(width: 4),
Expanded(child: child),
],
);
2022-07-17 21:35:35 +02:00
final _changelogs = <int, List<Widget> Function(BuildContext)>{
2022-07-22 11:55:38 +02:00
460: _buildChangelog460,
2022-07-17 21:35:35 +02:00
450: (context) => _buildChangelogCompat(context, 45),
440: (context) => _buildChangelogCompat(context, 44),
430: (context) => _buildChangelogCompat(context, 43),
420: (context) => _buildChangelogCompat(context, 42),
410: (context) => _buildChangelogCompat(context, 41),
400: (context) => _buildChangelogCompat(context, 40),
380: (context) => _buildChangelogCompat(context, 38),
370: (context) => _buildChangelogCompat(context, 37),
360: (context) => _buildChangelogCompat(context, 36),
350: (context) => _buildChangelogCompat(context, 35),
340: (context) => _buildChangelogCompat(context, 34),
320: (context) => _buildChangelogCompat(context, 32),
310: (context) => _buildChangelogCompat(context, 31),
300: (context) => _buildChangelogCompat(context, 30),
290: (context) => _buildChangelogCompat(context, 29),
280: (context) => _buildChangelogCompat(context, 28),
270: (context) => _buildChangelogCompat(context, 27),
260: (context) => _buildChangelogCompat(context, 26),
240: (context) => _buildChangelogCompat(context, 24),
230: (context) => _buildChangelogCompat(context, 23),
200: (context) => _buildChangelogCompat(context, 20),
190: (context) => _buildChangelogCompat(context, 19),
180: (context) => _buildChangelogCompat(context, 18),
170: (context) => _buildChangelogCompat(context, 17),
150: (context) => _buildChangelogCompat(context, 15),
130: (context) => _buildChangelogCompat(context, 13),
80: (context) => _buildChangelogCompat(context, 8),
70: (context) => _buildChangelogCompat(context, 7),
};
2022-07-22 11:55:38 +02:00
const _bullet = "\u2022";
2022-07-17 21:35:35 +02:00
const _oldChangelogs = [
2021-04-16 10:45:17 +02:00
// v1
null,
// v2
null,
// v3
null,
// v4
null,
// v5
null,
// v6
null,
// v7
2021-04-16 19:25:40 +02:00
"""1.7.0
Added HEIC support
Fixed a bug that corrupted the albums. Please re-add the photos after upgrading. Sorry for your inconvenience
2021-04-20 13:02:46 +02:00
""",
// v8
"""1.8.0
Dark theme
2021-04-16 19:25:40 +02:00
""",
2021-04-27 13:48:42 +02:00
// v9
null,
2021-04-30 19:10:12 +02:00
// v10
null,
2021-05-01 10:46:38 +02:00
// v11
null,
2021-05-06 09:24:24 +02:00
// v12
null,
2021-05-07 11:47:15 +02:00
// v13
"""13.0
Added MP4 support (Android only)
""",
2021-05-09 13:40:09 +02:00
// v14
null,
2021-05-25 20:18:26 +02:00
// v15
"""15.0
This version includes changes that are not compatible with older versions. Please also update your other devices if applicable
""",
2021-06-05 21:25:18 +02:00
// v16
null,
2021-06-15 13:52:35 +02:00
// v17
"""17.0
Archive photos to only show them in albums
Link to report issues in Settings
2021-06-22 20:41:01 +02:00
""",
// v18
"""18.0
Modify date/time of photos
Support GIF
2021-07-03 12:07:52 +02:00
""",
// v19
"""19.0
2021-07-03 16:56:50 +02:00
- Folder based album to browse photos in an existing folder (read only)
2021-07-03 12:07:52 +02:00
- Batch import folder based albums
This version includes changes that are not compatible with older versions. Please also update your other devices if applicable
2021-07-11 07:28:43 +02:00
""",
// v20
"""20.0
- Improved albums: sorting, text labels
- Simplify sharing to other apps
- Added WebM support (Android only)
2021-06-15 13:52:35 +02:00
""",
2021-07-13 13:44:01 +02:00
// v21
null,
2021-07-17 17:43:35 +02:00
// v22
null,
2021-07-25 21:10:15 +02:00
// v23
"""23.0
- Paid version is now published on Play Store. Head to Settings to learn more if you are interested
2021-08-02 21:28:12 +02:00
""",
// v24
"""24.0
- Show and manage deleted files in trash bin
2021-07-25 21:10:15 +02:00
""",
2021-08-08 22:43:11 +02:00
// v25
null,
2021-08-17 16:20:33 +02:00
// v26
"""26.0
- Pick album cover (open a photo in an album -> details -> use as cover)
2021-08-28 14:00:45 +02:00
""",
// v27
"""27.0
- New settings to customize photo viewer
2021-09-04 19:15:25 +02:00
""",
// v28
"""28.0
- New settings:
- Follow system dark theme settings (Android 10+)
2021-09-16 12:28:14 +02:00
""",
// v29
"""29.0
Features:
- (Experimental) Support the Nextcloud Face Recognition app
- Slideshow
- Performance & cache tweaks
- Due to an overhaul to the cache management, the old cache can't be used and will be cleared. First run after update will thus be slower
Localization (new/update):
- German (by PhilProg)
- Spanish (by luckkmaxx)
2021-10-02 11:57:09 +02:00
""",
// v30
"""30.0
Features:
- Share a single item using a link
- Optimize albums: the JSON files are now much smaller
- Download album/selected items
Localization (new/update):
- Czech (by Skyhawk)
- Spanish (by luckkmaxx)
2021-10-09 11:52:09 +02:00
""",
2021-10-29 21:03:41 +02:00
// v31
2021-10-09 11:52:09 +02:00
"""31.0
Features:
- Share multiple items using a link
- Manage shares in Collections > Sharing
- (Web) Now support share links like Android
- Group photos by date in albums (enable in Settings > Album)
2021-10-29 21:03:41 +02:00
""",
// v32
"""32.0
Features:
- Enable/disable server app integrations in Settings > Account
2021-08-17 16:20:33 +02:00
""",
2021-11-09 07:01:47 +01:00
// v33
null,
2021-12-07 19:51:33 +01:00
// v34
"""34.0
- Add OSM as an alternative map provider (Settings > Viewer)
- (Experimental) Add shared album (Settings > Experimental)
- (UI) Swipe up to show photo details
- (Localization) Update Spanish (by luckkmaxx)
2022-01-06 07:16:03 +01:00
""",
// v35
"""35.0
- Optimize start up performance
- Photos should appear more quickly on start up
- (UI) Swipe down to close the photo viewer
- (Localization) Add Finnish (by pHamala)
* The app needs to resync with the server due to changes in the database
2022-01-17 09:50:07 +01:00
""",
// v36
"""36.0
- Memories
- Show photos taken in the past
2022-02-08 19:38:10 +01:00
""",
// v37
"""37.0
- Favorites
- Browse favorites (Collections > Favorites)
- Add to or remove from favorites in photo viewer
- Tag
- Browse photos by specific tags (Collections > New collection > Tag)
- (Localization) Add Polish (by szymok)
- (Localization) Update Finnish (by pHamala)
2022-04-06 19:21:09 +02:00
""",
// v38
"""38.0
- (Android) Image metadata are now processed in a background service
- (Localization) Update Finnish (by pHamala)
- (Localization) Update Spanish (by luckkmaxx)
2022-04-22 22:23:19 +02:00
""",
// v39
null,
// v40
"""40.0
- (Android) Fixed a race condition causing the app to deadlock
- (Localization) Add Portuguese (by fernosan)
- (Localization) Update Finnish (by pHamala)
- (Localization) Update Russian (by kvasenok)
2022-05-14 19:22:43 +02:00
""",
// v41
"""41.0
- (Android) Enhance your photo with the new Enhance button in viewer
- (Android) New photo enhancement algorithms:
- Low-light enhancement
- Portrait blur
- (Localization) Add Chinese (by zerolin)
- (Localization) Update French (by mgreil)
2022-05-15 22:35:31 +02:00
""",
// v42
"""42.0
- Add tweakable parameters to low-light enhancement and portrait blur
2022-05-21 13:44:30 +02:00
""",
// v43
"""43.0
- (Android) Photo enhancements now implemented in C++:
- Better performance
- Less restrictions on RAM usage
- (Android) New photo enhancement algorithms:
- Super-resolution (upscale image to 4x)
- (Localization) Update Finnish (by pHamala)
2022-05-28 21:02:12 +02:00
""",
// v44
"""44.0
- (Android) New photo enhancement algorithms:
- Style transfer
2022-06-08 15:39:52 +02:00
""",
// v45
"""45.0
- Toggle between processing EXIF over Wi-Fi only or any network in Settings
- (Localization) Update Greek (by Chris Karasoulis)
2021-12-07 19:51:33 +01:00
""",
2021-04-16 10:45:17 +02:00
];