示例#1
0
        private void DrawShopping(CGContext context)
        {
            LearnerTemplateStyle shoppingStyle = this.FormsShimmer.ShoppingStyle;
            float lineSpacing = (float)shoppingStyle.LineSpacing;
            float lineHeight  = (float)shoppingStyle.LineHeight;
            float num1        = shoppingStyle.Width >= 0.0 ? (float)shoppingStyle.Width : this.templateWidth;
            float num2        = (shoppingStyle.Height >= 0.0 ? (float)shoppingStyle.Height : this.templateHeight) / 2f;

            context.AddRect(new CGRect((double)this.templateX, (double)this.centerY - (double)num2, (double)num1, (double)num2 * 2.0 - (double)lineHeight * 0.6 * 2.0 - (double)lineSpacing * 0.6 * 2.0 * 1.5));
            context.AddRect(new CGRect((double)this.templateX, (double)this.centerY + (double)num2 - (double)lineHeight * 0.6 * 2.0 - (double)lineSpacing * 0.6, (double)num1, (double)lineHeight * 0.6));
            context.AddRect(new CGRect((double)this.templateX, (double)this.centerY + (double)num2 - (double)lineHeight * 0.6, (double)num1, (double)lineHeight * 0.6));
        }
示例#2
0
        private void DrawVideo(CGContext context)
        {
            LearnerTemplateStyle videoStyle = this.FormsShimmer.VideoStyle;
            float circleRadius = (float)videoStyle.CircleRadius;
            float lineSpacing  = (float)videoStyle.LineSpacing;
            float lineHeight   = (float)videoStyle.LineHeight;
            float width        = videoStyle.Width >= 0.0 ? (float)videoStyle.Width : this.templateWidth;
            float num1         = (videoStyle.Height >= 0.0 ? (float)videoStyle.Height : this.templateHeight) / 2f;
            float num2         = this.templateX + circleRadius * 2f + this.columnSpacing;

            context.AddRect(new CGRect(this.templateX, this.centerY - num1, width, (float)((double)num1 * 2.0 - (double)circleRadius * 2.0) - lineSpacing));
            context.AddEllipseInRect(new CGRect(this.templateX, (float)((double)this.centerY + (double)num1 - (double)circleRadius * 2.0), circleRadius * 2f, circleRadius * 2f));
            context.AddRect(new CGRect((double)num2, (double)this.centerY + (double)num1 - (double)circleRadius * 2.0 + (double)lineSpacing * 0.5, (double)width - (double)this.columnSpacing - (double)circleRadius * 2.0, (double)lineHeight));
            context.AddRect(new CGRect((double)num2, (double)this.centerY + (double)num1 - (double)circleRadius * 2.0 + (double)lineSpacing * 1.5 + (double)lineHeight, (double)width - (double)this.columnSpacing - (double)circleRadius * 2.0, (double)lineHeight));
        }
示例#3
0
        private void DrawPersona(CGContext context)
        {
            LearnerTemplateStyle personaStyle = this.FormsShimmer.PersonaStyle;
            float circleRadius = (float)personaStyle.CircleRadius;
            float lineSpacing  = (float)personaStyle.LineSpacing;
            float lineHeight   = (float)personaStyle.LineHeight;
            float num1         = personaStyle.Width >= 0.0 ? (float)personaStyle.Width : this.templateWidth;
            float num2         = (personaStyle.Height >= 0.0 ? (float)personaStyle.Height : this.templateHeight) / 2f;
            float num3         = (double)num2 > 0.0 ? ((double)circleRadius <= (double)num2 ? circleRadius : num2) : circleRadius;
            float num4         = this.templateX + num3 * 2f + this.columnSpacing;

            context.AddEllipseInRect(new CGRect(this.templateX, this.centerY - num3, num3 * 2f, num3 * 2f));
            context.AddRect(new CGRect((double)num4, (double)this.centerY - (double)num3 + (double)lineSpacing, ((double)num1 - (double)this.columnSpacing - (double)num3 * 2.0) * 0.8, (double)lineHeight));
            context.AddRect(new CGRect((double)num4, (double)this.centerY - (double)num3 + (double)lineSpacing + (double)lineHeight + (double)lineSpacing, ((double)num1 - (double)this.columnSpacing - (double)num3 * 2.0) * 0.5, (double)lineHeight));
        }
示例#4
0
        private void DrawArticle(CGContext context)
        {
            LearnerTemplateStyle articleStyle = this.FormsShimmer.ArticleStyle;
            float lineSpacing = (float)articleStyle.LineSpacing;
            float lineHeight  = (float)articleStyle.LineHeight;
            float squareSize  = (float)articleStyle.SquareSize;
            float num1        = articleStyle.Width >= 0.0 ? (float)articleStyle.Width : this.templateWidth;
            float num2        = (articleStyle.Height >= 0.0 ? (float)articleStyle.Height : this.templateHeight) / 2f;
            float x           = this.templateX + squareSize + this.columnSpacing;

            context.AddRect(new CGRect(this.templateX, this.centerY - num2, squareSize, num2 * 2f));
            context.AddRect(new CGRect(x, this.centerY - num2, num1 - this.columnSpacing - squareSize, lineHeight));
            context.AddRect(new CGRect((double)x, (double)this.centerY - (double)num2 + (double)lineHeight + (double)lineSpacing, ((double)num1 - (double)this.columnSpacing - (double)squareSize) * 0.8, (double)lineHeight));
            context.AddRect(new CGRect((double)x, (double)this.centerY + (double)lineSpacing, ((double)num1 - (double)this.columnSpacing - (double)squareSize) * 0.4, (double)lineHeight));
            context.AddRect(new CGRect((double)x, (double)this.centerY + (double)lineHeight + (double)lineSpacing * 2.0, ((double)num1 - (double)this.columnSpacing - (double)squareSize) * 0.3, (double)lineHeight));
        }
示例#5
0
        private void DrawProfile(CGContext context)
        {
            LearnerTemplateStyle profileStyle = this.FormsShimmer.ProfileStyle;
            float  circleRadius = (float)profileStyle.CircleRadius;
            float  lineSpacing  = (float)profileStyle.LineSpacing;
            float  lineHeight   = (float)profileStyle.LineHeight;
            float  width        = profileStyle.Width >= 0.0 ? (float)profileStyle.Width : this.templateWidth;
            float  num1         = (profileStyle.Height >= 0.0 ? (float)profileStyle.Height : this.templateHeight) / 2f;
            double num2         = (double)width / 2.0;
            float  num3         = width / 2f;

            context.AddEllipseInRect(new CGRect(this.templateX + num3 - circleRadius, this.centerY - num1, circleRadius * 2f, circleRadius * 2f));
            context.AddRect(new CGRect((double)this.templateX + (double)num3 - (double)width * 0.2, (double)this.centerY + (double)lineSpacing, (double)width * 0.2 * 2.0, (double)lineHeight * 2.0));
            context.AddRect(new CGRect((double)this.templateX + (double)num3 - (double)width * 0.3, (double)this.centerY + (double)lineSpacing * 2.0 + (double)lineHeight * 2.0, (double)width * 0.3 * 2.0, (double)lineHeight * 2.0));
            context.AddRect(new CGRect(this.templateX, (float)((double)this.centerY + (double)num1 - (double)lineHeight * 2.0) - lineSpacing, width, lineHeight));
            context.AddRect(new CGRect(this.templateX, this.centerY + num1 - lineHeight, width, lineHeight));
        }
示例#6
0
        private void DrawFeed(CGContext context)
        {
            LearnerTemplateStyle feedStyle = this.FormsShimmer.FeedStyle;
            float circleRadius             = (float)feedStyle.CircleRadius;
            float lineSpacing = (float)feedStyle.LineSpacing;
            float lineHeight  = (float)feedStyle.LineHeight;
            float num1        = feedStyle.Width >= 0.0 ? (float)feedStyle.Width : this.templateWidth;
            float num2        = (feedStyle.Height >= 0.0 ? (float)feedStyle.Height : this.templateHeight) / 2f;
            float num3        = this.templateX + circleRadius * 2f + this.columnSpacing;

            context.AddEllipseInRect(new CGRect(this.templateX, this.centerY - num2, circleRadius * 2f, circleRadius * 2f));
            context.AddRect(new CGRect((double)num3, (double)this.centerY - (double)num2 + (double)lineSpacing * 0.5, (double)num1 - (double)this.columnSpacing - (double)circleRadius * 2.0, (double)lineHeight));
            context.AddRect(new CGRect((double)num3, (double)this.centerY - (double)num2 + (double)lineSpacing * 1.5 + (double)lineHeight, ((double)num1 - (double)this.columnSpacing - (double)circleRadius * 2.0) * 0.5, (double)lineHeight));
            context.AddRect(new CGRect((double)this.templateX, (double)this.centerY - (double)num2 + (double)circleRadius * 2.0 + (double)lineSpacing, (double)num1, (double)num2 * 2.0 - (double)lineHeight * 0.6 * 2.0 - (double)lineSpacing * 0.6 * 2.0 * 1.5 - (double)circleRadius * 2.0 - (double)lineSpacing));
            context.AddRect(new CGRect((double)this.templateX, (double)this.centerY + (double)num2 - (double)lineHeight * 0.6 * 2.0 - (double)lineSpacing * 0.6, (double)num1, (double)lineHeight * 0.6));
            context.AddRect(new CGRect((double)this.templateX, (double)this.centerY + (double)num2 - (double)lineHeight * 0.6, (double)num1, (double)lineHeight * 0.6));
        }
示例#7
0
        private void DrawShopping(Canvas canvas)
        {
            LearnerTemplateStyle shoppingStyle = (this.Element as LearnerShimmer).ShoppingStyle;
            int num1 = (int)(shoppingStyle.LineSpacing * (double)this.density);
            int num2 = (int)(shoppingStyle.LineHeight * (double)this.density);
            int num3 = (int)(shoppingStyle.Width * (double)this.density);

            if (num3 < 0)
            {
                num3 = this.templateWidth;
            }
            int num4 = (int)(shoppingStyle.Height * (double)this.density);
            int num5 = num4 >= 0 ? num4 / 2 : this.templateHeight / 2;

            canvas.DrawRect(new Android.Graphics.Rect(this.templateX, this.centerY - num5, this.templateX + num3, this.centerY + num5 - (int)((double)num2 * 0.6 * 2.0) - (int)((double)num1 * 0.6 * 2.0 * 1.5)), this.shimmerPaint);
            canvas.DrawRect(new Android.Graphics.Rect(this.templateX, this.centerY + num5 - (int)((double)num2 * 0.6 * 2.0) - (int)((double)num1 * 0.6), this.templateX + num3, this.centerY + num5 - (int)((double)num2 * 0.6) - (int)((double)num1 * 0.6)), this.shimmerPaint);
            canvas.DrawRect(new Android.Graphics.Rect(this.templateX, this.centerY + num5 - (int)((double)num2 * 0.6), this.templateX + num3, this.centerY + num5), this.shimmerPaint);
        }
示例#8
0
        private void DrawVideo(Canvas canvas)
        {
            LearnerTemplateStyle videoStyle = (this.Element as LearnerShimmer).VideoStyle;
            int num1 = (int)(videoStyle.CircleRadius * (double)this.density);
            int num2 = (int)(videoStyle.LineSpacing * (double)this.density);
            int num3 = (int)(videoStyle.LineHeight * (double)this.density);
            int num4 = (int)(videoStyle.Width * (double)this.density);

            if (num4 < 0)
            {
                num4 = this.templateWidth;
            }
            int num5 = (int)(videoStyle.Height * (double)this.density);
            int num6 = num5 >= 0 ? num5 / 2 : this.templateHeight / 2;
            int left = this.templateX + num1 * 2 + this.columnSpacing;

            canvas.DrawRect(new Android.Graphics.Rect(this.templateX, this.centerY - num6, this.templateX + num4, this.centerY + num6 - num1 * 2 - num2), this.shimmerPaint);
            canvas.DrawCircle((float)(this.templateX + num1), (float)(this.centerY + num6 - num1), (float)num1, this.shimmerPaint);
            canvas.DrawRect(new Android.Graphics.Rect(left, this.centerY + num6 - num1 * 2 + num2, this.templateX + num4, this.centerY + num6 - num1 * 2 + num2 + num3), this.shimmerPaint);
            canvas.DrawRect(new Android.Graphics.Rect(left, this.centerY + num6 - num1 * 2 + 2 * num2 + num3, this.templateX + num4, this.centerY + num6 - num1 * 2 + num2 + num3 * 2 + num2), this.shimmerPaint);
        }
示例#9
0
        private void DrawPersona(Canvas canvas)
        {
            LearnerTemplateStyle personaStyle = (this.Element as LearnerShimmer).PersonaStyle;
            int num1 = (int)(personaStyle.CircleRadius * (double)this.density);
            int num2 = (int)(personaStyle.LineSpacing * (double)this.density);
            int num3 = (int)(personaStyle.LineHeight * (double)this.density);
            int num4 = (int)(personaStyle.Width * (double)this.density);

            if (num4 < 0)
            {
                num4 = this.templateWidth;
            }
            int num5 = (int)(personaStyle.Height * (double)this.density);
            int num6 = num5 > 0 ? num5 / 2 : this.templateHeight / 2;
            int num7 = num6 > 0 ? (num1 <= num6 ? num1 : num6) : num1;
            int left = this.templateX + num7 * 2 + this.columnSpacing;

            canvas.DrawCircle((float)(this.templateX + num7), (float)this.centerY, (float)num7, this.shimmerPaint);
            canvas.DrawRect(new Android.Graphics.Rect(left, this.centerY - num7 + num2, left + (num4 - num7 * 2 - this.columnSpacing) * 3 / 4, this.centerY - num7 + num2 + num3), this.shimmerPaint);
            canvas.DrawRect(new Android.Graphics.Rect(left, this.centerY - num7 + num2 + num3 + num2, left + (num4 - num7 * 2 - this.columnSpacing) / 2, this.centerY - num7 + 2 * num2 + num3 * 2), this.shimmerPaint);
        }
示例#10
0
        private void DrawArticle(Canvas canvas)
        {
            LearnerTemplateStyle articleStyle = (this.Element as LearnerShimmer).ArticleStyle;
            int num1 = (int)(articleStyle.LineSpacing * (double)this.density);
            int num2 = (int)(articleStyle.LineHeight * (double)this.density);
            int num3 = (int)(articleStyle.SquareSize * (double)this.density);
            int num4 = (int)(articleStyle.Width * (double)this.density);

            if (num4 < 0)
            {
                num4 = this.templateWidth;
            }
            int num5 = (int)(articleStyle.Height * (double)this.density);
            int num6 = num5 >= 0 ? num5 / 2 : this.templateHeight / 2;
            int left = this.templateX + num3 + this.columnSpacing;

            canvas.DrawRect(new Android.Graphics.Rect(this.templateX, this.centerY - num6, this.templateX + num3, this.centerY + num6), this.shimmerPaint);
            canvas.DrawRect(new Android.Graphics.Rect(left, this.centerY - num6, this.templateX + num4, this.centerY - num6 + num2), this.shimmerPaint);
            canvas.DrawRect(new Android.Graphics.Rect(left, this.centerY - num6 + num2 + num1, (num4 - num3 - this.columnSpacing) * 4 / 5 + left, this.centerY - num6 + num2 * 2 + num1), this.shimmerPaint);
            canvas.DrawRect(new Android.Graphics.Rect(left, this.centerY + num1, (num4 - num3 - this.columnSpacing) * 2 / 5 + left, this.centerY + num1 + num2), this.shimmerPaint);
            canvas.DrawRect(new Android.Graphics.Rect(left, this.centerY + num2 + num1 * 2, (num4 - num3 - this.columnSpacing) * 3 / 10 + left, this.centerY + num2 * 2 + num1 * 2), this.shimmerPaint);
        }
示例#11
0
        private void DrawProfile(Canvas canvas)
        {
            LearnerTemplateStyle profileStyle = (this.Element as LearnerShimmer).ProfileStyle;
            int num1 = (int)(profileStyle.CircleRadius * (double)this.density);
            int num2 = (int)(profileStyle.LineSpacing * (double)this.density);
            int num3 = (int)(profileStyle.LineHeight * (double)this.density);
            int num4 = (int)(profileStyle.Width * (double)this.density);

            if (num4 < 0)
            {
                num4 = this.templateWidth;
            }
            int num5 = (int)(profileStyle.Height * (double)this.density);
            int num6 = num5 >= 0 ? num5 / 2 : this.templateHeight / 2;
            int num7 = num4 / 2;

            canvas.DrawCircle((float)(this.templateX + num7), (float)(this.centerY - num6 + num1), (float)num1, this.shimmerPaint);
            canvas.DrawRect(new Android.Graphics.Rect(this.templateX + num7 - num4 / 5, this.centerY + num2, this.templateX + num7 + num4 / 5, this.centerY + num2 + num3 * 2), this.shimmerPaint);
            canvas.DrawRect(new Android.Graphics.Rect(this.templateX + num7 - num4 * 3 / 10, this.centerY + num2 * 2 + num3 * 2, this.templateX + num7 + num4 * 3 / 10, this.centerY + num2 * 2 + num3 * 4), this.shimmerPaint);
            canvas.DrawRect(new Android.Graphics.Rect(this.templateX, this.centerY + num6 - num3 * 2 - num2, this.templateX + num4, this.centerY + num6 - num3 - num2), this.shimmerPaint);
            canvas.DrawRect(new Android.Graphics.Rect(this.templateX, this.centerY + num6 - num3, this.templateX + num4, this.centerY + num6), this.shimmerPaint);
        }
示例#12
0
        private void DrawFeed(Canvas canvas)
        {
            LearnerTemplateStyle feedStyle = (this.Element as LearnerShimmer).FeedStyle;
            int num1 = (int)(feedStyle.CircleRadius * (double)this.density);
            int num2 = (int)(feedStyle.LineSpacing * (double)this.density);
            int num3 = (int)(feedStyle.LineHeight * (double)this.density);
            int num4 = (int)(feedStyle.Width * (double)this.density);

            if (num4 < 0)
            {
                num4 = this.templateWidth;
            }
            int num5 = (int)(feedStyle.Height * (double)this.density);
            int num6 = num5 >= 0 ? num5 / 2 : this.templateHeight / 2;

            canvas.DrawCircle((float)(this.templateX + num1), (float)(this.centerY - num6 + num1), (float)num1, this.shimmerPaint);
            canvas.DrawRect(new Android.Graphics.Rect(this.templateX + num1 * 2 + this.columnSpacing, this.centerY - num6 + num2, this.templateX + num4, this.centerY - num6 + num2 + num3), this.shimmerPaint);
            canvas.DrawRect(new Android.Graphics.Rect(this.templateX + num1 * 2 + this.columnSpacing, this.centerY - num6 + 2 * num2 + num3, this.templateX + num4, this.centerY - num6 + num2 + num3 * 2 + num2), this.shimmerPaint);
            canvas.DrawRect(new Android.Graphics.Rect(this.templateX, this.centerY - num6 + num1 * 2 + num2, this.templateX + num4, this.centerY + num6 - (int)((double)num3 * 0.6 * 2.0) - (int)((double)num2 * 0.6 * 2.0 * 1.5)), this.shimmerPaint);
            canvas.DrawRect(new Android.Graphics.Rect(this.templateX, this.centerY + num6 - (int)((double)num3 * 0.6 * 2.0) - (int)((double)num2 * 0.6), this.templateX + num4, this.centerY + num6 - (int)((double)num3 * 0.6) - (int)((double)num2 * 0.6)), this.shimmerPaint);
            canvas.DrawRect(new Android.Graphics.Rect(this.templateX, this.centerY + num6 - (int)((double)num3 * 0.6), this.templateX + num4, this.centerY + num6), this.shimmerPaint);
        }