Skip to content

Commit 90df06d

Browse files
authored
💄 Roll UI design WeChat 8.3.x (#181)
1 parent 12eb505 commit 90df06d

File tree

8 files changed

+544
-234
lines changed

8 files changed

+544
-234
lines changed

CHANGELOG.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,26 @@ that can be found in the LICENSE file. -->
44

55
# Changelog
66

7+
See the [Migration Guide](guides/migration_guide.md) for the details of breaking changes between versions.
8+
9+
## 4.0.0-dev.1
10+
11+
To know more about breaking changes, see [Migration Guide][].
12+
13+
### New features
14+
15+
- Sync all UI details from WeChat 8.3.x. (#181)
16+
17+
### Improvements
18+
19+
- Improve the experience when using the exposure slider.
20+
- Prefer `FlashMode.off` for better performance.
21+
- Allow `cameras` to be set repeatedly.
22+
23+
### Fixes
24+
25+
- Fix accessibility on the switch cameras button.
26+
727
## 3.8.0
828

929
### New features
@@ -324,3 +344,5 @@ that can be found in the LICENSE file. -->
324344

325345
- Support taking pictures and videos.
326346
- Support video recording duration limitation.
347+
348+
[Migration Guide]: guides/migration_guide.md

README-ZH.md

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,31 @@ Language: [English](README.md) | 中文简体
1919
[**仿微信资源选择器**](https://pub.flutter-io.cn/packages/wechat_assets_picker) 的扩展。
2020
选择器基于 `camera` 实现相机相关功能,`photo_manager` 实现资源相关内容。
2121

22-
## 目录 🗂
23-
24-
- [Flutter WeChat Camera Picker](#flutter-wechat-camera-picker)
25-
- [目录 🗂](#目录-)
26-
- [特性 ✨](#特性-)
27-
- [截图 📸](#截图-)
28-
- [准备工作 🍭](#准备工作-)
29-
- [使用方法 📖](#使用方法-)
30-
- [简单的使用方法](#简单的使用方法)
31-
- [使用配置](#使用配置)
32-
- [常见问题 💭](#常见问题-)
33-
- [iOS 上的预览在旋转时行为诡异](#iOS-上的预览在旋转时行为诡异)
22+
当前的界面设计基于的微信版本:**8.3.x**
23+
界面更新将在微信版本更新后随时进行跟进。
24+
25+
查看 [迁移指南][] 了解如何从破坏性改动中迁移为可用代码。
26+
27+
<details>
28+
<summary>Table of content</summary>
29+
30+
<!-- TOC -->
31+
* [Flutter WeChat Camera Picker](#flutter-wechat-camera-picker)
32+
* [特性 ✨](#特性-)
33+
* [截图 📸](#截图-)
34+
* [准备工作 🍭](#准备工作-)
35+
* [版本限制](#版本限制)
36+
* [配置](#配置)
37+
* [Android 13 (API 33) 权限配置](#android-13-api-33-权限配置)
38+
* [使用方法 📖](#使用方法-)
39+
* [简单的使用方法](#简单的使用方法)
40+
* [使用配置](#使用配置)
41+
* [简单的使用方法](#简单的使用方法-1)
42+
* [使用自定义的 `State`](#使用自定义的-state)
43+
* [常见问题 💭](#常见问题-)
44+
* [iOS 上的预览在旋转时行为诡异](#ios-上的预览在旋转时行为诡异)
45+
<!-- TOC -->
46+
</details>
3447

3548
## 特性 ✨
3649

@@ -164,3 +177,5 @@ final AssetEntity? entity = await CameraPicker.pickFromCamera(
164177
你可以在这个 issue 里了解更多相关的信息:
165178
https://github.com/flutter/flutter/issues/89216
166179
除此之外的问题,你可以提交 issue 进行提问。
180+
181+
[迁移指南]: https://github.com/fluttercandies/flutter_wechat_camera_picker/blob/main/guides/migration_guide.md

README.md

Lines changed: 27 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,31 @@ A **camera picker** based on WeChat's UI which is a separate runnable extension
2020
The package based on `camera` for camera functions
2121
and `photo_manager` for asset implementation.
2222

23-
## Category 🗂
24-
25-
- [Flutter WeChat Camera Picker](#flutter-wechat-camera-picker)
26-
- [Category 🗂](#category-)
27-
- [Features ✨](#features-)
28-
- [Screenshots 📸](#screenshots-)
29-
- [Preparing for use 🍭](#preparing-for-use-)
30-
- [Usage 📖](#usage-)
31-
- [Simple usage](#simple-usage)
32-
- [With configurations](#with-configurations)
33-
- [Frequently asked question 💭](#frequently-asked-question-)
34-
- [Why the orientation behavior is strange on iOS?](#why-the-orientation-behavior-is-strange-on-ios)
35-
- [Contributors ✨](#contributors-)
23+
Current WeChat version that UI based on: **8.3.x**
24+
UI designs will be updated following the WeChat update in anytime.
25+
26+
See the [Migration Guide][] to learn how to migrate between breaking changes.
27+
28+
<details>
29+
<summary>Table of content</summary>
30+
31+
<!-- TOC -->
32+
* [Flutter WeChat Camera Picker](#flutter-wechat-camera-picker)
33+
* [Features ✨](#features-)
34+
* [Screenshots 📸](#screenshots-)
35+
* [Preparing for use 🍭](#preparing-for-use-)
36+
* [Version constraints](#version-constraints)
37+
* [Setup](#setup)
38+
* [Android 13 (API 33) permissions](#android-13-api-33-permissions)
39+
* [Usage 📖](#usage-)
40+
* [Simple usage](#simple-usage)
41+
* [With configurations](#with-configurations)
42+
* [Using custom `State`s](#using-custom-states)
43+
* [Frequently asked question 💭](#frequently-asked-question-)
44+
* [Why the orientation behavior is strange on iOS?](#why-the-orientation-behavior-is-strange-on-ios)
45+
* [Contributors ✨](#contributors-)
46+
<!-- TOC -->
47+
</details>
3648

3749
## Features ✨
3850

@@ -181,3 +193,5 @@ Thank goes to these wonderful people ([emoji key](https://allcontributors.org/do
181193

182194
<!-- ALL-CONTRIBUTORS-LIST:END -->
183195
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
196+
197+
[Migration Guide]: https://github.com/fluttercandies/flutter_wechat_camera_picker/blob/main/guides/migration_guide.md

example/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: wechat_camera_picker_demo
22
description: A new Flutter project.
3-
version: 3.8.0+23
3+
version: 4.0.0+24
44
publish_to: none
55

66
environment:

guides/migration_guide.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
<!-- Copyright 2019 The FlutterCandies author. All rights reserved.
2+
Use of this source code is governed by an Apache license
3+
that can be found in the LICENSE file. -->
4+
5+
# Migration Guide
6+
7+
This document gathered all breaking changes and migrations requirement between major versions.
8+
9+
## Versions
10+
11+
- [4.0.0](#400)
12+
13+
## 4.0.0
14+
15+
### Summary
16+
17+
> If you don't extend your customized `CameraPickerState`
18+
> or you didn't override below methods, you can stop reading.
19+
20+
In order to sync the UI details with the latest WeChat style (v8.3.0),
21+
few naming or signatures of methods are changed. including:
22+
- `restartDisplayModeDisplayTimer`
23+
- `buildBackButton`
24+
- `buildCameraPreview`
25+
- `buildCaptureButton`
26+
- `buildFocusingPoint`
27+
28+
### Details
29+
30+
- `restartDisplayModeDisplayTimer` is renamed to `restartExposureModeDisplayTimer`.
31+
- `buildBackButton` no more requires `BoxConstraints constraints` as an argument,
32+
the signature is `Widget buildBackButton(BuildContext context)` from now on.
33+
- `buildCameraPreview` no more requires `DeviceOrientation orientation` as an argument
34+
since the implementation does not really use it.
35+
It now requires `CameraValue cameraValue` as an argument. So the signature becomes:
36+
```dart
37+
Widget buildCameraPreview({
38+
required BuildContext context,
39+
required CameraValue cameraValue,
40+
required BoxConstraints constraints,
41+
})
42+
```
43+
- `buildCaptureButton` now requires `BuildContext context` as an argument. So the signature becomes:
44+
```dart
45+
Widget buildCaptureButton(BuildContext context, BoxConstraints constraints)
46+
```
47+
- `buildFocusingPoint` now adds `int quarterTurns` to make internal quarter turns.
48+
So the signature becomes:
49+
```dart
50+
Widget buildFocusingPoint({
51+
required CameraValue cameraValue,
52+
required BoxConstraints constraints,
53+
int quarterTurns = 0,
54+
})
55+
```

lib/src/constants/config.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ class CameraPickerConfig {
5151
/// 选择器是否可以录像
5252
final bool enableRecording;
5353

54-
/// Whether the picker can record video.
55-
/// 选择器是否可以录像
54+
/// Whether the picker can record video only.
55+
/// 选择器是否只可以录像
5656
final bool onlyEnableRecording;
5757

5858
/// Whether allow the record can start with single tap.

0 commit comments

Comments
 (0)