Skip to content

Commit

Permalink
💄 Roll UI design WeChat 8.3.x (#181)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexV525 authored Jul 29, 2023
1 parent 12eb505 commit 90df06d
Show file tree
Hide file tree
Showing 8 changed files with 544 additions and 234 deletions.
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,26 @@ that can be found in the LICENSE file. -->

# Changelog

See the [Migration Guide](guides/migration_guide.md) for the details of breaking changes between versions.

## 4.0.0-dev.1

To know more about breaking changes, see [Migration Guide][].

### New features

- Sync all UI details from WeChat 8.3.x. (#181)

### Improvements

- Improve the experience when using the exposure slider.
- Prefer `FlashMode.off` for better performance.
- Allow `cameras` to be set repeatedly.

### Fixes

- Fix accessibility on the switch cameras button.

## 3.8.0

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

- Support taking pictures and videos.
- Support video recording duration limitation.

[Migration Guide]: guides/migration_guide.md
39 changes: 27 additions & 12 deletions README-ZH.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,31 @@ Language: [English](README.md) | 中文简体
[**仿微信资源选择器**](https://pub.flutter-io.cn/packages/wechat_assets_picker) 的扩展。
选择器基于 `camera` 实现相机相关功能,`photo_manager` 实现资源相关内容。

## 目录 🗂

- [Flutter WeChat Camera Picker](#flutter-wechat-camera-picker)
- [目录 🗂](#目录-)
- [特性 ✨](#特性-)
- [截图 📸](#截图-)
- [准备工作 🍭](#准备工作-)
- [使用方法 📖](#使用方法-)
- [简单的使用方法](#简单的使用方法)
- [使用配置](#使用配置)
- [常见问题 💭](#常见问题-)
- [iOS 上的预览在旋转时行为诡异](#iOS-上的预览在旋转时行为诡异)
当前的界面设计基于的微信版本:**8.3.x**
界面更新将在微信版本更新后随时进行跟进。

查看 [迁移指南][] 了解如何从破坏性改动中迁移为可用代码。

<details>
<summary>Table of content</summary>

<!-- TOC -->
* [Flutter WeChat Camera Picker](#flutter-wechat-camera-picker)
* [特性 ✨](#特性-)
* [截图 📸](#截图-)
* [准备工作 🍭](#准备工作-)
* [版本限制](#版本限制)
* [配置](#配置)
* [Android 13 (API 33) 权限配置](#android-13-api-33-权限配置)
* [使用方法 📖](#使用方法-)
* [简单的使用方法](#简单的使用方法)
* [使用配置](#使用配置)
* [简单的使用方法](#简单的使用方法-1)
* [使用自定义的 `State`](#使用自定义的-state)
* [常见问题 💭](#常见问题-)
* [iOS 上的预览在旋转时行为诡异](#ios-上的预览在旋转时行为诡异)
<!-- TOC -->
</details>

## 特性 ✨

Expand Down Expand Up @@ -164,3 +177,5 @@ final AssetEntity? entity = await CameraPicker.pickFromCamera(
你可以在这个 issue 里了解更多相关的信息:
https://github.com/flutter/flutter/issues/89216
除此之外的问题,你可以提交 issue 进行提问。

[迁移指南]: https://github.com/fluttercandies/flutter_wechat_camera_picker/blob/main/guides/migration_guide.md
40 changes: 27 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,31 @@ A **camera picker** based on WeChat's UI which is a separate runnable extension
The package based on `camera` for camera functions
and `photo_manager` for asset implementation.

## Category 🗂

- [Flutter WeChat Camera Picker](#flutter-wechat-camera-picker)
- [Category 🗂](#category-)
- [Features ✨](#features-)
- [Screenshots 📸](#screenshots-)
- [Preparing for use 🍭](#preparing-for-use-)
- [Usage 📖](#usage-)
- [Simple usage](#simple-usage)
- [With configurations](#with-configurations)
- [Frequently asked question 💭](#frequently-asked-question-)
- [Why the orientation behavior is strange on iOS?](#why-the-orientation-behavior-is-strange-on-ios)
- [Contributors ✨](#contributors-)
Current WeChat version that UI based on: **8.3.x**
UI designs will be updated following the WeChat update in anytime.

See the [Migration Guide][] to learn how to migrate between breaking changes.

<details>
<summary>Table of content</summary>

<!-- TOC -->
* [Flutter WeChat Camera Picker](#flutter-wechat-camera-picker)
* [Features ✨](#features-)
* [Screenshots 📸](#screenshots-)
* [Preparing for use 🍭](#preparing-for-use-)
* [Version constraints](#version-constraints)
* [Setup](#setup)
* [Android 13 (API 33) permissions](#android-13-api-33-permissions)
* [Usage 📖](#usage-)
* [Simple usage](#simple-usage)
* [With configurations](#with-configurations)
* [Using custom `State`s](#using-custom-states)
* [Frequently asked question 💭](#frequently-asked-question-)
* [Why the orientation behavior is strange on iOS?](#why-the-orientation-behavior-is-strange-on-ios)
* [Contributors ✨](#contributors-)
<!-- TOC -->
</details>

## Features ✨

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

<!-- ALL-CONTRIBUTORS-LIST:END -->
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!

[Migration Guide]: https://github.com/fluttercandies/flutter_wechat_camera_picker/blob/main/guides/migration_guide.md
2 changes: 1 addition & 1 deletion example/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: wechat_camera_picker_demo
description: A new Flutter project.
version: 3.8.0+23
version: 4.0.0+24
publish_to: none

environment:
Expand Down
55 changes: 55 additions & 0 deletions guides/migration_guide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<!-- Copyright 2019 The FlutterCandies author. All rights reserved.
Use of this source code is governed by an Apache license
that can be found in the LICENSE file. -->

# Migration Guide

This document gathered all breaking changes and migrations requirement between major versions.

## Versions

- [4.0.0](#400)

## 4.0.0

### Summary

> If you don't extend your customized `CameraPickerState`
> or you didn't override below methods, you can stop reading.
In order to sync the UI details with the latest WeChat style (v8.3.0),
few naming or signatures of methods are changed. including:
- `restartDisplayModeDisplayTimer`
- `buildBackButton`
- `buildCameraPreview`
- `buildCaptureButton`
- `buildFocusingPoint`

### Details

- `restartDisplayModeDisplayTimer` is renamed to `restartExposureModeDisplayTimer`.
- `buildBackButton` no more requires `BoxConstraints constraints` as an argument,
the signature is `Widget buildBackButton(BuildContext context)` from now on.
- `buildCameraPreview` no more requires `DeviceOrientation orientation` as an argument
since the implementation does not really use it.
It now requires `CameraValue cameraValue` as an argument. So the signature becomes:
```dart
Widget buildCameraPreview({
required BuildContext context,
required CameraValue cameraValue,
required BoxConstraints constraints,
})
```
- `buildCaptureButton` now requires `BuildContext context` as an argument. So the signature becomes:
```dart
Widget buildCaptureButton(BuildContext context, BoxConstraints constraints)
```
- `buildFocusingPoint` now adds `int quarterTurns` to make internal quarter turns.
So the signature becomes:
```dart
Widget buildFocusingPoint({
required CameraValue cameraValue,
required BoxConstraints constraints,
int quarterTurns = 0,
})
```
4 changes: 2 additions & 2 deletions lib/src/constants/config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ class CameraPickerConfig {
/// 选择器是否可以录像
final bool enableRecording;

/// Whether the picker can record video.
/// 选择器是否可以录像
/// Whether the picker can record video only.
/// 选择器是否只可以录像
final bool onlyEnableRecording;

/// Whether allow the record can start with single tap.
Expand Down
Loading

0 comments on commit 90df06d

Please sign in to comment.