diff --git a/app/build.gradle b/app/build.gradle index 6d2d4b4d99..86bcce87b6 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -117,8 +117,8 @@ android { buildConfigField "String", "REMOTE", '"' + generateGitRemote() + '"' buildConfigField "String", "HEAD", '"' + generateGitBuild() + '"' buildConfigField "String", "DEV_VERSION", '"2.4-dev"' - buildConfigField "String", "DEV_DATE", '"21.6.2019"' - buildConfigField "String", "DEV_CHECKIN", '"8d9c18dd359dc671dfb1b9f75dd454e29df640f2"' + buildConfigField "String", "DEV_DATE", '"4.7.2019"' + buildConfigField "String", "DEV_CHECKIN", '"0693a599d50843999ff4e3b1312d1f3ed5d1369b"' testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" // if you change minSdkVersion to less than 11, you need to change executeTask for wear diff --git a/app/src/main/java/info/nightscout/androidaps/MainApp.java b/app/src/main/java/info/nightscout/androidaps/MainApp.java index e8120bf1a4..18df858457 100644 --- a/app/src/main/java/info/nightscout/androidaps/MainApp.java +++ b/app/src/main/java/info/nightscout/androidaps/MainApp.java @@ -1,9 +1,15 @@ package info.nightscout.androidaps; import android.app.Application; +import android.bluetooth.BluetoothAdapter; +import android.content.BroadcastReceiver; +import android.content.Context; +import android.content.Intent; import android.content.IntentFilter; import android.content.res.Resources; import android.os.SystemClock; +import android.util.Log; + import androidx.annotation.Nullable; import androidx.annotation.PluralsRes; import androidx.localbroadcastmanager.content.LocalBroadcastManager; @@ -61,12 +67,15 @@ import info.nightscout.androidaps.plugins.profile.local.LocalProfilePlugin; import info.nightscout.androidaps.plugins.profile.ns.NSProfilePlugin; import info.nightscout.androidaps.plugins.profile.simple.SimpleProfilePlugin; import info.nightscout.androidaps.plugins.pump.combo.ComboPlugin; +import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkConst; +import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkUtil; import info.nightscout.androidaps.plugins.pump.danaR.DanaRPlugin; import info.nightscout.androidaps.plugins.pump.danaRKorean.DanaRKoreanPlugin; import info.nightscout.androidaps.plugins.pump.danaRS.DanaRSPlugin; import info.nightscout.androidaps.plugins.pump.danaRv2.DanaRv2Plugin; import info.nightscout.androidaps.plugins.pump.insight.LocalInsightPlugin; import info.nightscout.androidaps.plugins.pump.mdi.MDIPlugin; +import info.nightscout.androidaps.plugins.pump.medtronic.MedtronicPumpPlugin; import info.nightscout.androidaps.plugins.pump.virtual.VirtualPumpPlugin; import info.nightscout.androidaps.plugins.sensitivity.SensitivityAAPSPlugin; import info.nightscout.androidaps.plugins.sensitivity.SensitivityOref0Plugin; @@ -111,6 +120,7 @@ public class MainApp extends Application { private static AckAlarmReceiver ackAlarmReciever = new AckAlarmReceiver(); private static DBAccessReceiver dbAccessReciever = new DBAccessReceiver(); private LocalBroadcastManager lbm; + BroadcastReceiver btReceiver; public static boolean devBranch; public static boolean engineeringMode; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/dialogs/MessageDialog.java b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/dialogs/MessageDialog.java index af407a166b..a42fd137b9 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/dialogs/MessageDialog.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/dialogs/MessageDialog.java @@ -4,7 +4,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import android.os.Bundle; -import android.support.v4.app.DialogFragment; +import androidx.fragment.app.DialogFragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/dialogs/MessageHelperActivity.java b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/dialogs/MessageHelperActivity.java index 3650300247..9b105c679d 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/dialogs/MessageHelperActivity.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/dialogs/MessageHelperActivity.java @@ -1,7 +1,7 @@ package info.nightscout.androidaps.plugins.general.overview.dialogs; import android.os.Bundle; -import android.support.v7.app.AppCompatActivity; +import androidx.appcompat.app.AppCompatActivity; public class MessageHelperActivity extends AppCompatActivity { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/dialog/RileyLinkBLEScanActivity.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/dialog/RileyLinkBLEScanActivity.java index cb68261f25..9a6fa87d11 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/dialog/RileyLinkBLEScanActivity.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/dialog/RileyLinkBLEScanActivity.java @@ -25,10 +25,6 @@ import android.os.Build; import android.os.Bundle; import android.os.Handler; import android.os.ParcelUuid; -import android.support.v4.app.ActivityCompat; -import android.support.v4.content.ContextCompat; -import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.Toolbar; import android.util.Log; import android.view.LayoutInflater; import android.view.Menu; @@ -40,6 +36,11 @@ import android.widget.ListView; import android.widget.TextView; import android.widget.Toast; +import androidx.appcompat.app.AppCompatActivity; +import androidx.appcompat.widget.Toolbar; +import androidx.core.app.ActivityCompat; +import androidx.core.content.ContextCompat; + import info.nightscout.androidaps.MainApp; import info.nightscout.androidaps.R; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkConst; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/RileyLinkUtil.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/RileyLinkUtil.java index ea1d0eb7fc..0239ae3a1a 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/RileyLinkUtil.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/RileyLinkUtil.java @@ -12,7 +12,9 @@ import org.slf4j.LoggerFactory; import android.content.Context; import android.content.Intent; -import android.support.v4.content.LocalBroadcastManager; + + +import androidx.localbroadcastmanager.content.LocalBroadcastManager; import info.nightscout.androidaps.MainApp; import info.nightscout.androidaps.logging.L; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/dialog/RileyLinkStatusActivity.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/dialog/RileyLinkStatusActivity.java index aa7e985d6b..20c6b8ec07 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/dialog/RileyLinkStatusActivity.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/dialog/RileyLinkStatusActivity.java @@ -4,16 +4,17 @@ import java.util.ArrayList; import java.util.List; import android.os.Bundle; -import android.support.design.widget.FloatingActionButton; -import android.support.design.widget.TabLayout; -import android.support.v4.app.Fragment; -import android.support.v4.app.FragmentManager; -import android.support.v4.app.FragmentPagerAdapter; -import android.support.v4.view.ViewPager; -import android.support.v7.app.AppCompatActivity; +import androidx.appcompat.app.AppCompatActivity; +import androidx.fragment.app.Fragment; +import androidx.fragment.app.FragmentManager; +import androidx.fragment.app.FragmentPagerAdapter; +import androidx.viewpager.widget.ViewPager; import android.view.View; import android.widget.TextView; +import com.google.android.material.floatingactionbutton.FloatingActionButton; +import com.google.android.material.tabs.TabLayout; + import butterknife.BindView; import info.nightscout.androidaps.MainApp; import info.nightscout.androidaps.R; @@ -35,12 +36,7 @@ public class RileyLinkStatusActivity extends AppCompatActivity { @BindView(R.id.rls_t1_connection_error) TextView connectionError; RileyLinkServiceData rileyLinkServiceData; - /** - * The {@link android.support.v4.view.PagerAdapter} that will provide - * fragments for each of the sections. We use a {@link FragmentPagerAdapter} derivative, which will keep every - * loaded fragment in memory. If this becomes too memory intensive, it - * may be best to switch to a {@link android.support.v4.app.FragmentStatePagerAdapter}. - */ + private SectionsPagerAdapter mSectionsPagerAdapter; private FloatingActionButton floatingActionButton; private TabLayout tabLayout; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/dialog/RileyLinkStatusDevice.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/dialog/RileyLinkStatusDevice.java index 8234119f6a..226d7fc622 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/dialog/RileyLinkStatusDevice.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/dialog/RileyLinkStatusDevice.java @@ -5,7 +5,7 @@ import java.util.List; import java.util.Map; import android.os.Bundle; -import android.support.v4.app.Fragment; +import androidx.fragment.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/dialog/RileyLinkStatusGeneral.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/dialog/RileyLinkStatusGeneral.java index a3d1b34048..63bcb11958 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/dialog/RileyLinkStatusGeneral.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/dialog/RileyLinkStatusGeneral.java @@ -1,7 +1,7 @@ package info.nightscout.androidaps.plugins.pump.common.hw.rileylink.dialog; import android.os.Bundle; -import android.support.v4.app.Fragment; +import androidx.fragment.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/dialog/RileyLinkStatusHistory.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/dialog/RileyLinkStatusHistory.java index 82e6c15a9b..21d6153e5d 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/dialog/RileyLinkStatusHistory.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/dialog/RileyLinkStatusHistory.java @@ -4,9 +4,9 @@ import java.util.ArrayList; import java.util.List; import android.os.Bundle; -import android.support.v4.app.Fragment; -import android.support.v7.widget.LinearLayoutManager; -import android.support.v7.widget.RecyclerView; +import androidx.fragment.app.Fragment; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/RileyLinkBroadcastReceiver.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/RileyLinkBroadcastReceiver.java index 77896b854a..806fc4fbd8 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/RileyLinkBroadcastReceiver.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/RileyLinkBroadcastReceiver.java @@ -9,7 +9,7 @@ import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; -import android.support.v4.content.LocalBroadcastManager; +import androidx.localbroadcastmanager.content.LocalBroadcastManager; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/MedtronicPumpPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/MedtronicPumpPlugin.java index 62d77ed96d..7e71e17767 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/MedtronicPumpPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/MedtronicPumpPlugin.java @@ -6,7 +6,7 @@ import android.content.ServiceConnection; import android.os.Bundle; import android.os.IBinder; import android.os.SystemClock; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import org.joda.time.LocalDateTime; import org.slf4j.Logger; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/dialog/MedtronicHistoryActivity.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/dialog/MedtronicHistoryActivity.java index 957b3f599e..0a48cd934e 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/dialog/MedtronicHistoryActivity.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/dialog/MedtronicHistoryActivity.java @@ -11,8 +11,8 @@ import android.os.Bundle; import android.os.Handler; import android.os.HandlerThread; import android.os.SystemClock; -import android.support.v7.widget.LinearLayoutManager; -import android.support.v7.widget.RecyclerView; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/dialog/RileyLinkStatusDeviceMedtronic.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/dialog/RileyLinkStatusDeviceMedtronic.java index 6e72e97573..2d7252cb7c 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/dialog/RileyLinkStatusDeviceMedtronic.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/dialog/RileyLinkStatusDeviceMedtronic.java @@ -1,7 +1,7 @@ package info.nightscout.androidaps.plugins.pump.medtronic.dialog; import android.os.Bundle; -import android.support.v4.app.Fragment; +import androidx.fragment.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; diff --git a/app/src/main/res/layout/medtronic_history_activity.xml b/app/src/main/res/layout/medtronic_history_activity.xml index 6b079198bc..08c92aae6e 100644 --- a/app/src/main/res/layout/medtronic_history_activity.xml +++ b/app/src/main/res/layout/medtronic_history_activity.xml @@ -50,7 +50,7 @@ android:layout_gravity="center_horizontal" android:gravity="center_horizontal" /> - - - - - + android:layout_height="?attr/actionBarSize"> + - + - \ No newline at end of file + \ No newline at end of file diff --git a/app/src/main/res/layout/rileylink_status.xml b/app/src/main/res/layout/rileylink_status.xml index abd2feceb7..d3c22faa51 100644 --- a/app/src/main/res/layout/rileylink_status.xml +++ b/app/src/main/res/layout/rileylink_status.xml @@ -1,5 +1,5 @@ - - - - - + + - - - + diff --git a/app/src/main/res/layout/rileylink_status_device.xml b/app/src/main/res/layout/rileylink_status_device.xml index 4a567ffd72..7b156a0087 100644 --- a/app/src/main/res/layout/rileylink_status_device.xml +++ b/app/src/main/res/layout/rileylink_status_device.xml @@ -1,4 +1,4 @@ - - \ No newline at end of file + \ No newline at end of file diff --git a/app/src/main/res/layout/rileylink_status_general.xml b/app/src/main/res/layout/rileylink_status_general.xml index f9121a101f..3ec7aed6d1 100644 --- a/app/src/main/res/layout/rileylink_status_general.xml +++ b/app/src/main/res/layout/rileylink_status_general.xml @@ -1,4 +1,4 @@ - - \ No newline at end of file + \ No newline at end of file diff --git a/app/src/main/res/layout/rileylink_status_history.xml b/app/src/main/res/layout/rileylink_status_history.xml index 756b90e00c..2db98b2e25 100644 --- a/app/src/main/res/layout/rileylink_status_history.xml +++ b/app/src/main/res/layout/rileylink_status_history.xml @@ -1,4 +1,4 @@ - - - \ No newline at end of file + \ No newline at end of file