[Android General] AbrahamGC:
NETWORK TRAFFIC WITH DARK TINT

Hi guys, this guide is based on [MENTION=5493353]Wuby986[/MENTION] and [MENTION=4714483]daxgirl[/MENTION] network traffic mod, I just updated it a little for get dark tint on white apps, even with custom color. Tested on S8+ and Note 8, IMPORTANT; ONLY FOR OREO, because I used DarkIconDispatcher for it, and that interface isn't present on Nougat or previous versions.

Original source code is on wuby's Github HERE

Modded source code is on DeluxeTeam's Github HERE

Now let's see how we can implement it, it's simple:

1- Merge attached zip to SystemUI/smali/com/android/wubydax

2- Open SystemUI/res/layout/status_bar.xml and before <include layout="@layout/system_icons" /> add this:

<com.android.wubydax.NetworkTraffic android:layout_width="wrap_content" android:layout_height="fill_parent" />

That's all :good:

RomControl; Add this where you want :

<PreferenceScreen
android:title="Network traffic preferences">
<PreferenceCategory
android:title="Network data">
<com.wubydax.romcontrol.v2.prefs.MyListPreference
android:title="Displayed traffic info"
android:key="network_traffic_state"
android:defaultValue="0"
app:dependentValue="0"
android:entryValues="@array/traffic_state_values"
android:entries="@array/traffic_state_items"/>
<com.wubydax.romcontrol.v2.prefs.MySwitchPreference
android:title="Display data in Bytes"
android:summaryOff="Displayed in Bits (default)"
android:summaryOn="Displayed in Bytes"
android:defaultValue="false"
android:key="network_traffic_unit"
android:dependency="network_traffic_state"/>

</PreferenceCategory>
<PreferenceCategory
android:title="Arrows display preferences"
android:dependency="network_traffic_state">
<com.wubydax.romcontrol.v2.prefs.MySwitchPreference
android:title="Show traffic arrows"
android:key="network_traffic_show_arrows"
android:defaultValue="true"
android:summaryOff="Arrows hidden"
android:summaryOn="Arrows shown"
android:dependency="network_traffic_state"/>
<com.wubydax.romcontrol.v2.prefs.MyListPreference
android:title="Arrows position"
android:key="network_traffic_arrows_position"
android:dependency="network_traffic_show_arrows"
android:defaultValue="0"
android:entryValues="@array/arrow_position_values"
android:entries="@array/arrow_position_entries"/>
</PreferenceCategory>
<PreferenceCategory
android:title="Display options"
android:dependency="network_traffic_state">
<com.wubydax.romcontrol.v2.prefs.MySwitchPreference
android:title="Autohide on low traffic"
android:key="network_traffic_autohide"
android:defaultValue="false"
android:summaryOff="Displayed always"
android:summaryOn="Autohide enabled"/>
<com.wubydax.romcontrol.v2.prefs.MySeekBarPreference
android:title="Autohide threshold"
app:unitsValue="Kb"
app:maxValue="100"
android:key="network_traffic_threshold"
android:defaultValue="10"
android:dependency="network_traffic_autohide"/>
<com.wubydax.romcontrol.v2.prefs.MyListPreference
android:title="Font style"
android:key="network_traffic_text_style"
android:defaultValue="0"
android:entries="@array/traffic_style_entries"
android:entryValues="@array/traffic_style_entry_values"/>
<com.wubydax.romcontrol.v2.prefs.MySeekBarPreference
android:title="Text size scale factor"
android:key="network_traffic_scale"
app:maxValue="10"
android:defaultValue="10"/>

</PreferenceCategory>
<PreferenceCategory
android:title="Network traffic colors"
android:dependency="network_traffic_state">
<com.wubydax.romcontrol.v2.prefs.MySwitchPreference
android:title="Separate colors for text and arrows"
android:key="network_traffic_global_color"
android:defaultValue="true"
android:summaryOn="Text and arrows can be colored separately"
android:summaryOff="Text color will apply to arrows as well"/>
<com.wubydax.romcontrol.v2.prefs.ColorPickerPreference
android:title="Traffic text color"
android:key="network_traffic_color"
android:defaultValue="#ffffff"/>
<com.wubydax.romcontrol.v2.prefs.ColorPickerPreference
android:title="Traffic arrows color"
android:key="network_traffic_arrow_color"
android:defaultValue="#ffffff"
android:dependency="network_traffic_global_color"/>
</PreferenceCategory>
</PreferenceScreen>

And this on arrays.xml :

<string-array name="traffic_state_values">
<item>0</item>
<item>1</item>
<item>2</item>
<item>3</item>
</string-array>
<string-array name="traffic_state_items">
<item>Disable view</item>
<item>Upload only</item>
<item>Download only</item>
<item>Upload and Download</item>
</string-array>
<string-array name="arrow_position_values">
<item>0</item>
<item>1</item>
</string-array>
<string-array name="arrow_position_entries">
<item>To end of view</item>
<item>To start of view</item>
</string-array>
<string-array name="traffic_style_entries">
<item>Normal</item>
<item>Bold</item>
<item>Italic</item>
<item>Bold italic</item>
</string-array>
<string-array name="traffic_style_entry_values">
<item>0</item>
<item>1</item>
<item>2</item>
<item>3</item>
</string-array>

​