In the simulator onLayout is "useless" but onUpdate is called for each field, so there you call getWidth, getHeight and getObscurityFlags, create a "hash" (I used ((width*1000)+height)*1000+obscurityFlags. This is a number or you can use the string: …