Note that there are some explanatory texts on larger screens.

plurals
  1. PONeed imagebutton clear before Animation commences
    primarykey
    data
    text
    <p>So I start my activity and then</p> <pre><code>setContentView(R.layout.myxmllayoutfile); </code></pre> <p>All is well, but I want to make my imagebutton suddenly grow (scale) from nothing (ie 1%). However the layout is already displaying the button so it suddenly disappears then grows back rather than growing from nothing.</p> <p>I have some alternatives but is there a real solution?: 1. flying the imagebutton animate in from offscreen? ; or 2. making it tiny in the xml and then growing it, then if necessary changing the clickable area?; or 3. is there a better solution?</p> <p>UPDATE: As suggested I tried:</p> <pre><code>&lt;ImageButton android:id="@+id/spinner" android:scaleType="fitXY" android:layout_width="120dp" android:layout_height="120dp" android:layout_alignParentBottom="true" android:layout_centerHorizontal="true" android:background="@drawable/clear" android:orientation="horizontal" android:visibility="invisible" android:src="@drawable/spin" /&gt; </code></pre> <p>and in my java:</p> <pre><code>scaleView.startAnimation(scanimation); ImageButton spinnerbutton=(ImageButton)findViewById(R.id.spinner); spinnerbutton.setVisibility(View.VISIBLE); </code></pre> <p>but it is still visible before it shrinks to 1% then grows! Suggestions welcome.</p> <p>UPDATE2:</p> <p>Nothing has changed with the edited below code:</p> <pre><code>public void growit() { final ImageView scaleView = (ImageView) findViewById(R.id.spinner); Animation scanimation = AnimationUtils.loadAnimation(this, R.anim.throbbing2); scanimation.setFillAfter(true); scanimation.setAnimationListener(new Animation.AnimationListener() { public void onAnimationStart(Animation a) { Log.e("growit", "---- animation start listener called"); scaleView.setVisibility(View.VISIBLE); } public void onAnimationRepeat(Animation a) { } public void onAnimationEnd(Animation a) { } }); scaleView.startAnimation(scanimation); } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload