HOW TO ADD AOSP RAM LINEAR COLOR BAR, IN RECENT PANEL for JB 4.2 + +

Search This thread

Adi Aisiteru Reborn

Senior Member
Apr 3, 2013
1,770
4,830
Bandar Lampung
HOW TO ADD AOSP RAM LINEAR COLOR BAR, IN RECENT PANEL

picture.php
picture.php


picture.php
picture.php



NOTE !! , This Mod guide is a continue from this thread, How to added RAM PROGRESS BAR & CLEAR ALL RECENT APPS in Recent panel for JB 4.2 + +

so to understand this Mod guide you have to already clean done that guide first !!


TRY AT YOUR OWN RISK !!!

THANKS :laugh::good:


STEP -1

Decompile your SystemUI.apk

- Download attached LinearColorRamBar_SystemUI.apk.zip exstract it and merge to your decompiled systemui.apk

- SystemUI.apk/res/layout/status_bar_recent_panel.xml
Code:
<?xml version="1.0" encoding="utf-8"?>
<com.android.systemui.recent.RecentsPanelView android:id="@id/recents_root" android:layout_width="fill_parent" android:layout_height="fill_parent" systemui:recentItemLayout="@layout/status_bar_recent_item"
  xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui">
    <LinearLayout android:orientation="vertical" android:background="@drawable/status_bar_recents_background" android:layout_width="fill_parent" android:layout_height="fill_parent">
        <view android:orientation="horizontal" android:id="@id/asteroid_ram_usage_bar" android:paddingLeft="4.0dip" android:paddingTop="10.0dip" android:paddingRight="4.0dip" android:clipChildren="false" android:clipToPadding="false" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginLeft="@*android:dimen/preference_fragment_padding_side" android:layout_marginTop="-5.0dip" android:layout_marginRight="@*android:dimen/preference_fragment_padding_side" class="com.android.systemui.recent.LinearColorBar">
            <TextView android:textAppearance="?android:textAppearanceSmallInverse" android:textColor="#ff000000" android:gravity="bottom|left|center" android:id="@id/asteroid_usedMemText" android:focusable="true" android:layout_width="0.0px" android:layout_height="wrap_content" android:singleLine="true" android:layout_weight="1.0" />
            <TextView android:textAppearance="?android:textAppearanceSmallInverse" android:textColor="#ff000000" android:gravity="center" android:id="@id/asteroid_ramText" android:focusable="true" android:layout_width="0.0px" android:layout_height="wrap_content" android:singleLine="true" android:layout_weight="1.0" />
            <TextView android:textAppearance="?android:textAppearanceSmallInverse" android:textColor="#ff000000" android:gravity="bottom|right|center" android:layout_gravity="right|center" android:id="@id/asteroid_freeMemText" android:focusable="true" android:layout_width="0.0px" android:layout_height="wrap_content" android:singleLine="true" android:layout_weight="1.0" />
        </view>
        <LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content">
            <TextView android:textColor="@*android:color/holo_blue_dark" android:layout_gravity="center" android:id="@id/recents_memory_text" android:layout_width="wrap_content" android:layout_height="wrap_content" />
            <ProgressBar android:id="@id/recents_memory_bar" android:paddingLeft="4.0dip" android:paddingRight="4.0dip" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginLeft="@*android:dimen/preference_fragment_padding_side" android:layout_marginRight="@*android:dimen/preference_fragment_padding_side" style="?android:attr/progressBarStyleHorizontal" />
        </LinearLayout>
        <FrameLayout android:id="@id/recents_bg_protect" android:fitsSystemWindows="true" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_alignParentBottom="true">
            <com.android.systemui.recent.RecentsVerticalScrollView android:layout_gravity="bottom|left|center" android:id="@id/recents_container" android:scrollbars="none" android:fadingEdge="vertical" android:fadingEdgeLength="@dimen/status_bar_recents_scroll_fading_edge_length" android:clipChildren="false" android:clipToPadding="false" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginRight="0.0dip" android:stackFromBottom="true" android:divider="@null">
                <LinearLayout android:orientation="vertical" android:id="@id/recents_linear_layout" android:clipChildren="false" android:clipToPadding="false" android:layout_width="fill_parent" android:layout_height="wrap_content" />
            </com.android.systemui.recent.RecentsVerticalScrollView>
            <include android:layout_gravity="center" android:id="@id/recents_no_apps" android:visibility="invisible" android:layout_width="fill_parent" android:layout_height="fill_parent" layout="@layout/status_bar_no_recent_apps" />
            <LinearLayout android:layout_gravity="bottom" android:orientation="horizontal" android:background="@drawable/tw_ab_bottom_transparent_dark_holo" android:layout_width="fill_parent" android:layout_height="45.0dip" android:layout_weight="1.0">
                <ImageButton android:id="@id/asteroid_recents_task_manager_button" android:background="@drawable/tw_recent_panel_button_forphone" android:layout_width="fill_parent" android:layout_height="fill_parent" android:src="@drawable/tw_recent_panel_ic_task_manager_holo_dark" android:layout_weight="1.0" android:contentDescription="@string/status_bar_recent_launch_task_manager_title" style="?android:attr/buttonStyle" />
                <LinearLayout android:layout_gravity="center_vertical" android:background="@drawable/tw_divider_vertical_holo_dark" android:layout_width="1.0dip" android:layout_height="29.0dip" />
                <ImageButton android:id="@id/asteroid_recents_google_button" android:background="@drawable/tw_recent_panel_button_forphone" android:layout_width="fill_parent" android:layout_height="fill_parent" android:src="@drawable/tw_recent_panel_ic_google_holo_dark" android:layout_weight="1.0" android:contentDescription="@string/status_bar_recent_launch_google_button" style="?android:attr/buttonStyle" />
                <LinearLayout android:layout_gravity="center_vertical" android:background="@drawable/tw_divider_vertical_holo_dark" android:layout_width="1.0dip" android:layout_height="29.0dip" />
                <ImageButton android:id="@id/asteroid_recents_clear_all_button" android:background="@drawable/tw_recent_panel_button_forphone" android:layout_width="fill_parent" android:layout_height="fill_parent" android:src="@drawable/tw_recent_panel_ic_delete_holo_dark" android:layout_weight="1.0" android:contentDescription="@string/status_bar_recent_remove_all_button" style="?android:attr/buttonStyle" />
            </LinearLayout>
        </FrameLayout>
    </LinearLayout>
</com.android.systemui.recent.RecentsPanelView>

- SystemUI.apk/res/layout-land/status_bar_recent_panel.xml
Code:
<?xml version="1.0" encoding="utf-8"?>
<com.android.systemui.recent.RecentsPanelView android:id="@id/recents_root" android:layout_width="fill_parent" android:layout_height="fill_parent" systemui:recentItemLayout="@layout/status_bar_recent_item"
  xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui">
    <LinearLayout android:orientation="vertical" android:background="@drawable/status_bar_recents_background" android:layout_width="fill_parent" android:layout_height="fill_parent">
        <view android:orientation="horizontal" android:id="@id/asteroid_ram_usage_bar" android:paddingLeft="4.0dip" android:paddingTop="10.0dip" android:paddingRight="4.0dip" android:clipChildren="false" android:clipToPadding="false" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginLeft="@*android:dimen/preference_fragment_padding_side" android:layout_marginTop="-5.0dip" android:layout_marginRight="@*android:dimen/preference_fragment_padding_side" class="com.android.systemui.recent.LinearColorBar">
            <TextView android:textAppearance="?android:textAppearanceSmallInverse" android:textColor="#ff000000" android:gravity="bottom|left|center" android:id="@id/asteroid_usedMemText" android:focusable="true" android:layout_width="0.0px" android:layout_height="wrap_content" android:singleLine="true" android:layout_weight="1.0" />
            <TextView android:textAppearance="?android:textAppearanceSmallInverse" android:textColor="#ff000000" android:gravity="center" android:id="@id/asteroid_ramText" android:focusable="true" android:layout_width="0.0px" android:layout_height="wrap_content" android:singleLine="true" android:layout_weight="1.0" />
            <TextView android:textAppearance="?android:textAppearanceSmallInverse" android:textColor="#ff000000" android:gravity="bottom|right|center" android:layout_gravity="right|center" android:id="@id/asteroid_freeMemText" android:focusable="true" android:layout_width="0.0px" android:layout_height="wrap_content" android:singleLine="true" android:layout_weight="1.0" />
        </view>
        <LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content">
            <TextView android:textColor="@*android:color/holo_blue_dark" android:layout_gravity="center" android:id="@id/recents_memory_text" android:layout_width="wrap_content" android:layout_height="wrap_content" />
            <ProgressBar android:id="@id/recents_memory_bar" android:paddingLeft="4.0dip" android:paddingRight="4.0dip" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginLeft="@*android:dimen/preference_fragment_padding_side" android:layout_marginRight="@*android:dimen/preference_fragment_padding_side" style="?android:attr/progressBarStyleHorizontal" />
        </LinearLayout>
        <FrameLayout android:id="@id/recents_bg_protect" android:fitsSystemWindows="true" android:clipChildren="false" android:clipToPadding="false" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_alignParentBottom="true">
            <com.android.systemui.recent.RecentsHorizontalScrollView android:layout_gravity="right" android:id="@id/recents_container" android:scrollbars="none" android:fadingEdge="horizontal" android:fadingEdgeLength="@dimen/status_bar_recents_scroll_fading_edge_length" android:clipChildren="false" android:clipToPadding="false" android:layout_width="wrap_content" android:layout_height="fill_parent">
                <LinearLayout android:orientation="horizontal" android:id="@id/recents_linear_layout" android:clipChildren="false" android:clipToPadding="false" android:layout_width="wrap_content" android:layout_height="fill_parent" />
            </com.android.systemui.recent.RecentsHorizontalScrollView>
            <include android:layout_gravity="center" android:id="@id/recents_no_apps" android:visibility="invisible" android:layout_width="fill_parent" android:layout_height="fill_parent" layout="@layout/status_bar_no_recent_apps" />
            <LinearLayout android:layout_gravity="bottom" android:orientation="horizontal" android:background="@drawable/tw_ab_bottom_transparent_dark_holo" android:layout_width="fill_parent" android:layout_height="45.0dip" android:layout_weight="1.0">
                <ImageButton android:id="@id/asteroid_recents_task_manager_button" android:background="@drawable/tw_recent_panel_button_forphone" android:layout_width="fill_parent" android:layout_height="fill_parent" android:src="@drawable/tw_recent_panel_ic_task_manager_holo_dark" android:layout_weight="1.0" android:contentDescription="@string/status_bar_recent_launch_task_manager_title" style="?android:attr/buttonStyle" />
                <LinearLayout android:layout_gravity="center_vertical" android:background="@drawable/tw_divider_vertical_holo_dark" android:layout_width="1.0dip" android:layout_height="29.0dip" />
                <ImageButton android:id="@id/asteroid_recents_google_button" android:background="@drawable/tw_recent_panel_button_forphone" android:layout_width="fill_parent" android:layout_height="fill_parent" android:src="@drawable/tw_recent_panel_ic_google_holo_dark" android:layout_weight="1.0" android:contentDescription="@string/status_bar_recent_launch_google_button" style="?android:attr/buttonStyle" />
                <LinearLayout android:layout_gravity="center_vertical" android:background="@drawable/tw_divider_vertical_holo_dark" android:layout_width="1.0dip" android:layout_height="29.0dip" />
                <ImageButton android:id="@id/asteroid_recents_clear_all_button" android:background="@drawable/tw_recent_panel_button_forphone" android:layout_width="fill_parent" android:layout_height="fill_parent" android:src="@drawable/tw_recent_panel_ic_delete_holo_dark" android:layout_weight="1.0" android:contentDescription="@string/status_bar_recent_remove_all_button" style="?android:attr/buttonStyle" />
            </LinearLayout>
        </FrameLayout>
    </LinearLayout>
</com.android.systemui.recent.RecentsPanelView>

- SystemUI.apk/res/values/ids.xml
Code:
    <item type="id" name="asteroid_recents_google_button">false</item>
    <item type="id" name="asteroid_recents_clear_all_button">false</item>
    [COLOR="Red"]<item type="id" name="asteroid_ram_usage_bar">false</item>
    <item type="id" name="asteroid_usedMemText">false</item>
    <item type="id" name="asteroid_ramText">false</item>
    <item type="id" name="asteroid_freeMemText">false</item>[/COLOR]
</resources>

- SystemUI.apk/res/values/strings.xml
Code:
    <string name="status_bar_recent_launch_task_manager_title">Task manager</string>
    <string name="status_bar_recent_launch_google_button">Google</string>
    <string name="status_bar_recent_remove_all_button">Remove all</string>
    [COLOR="Red"]<string name="memory">RAM</string>
    <string name="service_free_mem">%1$s free</string>
    <string name="service_used_mem">%1$s used</string>[/COLOR]
</resources>

- Recompile your SystemUI.apk
 

Attachments

  • Screenshot_2014-06-15-14-46-18.jpg
    Screenshot_2014-06-15-14-46-18.jpg
    39.6 KB · Views: 2,463
  • Screenshot_2014-06-15-14-46-43.jpg
    Screenshot_2014-06-15-14-46-43.jpg
    30.4 KB · Views: 2,191
  • Screenshot_2014-06-15-14-46-58.jpg
    Screenshot_2014-06-15-14-46-58.jpg
    35.5 KB · Views: 2,238
  • Screenshot_2014-06-15-14-47-07.png
    Screenshot_2014-06-15-14-47-07.png
    214.5 KB · Views: 1,786
  • LinearColorRamBar_SystemUI.apk.zip
    4.1 KB · Views: 1,111
Last edited:

Adi Aisiteru Reborn

Senior Member
Apr 3, 2013
1,770
4,830
Bandar Lampung
STEP -2

Decompile the newly Recompiled APK again
Next go to
res/values/public.xml
open it with Notepad++
leave it, but keep it open

- SystemUI.apk/smali/com/android/systemui/recent/RecentsPanelView.smali
add the red line

Code:
# instance fields
[COLOR="Red"].field private mActiveMemory:J[/COLOR]

.field private mAnimateIconOfFirstTask:Z

[COLOR="Red"].field private mCachedMemory:J[/COLOR]

.field private mFitThumbnailToXY:Z

[COLOR="Red"].field mFreeMemText:Landroid/widget/TextView;[/COLOR]

[COLOR="Red"].field private mFreeMemory:J[/COLOR]

.field private mGoogleButton:Landroid/widget/ImageButton;

.field private mHighEndGfx:Z

.field private mItemToAnimateInWhenWindowAnimationIsFinished:Lcom/android/systemui/recent/RecentsPanelView$ViewHolder;

.field private mListAdapter:Lcom/android/systemui/recent/RecentsPanelView$TaskDescriptionAdapter;

[COLOR="Red"].field mMemInfoReader:Lcom/android/internal/util/MemInfoReader;[/COLOR]

.field private mPopup:Landroid/widget/PopupMenu;

[COLOR="Red"].field mRamText:Landroid/widget/TextView;[/COLOR]

[COLOR="Red"].field private mRamUsageBar:Lcom/android/systemui/recent/LinearColorBar;[/COLOR]

.field private mRecentItemLayoutId:I

.field private mRecentTaskDescriptions:Ljava/util/ArrayList;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/ArrayList",
            "<",
            "Lcom/android/systemui/recent/TaskDescription;",
            ">;"
        }
    .end annotation
.end field

.field private mRecentTasksLoader:Lcom/android/systemui/recent/RecentTasksLoader;

.field private mRecentsClearAllButton:Landroid/widget/ImageButton;

.field private mRecentsContainer:Landroid/view/ViewGroup;

.field private mRecentsNoApps:Landroid/view/View;

.field private mRecentsScrim:Landroid/view/View;

.field private mShowing:Z

.field private mStatusBarTouchProxy:Lcom/android/systemui/recent/StatusBarTouchProxy;

.field private mTaskManagerButton:Landroid/widget/ImageButton;

.field private mThumbnailWidth:I

[COLOR="Red"].field private mTotalMemory:J[/COLOR]

[COLOR="Red"].field mUsedMemText:Landroid/widget/TextView;[/COLOR]

.field private mWaitingForWindowAnimation:Z

.field private mWaitingToShow:Z

.field private mWindowAnimationStartTime:J

Code:
.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V
    .locals 3
    .parameter "context"
    .parameter "attrs"
    .parameter "defStyle"

    .prologue
    const/4 v2, 0x0

    .line 260
    invoke-direct {p0, p1, p2, p3}, Landroid/widget/FrameLayout;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V

    [COLOR="Red"]new-instance v1, Lcom/android/internal/util/MemInfoReader;

    invoke-direct {v1}, Lcom/android/internal/util/MemInfoReader;-><init>()V

    iput-object v1, p0, Lcom/android/systemui/recent/RecentsPanelView;->mMemInfoReader:Lcom/android/internal/util/MemInfoReader;[/COLOR]

    .line 261
    invoke-virtual {p0}, Lcom/android/systemui/recent/RecentsPanelView;->updateValuesFromResources()V

    .line 263
    sget-object v1, Lcom/android/systemui/R$styleable;->RecentsPanelView:[I

    invoke-virtual {p1, p2, v1, p3, v2}, Landroid/content/Context;->obtainStyledAttributes(Landroid/util/AttributeSet;[III)Landroid/content/res/TypedArray;

    move-result-object v0

Code:
.method static synthetic access$1102(Lcom/android/systemui/recent/RecentsPanelView;Landroid/widget/PopupMenu;)Landroid/widget/PopupMenu;
    .locals 0
    .parameter "x0"
    .parameter "x1"

    .prologue
    .line 73
    iput-object p1, p0, Lcom/android/systemui/recent/RecentsPanelView;->mPopup:Landroid/widget/PopupMenu;

    return-object p1
.end method

[COLOR="Red"].method static synthetic access$11400(Lcom/android/systemui/recent/RecentsPanelView;)Landroid/content/Context;
    .locals 1
    .parameter "x0"

    .prologue
    .line 85
    iget-object v0, p0, Lcom/android/systemui/recent/RecentsPanelView;->mContext:Landroid/content/Context;

    return-object v0
.end method[/COLOR]

.method static synthetic access$177777700(Lcom/android/systemui/recent/RecentsPanelView;)V
    .locals 0
    .parameter "x0"

    .prologue
    .line 75
    invoke-direct {p0}, Lcom/android/systemui/recent/RecentsPanelView;->AsteroidClearAllRecentApps()V

    return-void
.end method

.method static synthetic access$200(Lcom/android/systemui/recent/RecentsPanelView;)Lcom/android/systemui/recent/RecentTasksLoader;

Code:
.method private pointInside(IILandroid/view/View;)Z
    .locals 5
    .parameter "x"
    .parameter "y"
    .parameter "v"

    .prologue
    .line 282
    invoke-virtual {p3}, Landroid/view/View;->getLeft()I

    move-result v1

    .line 283
    .local v1, l:I
    invoke-virtual {p3}, Landroid/view/View;->getRight()I

    move-result v2

    .line 284
    .local v2, r:I
    invoke-virtual {p3}, Landroid/view/View;->getTop()I

    move-result v3

    .line 285
    .local v3, t:I
    invoke-virtual {p3}, Landroid/view/View;->getBottom()I

    move-result v0

    .line 286
    .local v0, b:I
    if-lt p1, v1, :cond_0

    if-ge p1, v2, :cond_0

    if-lt p2, v3, :cond_0

    if-ge p2, v0, :cond_0

    const/4 v4, 0x1

    :goto_0
    return v4

    :cond_0
    const/4 v4, 0x0

    goto :goto_0
.end method

[COLOR="Red"].method private static readLine(Ljava/lang/String;I)Ljava/lang/String;
    .locals 4
    .parameter "filename"
    .parameter "line"
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .prologue
    .line 1190
    new-instance v1, Ljava/io/BufferedReader;

    new-instance v2, Ljava/io/FileReader;

    invoke-direct {v2, p0}, Ljava/io/FileReader;-><init>(Ljava/lang/String;)V

    const/16 v3, 0x100

    invoke-direct {v1, v2, v3}, Ljava/io/BufferedReader;-><init>(Ljava/io/Reader;I)V

    .line 1192
    .local v1, reader:Ljava/io/BufferedReader;
    const/4 v0, 0x1

    .local v0, i:I
    :goto_0
    if-ge v0, p1, :cond_0

    .line 1193
    :try_start_0
    invoke-virtual {v1}, Ljava/io/BufferedReader;->readLine()Ljava/lang/String;

    .line 1192
    add-int/lit8 v0, v0, 0x1

    goto :goto_0

    .line 1195
    :cond_0
    invoke-virtual {v1}, Ljava/io/BufferedReader;->readLine()Ljava/lang/String;
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    move-result-object v2

    .line 1197
    invoke-virtual {v1}, Ljava/io/BufferedReader;->close()V

    return-object v2

    :catchall_0
    move-exception v2

    invoke-virtual {v1}, Ljava/io/BufferedReader;->close()V

    throw v2
.end method[/COLOR]

.method private refreshRecentTasksList(Ljava/util/ArrayList;Z)V
    .locals 1
    .parameter
    .parameter "firstScreenful"
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/ArrayList",
            "<",
            "Lcom/android/systemui/recent/TaskDescription;",
            ">;Z)V"
        }
    .end annotation

    .prologue
    .line 646
    .local p1, recentTasksList:Ljava/util/ArrayList;,"Ljava/util/ArrayList<Lcom/android/systemui/recent/TaskDescription;>;"
    iget-object v0, p0, Lcom/android/systemui/recent/RecentsPanelView;->mRecentTaskDescriptions:Ljava/util/ArrayList;

    if-nez v0, :cond_0

Code:
 iget-object v0, p1, Lcom/android/systemui/recent/RecentsPanelView$ViewHolder;->iconView:Landroid/widget/ImageView;

    const/4 v1, 0x0

    invoke-virtual {v0, v1}, Landroid/widget/ImageView;->setVisibility(I)V

    .line 515
    :cond_1
    return-void
.end method

[COLOR="Red"].method private updateMemoryInfo()V
    .locals 7

    .prologue
    const/4 v6, 0x3

    const-wide/16 v0, 0x0

    :try_start_0
    const-string v2, "/proc/meminfo"

    const/4 v3, 0x1

    invoke-static {v2, v3}, Lcom/android/systemui/recent/RecentsPanelView;->readLine(Ljava/lang/String;I)Ljava/lang/String;

    move-result-object v2

    if-eqz v2, :cond_0

    const-string v3, "\\s+"

    invoke-virtual {v2, v3}, Ljava/lang/String;->split(Ljava/lang/String;)[Ljava/lang/String;

    move-result-object v2

    array-length v3, v2

    if-ne v3, v6, :cond_0

    const/4 v3, 0x1

    aget-object v2, v2, v3

    invoke-static {v2}, Ljava/lang/Long;->parseLong(Ljava/lang/String;)J

    move-result-wide v2

    const-wide/16 v4, 0x400

    div-long v0, v2, v4
    :try_end_0
    .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_3

    :cond_0
    :goto_0
    iput-wide v0, p0, Lcom/android/systemui/recent/RecentsPanelView;->mTotalMemory:J

    :try_start_1
    const-string v2, "/proc/meminfo"

    const/4 v3, 0x2

    invoke-static {v2, v3}, Lcom/android/systemui/recent/RecentsPanelView;->readLine(Ljava/lang/String;I)Ljava/lang/String;

    move-result-object v2

    if-eqz v2, :cond_1

    const-string v3, "\\s+"

    invoke-virtual {v2, v3}, Ljava/lang/String;->split(Ljava/lang/String;)[Ljava/lang/String;

    move-result-object v2

    array-length v3, v2

    if-ne v3, v6, :cond_1

    const/4 v3, 0x1

    aget-object v2, v2, v3

    invoke-static {v2}, Ljava/lang/Long;->parseLong(Ljava/lang/String;)J

    move-result-wide v2

    const-wide/16 v4, 0x400

    div-long v0, v2, v4
    :try_end_1
    .catch Ljava/io/IOException; {:try_start_1 .. :try_end_1} :catch_2

    :cond_1
    :goto_1
    iput-wide v0, p0, Lcom/android/systemui/recent/RecentsPanelView;->mFreeMemory:J

    :try_start_2
    const-string v2, "/proc/meminfo"

    const/4 v3, 0x6

    invoke-static {v2, v3}, Lcom/android/systemui/recent/RecentsPanelView;->readLine(Ljava/lang/String;I)Ljava/lang/String;

    move-result-object v2

    if-eqz v2, :cond_2

    const-string v3, "\\s+"

    invoke-virtual {v2, v3}, Ljava/lang/String;->split(Ljava/lang/String;)[Ljava/lang/String;

    move-result-object v2

    array-length v3, v2

    if-ne v3, v6, :cond_2

    const/4 v3, 0x1

    aget-object v2, v2, v3

    invoke-static {v2}, Ljava/lang/Long;->parseLong(Ljava/lang/String;)J

    move-result-wide v2

    const-wide/16 v4, 0x400

    div-long v0, v2, v4
    :try_end_2
    .catch Ljava/io/IOException; {:try_start_2 .. :try_end_2} :catch_1

    :cond_2
    :goto_2
    iput-wide v0, p0, Lcom/android/systemui/recent/RecentsPanelView;->mActiveMemory:J

    :try_start_3
    const-string v2, "/proc/meminfo"

    const/4 v3, 0x4

    invoke-static {v2, v3}, Lcom/android/systemui/recent/RecentsPanelView;->readLine(Ljava/lang/String;I)Ljava/lang/String;

    move-result-object v2

    if-eqz v2, :cond_3

    const-string v3, "\\s+"

    invoke-virtual {v2, v3}, Ljava/lang/String;->split(Ljava/lang/String;)[Ljava/lang/String;

    move-result-object v2

    array-length v3, v2

    if-ne v3, v6, :cond_3

    const/4 v3, 0x1

    aget-object v2, v2, v3

    invoke-static {v2}, Ljava/lang/Long;->parseLong(Ljava/lang/String;)J

    move-result-wide v2

    const-wide/16 v4, 0x400

    div-long v0, v2, v4
    :try_end_3
    .catch Ljava/io/IOException; {:try_start_3 .. :try_end_3} :catch_0

    :cond_3
    :goto_3
    iput-wide v0, p0, Lcom/android/systemui/recent/RecentsPanelView;->mCachedMemory:J

    return-void

    :catch_0
    move-exception v2

    goto :goto_3

    :catch_1
    move-exception v2

    goto :goto_2

    :catch_2
    move-exception v2

    goto :goto_1

    :catch_3
    move-exception v2

    goto :goto_0
.end method

.method private updateRamBar()V
    .locals 15

    .prologue
    const-wide/16 v1, 0x0

    const/4 v10, 0x1

    const/4 v9, 0x0

    const v0, [COLOR="Blue"]0x7f08012f[/COLOR]

    invoke-virtual {p0, v0}, Lcom/android/systemui/recent/RecentsPanelView;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Lcom/android/systemui/recent/LinearColorBar;

    iput-object v0, p0, Lcom/android/systemui/recent/RecentsPanelView;->mRamUsageBar:Lcom/android/systemui/recent/LinearColorBar;

    iget-object v0, p0, Lcom/android/systemui/recent/RecentsPanelView;->mContext:Landroid/content/Context;

    invoke-virtual {v0}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v0

    const-string v3, "recents_ram_bar_mode"

    invoke-static {v0, v3, v9}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

    move-result v3

    if-eqz v3, :cond_1

    iget-object v0, p0, Lcom/android/systemui/recent/RecentsPanelView;->mRamUsageBar:Lcom/android/systemui/recent/LinearColorBar;

    if-eqz v0, :cond_1

    new-instance v4, Landroid/util/DisplayMetrics;

    invoke-direct {v4}, Landroid/util/DisplayMetrics;-><init>()V

    iget-object v0, p0, Lcom/android/systemui/recent/RecentsPanelView;->mContext:Landroid/content/Context;

    const-string v5, "window"

    invoke-virtual {v0, v5}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/view/WindowManager;

    invoke-interface {v0}, Landroid/view/WindowManager;->getDefaultDisplay()Landroid/view/Display;

    move-result-object v0

    invoke-virtual {v0, v4}, Landroid/view/Display;->getMetrics(Landroid/util/DisplayMetrics;)V

    iget v0, v4, Landroid/util/DisplayMetrics;->density:F

    iget-object v0, p0, Lcom/android/systemui/recent/RecentsPanelView;->mRamUsageBar:Lcom/android/systemui/recent/LinearColorBar;

    invoke-virtual {v0, v9}, Lcom/android/systemui/recent/LinearColorBar;->setVisibility(I)V

    invoke-direct {p0}, Lcom/android/systemui/recent/RecentsPanelView;->updateMemoryInfo()V

    packed-switch v3, :pswitch_data_0

    move-wide v3, v1

    :goto_0
    const v0, [COLOR="Blue"]0x7f080130[/COLOR]

    invoke-virtual {p0, v0}, Lcom/android/systemui/recent/RecentsPanelView;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/TextView;

    iput-object v0, p0, Lcom/android/systemui/recent/RecentsPanelView;->mUsedMemText:Landroid/widget/TextView;

    const v0, [COLOR="Blue"]0x7f080132[/COLOR]

    invoke-virtual {p0, v0}, Lcom/android/systemui/recent/RecentsPanelView;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/TextView;

    iput-object v0, p0, Lcom/android/systemui/recent/RecentsPanelView;->mFreeMemText:Landroid/widget/TextView;

    const v0, [COLOR="Blue"]0x7f080131[/COLOR]

    invoke-virtual {p0, v0}, Lcom/android/systemui/recent/RecentsPanelView;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/TextView;

    iput-object v0, p0, Lcom/android/systemui/recent/RecentsPanelView;->mRamText:Landroid/widget/TextView;

    iget-object v0, p0, Lcom/android/systemui/recent/RecentsPanelView;->mUsedMemText:Landroid/widget/TextView;

    invoke-virtual {p0}, Lcom/android/systemui/recent/RecentsPanelView;->getResources()Landroid/content/res/Resources;

    move-result-object v5

    const v6, [COLOR="Blue"]0x7f0b00f7[/COLOR]

    new-array v7, v10, [Ljava/lang/Object;

    new-instance v8, Ljava/lang/StringBuilder;

    invoke-direct {v8}, Ljava/lang/StringBuilder;-><init>()V

    invoke-virtual {v8, v3, v4}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;

    move-result-object v3

    const-string v4, " MB"

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v3

    aput-object v3, v7, v9

    invoke-virtual {v5, v6, v7}, Landroid/content/res/Resources;->getString(I[Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v0, v3}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    iget-object v0, p0, Lcom/android/systemui/recent/RecentsPanelView;->mFreeMemText:Landroid/widget/TextView;

    invoke-virtual {p0}, Lcom/android/systemui/recent/RecentsPanelView;->getResources()Landroid/content/res/Resources;

    move-result-object v3

    const v4, [COLOR="Blue"]0x7f0b00f6[/COLOR]

    new-array v5, v10, [Ljava/lang/Object;

    new-instance v6, Ljava/lang/StringBuilder;

    invoke-direct {v6}, Ljava/lang/StringBuilder;-><init>()V

    invoke-virtual {v6, v1, v2}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;

    move-result-object v1

    const-string v2, " MB"

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    aput-object v1, v5, v9

    invoke-virtual {v3, v4, v5}, Landroid/content/res/Resources;->getString(I[Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    iget-object v0, p0, Lcom/android/systemui/recent/RecentsPanelView;->mRamText:Landroid/widget/TextView;

    invoke-virtual {p0}, Lcom/android/systemui/recent/RecentsPanelView;->getResources()Landroid/content/res/Resources;

    move-result-object v1

    const v2, [COLOR="Blue"]0x7f0b00f5[/COLOR]

    invoke-virtual {v1, v2}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    iget-wide v0, p0, Lcom/android/systemui/recent/RecentsPanelView;->mTotalMemory:J

    long-to-float v0, v0

    iget-wide v1, p0, Lcom/android/systemui/recent/RecentsPanelView;->mTotalMemory:J

    iget-wide v3, p0, Lcom/android/systemui/recent/RecentsPanelView;->mFreeMemory:J

    sub-long/2addr v1, v3

    iget-wide v3, p0, Lcom/android/systemui/recent/RecentsPanelView;->mCachedMemory:J

    sub-long/2addr v1, v3

    iget-wide v3, p0, Lcom/android/systemui/recent/RecentsPanelView;->mActiveMemory:J

    sub-long/2addr v1, v3

    long-to-float v1, v1

    div-float/2addr v1, v0

    iget-wide v2, p0, Lcom/android/systemui/recent/RecentsPanelView;->mActiveMemory:J

    long-to-float v2, v2

    div-float/2addr v2, v0

    iget-wide v3, p0, Lcom/android/systemui/recent/RecentsPanelView;->mCachedMemory:J

    long-to-float v3, v3

    div-float v0, v3, v0

    iget-object v3, p0, Lcom/android/systemui/recent/RecentsPanelView;->mRamUsageBar:Lcom/android/systemui/recent/LinearColorBar;

    invoke-virtual {v3, v1, v0, v2}, Lcom/android/systemui/recent/LinearColorBar;->setRatios(FFF)V

    iget-object v0, p0, Lcom/android/systemui/recent/RecentsPanelView;->mRamUsageBar:Lcom/android/systemui/recent/LinearColorBar;

    new-instance v1, Lcom/android/systemui/recent/RecentsPanelView$AsteroidRunningServices;

    invoke-direct {v1, p0}, Lcom/android/systemui/recent/RecentsPanelView$AsteroidRunningServices;-><init>(Lcom/android/systemui/recent/RecentsPanelView;)V

    invoke-virtual {v0, v1}, Lcom/android/systemui/recent/LinearColorBar;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    :cond_0
    :goto_1
    return-void

    :pswitch_0
    iget-wide v2, p0, Lcom/android/systemui/recent/RecentsPanelView;->mActiveMemory:J

    iget-wide v0, p0, Lcom/android/systemui/recent/RecentsPanelView;->mTotalMemory:J

    iget-wide v4, p0, Lcom/android/systemui/recent/RecentsPanelView;->mActiveMemory:J

    sub-long/2addr v0, v4

    move-wide v11, v0

    move-wide v13, v2

    move-wide v3, v13

    move-wide v1, v11

    goto/16 :goto_0

    :pswitch_1
    iget-wide v0, p0, Lcom/android/systemui/recent/RecentsPanelView;->mActiveMemory:J

    iget-wide v2, p0, Lcom/android/systemui/recent/RecentsPanelView;->mCachedMemory:J

    add-long/2addr v2, v0

    iget-wide v0, p0, Lcom/android/systemui/recent/RecentsPanelView;->mTotalMemory:J

    iget-wide v4, p0, Lcom/android/systemui/recent/RecentsPanelView;->mActiveMemory:J

    sub-long/2addr v0, v4

    iget-wide v4, p0, Lcom/android/systemui/recent/RecentsPanelView;->mCachedMemory:J

    sub-long/2addr v0, v4

    move-wide v11, v0

    move-wide v13, v2

    move-wide v3, v13

    move-wide v1, v11

    goto/16 :goto_0

    :pswitch_2
    iget-wide v0, p0, Lcom/android/systemui/recent/RecentsPanelView;->mTotalMemory:J

    iget-wide v2, p0, Lcom/android/systemui/recent/RecentsPanelView;->mFreeMemory:J

    sub-long v2, v0, v2

    iget-wide v0, p0, Lcom/android/systemui/recent/RecentsPanelView;->mFreeMemory:J

    move-wide v11, v0

    move-wide v13, v2

    move-wide v3, v13

    move-wide v1, v11

    goto/16 :goto_0

    :cond_1
    iget-object v0, p0, Lcom/android/systemui/recent/RecentsPanelView;->mRamUsageBar:Lcom/android/systemui/recent/LinearColorBar;

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/android/systemui/recent/RecentsPanelView;->mRamUsageBar:Lcom/android/systemui/recent/LinearColorBar;

    const/16 v1, 0x8

    invoke-virtual {v0, v1}, Lcom/android/systemui/recent/LinearColorBar;->setVisibility(I)V

    goto :goto_1

    nop

    :pswitch_data_0
    .packed-switch 0x1
        :pswitch_0
        :pswitch_1
        :pswitch_2
    .end packed-switch
.end method[/COLOR]

.method private updateThumbnail(Lcom/android/systemui/recent/RecentsPanelView$ViewHolder;Landroid/graphics/Bitmap;ZZ)V
    .locals 5
    .parameter "h"
    .parameter "thumbnail"
    .parameter "show"
    .parameter "anim"

Change this IDS with the value you got in your own public.xml

- 0x7f08012f
Code:
 <public type="id" name="asteroid_ram_usage_bar" id="[COLOR="Blue"]0x7f??????[/COLOR]" />

-- 0x7f080130
Code:
<public type="id" name="asteroid_usedMemText" id="[COLOR="Blue"]0x7f??????[/COLOR]" />

-- 0x7f080132
Code:
 <public type="id" name="asteroid_freeMemText" id="[COLOR="Blue"]0x7f??????[/COLOR]" />

-- 0x7f080131
Code:
 <public type="id" name="asteroid_ramText" id="[COLOR="Blue"]0x7f??????[/COLOR]" />

-- 0x7f0b00f7
Code:
<public type="string" name="service_used_mem" id="[COLOR="Blue"]0x7f??????[/COLOR]" />

-- 0x7f0b00f6
Code:
<public type="string" name="service_free_mem" id="[COLOR="Blue"]0x7f??????[/COLOR]" />

-- 0x7f0b00f5
Code:
<public type="string" name="memory" id="[COLOR="Blue"]0x7f??????[/COLOR]" />
 
Last edited:

Adi Aisiteru Reborn

Senior Member
Apr 3, 2013
1,770
4,830
Bandar Lampung
NEXT,

add the red line
Code:
.method public clearRecentTasksList()V
    .locals 1

    .prologue
    .line 611
    iget-object v0, p0, Lcom/android/systemui/recent/RecentsPanelView;->mRecentTaskDescriptions:Ljava/util/ArrayList;

    if-eqz v0, :cond_0

    .line 612
    iget-object v0, p0, Lcom/android/systemui/recent/RecentsPanelView;->mRecentTasksLoader:Lcom/android/systemui/recent/RecentTasksLoader;

    invoke-virtual {v0, p0}, Lcom/android/systemui/recent/RecentTasksLoader;->cancelLoadingThumbnailsAndIcons(Lcom/android/systemui/recent/RecentsPanelView;)V

    .line 613
    invoke-virtual {p0}, Lcom/android/systemui/recent/RecentsPanelView;->onTaskLoadingCancelled()V

    .line 615
    :cond_0
   [COLOR="Red"] invoke-direct {p0}, Lcom/android/systemui/recent/RecentsPanelView;->updateRamBar()V[/COLOR]

    return-void
.end method

find this method, and add the red line above goto :goto_0
Code:
.method public handleSwipe(Landroid/view/View;)V
Code:
    .line 770
    const/4 v2, 0x0

    invoke-virtual {p0, v2}, Lcom/android/systemui/recent/RecentsPanelView;->setContentDescription(Ljava/lang/CharSequence;)V

    invoke-direct {p0}, Lcom/android/systemui/recent/RecentsPanelView;->showMemDisplay()Z

   [COLOR="Red"] invoke-direct {p0}, Lcom/android/systemui/recent/RecentsPanelView;->updateRamBar()V[/COLOR]

    [COLOR="Blue"]goto :goto_0[/COLOR]
.end method

.method public isInContentArea(II)Z
    .locals 2
    .parameter "x"
    .parameter "y"

    .prologue
    const/4 v0, 0x1

Next, find this method
Code:
.method protected onFinishInflate()V
and add the red line above return-void
Code:
    invoke-direct {v2, p0}, Lcom/android/systemui/recent/RecentsPanelView$AsteroidGoogleHelper;-><init>(Lcom/android/systemui/recent/RecentsPanelView;)V

    invoke-virtual {v1, v2}, Landroid/widget/ImageButton;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    [COLOR="Red"]invoke-direct {p0}, Lcom/android/systemui/recent/RecentsPanelView;->updateRamBar()V[/COLOR]

    [COLOR="Blue"]return-void[/COLOR]

    .line 473
    .end local v0           #scrollView:Lcom/android/systemui/recent/RecentsPanelView$RecentsScrollView;
    :cond_1
    new-instance v1, Ljava/lang/IllegalArgumentException;

    const-string v2, "missing Recents[Horizontal]ScrollView"

Next
Code:
.method public onTaskLoadingCancelled()V
    .locals 1

    .prologue
    .line 619
    iget-object v0, p0, Lcom/android/systemui/recent/RecentsPanelView;->mRecentTaskDescriptions:Ljava/util/ArrayList;

    if-eqz v0, :cond_0

    .line 620
    const/4 v0, 0x0

    iput-object v0, p0, Lcom/android/systemui/recent/RecentsPanelView;->mRecentTaskDescriptions:Ljava/util/ArrayList;

    .line 621
    iget-object v0, p0, Lcom/android/systemui/recent/RecentsPanelView;->mListAdapter:Lcom/android/systemui/recent/RecentsPanelView$TaskDescriptionAdapter;

    invoke-virtual {v0}, Lcom/android/systemui/recent/RecentsPanelView$TaskDescriptionAdapter;->notifyDataSetInvalidated()V

    .line 623
    :cond_0
    [COLOR="Red"]invoke-direct {p0}, Lcom/android/systemui/recent/RecentsPanelView;->updateRamBar()V[/COLOR]

    return-void
.end method

.method onTaskThumbnailLoaded(Lcom/android/systemui/recent/TaskDescription;)V
    .locals 7

Next and the last
Code:
.method public refreshViews()V
    .locals 1

    .prologue
    .line 626
    iget-object v0, p0, Lcom/android/systemui/recent/RecentsPanelView;->mListAdapter:Lcom/android/systemui/recent/RecentsPanelView$TaskDescriptionAdapter;

    invoke-virtual {v0}, Lcom/android/systemui/recent/RecentsPanelView$TaskDescriptionAdapter;->notifyDataSetInvalidated()V

    .line 627
    invoke-direct {p0}, Lcom/android/systemui/recent/RecentsPanelView;->updateUiElements()V

    .line 628
    invoke-direct {p0}, Lcom/android/systemui/recent/RecentsPanelView;->showIfReady()V

   [COLOR="Red"] invoke-direct {p0}, Lcom/android/systemui/recent/RecentsPanelView;->updateRamBar()V[/COLOR]

    .line 629
    return-void
.end method

Done and recompile
Download attached AsteroidRAMbar.apk, push to system/app/with right permission
 

Attachments

  • AsteroidRAMbar.apk
    211.9 KB · Views: 626
Last edited:

Oohhlala

Senior Member
Jul 12, 2012
543
34
CREDIT & THANKS :

- AOKP ROM
- SLIMROM
- CARBON ROM
- CYANOGENMOD
- Ficeto colorpicker
- magaritnov colorpicker
- [Unofficial Community] Galaxy Wonder CyanogenMod Indonesia

sir, i met this issue when recompile, tell me what is this and how to fix

I: Smaling...
[48,4] Error for input '.param': Invalid directive
[49,4] Error for input '.param': Invalid directive
[50,4] Error for input '.param': Invalid directive
[48,11] mismatched input 'p1' expecting END_METHOD_DIRECTIVE
Exception in thread "main" brut.androlib.AndrolibException: Could not smali file: c:\TickleMyAndroid\_WorkArea1\_working\SystemUI.apk\smali\com\android\systemui\BeanBag$Board$1.smali
at brut.androlib.src.DexFileBuilder.addSmaliFile(DexFileBuilder.java:45)
at brut.androlib.src.DexFileBuilder.addSmaliFile(DexFileBuilder.java:33)
at brut.androlib.src.SmaliBuilder.buildFile(SmaliBuilder.java:66)
at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:50)
at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:37)
at brut.androlib.Androlib.buildSourcesSmali(Androlib.java:257)
at brut.androlib.Androlib.buildSources(Androlib.java:214)
at brut.androlib.Androlib.build(Androlib.java:205)
at brut.androlib.Androlib.build(Androlib.java:176)
at brut.apktool.Main.cmdBuild(Main.java:228)
at brut.apktool.Main.main(Main.java:79)

----------------

Recompile Not Successful!
 
Last edited:

Adi Aisiteru Reborn

Senior Member
Apr 3, 2013
1,770
4,830
Bandar Lampung
sir, i met this issue when recompile, tell me what is this and how to fix

I: Smaling...
[48,4] Error for input '.param': Invalid directive
[49,4] Error for input '.param': Invalid directive
[50,4] Error for input '.param': Invalid directive
[48,11] mismatched input 'p1' expecting END_METHOD_DIRECTIVE
Exception in thread "main" brut.androlib.AndrolibException: Could not smali file: c:\TickleMyAndroid\_WorkArea1\_working\SystemUI.apk\smali\com\android\systemui\BeanBag$Board$1.smali
at brut.androlib.src.DexFileBuilder.addSmaliFile(DexFileBuilder.java:45)
at brut.androlib.src.DexFileBuilder.addSmaliFile(DexFileBuilder.java:33)
at brut.androlib.src.SmaliBuilder.buildFile(SmaliBuilder.java:66)
at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:50)
at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:37)
at brut.androlib.Androlib.buildSourcesSmali(Androlib.java:257)
at brut.androlib.Androlib.buildSources(Androlib.java:214)
at brut.androlib.Androlib.build(Androlib.java:205)
at brut.androlib.Androlib.build(Androlib.java:176)
at brut.apktool.Main.cmdBuild(Main.java:228)
at brut.apktool.Main.main(Main.java:79)

----------------

Recompile Not Successful!

Try with apktool 1.5 xx

Sent from my GT-I8150 using XDA Free mobile app
 

Adi Aisiteru Reborn

Senior Member
Apr 3, 2013
1,770
4,830
Bandar Lampung
bro, plz explain me this step. i have to replace the ID in public.xml by your ID ( in smali ) or replace the ID in smali by one in public.xml ?

you will get the value of the questions marks in your secondly decompiled SystemUI.Apk/res/values/publc.xml
Code:
<public type="[COLOR="Red"]id[/COLOR]" name="[COLOR="Red"]asteroid_ram_usage_bar[/COLOR]" id="0x7f[COLOR="Blue"]??????[/COLOR]" />

Next , change this 0x7f08012f in my smali with that :). I think am clear enough
 

Oohhlala

Senior Member
Jul 12, 2012
543
34
you will get the value of the questions marks in your secondly decompiled SystemUI.Apk/res/values/publc.xml
Code:
<public type="[COLOR="Red"]id[/COLOR]" name="[COLOR="Red"]asteroid_ram_usage_bar[/COLOR]" id="0x7f[COLOR="Blue"]??????[/COLOR]" />

Next , change this 0x7f08012f in my smali with that :). I think am clear enough
Finally i got it, thank in advance :good:

Btw i tried to add this mod to other area ( notification panel) but it just shows the bar background, doesn't show the values
 

Attachments

  • Screenshot_2014-07-03-14-29-05.jpg
    Screenshot_2014-07-03-14-29-05.jpg
    74.7 KB · Views: 121
  • Like
Reactions: Adi Aisiteru Reborn

Top Liked Posts

  • There are no posts matching your filters.
  • 9
    HOW TO ADD AOSP RAM LINEAR COLOR BAR, IN RECENT PANEL

    picture.php
    picture.php


    picture.php
    picture.php



    NOTE !! , This Mod guide is a continue from this thread, How to added RAM PROGRESS BAR & CLEAR ALL RECENT APPS in Recent panel for JB 4.2 + +

    so to understand this Mod guide you have to already clean done that guide first !!


    TRY AT YOUR OWN RISK !!!

    THANKS :laugh::good:


    STEP -1

    Decompile your SystemUI.apk

    - Download attached LinearColorRamBar_SystemUI.apk.zip exstract it and merge to your decompiled systemui.apk

    - SystemUI.apk/res/layout/status_bar_recent_panel.xml
    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <com.android.systemui.recent.RecentsPanelView android:id="@id/recents_root" android:layout_width="fill_parent" android:layout_height="fill_parent" systemui:recentItemLayout="@layout/status_bar_recent_item"
      xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui">
        <LinearLayout android:orientation="vertical" android:background="@drawable/status_bar_recents_background" android:layout_width="fill_parent" android:layout_height="fill_parent">
            <view android:orientation="horizontal" android:id="@id/asteroid_ram_usage_bar" android:paddingLeft="4.0dip" android:paddingTop="10.0dip" android:paddingRight="4.0dip" android:clipChildren="false" android:clipToPadding="false" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginLeft="@*android:dimen/preference_fragment_padding_side" android:layout_marginTop="-5.0dip" android:layout_marginRight="@*android:dimen/preference_fragment_padding_side" class="com.android.systemui.recent.LinearColorBar">
                <TextView android:textAppearance="?android:textAppearanceSmallInverse" android:textColor="#ff000000" android:gravity="bottom|left|center" android:id="@id/asteroid_usedMemText" android:focusable="true" android:layout_width="0.0px" android:layout_height="wrap_content" android:singleLine="true" android:layout_weight="1.0" />
                <TextView android:textAppearance="?android:textAppearanceSmallInverse" android:textColor="#ff000000" android:gravity="center" android:id="@id/asteroid_ramText" android:focusable="true" android:layout_width="0.0px" android:layout_height="wrap_content" android:singleLine="true" android:layout_weight="1.0" />
                <TextView android:textAppearance="?android:textAppearanceSmallInverse" android:textColor="#ff000000" android:gravity="bottom|right|center" android:layout_gravity="right|center" android:id="@id/asteroid_freeMemText" android:focusable="true" android:layout_width="0.0px" android:layout_height="wrap_content" android:singleLine="true" android:layout_weight="1.0" />
            </view>
            <LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content">
                <TextView android:textColor="@*android:color/holo_blue_dark" android:layout_gravity="center" android:id="@id/recents_memory_text" android:layout_width="wrap_content" android:layout_height="wrap_content" />
                <ProgressBar android:id="@id/recents_memory_bar" android:paddingLeft="4.0dip" android:paddingRight="4.0dip" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginLeft="@*android:dimen/preference_fragment_padding_side" android:layout_marginRight="@*android:dimen/preference_fragment_padding_side" style="?android:attr/progressBarStyleHorizontal" />
            </LinearLayout>
            <FrameLayout android:id="@id/recents_bg_protect" android:fitsSystemWindows="true" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_alignParentBottom="true">
                <com.android.systemui.recent.RecentsVerticalScrollView android:layout_gravity="bottom|left|center" android:id="@id/recents_container" android:scrollbars="none" android:fadingEdge="vertical" android:fadingEdgeLength="@dimen/status_bar_recents_scroll_fading_edge_length" android:clipChildren="false" android:clipToPadding="false" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginRight="0.0dip" android:stackFromBottom="true" android:divider="@null">
                    <LinearLayout android:orientation="vertical" android:id="@id/recents_linear_layout" android:clipChildren="false" android:clipToPadding="false" android:layout_width="fill_parent" android:layout_height="wrap_content" />
                </com.android.systemui.recent.RecentsVerticalScrollView>
                <include android:layout_gravity="center" android:id="@id/recents_no_apps" android:visibility="invisible" android:layout_width="fill_parent" android:layout_height="fill_parent" layout="@layout/status_bar_no_recent_apps" />
                <LinearLayout android:layout_gravity="bottom" android:orientation="horizontal" android:background="@drawable/tw_ab_bottom_transparent_dark_holo" android:layout_width="fill_parent" android:layout_height="45.0dip" android:layout_weight="1.0">
                    <ImageButton android:id="@id/asteroid_recents_task_manager_button" android:background="@drawable/tw_recent_panel_button_forphone" android:layout_width="fill_parent" android:layout_height="fill_parent" android:src="@drawable/tw_recent_panel_ic_task_manager_holo_dark" android:layout_weight="1.0" android:contentDescription="@string/status_bar_recent_launch_task_manager_title" style="?android:attr/buttonStyle" />
                    <LinearLayout android:layout_gravity="center_vertical" android:background="@drawable/tw_divider_vertical_holo_dark" android:layout_width="1.0dip" android:layout_height="29.0dip" />
                    <ImageButton android:id="@id/asteroid_recents_google_button" android:background="@drawable/tw_recent_panel_button_forphone" android:layout_width="fill_parent" android:layout_height="fill_parent" android:src="@drawable/tw_recent_panel_ic_google_holo_dark" android:layout_weight="1.0" android:contentDescription="@string/status_bar_recent_launch_google_button" style="?android:attr/buttonStyle" />
                    <LinearLayout android:layout_gravity="center_vertical" android:background="@drawable/tw_divider_vertical_holo_dark" android:layout_width="1.0dip" android:layout_height="29.0dip" />
                    <ImageButton android:id="@id/asteroid_recents_clear_all_button" android:background="@drawable/tw_recent_panel_button_forphone" android:layout_width="fill_parent" android:layout_height="fill_parent" android:src="@drawable/tw_recent_panel_ic_delete_holo_dark" android:layout_weight="1.0" android:contentDescription="@string/status_bar_recent_remove_all_button" style="?android:attr/buttonStyle" />
                </LinearLayout>
            </FrameLayout>
        </LinearLayout>
    </com.android.systemui.recent.RecentsPanelView>

    - SystemUI.apk/res/layout-land/status_bar_recent_panel.xml
    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <com.android.systemui.recent.RecentsPanelView android:id="@id/recents_root" android:layout_width="fill_parent" android:layout_height="fill_parent" systemui:recentItemLayout="@layout/status_bar_recent_item"
      xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui">
        <LinearLayout android:orientation="vertical" android:background="@drawable/status_bar_recents_background" android:layout_width="fill_parent" android:layout_height="fill_parent">
            <view android:orientation="horizontal" android:id="@id/asteroid_ram_usage_bar" android:paddingLeft="4.0dip" android:paddingTop="10.0dip" android:paddingRight="4.0dip" android:clipChildren="false" android:clipToPadding="false" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginLeft="@*android:dimen/preference_fragment_padding_side" android:layout_marginTop="-5.0dip" android:layout_marginRight="@*android:dimen/preference_fragment_padding_side" class="com.android.systemui.recent.LinearColorBar">
                <TextView android:textAppearance="?android:textAppearanceSmallInverse" android:textColor="#ff000000" android:gravity="bottom|left|center" android:id="@id/asteroid_usedMemText" android:focusable="true" android:layout_width="0.0px" android:layout_height="wrap_content" android:singleLine="true" android:layout_weight="1.0" />
                <TextView android:textAppearance="?android:textAppearanceSmallInverse" android:textColor="#ff000000" android:gravity="center" android:id="@id/asteroid_ramText" android:focusable="true" android:layout_width="0.0px" android:layout_height="wrap_content" android:singleLine="true" android:layout_weight="1.0" />
                <TextView android:textAppearance="?android:textAppearanceSmallInverse" android:textColor="#ff000000" android:gravity="bottom|right|center" android:layout_gravity="right|center" android:id="@id/asteroid_freeMemText" android:focusable="true" android:layout_width="0.0px" android:layout_height="wrap_content" android:singleLine="true" android:layout_weight="1.0" />
            </view>
            <LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content">
                <TextView android:textColor="@*android:color/holo_blue_dark" android:layout_gravity="center" android:id="@id/recents_memory_text" android:layout_width="wrap_content" android:layout_height="wrap_content" />
                <ProgressBar android:id="@id/recents_memory_bar" android:paddingLeft="4.0dip" android:paddingRight="4.0dip" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginLeft="@*android:dimen/preference_fragment_padding_side" android:layout_marginRight="@*android:dimen/preference_fragment_padding_side" style="?android:attr/progressBarStyleHorizontal" />
            </LinearLayout>
            <FrameLayout android:id="@id/recents_bg_protect" android:fitsSystemWindows="true" android:clipChildren="false" android:clipToPadding="false" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_alignParentBottom="true">
                <com.android.systemui.recent.RecentsHorizontalScrollView android:layout_gravity="right" android:id="@id/recents_container" android:scrollbars="none" android:fadingEdge="horizontal" android:fadingEdgeLength="@dimen/status_bar_recents_scroll_fading_edge_length" android:clipChildren="false" android:clipToPadding="false" android:layout_width="wrap_content" android:layout_height="fill_parent">
                    <LinearLayout android:orientation="horizontal" android:id="@id/recents_linear_layout" android:clipChildren="false" android:clipToPadding="false" android:layout_width="wrap_content" android:layout_height="fill_parent" />
                </com.android.systemui.recent.RecentsHorizontalScrollView>
                <include android:layout_gravity="center" android:id="@id/recents_no_apps" android:visibility="invisible" android:layout_width="fill_parent" android:layout_height="fill_parent" layout="@layout/status_bar_no_recent_apps" />
                <LinearLayout android:layout_gravity="bottom" android:orientation="horizontal" android:background="@drawable/tw_ab_bottom_transparent_dark_holo" android:layout_width="fill_parent" android:layout_height="45.0dip" android:layout_weight="1.0">
                    <ImageButton android:id="@id/asteroid_recents_task_manager_button" android:background="@drawable/tw_recent_panel_button_forphone" android:layout_width="fill_parent" android:layout_height="fill_parent" android:src="@drawable/tw_recent_panel_ic_task_manager_holo_dark" android:layout_weight="1.0" android:contentDescription="@string/status_bar_recent_launch_task_manager_title" style="?android:attr/buttonStyle" />
                    <LinearLayout android:layout_gravity="center_vertical" android:background="@drawable/tw_divider_vertical_holo_dark" android:layout_width="1.0dip" android:layout_height="29.0dip" />
                    <ImageButton android:id="@id/asteroid_recents_google_button" android:background="@drawable/tw_recent_panel_button_forphone" android:layout_width="fill_parent" android:layout_height="fill_parent" android:src="@drawable/tw_recent_panel_ic_google_holo_dark" android:layout_weight="1.0" android:contentDescription="@string/status_bar_recent_launch_google_button" style="?android:attr/buttonStyle" />
                    <LinearLayout android:layout_gravity="center_vertical" android:background="@drawable/tw_divider_vertical_holo_dark" android:layout_width="1.0dip" android:layout_height="29.0dip" />
                    <ImageButton android:id="@id/asteroid_recents_clear_all_button" android:background="@drawable/tw_recent_panel_button_forphone" android:layout_width="fill_parent" android:layout_height="fill_parent" android:src="@drawable/tw_recent_panel_ic_delete_holo_dark" android:layout_weight="1.0" android:contentDescription="@string/status_bar_recent_remove_all_button" style="?android:attr/buttonStyle" />
                </LinearLayout>
            </FrameLayout>
        </LinearLayout>
    </com.android.systemui.recent.RecentsPanelView>

    - SystemUI.apk/res/values/ids.xml
    Code:
        <item type="id" name="asteroid_recents_google_button">false</item>
        <item type="id" name="asteroid_recents_clear_all_button">false</item>
        [COLOR="Red"]<item type="id" name="asteroid_ram_usage_bar">false</item>
        <item type="id" name="asteroid_usedMemText">false</item>
        <item type="id" name="asteroid_ramText">false</item>
        <item type="id" name="asteroid_freeMemText">false</item>[/COLOR]
    </resources>

    - SystemUI.apk/res/values/strings.xml
    Code:
        <string name="status_bar_recent_launch_task_manager_title">Task manager</string>
        <string name="status_bar_recent_launch_google_button">Google</string>
        <string name="status_bar_recent_remove_all_button">Remove all</string>
        [COLOR="Red"]<string name="memory">RAM</string>
        <string name="service_free_mem">%1$s free</string>
        <string name="service_used_mem">%1$s used</string>[/COLOR]
    </resources>

    - Recompile your SystemUI.apk
    4
    STEP -2

    Decompile the newly Recompiled APK again
    Next go to
    res/values/public.xml
    open it with Notepad++
    leave it, but keep it open

    - SystemUI.apk/smali/com/android/systemui/recent/RecentsPanelView.smali
    add the red line

    Code:
    # instance fields
    [COLOR="Red"].field private mActiveMemory:J[/COLOR]
    
    .field private mAnimateIconOfFirstTask:Z
    
    [COLOR="Red"].field private mCachedMemory:J[/COLOR]
    
    .field private mFitThumbnailToXY:Z
    
    [COLOR="Red"].field mFreeMemText:Landroid/widget/TextView;[/COLOR]
    
    [COLOR="Red"].field private mFreeMemory:J[/COLOR]
    
    .field private mGoogleButton:Landroid/widget/ImageButton;
    
    .field private mHighEndGfx:Z
    
    .field private mItemToAnimateInWhenWindowAnimationIsFinished:Lcom/android/systemui/recent/RecentsPanelView$ViewHolder;
    
    .field private mListAdapter:Lcom/android/systemui/recent/RecentsPanelView$TaskDescriptionAdapter;
    
    [COLOR="Red"].field mMemInfoReader:Lcom/android/internal/util/MemInfoReader;[/COLOR]
    
    .field private mPopup:Landroid/widget/PopupMenu;
    
    [COLOR="Red"].field mRamText:Landroid/widget/TextView;[/COLOR]
    
    [COLOR="Red"].field private mRamUsageBar:Lcom/android/systemui/recent/LinearColorBar;[/COLOR]
    
    .field private mRecentItemLayoutId:I
    
    .field private mRecentTaskDescriptions:Ljava/util/ArrayList;
        .annotation system Ldalvik/annotation/Signature;
            value = {
                "Ljava/util/ArrayList",
                "<",
                "Lcom/android/systemui/recent/TaskDescription;",
                ">;"
            }
        .end annotation
    .end field
    
    .field private mRecentTasksLoader:Lcom/android/systemui/recent/RecentTasksLoader;
    
    .field private mRecentsClearAllButton:Landroid/widget/ImageButton;
    
    .field private mRecentsContainer:Landroid/view/ViewGroup;
    
    .field private mRecentsNoApps:Landroid/view/View;
    
    .field private mRecentsScrim:Landroid/view/View;
    
    .field private mShowing:Z
    
    .field private mStatusBarTouchProxy:Lcom/android/systemui/recent/StatusBarTouchProxy;
    
    .field private mTaskManagerButton:Landroid/widget/ImageButton;
    
    .field private mThumbnailWidth:I
    
    [COLOR="Red"].field private mTotalMemory:J[/COLOR]
    
    [COLOR="Red"].field mUsedMemText:Landroid/widget/TextView;[/COLOR]
    
    .field private mWaitingForWindowAnimation:Z
    
    .field private mWaitingToShow:Z
    
    .field private mWindowAnimationStartTime:J

    Code:
    .method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V
        .locals 3
        .parameter "context"
        .parameter "attrs"
        .parameter "defStyle"
    
        .prologue
        const/4 v2, 0x0
    
        .line 260
        invoke-direct {p0, p1, p2, p3}, Landroid/widget/FrameLayout;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V
    
        [COLOR="Red"]new-instance v1, Lcom/android/internal/util/MemInfoReader;
    
        invoke-direct {v1}, Lcom/android/internal/util/MemInfoReader;-><init>()V
    
        iput-object v1, p0, Lcom/android/systemui/recent/RecentsPanelView;->mMemInfoReader:Lcom/android/internal/util/MemInfoReader;[/COLOR]
    
        .line 261
        invoke-virtual {p0}, Lcom/android/systemui/recent/RecentsPanelView;->updateValuesFromResources()V
    
        .line 263
        sget-object v1, Lcom/android/systemui/R$styleable;->RecentsPanelView:[I
    
        invoke-virtual {p1, p2, v1, p3, v2}, Landroid/content/Context;->obtainStyledAttributes(Landroid/util/AttributeSet;[III)Landroid/content/res/TypedArray;
    
        move-result-object v0

    Code:
    .method static synthetic access$1102(Lcom/android/systemui/recent/RecentsPanelView;Landroid/widget/PopupMenu;)Landroid/widget/PopupMenu;
        .locals 0
        .parameter "x0"
        .parameter "x1"
    
        .prologue
        .line 73
        iput-object p1, p0, Lcom/android/systemui/recent/RecentsPanelView;->mPopup:Landroid/widget/PopupMenu;
    
        return-object p1
    .end method
    
    [COLOR="Red"].method static synthetic access$11400(Lcom/android/systemui/recent/RecentsPanelView;)Landroid/content/Context;
        .locals 1
        .parameter "x0"
    
        .prologue
        .line 85
        iget-object v0, p0, Lcom/android/systemui/recent/RecentsPanelView;->mContext:Landroid/content/Context;
    
        return-object v0
    .end method[/COLOR]
    
    .method static synthetic access$177777700(Lcom/android/systemui/recent/RecentsPanelView;)V
        .locals 0
        .parameter "x0"
    
        .prologue
        .line 75
        invoke-direct {p0}, Lcom/android/systemui/recent/RecentsPanelView;->AsteroidClearAllRecentApps()V
    
        return-void
    .end method
    
    .method static synthetic access$200(Lcom/android/systemui/recent/RecentsPanelView;)Lcom/android/systemui/recent/RecentTasksLoader;

    Code:
    .method private pointInside(IILandroid/view/View;)Z
        .locals 5
        .parameter "x"
        .parameter "y"
        .parameter "v"
    
        .prologue
        .line 282
        invoke-virtual {p3}, Landroid/view/View;->getLeft()I
    
        move-result v1
    
        .line 283
        .local v1, l:I
        invoke-virtual {p3}, Landroid/view/View;->getRight()I
    
        move-result v2
    
        .line 284
        .local v2, r:I
        invoke-virtual {p3}, Landroid/view/View;->getTop()I
    
        move-result v3
    
        .line 285
        .local v3, t:I
        invoke-virtual {p3}, Landroid/view/View;->getBottom()I
    
        move-result v0
    
        .line 286
        .local v0, b:I
        if-lt p1, v1, :cond_0
    
        if-ge p1, v2, :cond_0
    
        if-lt p2, v3, :cond_0
    
        if-ge p2, v0, :cond_0
    
        const/4 v4, 0x1
    
        :goto_0
        return v4
    
        :cond_0
        const/4 v4, 0x0
    
        goto :goto_0
    .end method
    
    [COLOR="Red"].method private static readLine(Ljava/lang/String;I)Ljava/lang/String;
        .locals 4
        .parameter "filename"
        .parameter "line"
        .annotation system Ldalvik/annotation/Throws;
            value = {
                Ljava/io/IOException;
            }
        .end annotation
    
        .prologue
        .line 1190
        new-instance v1, Ljava/io/BufferedReader;
    
        new-instance v2, Ljava/io/FileReader;
    
        invoke-direct {v2, p0}, Ljava/io/FileReader;-><init>(Ljava/lang/String;)V
    
        const/16 v3, 0x100
    
        invoke-direct {v1, v2, v3}, Ljava/io/BufferedReader;-><init>(Ljava/io/Reader;I)V
    
        .line 1192
        .local v1, reader:Ljava/io/BufferedReader;
        const/4 v0, 0x1
    
        .local v0, i:I
        :goto_0
        if-ge v0, p1, :cond_0
    
        .line 1193
        :try_start_0
        invoke-virtual {v1}, Ljava/io/BufferedReader;->readLine()Ljava/lang/String;
    
        .line 1192
        add-int/lit8 v0, v0, 0x1
    
        goto :goto_0
    
        .line 1195
        :cond_0
        invoke-virtual {v1}, Ljava/io/BufferedReader;->readLine()Ljava/lang/String;
        :try_end_0
        .catchall {:try_start_0 .. :try_end_0} :catchall_0
    
        move-result-object v2
    
        .line 1197
        invoke-virtual {v1}, Ljava/io/BufferedReader;->close()V
    
        return-object v2
    
        :catchall_0
        move-exception v2
    
        invoke-virtual {v1}, Ljava/io/BufferedReader;->close()V
    
        throw v2
    .end method[/COLOR]
    
    .method private refreshRecentTasksList(Ljava/util/ArrayList;Z)V
        .locals 1
        .parameter
        .parameter "firstScreenful"
        .annotation system Ldalvik/annotation/Signature;
            value = {
                "(",
                "Ljava/util/ArrayList",
                "<",
                "Lcom/android/systemui/recent/TaskDescription;",
                ">;Z)V"
            }
        .end annotation
    
        .prologue
        .line 646
        .local p1, recentTasksList:Ljava/util/ArrayList;,"Ljava/util/ArrayList<Lcom/android/systemui/recent/TaskDescription;>;"
        iget-object v0, p0, Lcom/android/systemui/recent/RecentsPanelView;->mRecentTaskDescriptions:Ljava/util/ArrayList;
    
        if-nez v0, :cond_0

    Code:
     iget-object v0, p1, Lcom/android/systemui/recent/RecentsPanelView$ViewHolder;->iconView:Landroid/widget/ImageView;
    
        const/4 v1, 0x0
    
        invoke-virtual {v0, v1}, Landroid/widget/ImageView;->setVisibility(I)V
    
        .line 515
        :cond_1
        return-void
    .end method
    
    [COLOR="Red"].method private updateMemoryInfo()V
        .locals 7
    
        .prologue
        const/4 v6, 0x3
    
        const-wide/16 v0, 0x0
    
        :try_start_0
        const-string v2, "/proc/meminfo"
    
        const/4 v3, 0x1
    
        invoke-static {v2, v3}, Lcom/android/systemui/recent/RecentsPanelView;->readLine(Ljava/lang/String;I)Ljava/lang/String;
    
        move-result-object v2
    
        if-eqz v2, :cond_0
    
        const-string v3, "\\s+"
    
        invoke-virtual {v2, v3}, Ljava/lang/String;->split(Ljava/lang/String;)[Ljava/lang/String;
    
        move-result-object v2
    
        array-length v3, v2
    
        if-ne v3, v6, :cond_0
    
        const/4 v3, 0x1
    
        aget-object v2, v2, v3
    
        invoke-static {v2}, Ljava/lang/Long;->parseLong(Ljava/lang/String;)J
    
        move-result-wide v2
    
        const-wide/16 v4, 0x400
    
        div-long v0, v2, v4
        :try_end_0
        .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_3
    
        :cond_0
        :goto_0
        iput-wide v0, p0, Lcom/android/systemui/recent/RecentsPanelView;->mTotalMemory:J
    
        :try_start_1
        const-string v2, "/proc/meminfo"
    
        const/4 v3, 0x2
    
        invoke-static {v2, v3}, Lcom/android/systemui/recent/RecentsPanelView;->readLine(Ljava/lang/String;I)Ljava/lang/String;
    
        move-result-object v2
    
        if-eqz v2, :cond_1
    
        const-string v3, "\\s+"
    
        invoke-virtual {v2, v3}, Ljava/lang/String;->split(Ljava/lang/String;)[Ljava/lang/String;
    
        move-result-object v2
    
        array-length v3, v2
    
        if-ne v3, v6, :cond_1
    
        const/4 v3, 0x1
    
        aget-object v2, v2, v3
    
        invoke-static {v2}, Ljava/lang/Long;->parseLong(Ljava/lang/String;)J
    
        move-result-wide v2
    
        const-wide/16 v4, 0x400
    
        div-long v0, v2, v4
        :try_end_1
        .catch Ljava/io/IOException; {:try_start_1 .. :try_end_1} :catch_2
    
        :cond_1
        :goto_1
        iput-wide v0, p0, Lcom/android/systemui/recent/RecentsPanelView;->mFreeMemory:J
    
        :try_start_2
        const-string v2, "/proc/meminfo"
    
        const/4 v3, 0x6
    
        invoke-static {v2, v3}, Lcom/android/systemui/recent/RecentsPanelView;->readLine(Ljava/lang/String;I)Ljava/lang/String;
    
        move-result-object v2
    
        if-eqz v2, :cond_2
    
        const-string v3, "\\s+"
    
        invoke-virtual {v2, v3}, Ljava/lang/String;->split(Ljava/lang/String;)[Ljava/lang/String;
    
        move-result-object v2
    
        array-length v3, v2
    
        if-ne v3, v6, :cond_2
    
        const/4 v3, 0x1
    
        aget-object v2, v2, v3
    
        invoke-static {v2}, Ljava/lang/Long;->parseLong(Ljava/lang/String;)J
    
        move-result-wide v2
    
        const-wide/16 v4, 0x400
    
        div-long v0, v2, v4
        :try_end_2
        .catch Ljava/io/IOException; {:try_start_2 .. :try_end_2} :catch_1
    
        :cond_2
        :goto_2
        iput-wide v0, p0, Lcom/android/systemui/recent/RecentsPanelView;->mActiveMemory:J
    
        :try_start_3
        const-string v2, "/proc/meminfo"
    
        const/4 v3, 0x4
    
        invoke-static {v2, v3}, Lcom/android/systemui/recent/RecentsPanelView;->readLine(Ljava/lang/String;I)Ljava/lang/String;
    
        move-result-object v2
    
        if-eqz v2, :cond_3
    
        const-string v3, "\\s+"
    
        invoke-virtual {v2, v3}, Ljava/lang/String;->split(Ljava/lang/String;)[Ljava/lang/String;
    
        move-result-object v2
    
        array-length v3, v2
    
        if-ne v3, v6, :cond_3
    
        const/4 v3, 0x1
    
        aget-object v2, v2, v3
    
        invoke-static {v2}, Ljava/lang/Long;->parseLong(Ljava/lang/String;)J
    
        move-result-wide v2
    
        const-wide/16 v4, 0x400
    
        div-long v0, v2, v4
        :try_end_3
        .catch Ljava/io/IOException; {:try_start_3 .. :try_end_3} :catch_0
    
        :cond_3
        :goto_3
        iput-wide v0, p0, Lcom/android/systemui/recent/RecentsPanelView;->mCachedMemory:J
    
        return-void
    
        :catch_0
        move-exception v2
    
        goto :goto_3
    
        :catch_1
        move-exception v2
    
        goto :goto_2
    
        :catch_2
        move-exception v2
    
        goto :goto_1
    
        :catch_3
        move-exception v2
    
        goto :goto_0
    .end method
    
    .method private updateRamBar()V
        .locals 15
    
        .prologue
        const-wide/16 v1, 0x0
    
        const/4 v10, 0x1
    
        const/4 v9, 0x0
    
        const v0, [COLOR="Blue"]0x7f08012f[/COLOR]
    
        invoke-virtual {p0, v0}, Lcom/android/systemui/recent/RecentsPanelView;->findViewById(I)Landroid/view/View;
    
        move-result-object v0
    
        check-cast v0, Lcom/android/systemui/recent/LinearColorBar;
    
        iput-object v0, p0, Lcom/android/systemui/recent/RecentsPanelView;->mRamUsageBar:Lcom/android/systemui/recent/LinearColorBar;
    
        iget-object v0, p0, Lcom/android/systemui/recent/RecentsPanelView;->mContext:Landroid/content/Context;
    
        invoke-virtual {v0}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
    
        move-result-object v0
    
        const-string v3, "recents_ram_bar_mode"
    
        invoke-static {v0, v3, v9}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
    
        move-result v3
    
        if-eqz v3, :cond_1
    
        iget-object v0, p0, Lcom/android/systemui/recent/RecentsPanelView;->mRamUsageBar:Lcom/android/systemui/recent/LinearColorBar;
    
        if-eqz v0, :cond_1
    
        new-instance v4, Landroid/util/DisplayMetrics;
    
        invoke-direct {v4}, Landroid/util/DisplayMetrics;-><init>()V
    
        iget-object v0, p0, Lcom/android/systemui/recent/RecentsPanelView;->mContext:Landroid/content/Context;
    
        const-string v5, "window"
    
        invoke-virtual {v0, v5}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
    
        move-result-object v0
    
        check-cast v0, Landroid/view/WindowManager;
    
        invoke-interface {v0}, Landroid/view/WindowManager;->getDefaultDisplay()Landroid/view/Display;
    
        move-result-object v0
    
        invoke-virtual {v0, v4}, Landroid/view/Display;->getMetrics(Landroid/util/DisplayMetrics;)V
    
        iget v0, v4, Landroid/util/DisplayMetrics;->density:F
    
        iget-object v0, p0, Lcom/android/systemui/recent/RecentsPanelView;->mRamUsageBar:Lcom/android/systemui/recent/LinearColorBar;
    
        invoke-virtual {v0, v9}, Lcom/android/systemui/recent/LinearColorBar;->setVisibility(I)V
    
        invoke-direct {p0}, Lcom/android/systemui/recent/RecentsPanelView;->updateMemoryInfo()V
    
        packed-switch v3, :pswitch_data_0
    
        move-wide v3, v1
    
        :goto_0
        const v0, [COLOR="Blue"]0x7f080130[/COLOR]
    
        invoke-virtual {p0, v0}, Lcom/android/systemui/recent/RecentsPanelView;->findViewById(I)Landroid/view/View;
    
        move-result-object v0
    
        check-cast v0, Landroid/widget/TextView;
    
        iput-object v0, p0, Lcom/android/systemui/recent/RecentsPanelView;->mUsedMemText:Landroid/widget/TextView;
    
        const v0, [COLOR="Blue"]0x7f080132[/COLOR]
    
        invoke-virtual {p0, v0}, Lcom/android/systemui/recent/RecentsPanelView;->findViewById(I)Landroid/view/View;
    
        move-result-object v0
    
        check-cast v0, Landroid/widget/TextView;
    
        iput-object v0, p0, Lcom/android/systemui/recent/RecentsPanelView;->mFreeMemText:Landroid/widget/TextView;
    
        const v0, [COLOR="Blue"]0x7f080131[/COLOR]
    
        invoke-virtual {p0, v0}, Lcom/android/systemui/recent/RecentsPanelView;->findViewById(I)Landroid/view/View;
    
        move-result-object v0
    
        check-cast v0, Landroid/widget/TextView;
    
        iput-object v0, p0, Lcom/android/systemui/recent/RecentsPanelView;->mRamText:Landroid/widget/TextView;
    
        iget-object v0, p0, Lcom/android/systemui/recent/RecentsPanelView;->mUsedMemText:Landroid/widget/TextView;
    
        invoke-virtual {p0}, Lcom/android/systemui/recent/RecentsPanelView;->getResources()Landroid/content/res/Resources;
    
        move-result-object v5
    
        const v6, [COLOR="Blue"]0x7f0b00f7[/COLOR]
    
        new-array v7, v10, [Ljava/lang/Object;
    
        new-instance v8, Ljava/lang/StringBuilder;
    
        invoke-direct {v8}, Ljava/lang/StringBuilder;-><init>()V
    
        invoke-virtual {v8, v3, v4}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;
    
        move-result-object v3
    
        const-string v4, " MB"
    
        invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
    
        move-result-object v3
    
        invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
    
        move-result-object v3
    
        aput-object v3, v7, v9
    
        invoke-virtual {v5, v6, v7}, Landroid/content/res/Resources;->getString(I[Ljava/lang/Object;)Ljava/lang/String;
    
        move-result-object v3
    
        invoke-virtual {v0, v3}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V
    
        iget-object v0, p0, Lcom/android/systemui/recent/RecentsPanelView;->mFreeMemText:Landroid/widget/TextView;
    
        invoke-virtual {p0}, Lcom/android/systemui/recent/RecentsPanelView;->getResources()Landroid/content/res/Resources;
    
        move-result-object v3
    
        const v4, [COLOR="Blue"]0x7f0b00f6[/COLOR]
    
        new-array v5, v10, [Ljava/lang/Object;
    
        new-instance v6, Ljava/lang/StringBuilder;
    
        invoke-direct {v6}, Ljava/lang/StringBuilder;-><init>()V
    
        invoke-virtual {v6, v1, v2}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;
    
        move-result-object v1
    
        const-string v2, " MB"
    
        invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
    
        move-result-object v1
    
        invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
    
        move-result-object v1
    
        aput-object v1, v5, v9
    
        invoke-virtual {v3, v4, v5}, Landroid/content/res/Resources;->getString(I[Ljava/lang/Object;)Ljava/lang/String;
    
        move-result-object v1
    
        invoke-virtual {v0, v1}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V
    
        iget-object v0, p0, Lcom/android/systemui/recent/RecentsPanelView;->mRamText:Landroid/widget/TextView;
    
        invoke-virtual {p0}, Lcom/android/systemui/recent/RecentsPanelView;->getResources()Landroid/content/res/Resources;
    
        move-result-object v1
    
        const v2, [COLOR="Blue"]0x7f0b00f5[/COLOR]
    
        invoke-virtual {v1, v2}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;
    
        move-result-object v1
    
        invoke-virtual {v0, v1}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V
    
        iget-wide v0, p0, Lcom/android/systemui/recent/RecentsPanelView;->mTotalMemory:J
    
        long-to-float v0, v0
    
        iget-wide v1, p0, Lcom/android/systemui/recent/RecentsPanelView;->mTotalMemory:J
    
        iget-wide v3, p0, Lcom/android/systemui/recent/RecentsPanelView;->mFreeMemory:J
    
        sub-long/2addr v1, v3
    
        iget-wide v3, p0, Lcom/android/systemui/recent/RecentsPanelView;->mCachedMemory:J
    
        sub-long/2addr v1, v3
    
        iget-wide v3, p0, Lcom/android/systemui/recent/RecentsPanelView;->mActiveMemory:J
    
        sub-long/2addr v1, v3
    
        long-to-float v1, v1
    
        div-float/2addr v1, v0
    
        iget-wide v2, p0, Lcom/android/systemui/recent/RecentsPanelView;->mActiveMemory:J
    
        long-to-float v2, v2
    
        div-float/2addr v2, v0
    
        iget-wide v3, p0, Lcom/android/systemui/recent/RecentsPanelView;->mCachedMemory:J
    
        long-to-float v3, v3
    
        div-float v0, v3, v0
    
        iget-object v3, p0, Lcom/android/systemui/recent/RecentsPanelView;->mRamUsageBar:Lcom/android/systemui/recent/LinearColorBar;
    
        invoke-virtual {v3, v1, v0, v2}, Lcom/android/systemui/recent/LinearColorBar;->setRatios(FFF)V
    
        iget-object v0, p0, Lcom/android/systemui/recent/RecentsPanelView;->mRamUsageBar:Lcom/android/systemui/recent/LinearColorBar;
    
        new-instance v1, Lcom/android/systemui/recent/RecentsPanelView$AsteroidRunningServices;
    
        invoke-direct {v1, p0}, Lcom/android/systemui/recent/RecentsPanelView$AsteroidRunningServices;-><init>(Lcom/android/systemui/recent/RecentsPanelView;)V
    
        invoke-virtual {v0, v1}, Lcom/android/systemui/recent/LinearColorBar;->setOnClickListener(Landroid/view/View$OnClickListener;)V
    
        :cond_0
        :goto_1
        return-void
    
        :pswitch_0
        iget-wide v2, p0, Lcom/android/systemui/recent/RecentsPanelView;->mActiveMemory:J
    
        iget-wide v0, p0, Lcom/android/systemui/recent/RecentsPanelView;->mTotalMemory:J
    
        iget-wide v4, p0, Lcom/android/systemui/recent/RecentsPanelView;->mActiveMemory:J
    
        sub-long/2addr v0, v4
    
        move-wide v11, v0
    
        move-wide v13, v2
    
        move-wide v3, v13
    
        move-wide v1, v11
    
        goto/16 :goto_0
    
        :pswitch_1
        iget-wide v0, p0, Lcom/android/systemui/recent/RecentsPanelView;->mActiveMemory:J
    
        iget-wide v2, p0, Lcom/android/systemui/recent/RecentsPanelView;->mCachedMemory:J
    
        add-long/2addr v2, v0
    
        iget-wide v0, p0, Lcom/android/systemui/recent/RecentsPanelView;->mTotalMemory:J
    
        iget-wide v4, p0, Lcom/android/systemui/recent/RecentsPanelView;->mActiveMemory:J
    
        sub-long/2addr v0, v4
    
        iget-wide v4, p0, Lcom/android/systemui/recent/RecentsPanelView;->mCachedMemory:J
    
        sub-long/2addr v0, v4
    
        move-wide v11, v0
    
        move-wide v13, v2
    
        move-wide v3, v13
    
        move-wide v1, v11
    
        goto/16 :goto_0
    
        :pswitch_2
        iget-wide v0, p0, Lcom/android/systemui/recent/RecentsPanelView;->mTotalMemory:J
    
        iget-wide v2, p0, Lcom/android/systemui/recent/RecentsPanelView;->mFreeMemory:J
    
        sub-long v2, v0, v2
    
        iget-wide v0, p0, Lcom/android/systemui/recent/RecentsPanelView;->mFreeMemory:J
    
        move-wide v11, v0
    
        move-wide v13, v2
    
        move-wide v3, v13
    
        move-wide v1, v11
    
        goto/16 :goto_0
    
        :cond_1
        iget-object v0, p0, Lcom/android/systemui/recent/RecentsPanelView;->mRamUsageBar:Lcom/android/systemui/recent/LinearColorBar;
    
        if-eqz v0, :cond_0
    
        iget-object v0, p0, Lcom/android/systemui/recent/RecentsPanelView;->mRamUsageBar:Lcom/android/systemui/recent/LinearColorBar;
    
        const/16 v1, 0x8
    
        invoke-virtual {v0, v1}, Lcom/android/systemui/recent/LinearColorBar;->setVisibility(I)V
    
        goto :goto_1
    
        nop
    
        :pswitch_data_0
        .packed-switch 0x1
            :pswitch_0
            :pswitch_1
            :pswitch_2
        .end packed-switch
    .end method[/COLOR]
    
    .method private updateThumbnail(Lcom/android/systemui/recent/RecentsPanelView$ViewHolder;Landroid/graphics/Bitmap;ZZ)V
        .locals 5
        .parameter "h"
        .parameter "thumbnail"
        .parameter "show"
        .parameter "anim"

    Change this IDS with the value you got in your own public.xml

    - 0x7f08012f
    Code:
     <public type="id" name="asteroid_ram_usage_bar" id="[COLOR="Blue"]0x7f??????[/COLOR]" />

    -- 0x7f080130
    Code:
    <public type="id" name="asteroid_usedMemText" id="[COLOR="Blue"]0x7f??????[/COLOR]" />

    -- 0x7f080132
    Code:
     <public type="id" name="asteroid_freeMemText" id="[COLOR="Blue"]0x7f??????[/COLOR]" />

    -- 0x7f080131
    Code:
     <public type="id" name="asteroid_ramText" id="[COLOR="Blue"]0x7f??????[/COLOR]" />

    -- 0x7f0b00f7
    Code:
    <public type="string" name="service_used_mem" id="[COLOR="Blue"]0x7f??????[/COLOR]" />

    -- 0x7f0b00f6
    Code:
    <public type="string" name="service_free_mem" id="[COLOR="Blue"]0x7f??????[/COLOR]" />

    -- 0x7f0b00f5
    Code:
    <public type="string" name="memory" id="[COLOR="Blue"]0x7f??????[/COLOR]" />
    3
    NEXT,

    add the red line
    Code:
    .method public clearRecentTasksList()V
        .locals 1
    
        .prologue
        .line 611
        iget-object v0, p0, Lcom/android/systemui/recent/RecentsPanelView;->mRecentTaskDescriptions:Ljava/util/ArrayList;
    
        if-eqz v0, :cond_0
    
        .line 612
        iget-object v0, p0, Lcom/android/systemui/recent/RecentsPanelView;->mRecentTasksLoader:Lcom/android/systemui/recent/RecentTasksLoader;
    
        invoke-virtual {v0, p0}, Lcom/android/systemui/recent/RecentTasksLoader;->cancelLoadingThumbnailsAndIcons(Lcom/android/systemui/recent/RecentsPanelView;)V
    
        .line 613
        invoke-virtual {p0}, Lcom/android/systemui/recent/RecentsPanelView;->onTaskLoadingCancelled()V
    
        .line 615
        :cond_0
       [COLOR="Red"] invoke-direct {p0}, Lcom/android/systemui/recent/RecentsPanelView;->updateRamBar()V[/COLOR]
    
        return-void
    .end method

    find this method, and add the red line above goto :goto_0
    Code:
    .method public handleSwipe(Landroid/view/View;)V
    Code:
        .line 770
        const/4 v2, 0x0
    
        invoke-virtual {p0, v2}, Lcom/android/systemui/recent/RecentsPanelView;->setContentDescription(Ljava/lang/CharSequence;)V
    
        invoke-direct {p0}, Lcom/android/systemui/recent/RecentsPanelView;->showMemDisplay()Z
    
       [COLOR="Red"] invoke-direct {p0}, Lcom/android/systemui/recent/RecentsPanelView;->updateRamBar()V[/COLOR]
    
        [COLOR="Blue"]goto :goto_0[/COLOR]
    .end method
    
    .method public isInContentArea(II)Z
        .locals 2
        .parameter "x"
        .parameter "y"
    
        .prologue
        const/4 v0, 0x1

    Next, find this method
    Code:
    .method protected onFinishInflate()V
    and add the red line above return-void
    Code:
        invoke-direct {v2, p0}, Lcom/android/systemui/recent/RecentsPanelView$AsteroidGoogleHelper;-><init>(Lcom/android/systemui/recent/RecentsPanelView;)V
    
        invoke-virtual {v1, v2}, Landroid/widget/ImageButton;->setOnClickListener(Landroid/view/View$OnClickListener;)V
    
        [COLOR="Red"]invoke-direct {p0}, Lcom/android/systemui/recent/RecentsPanelView;->updateRamBar()V[/COLOR]
    
        [COLOR="Blue"]return-void[/COLOR]
    
        .line 473
        .end local v0           #scrollView:Lcom/android/systemui/recent/RecentsPanelView$RecentsScrollView;
        :cond_1
        new-instance v1, Ljava/lang/IllegalArgumentException;
    
        const-string v2, "missing Recents[Horizontal]ScrollView"

    Next
    Code:
    .method public onTaskLoadingCancelled()V
        .locals 1
    
        .prologue
        .line 619
        iget-object v0, p0, Lcom/android/systemui/recent/RecentsPanelView;->mRecentTaskDescriptions:Ljava/util/ArrayList;
    
        if-eqz v0, :cond_0
    
        .line 620
        const/4 v0, 0x0
    
        iput-object v0, p0, Lcom/android/systemui/recent/RecentsPanelView;->mRecentTaskDescriptions:Ljava/util/ArrayList;
    
        .line 621
        iget-object v0, p0, Lcom/android/systemui/recent/RecentsPanelView;->mListAdapter:Lcom/android/systemui/recent/RecentsPanelView$TaskDescriptionAdapter;
    
        invoke-virtual {v0}, Lcom/android/systemui/recent/RecentsPanelView$TaskDescriptionAdapter;->notifyDataSetInvalidated()V
    
        .line 623
        :cond_0
        [COLOR="Red"]invoke-direct {p0}, Lcom/android/systemui/recent/RecentsPanelView;->updateRamBar()V[/COLOR]
    
        return-void
    .end method
    
    .method onTaskThumbnailLoaded(Lcom/android/systemui/recent/TaskDescription;)V
        .locals 7

    Next and the last
    Code:
    .method public refreshViews()V
        .locals 1
    
        .prologue
        .line 626
        iget-object v0, p0, Lcom/android/systemui/recent/RecentsPanelView;->mListAdapter:Lcom/android/systemui/recent/RecentsPanelView$TaskDescriptionAdapter;
    
        invoke-virtual {v0}, Lcom/android/systemui/recent/RecentsPanelView$TaskDescriptionAdapter;->notifyDataSetInvalidated()V
    
        .line 627
        invoke-direct {p0}, Lcom/android/systemui/recent/RecentsPanelView;->updateUiElements()V
    
        .line 628
        invoke-direct {p0}, Lcom/android/systemui/recent/RecentsPanelView;->showIfReady()V
    
       [COLOR="Red"] invoke-direct {p0}, Lcom/android/systemui/recent/RecentsPanelView;->updateRamBar()V[/COLOR]
    
        .line 629
        return-void
    .end method

    Done and recompile
    Download attached AsteroidRAMbar.apk, push to system/app/with right permission
    3
    CREDIT & THANKS :

    - AOKP ROM
    - SLIMROM
    - CARBON ROM
    - CYANOGENMOD
    - Ficeto colorpicker
    - magaritnov colorpicker
    - [Unofficial Community] Galaxy Wonder CyanogenMod Indonesia
    1
    I see that you are using Tikle my android tool, then you can read this ? http://xdaforums.com/showthread.php?p=53839770

    Sir, what is this issue? I just did following this guide, i didnt do following your first guide.