あなたも、リストビューなしでそれを行う必要があると私はあなたがあなたの主な活動 //内部の活動でこの
を試すことができますので、あなたも、アダプタを望んでいないと思います
いくつかのアニメーションのための
TextView txt_help_gest;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_info);
txt_help_gest = (TextView) findViewById(R.id.txt_help_gest);
// hide until its title is clicked
txt_help_gest.setVisibility(View.GONE);
}
> /**
> * onClick handler
> */
public void toggle_contents(View v){
txt_help_gest.setVisibility(txt_help_gest.isShown()
? View.GONE
: View.VISIBLE);
}
主な活動で210
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:fillAfter="true">
<scale
android:duration="200"
android:fromXScale="1.0"
android:fromYScale="0.0"
android:interpolator="@android:anim/linear_interpolator"
android:toXScale="1.0"
android:toYScale="1.0" />
</set>
Javaコード
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
//...
/**
*
* @param ctx
* @param v
*/
public static void slide_down(Context ctx, View v){
Animation a = AnimationUtils.loadAnimation(ctx, R.anim.slide_down);
if(a != null){
a.reset();
if(v != null){
v.clearAnimation();
v.startAnimation(a);
}
}
}
/** * 上のクリックハンドラ */
public void toggle_contents(View v){
if(txt_help_gest.isShown()){
Fx.slide_up(this, txt_help_gest);
txt_help_gest.setVisibility(View.GONE);
}
else{
txt_help_gest.setVisibility(View.VISIBLE);
Fx.slide_down(this, txt_help_gest);
}
}