public OverlappedWidget(Context context, string bookId, List <BookMixAToc.MixToc.Chapters> chaptersList, IOnReadStateChangeListener listener) : base(context, bookId, chaptersList, listener) { mTouch.X = 0.01f; mTouch.Y = 0.01f; mPath0 = new Path(); var uintValue = 0xaa666666; int[] mBackShadowColors = new int[] { (int)uintValue, 0x666666 }; mBackShadowDrawableRL = new GradientDrawable(GradientDrawable.Orientation.RightLeft, mBackShadowColors); mBackShadowDrawableRL.SetGradientType(GradientType.LinearGradient); mBackShadowDrawableLR = new GradientDrawable(GradientDrawable.Orientation.LeftRight, mBackShadowColors); mBackShadowDrawableLR.SetGradientType(GradientType.LinearGradient); }
public BaseReadView(Context context, string bookId, List <BookMixAToc.MixToc.Chapters> chaptersList, IOnReadStateChangeListener listener) : base(context) { this.listener = listener; this.bookId = bookId; mScreenWidth = ScreenUtils.getScreenWidth(); mScreenHeight = ScreenUtils.getScreenHeight(); mCurPageBitmap = Bitmap.CreateBitmap(mScreenWidth, mScreenHeight, Bitmap.Config.Argb8888); mNextPageBitmap = Bitmap.CreateBitmap(mScreenWidth, mScreenHeight, Bitmap.Config.Argb8888); mCurrentPageCanvas = new Canvas(mCurPageBitmap); mNextPageCanvas = new Canvas(mNextPageBitmap); mScroller = new Scroller(Context); pagefactory = new PageFactory(Context, bookId, chaptersList); pagefactory.setOnReadStateChangeListener(listener); }
public PageWidget(Context context, string bookId, List <BookMixAToc.MixToc.Chapters> chaptersList, IOnReadStateChangeListener listener) : base(context, bookId, chaptersList, listener) { mPath0 = new Path(); mPath1 = new Path(); mMaxLength = (float)Java.Lang.Math.Hypot(mScreenWidth, mScreenHeight); mPaint = new Paint(); mPaint.SetStyle(Paint.Style.Fill); createDrawable(); ColorMatrix cm = new ColorMatrix();//设置颜色数组 float[] array = { 0.55f, 0, 0, 0, 80.0f, 0, 0.55f, 0, 0, 80.0f, 0, 0, 0.55f, 0, 80.0f, 0, 0, 0, 0.2f, 0 }; cm.Set(array); mColorMatrixFilter = new ColorMatrixColorFilter(cm); mMatrix = new Matrix(); mTouch.X = 0.01f; // 不让x,y为0,否则在点计算时会有问题 mTouch.Y = 0.01f; }
public void setOnReadStateChangeListener(IOnReadStateChangeListener listener) { this.listener = listener; }