Skip to content
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

Usability on small screens review #212

Closed
KatieWoe opened this issue Apr 16, 2019 · 10 comments
Closed

Usability on small screens review #212

KatieWoe opened this issue Apr 16, 2019 · 10 comments

Comments

@KatieWoe
Copy link
Contributor

KatieWoe commented Apr 16, 2019

Per @kathy-phet's request in phetsims/qa#295 I am making issues in each published sim repo detailing the pointer areas and usability of sims on phone sized screens. Done on an iPhone 7 iOS 12 device.

Potential Difficulties Noticed:

  • Using the +/- buttons on the accordion boxes could be difficult

Screenshots:
Image from iOS (1)
Image from iOS (2)
Image from iOS (3)
Image from iOS

@phetsims phetsims deleted a comment from KatieWoe Apr 16, 2019
@pixelzoom
Copy link
Contributor

pixelzoom commented Apr 16, 2019

  • Using the +/- buttons on the accordion boxes could be difficult

I don't see any good/quick options for improve this.

The API for AccordionBox only supports symmetric dilation of the pointer areas. I.e., pointer areas expand the same amount above/below and left/right of the button.

AccordionBox's button is ExpandCollapseButton, whose superclass is sun's RectangularButtonView. So if we want to support shifting pointer areas, that will require adding the following options to RectangularButtonView:

touchAreaXShift: 0,
touchAreaYShift: 0,
mouseAreaXShift: 0,
mouseAreaYShift: 0,

My question is whether the need here is great enough to justify the amount of work involved.

@KatieWoe
Copy link
Contributor Author

I'm not sure it is. Up to @kathy-phet and @amanda-phet

@pixelzoom
Copy link
Contributor

pixelzoom commented Apr 16, 2019

Actually, this doesn't look that difficult. In RectangularButtonView, add the options shown above. Then change this:

    // set pointer areas
    this.touchArea = button.localBounds.dilatedXY( options.touchAreaXDilation, options.touchAreaYDilation );
    this.mouseArea = button.localBounds.dilatedXY( options.mouseAreaXDilation, options.mouseAreaYDilation );

to this:

    // set pointer areas
    this.touchArea = button.localBounds.dilatedXY( options.touchAreaXDilation, options.touchAreaYDilation ).shifted( options.touchAreaXShift,  options.touchAreaYShift );
    this.mouseArea = button.localBounds.dilatedXY( options.mouseAreaXDilation, options.mouseAreaYDilation ).shifted( options.mouseAreaXShift,  options.mouseAreaYShift );

@pixelzoom
Copy link
Contributor

A better API for RectangularButtonView might be:

touchAreaXAlign: 'center', // left, right, center
touchAreaYAlign: 'center', // top, bottom, center

This doesn't support arbitrary shifting, but makes it easier to specify the typical cases.

@pixelzoom
Copy link
Contributor

I've created phetsims/sun#500 to track the general enhancement that would be required in RectangularButtonView.

@arouinfar Let me know whether you think we need to address this issue, because it will affect the priority of the more general issue.

@arouinfar
Copy link

The solution you've proposed seems pretty straightforward @pixelzoom. Generally, I think it would be a worthy investment to add support for asymmetric dilation of touch areas to RectangularButtonView, as the ExpandCollapseButton's are a bit hard to use on my phone.

The reality is that many teachers do have students pull up sims on their phones. Given that we have iOS and Android apps, it seems like a bit of a cop-out out not to optimize touch areas. However, it is entirely up to @kathy-phet and @ariel-phet to decide how much developer time we should be investing into common code changes.

@ariel-phet
Copy link

@pixelzoom @arouinfar I agree worth the time, especially since it seems like a generally good improvement to the flexibility of RectangularButtonView

@pixelzoom
Copy link
Contributor

Blocked by phetsims/sun#500.

@pixelzoom
Copy link
Contributor

Touch areas for all expand/collapse buttons in this sim are now shifted up, see sample screenshot below. @arouinfar could you please review?

screenshot_1175

@arouinfar
Copy link

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants