Note that there are some explanatory texts on larger screens.

plurals
  1. POAnimations no longer work when I hide a ProgressBar
    text
    copied!<p>long time listener, first time caller...</p> <p>I am creating a splash screen derived from Activity called SplashBase that is placed inside a shared project. The layout is the following: </p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/linlytSplash" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" &gt; &lt;ImageView android:id="@+id/imgvwSplash" android:src="@drawable/splashscreen" android:layout_width="fill_parent" android:layout_height="wrap_content" &gt;&lt;/ImageView&gt; &lt;LinearLayout android:id="@+id/linlytProgress" android:orientation="horizontal" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_gravity="center" android:gravity="center" &gt; &lt;ProgressBar android:id="@+id/progbarProgress" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginRight="5dp" &gt;&lt;/ProgressBar&gt; &lt;TextView android:id="@+id/txtvwProgress" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="10dip" android:gravity="center_vertical" android:text="@string/loading_ellipsis" android:textStyle="bold" &gt;&lt;/TextView&gt; &lt;/LinearLayout&gt; &lt;/LinearLayout&gt; </code></pre> <p>I am loading the animations like this : </p> <pre><code> Animation animation = AnimationUtils.loadAnimation(this, R.anim.splashscreen_anim); animation.setAnimationListener(new AnimationListener() { public void onAnimationEnd(Animation animation) { // Advance to the next screen. if (null != m_intentToLaunch) { startActivity(m_intentToLaunch); } finish(); } }); animation.setStartTime(AnimationUtils.currentAnimationTimeMillis() + 1000); </code></pre> <p>I have a derived class called Splash which lives in my main project.</p> <p>I've had this splash screen for a long time now, the animation has always worked. My ImageView is shown for 2 seconds, and then animates and disappears before calling finish() and loading the next Activity. </p> <p>I am now adding a ProgressBar which only be shown for the first second (not exactly, but it's clearer if I explain it that way). For some reason, after I hide the ProgressBar, the animation no longer works on the ImageView. When I call </p> <pre><code>findViewById(R.id.linlytProgress).setVisibility(View.INVISIBLE); </code></pre> <p>the animation no longer works. In order to test I have placed the following calls:</p> <pre><code>findViewById(R.id.txtvwProgress).setVisibility(View.INVISIBLE); </code></pre> <p>and then </p> <pre><code>findViewById(R.id.progbarProgress).setVisibility(View.INVISIBLE); </code></pre> <p>When I hide only the TextView, things work as expected. When I hide the ProgressBar, boom, my ImageView no longer animates. I'm at a loss.</p>
 

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