Skip to content

Commit

Permalink
Merge pull request #183 from Piwigo/develop
Browse files Browse the repository at this point in the history
Release 2.3.0
  • Loading branch information
remi-martin authored Jun 28, 2024
2 parents 7a7da9d + 919ac62 commit 74609ca
Show file tree
Hide file tree
Showing 47 changed files with 1,118 additions and 728 deletions.
1 change: 1 addition & 0 deletions android/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ GeneratedPluginRegistrant.java
# Remember to never publicly share your keystore.
# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
key.properties
/build/.last_build_id
24 changes: 10 additions & 14 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
plugins {
id "com.android.application"
id "kotlin-android"
id "dev.flutter.flutter-gradle-plugin"
}

def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
Expand All @@ -6,11 +12,6 @@ if (localPropertiesFile.exists()) {
}
}

def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
Expand All @@ -21,10 +22,6 @@ if (flutterVersionName == null) {
flutterVersionName = '1.0'
}

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
Expand All @@ -37,13 +34,13 @@ android {
compileOptions {
// Flag to enable support for the new language APIs
coreLibraryDesugaringEnabled true
// Sets Java compatibility to Java 8
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
// Sets Java compatibility to Java 11
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}

kotlinOptions {
jvmTarget = '1.8'
jvmTarget = '11'
}

sourceSets {
Expand Down Expand Up @@ -81,7 +78,6 @@ flutter {
}

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation "androidx.window:window:1.0.0"
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'
}
13 changes: 0 additions & 13 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,16 +1,3 @@
buildscript {
ext.kotlin_version = '1.7.10'
repositories {
google()
mavenCentral()
}

dependencies {
classpath 'com.android.tools.build:gradle:7.1.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}

allprojects {
repositories {
google()
Expand Down
30 changes: 22 additions & 8 deletions android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,25 @@
include ':app'
pluginManagement {
def flutterSdkPath = {
def properties = new Properties()
file("local.properties").withInputStream { properties.load(it) }
def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
return flutterSdkPath
}()

def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
def properties = new Properties()
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")

assert localPropertiesFile.exists()
localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}

def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version "7.1.3" apply false
id "org.jetbrains.kotlin.android" version "1.9.22" apply false
}

include ":app"
1 change: 0 additions & 1 deletion l10n/app_de.arb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"tabBar_albums": "Alben",
"settings_language": "Wählen Sie die Sprache",
"tabBar_upload": "Hochladen",
"tabBar_preferences": "Einstellungen",
"alertOkButton": "OK",
Expand Down
60 changes: 30 additions & 30 deletions l10n/app_zh.arb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"loadingHUD_label": "正在加载…",
"completeHUD_label": "完成",
"errorHUD_label": "出错",
"loadMoreHUD_label": "Release to load more",
"loadMoreHUD_label": "松开以加载更多",
"uploadRights_title": "需要上传权限",
"uploadRights_message": "您必须拥有上传权限才能上传照片或视频。",
"internetErrorGeneral_title": "连接出错",
Expand Down Expand Up @@ -48,16 +48,16 @@
"login_newSession": "正在打开会话",
"login_communityParameters": "社区参数",
"login_serverParameters": "Piwigo参数",
"login_advancedParameters": "Authentication Settings",
"login_advancedParameters": "验证设置",
"login_connectionChanged": "连接已变更!",
"login_rememberCredentials": "Remember credentials",
"login_rememberCredentials": "记住凭据",
"loginHTTP_title": "HTTP 证书",
"loginHTTP_message": "Piwigo服务器需要基本访问验证:",
"loginHTTP_enable": "Enable HTTP Basic",
"loginHTTP_enable": "使能 HTTP Basic",
"loginHTTPuser_placeholder": "用户名",
"loginHTTPpwd_placeholder": "密码",
"loginCert_title": "Self Signed Certificates",
"loginCert_enable": "Allow SSL",
"loginCert_title": "自签名证书",
"loginCert_enable": "允许 SSL",
"loginCertFailed_title": "非私密连接",
"loginCertFailed_message": "Piwigo警告网站证书无效。您仍然想要接受此证书吗?",
"loginHTTPSfailed_title": "安全连接失败",
Expand Down Expand Up @@ -153,7 +153,7 @@
"categoryUpload_loadSubCategories": "加载",
"categoryUpload_images": "上传图片",
"categoryUpload_videos": "上传视频",
"categoryUpload_camera": "Camera",
"categoryUpload_camera": "相机",
"categoryUpload_takePhoto": "拍照",
"categoryUpload_takeVideo": "录制",
"uploadList_title": "上传状态",
Expand Down Expand Up @@ -242,23 +242,23 @@
"moveCategoryHUD_moved": "相册已移动",
"moveCategoryError_title": "移动失败",
"moveCategoryError_message": "移动相册失败",
"categoryPrivacy": "Manage Permissions",
"categoryPrivacy_subtitle": "Manage access permissions of \"{album_name}\".",
"categoryPrivacy": "管理权限",
"categoryPrivacy_subtitle": "管理 \"{album_name}\" 的访问权限",
"@categoryPrivacy_subtitle": {
"placeholders": {
"album_name": {}
}
},
"categoryPrivacyMode_public": "Public",
"categoryPrivacyMode_publicMessage": "Every user can see this album.",
"categoryPrivacyMode_private": "Private",
"categoryPrivacyMode_privateMessage": "Visitors must log in and have the necessary permissions to see this album.",
"categoryPrivacyGroups": "Group permissions",
"categoryPrivacyGroups_add": "Authorize groups",
"categoryPrivacyUsers": "User permissions",
"categoryPrivacyUsers_message": "To manage user permissions, go to your web administration.",
"categoryPrivacyRecursive": "Apply to sub-albums",
"categoryPrivacyRecursive_message": "After confirmation, all modifications will be applied to sub-albums.",
"categoryPrivacyMode_public": "公开的",
"categoryPrivacyMode_publicMessage": "每个用户都可以看到此相册。",
"categoryPrivacyMode_private": "私有的",
"categoryPrivacyMode_privateMessage": "访客必须登录并拥有查看此相册的必要权限。",
"categoryPrivacyGroups": "组权限",
"categoryPrivacyGroups_add": "授权组",
"categoryPrivacyUsers": "用户权限",
"categoryPrivacyUsers_message": "要管理用户权限,请前往您的网站管理界面。",
"categoryPrivacyRecursive": "应用到子相册",
"categoryPrivacyRecursive_message": "确认后,所有修改都将应用于子相册。",
"categorySelection_setThumbnail": "请选择要使用照片 {photo} 作为缩略图的相册。",
"@categorySelection_setThumbnail": {
"placeholders": {
Expand Down Expand Up @@ -364,17 +364,17 @@
"tagsAdd_placeholder": "新标签",
"tagsAddHUD_label": "创建标签中...",
"tagsAddHUD_created": "标签已创建",
"group": "Group",
"groups": "Groups",
"groupsTitle_selectOne": "Select a Group",
"groupsHeader_selected": "Selected",
"groupsHeader_notSelected": "Not Selected",
"groupsHeader_all": "All Groups",
"groupsAdd_title": "Add Group",
"groupsAdd_message": "Enter a name for this new group",
"groupsAdd_placeholder": "New group",
"groupsAddHUD_label": "Creating Group…",
"groupsAddHUD_created": "Group Created",
"group": "",
"groups": "",
"groupsTitle_selectOne": "选择一个组",
"groupsHeader_selected": "已选中",
"groupsHeader_notSelected": "未选中",
"groupsHeader_all": "所有组",
"groupsAdd_title": "添加组",
"groupsAdd_message": "为新增的组设置名称",
"groupsAdd_placeholder": "新增组",
"groupsAddHUD_label": "正在创建组…",
"groupsAddHUD_created": "已创建组",
"tagsAddError_message": "无法创建新标签",
"tagsAddError_title": "创建失败",
"selectImages": "选择图片",
Expand Down
9 changes: 9 additions & 0 deletions lib/app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import 'package:piwigo_ng/views/image/edit_image_page.dart';
import 'package:piwigo_ng/views/image/image_favorites_page.dart';
import 'package:piwigo_ng/views/image/image_page.dart';
import 'package:piwigo_ng/views/image/image_search_page.dart';
import 'package:piwigo_ng/views/image/image_tags_page.dart';
import 'package:piwigo_ng/views/image/video_player_page.dart';
import 'package:piwigo_ng/views/settings/auto_upload_page.dart';
import 'package:piwigo_ng/views/settings/privacy_policy_page.dart';
Expand Down Expand Up @@ -147,6 +148,14 @@ Route<dynamic> generateRoute(RouteSettings settings) {
),
settings: settings,
);
case ImageTagsPage.routeName:
return MaterialPageRoute(
builder: (_) => ImageTagsPage(
isAdmin: arguments['isAdmin'] ?? isAdmin,
tag: arguments["tag"],
),
settings: settings,
);
case ImageFavoritesPage.routeName:
return MaterialPageRoute(
builder: (_) => ImageFavoritesPage(
Expand Down
36 changes: 19 additions & 17 deletions lib/components/appbars/root_search_app_bar.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:piwigo_ng/components/modals/open_tag_modal.dart';
import 'package:piwigo_ng/components/notification_dot.dart';
import 'package:piwigo_ng/components/popup_list_item.dart';
import 'package:piwigo_ng/services/preferences_service.dart';
Expand Down Expand Up @@ -40,9 +41,7 @@ class _RootSearchAppBarState extends State<RootSearchAppBar> {
if (widget.scrollController.offset > _expandedHeight * _opacityScale) {
return 0.0;
}
return (_expandedHeight * _opacityScale -
widget.scrollController.offset) /
(_expandedHeight * _opacityScale);
return (_expandedHeight * _opacityScale - widget.scrollController.offset) / (_expandedHeight * _opacityScale);
}
return 1.0;
}
Expand All @@ -58,8 +57,7 @@ class _RootSearchAppBarState extends State<RootSearchAppBar> {
}

// In case 0%-100% of the expanded height is viewed
double scrollDelta =
(_expandedHeight - widget.scrollController.offset) / _expandedHeight;
double scrollDelta = (_expandedHeight - widget.scrollController.offset) / _expandedHeight;
double scrollPercent = (scrollDelta * 2 - 1);
return (1 - scrollPercent) * delta * basePadding + basePadding;
}
Expand All @@ -71,8 +69,7 @@ class _RootSearchAppBarState extends State<RootSearchAppBar> {
Widget build(BuildContext context) {
return SliverAppBar(
leading: IconButton(
onPressed: () =>
Navigator.of(context).pushNamed(SettingsPage.routeName),
onPressed: () => Navigator.of(context).pushNamed(SettingsPage.routeName),
icon: const Icon(Icons.settings),
),
pinned: true,
Expand All @@ -90,7 +87,6 @@ class _RootSearchAppBarState extends State<RootSearchAppBar> {
child: AppField(
padding: const EdgeInsets.symmetric(vertical: 8.0),
prefix: Icon(Icons.search),
hint: "Search...",
),
),
),
Expand All @@ -108,7 +104,7 @@ class _RootSearchAppBarState extends State<RootSearchAppBar> {
),
title: Text(
appStrings.tabBar_albums,
textScaleFactor: 1,
textScaler: TextScaler.linear(1),
style: Theme.of(context).appBarTheme.titleTextStyle,
),
),
Expand All @@ -125,8 +121,7 @@ class _RootSearchAppBarState extends State<RootSearchAppBar> {
PopupMenuItem(
onTap: () => Future.delayed(
const Duration(seconds: 0),
() =>
Navigator.of(context).pushNamed(UploadStatusPage.routeName),
() => Navigator.of(context).pushNamed(UploadStatusPage.routeName),
),
child: Stack(
children: [
Expand All @@ -137,8 +132,7 @@ class _RootSearchAppBarState extends State<RootSearchAppBar> {
Positioned(
top: 14.0,
left: 0.0,
child: Consumer<UploadNotifier>(
builder: (context, uploadNotifier, child) {
child: Consumer<UploadNotifier>(builder: (context, uploadNotifier, child) {
return NotificationDot(
isShown: uploadNotifier.uploadList.isNotEmpty,
);
Expand All @@ -147,12 +141,21 @@ class _RootSearchAppBarState extends State<RootSearchAppBar> {
],
),
),
PopupMenuItem(
onTap: () => Future.delayed(
const Duration(seconds: 0),
() => showOpenTagModal(context),
),
child: PopupListItem(
icon: Icons.local_offer_outlined,
text: appStrings.tags,
),
),
if (Preferences.getUserStatus != 'guest')
PopupMenuItem(
onTap: () => Future.delayed(
const Duration(seconds: 0),
() => Navigator.of(context)
.pushNamed(ImageFavoritesPage.routeName),
() => Navigator.of(context).pushNamed(ImageFavoritesPage.routeName),
),
child: PopupListItem(
icon: Icons.favorite,
Expand All @@ -164,8 +167,7 @@ class _RootSearchAppBarState extends State<RootSearchAppBar> {
Positioned(
top: 12.0,
left: 12.0,
child: Consumer<UploadNotifier>(
builder: (context, uploadNotifier, child) {
child: Consumer<UploadNotifier>(builder: (context, uploadNotifier, child) {
return NotificationDot(
isShown: uploadNotifier.uploadList.isNotEmpty,
);
Expand Down
5 changes: 2 additions & 3 deletions lib/components/appbars/settings_app_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ class _SettingsAppBarState extends State<SettingsAppBar> {
}

// In case 0%-100% of the expanded height is viewed
double scrollDelta =
(_expandedHeight - widget.scrollController.offset) / _expandedHeight;
double scrollDelta = (_expandedHeight - widget.scrollController.offset) / _expandedHeight;
double scrollPercent = (scrollDelta * 2 - 1);
return (1 - scrollPercent) * delta * basePadding + basePadding;
}
Expand All @@ -59,7 +58,7 @@ class _SettingsAppBarState extends State<SettingsAppBar> {
),
title: Text(
appStrings.tabBar_preferences,
textScaleFactor: 1,
textScaler: TextScaler.linear(1),
style: Theme.of(context).appBarTheme.titleTextStyle,
),
),
Expand Down
2 changes: 1 addition & 1 deletion lib/components/cards/image_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class ImageCard extends StatelessWidget {
end: Alignment.topCenter),
),
child: AutoSizeText(
image.name,
image.name ?? "",
maxLines: 1,
maxFontSize: 14,
minFontSize: 8,
Expand Down
Loading

0 comments on commit 74609ca

Please sign in to comment.