@@ -0,0 +1,1221 @@
+package com.nestedworld.nestedworld.customView.wrapcontentViewPager;%0A%0Aimport android.content.Context;%0Aimport android.support.v4.view.ViewPager;%0Aimport android.util.AttributeSet;%0Aimport android.view.View;%0A%0Apublic class WrapContentViewPager extends ViewPager %7B%0A%0A    private int mCurrentPagePosition = 0;%0A%0A    public WrapContentViewPager(Context context) %7B%0A        super(context);%0A    %7D%0A%0A    public WrapContentViewPager(Context context, AttributeSet attrs) %7B%0A        super(context, attrs);%0A    %7D%0A%0A    @Override%0A    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) %7B%0A        try %7B%0A            View child = getChildAt(mCurrentPagePosition);%0A            if (child != null) %7B%0A                child.measure(widthMeasureSpec, MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED));%0A                int h = child.getMeasuredHeight();%0A                heightMeasureSpec = MeasureSpec.makeMeasureSpec(h, MeasureSpec.EXACTLY);%0A            %7D%0A        %7D catch (Exception e) %7B%0A            e.printStackTrace();%0A        %7D%0A        super.onMeasure(widthMeasureSpec, heightMeasureSpec);%0A    %7D%0A%0A    public void reMeasureCurrentPage(int position) %7B%0A        mCurrentPagePosition = position;%0A        requestLayout();%0A    %7D%0A%7D%0A

add custom Viewpager