SwipeView类似桌面的滑动界面
使用了android 2.0以上的ExifInterface来生成缩略图。可用来设计游戏的选关界面。
Java代码
import uk.co.jasonfry.android.tools.ui.PageControl.OnPageControlClickListener;
import android.content.Context;
import android.graphics.Rect;
import android.util.AttributeSet;
import android.util.Log;
import android.view.Display;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.view.WindowManager;
import android.widget.HorizontalScrollView;
import android.widget.LinearLayout;
public class SwipeView extends HorizontalScrollView
{
private static int DEFAULT_SWIPE_THRESHOLD = 60;
private LinearLayout mLinearLayout;
private Context mContext;
private int SCREEN_WIDTH;
private int mMotionStartX;
private int mMotionStartY;
private boolean mMostlyScrollingInX = false;
private boolean mMostlyScrollingInY = false;
private boolean mJustInterceptedAndIgnored = false;
protected boolean mCallScrollToPageInOnLayout = false;
private int mCurrentPage = 0;
private int mPageWidth = 0;
private OnPageChangedListener mOnPageChangedListener = null;
private SwipeOnTouchListener mSwipeOnTouchListener;
private View.OnTouchListener mOnTouchListener;
private PageControl mPageControl = null;
/**
* {@inheritDoc}
*/
public SwipeView(Context context)
{
super(context);
mContext = context;
initSwipeView();
}
/**
* {@inheritDoc}
*/
public SwipeView(Context context, AttributeSet attrs)
{
super(context, attrs);
mContext = context;
initSwipeView();
- 发表评论
-
- 最新评论 更多>>