如何在图像边框周围添加动画光?

时间:2013-01-21 09:41:30

标签: android

这是我的动画图像代码工作正常,但我想在图像周围添加绿色照明照明边框我是怎么做到的?喜欢这张图片http://imgur.com/qg0JM0q

淡出淡出图像的圆形边框???

public class MainActivity extends Activity {

Button btnAnimation, btnAnimation1, btnAnimation2;
 Animation performAnimation, performAnimation1, performAnimation2;
 ImageView androidImageView;

 @Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
 setContentView(R.layout.activity_main);


performAnimation1 = AnimationUtils.loadAnimation(this, R.layout.animation1);
 performAnimation1.setRepeatCount(4);



androidImageView = (ImageView)findViewById(R.id.androidImageView);

btnAnimation1 = (Button)findViewById(R.id.btn_animation1);




btnAnimation1.setOnClickListener(new View.OnClickListener() {

@Override
public void onClick(View v) {
androidImageView.startAnimation(performAnimation1);

 }
 });



}

 }




                <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent" >

<ImageView
android:id="@+id/androidImageView"
android:layout_width="30dp"
android:layout_height="40dp"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="192dp"
android:adjustViewBounds="false"
android:src="@drawable/alertlogo" />



<Button
android:id="@+id/btn_animation1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/androidImageView"
android:layout_below="@+id/btn_animation"
android:text="perform animation 2" />



</RelativeLayout>






<!------------ animation1.xml---->



          <?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="@android:anim/decelerate_interpolator">

<alpha
android:fromAlpha="0.0"
android:toAlpha="1.0"
android:interpolator="@android:anim/accelerate_interpolator"
android:duration="8000" />

</set>

0 个答案:

没有答案