I am scaling rootView
which is LinearLayout
in fragment
of ViewPager
but child views aren't clickable
.
This is the rootView
public class CarouselLinearLayout extends LinearLayout {
private float scale = CarouselPagerAdapter.BIG_SCALE;
public CarouselLinearLayout(Context context, AttributeSet attrs) {
super(context, attrs);
}
public CarouselLinearLayout(Context context) {
super(context);
}
public void setScaleBoth(float scale) {
this.scale = scale;
this.invalidate();
}
@Override
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
// The main mechanism to display scale animation, you can customize it as your needs
int w = this.getWidth();
int h = this.getHeight();
h = h - ((h / 2) / 2) / 2;
canvas.scale(scale, scale, w / 2, h);// / 2
}
}
Here is relevant code where i am scaling the rootview
.
LinearLayout linearLayout = (LinearLayout) inflater.inflate(R.layout.pager_fragment_dashboard, container, false);
CarouselLinearLayout root = (CarouselLinearLayout) linearLayout.findViewById(R.id.root_container);
root.setScaleBoth(scale);
That's how it looks like.
Each circle is the page of PagerView
. 1 - 2 - 3
Views in page 2 are clickable but views in page 1 and 3 aren't clickable. How can i fix this issue?