From 0e2de9d140b38b0dbafd71143148c81881ddb76a Mon Sep 17 00:00:00 2001 From: Tim Gunn <2896311+Tornado-Tim@users.noreply.github.com> Date: Sun, 3 May 2020 17:06:10 +1200 Subject: [PATCH] Convert to Kotlin --- .../aps/loop/CarbSuggestionReceiver.java | 20 ------------------- .../aps/loop/CarbSuggestionReceiver.kt | 15 ++++++++++++++ 2 files changed, 15 insertions(+), 20 deletions(-) delete mode 100644 app/src/main/java/info/nightscout/androidaps/plugins/aps/loop/CarbSuggestionReceiver.java create mode 100644 app/src/main/java/info/nightscout/androidaps/plugins/aps/loop/CarbSuggestionReceiver.kt diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/aps/loop/CarbSuggestionReceiver.java b/app/src/main/java/info/nightscout/androidaps/plugins/aps/loop/CarbSuggestionReceiver.java deleted file mode 100644 index fe0b9b3ef4..0000000000 --- a/app/src/main/java/info/nightscout/androidaps/plugins/aps/loop/CarbSuggestionReceiver.java +++ /dev/null @@ -1,20 +0,0 @@ -package info.nightscout.androidaps.plugins.aps.loop; - -import android.content.Context; -import android.content.Intent; - -import javax.inject.Inject; - -import dagger.android.DaggerBroadcastReceiver; - -public class CarbSuggestionReceiver extends DaggerBroadcastReceiver { - - @Inject LoopPlugin loopPlugin; - - @Override - public void onReceive(Context context, Intent intent) { - super.onReceive(context, intent); - int duartion = intent.getIntExtra("ignoreDuration", 5); - loopPlugin.disableCarbSuggestions(duartion); - } -} diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/aps/loop/CarbSuggestionReceiver.kt b/app/src/main/java/info/nightscout/androidaps/plugins/aps/loop/CarbSuggestionReceiver.kt new file mode 100644 index 0000000000..5382184d15 --- /dev/null +++ b/app/src/main/java/info/nightscout/androidaps/plugins/aps/loop/CarbSuggestionReceiver.kt @@ -0,0 +1,15 @@ +package info.nightscout.androidaps.plugins.aps.loop + +import android.content.Context +import android.content.Intent +import dagger.android.DaggerBroadcastReceiver +import javax.inject.Inject + +class CarbSuggestionReceiver : DaggerBroadcastReceiver() { + @Inject lateinit var loopPlugin: LoopPlugin + override fun onReceive(context: Context, intent: Intent) { + super.onReceive(context, intent) + val duration = intent.getIntExtra("ignoreDuration", 5) + loopPlugin.disableCarbSuggestions(duration) + } +} \ No newline at end of file