lint recommendation
This commit is contained in:
parent
c8bd0856bf
commit
0a207cbecc
|
@ -26,7 +26,7 @@ class OpenHumansLoginActivity : NoSplashAppCompatActivity() {
|
||||||
val button = findViewById<Button>(R.id.button)
|
val button = findViewById<Button>(R.id.button)
|
||||||
val checkbox = findViewById<CheckBox>(R.id.checkbox)
|
val checkbox = findViewById<CheckBox>(R.id.checkbox)
|
||||||
|
|
||||||
button.setOnClickListener { _ ->
|
button.setOnClickListener {
|
||||||
if (checkbox.isChecked) {
|
if (checkbox.isChecked) {
|
||||||
CustomTabsIntent.Builder().build().launchUrl(this, Uri.parse(OpenHumansUploader.AUTH_URL))
|
CustomTabsIntent.Builder().build().launchUrl(this, Uri.parse(OpenHumansUploader.AUTH_URL))
|
||||||
} else {
|
} else {
|
||||||
|
@ -55,7 +55,7 @@ class OpenHumansLoginActivity : NoSplashAppCompatActivity() {
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
|
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
|
||||||
return AlertDialog.Builder(activity!!)
|
return AlertDialog.Builder(requireActivity())
|
||||||
.setTitle(R.string.completing_login)
|
.setTitle(R.string.completing_login)
|
||||||
.setMessage(R.string.please_wait)
|
.setMessage(R.string.please_wait)
|
||||||
.create()
|
.create()
|
||||||
|
@ -65,10 +65,10 @@ class OpenHumansLoginActivity : NoSplashAppCompatActivity() {
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
disposable = openHumansUploader.login(arguments?.getString("authToken")!!).subscribeOn(Schedulers.io()).subscribe({
|
disposable = openHumansUploader.login(arguments?.getString("authToken")!!).subscribeOn(Schedulers.io()).subscribe({
|
||||||
dismiss()
|
dismiss()
|
||||||
SetupDoneDialog().show(fragmentManager!!, "SetupDoneDialog")
|
SetupDoneDialog().show(parentFragmentManager, "SetupDoneDialog")
|
||||||
}, {
|
}, {
|
||||||
dismiss()
|
dismiss()
|
||||||
ErrorDialog(it.message).show(fragmentManager!!, "ErrorDialog")
|
ErrorDialog(it.message).show(parentFragmentManager, "ErrorDialog")
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -96,7 +96,7 @@ class OpenHumansLoginActivity : NoSplashAppCompatActivity() {
|
||||||
val message = arguments?.getString("message")
|
val message = arguments?.getString("message")
|
||||||
val shownMessage = if (message == null) getString(R.string.there_was_an_error)
|
val shownMessage = if (message == null) getString(R.string.there_was_an_error)
|
||||||
else "${getString(R.string.there_was_an_error)}\n\n$message"
|
else "${getString(R.string.there_was_an_error)}\n\n$message"
|
||||||
return AlertDialog.Builder(activity!!)
|
return AlertDialog.Builder(requireActivity())
|
||||||
.setTitle(R.string.error)
|
.setTitle(R.string.error)
|
||||||
.setMessage(shownMessage)
|
.setMessage(shownMessage)
|
||||||
.setPositiveButton(R.string.close, null)
|
.setPositiveButton(R.string.close, null)
|
||||||
|
@ -122,14 +122,14 @@ class OpenHumansLoginActivity : NoSplashAppCompatActivity() {
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
|
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
|
||||||
return AlertDialog.Builder(activity!!)
|
return AlertDialog.Builder(requireActivity())
|
||||||
.setTitle(R.string.successfully_logged_in)
|
.setTitle(R.string.successfully_logged_in)
|
||||||
.setMessage(R.string.setup_will_continue_in_background)
|
.setMessage(R.string.setup_will_continue_in_background)
|
||||||
.setCancelable(false)
|
.setCancelable(false)
|
||||||
.setPositiveButton(R.string.close) { _, _ ->
|
.setPositiveButton(R.string.close) { _, _ ->
|
||||||
activity!!.run {
|
requireActivity().run {
|
||||||
setResult(Activity.RESULT_OK)
|
setResult(Activity.RESULT_OK)
|
||||||
activity!!.finish()
|
requireActivity().finish()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.create()
|
.create()
|
||||||
|
|
|
@ -133,8 +133,8 @@ object PrefImportSummaryDialog {
|
||||||
|
|
||||||
val dialog = builder.show()
|
val dialog = builder.show()
|
||||||
val textView = dialog.findViewById<View>(android.R.id.message) as TextView?
|
val textView = dialog.findViewById<View>(android.R.id.message) as TextView?
|
||||||
textView!!.textSize = 12f
|
textView?.textSize = 12f
|
||||||
textView!!.setPadding(10,0,0,0)
|
textView?.setPadding(10,0,0,0)
|
||||||
dialog.setCanceledOnTouchOutside(false)
|
dialog.setCanceledOnTouchOutside(false)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,17 +1,14 @@
|
||||||
package info.nightscout.androidaps.utils.ui
|
package info.nightscout.androidaps.utils.ui
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.text.TextWatcher
|
|
||||||
import android.util.AttributeSet
|
import android.util.AttributeSet
|
||||||
import android.util.Log
|
|
||||||
import android.view.View.OnFocusChangeListener
|
|
||||||
import android.widget.Button
|
import android.widget.Button
|
||||||
import info.nightscout.androidaps.core.R
|
import info.nightscout.androidaps.core.R
|
||||||
import java.text.DecimalFormat
|
import java.text.DecimalFormat
|
||||||
|
|
||||||
class MinutesNumberPicker constructor(context: Context, attrs: AttributeSet? = null) : NumberPicker(context, attrs) {
|
class MinutesNumberPicker constructor(context: Context, attrs: AttributeSet? = null) : NumberPicker(context, attrs) {
|
||||||
|
|
||||||
fun setParams(initValue: Double, minValue: Double, maxValue: Double, step: Double, allowZero: Boolean, okButton: Button? = null, textWatcher: TextWatcher? = null) {
|
fun setParams(initValue: Double, minValue: Double, maxValue: Double, step: Double, allowZero: Boolean, okButton: Button? = null) {
|
||||||
super.setParams(initValue, minValue, maxValue, step, null, allowZero, okButton)
|
super.setParams(initValue, minValue, maxValue, step, null, allowZero, okButton)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -114,7 +114,6 @@ class DanaRSService : DaggerService() {
|
||||||
|
|
||||||
fun readPumpStatus() {
|
fun readPumpStatus() {
|
||||||
try {
|
try {
|
||||||
val now = System.currentTimeMillis()
|
|
||||||
val pump = activePlugin.activePump
|
val pump = activePlugin.activePump
|
||||||
rxBus.send(EventPumpStatusChanged(resourceHelper.gs(R.string.gettingpumpsettings)))
|
rxBus.send(EventPumpStatusChanged(resourceHelper.gs(R.string.gettingpumpsettings)))
|
||||||
sendMessage(DanaRS_Packet_Etc_Keep_Connection(injector)) // test encryption for v3
|
sendMessage(DanaRS_Packet_Etc_Keep_Connection(injector)) // test encryption for v3
|
||||||
|
|
|
@ -17,7 +17,7 @@ abstract class ActionViewModelBase : ViewModel() {
|
||||||
|
|
||||||
fun executeAction() {
|
fun executeAction() {
|
||||||
_isActionExecutingLiveData.postValue(true)
|
_isActionExecutingLiveData.postValue(true)
|
||||||
val disposable = SingleSubject.fromCallable<PumpEnactResult>(this::doExecuteAction)
|
SingleSubject.fromCallable<PumpEnactResult>(this::doExecuteAction)
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
.doOnSuccess { result ->
|
.doOnSuccess { result ->
|
||||||
_isActionExecutingLiveData.postValue(false)
|
_isActionExecutingLiveData.postValue(false)
|
||||||
|
|
Loading…
Reference in a new issue