step by step.
目录
1.gif使用:
xml:
<ImageView
android:id="@+id/gif_water2"
android:layout_width="303dp"
android:layout_height="337dp"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="37dp"
android:scaleType="fitXY" />
java:
Button buttonag = (Button) findViewById(R.id.button_again); //引用按钮触发事件
buttonag.setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View v){
//触发页面
Intent intent = new Intent(PracticeActivity_w.this, LearnActivity.class);
startActivity(intent);
}
});
效果:
点击后:
2.重启动画(通过按“help”->“确定”)
ImageView water_g = (ImageView) findViewById(R.id.gif_water2);
water_g.setVisibility(View.VISIBLE);
java:
private void showNormalDialog(){
final AlertDialog.Builder normalDialog =
new AlertDialog.Builder(PracticeActivity_w.this);
normalDialog.setTitle("练习指南");
normalDialog.setMessage("点击笔画动画,即可关闭并开始练习。若需重新查看,请按“确定”。");
normalDialog.setNegativeButton("取消", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
}
});
normalDialog.setPositiveButton("确认", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
ImageView water_g = (ImageView) findViewById(R.id.gif_water2);
water_g.setVisibility(View.VISIBLE);
}
});
normalDialog.show();
}
效果: