private void Init(Context context) { mTextSize = DensityUtil.Dip2Px(context, DEFAULT_TEXT_SIZE); Width = DensityUtil.Dip2Px(context, DEFAULT_WIDTH); Height = DensityUtil.Dip2Px(context, DEFAULT_HEIGHT); mStrokeWidth = DensityUtil.Dip2Px(context, DEFAULT_STROKE_WIDTH); mGasTubeWidth = DensityUtil.Dip2Px(context, DEFAULT_GAS_TUBE_WIDTH); mGasTubeHeight = DensityUtil.Dip2Px(context, DEFAULT_GAS_TUBE_HEIGHT); mCannulaWidth = DensityUtil.Dip2Px(context, DEFAULT_CANNULA_WIDTH); mCannulaHeight = DensityUtil.Dip2Px(context, DEFAULT_CANNULA_HEIGHT); mCannulaOffsetY = DensityUtil.Dip2Px(context, DEFAULT_CANNULA_OFFSET_Y); mCannulaMaxOffsetY = DensityUtil.Dip2Px(context, DEFAULT_CANNULA_MAX_OFFSET_Y); mPipeBodyWidth = DensityUtil.Dip2Px(context, DEFAULT_PIPE_BODY_WIDTH); mPipeBodyHeight = DensityUtil.Dip2Px(context, DEFAULT_PIPE_BODY_HEIGHT); mBalloonWidth = DensityUtil.Dip2Px(context, DEFAULT_BALLOON_WIDTH); mBalloonHeight = DensityUtil.Dip2Px(context, DEFAULT_BALLOON_HEIGHT); mRectCornerRadius = DensityUtil.Dip2Px(context, DEFAULT_RECT_CORNER_RADIUS); mBalloonColor = DEFAULT_BALLOON_COLOR; mGasTubeColor = DEFAULT_GAS_TUBE_COLOR; mCannulaColor = DEFAULT_CANNULA_COLOR; mPipeBodyColor = DEFAULT_PIPE_BODY_COLOR; mProgressText = 10 + PERCENT_SIGN; Duration = ANIMATION_DURATION; }
private void Init(Context context) { mColors = DEFAULT_COLORS; mStrokeWidth = DensityUtil.Dip2Px(context, DEFAULT_STROKE_WIDTH); mCenterRadius = DensityUtil.Dip2Px(context, DEFAULT_CENTER_RADIUS); InitStrokeInSet(Width, Height); }
private void Init(Context context) { mStrokeWidth = DensityUtil.Dip2Px(context, DEFAULT_STROKE_WIDTH); mCenterRadius = DensityUtil.Dip2Px(context, DEFAULT_CENTER_RADIUS); mLevelSwipeDegrees = new float[3]; mLevelColors = DEFAULT_LEVEL_COLORS; }
private void Init(Context context) { mStrokeWidth = DensityUtil.Dip2Px(context, DEFAULT_STROKE_WIDTH); mCenterRadius = DensityUtil.Dip2Px(context, DEFAULT_CENTER_RADIUS); mSkipBallSize = DensityUtil.Dip2Px(context, DEFAULT_SKIP_BALL_RADIUS); mColor = DEFAULT_COLOR; mBallColor = DEFAULT_BALL_COLOR; }
private void Init(Context context) { mStrokeWidth = DensityUtil.Dip2Px(context, DEFAULT_STROKE_WIDTH); mCenterRadius = DensityUtil.Dip2Px(context, DEFAULT_CENTER_RADIUS); mColor = DEFAULT_COLOR; mGearCount = GEAR_COUNT; mGearSwipeDegrees = DEFAULT_GEAR_SWIPE_DEGREES; }
private void Init(Context context) { mStrokeWidth = DensityUtil.Dip2Px(context, DEFAULT_STROKE_WIDTH); mCenterRadius = DensityUtil.Dip2Px(context, DEFAULT_CENTER_RADIUS); mDanceBallRadius = DensityUtil.Dip2Px(context, DEFAULT_DANCE_BALL_RADIUS); Color = DEFAULT_COLOR; SetInsets((int)Width, (int)Height); Duration = ANIMATION_DURATION; }
private void Init(Context context) { Width = DensityUtil.Dip2Px(context, DEFAULT_WIDTH); Height = DensityUtil.Dip2Px(context, DEFAULT_HEIGHT); mStrokeWidth = DensityUtil.Dip2Px(context, DEFAULT_STROKE_WIDTH); mWaitCircleRadius = DensityUtil.Dip2Px(context, WAIT_CIRCLE_RADIUS); mTopColor = Color.White; mMiddleColor = Color.ParseColor("#FFF3C742"); mBottomColor = Color.ParseColor("#FF89CC59"); Duration = ANIMATION_DURATION; }
private void Init(Context context) { Width = DensityUtil.Dip2Px(context, DEFAULT_WIDTH); Height = DensityUtil.Dip2Px(context, DEFAULT_HEIGHT); mBallRadius = DensityUtil.Dip2Px(context, DEFAULT_BALL_RADIUS); mStrokeWidth = DensityUtil.Dip2Px(context, DEFAULT_STROKE_WIDTH); mColor = DEFAULT_COLOR; Duration = ANIMATION_DURATION; mBallCount = DEFAULT_CIRCLE_COUNT; mBallInterval = mBallRadius; }
private void Init(Context context) { mBallRadius = DensityUtil.Dip2Px(context, DEFAULT_BALL_RADIUS); Width = DensityUtil.Dip2Px(context, DEFAULT_WIDTH); Height = DensityUtil.Dip2Px(context, DEFAULT_HEIGHT); mOvalVerticalRadius = DensityUtil.Dip2Px(context, DEFAULT_OVAL_HEIGHT); mColors = DEFAULT_COLORS; mPositions = DEFAULT_POSITIONS; mBallCount = DEFAULT_BALL_COUNT; //mBallMoveYOffsets = mBallQuadCoefficient * mBallMoveXOffsets ^ 2 // ==> if mBallMoveYOffsets == mBallMoveXOffsets // ==> mBallQuadCoefficient = 1.0f / mBallMoveXOffsets; mBallMoveXOffsets = 1.5f * (2 * mBallRadius); mBallQuadCoefficient = 1.0f / mBallMoveXOffsets; }
private void Init(Context context) { Width = DensityUtil.Dip2Px(context, DEFAULT_WIDTH); Height = DensityUtil.Dip2Px(context, DEFAULT_HEIGHT); mRiverBankWidth = DensityUtil.Dip2Px(context, DEFAULT_RIVER_BANK_WIDTH); mPathFullLineSize = DensityUtil.Dip2Px(context, DEFAULT_PATH_FULL_LINE_SIZE); mPathDottedLineSize = DensityUtil.Dip2Px(context, DEFAULT_PATH_DOTTED_LINE_SIZE); mFishWidth = DensityUtil.Dip2Px(context, DEFAULT_FISH_WIDTH); mFishHeight = DensityUtil.Dip2Px(context, DEFAULT_FISH_HEIGHT); mFishEyeSize = DensityUtil.Dip2Px(context, DEFAULT_FISH_EYE_SIZE); mRiverWidth = DensityUtil.Dip2Px(context, DEFAULT_RIVER_WIDTH); mRiverHeight = DensityUtil.Dip2Px(context, DEFAULT_RIVER_HEIGHT); mColor = DEFAULT_COLOR; Duration = ANIMATION_DURATION; }
private void Init(Context context) { Width = DensityUtil.Dip2Px(context, DEFAULT_WIDTH); Height = DensityUtil.Dip2Px(context, DEFAULT_HEIGHT); mEyeEdgeWidth = DensityUtil.Dip2Px(context, DEFAULT_EYE_EDGE_WIDTH); mEyeInterval = DensityUtil.Dip2Px(context, DEFAULT_EYE_CIRCLE_INTERVAL); mEyeBallOffsetY = DensityUtil.Dip2Px(context, DEFAULT_EYE_BALL_OFFSET_Y); mEyeCircleRadius = DensityUtil.Dip2Px(context, DEFAULT_EYE_CIRCLE_RADIUS); mMaxEyeJumptDistance = DensityUtil.Dip2Px(context, DEFAULT_MAX_EYE_JUMP_DISTANCE); mAboveRadianEyeOffsetX = DensityUtil.Dip2Px(context, DEFAULT_ABOVE_RADIAN_EYE_CIRCLE_OFFSET); mEyeBallWidth = DensityUtil.Dip2Px(context, DEFAULT_EYE_BALL_WIDTH); mEyeBallHeight = DensityUtil.Dip2Px(context, DEFAULT_EYE_BALL_HEIGHT); mColor = DEFAULT_COLOR; Duration = ANIMATION_DURATION; }
private void Init(Context context) { mTextSize = DensityUtil.Dip2Px(context, DEFAULT_TEXT_SIZE); Width = DensityUtil.Dip2Px(context, DEFAULT_Width); Height = DensityUtil.Dip2Px(context, DEFAULT_Height); mStrokeWidth = DensityUtil.Dip2Px(context, DEFAULT_STROKE_Width); mBottleWidth = DensityUtil.Dip2Px(context, DEFAULT_BOTTLE_Width); mBottleHeight = DensityUtil.Dip2Px(context, DEFAULT_BOTTLE_Height); mWaterLowestPointToBottleneckDistance = DensityUtil.Dip2Px(context, WATER_LOWEST_POINT_TO_BOTTLENECK_DISTANCE); mBottleColor = DEFAULT_BOTTLE_COLOR; mWaterColor = DEFAULT_WATER_COLOR; mWaveCount = DEFAULT_WAVE_COUNT; Duration = ANIMATION_DURATION; }
private void Init(Context context) { Width = DensityUtil.Dip2Px(context, DEFAULT_WIDTH); Height = DensityUtil.Dip2Px(context, DEFAULT_HEIGHT); mMaxMotherOvalSize = DensityUtil.Dip2Px(context, MAX_MATHER_OVAL_SIZE); mBasicChildOvalRadius = DensityUtil.Dip2Px(context, MIN_CHILD_OVAL_RADIUS); mOvalColor = DEFAULT_OVAL_COLOR; mOvalDeepColor = DEFAULT_OVAL_DEEP_COLOR; mBackgroundColor = DEFAULT_BACKGROUND_COLOR; mBackgroundDeepColor = DEFAULT_BACKGROUND_DEEP_COLOR; mMotherOvalHalfWidth = mMaxMotherOvalSize; mMotherOvalHalfHeight = mMaxMotherOvalSize; mMaxRevealCircleRadius = (int)(Math.Sqrt(Width * Width + Height * Height) / 2 + 1); Duration = ANIMATION_DURATION; }
private void Init(Context context) { Width = DensityUtil.Dip2Px(context, DEFAULT_Width); Height = DensityUtil.Dip2Px(context, DEFAULT_Height); mStrokeWidth = DensityUtil.Dip2Px(context, DEFAULT_STROKE_Width); mStarRadius = DensityUtil.Dip2Px(context, DEFAULT_STAR_RADIUS); mSun_MoonRadius = DensityUtil.Dip2Px(context, DEFAULT_SUN_MOON_RADIUS); mInitSun_MoonCoordinateY = Height + mSun_MoonRadius + mStrokeWidth * 2.0f; mMaxSun_MoonRiseDistance = Height / 2.0f + mSun_MoonRadius; mSunRayStartCoordinateY = mInitSun_MoonCoordinateY - mMaxSun_MoonRiseDistance - mSun_MoonRadius - mStrokeWidth - DensityUtil.Dip2Px(context, DEFAULT_SUN_RAY_OFFSET); //sub the interval between the sun and the sun ray - sub the with the sun circle - sub the radius - the center //add strokeWidth * 2.0f because the stroke cap is Paint.Cap.ROUND mSunRayEndCoordinateY = mSunRayStartCoordinateY - DensityUtil.Dip2Px(context, DEFAULT_SUN_RAY_LENGTH) + mStrokeWidth; mSunCoordinateY = mInitSun_MoonCoordinateY; mMoonCoordinateY = mInitSun_MoonCoordinateY; mCurrentColor = DEFAULT_COLOR; Duration = ANIMATION_DURATION; }
private void Init(Context context) { mMode = MODE_NORMAL; Width = DensityUtil.Dip2Px(context, DEFAULT_Width); Height = DensityUtil.Dip2Px(context, DEFAULT_Height); mTextSize = DensityUtil.Dip2Px(context, DEFAULT_TEXT_SIZE); mStrokeWidth = DensityUtil.Dip2Px(context, DEFAULT_STROKE_Width); mCenterRadius = DensityUtil.Dip2Px(context, DEFAULT_CENTER_RADIUS); mProgressCenterRadius = DensityUtil.Dip2Px(context, DEFAULT_PROGRESS_CENTER_RADIUS); mProgressColor = DEFAULT_PROGRESS_COLOR; mProgressBgColor = DEFAULT_PROGRESS_BGCOLOR; mElectricFanBgColor = DEFAULT_ELECTRIC_FAN_BGCOLOR; mElectricFanOutlineColor = DEFAULT_ELECTRIC_FAN_OUTLINE_COLOR; mLeafDrawable = context.GetDrawable(Resource.Drawable.ic_leaf); mLoadingDrawable = context.GetDrawable(Resource.Drawable.ic_loading); mElectricFanDrawable = context.GetDrawable(Resource.Drawable.ic_eletric_fan); Duration = ANIMATION_DURATION; SetInsets((int)Width, (int)Height); }
private void InitParams(Context context) { Width = DensityUtil.Dip2Px(context, DEFAULT_SIZE); Height = DensityUtil.Dip2Px(context, DEFAULT_SIZE); Duration = ANIMATION_DURATION; }