SwipeView类似桌面的滑动界面(16)
else //carry on as normal
{
edgePosition = mCurrentPage*mPageWidth;
}
}
}
smoothScrollToPage((int)edgePosition/mPageWidth);
mFirstMotionEvent = true;
mDistanceX = 0;
mMostlyScrollingInX = false;
mMostlyScrollingInY = false;
return true;
}
}
}
Java代码
import java.util.ArrayList;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Color;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.ShapeDrawable;
import android.graphics.drawable.shapes.OvalShape;
import android.graphics.drawable.shapes.Shape;
import android.util.AttributeSet;
import android.util.Log;
import android.view.MotionEvent;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
public class PageControl extends LinearLayout
{
private int mIndicatorSize = 7;
private Drawable activeDrawable;
private Drawable inactiveDrawable;
private ArrayList<ImageView> indicators;
- 发表评论
-
- 最新评论 更多>>