donoachua
donoachua

Reputation: 193

android alpha animation remove alpha

I have Imageview in my Xml file and i have 0.6f alpha in my imageview.this is a code

 <ImageView
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:scaleType="centerCrop"
  android:alpha=".60"
  android:id="@+id/u_go_dashboard_bill"/>

now i want to remove alpha with animation with fade in fade out .i mean alpha 100%.i also wrote some java code but i can't change it

  AlphaAnimation alpha = new AlphaAnimation(0.0F, 1.0F);
            alpha.setDuration(150);
            alpha.setFillAfter(true);
            dashboardBillAvatar.startAnimation(alpha);

how i can solve my problem?if anyone knows solution please help me p.s i never worked alpha animations and i don't know how i can use it thanks everyone

Upvotes: 0

Views: 2481

Answers (1)

Vitaly Zinchenko
Vitaly Zinchenko

Reputation: 4911

Try this:

ImageView yourImageView = (ImageView) findViewById(R.id.u_go_dashboard_bill);
yourImageView.animate().alpha(1.0).setDuration(150).start();

Upvotes: 1

Related Questions