Procházet zdrojové kódy

Show feedback when starting service

Closes #63
tags/ActivityRecorder/0.1.3
Chris Smith před 14 roky
rodič
revize
1a81d81d4b

binární
code/ActivityRecorder/dist/ActivityRecorder.apk Zobrazit soubor


+ 11
- 0
code/ActivityRecorder/src/uk/co/md87/android/activityrecorder/ActivityRecorderActivity.java Zobrazit soubor

@@ -6,6 +6,7 @@
6 6
 package uk.co.md87.android.activityrecorder;
7 7
 
8 8
 import android.app.Activity;
9
+import android.app.ProgressDialog;
9 10
 import android.content.ComponentName;
10 11
 import android.content.Intent;
11 12
 import android.content.ServiceConnection;
@@ -34,6 +35,7 @@ import uk.co.md87.android.common.ExceptionHandler;
34 35
 public class ActivityRecorderActivity extends Activity {
35 36
 
36 37
     ActivityRecorderBinder service = null;
38
+    ProgressDialog dialog;
37 39
 
38 40
     final Handler handler = new Handler();
39 41
 
@@ -83,6 +85,10 @@ public class ActivityRecorderActivity extends Activity {
83 85
                 } else {
84 86
                     handler.removeCallbacks(updateRunnable);
85 87
                     ((Button) findViewById(R.id.togglebutton)).setEnabled(false);
88
+
89
+                    dialog = ProgressDialog.show(ActivityRecorderActivity.this, "Starting service",
90
+                        "Please wait...", true);
91
+
86 92
                     handler.postDelayed(startRunnable, 500);
87 93
                 }
88 94
             } catch (RemoteException ex) {
@@ -123,6 +129,11 @@ public class ActivityRecorderActivity extends Activity {
123 129
             ((Button) findViewById(R.id.togglebutton)).setText(service.isRunning()
124 130
                     ? R.string.service_enabled : R.string.service_disabled);
125 131
             ((Button) findViewById(R.id.togglebutton)).setEnabled(true);
132
+
133
+            if (dialog != null) {
134
+                dialog.dismiss();
135
+                dialog = null;
136
+            }
126 137
             
127 138
             final List<Classification> classifications = service.getClassifications();
128 139
             final ArrayAdapter<Classification> adapter = (ArrayAdapter<Classification>)

+ 1
- 1
website/index.html Zobrazit soubor

@@ -114,7 +114,7 @@
114 114
        </p>
115 115
        <h4>Changelog</h4>
116 116
        <ul>
117
-        <li><strong>0.1.2 &rarr; 0.1.3</strong>: More efficient updating of activity list</li>
117
+        <li><strong>0.1.2 &rarr; 0.1.3</strong>: More efficient updating of activity list, give feedback when starting service</li>
118 118
         <li><strong>0.1.1 &rarr; 0.1.2</strong>: Fix various issues when starting service</li>
119 119
         <li><strong>0.1.0 &rarr; 0.1.1</strong>: Fix exception when stopping service in some conditions</li>
120 120
        </ul>

Načítá se…
Zrušit
Uložit