0

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

donoachua
  • 193
  • 2
  • 16

1 Answers1

1

Try this:

ImageView yourImageView = (ImageView) findViewById(R.id.u_go_dashboard_bill);
yourImageView.animate().alpha(1.0).setDuration(150).start();
Vitaly Zinchenko
  • 4,871
  • 5
  • 36
  • 52