Android Question Preferences Dialog change time in steps

Cosmo

Member
Hello all,

in the Preferences Dialog is it possible to change the time in steps, e.g. when clicking arrow up or down, change the time in 10 or 15 minutes?

Any suggestions welcome!

Thanks,
Bernhard


1742392867513.png
 
Solution
B4X:
Private Sub SetMinutesSelectorIntervalTo10Minutes(Key As String)
    Dim i As Int = p.PrefItems.IndexOf(p.GetPrefItem(Key))
    Dim pmMinutes As B4XPlusMinus = p.CustomListView1.GetPanel(i).GetView(1).Tag
    pmMinutes.SetNumericRange(0, 50, 10)
End Sub

Example:
B4X:
Sub Button1_Click
    Dim rs As Object = p.ShowDialog(Data(0), "Ok", "CANCEL")
    SetMinutesSelectorIntervalTo10Minutes("time") 'this is the item "key"
    Wait For (rs) Complete (Result As Int)
    Log(Result)
End Sub

Erel

B4X founder
Staff member
Licensed User
Longtime User
B4X:
Private Sub SetMinutesSelectorIntervalTo10Minutes(Key As String)
    Dim i As Int = p.PrefItems.IndexOf(p.GetPrefItem(Key))
    Dim pmMinutes As B4XPlusMinus = p.CustomListView1.GetPanel(i).GetView(1).Tag
    pmMinutes.SetNumericRange(0, 50, 10)
End Sub

Example:
B4X:
Sub Button1_Click
    Dim rs As Object = p.ShowDialog(Data(0), "Ok", "CANCEL")
    SetMinutesSelectorIntervalTo10Minutes("time") 'this is the item "key"
    Wait For (rs) Complete (Result As Int)
    Log(Result)
End Sub
 
Upvote 0
Solution
Top