本文整理汇总了Java中android.widget.Button.startAnimation方法的典型用法代码示例。如果您正苦于以下问题:Java Button.startAnimation方法的具体用法?Java Button.startAnimation怎么用?Java Button.startAnimation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.widget.Button
的用法示例。
在下文中一共展示了Button.startAnimation方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreate
import android.widget.Button; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.main);
MainMenu.context = this;
dataBaseHelper = new DataBaseHelper(this);
try {
dataBaseHelper.createDataBase();
} catch (IOException ioe) {
throw new Error("Unable to create database");
}
dataBaseHelper.openDataBase();
dataBaseHelper.Exists();
played = Integer.parseInt(dataBaseHelper.getTimesPlayed());
highScoreTextView = (TextView) findViewById(R.id.textView1);
highScoreTextView.setText(getResources().getString(R.string.high_score) + dataBaseHelper.getHighScore());
Button buttonPlay = (Button) this.findViewById(R.id.button1);
buttonPlay.startAnimation(getButtonAnimation());
buttonPlay.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (view == findViewById(R.id.button1)) {
startActivity(new Intent(MainMenu.this, GamePanel.class));
played++;
dataBaseHelper.setTimesPlayed(Integer.toString(played));
}
}
});
}
示例2: onCreate
import android.widget.Button; //导入方法依赖的package包/类
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login_screen);
b2=(Button)findViewById(R.id.memberBtn);
b2.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
loginTask=new LoginTask();
loginTask.execute();
}
});
b2.startAnimation(AnimationUtils.loadAnimation(SplashActivity.this,R.anim.fade_in));
}