Pin Dialog in Roku
Posted By : Prashant Grover | 12-Apr-2017
Pin Dialog Implementation.
In roku sdk there are various types of dialog nodes, out of which one is PIN DIALOG, pin dialog is a special type of dialog node class it is generally used at that point where we want user to enter the pin code to access the specific module or section of our roku application. As the pin dialog class includes an internal Pin Dialog nodes which is used to prompt user to enter the numeric string.
Features provided by Pin Dialog Node are :
1. Pin dialog node allows to add/set title by setting the title field.
2. Pin dialog node allows to add/set message by setting the message field.
3. Pin dialog node allows to add set of action buttons by setting the buttons field.
Note : For the above point(3) , you will want to set the Dialog node title
field to prompt the user to enter a PIN, and add "OK" and "Cancel" buttons by setting the Dialog node buttons field to ["Ok","Cancel"] then observe the Dialog node buttonSelected
field to react when the user presses one of those buttons. At any time, the PinDialog node pin
field can be accessed to obtain the PIN value entered by the user.
Below mention are the fields provided by Pin Dialog :
1. pin - It is of string type, this field is used for both read and write i.e we can internally set the PIN NODE pin value as well as we can access the pin value enter by user, the user can enter at max 4 digit pin value
2. pinPad - It is of PinPad node type, this field is read-only which is used to provide access to internal PIN PAD node class which is implemented by PIN DIALOG node class.
3. privacyHintColor - This field is used to set the color of privacy hint text shown at the bottom of PIN DIALOG.
Example :
sub showPinDialog()
pinDialog = createObject("roSGNode", "PinDialog")
pinDialog.title = "Example Pin Dialog"
pinDialog.optionsDialog = true
pinDialog.message = "Press * To Dismiss"
pinDialog.buttons = ["Ok","Cancel"]
m.top.dialog = pinDialog
m.top.dialog.observeFields("buttonSelected","onVerifyPin")
End sub
sub onVerifyPin()
if m.top.dialog.buttonSelected = 1
print "ok button pressed"
else
print "cancel button pressed"
end if
end sub
THANKS
Cookies are important to the proper functioning of a site. To improve your experience, we use cookies to remember log-in details and provide secure log-in, collect statistics to optimize site functionality, and deliver content tailored to your interests. Click Agree and Proceed to accept cookies and go directly to the site or click on View Cookie Settings to see detailed descriptions of the types of cookies and choose whether to accept certain cookies while on the site.
About Author
Prashant Grover
Prashant is a bright Java developer, his area of expertise are Core Java, Android , Spring . Grails etc. Apart from that he spends his time playing volleyball.