-
Notifications
You must be signed in to change notification settings - Fork 45
Adding Vehicle Images
Note: this page is meant for developers. There currently is no means to import any custom images into the App.
A minimum car image set consists of…
- a main image (view from front, half profile left or right)
- an outline image (view from above)
- a map icon (normally the scaled down outline image).
All images should have the background (outside the vehicle) removed and replaced by transparency. Use feathering on the edges to achieve a smooth transition.
Image aspect ratio can be chosen as is best for the vehicle, the images will be scaled automatically to fill the view. Image sizes should not exceed 800 pixels in any direction, 650 pixels are totally sufficient. For the map icon, a maximum size of 128 pixel in any direction is allowed.
Image file format for all is currently PNG. Optimize your PNGs using a specialized tool like https://www.img2go.com/compress-image -- this reduces PNG sizes far better than your standard image processing software, without noticable losses.
You can add multiple colors, but please try to cut down the outline and map icon images to a single color to save space -- all images currently need to be added to the App package. If you need to add multiple colors, make all images the same size, and keep in mind common overlays may need to be applied.
Image files are all placed in res/drawable_nodpi
, names need to follow this convention:
- Main image(s):
car_<vehicleshortcut>_<color>.png
- Outline image(s):
ol_car_<vehicleshortcut>_<color>.png
- Map icon(s):
map_car_<vehicleshortcut>_<color>.png
Depending on the status features supported by the vehicle adapter you may want to add overlays to show certain vehicle states. Typical candidates for this are showing a currently active charge process (e.g. by overlaying a plugged in charge cable), showing open doors or frunks, and showing the vehicle lights.
These overlays are applied onto the outline image, so they need to match the dimension of these and be transparent except for the parts to be overlayed.
Example:
- Add the set of main image names (with extension removed) to the string array
sAvailableColors
in moduleui/Settings/CarEditorFragment.java
: https://github.com/openvehicles/Open-Vehicle-Android/blob/master/app/src/main/java/com/openvehicles/OVMS/ui/settings/CarEditorFragment.java#L298 - Add the outline image case to method
updateCarBodyView()
inui/CarFragment.java
: https://github.com/openvehicles/Open-Vehicle-Android/blob/master/app/src/main/java/com/openvehicles/OVMS/ui/CarFragment.java#L514 - If any, add functional overlays to method
updateCarBodyView()
inui/CarFragment.java
: https://github.com/openvehicles/Open-Vehicle-Android/blob/master/app/src/main/java/com/openvehicles/OVMS/ui/CarFragment.java#L807 - Add the map icon case to method
update()
inui/FragMap.java
: https://github.com/openvehicles/Open-Vehicle-Android/blob/master/app/src/main/java/com/openvehicles/OVMS/ui/FragMap.java#L517 - Add the map icon case to method
onMessageReceived()
inreceiver/MyGcmListenerService.java
: https://github.com/openvehicles/Open-Vehicle-Android/blob/master/app/src/main/java/com/openvehicles/OVMS/receiver/MyFirebaseMessagingService.java#L155