- add put for action

- change icons for primary/other actions

Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
This commit is contained in:
tobiasKaminsky 2019-02-20 12:31:33 +01:00
parent 5f7b25f8a1
commit 220bcfdb0a
No known key found for this signature in database
GPG Key ID: 0E00D4D47D0C5AF7
6 changed files with 46 additions and 2 deletions

View File

@ -0,0 +1,5 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
<path d="M0 0h24v24H0z" fill="none" />
<path
d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z" />
</svg>

After

Width:  |  Height:  |  Size: 277 B

View File

@ -0,0 +1,5 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
<path fill="none" d="M0 0h24v24H0V0zm0 0h24v24H0V0z" />
<path
d="M16.59 7.58L10 14.17l-3.59-3.58L5 12l5 5 8-8zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z" />
</svg>

After

Width:  |  Height:  |  Size: 346 B

View File

@ -62,6 +62,7 @@ import org.apache.commons.httpclient.HttpStatus;
import org.apache.commons.httpclient.methods.DeleteMethod;
import org.apache.commons.httpclient.methods.GetMethod;
import org.apache.commons.httpclient.methods.PostMethod;
import org.apache.commons.httpclient.methods.PutMethod;
import java.io.IOException;
import java.security.InvalidKeyException;
@ -183,8 +184,14 @@ public class NotificationJob extends Job {
actionIntent,
PendingIntent.FLAG_CANCEL_CURRENT);
notificationBuilder.addAction(new NotificationCompat.Action(R.drawable.ic_notification, action.label,
actionPendingIntent));
int icon;
if (action.primary) {
icon = R.drawable.ic_check_circle;
} else {
icon = R.drawable.ic_check_circle_outline;
}
notificationBuilder.addAction(new NotificationCompat.Action(icon, action.label, actionPendingIntent));
}
}
@ -295,6 +302,10 @@ public class NotificationJob extends Job {
method = new DeleteMethod(actionLink);
break;
case "PUT":
method = new PutMethod(actionLink);
break;
default:
// do nothing
return 0;

View File

@ -14,6 +14,7 @@ import org.apache.commons.httpclient.HttpStatus;
import org.apache.commons.httpclient.methods.DeleteMethod;
import org.apache.commons.httpclient.methods.GetMethod;
import org.apache.commons.httpclient.methods.PostMethod;
import org.apache.commons.httpclient.methods.PutMethod;
import java.io.IOException;
@ -48,6 +49,10 @@ public class NotificationExecuteActionTask extends AsyncTask<Action, Void, Boole
method = new DeleteMethod(action.link);
break;
case "PUT":
method = new PutMethod(action.link);
break;
default:
// do nothing
return false;

View File

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="#FF000000"
android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM10,17l-5,-5 1.41,-1.41L10,14.17l7.59,-7.59L19,8l-9,9z" />
</vector>

View File

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="#FF000000"
android:pathData="M16.59,7.58L10,14.17l-3.59,-3.58L5,12l5,5 8,-8zM12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM12,20c-4.42,0 -8,-3.58 -8,-8s3.58,-8 8,-8 8,3.58 8,8 -3.58,8 -8,8z" />
</vector>