mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-17 21:29:54 +01:00
Show spinner when quitting, don't show time in ongoing notification.
This commit is contained in:
@@ -47,6 +47,7 @@ public class BriarService extends RoboService {
|
|||||||
b.setSmallIcon(R.drawable.notification_icon);
|
b.setSmallIcon(R.drawable.notification_icon);
|
||||||
b.setContentTitle(getText(R.string.notification_title));
|
b.setContentTitle(getText(R.string.notification_title));
|
||||||
b.setContentText(getText(R.string.notification_text));
|
b.setContentText(getText(R.string.notification_text));
|
||||||
|
b.setWhen(0); // Don't show the time
|
||||||
// Touch the notification to quit
|
// Touch the notification to quit
|
||||||
Intent i = new Intent(this, HomeScreenActivity.class);
|
Intent i = new Intent(this, HomeScreenActivity.class);
|
||||||
i.addFlags(FLAG_ACTIVITY_CLEAR_TOP);
|
i.addFlags(FLAG_ACTIVITY_CLEAR_TOP);
|
||||||
|
|||||||
@@ -46,14 +46,6 @@ public class HomeScreenActivity extends BriarActivity {
|
|||||||
|
|
||||||
// If this activity was launched from the notification bar, quit
|
// If this activity was launched from the notification bar, quit
|
||||||
if(getIntent().getBooleanExtra("net.sf.briar.QUIT", false)) {
|
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();
|
quit();
|
||||||
} else {
|
} else {
|
||||||
ListView.LayoutParams matchParent = new ListView.LayoutParams(
|
ListView.LayoutParams matchParent = new ListView.LayoutParams(
|
||||||
@@ -173,6 +165,14 @@ public class HomeScreenActivity extends BriarActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void quit() {
|
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() {
|
new Thread() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
|||||||
Reference in New Issue
Block a user