Skip to content

iOS 13 scrollbar vibration #37724

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 9, 2019
Merged

Conversation

justinmc
Copy link
Contributor

@justinmc justinmc commented Aug 6, 2019

Description

It was pointed out that the recent implementation of draggable scrollbars doesn't include the vibration feedback that native iOS 13 does. This PR adds the vibration.

Related Issues

#37724
#35127

Tests

I tested that exactly one vibration happens at the start of both types of scrollbar dragging.

@justinmc justinmc added framework flutter/packages/flutter repository. See also f: labels. f: cupertino flutter/packages/flutter/cupertino repository labels Aug 6, 2019
@justinmc justinmc requested a review from HansMuller August 6, 2019 22:15
@justinmc justinmc self-assigned this Aug 6, 2019
Copy link
Contributor

@HansMuller HansMuller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@HansMuller HansMuller changed the title Ios13 scrollbar vibration iOS 13 scrollbar vibration Aug 6, 2019
@justinmc justinmc merged commit 361730e into flutter:master Aug 9, 2019
@justinmc justinmc deleted the ios13-scrollbar-vibration branch August 9, 2019 22:45
@valeriylu
Copy link

valeriylu commented Jul 3, 2020

Is this still working?
I tried with both the Scrollbar and CupertinoScrollbar and there were no vibrations

@justinmc
Copy link
Contributor Author

justinmc commented Jul 6, 2020

@valeriylu It seems to work for me, I just tried this on my iPhone 7 running iOS 13 on Flutter's latest master. I long pressed on the scrollbar thumb. Here's the code I used:

import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return CupertinoApp(
      title: 'Cupertino App',
      home: CupertinoPageScaffold(
        child: CupertinoScrollbar(
          child: ListView.builder(
            itemCount: 100,
            itemBuilder: (BuildContext context, int index) {
              return Card(
                child: Text('child #$index'),
              );
            },
          ),
        ),
      ),
    );
  }
}

@valeriylu
Copy link

@justinmc
Thanks for checking. I'm testing on an iPhone 6s running ios 13 and it seems like CupertinoScrollbar uses UIFeedbackGenerator. Looking online, it seems like that api is not supported on the 6s.
https://stackoverflow.com/questions/39564510/check-if-device-supports-uifeedbackgenerator-in-ios-10

@justinmc
Copy link
Contributor Author

justinmc commented Jul 7, 2020

Ah got it.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 30, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
f: cupertino flutter/packages/flutter/cupertino repository framework flutter/packages/flutter repository. See also f: labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants