FORUMS
Remove All Ads from XDA

[GUIDE][Difficulty: Intermediate] Hold/Swipe-up Home Button to Enable One-Handed Mode

833 posts
Thanks Meter: 1,866
 
Post Reply Email Thread
A few months back, I wrote about a hacky way to enable one-handed mode using a shell script, taken from this reddit thread. With this task (provided you have root access), you can enable one-handed mode just by holding down the home button or swiping-up from it.

Prerequisites
  • Root access

Instructions
  1. (For Android 6.0+) Go to Settings --> Apps. Press the settings cog up top, then go to Default Apps. Enter "Assist & Voice Input" and for the "Assist App" choose Tasker. Be warned that doing this will stop the "OK Google" on every screen (and off) from working, but if you're okay with that then go ahead and change it!
  2. (For Android < 6.0) Clear the default app that is set for swiping up from the home button. You will enable Tasker as your default app after you're done following the rest of the steps below.
  3. Create a new profile and name it whatever you want, then choose the Event context. Go to UI, then choose Assistance Request.
  4. Back out, and create a new task named 'Overscan' or whatever else you want.


Now, we'll make the actions needed for the task itself.
  1. Task --> If. Set the condition to %Overscan eq 1.
  2. Code --> Run Shell. For the Command, type in wm overscan reset. Check "Use Root" and then back out.
  3. Variables --> Variable Set. Under Name, choose %Overscan, and set it to 0.
  4. Task --> Else.
  5. Code --> Run Shell. For the command, type in wm overscan LEFT,TOP,RIGHT,BOTTOM where each of the directions are the pixel counts that the screen will shift in. On my Nexus 6p, I've set it to wm overscan 0,845,0,0. See my article for examples.
  6. Variables --> Variable Set. For Name choose %Overscan and set it to 1.
  7. Task --> End If.


That's it! Now when you swipe-up/long press the home button, you'll launch the Overscan tasker task which will shift your screen depending on whether or not it has already been shifted. The %Overscan variable is a global variable that is set to 1 if the screen is shifted and 0 if not.

Of course, this isn't the only thing you can do with long-pressing the home button. You can also do and set the Assistance Request to open a web-search overlay on any app.
The Following 15 Users Say Thank You to MishaalRahman For This Useful Post: [ View ] Gift MishaalRahman Ad-Free
 
 
9th March 2016, 06:19 PM |#2  
Member
Flag cdmx
Thanks Meter: 18
 
More
Un 6.0.1 i don't have the option to change the assist app to tasker
9th March 2016, 07:04 PM |#3  
Senior Member
Thanks Meter: 76
 
More
Quote:
Originally Posted by mi_guel69

Un 6.0.1 i don't have the option to change the assist app to tasker

+1
The Following User Says Thank You to moso11 For This Useful Post: [ View ] Gift moso11 Ad-Free
9th March 2016, 10:17 PM |#4  
MishaalRahman's Avatar
OP Editor in Chief
Thanks Meter: 1,866
 
More
Quote:
Originally Posted by mi_guel69

Un 6.0.1 i don't have the option to change the assist app to tasker

Quote:
Originally Posted by Umer520

+1

Tasker's Accessibility Service should be enabled for it to show up, try that.
10th March 2016, 03:47 PM |#5  
Junior Member
Thanks Meter: 1
 
More
Quote:

Tasker's Accessibility Service should be enabled for it to show up, try that.

I have this enabled and tasker still doesnt show up.
11th March 2016, 03:37 PM |#6  
Junior Member
Flag Ivano-Frankivsk
Thanks Meter: 0
 
More
Set to shake event instead
When I just use play button in Tasker it works fine, but if I shake it sets only top overscan ignoring rest parameters
Oneplus2, CM13
14th March 2016, 12:03 AM |#7  
Member
Thanks Meter: 12
 
More
Quote:
Originally Posted by mrorange4287

I have this enabled and tasker still doesnt show up.

I had this problem as well. Create the profile with the context event "Assistance Request" and it will be available for you use set in the Assist menu
14th March 2016, 10:38 AM |#8  
Senior Member
Flag Berlin
Thanks Meter: 119
 
More
@MishaalRahman
Thanks for this great guide! I first set it up as suggested and then switched it to a shake event, quite handy. I might end up using this with a swipe gesture from Nova launcher.

Do you have any idea how we could realize a shrinking screen just like Samsungs one handed mode? Example here -> http://www.androidcentral.com/sites/...ize-screen.jpg

I did some research and I think it might work using the commands "wm size" and/or "wm density", but I have very little knowledge about how to use them properly. Maybe you can help me out on this...?
14th March 2016, 05:48 PM |#9  
Junior Member
Thanks Meter: 1
 
More
https://imgur.com/a/e3e3y

When I use this in the home screen and all drawer I get what's in the pictures. Any thing I need to change to fix this? I am using Nova launcher on a rooted nexus 6.
14th March 2016, 08:59 PM |#10  
b.age's Avatar
Junior Member
Flag Milan
Thanks Meter: 4
 
More
Hi, nice works but how to set correct overscan? I'm using OP2
15th March 2016, 04:29 AM |#11  
MishaalRahman's Avatar
OP Editor in Chief
Thanks Meter: 1,866
 
More
Quote:
Originally Posted by digitalpig82

@MishaalRahman
Thanks for this great guide! I first set it up as suggested and then switched it to a shake event, quite handy. I might end up using this with a swipe gesture from Nova launcher.

Do you have any idea how we could realize a shrinking screen just like Samsungs one handed mode? Example here -> http://www.androidcentral.com/sites/androidcentral.com/files/styles/xlarge/public/article_images/2015/09/note-5-reduce-screen-size-screen.jpg

I did some research and I think it might work using the commands "wm size" and/or "wm density", but I have very little knowledge about how to use them properly. Maybe you can help me out on this...?

To mimic Samsung's implementation, you will have to change the LEFT and RIGHT parameters. However be noted that it will really mess with a lot of apps and they won't display properly.

Quote:
Originally Posted by mrorange4287

https://imgur.com/a/e3e3y

When I use this in the home screen and all drawer I get what's in the pictures. Any thing I need to change to fix this? I am using Nova launcher on a rooted nexus 6.

Some apps just don't turn out that well, unfortunately. Like I said this is a very hacky method.


Quote:
Originally Posted by b.age

Hi, nice works but how to set correct overscan? I'm using OP2

Experiment a bit. Make sure you set a fail safe to revert it back to normal, say if you shake your phone.
The Following 3 Users Say Thank You to MishaalRahman For This Useful Post: [ View ] Gift MishaalRahman Ad-Free
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes