Esempio n. 1
0
        public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions)
        {
            planVC    = new PlanViewController();
            myPlansVC = new MyPlansViewController();
            navCon    = new UINavigationController(myPlansVC);
            navCon.NavigationBar.BarTintColor        = Util.Green;
            navCon.NavigationBar.TintColor           = UIColor.White;
            navCon.NavigationBar.TitleTextAttributes = new UIStringAttributes()
            {
                ForegroundColor = UIColor.White,
                Font            = UIFont.FromName(Util.FontMain, 20)
            };
//			navCon.NavigationBar.titlet

            // Override point for customization after application launch.
            // If not required for your application you can safely delete this method

            Util.navController = navCon;


            Window = new UIWindow(UIScreen.MainScreen.Bounds);
            Window.RootViewController = navCon;
            Window.MakeKeyAndVisible();

            return(true);
        }
 public PlanTableSource(List <PlanModel> _plans, string _id, PlanViewController _planVC)
 {
     plans  = _plans;
     id     = _id;
     planVC = _planVC;
 }
        public PlanTableCell(List <PlanModel> _plans, float _cellHt, int _index, PlanViewController _planVC) : base(UITableViewCellStyle.Value1, Key)
        {
            plans  = _plans;
            cellHt = _cellHt;
            index  = _index;
            planVC = _planVC;

            ContentView.BackgroundColor = Util.BackgroundGrey;

            difficulty      = MakeLabel(Util.Lightblue, 14);
            difficulty.Text = "DIFFICULTY";
            frequency       = MakeLabel(Util.Lightblue, 14);
            frequency.Text  = "FREQUENCY";
            duration        = MakeLabel(Util.Lightblue, 14);
            duration.Text   = "LENGTH";
            freqVal         = MakeLabel(Util.Black, 24);
            durVal          = MakeLabel(Util.Black, 24);
            difLow          = MakeLowerLabel("");
            freqLow         = MakeLowerLabel("Per Week");
            durLow          = MakeLowerLabel("Weeks");
            color           = new UILabel()
            {
                Text            = "",
                BackgroundColor = Util.Green
            };
            color.Layer.CornerRadius = 10;
            color.ClipsToBounds      = true;

            container = new UIView();
            container.BackgroundColor = UIColor.White;

            workoutType = new UILabel()
            {
                BackgroundColor = Util.Purple,
                Font            = UIFont.FromName(Util.FontMain, 20),
                TextColor       = UIColor.FromRGBA(1.0f, 1.0f, 1.0f, 0.8f),
                TextAlignment   = UITextAlignment.Left,
            };

            name = new UILabel()
            {
                BackgroundColor = UIColor.Clear,
                Font            = UIFont.FromName(Util.FontMain, 24),
                TextColor       = Util.Black,
                TextAlignment   = UITextAlignment.Center
            };

            leftDiv  = MakeDivider();
            rightDiv = MakeDivider();

            trainerImg = new UIImageView()
            {
                ContentMode     = UIViewContentMode.ScaleAspectFill,
                BackgroundColor = UIColor.Clear
            };
            workoutIcon = new UIImageView()
            {
                ContentMode     = UIViewContentMode.ScaleAspectFill,
                BackgroundColor = UIColor.Clear,
                TintColor       = UIColor.FromRGBA(1.0f, 1.0f, 1.0f, 0.8f),
            };

            trainerImg.Layer.CornerRadius = ((ContentView.Frame.Width / 3) / 2) - 6;
            trainerImg.ClipsToBounds      = true;

            trainerName = MakeLabel(Util.Black, 16);
            trainerName.TextAlignment = UITextAlignment.Left;

            trainerCred               = MakeLabel(Util.Grey, 12);
            trainerCred.Lines         = 0;
            trainerCred.TextAlignment = UITextAlignment.Left;

            bottomView = new UIView()
            {
                BackgroundColor = UIColor.FromRGB(241, 241, 241)
            };

            price     = MakeLabel(Util.Black, 32);
            detailsBt = new UIButton(UIButtonType.RoundedRect)
            {
                BackgroundColor = UIColor.Clear,
                Font            = UIFont.FromName(Util.FontMain, 16)
            };
            detailsBt.SetTitle("+ Details", UIControlState.Normal);
            detailsBt.SetTitleColor(Util.Black, UIControlState.Normal);
            detailsBt.Layer.BorderWidth  = 1;
            detailsBt.Layer.BorderColor  = Util.Grey.CGColor;
            detailsBt.Layer.CornerRadius = 4;
            detailsBt.ClipsToBounds      = true;

            leftShadow   = MakeShadow();
            bottomShadow = MakeShadow();
            rightShadow  = MakeShadow();

            ContentView.InsertSubview(container, 0);

            container.AddSubview(workoutType);
            container.AddSubview(name);
            container.AddSubview(difficulty);
            container.AddSubview(frequency);
            container.AddSubview(duration);
            container.AddSubview(durVal);
            container.AddSubview(freqVal);
            container.AddSubview(color);
            container.AddSubview(freqLow);
            container.AddSubview(difLow);
            container.AddSubview(durLow);
            container.AddSubview(leftDiv);
            container.AddSubview(rightDiv);
            container.AddSubview(trainerImg);
            container.AddSubview(trainerName);
            container.AddSubview(trainerCred);
            container.AddSubview(bottomView);
            container.AddSubview(price);
            container.AddSubview(detailsBt);
            container.AddSubview(leftShadow);
            container.AddSubview(bottomShadow);
            container.AddSubview(rightShadow);
            container.AddSubview(workoutIcon);
        }