Merge pull request #300 from garyvdm/notification
Get service notification to show. Tweek settings.
Этот коммит содержится в:
@@ -37,10 +37,13 @@ public class TrackingService extends Service {
|
|||||||
private static Notification createNotification(Context context) {
|
private static Notification createNotification(Context context) {
|
||||||
PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, new Intent(context, MainActivity.class), 0);
|
PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, new Intent(context, MainActivity.class), 0);
|
||||||
return new NotificationCompat.Builder(context, MainApplication.PRIMARY_CHANNEL)
|
return new NotificationCompat.Builder(context, MainApplication.PRIMARY_CHANNEL)
|
||||||
.setContentTitle(context.getString(R.string.app_name))
|
.setContentTitle(context.getString(R.string.settings_status_on_summary))
|
||||||
.setContentText(context.getString(R.string.settings_status_on_summary))
|
.setTicker(context.getString(R.string.settings_status_on_summary))
|
||||||
.setContentIntent(pendingIntent)
|
.setContentIntent(pendingIntent)
|
||||||
.setPriority(NotificationCompat.PRIORITY_MIN)
|
.setSmallIcon(R.drawable.ic_stat_notify)
|
||||||
|
.setPriority(NotificationCompat.PRIORITY_LOW)
|
||||||
|
.setCategory(Notification.CATEGORY_SERVICE)
|
||||||
|
.setColor(ContextCompat.getColor(context, R.color.primary_dark))
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,10 @@
|
|||||||
|
<vector
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportHeight="72.0"
|
||||||
|
android:viewportWidth="72.0"
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<path
|
||||||
|
android:fillColor="#FF000000"
|
||||||
|
android:pathData="M36,0A36,36 0,0 0,0 36A36,36 0,0 0,36 72A36,36 0,0 0,72 36A36,36 0,0 0,36 0zM50.51,14.66C53.41,16.89 55.93,19.68 57.88,23.05C59.83,26.42 60.99,30 61.46,33.63L55.09,34.55C54.72,31.74 53.87,28.85 52.36,26.24C50.85,23.63 48.78,21.45 46.53,19.72L50.51,14.66zM42.82,24.85C44.4,26.08 45.77,27.58 46.84,29.43C47.91,31.27 48.52,33.21 48.79,35.2L42.42,36.12C42.25,34.95 41.95,33.7 41.32,32.61C40.69,31.53 39.77,30.64 38.84,29.91L42.82,24.85zM18.38,31.13L24.76,42.17L31.13,53.21A12.75,12.75 37.68,0 1,18.38 53.21A12.75,12.75 37.68,0 1,12.01 42.17A12.75,12.75 37.68,0 1,18.38 31.13zM32.96,34.21A3.19,3.19 60,0 1,35.8 35.8A3.19,3.19 60,0 1,34.63 40.15A3.19,3.19 60,0 1,30.28 38.99A3.19,3.19 60,0 1,31.45 34.63A3.19,3.19 60,0 1,32.96 34.21z"/>
|
||||||
|
</vector>
|
||||||
Ссылка в новой задаче
Block a user