I have a view (custom drawn) added with getWindowManager().addView()
and later I'm modifiying the LayoutParameters
of it (changing x
& width
) and call getWindowManager().updateViewLayout()
. This works but I am getting two screen refreshes, first one only moves the whole thing according to the new x
and later one scales it according to the new width. Any ideas about why is this happening even though I only call updateViewLayout
just one time with the new layout parameters?
FYI: onDraw
method of the custom drawn view mentioned here is also called only one time by the system during this process.
Try:
runOnUiThread(new Runnable() {
public void run() {
view.updateViewLayout();
}
});
http://developer.android.com/reference/android/app/Activity.html#runOnUiThread(java.lang.Runnable)
If it doesn't work, check this:
How to move a view in Android?
Are you doing this?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With