LightBlog

dimanche 18 octobre 2015

Enable One-Handed Mode using a Script

reachability

Bigger Isn’t Always Better

With the advent of bigger phone screens, it’s nearly impossible for most people to reach every corner of their phone using only one-hand (unless you’re LeBron James). Yet big phones like those from the Note series are still very popular due to how comfortable they are is to consume video and web content. Some manufacturers recognize that their customers will often face a situation where they want to use their phone with only one hand, so they’ve built in ‘one-handed mode’ options to resize the contents of the display on the fly. For example, Galaxy Note phones have a setting to shrink the screen to a single corner, and Apple has recently introduced their own solution called ‘Reachability’ to bump the screen contents halfway down the display. But for phones like the Nexus 6, you don’t have any stock options to enable one-handed mode.

Overscan Compensation

        Luckily, we can take advantage of a feature that’s typically not supposed to be used for phone displays at all. It’s called correcting for ‘overscan’. In an effort to always present a full-screen experience for TV viewers, many TVs may clip the edges of the input display, resulting in overscan. Thus to correct for this in Android, Google allowed developers with API Level 18 (Android 4.3 KitKat) to start using overscan margins to compensate for the display mismatch. Google also shifted a few display options such as resolution/DPI changing from the ‘am’ shell command (ActivityManager) to ‘wm’ shell command (WindowManager) and introduced the ‘overscan’ command to enable developers to easily test their apps right on their devices.

One-Handed Mode Demonstration

One-Handed Mode Demonstration

Requirements

  • You MUST be rooted.
  • You MUST be on Android 4.3+
  • Be warned that this persists on reboot. Do not set any of the below values high enough that you cannot sufficiently operate your device. If you mess up, you can perform the reset command using adb.
  • It’s optional, but highly recommended, that you use an automation app such as Tasker to bind the shell command to an action such as swipe up on home button or shake left-right.

Here are the commands you’ll need.

    wm overscan LEFT,TOP,RIGHT,BOTTOM

where each direction is a pixel count that represents how far from that direction the display should move. For example, if you set TOP to 600, the contents of your screen will move 600 pixels down. You can experiment with a combination of each to best find a set of values that will shrink the screen to your liking. You can mimic Apple’s Reachability for example by setting TOP to half your vertical resolution. In order to reset the overscan, simply use:

    wm overscan reset

Pretty simple! It works well for shrinking the screen down to reach a button, but I’ve personally had some Google keyboard issues with it. Give it a shot and let us know in the comments if you find any issues!



from xda-developers » xda-developers | Enable One-Handed Mode using a Script http://ift.tt/1VZn0cI
via IFTTT

Aucun commentaire:

Enregistrer un commentaire