[Samsung Galaxy Mega] unclefab:
This thread is now deprecated, look for the all new 5 layouts Floating Multi Windows mod here:

http://xdaforums.com/galaxy-mega/th...-floating-multi-windows-t2820366/post54240351

What about minimizable, maximizable, resizable floating multi windows on your Mega?

Interested?

DISCLAIMER

I'm not responsible for anything that may happen, your Mega, your responsability :eek:. The mod works fine on mine but one never knows, so make sure you have a Nandroid backup in case.

WHERE ARE THE UPDATES?

If you had already installed the previous version (s) just scroll down until the update chapters by the end of this post...

MEGA 5.8 OWNERS

This mod has been tested on Mega 6.3 but it should work as well on Mega 5.8.

Follow the instructions, but DO NOT flash the Floating_Multi_Windows_I9200.zip since it's for the Mega 6.3 only.

If you want the full version on your Mega 5.8, upload your androidpolicy.jar and I'll mod it.

REQUIREMENTS

A rooted Mega I9200 or I9205 on JB 4.2.2, with a custom recovery (either CWM, or TWRP, or whatever) installed.

It works on both odexed and deodexed Roms, but odexed Roms will allow less features. It has been tested on XXUAMEE and I can't tell for sure whether it works on other Roms or not, but my guess is that it does. Please try and report (but don't forget to make a backup beforehands):silly:

MEGA 6.3 ON DEODEXED MJ2

DO NOT flash the Floating_Multi_Windows_I9200.zip attached here cuz it's not compatible with MJ2. Go to post #13, I've attached a MJ2 version there (it has been tested and it works, see post #14).

INSTALLATION

Using your favorite root browser navigate to /system/etc/permissions folder and find com.sec.feature.multiwindow.phone.xml.

Rename it com.sec.feature.multiwindow.phone.xml.bak (do not delete it, in case you want to revert back to static stock multi windows).

That's it for people on an odexed Rom, reboot. Now when you open an app you see an icon at the top right or at the top bottom, press it, the app switches to floating window view (I'll explain everything in a minute, let me finish this paragraph first:cowboy:).

For people on a deodexed Rom, flash in recovery the attached zip (if you are running MJ2 don't flash the zip attached here but the one in post #13), wipe cache and dalvik cache, reboot.

HOW DOES IT WORK?

As said above, now when you open an app you see an icon that enables you to switch to floating mode. In floating mode you see on the top bar a close, a maximize and a pin button, plus a minimize icon (for deodexed Roms only, the difference between odexed and deodexed Roms is that deodexed Roms get on top of the other features a minimize icon and a double tap feature while in floating mode).

The close and maximize icons speak by themselves. The pin button, press it, it becomes green and enables you to keep the floating window (s) allways on screen. With the pin button activated you can resize windows from the bottom, the left and the right.

Use the space between the pin and the other icons to drag and move the window to wherever it pleases you.

While in floating mode you can press the maximize icon, or double tap the center of the bar (deodexed Roms only), to get the window back to full screen mode.The minimize icon (deodexed Roms only) shrinks the window to a bar like on a computer.

Depending on your phone settings the Flash Bar may or may not work. If it still works then you can use it to launch apps directly in floating mode, and you don't need to have the pin activated to be able to rezise windows. What makes it work or not? Good question, when I first set up this mod on my phone it worked, but at one point it stopped and never came back. I have to investigate and well, you are free to investigate too, any help is highly appreciated:D...

Anyway, with or without Flash Bar you can have as many Floating Windows as you want, cool...:good:

YOU WANT TO GO BACK TO THE STOCK STATIC MULTI WINDOWS VIEWS?

No worries, just delete the .bak in the com.sec.feature.multiwindow.phone.xml and reboot. If you flashed the zip don't bother, it won't harm your phone since the editing I made doesn't work when com.sec.feature.multiwindow.phone.xml is active.

NOT ALL YOUR APPS DISPLAY IN FLOATING MODE?

The latest update (7 JULY 2014) takes care of that, just keep on reading ;)

BUGS

1-When one changes screen orientation the floating windows are back to full screen size.

Solution:

change your phone's DPI. I changed mine to 195 and the bug is gone. Don't go below 193 as the systemui doesn't like it and would force close everytime the orientation changes.

2-Some apps that are natively multi windows enabled don't display nicely (they show a huge floating window). To tame them, one has to decompile the app, open res/values/dimens.xml and edit the app default and minimum sizes to have them to look as follows:

<dimen name="app_defaultsize_w">300.0dip</dimen>

<dimen name="app_defaultsize_h">200.0dip</dimen>

<dimen name="app_minimumsize_w">300.0dip</dimen>

<dimen name="app_minimumsize_h">200.0dip</dimen>

300 and 200 are the values I use but of course you can use other values that suit you better. The default size means the size the app has when it's opened in floating mode, and the minimum size means the smallest size you can resize/shrink it.

3-When an apk is minimized as a bar, if one opens a new apk and makes it float the first mimized apk has disappeared. It doesn't happen if two or more apks are open in floating mode and then minimized/maximized (I mean, in that case one can swith between minimize/maximize without loosing the other minimized apks), it happens only if a new apk is opened while one or more are minimized. I don't know if I explained it clearly but play a bit with the mod and you'll see what I mean...

Edit: 11 dec update (see below) more or less fixed this bug.

4-You tell me:cyclops:

UPDATE 11 DEC (Tested on deodexed I9200, but it should work for all 6.3 and 5.8 Mega models)

Today I decided to install the flash bar and some xmls permissions from the note 3, and see what would come out.

To my surprise it brought three interesting improvements.

1 - Multi instance, which means that one can open at the same time two or more windows of the same app (I could open up to 4 windows of the same app, not that I would really use it but just to say:cyclops:).

Quite a handy feature if you want to compare two books, or two maps, or two pics or two whatever, but note that not all apps support multi instance, and note that for some apps one can't open two windows one after the other (one has to open one window of let's say app A, then app B, then one can open a second window of app A with the first app A still open).

2 - The disappearance of minimized bars is gone (still some random disappearing:confused:) when the windows are launched from the flash bar (but it still occurs when they are launched from somewhere else).

3 - The windows are resizable to a very small size, even smaller than the minimized bars (like 50x60, and don't need anymore to have the pin enabled to be resized.

No need to drag the apps from the flash bar, just touch them and they open in floating mode (set your prefered floating size with multi windows manager).

The 5 xmls files are attached below. This zip is not flashable, I did it intentionally in order one to know what files one pushes into one's phone, in case one day one wants to remove them. So you have to unzip first, and then manually copy the 5 xmls to your /system/etc/permissions folder, set perms to rw, r, r (644), reboot.

Careful!

One of these 5 files is called com.sec.feature.multiwindow.xml, and you may think that you already have it in your /system/etc/permissions folder. Well, you certainely have a file that has the same name, but it's not the same file (look at the weight). Rename your existing file com.sec.feature.multiwindow.xml.bak and then copy the new com.sec.feature.multiwindow.xml onto the folder.

A word about static stock multi windows

I tested these files in static stock multi windows (by renaming the com.sec.feature.multiwindow.phone.xml.bak to com.sec.feature.multiwindow.phone.xml, see above) and the multi instance works, plus there is a funky recent multi windows opened apps feature on the top of the flashbar, and a bookmark function on the bottom. Well, I found these features a bit wonky, but I didn't test too much so see by yourself if you feel like it.

Your flash bar doesn't show up, and you don't have the option anymore in your settings?:eek:

It's normal, it's because com.sec.feature.multiwindow.phone.xml has been renamed com.sec.feature.multiwindow.phone.xml.bak.

Rename it com.sec.feature.multiwindow.phone.xml, reboot. Go to display in your settings, enable the flashbar. Check that it appears. Rename again com.sec.feature.multiwindow.phone.xml to com.sec.feature.multiwindow.phone.xml.bak, reboot, your flash bar is still there (Note that you don't have the option to enable/disable it in the settings. You can force stop it from the applications section in the settings, but in that case it won't restart until you reboot).

UPDATE

I found a way to have that multi windows option to show in the settings all the time.

Since it's a heavy file I didn't upload it (my internet connection is dreadful) but if someone wants it then I'll upload it.

I'm a bit busy at the moment and I didn't test all the new features extensively, but if you do and find some tricks or fine settings/improvments please report here. Thanks in advance.:silly:

UPDATE 21 DEC (tested on Mega 6.3 XXUAMEE but it should work on all 6.3 Roms, and probably 5.8's)

It's a two layouts mode, which means that you will have the ability to switch between dual and cascade mode at the press of a button.

Go to your system/app folder and rename FlashBarService.apk to FlashBarservice.apk.bak (in case you need to get back to it if the mod is not compatible with your rom).

Flash the 2LayoutsFlashbarServiceMega.zip, wipe cache and dalvik cache, reboot.

Now open your FlashBar (the bar from where you launch the multi windows) and look at the top, you'll see two icons. That's it, one is for cascade mode, and the other for dual mode. When you press one it turns green, which means that the mode is activated.

If some windows disappeared and you want them back, or if you had too many windows opened in dual mode and want to put everything in order, press the cascade icon and they'll open in cascade mode (but it only works if the apps were still active, if they had been closed it obviously doesn't work).

If the FlashBarService fc, it means that it's not compatible with your rom. In this case delete the FlashBarService.apk from your system/app, remove the .bak you put at the stock one, reboot. If you want it for your rom, upload here your FlashBarservice.apk and your framework-res.apk and I'll mod it to make it two layouts enabled.

UPDATE 7 JULY 2014 (tested on Mega 6.3 DDUCNB1, it should work on other 6.3 Roms but it won't work on Mega 5.8. If you want it for your rom upload your FlashBarService.apk, services.jar, framework-res.apk and I'll mod it)

Here is a mod to make all your apps floating multi windows compatible.

I know that there are some apps here and there that do the same job but the advantage of this mod is that:

1-it works without any third part app which means that you'll save some ram and some battery,

2-with third apps when you install a new app you have to reboot to have that new app to show in the multi windows tray and to have the cascade/minimize icon to appear in full mode, whereas with this mod you don't need to reboot, the app shows straight away in the tray and so does the cascade/minimze icon.

Download AllAppsFloatingMultiWindowsMega6.3.zip, flash it from recovery, clean dalvik cache, reboot.

Bugs:

1-In dual mode, before to minimize a window press the pins from both apps to avoid the black screen issue (you'll understand what I mean when you get it:D).

If you get the black screen no worries, just maximize your windows, or press recents, or home, or settings, well press whatever takes you out from the black. And next time don't forget to pin both the windows before to minimize them:cyclops:...

2-You tell me...

WHAT'S NEXT?

I will mod some files to try to enable 5 layouts or Note 3's quad view, and I will try to add 2-3 things I have in mind. But no promises:eek:

YOU WANT TO HELP MAKE THIS MOD BETTER?

You are welcome!!!!!!!!!!!!

CREDITS

[MENTION=4419114]rovo89[/MENTION] for the amazing Xposed Installer

[MENTION=4948919]xperiacle[/MENTION] cuz he was the one that found out that Samsung Roms are Floating Windows compatible

[MENTION=2176838]THEDEVIOUS1[/MENTION] for porting the mod to the Galaxy Tab 7 Plus, and for all his help when I made my first Floating Windows mod for the Galaxy Grand