💥 a nodejs tools for android screen adaptation
install
npm install android-sex-size --global
usage
generate config file
ruler --config
config.json
is generated in the current directory
- there is no width in the target that you want to fit?
measure with config.json
ruler --measure config.json
- generate the directory in the target like
values-sw533dp
values-sw720dp
...
extract with config.json
ruler --extract config.json
- replace the extracted dp and sp files and write the extracted values to dimens.xml in the current directory
- origin
- current
- dimens.xml
200dp 100dp
dragon
ruler --dragon config.json
start gui
ruler --gui
- browse localhost:8888 snapshot