[Android Themes] zhaozihanzzh:
Hello to everyone.

Material Recent for Gingerbread

Made by zhaozihanzzh（ME Failed Coder）, Open source

Created 2018-07-24

Last updated 2018-08-10

Note: If your native language is Chinese, you can go to this thread.

Hello guys. I have been making this material recent for a while. The project is based on [MENTION=5366279]tentenponce[/MENTION] 's SwipeRecentApps and ZieIony's library MaterialRecents. And I used m0r0's code to fix some bugs. I am a noob, but after many days' work I finally managed to get the performance improved and be able to convert it into framework. I made a short video for this: https://mega.nz/#!JJUVyYpL!cHySc82VtXUZpKVJGdVSHq6bLzQ0VE6q4Do3AcXTXIo

Features:

- Show the latest 7 recent apps

- Click to launch the application, swipe the card to try ending a process and long press the card to open application settings

- Click the clear button to launch an activity which is used to end processes

To start with, you need:

- Decompile / Recompile experience

- A rooted Android 2.3 with a process management app (the same as SwipeRecentApps)

- To be able to run Apktool 1.5.2

Before doing this, make sure you have a backup and are able to unbrick your phone.

Attachments: https://mega.nz/#!FdlyGYyQ!qP6-BUWGeVhWMbnBaLO3A839hhyE69qGbiWKJREbYas

Steps:

1. Decompile framework-res.apk and unzip the res folder to your decompiled files. (If your phone is not MDPI, you can manually resize the clear icon and put it under the proper drawable-??dpi folder.)

2. Open res/values/ids.xml and add the following lines before :

<item type="id" name="materialrecents_recentContent">false</item>
<item type="id" name="materialrecents_recentTitle">false</item>
<item type="id" name="materialrecents_recentIcon">false</item>
<item type="id" name="mainlayout">false</item>
<item type="id" name="materialrecents_recentHeader">false</item>
<item type="id" name="taskman">false</item>
<item type="id" name="noapps">false</item>
<item type="id" name="recent_frame">false</item>

Note: if you have done tenten's SwipeRecentApps you will find some ids already exist and you shouldn't add them.

Then, open res/values/strings.xml and add the following line before :

<string name="kill_app">The process has already been tried to end.</string>

3.Recompile framework-res and decompile the generated apk file and open the decompiled res/values/public.xml.(You can sign the generated framework-res apk properly and then let the apk wait for a while) Search for the item name below and write down their names and values:

Left: type Right: name

"color" transparent (I think this ID is same in all android devices, so maybe we can ignore it)

"layout" recent_apps_dialog

"id" taskman

"id" noapps

"id" mainlayout

"string" no_recent_tasks

"id" recent_frame

"string" kill_app

"layout" material_recents_card

"id" materialrecents_recentTitle

"id" materialrecents_recentIcon

"id" materialrecents_recentHeader

"id" materialrecents_recentContent

4. You need to have NineOldAndroids in your framework jars. Maybe some other guides you have done already add these library smalis to your framework.jar or android.policy.jar, such as the "nineoldandroids" in Ripple Effects on Button or "tentwentyoldandroids" in SwipeRecentApps. Therefore, if you already have this library, then you don't need to add my smali/com/noas folder and you should use a uniform path and name.（For example, if your path is com/nineoldandroids, then you should replace all the "com/noas" in all the smali files in smali/com/android/ and smali/tk/ with "nineoldandroids". By the way, in order to prevent Apps from loading the system NineOldAndroids instead of loading it from their own dex, I suggest not using "com/nineoldandroids".) If your ROM doesn't have nineoldandroids, or you don't understand what I am saying, then decompile android.policy.jar and merge the smali/com/noas folder.

5.Decompile android.policy.jar (If you have decompiled this in the 4th step, you don't need to decompile it again) and backup all the smali files related to recentapps and delete them. Then merge smali/com/android folder and smali/tk folder to your smali. After that, open smali/com/android/internal/policy/impl/RecentApplicationsDialog.smali and replace all the id numbers (commented with "#") with your own numbers which you have written down before. Notice that you should remove the first "0" after "0x", for example, if your id is 0x01080388, you are supposed to add "0x1080388" to your smali file. Do the same operation to smali/tk/zielony/merecents/RecentsList.smali.

6. Open smali/com/android/internal/policy/impl/RecentApplicationsDialog$100000001.smal and replace "com.sec.android.app.controlpanel" with the package name of your task management app, and replace "com.sec.android.app.controlpanel.activity.JobManagerActivity" with the task management activity of your application.

7. Recompile android.policy.jar and sign correctly. Push the modified android.policy.jar and framework-res.apk into system.

Source code: https://github.com/MeCreationTeam/ME_MaterialRecent.

If you want to compile it from source and decompile it into system by yourself, make sure the code

window.setType(WindowManager.LayoutParams.TYPE_SYSTEM_DIALOG);

in onCreate method in RecentApplicationsDialog.java uncommented. I commented this line only for directly build apk and testing. And the class path in source code is different from my smali.

Note: If you face problem when using horizontal screen, try to change the value of paddingLeft and paddingRight in the RelativeLayout in res/layout-land/recent_apps_dialog.xml according to your screen.

In fact, I don't have much time, so I am sorry that if you have some questions, probably I cannot help you.

Credits:

- tenten

- ZieIony

- m0r0

And thanks to NineOldAndroids.

This project is born with the help of open source project, and hope this project can continue to help others.