From 7a3c0a2eba68db58963c25bd68e66d26560ecf50 Mon Sep 17 00:00:00 2001 From: Hans Muller Date: Mon, 18 Jul 2016 12:20:00 -0700 Subject: [PATCH] Draw a smoother overscroll indicator on Android (#4945) --- examples/flutter_gallery/lib/gallery/item.dart | 2 +- .../flutter/lib/src/material/overscroll_indicator.dart | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/flutter_gallery/lib/gallery/item.dart b/examples/flutter_gallery/lib/gallery/item.dart index 4112e6206c..ab65da3034 100644 --- a/examples/flutter_gallery/lib/gallery/item.dart +++ b/examples/flutter_gallery/lib/gallery/item.dart @@ -200,7 +200,7 @@ final List kAllGalleryItems = [ ), new GalleryItem( title: 'Tabs', - subtitle: 'Tabs with indepdently scrollable views', + subtitle: 'Tabs with independently scrollable views', routeName: TabsDemo.routeName, buildRoute: (BuildContext context) => new TabsDemo() ), diff --git a/packages/flutter/lib/src/material/overscroll_indicator.dart b/packages/flutter/lib/src/material/overscroll_indicator.dart index 74b8d3f9f9..1a9df12d1f 100644 --- a/packages/flutter/lib/src/material/overscroll_indicator.dart +++ b/packages/flutter/lib/src/material/overscroll_indicator.dart @@ -31,7 +31,7 @@ class _Painter extends CustomPainter { void paintIndicator(Canvas canvas, Size size) { final double rectBias = extent / 2.0; - final double arcBias = extent; + final double arcBias = extent * 0.66; final Path path = new Path(); switch(scrollDirection) { @@ -41,12 +41,12 @@ class _Painter extends CustomPainter { path.moveTo(0.0, 0.0); path.relativeLineTo(width, 0.0); path.relativeLineTo(0.0, rectBias); - path.relativeQuadraticBezierTo(width / -2.0, arcBias, -width, 0.0); + path.relativeCubicTo(width * -0.25, arcBias, width * -0.75, arcBias, -width, 0.0); } else { path.moveTo(0.0, size.height); path.relativeLineTo(width, 0.0); path.relativeLineTo(0.0, -rectBias); - path.relativeQuadraticBezierTo(width / -2.0, -arcBias, -width, 0.0); + path.relativeCubicTo(width * -0.25, -arcBias, width * -0.75, -arcBias, -width, 0.0); } break; case Axis.horizontal: @@ -55,12 +55,12 @@ class _Painter extends CustomPainter { path.moveTo(0.0, 0.0); path.relativeLineTo(0.0, height); path.relativeLineTo(rectBias, 0.0); - path.relativeQuadraticBezierTo(arcBias, height / -2.0, 0.0, -height); + path.relativeCubicTo(arcBias, height * -0.25, arcBias, height * -0.75, 0.0, -height); } else { path.moveTo(size.width, 0.0); path.relativeLineTo(0.0, height); path.relativeLineTo(-rectBias, 0.0); - path.relativeQuadraticBezierTo(-arcBias, height / -2.0, 0.0, -height); + path.relativeCubicTo(-arcBias, height * -0.25, -arcBias, height * -0.75, 0.0, -height); } break; }