From d3ecc6cc0b33467f24f00acc5ae5f9b46c1a97d1 Mon Sep 17 00:00:00 2001 From: Jacques Foucry Date: Wed, 9 Nov 2016 16:07:12 +0100 Subject: [PATCH] Use new icons files --- .../net/foucry/pilldroid/MedicamentListActivity.java | 12 ++++++------ app/src/main/res/layout/medicament_list_content.xml | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/net/foucry/pilldroid/MedicamentListActivity.java b/app/src/main/java/net/foucry/pilldroid/MedicamentListActivity.java index 61c4632..5a24814 100644 --- a/app/src/main/java/net/foucry/pilldroid/MedicamentListActivity.java +++ b/app/src/main/java/net/foucry/pilldroid/MedicamentListActivity.java @@ -366,14 +366,14 @@ public class MedicamentListActivity extends AppCompatActivity { } private void scheduleNotification(Notification notification, long delay) { - Log.i(TAG, "scheduleNotification delay == " + delay); + Log.i(TAG, "scheduleNotification delay == " + 30000); Intent notificationIntent = new Intent(this, NotificationPublisher.class); notificationIntent.putExtra(NOTIFICATION_ID, 1); notificationIntent.putExtra(NotificationPublisher.NOTIFICATION, notification); PendingIntent pendingIntent = PendingIntent.getBroadcast(this, 0, notificationIntent, PendingIntent.FLAG_UPDATE_CURRENT); - long futureInMillis = SystemClock.elapsedRealtime() + delay; + long futureInMillis = SystemClock.elapsedRealtime() + 30000; AlarmManager alarmManager = (AlarmManager) getSystemService(Context.ALARM_SERVICE); alarmManager.set(AlarmManager.ELAPSED_REALTIME_WAKEUP, futureInMillis, pendingIntent); } @@ -384,7 +384,7 @@ public class MedicamentListActivity extends AppCompatActivity { Notification.Builder builder = new Notification.Builder(this); builder.setContentTitle(getAppName()); builder.setContentText(content); - builder.setSmallIcon(R.mipmap.ic_launcher); + builder.setSmallIcon(R.drawable.ic_stat_small_capsule); builder.setLargeIcon(BitmapFactory.decodeResource(getApplicationContext().getResources(), R.mipmap.ic_launcher)); return builder.build(); @@ -447,14 +447,14 @@ public class MedicamentListActivity extends AppCompatActivity { int remainingStock = (int) Math.floor(mValues.get(position).getStock() / mValues.get(position).getPrise()); if (remainingStock <= mValues.get(position).getAlertThreshold()) { holder.mView.setBackgroundResource(R.drawable.gradient_bg_alert); - holder.mIconView.setImageResource(R.drawable.stock_alert); + holder.mIconView.setImageResource(R.drawable.ic_stock_nok); } else if ((remainingStock > mValues.get(position).getAlertThreshold()) && (remainingStock <= (mValues.get(position).getWarnThreshold()))) { holder.mView.setBackgroundResource(R.drawable.gradient_bg_warning); - holder.mIconView.setImageResource(R.drawable.stock_warn); + holder.mIconView.setImageResource(R.drawable.ic_stock_waring); } else { holder.mView.setBackgroundResource(R.drawable.gradient_bg_ok); - holder.mIconView.setImageResource(R.drawable.stock_ok); + holder.mIconView.setImageResource(R.drawable.ic_stock_ok); } } diff --git a/app/src/main/res/layout/medicament_list_content.xml b/app/src/main/res/layout/medicament_list_content.xml index f5be3b6..dd96240 100644 --- a/app/src/main/res/layout/medicament_list_content.xml +++ b/app/src/main/res/layout/medicament_list_content.xml @@ -14,7 +14,7 @@ android:layout_width="50sp" android:layout_height="50sp" android:layout_marginLeft="5dp" - android:src="@drawable/stock_ok" + android:src="@drawable/ic_stock_ok" android:contentDescription="Icone de stock" android:layout_centerVertical="true" android:layout_alignParentStart="true" />