[Galaxy S6 General] asc1977:
Need urgent help !!!

with this guide the switch works only on left side. if i remove in signal_cluster_view_new2 the entry android:id="@id/signal_cluster" it works on right side but never on left. so i think problem is that i used android:id="@id/signal_cluster"two times and one of them has priority. i find no solution. any great dev here have a idea? Pleeeaaassseeeee !!!!!!!

[MENTION=1042140]tdunham[/MENTION] [MENTION=3002844]filchi756[/MENTION] [MENTION=2744265]sac23[/MENTION] [MENTION=5405448]thereassaad[/MENTION] [MENTION=4714483]daxgirl[/MENTION] [MENTION=5493353]Wuby986[/MENTION] [MENTION=3065070]Goldie[/MENTION] [MENTION=5198767]ikrom[/MENTION] [MENTION=4507636]edzamber[/MENTION] [MENTION=1007992]everyone[/MENTION]_her_on_XDA

How to make a switch to change Wifi/Data from right to left and back

decompile Systemui.apk

open res/values/ids.xml

add two new ids

<item type="id" name="signal_cluster_view_new">false</item>
<item type="id" name="signal_cluster_view_new2">false</item>

go to res/layout and add the two xml from attached zip or make two new ones with this content

signal_cluster_view_new

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout android:gravity="center_vertical" android:id="@id/signal_cluster_view_new" android:layout_width="wrap_content" android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android">
<com.android.keyguard.AlphaOptimizedLinearLayout android:gravity="center" android:orientation="horizontal" android:id="@id/notification_icon_area" android:layout_width="wrap_content" android:layout_height="fill_parent" android:paddingStart="0.0dip" android:layout_marginEnd="0.0dip">
<include android:id="@id/signal_cluster" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_marginLeft="-2.5dip" android:layout_marginBottom="-2.5dip" layout="@layout/signal_cluster_view" />
</com.android.keyguard.AlphaOptimizedLinearLayout>
</LinearLayout>

and signal_cluster_view_new2

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout android:gravity="center_vertical" android:id="@id/signal_cluster_view_new2" android:layout_width="wrap_content" android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android">
<com.android.keyguard.AlphaOptimizedLinearLayout android:gravity="center" android:orientation="horizontal" android:id="@id/notification_icon_area" android:layout_width="wrap_content" android:layout_height="fill_parent" android:paddingStart="0.0dip" android:layout_marginEnd="0.0dip">
<include android:id="@id/signal_cluster" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_marginLeft="-2.5dip" android:layout_marginBottom="-2.5dip" layout="@layout/signal_cluster_view" />
</com.android.keyguard.AlphaOptimizedLinearLayout>
</LinearLayout>

recompile and decompile systemui.apk

open res/layout/status_bar.xml

delete entry with android:id="@id/signal_cluster" if is there

replace it with or add followed at right position part in blue

<com.android.systemui.statusbar.AlphaOptimizedFrameLayout android:orientation="horizontal" android:id="@id/notification_icon_area" android:layout_width="0.0dip" android:layout_height="fill_parent" android:layout_weight="1.0">
<com.android.keyguard.AlphaOptimizedLinearLayout android:id="@id/notification_icon_area_inner" android:layout_width="fill_parent" android:layout_height="fill_parent">
<com.potato.systemui.clocks.ClockLeft android:textAppearance="@android:style/TextAppearance.StatusBar.Icon" android:textStyle="normal" android:gravity="center" android:paddingLeft="1.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" />
[COLOR="blue"]<include layout="@layout/signal_cluster_view_new" />[/COLOR]
<com.android.systemui.statusbar.ttraffic.Traffic android:textSize="8.0dip" android:textStyle="normal" android:textColor="#ffffffff" android:gravity="left" android:layout_gravity="center_horizontal" android:paddingTop="3.0dip" android:layout_width="40.0dip" android:layout_height="fill_parent" android:singleLine="true" android:fontFamily="sans-serif" android:paddingStart="0.0dip" android:layout_alignParentStart="true" />
<com.android.systemui.statusbar.traffic.Traffic android:textSize="8.0dip" android:textStyle="normal" android:textColor="#ffffffff" android:gravity="left" android:layout_gravity="center_vertical" android:layout_width="40.0dip" android:layout_height="fill_parent" android:layout_marginLeft="-44.0dip" android:layout_marginTop="7.0dip" android:singleLine="true" android:fontFamily="sans-serif" android:paddingStart="4.0dip" android:layout_alignParentStart="true" />
<com.android.systemui.statusbar.StatusBarIconView android:id="@id/moreIcon" android:visibility="gone" android:layout_width="@dimen/status_bar_icon_size" android:layout_height="fill_parent" android:src="@drawable/stat_notify_more" />
<com.android.systemui.statusbar.phone.IconMerger android:gravity="center_vertical" android:orientation="horizontal" android:id="@id/notificationIcons" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_alignParentStart="true" />
</com.android.keyguard.AlphaOptimizedLinearLayout>
</com.android.systemui.statusbar.AlphaOptimizedFrameLayout>

open res/layout/system_icons.xml

add blue and change red that it match text here

<LinearLayout android:gravity="center" android:orientation="horizontal" android:id="@id/signal_battery_cluster" android:layout_width="wrap_content" android:layout_height="fill_parent" android:paddingStart="@dimen/signal_cluster_gap">
[COLOR="blue"]<include layout="@layout/signal_cluster_view_new2" />[/COLOR]
[COLOR="Red"] <include android:id="@id/signal_cluster" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginStart="2.5dip" layout="@layout/signal_cluster_view" />[/COLOR]
<TextView android:textSize="@dimen/battery_text_size" android:textColor="@color/batterymeter_text_color" android:layout_gravity="center" android:id="@id/battery_text" android:layout_width="wrap_content" android:layout_height="wrap_content" android:importantForAccessibility="no" android:fontFamily="sec-roboto-light" android:layout_marginEnd="@dimen/battery_text_margin_end" />
<com.android.systemui.BatteryMeterView android:id="@id/battery" android:layout_width="@dimen/status_bar_battery_width" android:layout_height="@dimen/status_bar_battery_height" android:layout_marginBottom="@dimen/battery_margin_bottom" />
<com.android.systemui.statusbar.policy.MinitBattery android:id="@id/battery_minit" android:layout_width="wrap_content" android:layout_height="wrap_content" />
</LinearLayout>

open smali/com/android/systemui/statusbar/phone/PhoneStatusBar.smali

goto

move-object/from16 v0, p0

iget-object v4, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mBatteryTextObserver:Lcom/android/systemui/statusbar/phone/PhoneStatusBar$BatteryTextObserver;

const/4 v5, 0x0

invoke-virtual {v4, v5}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$BatteryTextObserver;->onChange(Z)V

add followed

move-object/from16 v0, p0

invoke-virtual {v0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->HideSignalLeft()V

invoke-virtual {v0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->HideSignalRight()V

add end of smali add two methods

.method HideSignalRight()V
.locals 7

iget-object v1, p0, Lcom/android/systemui/SystemUI;->mContext:Landroid/content/Context;

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

move-result-object v1

const-string v2, "signal_right"

const/4 v3, 0x0

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

move-result v1

if-nez v1, :cond_0

const v3, 0x8

iget-object v5, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarWindow:Lcom/android/systemui/statusbar/phone/StatusBarWindowView;

const v6, 0x7f0e036b [COLOR="Blue"]#ID of signal_cluster_view_new2[/COLOR]

invoke-virtual {v5, v6}, Lcom/android/systemui/statusbar/phone/StatusBarWindowView;->findViewById(I)Landroid/view/View;

move-result-object v4

invoke-virtual {v4, v3}, Landroid/widget/LinearLayout;->setVisibility(I)V

goto/16 :goto_0

:cond_0
const v3, 0x3

iget-object v5, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarWindow:Lcom/android/systemui/statusbar/phone/StatusBarWindowView;

const v6, 0x7f0e036b [COLOR="Blue"]#ID of signal_cluster_view_new2[/COLOR]

invoke-virtual {v5, v6}, Lcom/android/systemui/statusbar/phone/StatusBarWindowView;->findViewById(I)Landroid/view/View;

move-result-object v4

invoke-virtual {v4, v3}, Landroid/widget/LinearLayout;->setVisibility(I)V

:goto_0
return-void
.end method

.method HideSignalLeft()V
.locals 7

iget-object v1, p0, Lcom/android/systemui/SystemUI;->mContext:Landroid/content/Context;

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

move-result-object v1

const-string v2, "signal_left"

const/4 v3, 0x0

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

move-result v1

if-nez v1, :cond_0

const v3, 0x8

iget-object v5, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarWindow:Lcom/android/systemui/statusbar/phone/StatusBarWindowView;

const v6, 0x7f0e036a [COLOR="Blue"]#ID of signal_cluster_view_new[/COLOR]

invoke-virtual {v5, v6}, Lcom/android/systemui/statusbar/phone/StatusBarWindowView;->findViewById(I)Landroid/view/View;

move-result-object v4

invoke-virtual {v4, v3}, Landroid/widget/LinearLayout;->setVisibility(I)V

goto/16 :goto_0

:cond_0
const v3, 0x3

iget-object v5, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarWindow:Lcom/android/systemui/statusbar/phone/StatusBarWindowView;

const v6, 0x7f0e036a [COLOR="Blue"]#ID of signal_cluster_view_new[/COLOR]

invoke-virtual {v5, v6}, Lcom/android/systemui/statusbar/phone/StatusBarWindowView;->findViewById(I)Landroid/view/View;

move-result-object v4

invoke-virtual {v4, v3}, Landroid/widget/LinearLayout;->setVisibility(I)V

:goto_0
return-void
.end method

RomControl xml entry

<SwitchPreference android:title="Signal left" android:key="signal_left" android:summaryOn="Show" android:summaryOff="Hide" />
<SwitchPreference android:title="Signal right" android:key="signal_right" android:summaryOn="Show" android:summaryOff="Hide" />