mercredi 15 août 2018

Taskbar 4.0 brings back freeform window support to Android Pie devices

Taskbar freeform multiwindow

Support for multiple windows on Android was first popularized by Samsung, but the feature slowly made its way into Android. Android 6.0 Marshmallow introduced split-screen multi-window support while Android 7.0 Nougat quietly added freeform window support, although unlocking freeform window support required either an ADB command or enabling a Developer Option. Unfortunately, with the release of the first Android P Developer Preview, it seemed that freeform window support was removed because the traditional methods used to enable it no longer worked. Thankfully, there’s now a workaround to bring back freeform window support on Android Pie devices, and it doesn’t need root!

XDA Senior Member farmerbb, the developer of Taskbar, discovered the new method to launch freeform windows after the source code of Android 9 Pie was released. I reached out to the developer on Twitter to hear his thoughts on the changes made in Android Pie to app windowing, and here’s what he said:

Android Pie seems to have done away with the concept of “stacks” of windows, and instead introduces something called a WindowConfiguration…Each app window can have a specific windowing mode assigned to it. Freeform windows are just one of the various windowing modes listed. When starting an activity, you can set it to use any windowing mode you want by calling this method (using reflection).

Thus, why the earlier version of Taskbar could no longer launch freeform windows was that Android changed how app window modes are determined. With the source code now being available, farmerbb was able to figure out how to launch freeform windows using the new methods. As he explains:

You can either:

  • Start an activity supplying an ActivityOptions bundle with the setLaunchWindowingMode method called via reflection (requires targetSdk of 27 or earlier, otherwise you’ll run into the non-SDK interface restrictions here.

  • Or, run the am start-activity command via adb with the –windowingMode parameter supplied, for example: adb shell am start-activity –windowingMode 5 com.farmerbb.taskbar/.MainActivity

(If you’re interested in learning how freeform window support worked before Android 9 Pie, check out farmerbb’s excellent guest post on XDA.)

farmerbb chose the first way, so, for now, the app’s targetSdkVersion is 27 and not 28. Once he’s forced to bump the targetSdkVersion to 28, he’ll have to use a workaround that I recommended (if that still works by then.) We’ll cross that bridge when we get to that point, though.

Bring Back Freeform Windows on Android Pie

If you are interested in getting freeform windows on your Android 9 Pie device, then all you have to do is install the latest version of the Taskbar app from the Google Play Store. The latest version, 4.0, is already available. Just install the app and enable freeform mode in the app after following the setup instructions. If you’ve used the app to launch freeform windows in the past, you’ll notice one immediate difference between the previous implementation and how it now works in Android Pie. I’ll let farmerbb explain:

A side effect of this change is that now freeform windows can float on top of fullscreen windows, instead of being limited to their own stack! Pretty cool change, although you can’t keep them pinned on top of the window hierarchy like PIP windows can.

Here’s what that looks like, by the way:

Freeform window on Android 8.1 Oreo Freeform window on Android Pie

Don’t bother using this to force YouTube into a pseudo-PiP mode. It doesn’t work. You’ll just have to wait for YouTube PiP to roll out in your region or upgrade to YouTube Premium. In any case, if you want to use this feature for other purposes, here’s the link to download the app.

Taskbar - PC-style productivity for Android (Free, Google Play) →



from xda-developers https://ift.tt/2Pc2JoM
via IFTTT

Aucun commentaire:

Enregistrer un commentaire