From 7faa34aa50d7deca20b344e23f6a136b30586501 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Wed, 17 May 2023 18:36:01 +0200 Subject: [PATCH] fix activities translation --- .../androidaps/activities/HistoryBrowseActivity.kt | 4 ++-- .../androidaps/activities/PreferencesActivity.kt | 6 ------ ...ctivity.kt => TranslatedDaggerAppCompatActivity.kt} | 2 +- .../configuration/activities/SingleFragmentActivity.kt | 6 ------ .../maintenance/activities/LogSettingActivity.kt | 4 ++-- .../maintenance/activities/PrefImportListActivity.kt | 10 ++-------- .../activities/SmsCommunicatorOtpActivity.kt | 4 ++-- .../activities/RequestDexcomPermissionActivity.kt | 4 ++-- .../plugins/sync/openhumans/ui/OHLoginActivity.kt | 6 +++--- .../pump/combov2/activities/ComboV2PairingActivity.kt | 4 ++-- .../pump/dana/activities/DanaHistoryActivity.kt | 4 ++-- .../pump/dana/activities/DanaUserOptionsActivity.kt | 4 ++-- .../pump/danars/activities/BLEScanActivity.kt | 4 ++-- .../pump/danars/activities/EnterPinActivity.kt | 4 ++-- .../pump/danars/activities/PairingHelperActivity.kt | 4 ++-- .../diaconn/activities/DiaconnG8BLEScanActivity.kt | 4 ++-- .../diaconn/activities/DiaconnG8HistoryActivity.kt | 4 ++-- .../diaconn/activities/DiaconnG8UserOptionsActivity.kt | 4 ++-- .../plugins/pump/eopatch/ui/AlarmHelperActivity.kt | 4 ++-- .../plugins/pump/eopatch/ui/DialogHelperActivity.kt | 4 ++-- .../plugins/pump/eopatch/ui/EoBaseActivity.kt | 7 ++++--- .../common/activity/OmnipodWizardActivityBase.kt | 4 ++-- .../pump/omnipod/dash/ui/DashPodHistoryActivity.kt | 4 ++-- .../pump/omnipod/dash/ui/DashPodManagementActivity.kt | 4 ++-- .../pump/omnipod/eros/ui/ErosPodManagementActivity.kt | 4 ++-- .../nightscout/pump/common/ui/PumpBLEConfigActivity.kt | 4 ++-- .../nightscout/pump/common/ui/PumpHistoryActivity.kt | 6 ++---- .../pump/common/dialog/RileyLinkBLEConfigActivity.kt | 4 ++-- .../hw/rileylink/dialog/RileyLinkStatusActivity.kt | 4 ++-- .../ui/activities/BolusProgressHelperActivity.kt | 4 ++-- .../nightscout/ui/activities/ErrorHelperActivity.kt | 6 +++--- .../nightscout/ui/activities/ProfileHelperActivity.kt | 4 ++-- .../ui/activities/QuickWizardListActivity.kt | 4 ++-- .../info/nightscout/ui/activities/StatsActivity.kt | 4 ++-- .../info/nightscout/ui/activities/SurveyActivity.kt | 4 ++-- .../info/nightscout/ui/activities/TDDStatsActivity.kt | 4 ++-- .../nightscout/ui/activities/TreatmentsActivity.kt | 4 ++-- .../info/nightscout/ui/alertDialogs/ErrorDialog.kt | 4 ++-- .../info/nightscout/ui/dialogs/BolusProgressDialog.kt | 6 +++--- 39 files changed, 78 insertions(+), 97 deletions(-) rename core/ui/src/main/java/info/nightscout/core/ui/activities/{DialogAppCompatActivity.kt => TranslatedDaggerAppCompatActivity.kt} (80%) diff --git a/app/src/main/java/info/nightscout/androidaps/activities/HistoryBrowseActivity.kt b/app/src/main/java/info/nightscout/androidaps/activities/HistoryBrowseActivity.kt index 6d6759b0e2..a22c9ba427 100644 --- a/app/src/main/java/info/nightscout/androidaps/activities/HistoryBrowseActivity.kt +++ b/app/src/main/java/info/nightscout/androidaps/activities/HistoryBrowseActivity.kt @@ -11,9 +11,9 @@ import android.widget.TextView import com.google.android.material.datepicker.MaterialDatePicker import com.jjoe64.graphview.GraphView import dagger.android.HasAndroidInjector -import dagger.android.support.DaggerAppCompatActivity import info.nightscout.androidaps.databinding.ActivityHistorybrowseBinding import info.nightscout.core.events.EventIobCalculationProgress +import info.nightscout.core.ui.activities.TranslatedDaggerAppCompatActivity import info.nightscout.core.utils.fabric.FabricPrivacy import info.nightscout.core.workflow.CalculationWorkflow import info.nightscout.interfaces.Config @@ -42,7 +42,7 @@ import java.util.GregorianCalendar import javax.inject.Inject import kotlin.math.min -class HistoryBrowseActivity : DaggerAppCompatActivity() { +class HistoryBrowseActivity : TranslatedDaggerAppCompatActivity() { @Inject lateinit var historyBrowserData: HistoryBrowserData @Inject lateinit var injector: HasAndroidInjector diff --git a/app/src/main/java/info/nightscout/androidaps/activities/PreferencesActivity.kt b/app/src/main/java/info/nightscout/androidaps/activities/PreferencesActivity.kt index 7d38e2b6b9..7ea1d46f61 100644 --- a/app/src/main/java/info/nightscout/androidaps/activities/PreferencesActivity.kt +++ b/app/src/main/java/info/nightscout/androidaps/activities/PreferencesActivity.kt @@ -1,6 +1,5 @@ package info.nightscout.androidaps.activities -import android.content.Context import android.os.Bundle import android.view.Menu import android.view.MenuItem @@ -10,7 +9,6 @@ import androidx.preference.PreferenceScreen import info.nightscout.androidaps.R import info.nightscout.androidaps.databinding.ActivityPreferencesBinding import info.nightscout.configuration.activities.DaggerAppCompatActivityWithResult -import info.nightscout.core.ui.locale.LocaleHelper class PreferencesActivity : DaggerAppCompatActivityWithResult(), PreferenceFragmentCompat.OnPreferenceStartScreenCallback { @@ -66,10 +64,6 @@ class PreferencesActivity : DaggerAppCompatActivityWithResult(), PreferenceFragm return true } - override fun attachBaseContext(newBase: Context) { - super.attachBaseContext(LocaleHelper.wrap(newBase)) - } - override fun onOptionsItemSelected(item: MenuItem): Boolean = when (item.itemId) { android.R.id.home -> { diff --git a/core/ui/src/main/java/info/nightscout/core/ui/activities/DialogAppCompatActivity.kt b/core/ui/src/main/java/info/nightscout/core/ui/activities/TranslatedDaggerAppCompatActivity.kt similarity index 80% rename from core/ui/src/main/java/info/nightscout/core/ui/activities/DialogAppCompatActivity.kt rename to core/ui/src/main/java/info/nightscout/core/ui/activities/TranslatedDaggerAppCompatActivity.kt index 1d52f7663c..75884c5a6f 100644 --- a/core/ui/src/main/java/info/nightscout/core/ui/activities/DialogAppCompatActivity.kt +++ b/core/ui/src/main/java/info/nightscout/core/ui/activities/TranslatedDaggerAppCompatActivity.kt @@ -4,7 +4,7 @@ import android.content.Context import dagger.android.support.DaggerAppCompatActivity import info.nightscout.core.ui.locale.LocaleHelper -open class DialogAppCompatActivity : DaggerAppCompatActivity() { +open class TranslatedDaggerAppCompatActivity : DaggerAppCompatActivity() { override fun attachBaseContext(newBase: Context) { super.attachBaseContext(LocaleHelper.wrap(newBase)) } diff --git a/plugins/configuration/src/main/java/info/nightscout/configuration/activities/SingleFragmentActivity.kt b/plugins/configuration/src/main/java/info/nightscout/configuration/activities/SingleFragmentActivity.kt index 5292f243cf..cab20ee2e1 100644 --- a/plugins/configuration/src/main/java/info/nightscout/configuration/activities/SingleFragmentActivity.kt +++ b/plugins/configuration/src/main/java/info/nightscout/configuration/activities/SingleFragmentActivity.kt @@ -1,12 +1,10 @@ package info.nightscout.configuration.activities -import android.content.Context import android.content.Intent import android.os.Bundle import android.view.Menu import android.view.MenuItem import info.nightscout.configuration.R -import info.nightscout.core.ui.locale.LocaleHelper import info.nightscout.interfaces.plugin.ActivePlugin import info.nightscout.interfaces.plugin.PluginBase import info.nightscout.interfaces.protection.ProtectionCheck @@ -60,8 +58,4 @@ class SingleFragmentActivity : DaggerAppCompatActivityWithResult() { if (plugin?.preferencesId != -1) menuInflater.inflate(R.menu.menu_single_fragment, menu) return super.onCreateOptionsMenu(menu) } - - override fun attachBaseContext(newBase: Context) { - super.attachBaseContext(LocaleHelper.wrap(newBase)) - } } \ No newline at end of file diff --git a/plugins/configuration/src/main/java/info/nightscout/configuration/maintenance/activities/LogSettingActivity.kt b/plugins/configuration/src/main/java/info/nightscout/configuration/maintenance/activities/LogSettingActivity.kt index 890dcff920..0c88ce6107 100644 --- a/plugins/configuration/src/main/java/info/nightscout/configuration/maintenance/activities/LogSettingActivity.kt +++ b/plugins/configuration/src/main/java/info/nightscout/configuration/maintenance/activities/LogSettingActivity.kt @@ -5,14 +5,14 @@ import android.view.View import android.widget.CheckBox import android.widget.LinearLayout import android.widget.TextView -import dagger.android.support.DaggerAppCompatActivity import info.nightscout.configuration.R import info.nightscout.configuration.databinding.ActivityLogsettingBinding +import info.nightscout.core.ui.activities.TranslatedDaggerAppCompatActivity import info.nightscout.rx.interfaces.L import info.nightscout.rx.interfaces.LogElement import javax.inject.Inject -class LogSettingActivity : DaggerAppCompatActivity() { +class LogSettingActivity : TranslatedDaggerAppCompatActivity() { @Inject lateinit var l: L diff --git a/plugins/configuration/src/main/java/info/nightscout/configuration/maintenance/activities/PrefImportListActivity.kt b/plugins/configuration/src/main/java/info/nightscout/configuration/maintenance/activities/PrefImportListActivity.kt index f3e3d25666..27ec178c8d 100644 --- a/plugins/configuration/src/main/java/info/nightscout/configuration/maintenance/activities/PrefImportListActivity.kt +++ b/plugins/configuration/src/main/java/info/nightscout/configuration/maintenance/activities/PrefImportListActivity.kt @@ -1,6 +1,5 @@ package info.nightscout.configuration.maintenance.activities -import android.content.Context import android.content.Intent import android.os.Bundle import android.view.LayoutInflater @@ -10,12 +9,11 @@ import android.view.ViewGroup import androidx.fragment.app.FragmentActivity import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView -import dagger.android.support.DaggerAppCompatActivity import info.nightscout.configuration.R import info.nightscout.configuration.databinding.MaintenanceImportListActivityBinding import info.nightscout.configuration.databinding.MaintenanceImportListItemBinding import info.nightscout.configuration.maintenance.PrefsFileContract -import info.nightscout.core.ui.locale.LocaleHelper +import info.nightscout.core.ui.activities.TranslatedDaggerAppCompatActivity import info.nightscout.interfaces.maintenance.PrefFileListProvider import info.nightscout.interfaces.maintenance.PrefsFile import info.nightscout.interfaces.maintenance.PrefsMetadataKey @@ -23,7 +21,7 @@ import info.nightscout.interfaces.maintenance.PrefsStatus import info.nightscout.shared.interfaces.ResourceHelper import javax.inject.Inject -class PrefImportListActivity : DaggerAppCompatActivity() { +class PrefImportListActivity : TranslatedDaggerAppCompatActivity() { @Inject lateinit var rh: ResourceHelper @Inject lateinit var prefFileListProvider: PrefFileListProvider @@ -116,8 +114,4 @@ class PrefImportListActivity : DaggerAppCompatActivity() { } return super.onOptionsItemSelected(item) } - - override fun attachBaseContext(newBase: Context) { - super.attachBaseContext(LocaleHelper.wrap(newBase)) - } } \ No newline at end of file diff --git a/plugins/main/src/main/java/info/nightscout/plugins/general/smsCommunicator/activities/SmsCommunicatorOtpActivity.kt b/plugins/main/src/main/java/info/nightscout/plugins/general/smsCommunicator/activities/SmsCommunicatorOtpActivity.kt index 18e444505a..f5d10cc7b4 100644 --- a/plugins/main/src/main/java/info/nightscout/plugins/general/smsCommunicator/activities/SmsCommunicatorOtpActivity.kt +++ b/plugins/main/src/main/java/info/nightscout/plugins/general/smsCommunicator/activities/SmsCommunicatorOtpActivity.kt @@ -12,7 +12,7 @@ import android.view.View import android.view.WindowManager import com.google.common.primitives.Ints.min import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel -import dagger.android.support.DaggerAppCompatActivity +import info.nightscout.core.ui.activities.TranslatedDaggerAppCompatActivity import info.nightscout.core.ui.dialogs.OKDialog import info.nightscout.core.ui.toast.ToastUtils import info.nightscout.core.utils.fabric.FabricPrivacy @@ -28,7 +28,7 @@ import info.nightscout.shared.interfaces.ResourceHelper import net.glxn.qrgen.android.QRCode import javax.inject.Inject -class SmsCommunicatorOtpActivity : DaggerAppCompatActivity() { +class SmsCommunicatorOtpActivity : TranslatedDaggerAppCompatActivity() { @Inject lateinit var fabricPrivacy: FabricPrivacy @Inject lateinit var smsCommunicator: SmsCommunicator diff --git a/plugins/source/src/main/java/info/nightscout/source/activities/RequestDexcomPermissionActivity.kt b/plugins/source/src/main/java/info/nightscout/source/activities/RequestDexcomPermissionActivity.kt index 142601e644..5a6ef6242c 100644 --- a/plugins/source/src/main/java/info/nightscout/source/activities/RequestDexcomPermissionActivity.kt +++ b/plugins/source/src/main/java/info/nightscout/source/activities/RequestDexcomPermissionActivity.kt @@ -1,10 +1,10 @@ package info.nightscout.source.activities import android.os.Bundle -import info.nightscout.core.ui.activities.DialogAppCompatActivity +import info.nightscout.core.ui.activities.TranslatedDaggerAppCompatActivity import info.nightscout.source.DexcomPlugin -class RequestDexcomPermissionActivity : DialogAppCompatActivity() { +class RequestDexcomPermissionActivity : TranslatedDaggerAppCompatActivity() { private val requestCode = "AndroidAPS <3".map { it.code }.sum() diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/openhumans/ui/OHLoginActivity.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/openhumans/ui/OHLoginActivity.kt index 243200311d..1dc79a3912 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/openhumans/ui/OHLoginActivity.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/openhumans/ui/OHLoginActivity.kt @@ -15,13 +15,13 @@ import androidx.core.view.updatePadding import androidx.core.widget.NestedScrollView import com.google.android.material.appbar.MaterialToolbar import com.google.android.material.button.MaterialButton -import dagger.android.support.DaggerAppCompatActivity +import info.nightscout.core.ui.activities.TranslatedDaggerAppCompatActivity +import info.nightscout.plugins.sync.R import info.nightscout.plugins.sync.di.AuthUrl import info.nightscout.plugins.sync.di.ViewModelFactory -import info.nightscout.plugins.sync.R import javax.inject.Inject -class OHLoginActivity : DaggerAppCompatActivity() { +class OHLoginActivity : TranslatedDaggerAppCompatActivity() { @Inject internal lateinit var viewModelFactory: ViewModelFactory diff --git a/pump/combov2/src/main/kotlin/info/nightscout/pump/combov2/activities/ComboV2PairingActivity.kt b/pump/combov2/src/main/kotlin/info/nightscout/pump/combov2/activities/ComboV2PairingActivity.kt index f59418206d..8ecbda0c7a 100644 --- a/pump/combov2/src/main/kotlin/info/nightscout/pump/combov2/activities/ComboV2PairingActivity.kt +++ b/pump/combov2/src/main/kotlin/info/nightscout/pump/combov2/activities/ComboV2PairingActivity.kt @@ -16,9 +16,9 @@ import androidx.databinding.DataBindingUtil import androidx.lifecycle.Lifecycle import androidx.lifecycle.lifecycleScope import androidx.lifecycle.repeatOnLifecycle -import dagger.android.support.DaggerAppCompatActivity import info.nightscout.comboctl.base.BasicProgressStage import info.nightscout.comboctl.base.PairingPIN +import info.nightscout.core.ui.activities.TranslatedDaggerAppCompatActivity import info.nightscout.core.ui.dialogs.OKDialog import info.nightscout.pump.combov2.ComboV2Plugin import info.nightscout.pump.combov2.R @@ -72,7 +72,7 @@ private class BluetoothPermissionChecks( } } -class ComboV2PairingActivity : DaggerAppCompatActivity() { +class ComboV2PairingActivity : TranslatedDaggerAppCompatActivity() { @Inject lateinit var aapsLogger: AAPSLogger @Inject lateinit var rh: ResourceHelper diff --git a/pump/dana/src/main/java/info/nightscout/pump/dana/activities/DanaHistoryActivity.kt b/pump/dana/src/main/java/info/nightscout/pump/dana/activities/DanaHistoryActivity.kt index 8b1f74ab7d..5a83da3269 100644 --- a/pump/dana/src/main/java/info/nightscout/pump/dana/activities/DanaHistoryActivity.kt +++ b/pump/dana/src/main/java/info/nightscout/pump/dana/activities/DanaHistoryActivity.kt @@ -8,7 +8,7 @@ import android.widget.AdapterView import android.widget.ArrayAdapter import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView -import dagger.android.support.DaggerAppCompatActivity +import info.nightscout.core.ui.activities.TranslatedDaggerAppCompatActivity import info.nightscout.core.utils.fabric.FabricPrivacy import info.nightscout.interfaces.Constants import info.nightscout.interfaces.plugin.ActivePlugin @@ -37,7 +37,7 @@ import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject -class DanaHistoryActivity : DaggerAppCompatActivity() { +class DanaHistoryActivity : TranslatedDaggerAppCompatActivity() { @Inject lateinit var rxBus: RxBus @Inject lateinit var rh: ResourceHelper diff --git a/pump/dana/src/main/java/info/nightscout/pump/dana/activities/DanaUserOptionsActivity.kt b/pump/dana/src/main/java/info/nightscout/pump/dana/activities/DanaUserOptionsActivity.kt index ca1ef081e4..66211cb83b 100644 --- a/pump/dana/src/main/java/info/nightscout/pump/dana/activities/DanaUserOptionsActivity.kt +++ b/pump/dana/src/main/java/info/nightscout/pump/dana/activities/DanaUserOptionsActivity.kt @@ -2,7 +2,7 @@ package info.nightscout.pump.dana.activities import android.content.Context import android.os.Bundle -import dagger.android.support.DaggerAppCompatActivity +import info.nightscout.core.ui.activities.TranslatedDaggerAppCompatActivity import info.nightscout.core.utils.fabric.FabricPrivacy import info.nightscout.interfaces.Constants import info.nightscout.interfaces.plugin.ActivePlugin @@ -26,7 +26,7 @@ import javax.inject.Inject import kotlin.math.max import kotlin.math.min -class DanaUserOptionsActivity : DaggerAppCompatActivity() { +class DanaUserOptionsActivity : TranslatedDaggerAppCompatActivity() { @Inject lateinit var rxBus: RxBus @Inject lateinit var aapsLogger: AAPSLogger diff --git a/pump/danars/src/main/java/info/nightscout/pump/danars/activities/BLEScanActivity.kt b/pump/danars/src/main/java/info/nightscout/pump/danars/activities/BLEScanActivity.kt index a9dfbb5085..e4292a17f3 100644 --- a/pump/danars/src/main/java/info/nightscout/pump/danars/activities/BLEScanActivity.kt +++ b/pump/danars/src/main/java/info/nightscout/pump/danars/activities/BLEScanActivity.kt @@ -20,7 +20,7 @@ import android.view.ViewGroup import android.widget.BaseAdapter import android.widget.TextView import androidx.core.app.ActivityCompat -import dagger.android.support.DaggerAppCompatActivity +import info.nightscout.core.ui.activities.TranslatedDaggerAppCompatActivity import info.nightscout.core.ui.toast.ToastUtils import info.nightscout.core.utils.extensions.safeEnable import info.nightscout.interfaces.pump.BlePreCheck @@ -32,7 +32,7 @@ import info.nightscout.shared.sharedPreferences.SP import java.util.regex.Pattern import javax.inject.Inject -class BLEScanActivity : DaggerAppCompatActivity() { +class BLEScanActivity : TranslatedDaggerAppCompatActivity() { @Inject lateinit var sp: SP @Inject lateinit var blePreCheck: BlePreCheck diff --git a/pump/danars/src/main/java/info/nightscout/pump/danars/activities/EnterPinActivity.kt b/pump/danars/src/main/java/info/nightscout/pump/danars/activities/EnterPinActivity.kt index 125cc74ef5..d642dc5f58 100644 --- a/pump/danars/src/main/java/info/nightscout/pump/danars/activities/EnterPinActivity.kt +++ b/pump/danars/src/main/java/info/nightscout/pump/danars/activities/EnterPinActivity.kt @@ -2,7 +2,7 @@ package info.nightscout.pump.danars.activities import android.os.Bundle import android.util.Base64 -import dagger.android.support.DaggerAppCompatActivity +import info.nightscout.core.ui.activities.TranslatedDaggerAppCompatActivity import info.nightscout.core.ui.dialogs.OKDialog import info.nightscout.core.utils.fabric.FabricPrivacy import info.nightscout.core.utils.hexStringToByteArray @@ -21,7 +21,7 @@ import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject import kotlin.experimental.xor -class EnterPinActivity : DaggerAppCompatActivity() { +class EnterPinActivity : TranslatedDaggerAppCompatActivity() { @Inject lateinit var fabricPrivacy: FabricPrivacy @Inject lateinit var danaRSPlugin: DanaRSPlugin diff --git a/pump/danars/src/main/java/info/nightscout/pump/danars/activities/PairingHelperActivity.kt b/pump/danars/src/main/java/info/nightscout/pump/danars/activities/PairingHelperActivity.kt index c5bed29d63..f8fb960f45 100644 --- a/pump/danars/src/main/java/info/nightscout/pump/danars/activities/PairingHelperActivity.kt +++ b/pump/danars/src/main/java/info/nightscout/pump/danars/activities/PairingHelperActivity.kt @@ -4,10 +4,10 @@ import android.annotation.SuppressLint import android.content.Intent import android.content.pm.ActivityInfo import android.os.Bundle -import dagger.android.support.DaggerAppCompatActivity +import info.nightscout.core.ui.activities.TranslatedDaggerAppCompatActivity import info.nightscout.pump.danars.dialogs.PairingProgressDialog -class PairingHelperActivity : DaggerAppCompatActivity() { +class PairingHelperActivity : TranslatedDaggerAppCompatActivity() { var dialog: PairingProgressDialog? = null diff --git a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/activities/DiaconnG8BLEScanActivity.kt b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/activities/DiaconnG8BLEScanActivity.kt index 0a38bcac2e..4e9b63f519 100644 --- a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/activities/DiaconnG8BLEScanActivity.kt +++ b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/activities/DiaconnG8BLEScanActivity.kt @@ -23,7 +23,7 @@ import android.view.ViewGroup import android.widget.BaseAdapter import android.widget.TextView import androidx.core.app.ActivityCompat -import dagger.android.support.DaggerAppCompatActivity +import info.nightscout.core.ui.activities.TranslatedDaggerAppCompatActivity import info.nightscout.core.ui.toast.ToastUtils import info.nightscout.core.utils.extensions.safeEnable import info.nightscout.interfaces.pump.BlePreCheck @@ -35,7 +35,7 @@ import info.nightscout.shared.sharedPreferences.SP import java.util.UUID import javax.inject.Inject -class DiaconnG8BLEScanActivity : DaggerAppCompatActivity() { +class DiaconnG8BLEScanActivity : TranslatedDaggerAppCompatActivity() { @Inject lateinit var sp: SP @Inject lateinit var blePreCheck: BlePreCheck diff --git a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/activities/DiaconnG8HistoryActivity.kt b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/activities/DiaconnG8HistoryActivity.kt index a32f3d046f..0f65009a4c 100644 --- a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/activities/DiaconnG8HistoryActivity.kt +++ b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/activities/DiaconnG8HistoryActivity.kt @@ -9,7 +9,7 @@ import android.widget.ArrayAdapter import android.widget.TextView import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView -import dagger.android.support.DaggerAppCompatActivity +import info.nightscout.core.ui.activities.TranslatedDaggerAppCompatActivity import info.nightscout.core.utils.fabric.FabricPrivacy import info.nightscout.interfaces.plugin.ActivePlugin import info.nightscout.interfaces.profile.ProfileFunction @@ -31,7 +31,7 @@ import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject -class DiaconnG8HistoryActivity : DaggerAppCompatActivity() { +class DiaconnG8HistoryActivity : TranslatedDaggerAppCompatActivity() { @Inject lateinit var profileFunction: ProfileFunction @Inject lateinit var fabricPrivacy: FabricPrivacy diff --git a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/activities/DiaconnG8UserOptionsActivity.kt b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/activities/DiaconnG8UserOptionsActivity.kt index c75ae8484b..89457c0e1d 100644 --- a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/activities/DiaconnG8UserOptionsActivity.kt +++ b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/activities/DiaconnG8UserOptionsActivity.kt @@ -5,7 +5,7 @@ import android.os.Bundle import android.view.View import android.widget.AdapterView import android.widget.ArrayAdapter -import dagger.android.support.DaggerAppCompatActivity +import info.nightscout.core.ui.activities.TranslatedDaggerAppCompatActivity import info.nightscout.core.ui.toast.ToastUtils import info.nightscout.core.utils.fabric.FabricPrivacy import info.nightscout.interfaces.plugin.ActivePlugin @@ -23,7 +23,7 @@ import io.reactivex.rxjava3.disposables.CompositeDisposable import java.text.DecimalFormat import javax.inject.Inject -class DiaconnG8UserOptionsActivity : DaggerAppCompatActivity() { +class DiaconnG8UserOptionsActivity : TranslatedDaggerAppCompatActivity() { @Inject lateinit var fabricPrivacy: FabricPrivacy @Inject lateinit var context: Context diff --git a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ui/AlarmHelperActivity.kt b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ui/AlarmHelperActivity.kt index fb45db03bd..f459b3e28a 100644 --- a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ui/AlarmHelperActivity.kt +++ b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ui/AlarmHelperActivity.kt @@ -8,14 +8,14 @@ import info.nightscout.androidaps.plugins.pump.eopatch.event.EventProgressDialog import info.nightscout.androidaps.plugins.pump.eopatch.ui.dialogs.AlarmDialog import info.nightscout.androidaps.plugins.pump.eopatch.ui.dialogs.ProgressDialogHelper import info.nightscout.core.ui.R -import info.nightscout.core.ui.activities.DialogAppCompatActivity +import info.nightscout.core.ui.activities.TranslatedDaggerAppCompatActivity import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus import info.nightscout.shared.sharedPreferences.SP import io.reactivex.rxjava3.disposables.CompositeDisposable import javax.inject.Inject -class AlarmHelperActivity : DialogAppCompatActivity() { +class AlarmHelperActivity : TranslatedDaggerAppCompatActivity() { @Inject lateinit var sp : SP @Inject lateinit var rxBus: RxBus @Inject lateinit var aapsSchedulers: AapsSchedulers diff --git a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ui/DialogHelperActivity.kt b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ui/DialogHelperActivity.kt index 59e86714e2..ad8b16b73d 100644 --- a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ui/DialogHelperActivity.kt +++ b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ui/DialogHelperActivity.kt @@ -3,9 +3,9 @@ package info.nightscout.androidaps.plugins.pump.eopatch.ui import android.os.Bundle import info.nightscout.androidaps.plugins.pump.eopatch.ui.dialogs.ActivationNotCompleteDialog import info.nightscout.core.ui.R -import info.nightscout.core.ui.activities.DialogAppCompatActivity +import info.nightscout.core.ui.activities.TranslatedDaggerAppCompatActivity -class DialogHelperActivity : DialogAppCompatActivity() { +class DialogHelperActivity : TranslatedDaggerAppCompatActivity() { @Override override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) diff --git a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ui/EoBaseActivity.kt b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ui/EoBaseActivity.kt index fda4c8a6a6..8602ef800e 100644 --- a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ui/EoBaseActivity.kt +++ b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ui/EoBaseActivity.kt @@ -7,14 +7,15 @@ import androidx.annotation.LayoutRes import androidx.databinding.DataBindingUtil import androidx.databinding.ViewDataBinding import androidx.lifecycle.ViewModelProvider -import dagger.android.support.DaggerAppCompatActivity import info.nightscout.androidaps.plugins.pump.eopatch.dagger.EopatchPluginQualifier import info.nightscout.core.ui.R +import info.nightscout.core.ui.activities.TranslatedDaggerAppCompatActivity import info.nightscout.rx.AapsSchedulers import io.reactivex.rxjava3.disposables.CompositeDisposable import javax.inject.Inject -abstract class EoBaseActivity : DaggerAppCompatActivity(), EoBaseNavigator { +abstract class EoBaseActivity : TranslatedDaggerAppCompatActivity(), EoBaseNavigator { + @Inject @EopatchPluginQualifier lateinit var viewModelFactory: ViewModelProvider.Factory @@ -48,7 +49,7 @@ abstract class EoBaseActivity : DaggerAppCompatActivity(), } override fun finish(finishAffinity: Boolean) { - if(finishAffinity) { + if (finishAffinity) { finishAffinity() } else { finish() diff --git a/pump/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/common/activity/OmnipodWizardActivityBase.kt b/pump/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/common/activity/OmnipodWizardActivityBase.kt index a2c2e768ae..7b56898a59 100644 --- a/pump/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/common/activity/OmnipodWizardActivityBase.kt +++ b/pump/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/common/activity/OmnipodWizardActivityBase.kt @@ -3,10 +3,10 @@ package info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.common. import androidx.appcompat.app.AlertDialog import androidx.navigation.NavController import androidx.navigation.fragment.NavHostFragment -import dagger.android.support.DaggerAppCompatActivity import info.nightscout.androidaps.plugins.pump.omnipod.common.R +import info.nightscout.core.ui.activities.TranslatedDaggerAppCompatActivity -abstract class OmnipodWizardActivityBase : DaggerAppCompatActivity() { +abstract class OmnipodWizardActivityBase : TranslatedDaggerAppCompatActivity() { override fun onBackPressed() = exitActivityAfterConfirmation() diff --git a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/DashPodHistoryActivity.kt b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/DashPodHistoryActivity.kt index 9328ac9e71..ef0d74e33d 100644 --- a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/DashPodHistoryActivity.kt +++ b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/DashPodHistoryActivity.kt @@ -11,7 +11,6 @@ import android.widget.Spinner import android.widget.TextView import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView -import dagger.android.support.DaggerAppCompatActivity import info.nightscout.androidaps.plugins.pump.omnipod.common.definition.OmnipodCommandType import info.nightscout.androidaps.plugins.pump.omnipod.dash.R import info.nightscout.androidaps.plugins.pump.omnipod.dash.history.DashHistory @@ -21,6 +20,7 @@ import info.nightscout.androidaps.plugins.pump.omnipod.dash.history.data.History import info.nightscout.androidaps.plugins.pump.omnipod.dash.history.data.InitialResult import info.nightscout.androidaps.plugins.pump.omnipod.dash.history.data.ResolvedResult import info.nightscout.androidaps.plugins.pump.omnipod.dash.history.data.TempBasalRecord +import info.nightscout.core.ui.activities.TranslatedDaggerAppCompatActivity import info.nightscout.core.utils.DateTimeUtil import info.nightscout.interfaces.pump.defs.PumpType import info.nightscout.pump.common.defs.PumpHistoryEntryGroup @@ -33,7 +33,7 @@ import java.util.Calendar import java.util.GregorianCalendar import javax.inject.Inject -class DashPodHistoryActivity : DaggerAppCompatActivity() { +class DashPodHistoryActivity : TranslatedDaggerAppCompatActivity() { @Inject lateinit var dashHistory: DashHistory @Inject lateinit var aapsSchedulers: AapsSchedulers diff --git a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/DashPodManagementActivity.kt b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/DashPodManagementActivity.kt index 34fd85af45..36f4306b0a 100644 --- a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/DashPodManagementActivity.kt +++ b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/DashPodManagementActivity.kt @@ -4,7 +4,6 @@ import android.content.Context import android.content.Intent import android.os.Bundle import dagger.android.HasAndroidInjector -import dagger.android.support.DaggerAppCompatActivity import info.nightscout.androidaps.plugins.pump.omnipod.common.queue.command.CommandPlayTestBeep import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.activation.PodActivationWizardActivity import info.nightscout.androidaps.plugins.pump.omnipod.dash.databinding.OmnipodDashPodManagementBinding @@ -12,6 +11,7 @@ import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.definitio import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.state.OmnipodDashPodStateManager import info.nightscout.androidaps.plugins.pump.omnipod.dash.ui.wizard.activation.DashPodActivationWizardActivity import info.nightscout.androidaps.plugins.pump.omnipod.dash.ui.wizard.deactivation.DashPodDeactivationWizardActivity +import info.nightscout.core.ui.activities.TranslatedDaggerAppCompatActivity import info.nightscout.core.ui.dialogs.OKDialog import info.nightscout.core.utils.fabric.FabricPrivacy import info.nightscout.interfaces.queue.Callback @@ -26,7 +26,7 @@ import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject -class DashPodManagementActivity : DaggerAppCompatActivity() { +class DashPodManagementActivity : TranslatedDaggerAppCompatActivity() { @Inject lateinit var fabricPrivacy: FabricPrivacy @Inject lateinit var commandQueue: CommandQueue diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/ErosPodManagementActivity.kt b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/ErosPodManagementActivity.kt index 30470298e0..ea2aea4bf2 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/ErosPodManagementActivity.kt +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/ErosPodManagementActivity.kt @@ -6,7 +6,6 @@ import android.os.Bundle import android.os.Handler import android.os.HandlerThread import dagger.android.HasAndroidInjector -import dagger.android.support.DaggerAppCompatActivity import info.nightscout.androidaps.plugins.pump.common.events.EventRileyLinkDeviceStatusChange import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.dialog.RileyLinkStatusActivity import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.RileyLinkServiceData @@ -24,6 +23,7 @@ import info.nightscout.androidaps.plugins.pump.omnipod.eros.manager.AapsOmnipodE import info.nightscout.androidaps.plugins.pump.omnipod.eros.queue.command.CommandReadPulseLog import info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.activation.ErosPodActivationWizardActivity import info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.deactivation.ErosPodDeactivationWizardActivity +import info.nightscout.core.ui.activities.TranslatedDaggerAppCompatActivity import info.nightscout.core.ui.dialogs.OKDialog import info.nightscout.core.utils.fabric.FabricPrivacy import info.nightscout.interfaces.Config @@ -42,7 +42,7 @@ import javax.inject.Inject /** * Created by andy on 30/08/2019 */ -class ErosPodManagementActivity : DaggerAppCompatActivity() { +class ErosPodManagementActivity : TranslatedDaggerAppCompatActivity() { @Inject lateinit var fabricPrivacy: FabricPrivacy @Inject lateinit var commandQueue: CommandQueue diff --git a/pump/pump-common/src/main/java/info/nightscout/pump/common/ui/PumpBLEConfigActivity.kt b/pump/pump-common/src/main/java/info/nightscout/pump/common/ui/PumpBLEConfigActivity.kt index 52ac11c8d1..68c6f30eed 100644 --- a/pump/pump-common/src/main/java/info/nightscout/pump/common/ui/PumpBLEConfigActivity.kt +++ b/pump/pump-common/src/main/java/info/nightscout/pump/common/ui/PumpBLEConfigActivity.kt @@ -20,7 +20,7 @@ import android.widget.AdapterView import android.widget.AdapterView.OnItemClickListener import android.widget.BaseAdapter import android.widget.TextView -import dagger.android.support.DaggerAppCompatActivity +import info.nightscout.core.ui.activities.TranslatedDaggerAppCompatActivity import info.nightscout.core.ui.dialogs.OKDialog import info.nightscout.interfaces.plugin.ActivePlugin import info.nightscout.interfaces.pump.BlePreCheck @@ -37,7 +37,7 @@ import org.apache.commons.lang3.StringUtils import javax.inject.Inject @SuppressLint("MissingPermission") -class PumpBLEConfigActivity : DaggerAppCompatActivity() { +class PumpBLEConfigActivity : TranslatedDaggerAppCompatActivity() { @Inject lateinit var activePlugin: ActivePlugin @Inject lateinit var sp: SP diff --git a/pump/pump-common/src/main/java/info/nightscout/pump/common/ui/PumpHistoryActivity.kt b/pump/pump-common/src/main/java/info/nightscout/pump/common/ui/PumpHistoryActivity.kt index b61693aba3..ab4f66d5cc 100644 --- a/pump/pump-common/src/main/java/info/nightscout/pump/common/ui/PumpHistoryActivity.kt +++ b/pump/pump-common/src/main/java/info/nightscout/pump/common/ui/PumpHistoryActivity.kt @@ -11,7 +11,7 @@ import android.widget.ArrayAdapter import android.widget.TextView import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView -import dagger.android.support.DaggerAppCompatActivity +import info.nightscout.core.ui.activities.TranslatedDaggerAppCompatActivity import info.nightscout.interfaces.plugin.ActivePlugin import info.nightscout.pump.common.R import info.nightscout.pump.common.databinding.PumpHistoryActivityBinding @@ -22,12 +22,10 @@ import info.nightscout.pump.common.driver.history.PumpHistoryEntry import info.nightscout.pump.common.driver.history.PumpHistoryText import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag -import info.nightscout.shared.interfaces.ResourceHelper import javax.inject.Inject -class PumpHistoryActivity : DaggerAppCompatActivity() { +class PumpHistoryActivity : TranslatedDaggerAppCompatActivity() { - @Inject lateinit var resourceHelper: ResourceHelper @Inject lateinit var aapsLogger: AAPSLogger @Inject lateinit var activePlugin: ActivePlugin @Inject lateinit var context: Context diff --git a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/dialog/RileyLinkBLEConfigActivity.kt b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/dialog/RileyLinkBLEConfigActivity.kt index ca61cee722..a9d0e976b3 100644 --- a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/dialog/RileyLinkBLEConfigActivity.kt +++ b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/dialog/RileyLinkBLEConfigActivity.kt @@ -26,13 +26,13 @@ import android.widget.BaseAdapter import android.widget.TextView import android.widget.Toast import androidx.core.app.ActivityCompat -import dagger.android.support.DaggerAppCompatActivity import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.R 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.common.hw.rileylink.ble.data.GattAttributes import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.databinding.RileyLinkBleConfigActivityBinding import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkPumpDevice +import info.nightscout.core.ui.activities.TranslatedDaggerAppCompatActivity import info.nightscout.core.ui.dialogs.OKDialog import info.nightscout.interfaces.plugin.ActivePlugin import info.nightscout.interfaces.pump.BlePreCheck @@ -45,7 +45,7 @@ import java.util.Locale import javax.inject.Inject // IMPORTANT: This activity needs to be called from RileyLinkSelectPreference (see pref_medtronic.xml as example) -class RileyLinkBLEConfigActivity : DaggerAppCompatActivity() { +class RileyLinkBLEConfigActivity : TranslatedDaggerAppCompatActivity() { @Inject lateinit var sp: SP @Inject lateinit var blePreCheck: BlePreCheck diff --git a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/dialog/RileyLinkStatusActivity.kt b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/dialog/RileyLinkStatusActivity.kt index 010a61f0ce..2fd7f8c177 100644 --- a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/dialog/RileyLinkStatusActivity.kt +++ b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/dialog/RileyLinkStatusActivity.kt @@ -5,13 +5,13 @@ import androidx.appcompat.app.AppCompatActivity import androidx.fragment.app.Fragment import androidx.viewpager2.adapter.FragmentStateAdapter import com.google.android.material.tabs.TabLayoutMediator -import dagger.android.support.DaggerAppCompatActivity import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.R import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.databinding.RileylinkStatusBinding +import info.nightscout.core.ui.activities.TranslatedDaggerAppCompatActivity import info.nightscout.shared.interfaces.ResourceHelper import javax.inject.Inject -class RileyLinkStatusActivity : DaggerAppCompatActivity() { +class RileyLinkStatusActivity : TranslatedDaggerAppCompatActivity() { @Inject lateinit var rh: ResourceHelper diff --git a/ui/src/main/java/info/nightscout/ui/activities/BolusProgressHelperActivity.kt b/ui/src/main/java/info/nightscout/ui/activities/BolusProgressHelperActivity.kt index bc717782e5..440ec2cde6 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/BolusProgressHelperActivity.kt +++ b/ui/src/main/java/info/nightscout/ui/activities/BolusProgressHelperActivity.kt @@ -1,10 +1,10 @@ package info.nightscout.ui.activities import android.os.Bundle -import info.nightscout.core.ui.activities.DialogAppCompatActivity +import info.nightscout.core.ui.activities.TranslatedDaggerAppCompatActivity import info.nightscout.ui.dialogs.BolusProgressDialog -class BolusProgressHelperActivity : DialogAppCompatActivity() { +class BolusProgressHelperActivity : TranslatedDaggerAppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) BolusProgressDialog() diff --git a/ui/src/main/java/info/nightscout/ui/activities/ErrorHelperActivity.kt b/ui/src/main/java/info/nightscout/ui/activities/ErrorHelperActivity.kt index f3339c054d..52b02afd58 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/ErrorHelperActivity.kt +++ b/ui/src/main/java/info/nightscout/ui/activities/ErrorHelperActivity.kt @@ -1,17 +1,17 @@ package info.nightscout.ui.activities import android.os.Bundle -import info.nightscout.ui.services.AlarmSoundService -import info.nightscout.core.ui.activities.DialogAppCompatActivity +import info.nightscout.core.ui.activities.TranslatedDaggerAppCompatActivity import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.InsertTherapyEventAnnouncementTransaction import info.nightscout.shared.sharedPreferences.SP import info.nightscout.ui.alertDialogs.ErrorDialog +import info.nightscout.ui.services.AlarmSoundService import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject -class ErrorHelperActivity : DialogAppCompatActivity() { +class ErrorHelperActivity : TranslatedDaggerAppCompatActivity() { @Inject lateinit var sp: SP @Inject lateinit var repository: AppRepository diff --git a/ui/src/main/java/info/nightscout/ui/activities/ProfileHelperActivity.kt b/ui/src/main/java/info/nightscout/ui/activities/ProfileHelperActivity.kt index fefe7c2b37..e62d55bcc0 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/ProfileHelperActivity.kt +++ b/ui/src/main/java/info/nightscout/ui/activities/ProfileHelperActivity.kt @@ -8,8 +8,8 @@ import android.widget.ArrayAdapter import android.widget.TextView import com.google.android.material.tabs.TabLayout import com.google.common.collect.Lists -import dagger.android.support.DaggerAppCompatActivity import info.nightscout.core.profile.ProfileSealed +import info.nightscout.core.ui.activities.TranslatedDaggerAppCompatActivity import info.nightscout.core.ui.dialogs.OKDialog import info.nightscout.core.ui.toast.ToastUtils import info.nightscout.core.utils.fabric.FabricPrivacy @@ -38,7 +38,7 @@ import io.reactivex.rxjava3.kotlin.plusAssign import java.text.DecimalFormat import javax.inject.Inject -class ProfileHelperActivity : DaggerAppCompatActivity() { +class ProfileHelperActivity : TranslatedDaggerAppCompatActivity() { @Inject lateinit var tddCalculator: TddCalculator @Inject lateinit var profileFunction: ProfileFunction diff --git a/ui/src/main/java/info/nightscout/ui/activities/QuickWizardListActivity.kt b/ui/src/main/java/info/nightscout/ui/activities/QuickWizardListActivity.kt index 3d36002f44..ea69943ad6 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/QuickWizardListActivity.kt +++ b/ui/src/main/java/info/nightscout/ui/activities/QuickWizardListActivity.kt @@ -14,7 +14,7 @@ import androidx.fragment.app.FragmentManager import androidx.recyclerview.widget.ItemTouchHelper import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView -import dagger.android.support.DaggerAppCompatActivity +import info.nightscout.core.ui.activities.TranslatedDaggerAppCompatActivity import info.nightscout.core.ui.dialogs.OKDialog import info.nightscout.core.utils.ActionModeHelper import info.nightscout.core.utils.fabric.FabricPrivacy @@ -38,7 +38,7 @@ import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject -class QuickWizardListActivity : DaggerAppCompatActivity(), OnStartDragListener { +class QuickWizardListActivity : TranslatedDaggerAppCompatActivity(), OnStartDragListener { @Inject lateinit var aapsSchedulers: AapsSchedulers @Inject lateinit var rxBus: RxBus diff --git a/ui/src/main/java/info/nightscout/ui/activities/StatsActivity.kt b/ui/src/main/java/info/nightscout/ui/activities/StatsActivity.kt index 2fec1569ba..d26af93367 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/StatsActivity.kt +++ b/ui/src/main/java/info/nightscout/ui/activities/StatsActivity.kt @@ -5,7 +5,7 @@ import android.os.Bundle import android.os.Handler import android.os.HandlerThread import android.widget.TextView -import dagger.android.support.DaggerAppCompatActivity +import info.nightscout.core.ui.activities.TranslatedDaggerAppCompatActivity import info.nightscout.core.ui.dialogs.OKDialog import info.nightscout.core.utils.fabric.FabricPrivacy import info.nightscout.database.entities.UserEntry.Action @@ -25,7 +25,7 @@ import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject -class StatsActivity : DaggerAppCompatActivity() { +class StatsActivity : TranslatedDaggerAppCompatActivity() { @Inject lateinit var tddCalculator: TddCalculator @Inject lateinit var tirCalculator: TirCalculator diff --git a/ui/src/main/java/info/nightscout/ui/activities/SurveyActivity.kt b/ui/src/main/java/info/nightscout/ui/activities/SurveyActivity.kt index ea0937e7f2..ecde272124 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/SurveyActivity.kt +++ b/ui/src/main/java/info/nightscout/ui/activities/SurveyActivity.kt @@ -2,7 +2,7 @@ package info.nightscout.ui.activities import android.os.Bundle import android.widget.ArrayAdapter -import dagger.android.support.DaggerAppCompatActivity +import info.nightscout.core.ui.activities.TranslatedDaggerAppCompatActivity import info.nightscout.core.ui.toast.ToastUtils import info.nightscout.core.utils.fabric.InstanceId import info.nightscout.interfaces.plugin.ActivePlugin @@ -15,7 +15,7 @@ import info.nightscout.ui.databinding.ActivitySurveyBinding import info.nightscout.ui.defaultProfile.DefaultProfile import javax.inject.Inject -class SurveyActivity : DaggerAppCompatActivity() { +class SurveyActivity : TranslatedDaggerAppCompatActivity() { @Inject lateinit var activePlugin: ActivePlugin @Inject lateinit var profileFunction: ProfileFunction diff --git a/ui/src/main/java/info/nightscout/ui/activities/TDDStatsActivity.kt b/ui/src/main/java/info/nightscout/ui/activities/TDDStatsActivity.kt index d9686deaa3..be1b982d94 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/TDDStatsActivity.kt +++ b/ui/src/main/java/info/nightscout/ui/activities/TDDStatsActivity.kt @@ -14,7 +14,7 @@ import android.widget.EditText import android.widget.TableLayout import android.widget.TableRow import android.widget.TextView -import dagger.android.support.DaggerAppCompatActivity +import info.nightscout.core.ui.activities.TranslatedDaggerAppCompatActivity import info.nightscout.core.utils.fabric.FabricPrivacy import info.nightscout.database.entities.TotalDailyDose import info.nightscout.database.impl.AppRepository @@ -43,7 +43,7 @@ import javax.inject.Inject import kotlin.math.min import kotlin.math.roundToInt -class TDDStatsActivity : DaggerAppCompatActivity() { +class TDDStatsActivity : TranslatedDaggerAppCompatActivity() { @Inject lateinit var sp: SP @Inject lateinit var profileFunction: ProfileFunction diff --git a/ui/src/main/java/info/nightscout/ui/activities/TreatmentsActivity.kt b/ui/src/main/java/info/nightscout/ui/activities/TreatmentsActivity.kt index c15fb0f774..f53797d513 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/TreatmentsActivity.kt +++ b/ui/src/main/java/info/nightscout/ui/activities/TreatmentsActivity.kt @@ -5,7 +5,7 @@ import android.view.MenuItem import androidx.fragment.app.Fragment import androidx.fragment.app.FragmentTransaction import com.google.android.material.tabs.TabLayout -import dagger.android.support.DaggerAppCompatActivity +import info.nightscout.core.ui.activities.TranslatedDaggerAppCompatActivity import info.nightscout.interfaces.Config import info.nightscout.interfaces.plugin.ActivePlugin import info.nightscout.shared.extensions.toVisibility @@ -21,7 +21,7 @@ import info.nightscout.ui.activities.fragments.TreatmentsUserEntryFragment import info.nightscout.ui.databinding.TreatmentsFragmentBinding import javax.inject.Inject -class TreatmentsActivity : DaggerAppCompatActivity() { +class TreatmentsActivity : TranslatedDaggerAppCompatActivity() { @Inject lateinit var config: Config @Inject lateinit var activePlugin: ActivePlugin diff --git a/ui/src/main/java/info/nightscout/ui/alertDialogs/ErrorDialog.kt b/ui/src/main/java/info/nightscout/ui/alertDialogs/ErrorDialog.kt index 272d3a10bd..a96e9a0335 100644 --- a/ui/src/main/java/info/nightscout/ui/alertDialogs/ErrorDialog.kt +++ b/ui/src/main/java/info/nightscout/ui/alertDialogs/ErrorDialog.kt @@ -10,7 +10,7 @@ import android.view.ViewGroup import android.view.Window import android.view.WindowManager import dagger.android.support.DaggerDialogFragment -import info.nightscout.core.ui.activities.DialogAppCompatActivity +import info.nightscout.core.ui.activities.TranslatedDaggerAppCompatActivity import info.nightscout.database.entities.UserEntry.Action import info.nightscout.database.entities.UserEntry.Sources import info.nightscout.interfaces.logging.UserEntryLogger @@ -26,7 +26,7 @@ class ErrorDialog : DaggerDialogFragment() { @Inject lateinit var aapsLogger: AAPSLogger @Inject lateinit var uel: UserEntryLogger - var helperActivity: DialogAppCompatActivity? = null + var helperActivity: TranslatedDaggerAppCompatActivity? = null var status: String = "" var title: String = "" var sound: Int = 0 diff --git a/ui/src/main/java/info/nightscout/ui/dialogs/BolusProgressDialog.kt b/ui/src/main/java/info/nightscout/ui/dialogs/BolusProgressDialog.kt index bad2f5effd..c4b6b85a33 100644 --- a/ui/src/main/java/info/nightscout/ui/dialogs/BolusProgressDialog.kt +++ b/ui/src/main/java/info/nightscout/ui/dialogs/BolusProgressDialog.kt @@ -8,7 +8,7 @@ import android.view.ViewGroup import android.view.Window import android.view.WindowManager import dagger.android.support.DaggerDialogFragment -import info.nightscout.core.ui.activities.DialogAppCompatActivity +import info.nightscout.core.ui.activities.TranslatedDaggerAppCompatActivity import info.nightscout.database.entities.UserEntry.Action import info.nightscout.database.entities.UserEntry.Sources import info.nightscout.interfaces.logging.UserEntryLogger @@ -42,7 +42,7 @@ class BolusProgressDialog : DaggerDialogFragment() { private var amount = 0.0 private var id: Long = 0L private var state: String? = null - private var helpActivity: DialogAppCompatActivity? = null + private var helpActivity: TranslatedDaggerAppCompatActivity? = null fun setId(id: Long): BolusProgressDialog { this.id = id @@ -55,7 +55,7 @@ class BolusProgressDialog : DaggerDialogFragment() { return this } - fun setHelperActivity(activity: DialogAppCompatActivity): BolusProgressDialog { + fun setHelperActivity(activity: TranslatedDaggerAppCompatActivity): BolusProgressDialog { helpActivity = activity return this }