[Galaxy S III Android Development] RMarkwald:
Thanks wanam for the tutorial! I am late to the party, maybe these suggestions have been covered, but I thought I'd put this out there for those trying this who run into trouble. I just re-did this to my S3 (d2usc), as I see this method was slightly updated (mainly wanamlite to wanam, naming...and the LidroidSettings app change from QuickSettings).

I think that some people are copying the last line in Step 1:

<LinearLayout android:orientation="vertical" android:id="@id/brightness_controller" android:background="#ff000000" android:layout_width="fill_parent" android:layout_height="56.0dip" android:layout_marginTop="@dimen/notification_panel_quicksettingbtn_height">

It doesn't have any the end tag </LinearLayout>, so I think that where the "tag mismatch" error comes in when compiling, so watch for that peoples. I actually had this line posted further down in the xml file, so I just copied lines 7-11 (opened in Notepad++, that where the line numbers come from here) and pasted as shown. I also had an issue where adding only 2 or 3 toggles they weren't spreading out to file the space, so I had to change a layout_width from wrap_content to fill_parent. Not sure if it's just me or not, but I thought I'd throw that out there too.

Here's my tw_status_bar_expanded.xml:

<?xml version="1.0" encoding="utf-8"?>

<FrameLayout android:id="@id/notification_panel" android:background="#60000000" android:paddingTop="@dimen/notification_panel_padding_top" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_marginLeft="@dimen/notification_panel_margin_left"

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

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

<FrameLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_marginBottom="@dimen/close_handle_underlap">

<include android:layout_width="fill_parent" android:layout_height="@dimen/tw_notification_panel_header_height" layout="@layout/tw_status_bar_expanded_header" />

<TextView android:gravity="center" android:id="@id/emergency_calls_only" android:paddingBottom="4.0dip" android:visibility="gone" android:layout_width="fill_parent" android:layout_height="wrap_content" />

<HorizontalScrollView android:id="@id/quicksetting_scroller" android:visibility="gone" android:scrollbars="none" android:layout_width="wrap_content" android:layout_height="@dimen/quick_setting_button_height" android:layout_marginTop="@dimen/tw_notification_panel_header_height">

<com.android.systemui.statusbar.policy.quicksetting.QuickSettingPanel android:orientation="horizontal" android:id="@id/quicksetting_container" android:layout_width="wrap_content" android:layout_height="wrap_content" android:divider="@drawable/tw_black_bg" android:showDividers="middle" />

</HorizontalScrollView>

<com.wanam.systemui.quickpanel.PowerWidget android:id="@id/exp_power_stat" android:layout_width="fill_parent" android:layout_height="@dimen/quick_setting_button_height" android:layout_marginTop="@dimen/tw_notification_panel_header_height" />

<ScrollView android:id="@id/scroll" android:fadingEdge="none" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_marginTop="@dimen/notification_panel_quicksettingbtn_height" android:overScrollMode="ifContentScrolls">

<LinearLayout android:orientation="vertical" android:id="@id/scrollCart" android:layout_width="fill_parent" android:layout_height="wrap_content">

<LinearLayout android:orientation="vertical" android:id="@id/brightness_controller" android:background="#ff000000" android:layout_width="fill_parent" android:layout_height="56.0dip">

<LinearLayout android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="55.0dip">

<ImageView android:id="@id/brightness_icon" android:clickable="true" android:layout_width="25.0dip" android:layout_height="fill_parent" android:layout_marginLeft="13.0dip" android:src="@drawable/ic_sysbar_brightness" android:contentDescription="@string/accessibility_brightness_icon" />

<FrameLayout android:id="@id/brightness_group" android:layout_width="fill_parent" android:layout_height="fill_parent">

<com.android.systemui.statusbar.policy.ToggleSlider android:id="@id/brightness" android:layout_width="fill_parent" android:layout_height="fill_parent" systemui:text="@string/status_bar_settings_auto_brightness_label" />

<com.android.systemui.statusbar.policy.ToggleSlider android:id="@id/auto_brightness" android:layout_width="fill_parent" android:layout_height="fill_parent" systemui:text="@string/status_bar_settings_auto_brightness_label" />

</FrameLayout>

</LinearLayout>

<View android:background="#ff000000" android:layout_width="fill_parent" android:layout_height="1.0dip" />

</LinearLayout>

<LinearLayout android:orientation="vertical" android:id="@id/noNotificationsTitle" android:focusable="true" android:layout_width="fill_parent" android:layout_height="wrap_content">

<TextView android:textSize="@dimen/status_bar_expanded_notification_category_text_size" android:textStyle="bold" android:textColor="@color/notification_category_color" android:gravity="left|center" android:id="@id/noNotificationsText" android:paddingLeft="11.0dip" android:layout_width="fill_parent" android:layout_height="@dimen/status_bar_expanded_notification_category_height" android:text="@string/status_bar_no_notifications_title" />

</LinearLayout>

<LinearLayout android:orientation="vertical" android:id="@id/onGoingCart" android:background="#ff000000" android:focusable="true" android:visibility="gone" android:layout_width="fill_parent" android:layout_height="@dimen/status_bar_expanded_notification_category_height">

<TextView android:textSize="@dimen/status_bar_expanded_notification_category_text_size" android:textStyle="bold" android:textColor="@color/notification_category_color" android:gravity="left|center" android:id="@id/onGoingNotificationText" android:paddingLeft="11.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:text="@string/status_bar_ongoing_events_title" />

</LinearLayout>

<com.android.systemui.statusbar.policy.NotificationRowLayout android:id="@id/onGoingItems" android:layout_width="fill_parent" android:layout_height="wrap_content" systemui:rowHeight="@dimen/tw_notification_row_min_height" />

<LinearLayout android:orientation="vertical" android:id="@id/notificationCart" android:background="#ff000000" android:visibility="gone" android:layout_width="fill_parent" android:layout_height="@dimen/status_bar_expanded_notification_category_height">

<RelativeLayout android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content">

<TextView android:textSize="@dimen/status_bar_expanded_notification_category_text_size" android:textStyle="bold" android:textColor="@color/notification_category_color" android:gravity="left|center" android:id="@id/latestNotificationText" android:paddingLeft="11.0dip" android:layout_width="180.0dip" android:layout_height="fill_parent" android:text="@string/status_bar_latest_events_title" android:layout_alignParentLeft="true" />

</RelativeLayout>

</LinearLayout>

<com.android.systemui.statusbar.policy.NotificationRowLayout android:id="@id/notificationItems" android:layout_width="fill_parent" android:layout_height="wrap_content" systemui:rowHeight="@dimen/tw_notification_row_min_height" />

<com.android.systemui.statusbar.policy.NotificationRowLayout android:id="@id/latestItems" android:layout_width="fill_parent" android:layout_height="wrap_content" systemui:rowHeight="@dimen/tw_notification_row_min_height" />

</LinearLayout>

</ScrollView>

</FrameLayout>

<com.android.systemui.statusbar.phone.CloseDragHandle android:layout_gravity="bottom" android:orientation="vertical" android:id="@id/close" android:layout_width="fill_parent" android:layout_height="@dimen/tw_close_handle_height">

<RelativeLayout android:layout_width="fill_parent" android:layout_height="fill_parent">

<ImageView android:layout_gravity="bottom" android:layout_width="fill_parent" android:layout_height="@dimen/tw_close_handle_height" android:src="@drawable/tw_status_bar_close" android:scaleType="fitXY" />

<TextView android:textAppearance="@style/TextAppearance.StatusBar.Expanded.Network" android:gravity="center" android:layout_gravity="bottom" android:id="@id/carrier_label" android:layout_width="fill_parent" android:layout_height="@dimen/tw_close_handle_height" android:layout_marginBottom="10.0dip" />

</RelativeLayout>

</com.android.systemui.statusbar.phone.CloseDragHandle>

</FrameLayout>

If you copy that, there is some theming elements I've added that you may not like. If you have Notepad++ open, refer to lines 7-11 in the above code, as those are the lines you need. I've modded lidroid-res.apk too, so the background of the toggles is transparent, and adjusted the toggle colors too.

A note about finding the public ID for "exp_power_stat": Since you are adding it, it won't assign a public ID for that until you compile the apk. Once you do that, you can then decompile the newly compiled apk, open res/values/public.xml, search "exp_power_stat" and you'll have your number for the method "makeStatusBarView" in PhoneStatusBar.smali.

I also had to adjust variable numbers to make my PhoneStatusBar.smali, as the ones listed in the OP were different. It wasn't too hard to do, just have to observe the variable numbers above and see the pattern. Watch for that too.

If this stuff was already stated previously, I apologize for re-posting. I really like the new LidroidSettings app layout. Thanks again guys!