display cpu temperature in twrp
use TW_NO_CPU_TEMP := true to disable display
use TW_CPU_CUSTOM_PATH := path to set custom path

Change-Id: Id260ecbb4ec36a78442387329944f67003d0f6a0
diff --git a/gui/devices/1024x600/res/ui.xml b/gui/devices/1024x600/res/ui.xml
index 4d6f317..7b7ad8c 100644
--- a/gui/devices/1024x600/res/ui.xml
+++ b/gui/devices/1024x600/res/ui.xml
@@ -231,13 +231,13 @@
 
 			<object type="text" color="%text_color%">
 				<font resource="font" />
-				<placement x="250" y="5" />
+				<placement x="200" y="5" />
 				<text>Team Win Recovery Project  v%tw_version%</text>
 			</object>
 
 			<object type="text" color="%text_color%">
 				<font resource="font" />
-				<placement x="250" y="30" />
+				<placement x="200" y="30" />
 				<conditions>
 					<condition var1="tw_no_battery_percent" var2="0" />
 					<condition var1="tw_battery" op=">" var2="0" />
@@ -248,14 +248,23 @@
 
 			<object type="text" color="%text_color%">
 				<font resource="font" />
-				<placement x="450" y="30" />
+				<placement x="400" y="30" />
 				<text>%tw_time%</text>
 			</object>
 
 			<object type="text" color="%text_color%">
+				<font resource="font" />
+				<placement x="700" y="30" />
+				<conditions>
+					<condition var1="tw_no_cpu_temp" var2="0" />
+				</conditions>
+				<text>CPU: %tw_cpu_temp% C</text>
+			</object>
+
+			<object type="text" color="%text_color%">
 				<condition var1="tw_simulate_actions" var2="1" />
 				<font resource="font" />
-				<placement x="550" y="30" />
+				<placement x="475" y="30" />
 				<text>SIMULATING ACTIONS</text>
 			</object>
 
diff --git a/gui/devices/1024x768/res/ui.xml b/gui/devices/1024x768/res/ui.xml
index 29f1690..b5ce1b4 100644
--- a/gui/devices/1024x768/res/ui.xml
+++ b/gui/devices/1024x768/res/ui.xml
@@ -231,13 +231,13 @@
 
 			<object type="text" color="%text_color%">
 				<font resource="font" />
-				<placement x="250" y="5" />
+				<placement x="200" y="5" />
 				<text>Team Win Recovery Project  v%tw_version%</text>
 			</object>
 
 			<object type="text" color="%text_color%">
 				<font resource="font" />
-				<placement x="250" y="30" />
+				<placement x="200" y="30" />
 				<conditions>
 					<condition var1="tw_no_battery_percent" var2="0" />
 					<condition var1="tw_battery" op=">" var2="0" />
@@ -248,14 +248,23 @@
 
 			<object type="text" color="%text_color%">
 				<font resource="font" />
-				<placement x="450" y="30" />
+				<placement x="400" y="30" />
 				<text>%tw_time%</text>
 			</object>
 
 			<object type="text" color="%text_color%">
+				<font resource="font" />
+				<placement x="700" y="30" />
+				<conditions>
+					<condition var1="tw_no_cpu_temp" var2="0" />
+				</conditions>
+				<text>CPU: %tw_cpu_temp% C</text>
+			</object>
+
+			<object type="text" color="%text_color%">
 				<condition var1="tw_simulate_actions" var2="1" />
 				<font resource="font" />
-				<placement x="550" y="30" />
+				<placement x="475" y="30" />
 				<text>SIMULATING ACTIONS</text>
 			</object>
 
diff --git a/gui/devices/1080x1920/res/ui.xml b/gui/devices/1080x1920/res/ui.xml
index 95c48a5..1367015 100644
--- a/gui/devices/1080x1920/res/ui.xml
+++ b/gui/devices/1080x1920/res/ui.xml
@@ -246,6 +246,15 @@
 				<text>Battery: %tw_battery%</text>
 			</object>
 
+			<object type="text" color="%text_color%">
+				<font resource="font" />
+				<placement x="760" y="114" />
+				<conditions>
+					<condition var1="tw_no_cpu_temp" var2="0" />
+				</conditions>
+				<text>CPU: %tw_cpu_temp% C</text>
+			</object>
+
 			<object type="button">
 				<highlight color="%highlight_color%" />
 				<placement x="%home_button_x%" y="%home_button_y%" />
diff --git a/gui/devices/1200x1920/res/ui.xml b/gui/devices/1200x1920/res/ui.xml
index 428880d..77af05b 100644
--- a/gui/devices/1200x1920/res/ui.xml
+++ b/gui/devices/1200x1920/res/ui.xml
@@ -249,6 +249,15 @@
 				<text>Battery: %tw_battery%</text>
 			</object>
 
+			<object type="text" color="%text_color%">
+				<font resource="font" />
+				<placement x="730" y="114" />
+				<conditions>
+					<condition var1="tw_no_cpu_temp" var2="0" />
+				</conditions>
+				<text>CPU: %tw_cpu_temp% C</text>
+			</object>
+
 			<object type="button">
 				<highlight color="%highlight_color%" />
 				<placement x="%home_button_x%" y="%home_button_y%" />
diff --git a/gui/devices/1280x800/res/ui.xml b/gui/devices/1280x800/res/ui.xml
index 6f6c2bd..716dadc 100644
--- a/gui/devices/1280x800/res/ui.xml
+++ b/gui/devices/1280x800/res/ui.xml
@@ -253,6 +253,15 @@
 			</object>
 
 			<object type="text" color="%text_color%">
+				<font resource="font" />
+				<placement x="850" y="30" />
+				<conditions>
+					<condition var1="tw_no_cpu_temp" var2="0" />
+				</conditions>
+				<text>CPU: %tw_cpu_temp% C</text>
+			</object>
+
+			<object type="text" color="%text_color%">
 				<condition var1="tw_simulate_actions" var2="1" />
 				<font resource="font" />
 				<placement x="550" y="30" />
diff --git a/gui/devices/1440x2560/res/ui.xml b/gui/devices/1440x2560/res/ui.xml
index fe55dfd..79f12cf 100644
--- a/gui/devices/1440x2560/res/ui.xml
+++ b/gui/devices/1440x2560/res/ui.xml
@@ -9,9 +9,9 @@
 		<preview>preview.jpg</preview>
 	</details>
 
-    <include>
-        <xmlfile name="portrait.xml" />
-    </include>
+	<include>
+		<xmlfile name="portrait.xml" />
+	</include>
 
 	<resources>
 		<resource name="font" type="font" filename="RobotoCondensed-Regular.ttf" size="50" fallback="Roboto-Condensed-50" />
@@ -246,6 +246,15 @@
 				<text>Battery: %tw_battery%</text>
 			</object>
 
+			<object type="text" color="%text_color%">
+				<font resource="font" />
+				<placement x="839" y="132" />
+				<conditions>
+					<condition var1="tw_no_cpu_temp" var2="0" />
+				</conditions>
+				<text>CPU: %tw_cpu_temp% C</text>
+			</object>
+
 			<object type="button">
 				<highlight color="%highlight_color%" />
 				<placement x="%home_button_x%" y="%home_button_y%" />
diff --git a/gui/devices/1600x2560/res/ui.xml b/gui/devices/1600x2560/res/ui.xml
index 8561b2d..09c7408 100644
--- a/gui/devices/1600x2560/res/ui.xml
+++ b/gui/devices/1600x2560/res/ui.xml
@@ -249,6 +249,15 @@
 				<text>Battery: %tw_battery%</text>
 			</object>
 
+			<object type="text" color="%text_color%">
+				<font resource="font" />
+				<placement x="739" y="132" />
+				<conditions>
+					<condition var1="tw_no_cpu_temp" var2="0" />
+				</conditions>
+				<text>CPU: %tw_cpu_temp% C</text>
+			</object>
+
 			<object type="button">
 				<highlight color="%highlight_color%" />
 				<placement x="%home_button_x%" y="%home_button_y%" />
diff --git a/gui/devices/1920x1200/res/ui.xml b/gui/devices/1920x1200/res/ui.xml
index 3e8c9f1..e36d0ae 100644
--- a/gui/devices/1920x1200/res/ui.xml
+++ b/gui/devices/1920x1200/res/ui.xml
@@ -253,9 +253,18 @@
 			</object>
 
 			<object type="text" color="%text_color%">
+				<font resource="font" />
+				<placement x="1150" y="40" />
+				<conditions>
+					<condition var1="tw_no_cpu_temp" var2="0" />
+				</conditions>
+				<text>CPU: %tw_cpu_temp% C</text>
+			</object>
+
+			<object type="text" color="%text_color%">
 				<condition var1="tw_simulate_actions" var2="1" />
 				<font resource="font" />
-				<placement x="850" y="40" />
+				<placement x="750" y="40" />
 				<text>SIMULATING ACTIONS</text>
 			</object>
 
diff --git a/gui/devices/240x240/res/ui.xml b/gui/devices/240x240/res/ui.xml
index 294e595..d157f85 100644
--- a/gui/devices/240x240/res/ui.xml
+++ b/gui/devices/240x240/res/ui.xml
@@ -211,7 +211,7 @@
 
 			<object type="text" color="%text_color%">
 				<font resource="font" />
-				<placement x="3" y="3" />
+				<placement x="1" y="3" />
 				<text>TWRP v%tw_version%</text>
 			</object>
 
@@ -224,7 +224,7 @@
 
 			<object type="text" color="%text_color%">
 				<font resource="font" />
-				<placement x="100" y="3" />
+				<placement x="89" y="3" />
 				<text>%tw_time%</text>
 			</object>
 
@@ -238,6 +238,15 @@
 				</conditions>
 				<text>%tw_battery%</text>
 			</object>
+
+			<object type="text" color="%text_color%">
+				<font resource="font" />
+				<placement x="145" y="3" />
+				<conditions>
+					<condition var1="tw_no_cpu_temp" var2="0" />
+				</conditions>
+				<text>%tw_cpu_temp% C</text>
+			</object>
 		</template>
 
 		<template name="header">
diff --git a/gui/devices/2560x1600/res/ui.xml b/gui/devices/2560x1600/res/ui.xml
index cb0c12e..12a2d55 100644
--- a/gui/devices/2560x1600/res/ui.xml
+++ b/gui/devices/2560x1600/res/ui.xml
@@ -253,6 +253,15 @@
 			</object>
 
 			<object type="text" color="%text_color%">
+				<font resource="font" />
+				<placement x="1650" y="55" />
+				<conditions>
+					<condition var1="tw_no_cpu_temp" var2="0" />
+				</conditions>
+				<text>CPU: %tw_cpu_temp% C</text>
+			</object>
+
+			<object type="text" color="%text_color%">
 				<condition var1="tw_simulate_actions" var2="1" />
 				<font resource="font" />
 				<placement x="1100" y="55" />
diff --git a/gui/devices/280x280/res/ui.xml b/gui/devices/280x280/res/ui.xml
index 99532ed..971e637 100644
--- a/gui/devices/280x280/res/ui.xml
+++ b/gui/devices/280x280/res/ui.xml
@@ -224,7 +224,7 @@
 
 			<object type="text" color="%text_color%">
 				<font resource="font" />
-				<placement x="165" y="3" />
+				<placement x="95" y="3" />
 				<text>%tw_time%</text>
 			</object>
 
@@ -238,6 +238,15 @@
 				</conditions>
 				<text>%tw_battery%</text>
 			</object>
+
+			<object type="text" color="%text_color%">
+				<font resource="font" />
+				<placement x="160" y="3" />
+				<conditions>
+					<condition var1="tw_no_cpu_temp" var2="0" />
+				</conditions>
+				<text>CPU: %tw_cpu_temp% C</text>
+			</object>
 		</template>
 
 		<template name="header">
diff --git a/gui/devices/320x320/res/ui.xml b/gui/devices/320x320/res/ui.xml
index f668529..4678e85 100644
--- a/gui/devices/320x320/res/ui.xml
+++ b/gui/devices/320x320/res/ui.xml
@@ -224,7 +224,7 @@
 
 			<object type="text" color="%text_color%">
 				<font resource="font" />
-				<placement x="200" y="3" />
+				<placement x="110" y="3" />
 				<text>%tw_time%</text>
 			</object>
 
@@ -238,6 +238,15 @@
 				</conditions>
 				<text>%tw_battery%</text>
 			</object>
+
+			<object type="text" color="%text_color%">
+				<font resource="font" />
+				<placement x="190" y="3" />
+				<conditions>
+					<condition var1="tw_no_cpu_temp" var2="0" />
+				</conditions>
+				<text>CPU: %tw_cpu_temp% C</text>
+			</object>
 		</template>
 
 		<template name="header">
diff --git a/gui/devices/320x480/res/ui.xml b/gui/devices/320x480/res/ui.xml
index cccd5b3..dd4cdbc 100644
--- a/gui/devices/320x480/res/ui.xml
+++ b/gui/devices/320x480/res/ui.xml
@@ -232,7 +232,7 @@
 
 			<object type="text" color="%text_color%">
 				<font resource="font" />
-				<placement x="165" y="39" />
+				<placement x="135" y="39" />
 				<conditions>
 					<condition var1="tw_no_battery_percent" var2="0" />
 					<condition var1="tw_battery" op=">" var2="0" />
@@ -241,6 +241,15 @@
 				<text>Battery: %tw_battery%</text>
 			</object>
 
+			<object type="text" color="%text_color%">
+				<font resource="font" />
+				<placement x="265" y="39" />
+				<conditions>
+					<condition var1="tw_no_cpu_temp" var2="0" />
+				</conditions>
+				<text>%tw_cpu_temp% C</text>
+			</object>
+
 			<object type="button">
 				<placement x="%home_button_x%" y="%home_button_y%" />
 				<font resource="font" color="%button_text_color%" />
diff --git a/gui/devices/480x800/res/ui.xml b/gui/devices/480x800/res/ui.xml
index 940ad43..0e0f65d 100644
--- a/gui/devices/480x800/res/ui.xml
+++ b/gui/devices/480x800/res/ui.xml
@@ -232,7 +232,7 @@
 
 			<object type="text" color="%text_color%">
 				<font resource="font" />
-				<placement x="250" y="70" />
+				<placement x="190" y="70" />
 				<conditions>
 					<condition var1="tw_no_battery_percent" var2="0" />
 					<condition var1="tw_battery" op=">" var2="0" />
@@ -241,6 +241,15 @@
 				<text>Battery: %tw_battery%</text>
 			</object>
 
+			<object type="text" color="%text_color%">
+				<font resource="font" />
+				<placement x="350" y="70" />
+				<conditions>
+					<condition var1="tw_no_cpu_temp" var2="0" />
+				</conditions>
+				<text>CPU: %tw_cpu_temp% C</text>
+			</object>
+
 			<object type="button">
 				<placement x="%home_button_x%" y="%home_button_y%" />
 				<font resource="font" color="%button_text_color%" />
diff --git a/gui/devices/480x854/res/ui.xml b/gui/devices/480x854/res/ui.xml
index dce1d88..26d8b28 100644
--- a/gui/devices/480x854/res/ui.xml
+++ b/gui/devices/480x854/res/ui.xml
@@ -231,7 +231,7 @@
 
 			<object type="text" color="%text_color%">
 				<font resource="font" />
-				<placement x="250" y="70" />
+				<placement x="190" y="70" />
 				<conditions>
 					<condition var1="tw_no_battery_percent" var2="0" />
 					<condition var1="tw_battery" op=">" var2="0" />
@@ -240,6 +240,15 @@
 				<text>Battery: %tw_battery%</text>
 			</object>
 
+			<object type="text" color="%text_color%">
+				<font resource="font" />
+				<placement x="350" y="70" />
+				<conditions>
+					<condition var1="tw_no_cpu_temp" var2="0" />
+				</conditions>
+				<text>CPU: %tw_cpu_temp% C</text>
+			</object>
+
 			<object type="button">
 				<placement x="%home_button_x%" y="%home_button_y%" />
 				<font resource="font" color="%button_text_color%" />
diff --git a/gui/devices/540x960/res/ui.xml b/gui/devices/540x960/res/ui.xml
index 37c3e26..dc647ce 100644
--- a/gui/devices/540x960/res/ui.xml
+++ b/gui/devices/540x960/res/ui.xml
@@ -232,7 +232,7 @@
 
 			<object type="text" color="%text_color%">
 				<font resource="font" />
-				<placement x="250" y="70" />
+				<placement x="200" y="70" />
 				<conditions>
 					<condition var1="tw_no_battery_percent" var2="0" />
 					<condition var1="tw_battery" op=">" var2="0" />
@@ -241,6 +241,15 @@
 				<text>Battery: %tw_battery%</text>
 			</object>
 
+			<object type="text" color="%text_color%">
+				<font resource="font" />
+				<placement x="400" y="70" />
+				<conditions>
+					<condition var1="tw_no_cpu_temp" var2="0" />
+				</conditions>
+				<text>CPU: %tw_cpu_temp% C</text>
+			</object>
+
 			<object type="button">
 				<placement x="%home_button_x%" y="%home_button_y%" />
 				<font resource="font" color="%button_text_color%" />
diff --git a/gui/devices/720x1280/res/ui.xml b/gui/devices/720x1280/res/ui.xml
index a7ff192..2f1fbc7 100644
--- a/gui/devices/720x1280/res/ui.xml
+++ b/gui/devices/720x1280/res/ui.xml
@@ -246,6 +246,15 @@
 				<text>Battery: %tw_battery%</text>
 			</object>
 
+			<object type="text" color="%text_color%">
+				<font resource="font" />
+				<placement x="500" y="76" />
+				<conditions>
+					<condition var1="tw_no_cpu_temp" var2="0" />
+				</conditions>
+				<text>CPU: %tw_cpu_temp% C</text>
+			</object>
+
 			<object type="button">
 				<highlight color="%highlight_color%" />
 				<placement x="%home_button_x%" y="%home_button_y%" />
diff --git a/gui/devices/800x1280/res/ui.xml b/gui/devices/800x1280/res/ui.xml
index e0036bf..03b6144 100644
--- a/gui/devices/800x1280/res/ui.xml
+++ b/gui/devices/800x1280/res/ui.xml
@@ -243,6 +243,15 @@
 				<text>Battery: %tw_battery%</text>
 			</object>
 
+			<object type="text" color="%text_color%">
+				<font resource="font" />
+				<placement x="420" y="76" />
+				<conditions>
+					<condition var1="tw_no_cpu_temp" var2="0" />
+				</conditions>
+				<text>CPU: %tw_cpu_temp% C</text>
+			</object>
+
 			<object type="button">
 				<placement x="%home_button_x%" y="%home_button_y%" />
 				<font resource="font" color="%button_text_color%" />
diff --git a/gui/devices/800x480/res/ui.xml b/gui/devices/800x480/res/ui.xml
index 9acb7a1..ed1c842 100644
--- a/gui/devices/800x480/res/ui.xml
+++ b/gui/devices/800x480/res/ui.xml
@@ -248,11 +248,20 @@
 
 			<object type="text" color="%text_color%">
 				<font resource="font" />
-				<placement x="450" y="37" />
+				<placement x="425" y="37" />
 				<text>%tw_time%</text>
 			</object>
 
 			<object type="text" color="%text_color%">
+				<font resource="font" />
+				<placement x="500" y="37" />
+				<conditions>
+					<condition var1="tw_no_cpu_temp" var2="0" />
+				</conditions>
+				<text>CPU: %tw_cpu_temp% C</text>
+			</object>
+
+			<object type="text" color="%text_color%">
 				<condition var1="tw_simulate_actions" var2="1" />
 				<font resource="font" />
 				<placement x="250" y="20" />