[Galaxy S6 General] asc1977:
How to change number of toggles in a row with RomControl (optional on the fly)

Thanks [MENTION=5262778]kin201303[/MENTION] for his help to reach the goal on his post here

decompile SystemUI.apk

goto smali/com/android/systemui/qs/QSPanel.smali

find

.line 223
.local v1, "conf":Landroid/content/res/Configuration;
const/4 v7, 0x1

invoke-virtual {v5, v11}, Landroid/content/res/Resources;->getInteger(I)I

move-result v8

invoke-static {v7, v8}, Ljava/lang/Math;->max(II)I

move-result v0

replace

.line 223
.local v1, "conf":Landroid/content/res/Configuration;
const/4 v7, 0x1

[COLOR="Blue"]invoke-virtual {p0}, Lcom/android/systemui/qs/QSPanel;->QSPanel_NumberCount()I[/COLOR]

move-result v8

invoke-static {v7, v8}, Ljava/lang/Math;->max(II)I

move-result v0

find

.line 241
invoke-virtual {p0}, Lcom/android/systemui/qs/QSPanel;->getResources()Landroid/content/res/Resources;

move-result-object v7

const v8, 0x7f0f0014

invoke-virtual {v7, v8}, Landroid/content/res/Resources;->getInteger(I)I

move-result v7

iput v7, p0, Lcom/android/systemui/qs/QSPanel;->mNumColumns:I

replace

.line 241
invoke-virtual {p0}, Lcom/android/systemui/qs/QSPanel;->getResources()Landroid/content/res/Resources;

move-result-object v7

const v8, 0x7f0f0014

[COLOR="blue"]invoke-virtual {p0}, Lcom/android/systemui/qs/QSPanel;->QSPanel_NumberCount()I[/COLOR]

move-result v7

iput v7, p0, Lcom/android/systemui/qs/QSPanel;->mNumColumns:I

find

.line 253
.end local v4 # "padding":I
:cond_6
invoke-virtual {p0}, Lcom/android/systemui/qs/QSPanel;->getResources()Landroid/content/res/Resources;

move-result-object v7

invoke-virtual {v7, v11}, Landroid/content/res/Resources;->getInteger(I)I

move-result v7

iput v7, p0, Lcom/android/systemui/qs/QSPanel;->mNumColumns:I

replace

.line 253
.end local v4 # "padding":I
:cond_6
invoke-virtual {p0}, Lcom/android/systemui/qs/QSPanel;->getResources()Landroid/content/res/Resources;

move-result-object v7

[COLOR="blue"]invoke-virtual {p0}, Lcom/android/systemui/qs/QSPanel;->QSPanel_NumberCount()I[/COLOR]

move-result v7

iput v7, p0, Lcom/android/systemui/qs/QSPanel;->mNumColumns:I

and at end of smali add method:

.method QSPanel_NumberCount()I
.locals 4

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

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

move-result-object v1

const-string v2, "QSPanel_NumberCount"

const/4 v3, 0x5

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

move-result v0

return v0
.end method

if you want on the fly and you have already a QSPanel SettingsObserver add at

.method private regObserver(Landroid/content/ContentResolver;)V

in QSPanel.smali

const-string v1, "QSPanel_NumberCount"

invoke-static {v1}, Landroid/provider/Settings$System;->getUriFor(Ljava/lang/String;)Landroid/net/Uri;

move-result-object v1

invoke-virtual {p1, v1, v2, v0}, Landroid/content/ContentResolver;->registerContentObserver(Landroid/net/Uri;ZLandroid/database/ContentObserver;)V

RomControl

add arrays

<string-array name="toggle_entries">
<item>3</item>
<item>4</item>
<item>5</item>
<item>6</item>
<item>7</item>
<item>8</item>
<item>9</item>
</string-array>
<string-array name="toggle_values">
<item>3</item>
<item>4</item>
<item>5</item>
<item>6</item>
<item>7</item>
<item>8</item>
<item>9</item>
</string-array>

add xml

<com.wubydax.romcontrol.prefs.MyListPreference android:entries="@array/toggle_entries" android:title="Visible Toggles Shown" android:key="QSPanel_NumberCount" android:summary="Number shown on screen" android:entryValues="@array/toggle_values" />