Commit 7a3c0a2e authored by Hans Muller's avatar Hans Muller Committed by GitHub

Draw a smoother overscroll indicator on Android (#4945)

parent 773f4042
...@@ -200,7 +200,7 @@ final List<GalleryItem> kAllGalleryItems = <GalleryItem>[ ...@@ -200,7 +200,7 @@ final List<GalleryItem> kAllGalleryItems = <GalleryItem>[
), ),
new GalleryItem( new GalleryItem(
title: 'Tabs', title: 'Tabs',
subtitle: 'Tabs with indepdently scrollable views', subtitle: 'Tabs with independently scrollable views',
routeName: TabsDemo.routeName, routeName: TabsDemo.routeName,
buildRoute: (BuildContext context) => new TabsDemo() buildRoute: (BuildContext context) => new TabsDemo()
), ),
......
...@@ -31,7 +31,7 @@ class _Painter extends CustomPainter { ...@@ -31,7 +31,7 @@ class _Painter extends CustomPainter {
void paintIndicator(Canvas canvas, Size size) { void paintIndicator(Canvas canvas, Size size) {
final double rectBias = extent / 2.0; final double rectBias = extent / 2.0;
final double arcBias = extent; final double arcBias = extent * 0.66;
final Path path = new Path(); final Path path = new Path();
switch(scrollDirection) { switch(scrollDirection) {
...@@ -41,12 +41,12 @@ class _Painter extends CustomPainter { ...@@ -41,12 +41,12 @@ class _Painter extends CustomPainter {
path.moveTo(0.0, 0.0); path.moveTo(0.0, 0.0);
path.relativeLineTo(width, 0.0); path.relativeLineTo(width, 0.0);
path.relativeLineTo(0.0, rectBias); 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 { } else {
path.moveTo(0.0, size.height); path.moveTo(0.0, size.height);
path.relativeLineTo(width, 0.0); path.relativeLineTo(width, 0.0);
path.relativeLineTo(0.0, -rectBias); 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; break;
case Axis.horizontal: case Axis.horizontal:
...@@ -55,12 +55,12 @@ class _Painter extends CustomPainter { ...@@ -55,12 +55,12 @@ class _Painter extends CustomPainter {
path.moveTo(0.0, 0.0); path.moveTo(0.0, 0.0);
path.relativeLineTo(0.0, height); path.relativeLineTo(0.0, height);
path.relativeLineTo(rectBias, 0.0); 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 { } else {
path.moveTo(size.width, 0.0); path.moveTo(size.width, 0.0);
path.relativeLineTo(0.0, height); path.relativeLineTo(0.0, height);
path.relativeLineTo(-rectBias, 0.0); 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; break;
} }
......
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