Closed mscdroidlabs closed 8 years ago
Hi @mscdroidlabs
can you check if the same issue occurs if you use a regular ViewPager
instead of FlippableStackView
?
You want i try separately in other activity/fragment or i change any class of flippablestack?
You need to swap the one you're having problem with. What are you setting this OnClickListener
on? On FlippableStackView
object?
`mPageAdapter = new ColorFragmentAdapter(getSupportFragmentManager(), mViewPagerFragments); mFlippableStack = (FlippableStackView) findViewById(R.id.flippable_stack_view); mFlippableStack.initStack(6, StackPageTransformer.Orientation.HORIZONTAL); mFlippableStack.setAdapter(mPageAdapter); mFlippableStack.setClickable(true); //Its hidden by default on my app mFlippableStack.setVisibility(View.VISIBLE);
mFlippableStack.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Toast.makeText(getApplicationContext(), "mFlippableStack ClicListener! ", Toast.LENGTH_SHORT).show();
}
});
mFlippableStack.setOnDragListener(new View.OnDragListener() {
@Override
public boolean onDrag(View view, DragEvent dragEvent) {
Log.d("TT", "Drag : " + dragEvent.toString() );
return false;
}
});`
The content of fragments is displayed whithout problems but, no one of this events is executed... :S
Ok so you're trying to set an OnClickListener
on a FlippableStackView
itself.
OnClickListener
will not work for the FlippableStackView
in the same way it will not work for the regular ViewPager
. You can read the whole StackOverflow topic over here.
You should consider two things:
OnClickListener
on the FlippableStackView
... Maybe it's the contents of the Stack
that should be implementing this functionality?FlippableStackView
that needs that, try this approach.Nice! Big thanks!
Hi!
i have some problems to listen to this events, i tried to set clickable propertie in xml, also tried programattically "setClickacle(true)" but anything occurs. I only get working with OnTouchListener and then i have to play with ACTION_DOWN, ACTION_UP and ACTION_MOVE.
Anyone has tried?