public override void GetPlaceholderTemplate(CLKComplication complication, Action<CLKComplicationTemplate> handler)
        {
            Console.WriteLine ("GetPlaceholderTemplate");
            CLKComplicationTemplate template = null;
            if (complication.Family == CLKComplicationFamily.ModularSmall) {
                var textTemplate = new CLKComplicationTemplateModularSmallRingText ();
                textTemplate.TextProvider = CLKSimpleTextProvider.FromText ("XAM1");
                template = textTemplate;
            } else if (complication.Family == CLKComplicationFamily.UtilitarianSmall) {
                var textTemplate = new CLKComplicationTemplateUtilitarianSmallFlat ();
                textTemplate.TextProvider = CLKSimpleTextProvider.FromText ("XAM2");
                template = textTemplate;
            } else if (complication.Family == CLKComplicationFamily.UtilitarianLarge) {
                var textTemplate = new CLKComplicationTemplateUtilitarianLargeFlat ();
                textTemplate.TextProvider = CLKSimpleTextProvider.FromText ("XAM3");
                template = textTemplate;
            } else if (complication.Family == CLKComplicationFamily.CircularSmall) {
                var textTemplate = new CLKComplicationTemplateCircularSmallRingText ();
                textTemplate.TextProvider = CLKSimpleTextProvider.FromText ("XS");
                template = textTemplate;
            }
            else
            {
                Console.WriteLine ("GetPlaceholderTemplate: Complication not supported");
            }

            handler (template);
        }
		public override void GetPlaceholderTemplate (CLKComplication complication, Action<CLKComplicationTemplate> handler)
		{
			Console.WriteLine ("GetPlaceholderTemplate");
			CLKComplicationTemplate template = null;
			if (complication.Family == CLKComplicationFamily.ModularSmall) {
				var textTemplate = new CLKComplicationTemplateModularSmallRingText ();
				textTemplate.TextProvider = CLKSimpleTextProvider.FromText ("XAM1");
				template = textTemplate;
			} else if (complication.Family == CLKComplicationFamily.UtilitarianSmall) {
				var textTemplate = new CLKComplicationTemplateUtilitarianSmallFlat ();
				textTemplate.TextProvider = CLKSimpleTextProvider.FromText ("XAM2");
				template = textTemplate;
			} else if (complication.Family == CLKComplicationFamily.UtilitarianLarge) {
				var textTemplate = new CLKComplicationTemplateUtilitarianLargeFlat ();
				textTemplate.TextProvider = CLKSimpleTextProvider.FromText ("XAM3");
				template = textTemplate;
			} else if (complication.Family == CLKComplicationFamily.CircularSmall) {
				var textTemplate = new CLKComplicationTemplateCircularSmallRingText ();
				textTemplate.TextProvider = CLKSimpleTextProvider.FromText ("XS");
				template = textTemplate;
			}
			else	 
			{
				Console.WriteLine ("GetPlaceholderTemplate: Complication not supported");
			}

			handler (template);
		}
Exemplo n.º 3
0
        private CLKComplicationTemplate CreateComplicationTemplate(CLKComplicationFamily complicationFamily, string complicationText)
        {
            CLKComplicationTemplate template = null;

            switch (complicationFamily)
            {
            case CLKComplicationFamily.ModularSmall:
                template = new CLKComplicationTemplateModularSmallRingText()
                {
                    TextProvider = CLKSimpleTextProvider.FromText(complicationText),
                    FillFraction = 0.75f,
                    RingStyle    = CLKComplicationRingStyle.Open
                };
                break;

            case CLKComplicationFamily.ModularLarge:
                template = new CLKComplicationTemplateModularLargeStandardBody()
                {
                    HeaderTextProvider = CLKSimpleTextProvider.FromText("My Complication"),
                    Body1TextProvider  = CLKSimpleTextProvider.FromText(complicationText),
                    Body2TextProvider  = CLKTimeTextProvider.FromDate(NSDate.Now)
                };
                break;
            }

            return(template);
        }
Exemplo n.º 4
0
        public override void GetPlaceholderTemplate(CLKComplication complication, Action <CLKComplicationTemplate> handler)
        {
            Console.WriteLine("GetPlaceholderTemplate for " + complication);

            CLKComplicationTemplate template = null;

            if (complication.Family == CLKComplicationFamily.ModularSmall)
            {
                var textTemplate = new CLKComplicationTemplateModularSmallRingText();
                textTemplate.TextProvider = CLKSimpleTextProvider.FromText("XAM1");
                template = textTemplate;
            }
            else if (complication.Family == CLKComplicationFamily.ModularLarge)
            {
                var textTemplate = new CLKComplicationTemplateModularLargeStandardBody();
                textTemplate.HeaderTextProvider = CLKSimpleTextProvider.FromText("Header A", "A 2", "~~~");
                textTemplate.Body1TextProvider  = CLKSimpleTextProvider.FromText("Body B", "B 2", "~~~");
                template = textTemplate;
            }
            else if (complication.Family == CLKComplicationFamily.UtilitarianSmall)
            {
                var textTemplate = new CLKComplicationTemplateUtilitarianSmallFlat();
                textTemplate.TextProvider = CLKSimpleTextProvider.FromText("XAM2");
                template = textTemplate;
            }
            else if (complication.Family == CLKComplicationFamily.UtilitarianLarge)
            {
                var textTemplate = new CLKComplicationTemplateUtilitarianLargeFlat();
                textTemplate.TextProvider = CLKSimpleTextProvider.FromText("XAM3");
                template = textTemplate;
            }
            else if (complication.Family == CLKComplicationFamily.CircularSmall)
            {
                var textTemplate = new CLKComplicationTemplateCircularSmallRingText();
                textTemplate.TextProvider = CLKSimpleTextProvider.FromText("s");
                template = textTemplate;
            }
            else
            {
                Console.WriteLine("GetPlaceholderTemplate: Complication not supported (" + complication + ")");
            }

            handler(template);
        }