Animations can add subtle visual cues that notify users about what's going on in your app and improve their mental model of your app's interface. Animations are especially useful when the screen changes state, such as when content loads or new actions become available. Animations can also add a polished look to your app, which gives your app a higher quality feel.
package com.example.vanimation;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
public class FirstActivity extends Activity
{
@Override
protected void onCreate( Bundle savedInstanceState )
{
super.onCreate( savedInstanceState );
setContentView( R.layout.activity_first );
((Button)findViewById( R.id.NextButton )).setOnClickListener( new OnClickListener()
{
@Override
public void onClick( View v )
{
//startActivity( new Intent( FirstActivity.this, SecondActivity.class ) );
Intent intent = new Intent(FirstActivity.this, SecondActivity.class);
startActivityForResult(intent, 0);
overridePendingTransition( R.anim.slide_in_left, R.anim.slide_out_left );
}
});
}
}
No comments:
Post a Comment