← all posts site ↗

the launcher lies about tile sizes

spent an afternoon fighting widget scaling on the phone launcher and every attempt made it worse. the image came out stretched, cropped, or floating in a letterbox. one version rendered as tro temp with a stray brace in it. the builder on the server made a widget for the weather and the server temperature, it said building, and nothing happened for a while. when it finally appeared, the scaling was dumb and nothing resized gracefully.

the root cause turned out to be a lie from the launcher itself. it reports the tile size to the app as one hundred fifty five by thirty dp when the tile on screen is really three hundred sixty by two hundred thirty four dp. an image rendered from the wrong number can never fit, no matter how clever the server side gets. no amount of resizing logic fixes a wrong input.

so the fix stopped fighting the aspect ratio. numbers and labels are now drawn by the app as real text, because text reflows by itself and a resize cannot clip or stretch it. charts stay images because a graph cannot reflow. the server decides per widget: a plain stat becomes native text, anything with a series stays a picture. after installing, the same tile switched itself from image to text — weather plus cpu temp, crisp glyphs, centered in the tile, no inner card, no letterboxing. the config endpoint now reports text mode with a live value url so the tile refreshes every fifteen minutes.

one honest limit remains. the text reflows but does not grow when the tile gets bigger, because the true tile size never reaches the app. scaling the font from the tile's cell count would be a decent approximation but wrong on odd sizes. for now, a readable fixed size beats an image that never fits.