Exemple #1
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            this.SetContentView(Resource.Layout.SignaturePad);

            var rootView = this.FindViewById <RelativeLayout>(Resource.Id.rootView);

            this.signatureView = this.FindViewById <NativeView>(Resource.Id.signatureView);
            this.btnSave       = this.FindViewById <Button>(Resource.Id.btnSave);
            this.btnCancel     = this.FindViewById <Button>(Resource.Id.btnCancel);

            var cfg = this.Resolve().CurrentConfig;

            rootView.SetBackgroundColor(cfg.MainBackgroundColor.ToAndroid());
            this.signatureView.BackgroundColor = cfg.SignatureBackgroundColor.ToAndroid();
            this.signatureView.Caption.Text    = cfg.CaptionText;
            this.signatureView.Caption.SetTextColor(cfg.CaptionTextColor.ToAndroid());
            this.signatureView.ClearLabel.Text = cfg.ClearText;
            this.signatureView.ClearLabel.SetTextColor(cfg.ClearTextColor.ToAndroid());
            this.signatureView.SignatureLineColor   = cfg.SignatureLineColor.ToAndroid();
            this.signatureView.SignaturePrompt.Text = cfg.PromptText;
            this.signatureView.SignaturePrompt.SetTextColor(cfg.PromptTextColor.ToAndroid());
            this.signatureView.StrokeColor = cfg.StrokeColor.ToAndroid();
            this.signatureView.StrokeWidth = cfg.StrokeWidth;

            this.btnSave.Text   = cfg.SaveText;
            this.btnCancel.Text = cfg.CancelText;
        }
        protected override void OnCreate(Bundle bundle) {
            base.OnCreate(bundle);
            this.SetContentView(Resource.Layout.SignaturePad);

            var rootView = this.FindViewById<RelativeLayout>(Resource.Id.rootView);
            this.signatureView = this.FindViewById<NativeView>(Resource.Id.signatureView);
            this.btnSave = this.FindViewById<Button>(Resource.Id.btnSave);
            this.btnCancel = this.FindViewById<Button>(Resource.Id.btnCancel);

            var cfg = this.Resolve().CurrentConfig;
            rootView.SetBackgroundColor(cfg.MainBackgroundColor.ToAndroid());
            this.signatureView.BackgroundColor = cfg.SignatureBackgroundColor.ToAndroid();
            this.signatureView.Caption.Text = cfg.CaptionText;
            this.signatureView.Caption.SetTextColor(cfg.CaptionTextColor.ToAndroid());
            this.signatureView.ClearLabel.Text = cfg.ClearText;
            this.signatureView.ClearLabel.SetTextColor(cfg.ClearTextColor.ToAndroid());
            this.signatureView.SignatureLineColor = cfg.SignatureLineColor.ToAndroid(); 
            this.signatureView.SignaturePrompt.Text = cfg.PromptText;
            this.signatureView.SignaturePrompt.SetTextColor(cfg.PromptTextColor.ToAndroid());
            this.signatureView.StrokeColor = cfg.StrokeColor.ToAndroid();
            this.signatureView.StrokeWidth = cfg.StrokeWidth;

            this.btnSave.Text = cfg.SaveText;
            this.btnCancel.Text = cfg.CancelText;
        }
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            this.SetContentView(Resource.Layout.SignaturePad);

            var rootView = this.FindViewById <RelativeLayout>(Resource.Id.rootView);

            this.signatureView = this.FindViewById <NativeView>(Resource.Id.signatureView);
            this.btnSave       = this.FindViewById <Button>(Resource.Id.btnSave);
            this.btnCancel     = this.FindViewById <Button>(Resource.Id.btnCancel);

            var cfg = SignatureService.CurrentConfig;

            rootView.SetBackgroundColor(cfg.MainBackgroundColor.ToAndroid());
            this.signatureView.BackgroundColor = cfg.SignatureBackgroundColor.ToAndroid();
            this.signatureView.Caption.Text    = cfg.CaptionText;
            this.signatureView.Caption.SetTextColor(cfg.CaptionTextColor.ToAndroid());
            this.signatureView.ClearLabel.Text = cfg.ClearText;
            this.signatureView.ClearLabel.SetTextColor(cfg.ClearTextColor.ToAndroid());
            this.signatureView.SignatureLineColor   = cfg.SignatureLineColor.ToAndroid();
            this.signatureView.SignaturePrompt.Text = cfg.PromptText;
            this.signatureView.SignaturePrompt.SetTextColor(cfg.PromptTextColor.ToAndroid());
            this.signatureView.StrokeColor = cfg.StrokeColor.ToAndroid();
            this.signatureView.StrokeWidth = cfg.StrokeWidth;

            this.btnSave.Text   = cfg.SaveText;
            this.btnCancel.Text = cfg.CancelText;

//            if (SignatureService.CurrentPoints != null) {
//                this.btnSave.Visibility = ViewStates.Gone;
//                this.btnCancel.Visibility = ViewStates.Gone;
////                this.signatureView.Enabled = false;
//                this.signatureView.LoadPoints(
//                    SignatureService
//                        .CurrentPoints
//                        .Select(x => new PointF { X = x.X, Y = x.Y })
//                        .ToArray()
//                );
//            }
        }
        protected override void OnCreate(Bundle bundle) {
            base.OnCreate(bundle);
            this.SetContentView(Resource.Layout.SignaturePad);

            var rootView = this.FindViewById<RelativeLayout>(Resource.Id.rootView);
            this.signatureView = this.FindViewById<NativeView>(Resource.Id.signatureView);
            this.btnSave = this.FindViewById<Button>(Resource.Id.btnSave);
            this.btnCancel = this.FindViewById<Button>(Resource.Id.btnCancel);

            var cfg = SignatureService.CurrentConfig;

            rootView.SetBackgroundColor(cfg.MainBackgroundColor.ToAndroid());
            this.signatureView.BackgroundColor = cfg.SignatureBackgroundColor.ToAndroid();
            this.signatureView.Caption.Text = cfg.CaptionText;
            this.signatureView.Caption.SetTextColor(cfg.CaptionTextColor.ToAndroid());
            this.signatureView.ClearLabel.Text = cfg.ClearText;
            this.signatureView.ClearLabel.SetTextColor(cfg.ClearTextColor.ToAndroid());
            this.signatureView.SignatureLineColor = cfg.SignatureLineColor.ToAndroid(); 
            this.signatureView.SignaturePrompt.Text = cfg.PromptText;
            this.signatureView.SignaturePrompt.SetTextColor(cfg.PromptTextColor.ToAndroid());
            this.signatureView.StrokeColor = cfg.StrokeColor.ToAndroid();
            this.signatureView.StrokeWidth = cfg.StrokeWidth;

            this.btnSave.Text = cfg.SaveText;
            this.btnCancel.Text = cfg.CancelText;

//            if (SignatureService.CurrentPoints != null) {
//                this.btnSave.Visibility = ViewStates.Gone;
//                this.btnCancel.Visibility = ViewStates.Gone;
////                this.signatureView.Enabled = false;
//                this.signatureView.LoadPoints(
//                    SignatureService
//                        .CurrentPoints
//                        .Select(x => new PointF { X = x.X, Y = x.Y })
//                        .ToArray()
//                );
//            }
        }