本文整理匯總了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));
}