Skip to content

Commit 862ac04

Browse files
authored
🐛 Fix UI layouts (#634)
1 parent 2d2a786 commit 862ac04

15 files changed

+99
-39
lines changed

CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,14 @@ that can be found in the LICENSE file. -->
99
1010
## Unreleased
1111

12-
*None.*
12+
### Improvements
13+
14+
- Do not mute the Live Photo during the preview.
15+
16+
### Fixes
17+
18+
- Fix the GIF indicator's layout.
19+
- Fix the directionality with the reverted grid item.
1320

1421
## 9.3.0
1522

example/ios/Runner.xcodeproj/project.pbxproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@
7676
FF5A0AA64F3B1C88D3552E39 /* Pods-Runner.release.xcconfig */,
7777
6B0C8420452B45A5D1F1C0C7 /* Pods-Runner.profile.xcconfig */,
7878
);
79-
name = Pods;
8079
path = Pods;
8180
sourceTree = "<group>";
8281
};

example/ios/Runner/Info.plist

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
33
<plist version="1.0">
44
<dict>
5+
<key>CADisableMinimumFrameDurationOnPhone</key>
6+
<true/>
57
<key>CFBundleDevelopmentRegion</key>
68
<string>$(DEVELOPMENT_LANGUAGE)</string>
79
<key>CFBundleDisplayName</key>
@@ -30,6 +32,8 @@
3032
<string>Take a video for display</string>
3133
<key>NSPhotoLibraryUsageDescription</key>
3234
<string>Read your photos for display</string>
35+
<key>UIApplicationSupportsIndirectInputEvents</key>
36+
<true/>
3337
<key>UILaunchStoryboardName</key>
3438
<string>LaunchScreen</string>
3539
<key>UIMainStoryboardFile</key>
@@ -47,9 +51,5 @@
4751
<string>UIInterfaceOrientationLandscapeLeft</string>
4852
<string>UIInterfaceOrientationLandscapeRight</string>
4953
</array>
50-
<key>CADisableMinimumFrameDurationOnPhone</key>
51-
<true/>
52-
<key>UIApplicationSupportsIndirectInputEvents</key>
53-
<true/>
5454
</dict>
5555
</plist>

example/lib/constants/picker_method.dart

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,29 @@ class PickMethod {
9696
);
9797
}
9898

99+
factory PickMethod.livePhoto(BuildContext context, int maxAssetsCount) {
100+
return PickMethod(
101+
icon: '🎬',
102+
name: context.l10n.pickMethodLivePhotoName,
103+
description: context.l10n.pickMethodLivePhotoDescription,
104+
method: (BuildContext context, List<AssetEntity> assets) {
105+
return AssetPicker.pickAssets(
106+
context,
107+
pickerConfig: AssetPickerConfig(
108+
maxAssets: maxAssetsCount,
109+
selectedAssets: assets,
110+
requestType: RequestType.image,
111+
filterOptions: CustomFilter.sql(
112+
where: '${CustomColumns.base.mediaType} = 1'
113+
' AND '
114+
'${CustomColumns.darwin.mediaSubtypes} & (1 << 3) = (1 << 3)',
115+
),
116+
),
117+
);
118+
},
119+
);
120+
}
121+
99122
factory PickMethod.camera({
100123
required BuildContext context,
101124
required int maxAssetsCount,

example/lib/l10n/app_en.arb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
"pickMethodVideoDescription": "Only pick video from device. (Includes Live Photos on iOS and macOS.)",
1515
"pickMethodAudioName": "Audio picker",
1616
"pickMethodAudioDescription": "Only pick audio from device.",
17+
"pickMethodLivePhotoName": "Live Photo picker",
18+
"pickMethodLivePhotoDescription": "Only pick Live Photos from device.",
1719
"pickMethodCameraName": "Pick from camera",
1820
"pickMethodCameraDescription": "Allow to pick an asset through camera.",
1921
"pickMethodCameraAndStayName": "Pick from camera and stay",

example/lib/l10n/app_zh.arb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@
1313
"pickMethodImageName": "图片选择",
1414
"pickMethodImageDescription": "仅选择图片。",
1515
"pickMethodVideoName": "视频选择",
16-
"pickMethodVideoDescription": "仅选择视频。(在 iOS 和 macOS 上将包括实况图片。)",
16+
"pickMethodVideoDescription": "仅选择视频。",
1717
"pickMethodAudioName": "音频选择",
1818
"pickMethodAudioDescription": "仅选择音频。",
19+
"pickMethodLivePhotoName": "实况图片选择",
20+
"pickMethodLivePhotoDescription": "仅选择实况图片。",
1921
"pickMethodCameraName": "从相机生成选择",
2022
"pickMethodCameraDescription": "通过相机拍照生成并选择资源",
2123
"pickMethodCameraAndStayName": "从相机生成选择并停留",

example/lib/l10n/gen/app_localizations.dart

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,18 @@ abstract class AppLocalizations {
180180
/// **'Only pick audio from device.'**
181181
String get pickMethodAudioDescription;
182182

183+
/// No description provided for @pickMethodLivePhotoName.
184+
///
185+
/// In en, this message translates to:
186+
/// **'Live Photo picker'**
187+
String get pickMethodLivePhotoName;
188+
189+
/// No description provided for @pickMethodLivePhotoDescription.
190+
///
191+
/// In en, this message translates to:
192+
/// **'Only pick Live Photos from device.'**
193+
String get pickMethodLivePhotoDescription;
194+
183195
/// No description provided for @pickMethodCameraName.
184196
///
185197
/// In en, this message translates to:

example/lib/l10n/gen/app_localizations_en.dart

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,13 @@ class AppLocalizationsEn extends AppLocalizations {
5151
@override
5252
String get pickMethodAudioDescription => 'Only pick audio from device.';
5353

54+
@override
55+
String get pickMethodLivePhotoName => 'Live Photo picker';
56+
57+
@override
58+
String get pickMethodLivePhotoDescription =>
59+
'Only pick Live Photos from device.';
60+
5461
@override
5562
String get pickMethodCameraName => 'Pick from camera';
5663

example/lib/l10n/gen/app_localizations_zh.dart

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,20 @@ class AppLocalizationsZh extends AppLocalizations {
4242
String get pickMethodVideoName => '视频选择';
4343

4444
@override
45-
String get pickMethodVideoDescription => '仅选择视频。(在 iOS 和 macOS 上将包括实况图片。)';
45+
String get pickMethodVideoDescription => '仅选择视频。';
4646

4747
@override
4848
String get pickMethodAudioName => '音频选择';
4949

5050
@override
5151
String get pickMethodAudioDescription => '仅选择音频。';
5252

53+
@override
54+
String get pickMethodLivePhotoName => '实况图片选择';
55+
56+
@override
57+
String get pickMethodLivePhotoDescription => '仅选择实况图片。';
58+
5359
@override
5460
String get pickMethodCameraName => '从相机生成选择';
5561

example/lib/pages/multi_assets_page.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
// Use of this source code is governed by an Apache license that can be found
33
// in the LICENSE file.
44

5+
import 'dart:io';
6+
57
import 'package:flutter/material.dart';
68
import 'package:wechat_assets_picker/wechat_assets_picker.dart';
79

@@ -32,6 +34,8 @@ class _MultiAssetsPageState extends State<MultiAssetsPage>
3234
PickMethod.image(context, maxAssetsCount),
3335
PickMethod.video(context, maxAssetsCount),
3436
PickMethod.audio(context, maxAssetsCount),
37+
if (Platform.isIOS || Platform.isMacOS)
38+
PickMethod.livePhoto(context, maxAssetsCount),
3539
PickMethod.camera(
3640
context: context,
3741
maxAssetsCount: maxAssetsCount,

0 commit comments

Comments
 (0)