Skip to content

Instantly share code, notes, and snippets.

@vortitu
Created October 26, 2020 16:09
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vortitu/4331e93c383645abf211617c1e624e03 to your computer and use it in GitHub Desktop.
Save vortitu/4331e93c383645abf211617c1e624e03 to your computer and use it in GitHub Desktop.
COVID-19 Inzidenz-Widget für Android innerhalb Deutschlands
<?xml version='1.0' encoding='UTF-8' standalone='yes' ?>
<data version="1.38.0">
<trigger type="periodic_location_update">
<useDefaultName>true</useDefaultName>
<name>Periodic Location Update: every 10m (Network)</name>
<enabled>true</enabled>
<provider>network</provider>
<frequency>600000</frequency>
<enforceFrequency>true</enforceFrequency>
<minimumAccuracyEnabled>false</minimumAccuracyEnabled>
<minimumAccuracy>500</minimumAccuracy>
<limitTimeRange>false</limitTimeRange>
<weekday>Mon</weekday>
<weekday>Tue</weekday>
<weekday>Wed</weekday>
<weekday>Thu</weekday>
<weekday>Fri</weekday>
<weekday>Sat</weekday>
<weekday>Sun</weekday>
<hourFrom>8</hourFrom>
<minuteFrom>0</minuteFrom>
<hourTo>17</hourTo>
<minuteTo>0</minuteTo>
<allowInDeviceIdle>false</allowInDeviceIdle>
<likeAlarmClock>false</likeAlarmClock>
</trigger>
<action type="script">
<useDefaultName>false</useDefaultName>
<name>covid-19-inzidenz widget day</name>
<script>//setWidgetElementProperty("covid-19-inzidenz", "Text_city", "fillcolor", "#d17f7f7f" );
setWidgetElementProperty("covid-19-inzidenz", "Background", "fillcolor", "#d17f7f7f" );
</script>
</action>
<action type="script">
<useDefaultName>false</useDefaultName>
<name>covid-19-inzidenz widget night</name>
<script>//setWidgetElementProperty("covid-19-inzidenz", "Text_city", "fillcolor", "#d17f7f7f" );
setWidgetElementProperty("covid-19-inzidenz", "Background", "fillcolor", "#d1111111" );
</script>
</action>
<action type="execute_flows">
<useDefaultName>true</useDefaultName>
<name>Execute Flows: Covid19Inzidenz</name>
<includeFlowNamePatternList>Covid19Inzidenz</includeFlowNamePatternList>
<excludeFlowNamePatternList></excludeFlowNamePatternList>
<skipDisabledFlowsWithoutError>false</skipDisabledFlowsWithoutError>
<waitForFlowsToFinish>false</waitForFlowsToFinish>
<returnLocalVariablesToCallingFlow>false</returnLocalVariablesToCallingFlow>
</action>
<action type="http_request">
<useDefaultName>true</useDefaultName>
<name>HTTP Request: PUT {url} application/x-www-form-urlencoded Lastname=XYZ,Firstname=ABC store in response</name>
<url>{url}</url>
<verifyCertificates>true</verifyCertificates>
<basicAuthentication>false</basicAuthentication>
<username></username>
<clientCert>false</clientCert>
<clientCertPath></clientCertPath>
<httpMethod>PUT</httpMethod>
<networkType>DEFAULT</networkType>
<httpContentType>X_WWW_FORM_URLENCODED</httpContentType>
<contentType>text/plain</contentType>
<generalTextData></generalTextData>
<formFieldList>Lastname=XYZ,Firstname=ABC</formFieldList>
<uploadFieldName>upload_field</uploadFieldName>
<uploadFilePath></uploadFilePath>
<binaryContentType>application/octet-stream</binaryContentType>
<binaryFilePath></binaryFilePath>
<timeout>60000</timeout>
<setCustomHTTPHeaders>false</setCustomHTTPHeaders>
<customHTTPHeaders></customHTTPHeaders>
<storeInVariable>true</storeInVariable>
<variable>response</variable>
<encoding></encoding>
<path>/storage/emulated/0/Download/file.bin</path>
<followRedirects>true</followRedirects>
<skipConnectivityCheck>false</skipConnectivityCheck>
</action>
<action type="init_variable_location">
<useDefaultName>true</useDefaultName>
<name>Init Variable Location: new location into location using Network, Timeout 1m</name>
<variable>location</variable>
<newLocation>true</newLocation>
<provider>network</provider>
<minimumAccuracyEnabled>false</minimumAccuracyEnabled>
<minimumAccuracy>500</minimumAccuracy>
<timeoutEnabled>true</timeoutEnabled>
<timeoutMillis>60000</timeoutMillis>
</action>
<action type="script">
<useDefaultName>true</useDefaultName>
<name>Script: js = fromJSON(response); city = js["features"][0]["attributes"]["GEN"]; inzidenz = js["features"][0]["attributes"]["cases7_per_100k"]; setWidgetElementProperty("covid-19-inzidenz", "Text_city", "text", city); setWidgetElementProperty("covid-19-inzidenz", "Text_inzidenz", "text", "{inzidenz,numberformat,0.0}"); inznumber = toNumber(inzidenz); inzcolor = "#FF00F70F"; if (inznumber &gt; 35) { inzcolor = "#FFFCAD00"; } if (inznumber &gt; 50) { inzcolor = "#FFFF0000"; } setWidgetElementProperty("covid-19-inzidenz", "Text_inzidenz", "fillcolor", inzcolor)</name>
<script>js = fromJSON(response);
city = js["features"][0]["attributes"]["GEN"];
inzidenz = js["features"][0]["attributes"]["cases7_per_100k"];
setWidgetElementProperty("covid-19-inzidenz", "Text_city", "text", city);
setWidgetElementProperty("covid-19-inzidenz", "Text_inzidenz", "text", "{inzidenz,numberformat,0.0}");
inznumber = toNumber(inzidenz);
inzcolor = "#FF00F70F";
if (inznumber &gt; 35)
{
inzcolor = "#FFFCAD00";
}
if (inznumber &gt; 50)
{
inzcolor = "#FFFF0000";
}
setWidgetElementProperty("covid-19-inzidenz", "Text_inzidenz", "fillcolor", inzcolor)
</script>
</action>
<action type="script">
<useDefaultName>true</useDefaultName>
<name>Script: str = split("{location,locationformat,decimal}", ","); lat = str[0]; lon = str[1]; url = "https://services7.arcgis.com/mOBPykOjAyBO2ZKk/arcgis/rest/services/RKI_Landkreisdaten/FeatureServer/0/query?where=1%3D1&amp;outFields=GEN,cases7_per_100k&amp;geometry={lon}%2C{lat}&amp;geometryType=esriGeometryPoint&amp;inSR=4326&amp;spatialRel=esriSpatialRelWithin&amp;returnGeometry=false&amp;outSR=4326&amp;f=json";</name>
<script>
str = split("{location,locationformat,decimal}", ",");
lat = str[0];
lon = str[1];
url = "https://services7.arcgis.com/mOBPykOjAyBO2ZKk/arcgis/rest/services/RKI_Landkreisdaten/FeatureServer/0/query?where=1%3D1&amp;outFields=GEN,cases7_per_100k&amp;geometry={lon}%2C{lat}&amp;geometryType=esriGeometryPoint&amp;inSR=4326&amp;spatialRel=esriSpatialRelWithin&amp;returnGeometry=false&amp;outSR=4326&amp;f=json";
</script>
</action>
<flow type="flow">
<name>Covid19Inzidenz</name>
<enabled>true</enabled>
<executionPolicy>PARALLEL</executionPolicy>
<triggercontainer id="t1" x="70.0" y="52.5">
<trigger>Periodic Location Update: every 10m (Network)</trigger>
</triggercontainer>
<actioncontainer id="t2" x="244.99997" y="1417.5">covid-19-inzidenz widget night</actioncontainer>
<actioncontainer id="t3" x="-105.00006" y="1417.5">covid-19-inzidenz widget day</actioncontainer>
<actioncontainer id="t4" x="69.99999" y="297.50003">Init Variable Location: new location into location using Network, Timeout 1m</actioncontainer>
<actioncontainer id="t5" x="70.000015" y="472.49994">Script: str = split("{location,locationformat,decimal}", ","); lat = str[0]; lon = str[1]; url = "https://services7.arcgis.com/mOBPykOjAyBO2ZKk/arcgis/rest/services/RKI_Landkreisdaten/FeatureServer/0/query?where=1%3D1&amp;outFields=GEN,cases7_per_100k&amp;geometry={lon}%2C{lat}&amp;geometryType=esriGeometryPoint&amp;inSR=4326&amp;spatialRel=esriSpatialRelWithin&amp;returnGeometry=false&amp;outSR=4326&amp;f=json";</actioncontainer>
<actioncontainer id="t6" x="70.00004" y="682.49994">HTTP Request: PUT {url} application/x-www-form-urlencoded Lastname=XYZ,Firstname=ABC store in response</actioncontainer>
<actioncontainer id="t7" x="69.99999" y="927.5">Script: js = fromJSON(response); city = js["features"][0]["attributes"]["GEN"]; inzidenz = js["features"][0]["attributes"]["cases7_per_100k"]; setWidgetElementProperty("covid-19-inzidenz", "Text_city", "text", city); setWidgetElementProperty("covid-19-inzidenz", "Text_inzidenz", "text", "{inzidenz,numberformat,0.0}"); inznumber = toNumber(inzidenz); inzcolor = "#FF00F70F"; if (inznumber &gt; 35) { inzcolor = "#FFFCAD00"; } if (inznumber &gt; 50) { inzcolor = "#FFFF0000"; } setWidgetElementProperty("covid-19-inzidenz", "Text_inzidenz", "fillcolor", inzcolor)</actioncontainer>
<connection from="t1" to="t4" type="NORMAL" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t4" to="t5" type="NORMAL" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t5" to="t6" type="NORMAL" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t6" to="t7" type="NORMAL" sourcePosition="SOUTH" targetPosition="NORTH" />
</flow>
<widget type="custom">
<name>covid-19-inzidenz</name>
<width>200</width>
<height>200</height>
<bitmapScalingFactor>1</bitmapScalingFactor>
<stretchToFillArea>false</stretchToFillArea>
<autoRefresh>false</autoRefresh>
<autoRefreshFrequency>3600000</autoRefreshFrequency>
<clickable>
<row>
<cell>
<action gestureType="CLICK">Execute Flows: Covid19Inzidenz</action>
</cell>
</row>
</clickable>
<clickableFeedback>true</clickableFeedback>
<widgetIds>18</widgetIds>
<elements>
<element type="background">
<properties>
<property name="cornerradiusx" type="double">30.0</property>
<property name="cornerradiusy" type="double">30.0</property>
<property name="fill" type="boolean">true</property>
<property name="fillcolor" type="integer">-780173441</property>
<property name="marginbottom" type="double">0.0</property>
<property name="marginleft" type="double">0.0</property>
<property name="marginright" type="double">0.0</property>
<property name="margintop" type="double">0.0</property>
<property name="name" type="string">Background</property>
<property name="roundedcorners" type="boolean">true</property>
<property name="visible" type="boolean">true</property>
</properties>
</element>
<element type="text">
<properties>
<property name="clip" type="boolean">false</property>
<property name="fakebold" type="boolean">false</property>
<property name="fill" type="boolean">true</property>
<property name="fillcolor" type="integer">-1</property>
<property name="fillshadow" type="boolean">false</property>
<property name="fillshadowcolor" type="integer">-16777216</property>
<property name="fillshadowoffsetx" type="double">2.0</property>
<property name="fillshadowoffsety" type="double">2.0</property>
<property name="fillshadowradius" type="double">3.0</property>
<property name="height" type="double">88.0</property>
<property name="multiline" type="boolean">true</property>
<property name="name" type="string">Text_city</property>
<property name="outline" type="boolean">false</property>
<property name="outlinecolor" type="integer">-16711936</property>
<property name="outlineshadow" type="boolean">false</property>
<property name="outlineshadowcolor" type="integer">-16777216</property>
<property name="outlineshadowoffsetx" type="double">2.0</property>
<property name="outlineshadowoffsety" type="double">2.0</property>
<property name="outlineshadowradius" type="double">3.0</property>
<property name="outlinewidth" type="double">1.0</property>
<property name="rotation" type="double">0.0</property>
<property name="rotationx" type="double">0.0</property>
<property name="rotationy" type="double">0.0</property>
<property name="strikethrough" type="boolean">false</property>
<property name="text" type="string">Trier</property>
<property name="textalign" type="string">left</property>
<property name="textpaddingbottom" type="double">0.0</property>
<property name="textpaddingleft" type="double">0.0</property>
<property name="textpaddingright" type="double">0.0</property>
<property name="textpaddingtop" type="double">0.0</property>
<property name="textscalex" type="double">1.0</property>
<property name="textsize" type="double">39.0</property>
<property name="textskewx" type="double">0.0</property>
<property name="textstyle" type="string">normal</property>
<property name="typeface" type="string">sansserif</property>
<property name="underline" type="boolean">false</property>
<property name="verticaltextalign" type="string">top</property>
<property name="visible" type="boolean">true</property>
<property name="width" type="double">170.0</property>
<property name="x" type="double">21.0</property>
<property name="y" type="double">42.5</property>
</properties>
</element>
<element type="text">
<properties>
<property name="clip" type="boolean">false</property>
<property name="fakebold" type="boolean">false</property>
<property name="fill" type="boolean">true</property>
<property name="fillcolor" type="integer">-65536</property>
<property name="fillshadow" type="boolean">false</property>
<property name="fillshadowcolor" type="integer">-16777216</property>
<property name="fillshadowoffsetx" type="double">2.0</property>
<property name="fillshadowoffsety" type="double">2.0</property>
<property name="fillshadowradius" type="double">3.0</property>
<property name="height" type="double">54.0</property>
<property name="multiline" type="boolean">false</property>
<property name="name" type="string">Text_inzidenz</property>
<property name="outline" type="boolean">false</property>
<property name="outlinecolor" type="integer">-16711936</property>
<property name="outlineshadow" type="boolean">false</property>
<property name="outlineshadowcolor" type="integer">-16777216</property>
<property name="outlineshadowoffsetx" type="double">2.0</property>
<property name="outlineshadowoffsety" type="double">2.0</property>
<property name="outlineshadowradius" type="double">3.0</property>
<property name="outlinewidth" type="double">1.0</property>
<property name="rotation" type="double">0.0</property>
<property name="rotationx" type="double">0.0</property>
<property name="rotationy" type="double">0.0</property>
<property name="strikethrough" type="boolean">false</property>
<property name="text" type="string">85.2</property>
<property name="textalign" type="string">right</property>
<property name="textpaddingbottom" type="double">0.0</property>
<property name="textpaddingleft" type="double">0.0</property>
<property name="textpaddingright" type="double">0.0</property>
<property name="textpaddingtop" type="double">0.0</property>
<property name="textscalex" type="double">1.0</property>
<property name="textsize" type="double">47.0</property>
<property name="textskewx" type="double">0.0</property>
<property name="textstyle" type="string">bold</property>
<property name="typeface" type="string">sansserif</property>
<property name="underline" type="boolean">false</property>
<property name="verticaltextalign" type="string">middle</property>
<property name="visible" type="boolean">true</property>
<property name="width" type="double">167.0</property>
<property name="x" type="double">22.723663330078125</property>
<property name="y" type="double">128.5</property>
</properties>
</element>
<element type="text">
<properties>
<property name="clip" type="boolean">false</property>
<property name="fakebold" type="boolean">false</property>
<property name="fill" type="boolean">true</property>
<property name="fillcolor" type="integer">-1</property>
<property name="fillshadow" type="boolean">false</property>
<property name="fillshadowcolor" type="integer">-16777216</property>
<property name="fillshadowoffsetx" type="double">2.0</property>
<property name="fillshadowoffsety" type="double">2.0</property>
<property name="fillshadowradius" type="double">3.0</property>
<property name="height" type="double">25.0</property>
<property name="multiline" type="boolean">false</property>
<property name="name" type="string">Text_Headline</property>
<property name="outline" type="boolean">false</property>
<property name="outlinecolor" type="integer">-16711936</property>
<property name="outlineshadow" type="boolean">false</property>
<property name="outlineshadowcolor" type="integer">-16777216</property>
<property name="outlineshadowoffsetx" type="double">2.0</property>
<property name="outlineshadowoffsety" type="double">2.0</property>
<property name="outlineshadowradius" type="double">3.0</property>
<property name="outlinewidth" type="double">1.0</property>
<property name="rotation" type="double">0.0</property>
<property name="rotationx" type="double">0.0</property>
<property name="rotationy" type="double">0.0</property>
<property name="strikethrough" type="boolean">false</property>
<property name="text" type="string">Inzidenz </property>
<property name="textalign" type="string">left</property>
<property name="textpaddingbottom" type="double">0.0</property>
<property name="textpaddingleft" type="double">0.0</property>
<property name="textpaddingright" type="double">0.0</property>
<property name="textpaddingtop" type="double">0.0</property>
<property name="textscalex" type="double">1.0</property>
<property name="textsize" type="double">21.0</property>
<property name="textskewx" type="double">0.0</property>
<property name="textstyle" type="string">normal</property>
<property name="typeface" type="string">sansserif</property>
<property name="underline" type="boolean">false</property>
<property name="verticaltextalign" type="string">top</property>
<property name="visible" type="boolean">true</property>
<property name="width" type="double">150.0</property>
<property name="x" type="double">21.0</property>
<property name="y" type="double">11.0</property>
</properties>
</element>
</elements>
</widget>
</data>
@Katastrofee
Copy link

Hey, vielen Dank für die Bereitstellung auf Android! Leider krieg ich es irgendwie aber nicht hin dass das widget erscheint... Kannst du mir da vielleicht helfen?

Ich habe automagic installiert am Handy, kann aber den Code nur als solches kopieren / dann aber nirgends einfügen. Also download als Datei klappt schon nicht.

Vielen Dank!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment