I’d like to do such thing…. There is a Relative layout with splash.PNG as a background…. there are five ImageViews: @drawable\1.png, @drawable\2.png, @drawable\3.png, @drawable\4.png and @drawable\5.png…
1-is clickable and visible;
2-5 – are invisible and clickable=”false”
by clicking once Imageview 2 becomes visible but unclickable, and then by clicking all 2-5 appears, then by clicking last fifth time 2-5 again becomes invisible….
As for me, such construction works with one invisible ImageView:
final ImageView iv36 = (ImageView) findViewById(R.id.yabl3skr);
iv36.setOnClickListener( new OnClickListener() {
@Override
public void onClick(View v33) {
// TODO Auto-generated method stub
final ImageView iv37 = (ImageView)findViewById(R.id.yab3);
iv37.setVisibility(1);
iv37.setClickable(true);
iv37.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v33) {
// TODO Auto-generated method stub
iv37.setVisibility(View.GONE);
iv37.setClickable(false);
}
});
}
});
Need any ideas how to do it in a good way with five imageViews?
I don’t know if I fully get it, but what I think you’re saying is that you have five ImageViews that all perform conditional logic when clicked. If that’s the case, what I normally do is implement single OnClickListener for all of the images. You can set an initial state on all of your images and then do a switch on the id of the View being passed to enable and show which ever views you want to show.