commit
6619e4514a
7 changed files with 17 additions and 4 deletions
|
@ -21,6 +21,7 @@ import java.util.Collections;
|
|||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
|
||||
import info.nightscout.androidaps.Config;
|
||||
import info.nightscout.androidaps.MainApp;
|
||||
import info.nightscout.androidaps.R;
|
||||
import info.nightscout.androidaps.Services.AlarmSoundService;
|
||||
|
@ -123,10 +124,15 @@ public class NotificationStore {
|
|||
Context context = MainApp.instance().getApplicationContext();
|
||||
NotificationManager mgr = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
|
||||
Bitmap largeIcon = BitmapFactory.decodeResource(context.getResources(), R.mipmap.blueowl);
|
||||
int smallIcon = R.drawable.ic_notification;
|
||||
if (Config.NSCLIENT || Config.G5UPLOADER){
|
||||
largeIcon = BitmapFactory.decodeResource(MainApp.instance().getResources(), R.mipmap.yellowowl);
|
||||
smallIcon = R.drawable.nsclient_smallicon;
|
||||
}
|
||||
Uri sound = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_ALARM);
|
||||
NotificationCompat.Builder notificationBuilder =
|
||||
new NotificationCompat.Builder(context, CHANNEL_ID)
|
||||
.setSmallIcon(R.drawable.ic_notification)
|
||||
.setSmallIcon(smallIcon)
|
||||
.setLargeIcon(largeIcon)
|
||||
.setContentText(n.text)
|
||||
.setPriority(NotificationCompat.PRIORITY_MAX)
|
||||
|
|
|
@ -15,6 +15,7 @@ import android.support.v4.app.TaskStackBuilder;
|
|||
|
||||
import com.squareup.otto.Subscribe;
|
||||
|
||||
import info.nightscout.androidaps.Config;
|
||||
import info.nightscout.androidaps.Constants;
|
||||
import info.nightscout.androidaps.MainActivity;
|
||||
import info.nightscout.androidaps.MainApp;
|
||||
|
@ -153,9 +154,15 @@ public class PersistentNotificationPlugin extends PluginBase {
|
|||
builder.setOngoing(true);
|
||||
builder.setOnlyAlertOnce(true);
|
||||
builder.setCategory(NotificationCompat.CATEGORY_STATUS);
|
||||
builder.setSmallIcon(R.drawable.ic_notification);
|
||||
Bitmap largeIcon = BitmapFactory.decodeResource(ctx.getResources(), R.mipmap.blueowl);
|
||||
builder.setLargeIcon(largeIcon);
|
||||
if (Config.NSCLIENT || Config.G5UPLOADER){
|
||||
builder.setSmallIcon(R.drawable.nsclient_smallicon);
|
||||
Bitmap largeIcon = BitmapFactory.decodeResource(ctx.getResources(), R.mipmap.yellowowl);
|
||||
builder.setLargeIcon(largeIcon);
|
||||
} else {
|
||||
builder.setSmallIcon(R.drawable.ic_notification);
|
||||
Bitmap largeIcon = BitmapFactory.decodeResource(ctx.getResources(), R.mipmap.blueowl);
|
||||
builder.setLargeIcon(largeIcon);
|
||||
}
|
||||
builder.setContentTitle(line1);
|
||||
builder.setContentText(line2);
|
||||
builder.setSubText(line3);
|
||||
|
|
BIN
app/src/main/res/drawable-hdpi/nsclient_smallicon.png
Normal file
BIN
app/src/main/res/drawable-hdpi/nsclient_smallicon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 968 B |
BIN
app/src/main/res/drawable-mdpi/nsclient_smallicon.png
Normal file
BIN
app/src/main/res/drawable-mdpi/nsclient_smallicon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 571 B |
BIN
app/src/main/res/drawable-xhdpi/nsclient_smallicon.png
Normal file
BIN
app/src/main/res/drawable-xhdpi/nsclient_smallicon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.3 KiB |
BIN
app/src/main/res/drawable-xxhdpi/nsclient_smallicon.png
Normal file
BIN
app/src/main/res/drawable-xxhdpi/nsclient_smallicon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2 KiB |
BIN
logo/nsclient/white.png
Normal file
BIN
logo/nsclient/white.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.7 KiB |
Loading…
Reference in a new issue