android-openrat

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 8c2485db5cc411d4ee6a5fdd983dc8b7209f9f74
parent 4c76feeb0bec710df03782dfe15f09d13e115bbe
Author: dankert <devnull@localhost>
Date:   Wed, 19 Oct 2011 21:41:29 +0200

Längere Tickertexte bei den IntentServices.

Diffstat:
res/values/strings.xml | 12++++++++++++
src/de/openrat/android/blog/service/PublishIntentService.java | 12+++---------
src/de/openrat/android/blog/service/UploadIntentService.java | 8+++++---
3 files changed, 20 insertions(+), 12 deletions(-)

diff --git a/res/values/strings.xml b/res/values/strings.xml @@ -31,18 +31,26 @@ <string name="waitingforselectproject">Wähle Projekt</string> <string name="waitingforrootfolder">Einstiegsordner wird gesucht</string> <string name="waitingforlogin">Anmeldung am Server</string> + <string name="waitingfordelete">Löschen</string> + <string name="waitingfornew">Erzeuge</string> <string name="language">Sprache</string> <string name="model">Variante</string> <string name="new1">Neu</string> <string name="new_folder">Neuer Unterordner</string> <string name="new_page">Neue Seite</string> <string name="upload">Hochladen</string> + <string name="upload_long">Die Datei wird jetzt hochladen</string> <string name="upload_file">Datei hochladen</string> <string name="upload_image">Bild hochladen</string> <string name="upload_ok">Hochladevorgang abgeschlossen</string> + <string name="upload_ok_long">Die Datei wurde erfolgreich auf den Server geladen</string> <string name="upload_fail">Hochladevorgang fehlerhaft</string> + <string name="upload_fail_long">Die Datei konnte nicht auf den Server geladen werden</string> + <string name="publish_long">Die Veröffentlichung wurde gestartet</string> <string name="publish_ok">Wurde veröffentlicht</string> + <string name="publish_ok_long">Erfolgreich veröffentlicht</string> <string name="publish_fail">Veröffentlichung nicht erfolgreich</string> + <string name="publish_fail_long">Leider konnte die Datei nicht veröffentlicht werden</string> <string name="delete">Löschen</string> <string name="name">Name</string> <string name="filename">Dateiname</string> @@ -52,9 +60,13 @@ <string name="folder_content">Ordner</string> <string name="folder_properties">Eigenschaften</string> <string name="page_content">Seite</string> + <string name="description">Inhalt</string> <string name="editor">Inhalt</string> <string name="error_timeout">Zeitablauf</string> <string name="error_io">Verbindungsabbruch</string> <string name="error">Fehler</string> <string name="reason">Grund</string> + <string name="areyousure">Sicher?</string> + <string name="choosefile">Datei auswählen</string> + <string name="chooseimage">Bild auswählen</string> </resources> diff --git a/src/de/openrat/android/blog/service/PublishIntentService.java b/src/de/openrat/android/blog/service/PublishIntentService.java @@ -65,7 +65,7 @@ public class PublishIntentService extends IntentService final Notification notification = new Notification( R.drawable.logo, getResources().getString( - R.string.publish), System.currentTimeMillis()); + R.string.publish_long), System.currentTimeMillis()); notification.setLatestEventInfo(getApplicationContext(), getResources().getString(R.string.publish), name, contentIntent); @@ -75,14 +75,6 @@ public class PublishIntentService extends IntentService try { - try - { - Thread.sleep(5000); - } - catch (InterruptedException e) - { - } - int old = client.setTimeout(3600000); // 1 Std. client.publish(type, id); client.setTimeout(old); @@ -91,12 +83,14 @@ public class PublishIntentService extends IntentService notification.setLatestEventInfo(getApplicationContext(), getResources().getString(R.string.publish_ok), name, contentIntent); + notification.tickerText = getResources().getString(R.string.publish_ok_long); notification.flags = Notification.FLAG_AUTO_CANCEL; nm.notify(NOTIFICATION_PUBLISH, notification); } catch (IOException e) { final String msgText = getResources().getString(R.string.publish_fail); + notification.tickerText = getResources().getString(R.string.publish_fail_long); notification.setLatestEventInfo(getApplicationContext(), msgText, name, contentIntent); diff --git a/src/de/openrat/android/blog/service/UploadIntentService.java b/src/de/openrat/android/blog/service/UploadIntentService.java @@ -53,10 +53,10 @@ public class UploadIntentService extends IntentService notificationIntent, 0); final File file = new File(filePath); - final String msgUpload = getResources().getString(R.string.upload); + final String tickerText = getResources().getString(R.string.upload_long); final Notification notification = new Notification(R.drawable.logo, - msgUpload, System.currentTimeMillis()); - notification.setLatestEventInfo(getApplicationContext(), msgUpload, + tickerText, System.currentTimeMillis()); + notification.setLatestEventInfo(getApplicationContext(), getResources().getString(R.string.upload), file.getName(), contentIntent); notification.flags = Notification.FLAG_ONGOING_EVENT | Notification.FLAG_NO_CLEAR; @@ -78,6 +78,7 @@ public class UploadIntentService extends IntentService // Alles OK. final String msgText = getResources().getString(R.string.upload_ok); + notification.tickerText = getResources().getString(R.string.upload_ok_long); notification.setLatestEventInfo(getApplicationContext(), msgText, file.getName(), contentIntent); notification.flags = Notification.FLAG_AUTO_CANCEL; @@ -89,6 +90,7 @@ public class UploadIntentService extends IntentService // Fehler ist aufgetreten. final String msgText = getResources().getString( R.string.upload_fail); + notification.tickerText = getResources().getString(R.string.upload_fail_long); notification.setLatestEventInfo(getApplicationContext(), msgText, e .getMessage() + ": " + file.getName(), contentIntent);