I have written the following code to first increase the size of ImageView and after 100ms decrease the size of the same ImageView. However this code increases the size of ImageView but it doesn't decrease it's size or the code after 100ms delay doesn't affect the imageView dimensions.
What am I doing wrong?
uiHandler.post(new Runnable()
{
@Override
public void run()
{
FrameLayout.LayoutParams layout = (android.widget.FrameLayout.LayoutParams) imageView.getLayoutParams();
layout.height = (int) (2*iconsSizeInDP);
layout.width = (int) (2*iconsSizeInDP);
imageView.setLayoutParams(layout);
try
{
Thread.sleep(50);
}
catch (InterruptedException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
Toast.makeText(getApplicationContext(), "Hello", Toast.LENGTH_SHORT).show();
// following code block doesnt'affect imageView dimensions
layout.height = (int) iconsSizeInDP;
layout.width = (int) iconsSizeInDP;
imageView.setLayoutParams(layout);
}
});
Regards