Adding swipe suppoprt to s6 launcher
For dearest @The Sickness!
As promised, I am writing what I found about swipe support for s6 launcher:
Now... you will need to make sure that you delete that image for the users upon rom installation and make sure they either make clean install or clear data to the launcher.
Now to the animation. Samsung make the briefing app open with no animation (because they dont want you to see it opens on top of the snapshot...)
So... navigate to /res/anim and find two files home_zero_page_fade_in.xml and home_zero_page_fade_out.xml
In home_zero_page_fade_in.xml replace all text with:
and in home_zero_page_fade_out.xml replace all code with this:
Now you also have a nice slide from the side animation for your swipe app.
This is the most you can get out of the s6 launcher. I am very happy with the result. The amount of smali I had to read for that is enormous. I tried different mods in smali to achieve this result but in the end this way seems to be the easiest.
If your users want to have the briefing app back, they have 2 choices. They need to install one of the apps that allow you to create activity shortcut. Once they do, they will have it show on the list of "use custom shortcut" in our app. Then they can choos the swipe action to open the flipboard main activity. or I can create a simple app for you and call it "My Magazine" which will just launch the magazine all (the boxer app for flipboard is not launcher category, so they cant choose it from the app list).
For dearest @The Sickness!
As promised, I am writing what I found about swipe support for s6 launcher:
- The swipe support is in a differens smali: you need to navigate to /smali/com/sec/android/app/launcher/activities/LauncherActivity
- There you need to find this line: .local v6, "pm":Landroid/content/pm/PackageManager;
- You will see the first string with the flipboard app package name couple of lines below and when you scroll some more, you will see after this line (new-instance v11, Landroid/content/ComponentName) another two strings (onw with package name and one with default class name). To remind you the package name of our app is com.wubydax.geartwswipe and the Activity name you need is com.wubydax.geartwswipe.SetAppActivity.
- After you replaced the three strings (first and second with package name and third with activity name), save and exit
- Now... Samsung, the geniuses that they are, introduce a new feature to the launcher on s6. It has a snapshot of the first time you open the briefing app and it saves it and uses it on the future openings. So we need to take care of that...
- Navigate to: /res/drawable/drawable-sw360dp-xxxhdpi and you will find 3 images there (which you cannot see): home_zeropage_briefing_bg, home_zeropage_briefing_chn, home_zeropage_briefing_usa. You need to replace all 3 with... well anything you want. I suggest using just a transparent png. For our rom I used a png that says (6thGear TWSwipe). I will attach them for you. Delete the old ones... or it will not compile. The old ones are not png...
- Now you would think that this is all... BUT! Samsing has already saved the screenshot for you. It's located in /storage/emulated/0/Android/data/.com.sec.android.app.launcher.cache/briefing.jpg
- After you installed your new apk with edited swipe and replaced images, delete that jpg file. DO NOT OPEN THE ZERO PAGE NOW (or it will take a snapshot again).
- Wipe data to the launcher from application manager
- There you go. You have your own swipe page clean from briefing snapshot.
Now... you will need to make sure that you delete that image for the users upon rom installation and make sure they either make clean install or clear data to the launcher.
Now to the animation. Samsung make the briefing app open with no animation (because they dont want you to see it opens on top of the snapshot...)
So... navigate to /res/anim and find two files home_zero_page_fade_in.xml and home_zero_page_fade_out.xml
In home_zero_page_fade_in.xml replace all text with:
Code:
<?xml version="1.0" encoding="utf-8"?>
<set android:shareInterpolator="false"
xmlns:android="http://schemas.android.com/apk/res/android">
<translate android:interpolator="@android:interpolator/decelerate_cubic" android:duration="1000" android:fromXDelta="-100.0%" android:toXDelta="0.0" />
<alpha android:interpolator="@android:interpolator/decelerate_cubic" android:duration="@android:integer/config_shortAnimTime" android:fromAlpha="0.5" android:toAlpha="1.0" />
</set>
Code:
<?xml version="1.0" encoding="utf-8"?>
<set android:shareInterpolator="false"
xmlns:android="http://schemas.android.com/apk/res/android">
<translate android:interpolator="@android:interpolator/decelerate_cubic" android:duration="1000" android:fromXDelta="0.0" android:toXDelta="-100.0%" />
<alpha android:interpolator="@android:interpolator/decelerate_cubic" android:duration="@android:integer/config_shortAnimTime" android:fromAlpha="1.0" android:toAlpha="0.5" />
</set>
Now you also have a nice slide from the side animation for your swipe app.
This is the most you can get out of the s6 launcher. I am very happy with the result. The amount of smali I had to read for that is enormous. I tried different mods in smali to achieve this result but in the end this way seems to be the easiest.
If your users want to have the briefing app back, they have 2 choices. They need to install one of the apps that allow you to create activity shortcut. Once they do, they will have it show on the list of "use custom shortcut" in our app. Then they can choos the swipe action to open the flipboard main activity. or I can create a simple app for you and call it "My Magazine" which will just launch the magazine all (the boxer app for flipboard is not launcher category, so they cant choose it from the app list).
Attachments
Last edited: