Skip to content

Commit

Permalink
Android: cosmetic changes
Browse files Browse the repository at this point in the history
  • Loading branch information
raphaelm committed Mar 12, 2014
1 parent 6e2bbb7 commit 8c77a16
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 4 deletions.
2 changes: 1 addition & 1 deletion android-widget/app/src/main/AndroidManifest.xml
Expand Up @@ -37,7 +37,7 @@

<service android:name=".WantConnectivityService" />
</application>
<uses-sdk android:minSdkVersion="7" />
<uses-sdk android:minSdkVersion="7" android:targetSdkVersion="19" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
</manifest>
Expand Up @@ -76,14 +76,17 @@ public void onClick(View v) {
try {
JSONObject result = new JSONObject(getIntent().getStringExtra("result"));
StringBuilder people = new StringBuilder();
people.append("Anwesend: ");
JSONArray peopledetails = result.getJSONObject("details").getJSONArray("laboranten");
if (peopledetails.length() > 0)
people.append("Anwesend: ");
for (int i = 0; i < peopledetails.length(); i++) {
if (i > 0)
people.append(", ");
people.append(peopledetails.get(i));
}
people.append("\nGeräte: ");
if (peopledetails.length() > 0)
people.append("\n");
people.append("Geräte: ");
people.append(result.getJSONObject("details").getInt("geraete"));
((TextView) findViewById(R.id.statustext)).setText(people.toString());
} catch (JSONException e) {
Expand Down
10 changes: 10 additions & 0 deletions android-widget/app/src/main/res/drawable/background.xml
@@ -0,0 +1,10 @@
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_selected="true"
android:drawable="@drawable/selected" />
<item android:state_pressed="true"
android:drawable="@drawable/selected" />
<item android:state_focused="true"
android:drawable="@drawable/selected" />
<item
android:drawable="@drawable/transparent" />
</selector>
6 changes: 6 additions & 0 deletions android-widget/app/src/main/res/drawable/selected.xml
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >
<solid android:color="#000099" />

</shape>
5 changes: 5 additions & 0 deletions android-widget/app/src/main/res/drawable/transparent.xml
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >
<solid android:color="#00FFFFFF" />
</shape>
6 changes: 5 additions & 1 deletion android-widget/app/src/main/res/layout/quickaction.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="144dp"
android:layout_width="196dp"
android:layout_height="wrap_content"
android:padding="8dp"
android:background="#000000">
Expand All @@ -17,13 +17,17 @@
android:layout_alignParentLeft="true"
android:layout_below="@id/statustext"
android:layout_height="48dp"
android:clickable="true"
android:background="@drawable/background"
android:src="@drawable/ic_action_refresh" />

<ImageView
android:id="@+id/settings"
android:layout_width="48dp"
android:layout_alignParentRight="true"
android:layout_below="@id/statustext"
android:clickable="true"
android:background="@drawable/background"
android:layout_height="48dp"
android:src="@drawable/ic_action_settings" />
</RelativeLayout>

0 comments on commit 8c77a16

Please sign in to comment.