Open mihir-io opened 2 years ago
I looked into playing a silent audio file for my use-case, but this seems a far more robust way to keep the app running. LGTM
I rebased these changes against the latest branch and added the landscape fix in my branch here: https://github.com/regulad/iOS-SOCKS-Server/tree/feature/fullscreen
I also applied Black since you had some single quoted strings.
Didn't want to clobber your PR or steal your thunder. Feel free force push your branch to mine!
@regulad I won't have access to my usual machine with Git for a few days. If you want to, feel free to go ahead and force push the branch -- I'm not worried about credit or anything. Otherwise I'll try to get to it sometime next week.
@regulad I won't have access to my usual machine with Git for a few days. If you want to, feel free to go ahead and force push the branch -- I'm not worried about credit or anything. Otherwise I'll try to get to it sometime next week.
I don't have write access. I'll just open a new PR.
This PR addresses issue #8 and adds a popover pane that can essentially 'black out' the display, which for OLED-based iPhones means that the screen doesn't emit any light, and therefore saves battery life.
The way it works is to add a separate pane adjacent to the console window that has a single button to enable full-screen mode. Clicking that button will add a sub-view that opens the popover to black out the screen. By swiping down on the popover, you can close the popover and exit the pseudo-fullscreen mode while keeping the proxy server running. To enter full screen again, simply click the button from the side pane.
There are a couple caveats with this approach, that I'm planning to look into more for the future:
DEBUG
toERROR
can reduce the rate that it changes focus over. And is probably very slightly better for performance/battery life anyways, if you don't need it to log every connection/request.I think if I switched to the Scene library instead of the UI one, it might be possible to remove the battery charging icon in portrait mode. The home bar is probably there to stay outside of using guided access mode.
Photos:
The side pane with the "enter full screen" button, adjacent to the console
The fullscreen view in portrait mode while charging
Tested on iPhone 7 and 13 Pro.