Show spinner when quitting, don't show time in ongoing notification.

This commit is contained in:
akwizgran
2013-03-02 00:32:13 +00:00
parent e15731a8e3
commit 63a520bae4
2 changed files with 9 additions and 8 deletions

View File

@@ -47,6 +47,7 @@ public class BriarService extends RoboService {
b.setSmallIcon(R.drawable.notification_icon);
b.setContentTitle(getText(R.string.notification_title));
b.setContentText(getText(R.string.notification_text));
b.setWhen(0); // Don't show the time
// Touch the notification to quit
Intent i = new Intent(this, HomeScreenActivity.class);
i.addFlags(FLAG_ACTIVITY_CLEAR_TOP);

View File

@@ -46,14 +46,6 @@ public class HomeScreenActivity extends BriarActivity {
// If this activity was launched from the notification bar, quit
if(getIntent().getBooleanExtra("net.sf.briar.QUIT", false)) {
LinearLayout layout = new LinearLayout(this);
layout.setLayoutParams(new LinearLayout.LayoutParams(MATCH_PARENT,
MATCH_PARENT));
layout.setGravity(CENTER);
ProgressBar spinner = new ProgressBar(this);
spinner.setIndeterminate(true);
layout.addView(spinner);
setContentView(layout);
quit();
} else {
ListView.LayoutParams matchParent = new ListView.LayoutParams(
@@ -173,6 +165,14 @@ public class HomeScreenActivity extends BriarActivity {
}
private void quit() {
LinearLayout layout = new LinearLayout(this);
layout.setLayoutParams(new LinearLayout.LayoutParams(MATCH_PARENT,
MATCH_PARENT));
layout.setGravity(CENTER);
ProgressBar spinner = new ProgressBar(this);
spinner.setIndeterminate(true);
layout.addView(spinner);
setContentView(layout);
new Thread() {
@Override
public void run() {