[Galaxy Y GT-S5360 General] 73R3WY:
This mod will add a Calculator to your SystemUI.

I recommend that you use mods that will provide additional layouts space/tabs to your SystemUI such as SystemUI Tabs.

Note: Smali files were decompiled using apktool_2.0.0b9, so pls use the same apktool version in decompiling and recompiling your SystemUI.apk

Adding the calculator on SystemUI:

Steps:

1. Decompile your SystemUI.apk

2. Download the attachment (Use the latest version, It contains the needed smali files).

3. Extract the zip file to your decompiled SystemUI.apk folder (/SystemUI.apk/here).

Note: Starting v0.2, you have the option to customize the appearance of your calculator, If you don't want to customize it just extract the SMALI files ONLY, but if you want to customize it further, extract the RES and SMALI folders from the zip file.

4. Open your status_bar_expanded.xml (/SystemUI.apk/res/layout/status_bar_expanded.xml).

5. Insert this code:

<ScrollView android:layout_width="fill_parent" android:layout_height="fill_parent">
<LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content">
<com.jeremypacabis.statusbarmods.CalculatorOnSystemUI android:layout_width="match_parent" android:layout_height="wrap_content" />
</LinearLayout>
</ScrollView>

after

xmlns:android="http://schemas.android.com/apk/res/android">

OR anywhere in your layout where there is a free space or free layout such as a Tab in your SystemUI.

6. Recompile your SystemUI.apk

7. Push of Flash your SystemUI.apk

Now, you are done adding the calculator on your SystemUI, If you want to customize it (starting CalcOnSystemUI_v0,2), proceed with the next steps:

Customizing the appearance of calculator on SystemUI:

1. Extract the RES folder from the attachment (if you have not extracted it from the previous steps above) into /SystemUI.apk/here.

2. Recompile your SystemUI.apk

3. Decompile your SystemUI.apk into a new location

4. Open public.xml (/SystemUI.apk/res/values/public.xml) and take note of these public ids:

<public type="drawable" name="calc_display" id="0x7f020179" />
<public type="drawable" name="btnc" id="0x7f020172" />
<public type="drawable" name="btn" id="0x7f02016c" />

Note: These public ids MIGHT BE DIFFERENT from what you will get after recompiling and decompiling your SystemUI.apk, its ok, just take note of them.

5. Open CalculatorOnSystemUI,smali (/SystemUI.apk/smali/com/jeremypacabis/statusbarmods/CalculatorOnSystemUI.smali) and search for these:

const v0, 0x1080004	# Replace 0x1080004 with your customized number button drawable public id, by default it is android.R.drawable.btn_default
const v0, 0x1080005	# Replace 0x1080005 with your customized operation button drawable public id, by default it is android.R.drawable.btn_default_small
const v0, 0x108001c	# Replace 0x108001c with your customized advanced op button drawable public id, by default it is android.R.drawable.gallery_thumb
const v0, 0x1080016	# Replace 0x1080016 with your customized display drawable public id, by default it is android.R.drawable.edit_text

Replace 0x1080004 with the public id you get from <public type="drawable" name="btnc" id="0x7f020172" /> which is 0x7f020172.

Replace 0x1080005 with the public id you get from <public type="drawable" name="btn" id="0x7f02016c" /> which is 0x7f02016c.

Replace 0x108001c with the public id you get from <public type="drawable" name="btn" id="0x7f02016c" /> which is 0x7f02016c.

Replace 0x1080016 with the public id you get from <public type="drawable" name="calc_display" id="0x7f020179" /> which is 0x7f020179.

SO my new code based from the public ids I get after recompiling and decompiling is:

const v0, 0x7f020172	# Replace 0x1080004 with your customized number button drawable public id, by default it is android.R.drawable.btn_default
const v0, 0x7f02016c	# Replace 0x1080005 with your customized operation button drawable public id, by default it is android.R.drawable.btn_default_small
const v0, 0x7f02016c	# Replace 0x108001c with your customized advanced op button drawable public id, by default it is android.R.drawable.gallery_thumb
const v0, 0x7f020179	# Replace 0x1080016 with your customized display drawable public id, by default it is android.R.drawable.edit_text

6. Save your edited CalculatorOnSystemUI.smali

7. Recompile your new SystemUI.apk

8. Push of Flash your SystemUI.apk

Screenshots:

v0.1 - basic calculator only

View attachment 2884305

v0.2 - calculator with some advance functions (not customized)

View attachment 2887499View attachment 2887500

v0.2 - calculator with some advance functions (customized)

View attachment 2887501View attachment 2887502

Needed Files:

View attachment 2884306 v0.1

-Basic calculator only

View attachment 2887498 v0.2

-Added some advanced functions

-Can be customized further

Source Codes?

You want to play with the code? Add functions? Explore and Learn? Copy method snippets? You can check it at my GitHub.:good::

Suggestions? Comments? Bugs (I hope none)?

Just post a reply here and I will try to attend to it. (The word "try" always has a "catch" Exception, iykwim.)