I'd like to use the Android Lock Screen Pattern in my custom application while opening the app. I've searched a lot, but everyone asks to use the LockScreenUtils.java class from the source code. I'm having a tough time doing this.
One post on stackoverflow asks to make custom 3x3 matrix with a button on each cell and listen for the selection pattern, but then that doesn't look artistically good :)
Any thoughts or suggestions on how do I implement this?
Thanks!!!
After struggling with those custom buttons, spending time digging out the LockPattern Source from the AOSP, I stumbled upon this awesome library which solved my problem. Hope it helps you out as well.
Android Lock Pattern Library
Doing it manually, you could just have a single View
, and manually draw some nice graphics at the 9 points you want. Then just listen for any MotionEvent
; if it's within a 'button zone' that hasn't been touched before, mark it as pushed (and change the graphics) and add a pretty line joining it to the last touched 'button' to the stuff to draw.
So all you need is:
View
with some simple customized rendering code and nice 'on'/'off' graphics for the buttons.This should be easier to improve the appearance of than buttons in a table.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With