Unverified Commit 396298fb authored by xster's avatar xster Committed by GitHub

Give more room for the front layer drag on iPhone X for new Gallery (#16975)

* Give more room for the front layer drag on iPhone X

* Tweak the animation visual effects

* review lint
parent f8fe5e3c
...@@ -9,7 +9,7 @@ import 'package:flutter/rendering.dart'; ...@@ -9,7 +9,7 @@ import 'package:flutter/rendering.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
const double _kFrontHeadingHeight = 32.0; // front layer beveled rectangle const double _kFrontHeadingHeight = 32.0; // front layer beveled rectangle
const double _kFrontClosedHeight = 72.0; // front layer height when closed const double _kFrontClosedHeight = 92.0; // front layer height when closed
const double _kBackAppBarHeight = 56.0; // back layer (options) appbar height const double _kBackAppBarHeight = 56.0; // back layer (options) appbar height
// The size of the front layer heading's left and right beveled corners. // The size of the front layer heading's left and right beveled corners.
...@@ -204,6 +204,7 @@ class Backdrop extends StatefulWidget { ...@@ -204,6 +204,7 @@ class Backdrop extends StatefulWidget {
class _BackdropState extends State<Backdrop> with SingleTickerProviderStateMixin { class _BackdropState extends State<Backdrop> with SingleTickerProviderStateMixin {
final GlobalKey _backdropKey = new GlobalKey(debugLabel: 'Backdrop'); final GlobalKey _backdropKey = new GlobalKey(debugLabel: 'Backdrop');
AnimationController _controller; AnimationController _controller;
Animation<double> _frontOpacity;
@override @override
void initState() { void initState() {
...@@ -213,6 +214,14 @@ class _BackdropState extends State<Backdrop> with SingleTickerProviderStateMixin ...@@ -213,6 +214,14 @@ class _BackdropState extends State<Backdrop> with SingleTickerProviderStateMixin
value: 1.0, value: 1.0,
vsync: this, vsync: this,
); );
_frontOpacity =
new Tween<double>(begin: 0.2, end: 1.0).animate(
new CurvedAnimation(
parent: _controller,
curve: const Interval(0.0, 0.4, curve: Curves.easeInOut),
),
);
} }
@override @override
...@@ -310,7 +319,10 @@ class _BackdropState extends State<Backdrop> with SingleTickerProviderStateMixin ...@@ -310,7 +319,10 @@ class _BackdropState extends State<Backdrop> with SingleTickerProviderStateMixin
child: new _IgnorePointerWhileStatusIsNot( child: new _IgnorePointerWhileStatusIsNot(
AnimationStatus.completed, AnimationStatus.completed,
controller: _controller, controller: _controller,
child: widget.frontLayer, child: new FadeTransition(
opacity: _frontOpacity,
child: widget.frontLayer,
),
), ),
), ),
), ),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment