Regarding android UI development

  • Replies:1
Reshmi
  • Forum posts: 1

Nov 21, 2014, 6:55:04 AM via Website

Hi

I am developing a android application. Here the UI is created using Images. So each Button Image on click should get highlighted(i.e replaced by another highlighted button image whenever the button is clicked). What is the simple way to achieve this (Since we have hundreds of buttons which needs the same requirement).

Please help me.

Regards
Reshmi

Reply
Kevin Berendsen
  • Forum posts: 118

Nov 21, 2014, 12:42:06 PM via Website

You could cache the most used images on buttons to increase performance. You'd have to load them anyway so try to keep the load time and pressure on the UI thread to the minimum.

You could create a wrapper for your button to keep your code more organized and efficient. For example a wrapper that receives the drawable (images in your case) and sets it as button image with just a single line. That reduces the amount of lines that you'd have to write.

Another tip would be to compress your images. Using big PNG files requires a bigger loading time.

Reply