Support to set max value and min value in preference xml.

Signed-off-by: Pengfei Han <hanpfei@gmail.com>