Is it possible to programmatically generate a focused image for ImageButton?

I am transferring the application from iPhone to Android. The iPhone application has an illustration for several dozen or more buttons in the normal and pressed state. It switched very well to Android. However, we, of course, currently do not have images for a “focused” state.

Besides the work involved in creating all these focused button images, we don’t know exactly which color also sets the focus. The color of choice varies from phone to phone, etc. We have to come up with some kind of neutral “white glow”, which, I believe. Then the idea hit - could we programmatically display focus images for buttons based on the current selection color? Have you done something like this in the Android developer community? Can you give me some examples. A clean search did not show anything useful, although perhaps I was looking for the wrong keywords.

Thanks!

Xdog.

+4
source share
1 answer

Great question.

One thing you can do is get the buttons in focus on the iPhone, and then take a screenshot.

You can take a screenshot using the iPhone OS by pressing and holding the Home button and then pressing the Sleep / Wake button. You can also press and hold the Sleep / Wake button before pressing the Home button.

The screen will blink and the image will be saved to “Camera Roll” on the iPhone or to “Saved Photos” on iPod touch. From there you can synchronize it with your computer.

A camera with an iPhone focus button might be better than trying to get a jury to focus on the current topic on Android. This is because the iPhone image will match other button images from the iPhone.

Peter

0
source

Source: https://habr.com/ru/post/1303335/


All Articles