Switch Short and long click functions
Short Click View Profile Long Click Profile Switch Dialog
This commit is contained in:
parent
2ae77ed66a
commit
124b8c07b1
|
@ -292,8 +292,15 @@ class OverviewFragment : DaggerFragment(), View.OnClickListener, OnLongClickList
|
||||||
R.id.overview_insulinbutton -> protectionCheck.queryProtection(activity, ProtectionCheck.Protection.BOLUS, UIRunnable { InsulinDialog().show(childFragmentManager, "Overview") })
|
R.id.overview_insulinbutton -> protectionCheck.queryProtection(activity, ProtectionCheck.Protection.BOLUS, UIRunnable { InsulinDialog().show(childFragmentManager, "Overview") })
|
||||||
R.id.overview_quickwizardbutton -> protectionCheck.queryProtection(activity, ProtectionCheck.Protection.BOLUS, UIRunnable { onClickQuickWizard() })
|
R.id.overview_quickwizardbutton -> protectionCheck.queryProtection(activity, ProtectionCheck.Protection.BOLUS, UIRunnable { onClickQuickWizard() })
|
||||||
R.id.overview_carbsbutton -> protectionCheck.queryProtection(activity, ProtectionCheck.Protection.BOLUS, UIRunnable { CarbsDialog().show(childFragmentManager, "Overview") })
|
R.id.overview_carbsbutton -> protectionCheck.queryProtection(activity, ProtectionCheck.Protection.BOLUS, UIRunnable { CarbsDialog().show(childFragmentManager, "Overview") })
|
||||||
R.id.overview_activeprofile -> protectionCheck.queryProtection(activity, ProtectionCheck.Protection.BOLUS, UIRunnable { ProfileSwitchDialog().show(childFragmentManager, "Overview") })
|
|
||||||
R.id.overview_temptarget -> protectionCheck.queryProtection(activity, ProtectionCheck.Protection.BOLUS, UIRunnable { TempTargetDialog().show(childFragmentManager, "Overview") })
|
R.id.overview_temptarget -> protectionCheck.queryProtection(activity, ProtectionCheck.Protection.BOLUS, UIRunnable { TempTargetDialog().show(childFragmentManager, "Overview") })
|
||||||
|
R.id.overview_activeprofile -> {
|
||||||
|
val args = Bundle()
|
||||||
|
args.putLong("time", DateUtil.now())
|
||||||
|
args.putInt("mode", ProfileViewerDialog.Mode.RUNNING_PROFILE.ordinal)
|
||||||
|
val pvd = ProfileViewerDialog()
|
||||||
|
pvd.arguments = args
|
||||||
|
pvd.show(childFragmentManager, "ProfileViewDialog")
|
||||||
|
}
|
||||||
R.id.overview_cgmbutton -> {
|
R.id.overview_cgmbutton -> {
|
||||||
if (xdripPlugin.isEnabled(PluginType.BGSOURCE))
|
if (xdripPlugin.isEnabled(PluginType.BGSOURCE))
|
||||||
openCgmApp("com.eveningoutpost.dexdrip")
|
openCgmApp("com.eveningoutpost.dexdrip")
|
||||||
|
@ -366,14 +373,8 @@ class OverviewFragment : DaggerFragment(), View.OnClickListener, OnLongClickList
|
||||||
v.performClick()
|
v.performClick()
|
||||||
}
|
}
|
||||||
R.id.overview_temptarget -> v.performClick()
|
R.id.overview_temptarget -> v.performClick()
|
||||||
R.id.overview_activeprofile -> {
|
R.id.overview_activeprofile -> activity?.let { activity -> protectionCheck.queryProtection(activity, ProtectionCheck.Protection.BOLUS, UIRunnable { ProfileSwitchDialog().show(childFragmentManager, "Overview") })}
|
||||||
val args = Bundle()
|
|
||||||
args.putLong("time", DateUtil.now())
|
|
||||||
args.putInt("mode", ProfileViewerDialog.Mode.RUNNING_PROFILE.ordinal)
|
|
||||||
val pvd = ProfileViewerDialog()
|
|
||||||
pvd.arguments = args
|
|
||||||
pvd.show(childFragmentManager, "ProfileViewDialog")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue