Beispiel #1
0
        //this comment should only be available in dev
        //this comment should only be available in release branch
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate (bundle);
            var surfaceOrientation = WindowManager.DefaultDisplay.Rotation;

            mainLayout = viewResource.LinLayout (this);
            if(surfaceOrientation == SurfaceOrientation.Rotation0 || surfaceOrientation == SurfaceOrientation.Rotation180)
            {
                mainLayout.Orientation = Orientation.Vertical;
            }
            else if (surfaceOrientation == SurfaceOrientation.Rotation90 || surfaceOrientation == SurfaceOrientation.Rotation270)
            {
                mainLayout.Orientation = Orientation.Horizontal;
            }

            topLayout = viewResource.LinLayout (this);
            topLayout.Id = 1;
            topLayout.WeightSum = 1;
            //topLayout.SetMinimumHeight(mainLayout.Height * .25);

            bottomLayout = viewResource.LinLayout (this);
            bottomLayout.Id = 2;
            bottomLayout.WeightSum = 1;
            //bottomLayout.SetMinimumHeight( mainLayout.Height * .75);

            LoadFragments ();

            mainLayout.AddView (topLayout);
            mainLayout.AddView (bottomLayout);

            SetContentView (mainLayout);

            Console.WriteLine(mainLayout.ToString ());
        }
Beispiel #2
0
        public void AddSpinner(ViewGroup rootview,string loadingtext)
        {
            loading = true;
            if(loadingcontainer==null||(loadingcontainer!=null&&!loadingcontainer.IsShown)){
                loadingcontainer = new RelativeLayout (nn_activity);
                loadingcontainer.LayoutParameters = new RelativeLayout.LayoutParams (RelativeLayout.LayoutParams.MatchParent, RelativeLayout.LayoutParams.MatchParent);
                loadingcontainer.SetBackgroundColor (Color.White);

                var detailcontainer = new LinearLayout (nn_activity);

                detailcontainer.Orientation = Orientation.Vertical;
                RelativeLayout.LayoutParams param = new RelativeLayout.LayoutParams ((int)TapUtil.dptodx (100), RelativeLayout.LayoutParams.WrapContent);
                param.AddRule (LayoutRules.CenterInParent);
                detailcontainer.LayoutParameters = param;

                LinearLayout.LayoutParams linearlayoutparm = new LinearLayout.LayoutParams (LinearLayout.LayoutParams.MatchParent, LinearLayout.LayoutParams.WrapContent);
                linearlayoutparm.Gravity = GravityFlags.CenterHorizontal;

                ProgressBar progressbar = new ProgressBar (nn_activity);
                progressbar.LayoutParameters = linearlayoutparm;

                TextView tectview = new TextView (nn_activity);
                tectview.LayoutParameters = linearlayoutparm;
                tectview.Text = loadingtext;
                tectview.Gravity = GravityFlags.CenterHorizontal;

                detailcontainer.AddView (progressbar);
                detailcontainer.AddView (tectview);

                loadingcontainer.AddView (detailcontainer);
                rootview.AddView (loadingcontainer);
            }
        }
 //-----------clicking on images -> image on fullscreen---------//
 protected void ImageZoom(ImageView imageView, string Tag, LinearLayout fullScreen, LinearLayout downScreen, Button takeIt)
 {
     imageView.Click += ((object sender, System.EventArgs e) => {
         Log.Info(Tag, "isImageFitToScreen: " + isImageFitToScreen.ToString());
         if (isImageFitToScreen) {
             downScreen.RemoveView(imageView);
             imageView.SetMaxHeight (1500);
             imageView.SetMaxWidth (1500);
             fullScreen.AddView(imageView);
             fullScreen.AddView(takeIt);
             Log.Info(Tag, "maximize");
             canBeSelected = true;
             isImageFitToScreen = false;
         } else {
             fullScreen.RemoveView(takeIt);
             fullScreen.RemoveView(imageView);
             imageView.SetMaxHeight (450);
             imageView.SetMaxWidth (450);
             downScreen.AddView(imageView);
             Log.Info(Tag, "minimize");
             canBeSelected = false;
             isImageFitToScreen = true;
         }
     });
 }
Beispiel #4
0
		void Initialize ()
		{
			this.LayoutParameters = new RelativeLayout.LayoutParams(-1,Configuration.getHeight (412));// LinearLayout.LayoutParams (Configuration.getWidth (582), Configuration.getHeight (394));
			this.SetGravity(GravityFlags.Center);


			image = new RelativeLayout(context);
			txtDescription = new TextView (context);
			txtTitle = new TextView (context);
			background = new LinearLayout (context);

			image.SetGravity (GravityFlags.Center);
			background.LayoutParameters = new LinearLayout.LayoutParams (Configuration.getWidth (530), Configuration.getHeight (356));
			background.Orientation = Orientation.Vertical;
			background.SetBackgroundColor (Color.ParseColor ("#50000000"));

			image.LayoutParameters = new RelativeLayout.LayoutParams (Configuration.getWidth (582), Configuration.getHeight (394));

			txtTitle.SetTextColor (Color.ParseColor("#ffffff"));
			txtDescription.SetTextColor(Color.ParseColor("#ffffff"));
			txtTitle.SetTextSize (ComplexUnitType.Px, Configuration.getHeight (40));
			txtDescription.SetTextSize (ComplexUnitType.Px, Configuration.getHeight (30));

			background.AddView (txtTitle);
			background.AddView (txtDescription);



			image.AddView (background);

			this.AddView (image);
			//this.AddView (background);


		}
Beispiel #5
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            var layot = new LinearLayout(this);
            layot.Orientation = Orientation.Vertical;

            _btn1 = new Button(this);
            _btn1.SetText(Resource.String.Button1Text);
            _btn1.Click += OnClickButton1;

            _btn2 = new Button(this);
            _btn2.SetText(Resource.String.Button2Text);
            _btn2.Click += OnClickButton2;

            _btn3 = new Button(this);
            _btn3.SetText(Resource.String.Button3Text);
            _btn3.Click += OnClickButton3;

            _btn4 = new Button(this);
            _btn4.SetText(Resource.String.Button4Text);
            _btn4.Click += OnClickButton4;

            layot.AddView(_btn1);
            layot.AddView(_btn2);
            layot.AddView(_btn3);
            layot.AddView(_btn4);
            SetContentView(layot);
        }
Beispiel #6
0
		void Initialize ()
		{
			this.LayoutParameters = new RelativeLayout.LayoutParams(-1,-1);
			this.SetGravity(GravityFlags.CenterHorizontal);

			mainLinearLayout = new LinearLayout (context);
			mainLinearLayout.LayoutParameters = new LinearLayout.LayoutParams (-1, -1);
			mainLinearLayout.Orientation = Orientation.Vertical;

			imBack = new ImageView (context);
			txtDescription = new TextView (context);
			txtTitle = new TextView (context);

			txtTitle.SetTextSize (ComplexUnitType.Fraction, Configuration.getHeight(38));
			txtDescription.SetTextSize (ComplexUnitType.Fraction, Configuration.getHeight(32));
			txtTitle.Typeface =  Typeface.CreateFromAsset(context.Assets, "fonts/ArcherMediumPro.otf");
			txtDescription.Typeface =  Typeface.CreateFromAsset(context.Assets, "fonts/ArcherMediumPro.otf");


			int padW = Configuration.getWidth(30);
			int padH = Configuration.getHeight (0);
			this.SetPadding (padW,padH,padW,padH);
	
			mainLinearLayout.AddView (txtTitle);
			mainLinearLayout.AddView (imBack);
			mainLinearLayout.AddView (txtDescription);

			this.AddView (mainLinearLayout);
			//this.AddView (background);


		}
		public override Android.Views.View GetSampleContent (Android.Content.Context context)
		{
			LinearLayout layout= new LinearLayout(context);
			layout.Orientation = Orientation.Vertical;
			TextView textView= new TextView(context);
			textView.TextSize = 16;
			textView.SetPadding(10,20,0,0);
			textView.SetHeight(70);

			textView.Text ="Top Population Countries With Bubbles";
			layout.AddView(textView);
			textView.Gravity = Android.Views.GravityFlags.Top;
			maps = new SfMaps (context);
			ShapeFileLayer layer = new ShapeFileLayer ();
			layer.ShowItems = true;
			layer.Uri ="world1.shp";
			layer.DataSource = GetDataSource();
			layer.ShapeIdPath = "Country";
			layer.ShapeIdTableField = "NAME";
			layer.ShapeSettings = new ShapeSetting ();
			layer.ShapeSettings.ShapeValuePath= "ShortName";
			layer.ShapeSettings.ShapeFill = Color.ParseColor ("#A9D9F7");
			BubbleMarkerSetting marker = new BubbleMarkerSetting ()
			{  FillColor = Color.ParseColor ("#ffa500"), MinSize=15,MaxSize=25, ValuePath="Population" };
			layer.BubbleMarkerSetting = marker;
			maps.Layers.Add (layer);
			layout.AddView (maps);
			return layout;
		}
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            var layout = new LinearLayout(this) {
                Orientation = Orientation.Vertical
            };
            this.AddContentView(layout, new ViewGroup.LayoutParams(-1, -1));

            this.T1 = new TextView(this);
            this.T2 = new TextView(this) {
                Text = DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss")
            };

            layout.AddView(this.T1);
            layout.AddView(this.T2);

            var btn = new Button(this) {
                Text = "Search"
            };

            btn.Click += Btn_Click;
            layout.AddView(btn);

            this.HandleIntent(this.Intent);
        }
Beispiel #9
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate (bundle);

            ScrollView _scrl = new ScrollView (this);
            LinearLayout _linear = new LinearLayout (this);
            _linear.Orientation = Orientation.Vertical;
            _scrl.AddView (_linear);

            Button _addBtn = new Button (this);
            _addBtn.Text = "Click to add TextViiews and EditTexts";
            _linear.AddView (_addBtn);

            _addBtn.Click += (sender, e) => {

                // TODO Auto-generated method stub
                count++;

                TextView _text = new TextView (ApplicationContext);
                _text.Text = "Number : " + count.ToString();
                _linear.AddView(_text);

                EditText _edit = new EditText(ApplicationContext);
                _edit.Text = " Edit Text : " + count.ToString();
                _linear.AddView(_edit);

            };

            this.SetContentView (_scrl);
        }
Beispiel #10
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            // Use this to return your custom view for this Fragment
            // return inflater.Inflate(Resource.Layout.YourFragment, container, false);
            //return base.OnCreateView (inflater, container, savedInstanceState);

            linLayout = viewResource.LinLayout (this.Activity);
            //linLayout.Id = 1;
            txtViewTitle = viewResource.TextViewTitle (this.Activity);
            txtViewTitle.SetPadding (10, 10, 10, 10);

            button = viewResource.BtnOne (this.Activity);
            button.Click += OnButtonClick;
            button.Text = "Click me!";

            buttonTwo = viewResource.BtnTwo (this.Activity);

            txtViewTwo = viewResource.TextViewOne(this.Activity);
            txtViewTwo.Text = "Click the button!";

            subLayout = viewResource.SubLinLayout (this.Activity);

            subLayout.AddView (txtViewTwo);
            subLayout.AddView (button);
            subLayout.AddView (buttonTwo);

            linLayout.AddView (subLayout);
            linLayout.SetBackgroundColor (Android.Graphics.Color.BlueViolet);

            return linLayout;
        }
        private void CreateLayout()
        {
            // Create a new vertical layout for the app
            var layout = new LinearLayout(this) { Orientation = Orientation.Vertical };

            // Create a label for showing the load status for the public service
            _publicLayerLabel = new TextView(this);
            _publicLayerLabel.Text = PublicLayerName;
            _publicLayerLabel.TextSize = 12;
            _publicLayerLabel.SetTextColor(Color.Gray);
            layout.AddView(_publicLayerLabel);

            // Create a label to show the load status of the secured layer
            _secureLayerLabel = new TextView(this);
            _secureLayerLabel.Text = SecureLayerName;
            _secureLayerLabel.TextSize = 12;
            _secureLayerLabel.SetTextColor(Color.Gray);
            layout.AddView(_secureLayerLabel);

            // Add the map view to the layout
            layout.AddView(_myMapView);

            // Show the layout in the app
            SetContentView(layout);
        }
        protected override void OnDraw(Canvas canvas)
        {
            base.OnDraw(canvas);

            var actionBar = ((Activity)Context).ActionBar;
            LinearLayout layout = new LinearLayout(Context);
            layout.Orientation = Orientation.Horizontal;
            layout.WeightSum = 100;
            TextView title = new TextView(Context);
            title.Text = actionBar.Title;

            title.TextSize = 18;
            Typeface font = Typeface.CreateFromAsset(Forms.Context.Assets, "BTrafcBd.ttf");
            title.Typeface = font;

            LayoutParams textlp = new LayoutParams(LayoutParams.MatchParent, LayoutParams.MatchParent);

            ImageView logo = new ImageView(Context);
            logo.SetImageResource(Resource.Drawable.Logo);
            LayoutParams imglp = new LayoutParams(LayoutParams.MatchParent, LayoutParams.MatchParent);

            layout.AddView(title, textlp);
            layout.AddView(logo, imglp);
            actionBar.SetCustomView(layout, new ActionBar.LayoutParams(LayoutParams.MatchParent, LayoutParams.MatchParent));
            actionBar.SetDisplayOptions(ActionBarDisplayOptions.ShowCustom, ActionBarDisplayOptions.ShowCustom);
        }
        public override void Login(LoginConfig config)
        {
            var context = Utils.GetActivityContext();
            var txtUser = new EditText(context) {
                Hint = config.LoginPlaceholder,
                Text = config.LoginValue ?? String.Empty
            };
            var txtPass = new EditText(context) {
                Hint = config.PasswordPlaceholder,
                TransformationMethod = PasswordTransformationMethod.Instance
            };
            var layout = new LinearLayout(context) {
                Orientation = Orientation.Vertical
            };
            layout.AddView(txtUser, ViewGroup.LayoutParams.MatchParent);
            layout.AddView(txtPass, ViewGroup.LayoutParams.MatchParent);

            Utils.RequestMainThread(() =>
                new AlertDialog
                    .Builder(Utils.GetActivityContext())
                    .SetTitle(config.Title)
                    .SetMessage(config.Message)
                    .SetView(layout)
                    .SetPositiveButton(config.OkText, (o, e) =>
                        config.OnResult(new LoginResult(txtUser.Text, txtPass.Text, true))
                    )
                    .SetNegativeButton(config.CancelText, (o, e) =>
                        config.OnResult(new LoginResult(txtUser.Text, txtPass.Text, false))
                    )
                    .Show()
            );
        }
		public override View GetPropertyWindowLayout (Android.Content.Context context)
		{
			LinearLayout linear = new LinearLayout (context);
			linear.Orientation = Orientation.Vertical;
			allowsorting = new CheckBox (context);
			allowtristatesorting = new CheckBox (context);
			allowsortingforSupplierID = new CheckBox (context);
			allowsortingforProductID = new CheckBox (context);

			allowsorting.Text = "Allow Sorting";
			allowtristatesorting.Text = "Allow TriState Sorting";
			allowsortingforSupplierID.Text = "Allow Sorting For SupplierID";
			allowsortingforProductID.Text = "Allow Sorting For ProductID";

			allowsorting.Checked = true;
			allowtristatesorting.Checked = true;
			allowsortingforSupplierID.Checked = true;
			allowsortingforProductID.Checked = true;

			allowsorting.CheckedChange += OnAllowSortingChanged;
			allowtristatesorting.CheckedChange += OnAllowTriStateSortingChanged;
			allowsortingforProductID.CheckedChange += OnSortingForProductIDChanged;
			allowsortingforSupplierID.CheckedChange += OnSortingForSupplierIDChanged;
			linear.AddView (allowsorting);
			linear.AddView (allowtristatesorting);
			linear.AddView (allowsortingforSupplierID);
			linear.AddView (allowsortingforProductID);
			return linear;
		}
Beispiel #15
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            if (container == null)
            {
                // Currently in a layout without a container, so no reason to create our view.
                return null;
            }

            var scroller = new ScrollView(Activity);
            var llayout = new LinearLayout (Activity);
            llayout.Orientation = Orientation.Vertical;
            var text = new TextView(Activity);
            var padding = Convert.ToInt32(TypedValue.ApplyDimension(ComplexUnitType.Dip, 4, Activity.Resources.DisplayMetrics));
            text.SetPadding(padding, padding, padding, padding);
            text.TextSize = 24;
            var doc = DoctorManager.GetDoctor (ShownPlayId);
            var hosp = HospitalManager.GetHospital (doc.HospitalID);
            text.Text = "Фамилия: " + doc.FirstName + "\n\n" +
            "Имя: " + doc.SecondName + "\n\n" +
            "Отчество: " + doc.ThirdName + "\n\n" +
            "Больница: " + hosp.Name + "\n\n" +
            "Адрес: " + hosp.Adress;
                //Shakespeare.Dialogue[ShownPlayId];
            llayout.AddView(text);

            Spinner spn = new Spinner (Activity);

            var preses = Presentations.GetPresentations ();

            List<String> presentsTitle = new List<String>();
            for (int i = 0; i < preses.Count; i++) {
                for (int j = 0; j < preses[i].parts.Count; j++) {
                    presentsTitle.Add (preses [i].name + "." + preses [i].parts [j].name);
                }
            }
            spn.Adapter = new ArrayAdapter<String>(Activity, Android.Resource.Layout.SimpleListItemChecked, presentsTitle.ToArray());
            llayout.AddView(spn);

            Button btnSlide = new Button (Activity);
            btnSlide.Text = "Начать показ!";
            btnSlide.Click += (sender, e) => {
                var slides = new Intent ( Activity, typeof(PresentationView));
                int presentationID = 0;
                int partID = spn.SelectedItemPosition;
                for (int i=0; (i <= preses.Count-1) && (partID > preses[i].parts.Count-1); i++){
                    presentationID = i+1;
                    partID = partID - preses [i].parts.Count;
                }
                slides.PutExtra ("presentationID", presentationID);
                slides.PutExtra ("partID", partID);
                slides.PutExtra ("doctorID", ShownPlayId);
                StartActivity (slides);
            };
            llayout.AddView (btnSlide);

            scroller.AddView (llayout);
            return scroller;
        }
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            var rootLayout = new LinearLayout(this)
            {
                LayoutParameters =
                    new ViewGroup.LayoutParams(ViewGroup.LayoutParams.FillParent, ViewGroup.LayoutParams.FillParent),
                Orientation = Orientation.Vertical
            };

            var header = new TextView(this)
            {
                Text = "Log in",
                TextSize = 30,
                LayoutParameters =
                    new ViewGroup.LayoutParams(ViewGroup.LayoutParams.FillParent, ViewGroup.LayoutParams.WrapContent)
            };
            header.SetPadding(5, 11, 0, 11);
            

            rootLayout.AddView(header);

            var description = new TextView(this)
            {
                Text = "Log in the application with your account of choice.",
                TextSize = 15,
                LayoutParameters =
                    new ViewGroup.LayoutParams(ViewGroup.LayoutParams.FillParent, ViewGroup.LayoutParams.WrapContent)
            };
            description.SetPadding(5, 11, 5, 11);
            

            rootLayout.AddView(description);

            loginView = new AccessControlIdentityProviderListView(this)
            {
                LayoutParameters =
                    new ViewGroup.LayoutParams(ViewGroup.LayoutParams.FillParent, ViewGroup.LayoutParams.FillParent),
                Orientation = Orientation.Vertical
            };

            loginView.NavigateToIdentityProvider += loginView_NavigateToIdentityProvider;

            var realm = Intent.GetStringExtra("monodroid.watoolkit.library.login.realm");
            var acsNamespace = Intent.GetStringExtra("monodroid.watoolkit.library.login.acsNamespace");

            loginView.Realm = realm;
            loginView.ServiceNamespace = acsNamespace;

            rootLayout.AddView(loginView);

            SetContentView(rootLayout);

            loginView.GetSecurityToken();
        }
Beispiel #17
0
		void Initialize ()
		{
			this.LayoutParameters = new RelativeLayout.LayoutParams(-1,Configuration.getHeight (412));// LinearLayout.LayoutParams (Configuration.getWidth (582), Configuration.getHeight (394));
			this.SetGravity(GravityFlags.Center);


			image = new RelativeLayout(context);

			txtTitle = new TextView (context);
			background = new LinearLayout (context);
			linearTitle = new LinearLayout (context);
			linearButton = new LinearLayout (context);
			imgPlay = new ImageButton (context);

			image.SetGravity (GravityFlags.Bottom);
			background.LayoutParameters = new LinearLayout.LayoutParams (Configuration.getWidth (582), Configuration.getHeight (111));
			background.Orientation = Orientation.Horizontal;
			background.SetBackgroundColor (Color.ParseColor ("#50000000"));

			linearTitle.LayoutParameters = new LinearLayout.LayoutParams (Configuration.getWidth (482), Configuration.getHeight (111));
			linearTitle.Orientation = Orientation.Horizontal;
			linearTitle.SetGravity (GravityFlags.Center);

			linearButton.LayoutParameters = new LinearLayout.LayoutParams (Configuration.getWidth (100), Configuration.getHeight (111));
			linearButton.Orientation = Orientation.Horizontal;
			linearButton.SetGravity (GravityFlags.Center);


			image.LayoutParameters = new RelativeLayout.LayoutParams (Configuration.getWidth (582), Configuration.getHeight (394));
			//image.SetGravity (GravityFlags.Bottom);
			imgPlay.Alpha = 255.0f;
			imgPlay.SetBackgroundColor (Color.Transparent);

			txtTitle.SetTextColor (Color.ParseColor("#ffffff"));
			txtTitle.SetPadding (Configuration.getWidth (20), 0, 0, 0);
			txtTitle.SetTextSize (ComplexUnitType.Px, Configuration.getHeight (40));
			txtTitle.Ellipsize = Android.Text.TextUtils.TruncateAt.End;
			txtTitle.SetMaxLines (2);

			//imgPlay.SetImageBitmap (Bitmap.CreateStxtcaledBitmap (getBitmapFromAsset ("icons/"), Configuration.getWidth (83), Configuration.getHeight (83), true));
			linearTitle.AddView (txtTitle);
			linearButton.AddView (imgPlay);

			background.AddView (linearTitle);
			background.AddView (linearButton);



			image.AddView (background);

			this.AddView (image);
			//this.AddView (background);


		}
Beispiel #18
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            // Set our view from the "main" layout resource
            LinearLayout ll = new LinearLayout(this);
            TextView tv = new TextView(this);
            ll.AddView(tv);
            ll.AddView(new DrawingView(this, new TextView(this)));
            SetContentView(ll);
        }
        protected override void OnCreate (Bundle bundle)
        {
            base.OnCreate (bundle);

            RequestWindowFeature(WindowFeatures.IndeterminateProgress);

            Database = Manager.SharedInstance.GetDatabase(Tag.ToLower());

            Query = List.GetQuery(Database);
            Query.Completed += (sender, e) => 
                Log.Verbose("MainActivity", e.ErrorInfo.ToString() ?? e.Rows.ToString());
            LiveQuery = Query.ToLiveQuery();

            var layout = new LinearLayout(this);
            layout.LayoutParameters = new ViewGroup.LayoutParams(
                ViewGroup.LayoutParams.MatchParent, 
                ViewGroup.LayoutParams.MatchParent);
            layout.Orientation = Orientation.Vertical;

            // Allow user to add Items.
            var newItemText = new EditText(this)
            {   // Ensure we get a 'done' key instead of carriage return.
                InputType = Android.Text.InputTypes.ClassText
            };
            newItemText.LayoutParameters = new LinearLayout.LayoutParams(
                ViewGroup.LayoutParams.MatchParent, 
                ViewGroup.LayoutParams.WrapContent);

            newItemText.KeyPress += (sender, e) => 
            {
                e.Handled = false;
                if (e.KeyCode == Keycode.Enter) {
                    if (e.Event.Action == KeyEventActions.Down 
                        && newItemText.Text.Length > 0) {
                        AddItem(newItemText.Text);
                    }
                    newItemText.Text = "";
                }
                e.Handled = false;
            };
            layout.AddView(newItemText);

            // Create our table
            var listView = new ListView(this);
            listView.LayoutParameters = new LinearLayout.LayoutParams(
                ViewGroup.LayoutParams.MatchParent, 
                ViewGroup.LayoutParams.MatchParent);
            listView.Adapter = new ListLiveQueryAdapter(this, LiveQuery);
            layout.AddView(listView);

            SetContentView (layout);
        }
        public TestResultsGroupView(Context context, TestRunInfo testRunInfo) : base(context)
        {
            var indicatorView = new View(context)
            {
                LayoutParameters = new LayoutParams(18, 18)
                {
                    LeftMargin = 60,
                    RightMargin = 14,
                    TopMargin = 14,
                    BottomMargin = 14,
                    Gravity = GravityFlags.CenterVertical
                }
            };
            indicatorView.SetBackgroundColor(
                testRunInfo.IsIgnored ? Color.Yellow
                : testRunInfo.Running ? Color.Gray
                : testRunInfo.Passed ? Color.Green
                : Color.Red);
            AddView(indicatorView);

            var container = new LinearLayout(context)
            {
                Orientation = Orientation.Vertical,
                LayoutParameters =
                    new ViewGroup.LayoutParams(ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent)
            };
            AddView(container);

            var text1 = new TextView(context)
            {
                Text = testRunInfo.Description,
                Ellipsize = TextUtils.TruncateAt.Marquee,
                LayoutParameters =
                    new LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent)
            };
            text1.SetTextSize(ComplexUnitType.Sp, 22);
            text1.SetSingleLine(true);
            text1.SetPadding(2, 2, 2, 2);
            container.AddView(text1);

            var text2 = new TextView(context)
            {
                Text = testRunInfo.TestCaseName,
                Ellipsize = TextUtils.TruncateAt.Marquee,
                LayoutParameters =
                    new LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent)
            };
            text2.SetTextSize(ComplexUnitType.Sp, 14);
            text2.SetSingleLine(true);
            text2.SetPadding(2, 2, 2, 2);
            container.AddView(text2);
        }
		public override View GetSampleContent (Context con)
		{


            LinearLayout linear = new LinearLayout(con);
            linear.SetBackgroundColor(Color.White);
            linear.Orientation = Orientation.Vertical;
            linear.SetPadding(10, 10, 10, 10);

            TextView text1 = new TextView(con);
            text1.TextSize = 16;
            text1.SetTextColor(Color.ParseColor("#262626"));
            text1.Typeface = Typeface.DefaultBold;
            text1.Text = "Allowed Characters";
            text1.SetPadding(5, 10, 10, 5);
            linear.AddView(text1);

            TextView text2 = new TextView(con);
            text2.TextSize = 14;
            text2.SetTextColor(Color.ParseColor("#3F3F3F"));
            text2.Text = "All 128 ASCII Characters";
            text2.SetPadding(5, 5, 5, 5);
            LinearLayout text2Layout = new LinearLayout(con);
            LinearLayout.LayoutParams parms = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MatchParent, LinearLayout.LayoutParams.WrapContent);
            text2Layout.LayoutParameters = parms;
            text2Layout.AddView(text2);
            linear.AddView(text2Layout);

            LinearLayout barcodeLayout = new LinearLayout(con);
            barcodeLayout.SetPadding(0, 10, 0, 5);
            LinearLayout.LayoutParams parms1 = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MatchParent, LinearLayout.LayoutParams.WrapContent);
            barcodeLayout.LayoutParameters = parms1;

            barcode = new SfBarcode(con);
            barcode.Text = "G71C0453";
            Typeface fontFamily = Typeface.Create("helvetica", TypefaceStyle.Bold);
            barcode.TextFont = fontFamily;
            barcode.SetBackgroundColor(Color.ParseColor("#F2F2F2"));
            barcode.Symbology = BarcodeSymbolType.Code39Extended;
            barcode.TextSize = 20;

            Code39ExtendedSettings setting = new Code39ExtendedSettings();
            setting.BarHeight = 120;
            setting.NarrowBarWidth = 3;
            barcode.SymbologySettings = setting;
            barcodeLayout.AddView(barcode);
            linear.AddView(barcodeLayout);

            return linear;        
		}
Beispiel #22
0
		public BaseCellView(Context context, Cell cell) : base(context)
		{
			_cell = cell;
			SetMinimumWidth((int)context.ToPixels(25));
			SetMinimumHeight((int)context.ToPixels(25));
			Orientation = Orientation.Horizontal;

			var padding = (int)context.FromPixels(8);
			SetPadding(padding, padding, padding, padding);

			_imageView = new ImageView(context);
			var imageParams = new LayoutParams(ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.MatchParent)
			{
				Width = (int)context.ToPixels(60),
				Height = (int)context.ToPixels(60),
				RightMargin = 0,
				Gravity = GravityFlags.Center
			};
			using (imageParams)
				AddView(_imageView, imageParams);

			var textLayout = new LinearLayout(context) { Orientation = Orientation.Vertical };

			_mainText = new TextView(context);
			_mainText.SetSingleLine(true);
			_mainText.Ellipsize = TextUtils.TruncateAt.End;
			_mainText.SetPadding((int)context.ToPixels(15), padding, padding, padding);
			_mainText.SetTextAppearanceCompat(context, global::Android.Resource.Style.TextAppearanceSmall);

			using (var lp = new LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent))
				textLayout.AddView(_mainText, lp);

			_detailText = new TextView(context);
			_detailText.SetSingleLine(true);
			_detailText.Ellipsize = TextUtils.TruncateAt.End;
			_detailText.SetPadding((int)context.ToPixels(15), padding, padding, padding);
			_detailText.Visibility = ViewStates.Gone;
			_detailText.SetTextAppearanceCompat(context, global::Android.Resource.Style.TextAppearanceSmall);

			using (var lp = new LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent))
				textLayout.AddView(_detailText, lp);

			var layoutParams = new LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent) { Width = 0, Weight = 1, Gravity = GravityFlags.Center };

			using (layoutParams)
				AddView(textLayout, layoutParams);

			SetMinimumHeight((int)context.ToPixels(DefaultMinHeight));
			_androidDefaultTextColor = Color.FromUint((uint)_mainText.CurrentTextColor);
		}
		public override View GetSampleContent (Context con)
		{

            LinearLayout linear = new LinearLayout(con);
            linear.SetBackgroundColor(Color.White);
            linear.Orientation = Orientation.Vertical;
            linear.SetPadding(10, 10, 10, 10);

            TextView text1 = new TextView(con);
            text1.TextSize = 16;
            text1.SetTextColor(Color.ParseColor("#262626"));
            text1.Typeface = Typeface.DefaultBold;
            text1.Text = "Allowed Characters";
            text1.SetPadding(5, 10, 10, 5);
            linear.AddView(text1);

            TextView text2 = new TextView(con);
            text2.TextSize = 14;
            text2.SetTextColor(Color.ParseColor("#3F3F3F"));
            text2.Text = "ASCII values from 32 to 127\nSPACE ! \" # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \\ ]^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~ DEL";
            text2.SetPadding(5, 5, 5, 5);
            LinearLayout text2Layout = new LinearLayout(con);
            LinearLayout.LayoutParams parms = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MatchParent, LinearLayout.LayoutParams.WrapContent);
            text2Layout.LayoutParameters = parms;
            text2Layout.AddView(text2);
            linear.AddView(text2Layout);

            LinearLayout barcodeLayout = new LinearLayout(con);
            barcodeLayout.SetPadding(0, 10, 0, 5);
            LinearLayout.LayoutParams parms1 = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MatchParent, LinearLayout.LayoutParams.WrapContent);
            barcodeLayout.LayoutParameters = parms1;

            barcode = new SfBarcode(con);
            barcode.Text = "ISBN-678504";
            Typeface fontFamily = Typeface.Create("helvetica", TypefaceStyle.Bold);
            barcode.TextFont = fontFamily;
            barcode.SetBackgroundColor(Color.ParseColor("#F2F2F2"));
            barcode.Symbology = BarcodeSymbolType.Code128B;
            barcode.TextSize = 20;

            Code128BSettings setting = new Code128BSettings();
            setting.BarHeight = 120;
            setting.NarrowBarWidth = 3;
            barcode.SymbologySettings = setting;
            barcodeLayout.AddView(barcode);
            linear.AddView(barcodeLayout);

            return linear;
		}
        public override View GetSampleContent(Context context)
        {
            chart = new SfChart(context); ;
            chart.SetBackgroundColor(Color.White);

            chart.PrimaryAxis = new NumericalAxis ();
            chart.SecondaryAxis = new NumericalAxis { };

            var series = new LineSeries
            {
                DataSource = MainPage.GetSeriesData1(),
            };
            chart.Series.Add(series);

            series = new LineSeries
            {
                DataSource = MainPage.GetSeriesData2(),
            };
            chart.Series.Add(series);

            series = new LineSeries
            {
                DataSource = MainPage.GetSeriesData3(),
            };        
            chart.Series.Add(series);

            chart.Behaviors.Add(new ChartTrackballBehavior());

            var label = new TextView(context);;
            label.SetPadding(5, 5, 5, 5);
            label.Text = "Press and hold to enable trackball.";

            var layout = new LinearLayout(context){ Orientation = Android.Widget.Orientation.Vertical };

            var layoutLabel = new LinearLayout(context)
            {
                Orientation = Android.Widget.Orientation.Horizontal,
                LayoutParameters =
                    new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent)
            };

            layoutLabel.SetHorizontalGravity(GravityFlags.CenterHorizontal);
            layoutLabel.AddView(label);
            
            layout.AddView(layoutLabel);
            layout.AddView(chart);

            return layout;
        }
        private void CreateLayout()
        {
            // Create a new vertical layout for the app
            var layout = new LinearLayout(this) { Orientation = Orientation.Vertical };

            // Create control to show the maps' loading status
            _loadStatusTextView = new TextView(this);
            layout.AddView(_loadStatusTextView);

            // Add the map view to the layout
            layout.AddView(_myMapView);

            // Show the layout in the app
            SetContentView(layout);
        }
        private View CreateView(TestRunInfo testRunDetails)
        {
            LinearLayout layout = new LinearLayout(this);
            layout.Orientation = Orientation.Vertical;

            TextView titleTextView = new TextView(this);
            titleTextView.LayoutParameters = new LinearLayout.LayoutParams(
                LinearLayout.LayoutParams.FillParent, 48);

            titleTextView.SetBackgroundColor(Color.Argb(255,50,50,50));
            titleTextView.SetPadding(20,0,20,0);

            titleTextView.Gravity = GravityFlags.CenterVertical;
            titleTextView.Text = testRunDetails.Description;
            titleTextView.Ellipsize = TextUtils.TruncateAt.Start;

            TextView descriptionTextView = new TextView(this);
            descriptionTextView.LayoutParameters = new LinearLayout.LayoutParams(
                LinearLayout.LayoutParams.FillParent, LinearLayout.LayoutParams.WrapContent)
            {
                LeftMargin = 40,
                RightMargin = 40
            };

           if (testRunDetails.Running)
    		{
				descriptionTextView.Text = "Test is currently running.";
			}
			else if (testRunDetails.Passed)
			{
				descriptionTextView.Text = "wohhoo, Test has passed.";
			}
			else if (testRunDetails.TestResult != null)
			{
				descriptionTextView.Text = testRunDetails.TestResult.Message + "\r\n\r\n" + testRunDetails.TestResult.StackTrace;	
			}

            ScrollView scrollView = new ScrollView(this);
            scrollView.LayoutParameters = new LinearLayout.LayoutParams(
                LinearLayout.LayoutParams.FillParent, LinearLayout.LayoutParams.FillParent);

            scrollView.AddView(descriptionTextView);

            layout.AddView(titleTextView);
            layout.AddView(scrollView);

            return layout;
        }
		public override View GetSampleContent (Context con)
		{
            LinearLayout linear = new LinearLayout(con);
            linear.SetBackgroundColor(Color.White);
            linear.Orientation = Orientation.Vertical;
            linear.SetPadding(10, 10, 10, 10);

            TextView text1 = new TextView(con);
            text1.TextSize = 16;
            text1.SetTextColor(Color.ParseColor("#262626"));
            text1.Typeface = Typeface.DefaultBold;
            text1.Text = "Allowed Characters";
            text1.SetPadding(5, 10, 10, 5);
            linear.AddView(text1);

            TextView text2 = new TextView(con);
            text2.TextSize = 14;
            text2.SetTextColor(Color.ParseColor("#3F3F3F"));
            text2.Text = "ASCII values from 0 to 95\nNUL SOH STX ETX EOT ENQ ACK BEL BS HT LF VT FF CR SO SI DLE DC1 DC2 DC3 DC4 NAK SYN ETB CAN EM SUB ESC FS GS RS US SPACE ! \" # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \\ ]^ _";
            text2.SetPadding(5, 5, 5, 5);
            LinearLayout text2Layout = new LinearLayout(con);
            LinearLayout.LayoutParams parms = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MatchParent, LinearLayout.LayoutParams.WrapContent);
            text2Layout.LayoutParameters = parms;
            text2Layout.AddView(text2);
            linear.AddView(text2Layout);

            LinearLayout barcodeLayout = new LinearLayout(con);
            barcodeLayout.SetPadding(0, 10, 0, 5);
            LinearLayout.LayoutParams parms1 = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MatchParent, LinearLayout.LayoutParams.WrapContent);
            barcodeLayout.LayoutParameters = parms1;

            barcode = new SfBarcode(con);
            barcode.Text = "ACL32 SF-D8";
            Typeface fontFamily = Typeface.Create("helvetica", TypefaceStyle.Bold);
            barcode.TextFont = fontFamily;
            barcode.SetBackgroundColor(Color.ParseColor("#F2F2F2"));
            barcode.Symbology = BarcodeSymbolType.Code128A;
            barcode.TextSize = 20;

            Code128ASettings setting = new Code128ASettings();
            setting.BarHeight = 120;
            setting.NarrowBarWidth = 3;
            barcode.SymbologySettings = setting;
            barcodeLayout.AddView(barcode);
            linear.AddView(barcodeLayout);

            return linear;
		}
        protected override void OnElementChanged(ElementChangedEventArgs<Page> e) {

            base.OnElementChanged(e);
            myAMapPage = e.NewElement as TencentMapPage;
            layout1 = new LinearLayout(this.Context);
            this.AddView(layout1);

            mapView = new MapView(this.Context) {                
                LayoutParameters = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent)
            };            
            LatLng SHANGHAI = new LatLng( 31.238068,  121.501654);            
            mapView.Map.SetCenter(SHANGHAI);

            var pins = myAMapPage.Pins;

            Drawable d = Resources.GetDrawable(Resource.Drawable.red_location);
            Bitmap bitmap = ((BitmapDrawable)d).Bitmap;
            LatLng latLng1;
            foreach (UserTaskEntInfo pin in pins) {
                latLng1 = new LatLng(pin.Longitude ?? 31.238068, pin.Latitude ?? 121.501654);                
                var markOption = new MarkerOptions();
                markOption.InvokeIcon(new BitmapDescriptor(bitmap));
                markOption.InvokeTitle(pin.Name);
                markOption.InvokePosition(latLng1);
                var fix = mapView.Map.AddMarker(markOption);
                fix.ShowInfoWindow();
            }
            mapView.Map.SetZoom(15); 
            mapView.OnCreate(bundle);
            layout1.AddView(mapView);

        }
Beispiel #29
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            rootview = (RelativeLayout)inflater.Inflate (Resource.Layout.raffleroot, container, false);
            locationcontainerlayout=(LinearLayout)rootview.FindViewById (Resource.Id.raffleroot_locationcontainer_linerlayout);

            TextView locationtext=new TextView(nn_activity);
            locationtext.Text=nn_location;
            LinearLayout.LayoutParams param=new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WrapContent,LinearLayout.LayoutParams.WrapContent);
            param.Gravity=global::Android.Views.GravityFlags.Center;
            param.LeftMargin=TapUtil.dptodx(5);
            locationtext.LayoutParameters=param;
            locationcontainerlayout.AddView (locationtext);

            //initialize listview
            listview=(ListView)rootview.FindViewById(Resource.Id.raffleroot_eventlist_listview);
            listview.Divider = null;
            adapter = new EventListAdapter (nn_activity,eventcards);
            listview.Adapter = adapter;
            //adapter.NotifyListChange ();

            listview.ItemClick+= (object sender, AdapterView.ItemClickEventArgs e) => {
                (nn_activity as HomeScreen).ShowRaffleDetailFragment(e.Position);

            };

            return rootview;
        }
Beispiel #30
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate (bundle);

            Xamarin.Motion.Tweener.Sync = this;
            canvas = new Canvas (this.BaseContext);
            canvas.SetBackground (new Color (1, 1, 1));

            coverflow = new Xamarin.Canvas.Controls.Coverflow (new [] {
                "cover1.jpg", "cover2.jpg", "cover3.jpg", "cover4.jpg", "cover5.jpg", "cover6.jpg",
                "cover7.jpg", "cover8.jpg", "cover9.jpg", "cover10.jpg", "cover1.jpg", "cover2.jpg", "cover3.jpg",
                "cover4.jpg", "cover5.jpg", "cover6.jpg", "cover7.jpg", "cover8.jpg", "cover9.jpg", "cover10.jpg",
            });

            canvas.Root.Add (coverflow);
            canvas.Root.SizeChanged += (sender, e) => {
                coverflow.WidthRequest = canvas.Root.Width;
                coverflow.HeightRequest = canvas.Root.Height;
            };

            LinearLayout layout = new LinearLayout (BaseContext);
            SetContentView (layout);

            layout.AddView (canvas);
        }
Beispiel #31
0
 private void AddInfoView(object sender, View view)
 {
     AndroidApplication.Logger.Debug(() => $"MainActivity: AddInfoView");
     RunOnUiThread(() =>
     {
         NoDriveDataView.Visibility        = ViewStates.Gone;
         DriveInfoContainerView.Visibility = ViewStates.Visible;
         DriveInfoContainerView?.AddView(view);
     });
 }
Beispiel #32
0
        private LinearLayout CreateSeatSelectionPage()
        {
            LinearLayout seatSelectionMainLayout = new LinearLayout(context);

            seatSelectionMainLayout.Orientation = Android.Widget.Orientation.Vertical;
            seatSelectionMainLayout.SetBackgroundColor(Color.White);


            LinearLayout numberOfSeatsLayout = new LinearLayout(context);

            numberOfSeatsLayout.Orientation = Android.Widget.Orientation.Horizontal;

            if (MainActivity.IsTablet)
            {
                numberOfSeatsLayout.AddView(CreateSeatSelectionLayout("1"), (int)((450 * Resources.System.DisplayMetrics.Density) / 8), (int)(42 * Resources.System.DisplayMetrics.Density));
                numberOfSeatsLayout.AddView(CreateSeatSelectionLayout("2", 1), (int)((450 * Resources.System.DisplayMetrics.Density) / 8), (int)(42 * Resources.System.DisplayMetrics.Density));
                numberOfSeatsLayout.AddView(CreateSeatSelectionLayout("3"), (int)((450 * Resources.System.DisplayMetrics.Density) / 8), (int)(42 * Resources.System.DisplayMetrics.Density));
                numberOfSeatsLayout.AddView(CreateSeatSelectionLayout("4"), (int)((450 * Resources.System.DisplayMetrics.Density) / 8), (int)(42 * Resources.System.DisplayMetrics.Density));
                numberOfSeatsLayout.AddView(CreateSeatSelectionLayout("5"), (int)((450 * Resources.System.DisplayMetrics.Density) / 8), (int)(42 * Resources.System.DisplayMetrics.Density));
                numberOfSeatsLayout.AddView(CreateSeatSelectionLayout("6"), (int)((450 * Resources.System.DisplayMetrics.Density) / 8), (int)(42 * Resources.System.DisplayMetrics.Density));
                numberOfSeatsLayout.AddView(CreateSeatSelectionLayout("7"), (int)((450 * Resources.System.DisplayMetrics.Density) / 8), (int)(42 * Resources.System.DisplayMetrics.Density));
                numberOfSeatsLayout.AddView(CreateSeatSelectionLayout("8"), (int)((450 * Resources.System.DisplayMetrics.Density) / 8), (int)(42 * Resources.System.DisplayMetrics.Density));
            }
            else
            {
                numberOfSeatsLayout.AddView(CreateSeatSelectionLayout("1"), (int)((300 * Resources.System.DisplayMetrics.Density) / 8), (int)(42 * Resources.System.DisplayMetrics.Density));
                numberOfSeatsLayout.AddView(CreateSeatSelectionLayout("2", 1), (int)((300 * Resources.System.DisplayMetrics.Density) / 8), (int)(42 * Resources.System.DisplayMetrics.Density));
                numberOfSeatsLayout.AddView(CreateSeatSelectionLayout("3"), (int)((300 * Resources.System.DisplayMetrics.Density) / 8), (int)(42 * Resources.System.DisplayMetrics.Density));
                numberOfSeatsLayout.AddView(CreateSeatSelectionLayout("4"), (int)((300 * Resources.System.DisplayMetrics.Density) / 8), (int)(42 * Resources.System.DisplayMetrics.Density));
                numberOfSeatsLayout.AddView(CreateSeatSelectionLayout("5"), (int)((300 * Resources.System.DisplayMetrics.Density) / 8), (int)(42 * Resources.System.DisplayMetrics.Density));
                numberOfSeatsLayout.AddView(CreateSeatSelectionLayout("6"), (int)((300 * Resources.System.DisplayMetrics.Density) / 8), (int)(42 * Resources.System.DisplayMetrics.Density));
                numberOfSeatsLayout.AddView(CreateSeatSelectionLayout("7"), (int)((300 * Resources.System.DisplayMetrics.Density) / 8), (int)(42 * Resources.System.DisplayMetrics.Density));
                numberOfSeatsLayout.AddView(CreateSeatSelectionLayout("8"), (int)((300 * Resources.System.DisplayMetrics.Density) / 8), (int)(42 * Resources.System.DisplayMetrics.Density));
            }

            TextView title2 = new TextView(context);

            title2.Text = "Select your seat class";
            if (!MainActivity.IsTablet)
            {
                title2.SetY(10);
            }
            title2.SetTextColor(Color.Black);
            title2.SetTextSize(ComplexUnitType.Dip, 14);

            LinearLayout seatClassLayout = new LinearLayout(context);

            seatClassLayout.Orientation = Android.Widget.Orientation.Vertical;
            if (MainActivity.IsTablet)
            {
                seatClassLayout.SetPadding((int)(22 * density), 0, 0, 0);
            }
            else
            {
                seatClassLayout.SetPadding((int)(22 * density), (int)(15 * density), 0, 0);
            }

            seatClassLayout.AddView(CreateSeatClassLayoutTile("Silver"), (int)(300 * density), (int)(40 * density));
            seatClassLayout.AddView(CreateSeatClassLayoutTile("Premier"), (int)(300 * density), (int)(40 * density));

            if (MainActivity.IsTablet)
            {
                numberOfSeatsLayout.SetPadding(0, (int)(15 * density), 0, 0);
                title2.SetPadding((int)(10 * density), 0, 0, 0);
                seatSelectionMainLayout.AddView(numberOfSeatsLayout, ViewGroup.LayoutParams.MatchParent, (int)(84 * Resources.System.DisplayMetrics.Density));
                seatSelectionMainLayout.AddView(title2, ViewGroup.LayoutParams.MatchParent, (int)(45 * density));
                seatSelectionMainLayout.AddView(seatClassLayout, ViewGroup.LayoutParams.MatchParent, (int)(120 * density));
                termsAndConditionsPopup.PopupView.FooterHeight = 60;
            }
            else
            {
                numberOfSeatsLayout.SetPadding(0, (int)(10 * density), 0, 0);
                title2.SetPadding((int)(10 * density), (int)(15 * density), 0, 0);
                seatSelectionMainLayout.AddView(numberOfSeatsLayout, ViewGroup.LayoutParams.MatchParent, (int)(52 * Resources.System.DisplayMetrics.Density));
                seatSelectionMainLayout.AddView(title2, ViewGroup.LayoutParams.MatchParent, (int)(45 * density));
                seatSelectionMainLayout.AddView(seatClassLayout, ViewGroup.LayoutParams.MatchParent, (int)(95 * density));
                termsAndConditionsPopup.PopupView.FooterHeight = 40;
            }

            termsAndConditionsPopup.PopupView.HeaderTitle = "Select your seats";
            termsAndConditionsPopup.PopupView.PopupStyle.HeaderTextColor       = Color.Black;
            termsAndConditionsPopup.PopupView.PopupStyle.HeaderBackgroundColor = Color.White;// ParseColor("#007CEE");
            termsAndConditionsPopup.PopupView.PopupStyle.BorderThickness       = 1;
            termsAndConditionsPopup.PopupView.ShowFooter = true;
            termsAndConditionsPopup.PopupView.ShowHeader = true;
            if (MainActivity.IsTablet)
            {
                termsAndConditionsPopup.PopupView.HeightRequest = 350;
            }
            else
            {
                termsAndConditionsPopup.PopupView.HeightRequest = 300;
            }
            termsAndConditionsPopup.PopupView.AppearanceMode = AppearanceMode.TwoButton;
            (termsAndConditionsPopup.PopupView.FooterView as LinearLayout).RemoveAllViews();
            proceed      = new Button(context);
            proceed.Text = "Proceed";
            proceed.SetTextSize(ComplexUnitType.Dip, 14);
            proceed.SetTextColor(Color.White);
            proceed.SetBackgroundColor(Color.ParseColor("#007CEE"));
            proceed.SetMinimumWidth((int)(300 * density));
            (termsAndConditionsPopup.PopupView.FooterView as LinearLayout).AddView(proceed, ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent);
            proceed.Click += AcceptTerms_Click;
            termsAndConditionsPopup.PopupView.PopupStyle.FooterBackgroundColor = Color.White;
            return(seatSelectionMainLayout);
        }
Beispiel #33
0
        public async Task getData()
        {
            progress = new Android.App.ProgressDialog(Activity);
            progress.Indeterminate = true;
            progress.SetProgressStyle(Android.App.ProgressDialogStyle.Spinner);
            progress.SetCancelable(false);
            progress.SetMessage("Please wait...");
            progress.Show();
            dynamic value = new ExpandoObject();

            value.UserId = userid;

            string json = JsonConvert.SerializeObject(value);

            try
            {
                JsonValue item = await restService.TaskOutbox(Activity, json, geolocation);

                List <TaskOutboxModel> taskOutbox = JsonConvert.DeserializeObject <List <TaskOutboxModel> >(item);
                dbHelper.insertdataoutbox(taskOutbox);

                for (int i = 0; i < taskOutbox.Count; i++)
                {
                    TaskOutboxModel detail = new TaskOutboxModel
                    {
                        TaskPercentage     = taskOutbox[i].TaskPercentage,
                        Task_id            = taskOutbox[i].Task_id,
                        Task_name          = taskOutbox[i].Task_name,
                        Description        = taskOutbox[i].Description,
                        deadline_date      = taskOutbox[i].deadline_date,
                        mark_to            = taskOutbox[i].mark_to,
                        task_status        = taskOutbox[i].task_status,
                        Task_created_by    = taskOutbox[i].Task_created_by,
                        Task_creation_date = taskOutbox[i].Task_creation_date,
                        task_mark_by       = taskOutbox[i].task_mark_by,
                        MarkingDate        = taskOutbox[i].MarkingDate,
                        task_marking_type  = taskOutbox[i].task_marking_type
                    };


                    im_model.Add(detail);
                }
                if (im_model.Count != 0)
                {
                    recyclerview_layoutmanger = new LinearLayoutManager(Activity, LinearLayoutManager.Vertical, false);
                    recyclerview.SetLayoutManager(recyclerview_layoutmanger);
                    recyclerview_adapter = new TaskOutboxAdapter(Activity, im_model, recyclerview, FragmentManager);
                    recyclerview.SetAdapter(recyclerview_adapter);
                }
                else
                {
                    TextView textView = new TextView(Activity);

                    textView.Text = "Oops ! You haven't assigned any task yet";
                    LinearLayout.AddView(textView);
                }

                progress.Dismiss();
            }
            catch (Exception ex)
            {
                progress.Dismiss();
            }
            progress.Dismiss();
        }
Beispiel #34
0
        private void CreateInfoLayout(object sender)
        {
            var header = (((sender as ImageView).Parent as LinearLayout).GetChildAt(0) as LinearLayout).GetChildAt(0) as TextView;

            LinearLayout bodyView = new LinearLayout(context);

            bodyView.Orientation = Android.Widget.Orientation.Vertical;
            bodyView.SetBackgroundColor(Color.White);

            TextView body = new TextView(context);

            body.Text = ((((sender as ImageView).Parent as LinearLayout).GetChildAt(0) as LinearLayout).GetChildAt(1) as TextView).Text + "421 E DRACHMAN TUCSON AZ 85705 - 7598 USA";
            body.SetTextSize(ComplexUnitType.Dip, 14);
            body.SetPadding((int)(12 * density), (int)(10 * density), 0, 0);
            body.SetTextColor(Color.ParseColor("#007CEE"));

            TextView facilities = new TextView(context);

            facilities.Text    = "Available Facilities";
            facilities.Gravity = GravityFlags.CenterHorizontal;
            facilities.SetTextColor(Color.Black);
            facilities.SetTextSize(ComplexUnitType.Dip, 14);

            LinearLayout facilitiesLayout = new LinearLayout(context);

            facilitiesLayout.Orientation = Android.Widget.Orientation.Vertical;
            facilitiesLayout.SetPadding(0, (int)(10 * density), 0, 0);

            LinearLayout iconLayout = new LinearLayout(context);

            iconLayout.Orientation = Android.Widget.Orientation.Horizontal;
            iconLayout.SetHorizontalGravity(GravityFlags.CenterHorizontal);

            LinearLayout iconDescLayout = new LinearLayout(context);

            iconDescLayout.Orientation = Android.Widget.Orientation.Horizontal;
            iconDescLayout.SetHorizontalGravity(GravityFlags.CenterHorizontal);

            ImageView mticket = new ImageView(context);

            mticket.SetImageResource(Resource.Drawable.Popup_MTicket);

            ImageView parking = new ImageView(context);

            parking.SetImageResource(Resource.Drawable.Popup_Parking);

            ImageView foodCourt = new ImageView(context);

            foodCourt.SetImageResource(Resource.Drawable.Popup_FoodCourt);

            iconLayout.AddView(mticket, (int)(100 * density), (int)(30 * density));
            iconLayout.AddView(parking, (int)(100 * density), (int)(30 * density));
            iconLayout.AddView(foodCourt, (int)(100 * density), (int)(30 * density));

            TextView mtick = new TextView(context);

            mtick.Text = "M-Ticket";
            mtick.SetTextSize(ComplexUnitType.Dip, 10);
            mtick.SetTextColor(Color.Black);
            mtick.Gravity = GravityFlags.CenterHorizontal | GravityFlags.CenterVertical;

            TextView park = new TextView(context);

            park.Text = "Parking";
            park.SetTextSize(ComplexUnitType.Dip, 10);
            park.SetTextColor(Color.Black);
            park.Gravity = GravityFlags.CenterHorizontal | GravityFlags.CenterVertical;

            TextView food = new TextView(context);

            food.Text = "Food Court";
            food.SetTextSize(ComplexUnitType.Dip, 10);
            food.SetTextColor(Color.Black);
            food.Gravity = GravityFlags.CenterHorizontal | GravityFlags.CenterVertical;

            iconDescLayout.AddView(mtick, (int)(100 * density), (int)(30 * density));
            iconDescLayout.AddView(park, (int)(100 * density), (int)(30 * density));
            iconDescLayout.AddView(food, (int)(100 * density), (int)(30 * density));

            facilitiesLayout.AddView(iconLayout);
            facilitiesLayout.AddView(iconDescLayout);

            bodyView.AddView(body, ViewGroup.LayoutParams.MatchParent, (int)(50 * density));
            bodyView.AddView(facilities, ViewGroup.LayoutParams.MatchParent, (int)(30 * density));
            bodyView.AddView(facilitiesLayout, ViewGroup.LayoutParams.MatchParent, (int)(70 * density));

            DisplayInfoPopup(bodyView, header.Text);
        }
Beispiel #35
0
        private void SfSchedule_MonthCellLoaded(object sender, MonthCellLoadedEventArgs e)
        {
            Calendar    calendar    = e.Calendar;
            FrameLayout frameLayout = new FrameLayout(context);

            if (calendar != null)
            {
                GradientDrawable gradientDrawable = new GradientDrawable(
                    GradientDrawable.Orientation.TopBottom,
                    new int[] { 255, 0 });                             //0xFF616261
                gradientDrawable.SetCornerRadius(0f);
                TextView monthCellText = new TextView(context);
                String   text          = new SimpleDateFormat("dd").Format(calendar.Time);
                monthCellText.Text = text;
                if ((calendar.Get(CalendarField.DayOfWeek) == Calendar.Sunday) || (calendar.Get(CalendarField.DayOfWeek) == Calendar.Saturday))
                {
                    monthCellText.SetTextColor(Color.Red);
                }
                else
                {
                    monthCellText.SetTextColor(Color.Black);
                }

                if ((calendar.Get(CalendarField.Year) == Calendar.Instance.Get(CalendarField.Year)) && (calendar.Get(CalendarField.Month) == Calendar.Instance.Get(CalendarField.Month) && (calendar.Get(CalendarField.DayOfMonth) == Calendar.Instance.Get(CalendarField.DayOfMonth))))
                {
                    monthCellText.SetTextColor(Color.LightBlue);
                }

                monthCellText.TextSize = 18;
                monthCellText.Gravity  = GravityFlags.CenterHorizontal;
                monthCellText.SetPadding(0, 10, 0, 0);
                LinearLayout layout = new LinearLayout(context);

                Button appDot = new Button(context);
                LinearLayout.LayoutParams params1 = new LinearLayout.LayoutParams(
                    LinearLayout.LayoutParams.WrapContent, LinearLayout.LayoutParams.WrapContent);
                params1.SetMargins(0, 80, 0, 0);
                appDot.LayoutParameters = params1;
                GradientDrawable appDotDrawable = new GradientDrawable();
                appDotDrawable.SetColor(255);
                appDotDrawable.SetCornerRadius(15);
                appDotDrawable.SetStroke(0, Color.Red);
                layout.SetGravity(GravityFlags.CenterHorizontal);
                appDot.Background       = appDotDrawable;
                appDot.LayoutParameters = new ViewGroup.LayoutParams(10, 10);
                layout.Orientation      = Orientation.Vertical;
                View line = new View(context);
                line.LayoutParameters = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, 1);
                line.SetBackgroundColor(Color.Gray);
                layout.AddView(line);
                layout.AddView(monthCellText);
                if (e.Appointments != null && e.Appointments.Count > 0)
                {
                    layout.AddView(appDot);
                }

                frameLayout.AddView(layout);
            }

            e.View = frameLayout;
        }
        public override View GetSampleContent(Android.Content.Context con)
        {
            /****************
            **Linear Gauge**
            ****************/
            SfLinearGauge linearGauge = new SfLinearGauge(con);
            ObservableCollection <LinearScale>   scales   = new ObservableCollection <LinearScale>();
            ObservableCollection <LinearPointer> pointers = new ObservableCollection <LinearPointer>();

            linearGauge.SetX(0);
            linearGauge.SetY(0);
            linearGauge.SetBackgroundColor(Color.Rgb(255, 255, 255));
            linearGauge.SetOrientation(SfLinearGauge.Orientation.Horizontal);


            //OuterScale
            outerScale                       = new LinearScale();
            outerScale.Minimum               = 0;
            outerScale.Maximum               = 100;
            outerScale.ScaleBarSize          = 40;
            outerScale.Interval              = 10;
            outerScale.ScaleBarColor         = Color.ParseColor("#e0e9f9");
            outerScale.MinorTicksPerInterval = 0;
            outerScale.LabelFontSize         = 14;
            outerScale.LabelColor            = Color.ParseColor("#424242");
            outerScale.CornerRadius          = 20;
            outerScale.CornerRadiusType      = CornerRadiusType.End;

            //OuterScale MajorTicksSettings
            LinearTickSettings outerScale_majorTicksSettings = new LinearTickSettings();

            outerScale_majorTicksSettings.Color       = Color.ParseColor("#9E9E9E");//
            outerScale_majorTicksSettings.Length      = 10;
            outerScale_majorTicksSettings.StrokeWidth = 1;
            outerScale.MajorTickSettings = outerScale_majorTicksSettings;

            //Symbol Pointer
            outerScale_needlePointer = new SymbolPointer();
            outerScale_needlePointer.SymbolPosition  = SymbolPointerPosition.Away;
            outerScale_needlePointer.Value           = pointervalue;
            outerScale_needlePointer.StrokeWidth     = 12;
            outerScale_needlePointer.Color           = Color.ParseColor("#5b86e5");
            outerScale_needlePointer.MarkerShape     = MarkerShape.Triangle;
            outerScale_needlePointer.EnableAnimation = false;
            pointers.Add(outerScale_needlePointer);

            //Bar Pointer
            rangePointer                  = new BarPointer();
            rangePointer.Value            = barvalue;
            rangePointer.StrokeWidth      = 30;
            rangePointer.EnableAnimation  = false;
            rangePointer.CornerRadius     = 15;
            rangePointer.CornerRadiusType = CornerRadiusType.End;
            rangePointer.GradientStops    = new ObservableCollection <GaugeGradientStop>()
            {
                new GaugeGradientStop()
                {
                    Value = 0, Color = Color.ParseColor("#36d1dc")
                },
                new GaugeGradientStop()
                {
                    Value = 75, Color = Color.ParseColor("#5b86e5")
                }
            };
            pointers.Add(rangePointer);
            outerScale.Pointers = pointers;

            scales.Add(outerScale);
            linearGauge.Scales = scales;

            //Linear Gauge Layout
            LinearLayout linearGaugeLayout = new LinearLayout(con);

            linearGaugeLayout.SetBackgroundColor(Color.Rgb(255, 255, 255));
            linearGaugeLayout.AddView(linearGauge);

            return(linearGaugeLayout);
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            if (LastNonConfigurationInstance != null)
            {
                //bug in Mono for Android or whatever: after config change the extra fields are wrong
                // -> reload:
                Reload();
                return;
            }

            _appTask = AppTask.GetTaskInOnCreate(savedInstanceState, Intent);

            SetContentView(Resource.Layout.entry_edit);
            _closeForReload = false;

            // Likely the app has been killed exit the activity
            if (!App.Kp2a.DatabaseIsUnlocked)
            {
                Finish();
                return;
            }


            if (Intent.GetBooleanExtra(IntentContinueWithEditing, false))
            {
                //property "State" will return the state
            }
            else
            {
                Database db = App.Kp2a.GetDb();

                App.Kp2a.EntryEditActivityState = new EntryEditActivityState();
                ISharedPreferences prefs = PreferenceManager.GetDefaultSharedPreferences(this);
                State.ShowPassword = !prefs.GetBoolean(GetString(Resource.String.maskpass_key), Resources.GetBoolean(Resource.Boolean.maskpass_default));

                Intent i         = Intent;
                String uuidBytes = i.GetStringExtra(KeyEntry);

                PwUuid entryId = PwUuid.Zero;
                if (uuidBytes != null)
                {
                    entryId = new PwUuid(MemUtil.HexStringToByteArray(uuidBytes));
                }

                State.ParentGroup = null;
                if (entryId.Equals(PwUuid.Zero))
                {
                    //creating new entry
                    String groupId = i.GetStringExtra(KeyParent);
                    State.ParentGroup = db.KpDatabase.RootGroup.FindGroup(new PwUuid(MemUtil.HexStringToByteArray(groupId)), true);

                    PwUuid  templateId    = new PwUuid(MemUtil.HexStringToByteArray(i.GetStringExtra(KeyTemplateUuid)));
                    PwEntry templateEntry = null;
                    if (!PwUuid.Zero.Equals(templateId))
                    {
                        templateEntry = db.Entries[templateId];
                    }

                    if (KpEntryTemplatedEdit.IsTemplate(templateEntry))
                    {
                        CreateNewFromKpEntryTemplate(db, templateEntry);
                    }
                    else if (templateEntry != null)
                    {
                        CreateNewFromStandardTemplate(templateEntry);
                    }
                    else
                    {
                        CreateNewWithoutTemplate(db);
                    }

                    _appTask.PrepareNewEntry(State.EntryInDatabase);
                    State.IsNew         = true;
                    State.EntryModified = true;
                }
                else
                {
                    Debug.Assert(entryId != null);

                    State.EntryInDatabase = db.Entries [entryId];
                    State.IsNew           = false;
                }

                State.Entry = State.EntryInDatabase.CloneDeep();
                if (KpEntryTemplatedEdit.IsTemplated(db, State.Entry))
                {
                    State.EditMode = new KpEntryTemplatedEdit(db, State.Entry);
                }
                else
                {
                    State.EditMode = new DefaultEdit();
                }
            }

            if (!State.EntryModified)
            {
                SetResult(KeePass.ExitNormal);
            }
            else
            {
                SetResult(KeePass.ExitRefreshTitle);
            }



            FillData();
            View scrollView = FindViewById(Resource.Id.entry_scroll);

            scrollView.ScrollBarStyle = ScrollbarStyles.InsideInset;

            ImageButton iconButton = (ImageButton)FindViewById(Resource.Id.icon_button);

            if (State.SelectedIcon)
            {
                App.Kp2a.GetDb().DrawableFactory.AssignDrawableTo(iconButton, this, App.Kp2a.GetDb().KpDatabase, (PwIcon)State.SelectedIconId, State.SelectedCustomIconId, false);
            }
            iconButton.Click += (sender, evt) => {
                UpdateEntryFromUi(State.Entry);
                IconPickerActivity.Launch(this);
            };


            // Generate password button
            FindViewById(Resource.Id.generate_button).Click += (sender, e) =>
            {
                UpdateEntryFromUi(State.Entry);
                GeneratePasswordActivity.Launch(this);
            };



            // Save button
            //SupportActionBar.SetCustomView(Resource.Layout.SaveButton);

            if (State.IsNew)
            {
                SupportActionBar.Title = GetString(Resource.String.add_entry);
            }
            else
            {
                SupportActionBar.Title = GetString(Resource.String.edit_entry);
            }

            SupportActionBar.SetDisplayHomeAsUpEnabled(true);
            SupportActionBar.SetHomeButtonEnabled(true);

            // Respect mask password setting
            MakePasswordVisibleOrHidden();

            ImageButton btnTogglePassword = (ImageButton)FindViewById(Resource.Id.toggle_password);

            btnTogglePassword.Click += (sender, e) =>
            {
                State.ShowPassword = !State.ShowPassword;
                MakePasswordVisibleOrHidden();
            };
            PorterDuff.Mode mMode = PorterDuff.Mode.SrcAtop;
            Color           color = new Color(189, 189, 189);

            btnTogglePassword.SetColorFilter(color, mMode);


            Button addButton = (Button)FindViewById(Resource.Id.add_advanced);

            addButton.Visibility = ViewStates.Visible;
            addButton.Click     += (sender, e) =>
            {
                LinearLayout container = (LinearLayout)FindViewById(Resource.Id.advanced_container);

                KeyValuePair <string, ProtectedString> pair = new KeyValuePair <string, ProtectedString>("", new ProtectedString(true, ""));
                View ees = CreateExtraStringView(pair);
                container.AddView(ees);

                State.EntryModified = true;

                /*TextView keyView = (TextView) ees.FindViewById(Resource.Id.title);
                 * keyView.RequestFocus();*/
                EditAdvancedString(ees.FindViewById(Resource.Id.edit_extra));
            };
            SetAddExtraStringEnabled();

            ((CheckBox)FindViewById(Resource.Id.entry_expires_checkbox)).CheckedChange += (sender, e) =>
            {
                State.Entry.Expires = e.IsChecked;
                if (e.IsChecked)
                {
                    if (State.Entry.ExpiryTime < DateTime.Now)
                    {
                        State.Entry.ExpiryTime = DateTime.Now;
                    }
                }
                UpdateExpires();
                State.EntryModified = true;
            };
        }
Beispiel #38
0
        public void listOfStudent()
        {
            linearLayout1.RemoveAllViews();

            try
            {
                using (var client = new WebClient())
                {
                    string  id       = Library.ControlID.userID;
                    var     json     = client.DownloadString("http://joremtongwebsite.000webhostapp.com/studentList.php?sectionID=" + ID);
                    dynamic jsonData = JsonConvert.DeserializeObject(json);
                    foreach (dynamic jsonDatas in jsonData)
                    {
                        var layout2 = new LinearLayout(this);
                        layout2.Orientation = Orientation.Horizontal;
                        var layoutParams2 = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent);
                        layoutParams2.SetMargins(0, 0, 0, 20);
                        layout2.SetBackgroundResource(Resource.Drawable.layout_bg);
                        layout2.SetPadding(0, 0, 0, 0);
                        layout2.LayoutParameters = layoutParams2;

                        var Image = new ImageView(this);
                        var param = new LayoutParams(120, 120);
                        Image.LayoutParameters = param;
                        Image.SetPadding(20, 30, 0, 0);
                        Image.SetImageResource(Resource.Drawable.study);

                        var layout = new LinearLayout(this);
                        layout.Orientation = Orientation.Vertical;
                        var layoutParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent);;
                        layoutParams.SetMargins(0, 30, 0, 20);
                        layout.SetBackgroundResource(Resource.Drawable.layout_bg);
                        layout.SetPadding(10, 10, 10, 50);
                        layout.LayoutParameters = layoutParams;
                        layout.Click           += async delegate
                        {
                            UserDialogs.Instance.ShowLoading("Loading", MaskType.Black);
                            await Task.Delay(1000);

                            Intent activity = new Intent(this, typeof(studentProfileActivity));
                            activity.PutExtra("userID", jsonDatas["userID"].ToString());
                            StartActivity(activity);
                            UserDialogs.Instance.HideLoading();
                        };

                        var username = new TextView(this);
                        username.SetTextColor(Color.White);
                        username.SetTypeface(Typeface.Default, TypefaceStyle.BoldItalic);
                        username.SetTextSize(global::Android.Util.ComplexUnitType.Dip, 20);
                        username.Text = jsonDatas["fullName"].ToString();
                        username.SetPadding(20, 20, 20, 0);


                        layout.AddView(username);
                        layout2.AddView(Image);
                        layout2.AddView(layout);

                        linearLayout1.AddView(layout2);
                    }
                }
            }
            catch (Exception i)
            {
                var layout2 = new LinearLayout(this);
                layout2.Orientation = Orientation.Horizontal;
                var layoutParams2 = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent);
                layoutParams2.SetMargins(0, 0, 0, 20);
                layout2.SetBackgroundResource(Resource.Drawable.layout_bg);
                layout2.SetPadding(0, 0, 0, 0);
                layout2.LayoutParameters = layoutParams2;

                var Image = new ImageView(this);
                var param = new LayoutParams(120, 120);
                Image.LayoutParameters = param;
                Image.SetPadding(20, 30, 0, 0);
                Image.SetImageResource(Resource.Drawable.study);

                var layout = new LinearLayout(this);
                layout.Orientation = Orientation.Vertical;
                var layoutParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent);;
                layoutParams.SetMargins(0, 0, 0, 20);
                layout.SetBackgroundResource(Resource.Drawable.layout_bg);
                layout.SetPadding(10, 10, 10, 50);
                layout.LayoutParameters = layoutParams;

                var username = new TextView(this);
                username.SetTextColor(Color.White);
                username.SetTypeface(Typeface.Default, TypefaceStyle.BoldItalic);
                username.SetTextSize(global::Android.Util.ComplexUnitType.Dip, 20);
                username.Text = "NO DATA YET";
                username.SetPadding(20, 20, 20, 0);

                layout.AddView(username);
                layout2.AddView(Image);
                layout2.AddView(layout);
                linearLayout1.AddView(layout2);
            }
        }
Beispiel #39
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            // Hide the window title and go fullscreen.
            RequestWindowFeature(WindowFeatures.NoTitle);
            Window.AddFlags(WindowManagerFlags.Fullscreen);

            // Create our Preview view and set it as the content of our activity.
            mPreview = new CameraView(this);

            FrameLayout.LayoutParams tparams = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent,
                                                                            ViewGroup.LayoutParams.WrapContent);                            //定义显示组件参数

            View   mainView  = View.Inflate(this, Resource.Layout.Main, null);
            Button btn       = mainView.FindViewById <Button> (Resource.Id.takepicb);
            Button enrollbtn = mainView.FindViewById <Button> (Resource.Id.enrollbtn);
            Button kechenbtn = mainView.FindViewById <Button> (Resource.Id.button1);

            Spinner spinner = mainView.FindViewById <Spinner> (Resource.Id.spinner1);

            tv      = mainView.FindViewById <TextView> (Resource.Id.statustext);
            tv.Text = "开始指纹识别。。。";
            result  = mainView.FindViewById <TextView> (Resource.Id.resulttext);

            Switch autoSw = mainView.FindViewById <Switch> (Resource.Id.switch1);

            iv        = mainView.FindViewById <ImageView> (Resource.Id.imageView1);
            frameView = mainView.FindViewById <TextView> (Resource.Id.textView1);

            tts = new TextToSpeech(this, this);

            FrameLayout fl = new FrameLayout(this);

            fl.AddView(mPreview);
            fl.AddView(mainView);

            //保持屏幕常亮
            Window.SetFlags(WindowManagerFlags.KeepScreenOn, WindowManagerFlags.KeepScreenOn);
            SetContentView(fl, tparams);

            // Initialize SourceAFIS
            Afis = new AfisEngine();
            // Look up the probe using Threshold = 10
            Afis.Threshold = 25;
            // Enroll some people
            database = new List <MyPerson>();
            lessons  = new List <MyLesson> ();

            if (System.IO.File.Exists(ImagePath + "lessons"))
            {
                BinaryFormatter formatter = new BinaryFormatter();
                using (FileStream stream = File.OpenRead(ImagePath + "lessons"))
                    lessons = (List <MyLesson>)formatter.Deserialize(stream);
            }
            else
            {
                tv.Text = "无课程,请添加课程。。。";
            }

            List <string> lessonname = new List <string> ();

            foreach (MyLesson ml in lessons)
            {
                lessonname.Add(ml.name);
            }
            ArrayAdapter <string> adapter = new ArrayAdapter <string> (Application.Context, Android.Resource.Layout.SimpleSpinnerItem, lessonname);

            spinner.Adapter       = adapter;
            spinner.ItemSelected += delegate(object sender, AdapterView.ItemSelectedEventArgs e) {
                Spinner s = (Spinner)sender;
                nowLesson = s.GetItemAtPosition(e.Position).ToString();

                //判断数据库是否存在
                if (System.IO.File.Exists(ImagePath + nowLesson + ".dat"))
                {
                    tv.Text = "已载入" + nowLesson + "数据库,开始识别。。。";
                    BinaryFormatter formatterr = new BinaryFormatter();
                    Console.WriteLine("Reloading database...");
                    using (FileStream stream = File.OpenRead(ImagePath + nowLesson + ".dat"))
                        database = (List <MyPerson>)formatterr.Deserialize(stream);
                }
                else
                {
                    tv.Text  = "数据库" + nowLesson + "中无数据,请录入指纹。。。";
                    database = new List <MyPerson>();
                }

                //判断本课程今天的考勤是否已经建立
                todayisbuld = false;
                for (int i = 0; i < lessons.Count; i++)
                {
                    if (lessons[i].name.Equals(nowLesson))
                    {
                        //获取当前课程的数据库中的标号
                        nowLessonNum = i;
                        for (int j = 0; j < lessons[i].attendance.Count; j++)
                        {
                            DateTime nowTime = DateTime.Now;
                            if ((lessons[i].attendance[j].date.Year == nowTime.Year) &&
                                (lessons[i].attendance[j].date.Month == nowTime.Month) &&
                                (lessons[i].attendance[j].date.Day == nowTime.Day)
                                )
                            {
                                todayisbuld = true;
                                //如果本课程今天已经建立了考勤,则获取当前考勤的数据库标号
                                todayNum = j;
                                //校准考勤时间的日期到今天的课程设置时间,方便比较
                                //lessons[nowLessonNum].time = new DateTime(nowTime.Year,nowTime.Month,nowTime.Day,
                                //	lessons[nowLessonNum].time.Hour,lessons[nowLessonNum].time.Minute,0);
                            }
                        }
                    }
                }

                //如果没建立,就新建一个
                if (!todayisbuld)
                {
                    DateTime nowTime = DateTime.Now;
                    //校准考勤时间的日期到今天的课程设置时间,方便比较
                    //lessons[nowLessonNum].time = new DateTime(nowTime.Year,nowTime.Month,nowTime.Day,
                    //	lessons[nowLessonNum].time.Hour,lessons[nowLessonNum].time.Minute,0);

                    //新建今天的考勤
                    Attendance att = new Attendance(new DateTime(nowTime.Year, nowTime.Month, nowTime.Day,
                                                                 lessons[nowLessonNum].time.Hour, lessons[nowLessonNum].time.Minute, 0));
                    lessons[nowLessonNum].attendance.Add(att);
                    todayNum    = lessons[nowLessonNum].attendance.IndexOf(att);
                    todayisbuld = true;
                }
            };

            btn.Click += delegate {
                try{
                    auto = false;
                    mCamera.TakePicture(null, null, this);
                    //设置、输出相机参数
                    Android.Hardware.Camera.Parameters p = mCamera.GetParameters();
                    string s = p.Flatten();
                    Console.WriteLine(s);
                    //					p.Set("iso",100.ToString());
                    //					p.Set("jpeg-quality",100.ToString());
                    //					mCamera.SetParameters(p);

                    //输出支持的图片分辨率
                    //					IList<Android.Hardware.Camera.Size> ss =  p.SupportedPictureSizes;
                    //					foreach(Android.Hardware.Camera.Size aa in ss)
                    //					{
                    //						Console.WriteLine(aa.Height +"," + aa.Width);
                    //					}
                }
                catch (Exception e)
                {
                    e.ToString();
                }
            };

            btn.SetOnTouchListener(this);
            enrollbtn.SetOnTouchListener(this);
            kechenbtn.SetOnTouchListener(this);

            btn.LongClick += delegate {
                mCamera.AutoFocus(null);
                tv.Text     = lessons[nowLessonNum].attendance[todayNum].attend.Count + "";
                result.Text = lessons[nowLessonNum].attendance[todayNum].late.Count + "";
                //hdler.PostDelayed (this,DELAY_MILLIS);
            };

            enrollbtn.Click += delegate {
                EditText            editT       = new EditText(this);
                AlertDialog.Builder alertDialog = new AlertDialog.Builder(this);
                alertDialog.SetTitle("请输入学号后3位:");
                alertDialog.SetView(editT);
                alertDialog.SetPositiveButton("确认", delegate {
                    xuehao     = editT.Text;
                    tv.Text    = "学号为" + xuehao + ",开始录入指纹。。。";
                    isIdentify = false;
                });
                alertDialog.SetNegativeButton("取消", delegate {
                });
                alertDialog.Show();
            };

            kechenbtn.Click += delegate {
                View     base2        = View.Inflate(this, Resource.Layout.kecheng, null);
                Button   deletelesson = base2.FindViewById <Button>(Resource.Id.button3);
                Button   backbtn      = base2.FindViewById <Button>(Resource.Id.button1);
                Button   addbtn       = base2.FindViewById <Button>(Resource.Id.button2);
                ListView listLesson   = base2.FindViewById <ListView>(Resource.Id.listView1);

                //SimpleAdapter sAdapter = new SimpleAdapter(Application.Context,

                deletelesson.Click += delegate {
                };

                addbtn.Click += delegate {
                    EditText     editT    = new EditText(this);
                    EditText     edittime = new EditText(this);
                    LinearLayout ll       = new LinearLayout(this);
                    ll.Orientation = Orientation.Vertical;
                    ll.AddView(editT);
                    ll.AddView(edittime);
                    AlertDialog.Builder alertDialog = new AlertDialog.Builder(this);
                    alertDialog.SetTitle("请输入课程名和时间:");
                    alertDialog.SetView(ll);
                    alertDialog.SetPositiveButton("确认", delegate {
                        //lessons.Add(editT.Text);
                        MyLesson myl = new MyLesson(editT.Text, Convert.ToDateTime(edittime.Text.Insert(2, ":")));
                        lessons.Add(myl);
                        adapter.Add(editT.Text);
                        adapter.NotifyDataSetChanged();
                        Console.WriteLine("添加课程...");
                        BinaryFormatter formatters = new BinaryFormatter();
                        using (Stream stream = File.Open(ImagePath + "lessons", FileMode.OpenOrCreate))
                            formatters.Serialize(stream, lessons);
                        tv.Text = "课程名为" + editT.Text + ",请录入指纹。。。";
                    });
                    alertDialog.SetNegativeButton("取消", delegate {
                    });
                    alertDialog.Show();
                };

                //返回
                backbtn.Click += delegate {
                    SetContentView(fl);
                };

                //如果开了自动,则关闭
                if (autoSw.Checked)
                {
                    hdler.RemoveCallbacks(this);
                    autoSw.Checked = false;
                }
                SetContentView(base2);
            };

            autoSw.CheckedChange += delegate {
                if (autoSw.Checked)
                {
                    hdler.PostDelayed(this, DELAY_MILLIS);
                }
                else
                {
                    hdler.RemoveCallbacks(this);
                }
            };


            //zoom放大
//			sk.ProgressChanged += delegate {
//				Android.Hardware.Camera.Parameters  p = mCamera.GetParameters();
//				int maxPa = p.MaxZoom;
//				int maxCa = sk.Max;
//				p.Zoom = maxPa * sk.Progress / maxCa;
//				mCamera.SetParameters(p);
//			};
        }
Beispiel #40
0
        private View SetMissionsList()
        {
            ScrollView MissionMainScrollLayout = new ScrollView(this);

            MissionMainScrollLayout.LayoutParameters = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent);

            LinearLayout MissionMainLayout = new LinearLayout(this);

            MissionMainLayout.Orientation      = Android.Widget.Orientation.Vertical;
            MissionMainLayout.LayoutParameters = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent);
            MissionMainLayout.SetGravity(GravityFlags.Center);

            for (int i = 0; i < 15; ++i)
            {
                string[] mission_reward = music.Missions[i].Split(',');
                string   mission        = $"M{i + 1}. ";
                string   reward         = mission_reward[mission_reward.Length - 1];

                switch (i)
                {
                case 0:
                    mission += "최초 클리어";
                    break;

                case 1:
                    mission += $"랭크 {mission_reward[0]}";
                    break;

                case 2:
                    mission += $"올 콤보 {mission_reward[0]}회";
                    break;

                case 3:
                    mission += $"PERFECT+ 판정 {mission_reward[0]}% 이상";
                    break;

                case 4:
                    mission += $"올 퍼펙트 {mission_reward[0]}회";
                    break;

                case 5:
                    mission += $"클리어 {mission_reward[0]}회";
                    break;

                case 6:
                    mission += $"하이 스코어 {mission_reward[0]}회";
                    break;

                case 7:
                    mission += $"{mission_reward[0]}점 이상";
                    break;

                case 8:
                    mission += $"{mission_reward[0]}미스 이상";
                    break;

                case 9:
                    mission += $"{mission_reward[0]}미스 이하";
                    break;

                case 10:
                    mission += $"VOCAL 스타 {mission_reward[0]}명 이상";
                    break;

                case 11:
                    mission += $"DANCER 스타 {mission_reward[0]}명 이상";
                    break;

                case 12:
                    mission += $"SESSION 스타 {mission_reward[0]}명 이상";
                    break;

                case 13:
                    mission += $"{mission_reward[0]}개 이상";
                    break;

                case 14:
                    mission += $"{mission_reward[0]}명 포함";
                    break;
                }

                LinearLayout MissionLayout = new LinearLayout(this);
                MissionLayout.Orientation      = Android.Widget.Orientation.Vertical;
                MissionLayout.LayoutParameters = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent)
                {
                    BottomMargin = 10
                };
                MissionLayout.SetGravity(GravityFlags.Center);

                TextView Mission = new TextView(this);
                Mission.Text     = mission;
                Mission.Gravity  = GravityFlags.Center;
                Mission.Typeface = Android.Graphics.Typeface.DefaultBold;

                MissionLayout.AddView(Mission);

                TextView Reward = new TextView(this);
                Reward.Text = reward;
                Reward.SetTextColor(Android.Graphics.Color.ParseColor("#6B6B6B"));
                Reward.Gravity = GravityFlags.Center;

                MissionLayout.AddView(Reward);

                MissionMainLayout.AddView(MissionLayout);
            }

            MissionMainScrollLayout.AddView(MissionMainLayout);

            return(MissionMainScrollLayout);
        }
Beispiel #41
0
        // Prompt for portal item information
        private void ShowOAuthConfigDialog()
        {
            // Create a dialog to get OAuth information (client id, redirect url, etc.)
            AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(this);

            // Create the layout
            LinearLayout dialogLayout = new LinearLayout(this)
            {
                Orientation = Orientation.Vertical
            };

            // Create a text box for entering the client id
            LinearLayout clientIdLayout = new LinearLayout(this)
            {
                Orientation = Orientation.Horizontal
            };
            TextView clientIdLabel = new TextView(this)
            {
                Text = "Client ID:"
            };

            _clientIdText = new EditText(this);
            if (!String.IsNullOrEmpty(_appClientId))
            {
                _clientIdText.Text = _appClientId;
            }
            clientIdLayout.AddView(clientIdLabel);
            clientIdLayout.AddView(_clientIdText);

            // Create a text box for entering the redirect url
            LinearLayout redirectUrlLayout = new LinearLayout(this)
            {
                Orientation = Orientation.Horizontal
            };

            TextView redirectUrlLabel = new TextView(this)
            {
                Text = "Redirect:"
            };

            _redirectUrlText = new EditText(this)
            {
                Hint = "https://my.redirect/url"
            };

            if (!String.IsNullOrEmpty(_oAuthRedirectUrl))
            {
                _redirectUrlText.Text = _oAuthRedirectUrl;
            }

            redirectUrlLayout.AddView(redirectUrlLabel);
            redirectUrlLayout.AddView(_redirectUrlText);

            // Create a button to dismiss the dialog (and proceed with updating the values)
            Button okButton = new Button(this)
            {
                Text = "Save"
            };

            // Handle the click event for the OK button
            okButton.Click += OnCloseOAuthDialog;

            // Add the controls to the dialog
            dialogLayout.AddView(clientIdLayout);
            dialogLayout.AddView(redirectUrlLayout);
            dialogLayout.AddView(okButton);
            dialogBuilder.SetView(dialogLayout);
            dialogBuilder.SetTitle("Configure OAuth");

            // Show the dialog
            _configOAuthDialog = dialogBuilder.Show();
        }
Beispiel #42
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            check = Shared.Get();
            Shared.Clean();

            CheckListBLL BLL = new CheckListBLL();

            chaves = BLL.ListaChaves();
            //int count = 0;
            if (chaves != null)
            {
                foreach (Chave p in chaves)
                {
                    if (p.Area.Equals(check.Area) && !p.Area.Equals("2"))
                    {
                        chavesA.Add(p);
                    }
                    if (p.Area.Equals("2"))
                    {
                        chavesA.Add(p);
                    }
                }

                //PARAMETROS PARA OS INTENS
                LayoutParams lp  = new LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent);
                LayoutParams lpL = new LayoutParams(ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent);

                lp.Height = 120;

                //LAYOUT PRINCIPAL QUE IRÀ DENTRO DO SCROLL
                LinearLayout layout = new LinearLayout(this);
                layout.Orientation      = Orientation.Vertical;
                layout.LayoutParameters = lpL;
                //SCROLL DE ROLAGEM
                ScrollView scroll = new ScrollView(this);
                scroll.LayoutParameters = lpL;
                this.SetContentView(scroll);
                scroll.AddView(layout);



                TextView lblChaves = new TextView(this);
                lblChaves.Text = "Confira as Chaves!!!! =)";
                lblChaves.SetTextSize(Android.Util.ComplexUnitType.Sp, 30);

                //ADICIONAR TUDO AO LAYOUT
                layout.AddView(lblChaves, lp);


                Button botao = new Button(this);
                botao.Text = "CONCLUIR";



                if (chavesA != null)
                {
                    foreach (Chave a in chavesA)
                    {
                        Switch s = new Switch(this);
                        s.Text = a.Nome;
                        //try { s.Id = Convert.ToInt32(a.Id); } catch { }
                        s.SetTextSize(Android.Util.ComplexUnitType.Sp, 30);
                        switches.Add(s);
                    }
                }
                //for (int i = 0; i < 60; i++)
                //{
                //    Switch s = new Switch(this);
                //    s.Text = "Texto do Switch..:  " + i;
                //    s.SetTextSize(Android.Util.ComplexUnitType.Sp, 30);
                //    switches.Add(s);

                //}

                foreach (var s in switches)
                {
                    layout.AddView(s, lp);
                }


                layout.AddView(botao, lp);


                botao.Click += delegate {
                    Aguarde.MostraAguarde(true, this);
                    var task = Task.Factory.StartNew(() =>
                    {
                        certo = Cadastrar();
                    });
                    task.ContinueWith(
                        t =>
                    {
                        if (certo)
                        {
                            Toast.MakeText(this, "CHECKLIST FINALIZADO", ToastLength.Long).Show();
                            this.FinishAffinity();
                        }
                        else
                        {
                            Toast.MakeText(this, "VERIFIQUE OS CAMPOS OBRIGATÓRIOS", ToastLength.Long).Show();
                        }
                        Aguarde.MostraAguarde(false, this);
                    }, TaskScheduler.FromCurrentSynchronizationContext());

                    //
                };
            }
        }
Beispiel #43
0
        public static void Create(BaseAniDroidActivity context, List <string> customScoringMethods,
                                  ScoreFormat scoreFormat, List <float?> scores, Action <List <float?> > onSaveAction)
        {
            var random = new Random();

            var view = context.LayoutInflater.Inflate(Resource.Layout.Dialog_CustomScoring, null);

            var container = view.FindViewById <LinearLayout>(Resource.Id.CustomScoring_Container);

            var groupedScoringMethods = customScoringMethods.Select((value, index) => new { value, index })
                                        .GroupBy(x => x.index / 2, x => new { Value = x.value, Id = random.Next() }).ToList();

            foreach (var group in groupedScoringMethods)
            {
                var innerContainer = new LinearLayout(context)
                {
                    LayoutParameters =
                        new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent,
                                                   ViewGroup.LayoutParams.WrapContent),
                    Orientation = Orientation.Horizontal
                };

                foreach (var method in group)
                {
                    var scoreWidget =
                        context.LayoutInflater.Inflate(Resource.Layout.View_PickerWithLabel, innerContainer, false);

                    var label  = scoreWidget.FindViewById <TextView>(Resource.Id.PickerWithLabel_Label);
                    var picker = scoreWidget.FindViewById <Picker>(Resource.Id.PickerWithLabel_Picker);

                    // assign new Ids so we don't have collisions
                    label.Text = method.Value;
                    label.Id   = method.Id + 1;
                    picker.Id  = method.Id;

                    var score = scores?.ElementAtOrDefault(customScoringMethods.IndexOf(method.Value)) ?? 0;

                    if (scoreFormat == ScoreFormat.Hundred)
                    {
                        picker.SetNumericValues(100, 0, false, score);
                    }
                    else if (scoreFormat == ScoreFormat.TenDecimal)
                    {
                        picker.SetNumericValues(10, 1, false, score);
                    }

                    innerContainer.AddView(scoreWidget);
                }

                container.AddView(innerContainer);
            }

            var alert = new AlertDialog.Builder(context,
                                                context.GetThemedResourceId(Resource.Attribute.Dialog_Theme));

            alert.SetView(view);
            alert.SetPositiveButton("Save", (sender, e) =>
            {
                var savedScores = groupedScoringMethods.SelectMany(x => x).Select(x =>
                                                                                  view.FindViewById <Picker>(x.Id).GetValue() ?? (float?)0).ToList();
                onSaveAction?.Invoke(savedScores);
            });
            alert.SetNegativeButton("Cancel", (sender, e) => { });

            alert.Show();
        }
Beispiel #44
0
        private void CreateLayout()
        {
            // Create a new vertical layout for the app.
            LinearLayout layout = new LinearLayout(this)
            {
                Orientation = Orientation.Vertical
            };

            LinearLayout.LayoutParams buttonParam = new LinearLayout.LayoutParams(
                ViewGroup.LayoutParams.MatchParent,
                ViewGroup.LayoutParams.MatchParent,
                1.0f
                );
            LinearLayout.LayoutParams labelParam = new LinearLayout.LayoutParams(
                ViewGroup.LayoutParams.MatchParent,
                ViewGroup.LayoutParams.MatchParent,
                3.0f
                );

            // Create a horizontal sub layout for the start date.
            LinearLayout startDateSubLayout = new LinearLayout(this)
            {
                Orientation = Orientation.Horizontal
            };

            // Label for the start date.
            TextView startDateLabel = new TextView(this)
            {
                Text             = "Start Date:",
                LayoutParameters = labelParam,
                Gravity          = GravityFlags.Center
            };

            startDateSubLayout.AddView(startDateLabel);

            // Button for the start date.
            _startDateButton = new Button(this)
            {
                Text             = "1/01/1998",
                LayoutParameters = buttonParam
            };
            _startDateButton.Click += OnDateClicked;
            startDateSubLayout.AddView(_startDateButton);

            // Add the start date information to the general layout.
            layout.AddView(startDateSubLayout);

            // Create a horizontal sub layout for the end date.
            LinearLayout endDateSubLayout = new LinearLayout(this)
            {
                Orientation = Orientation.Horizontal
            };

            // Label for the end date.
            TextView endDateLabel = new TextView(this)
            {
                Text             = "End Date:",
                LayoutParameters = labelParam,
                Gravity          = GravityFlags.Center
            };

            endDateSubLayout.AddView(endDateLabel);

            // Button for the end date.
            _endDateButton = new Button(this)
            {
                Text             = "1/31/1998",
                LayoutParameters = buttonParam
            };
            _endDateButton.Click += OnDateClicked;
            endDateSubLayout.AddView(_endDateButton);

            // Add the start date information to the general layout.
            layout.AddView(endDateSubLayout);

            // Add a button to the run the hot spot analysis; wire up the click event as well
            Button mapsButton = new Button(this)
            {
                Text = "Run Analysis"
            };

            mapsButton.Click += OnRunAnalysisClicked;
            layout.AddView(mapsButton);

            // Create a layout to be used to alert the user when processing is happening.
            LinearLayout alertLayout = new LinearLayout(this)
            {
                Orientation = Orientation.Vertical
            };

            // Create paramaters for the items in the alert layout.
            LinearLayout.LayoutParams alertParam = new LinearLayout.LayoutParams(
                ViewGroup.LayoutParams.MatchParent,
                ViewGroup.LayoutParams.MatchParent,
                1.0f
                );
            alertParam.SetMargins(0, 10, 0, 10);

            // Text for the processing alert.
            TextView processingText = new TextView(this)
            {
                Text             = "Processing...",
                LayoutParameters = alertParam,
                Gravity          = GravityFlags.Center,
            };

            // Add the progress bar to indicate the geoprocessing task is running.
            ProgressBar progressBar = new ProgressBar(this)
            {
                Indeterminate    = true,
                LayoutParameters = alertParam,
                TextAlignment    = TextAlignment.Center
            };

            // Add the text and progress bar to the Linear Layout.
            alertLayout.AddView(processingText);
            alertLayout.AddView(progressBar);

            // Create the alert dialog.
            _alert = new AlertDialog.Builder(this).Create();
            _alert.SetCanceledOnTouchOutside(false);
            _alert.Show();
            _alert.Cancel();

            // Add the layout to the alert.
            _alert.AddContentView(alertLayout, buttonParam);

            // Add the map view to the layout.
            layout.AddView(_myMapView);

            // Show the layout in the app.
            SetContentView(layout);
        }
Beispiel #45
0
        private void CreateTermsAndConditionsPopup()
        {
            termsAndConditionsPopup = new SfPopupLayout(this.context);
            termsAndConditionsPopup.PopupView.SetBackgroundColor(Color.White);
            termsAndConditionsPopup.StaysOpen             = true;
            termsAndConditionsPopup.PopupView.HeaderTitle = "Terms & Conditions";
            termsAndConditionsPopup.PopupView.PopupStyle.HeaderTextGravity     = GravityFlags.CenterHorizontal | GravityFlags.CenterVertical;
            termsAndConditionsPopup.PopupView.PopupStyle.HeaderBackgroundColor = Color.White;
            termsAndConditionsPopup.PopupView.PopupStyle.HeaderTextColor       = Color.Black;
            termsAndConditionsPopup.PopupView.PopupStyle.BorderColor           = Color.LightGray;
            termsAndConditionsPopup.PopupView.PopupStyle.BorderThickness       = 1;
            termsAndConditionsPopup.PopupView.ShowFooter      = true;
            termsAndConditionsPopup.PopupView.ShowCloseButton = false;
            termsAndConditionsPopup.PopupView.AppearanceMode  = AppearanceMode.TwoButton;
            TextView messageView = new TextView(this.context)
            {
                Text = "1. Children below the age of 18 cannot be admitted for movies certified A.\n2. Please carry proof of age for movies certified A.\n3. Drinking and alcohol is strictly prohibited inside the premises \n4. Please purchase tickets for children above age of 3."
            };

            termsAndConditionsPopup.PopupView.ContentView    = messageView;
            termsAndConditionsPopup.PopupView.AppearanceMode = AppearanceMode.TwoButton;

            LinearLayout footer = new LinearLayout(context);

            footer.Orientation = Android.Widget.Orientation.Horizontal;

            cancelButton        = new Button(context);
            cancelButton.Text   = "Decline";
            cancelButton.Click += CancelButton_Click;
            cancelButton.SetBackgroundColor(Color.White);
            cancelButton.Gravity = GravityFlags.Center;
            cancelButton.SetTextSize(ComplexUnitType.Dip, 14);
            cancelButton.SetTextColor(Color.ParseColor("#007CEE"));

            okButton        = new Button(context);
            okButton.Text   = "Accept";
            okButton.Click += AcceptTerms_Click;
            okButton.SetTextSize(ComplexUnitType.Dip, 14);
            okButton.SetBackgroundColor(Color.White);
            okButton.Gravity = GravityFlags.Center;
            okButton.SetTextColor(Color.ParseColor("#007CEE"));

            if (MainActivity.IsTablet)
            {
                messageView.TextSize = 19;
                messageView.SetTextColor(Color.Gray);
                messageView.SetBackgroundColor(Color.White);
                messageView.SetPadding((int)(10 * density), (int)(30 * density), (int)(10 * density), (int)(30 * density));
                termsAndConditionsPopup.PopupView.WidthRequest  = 450;
                termsAndConditionsPopup.PopupView.HeightRequest = 320;
                footer.SetMinimumWidth(450);
                footer.AddView(cancelButton, (int)(225 * density), ViewGroup.LayoutParams.MatchParent);
                footer.AddView(new View(context)
                {
                    Background = new ColorDrawable(Color.LightGray)
                }, (int)(1 * density), ViewGroup.LayoutParams.MatchParent);
                footer.AddView(okButton, (int)(225 * density), ViewGroup.LayoutParams.MatchParent);
            }
            else
            {
                messageView.TextSize = 14;
                messageView.SetTextColor(Color.Gray);
                messageView.SetBackgroundColor(Color.White);
                messageView.SetPadding((int)(10 * density), (int)(10 * density), (int)(10 * density), (int)(10 * density));
                termsAndConditionsPopup.PopupView.WidthRequest  = 300;
                termsAndConditionsPopup.PopupView.HeightRequest = 270;
                footer.SetMinimumWidth(300);
                footer.AddView(cancelButton, (int)(150 * density), ViewGroup.LayoutParams.MatchParent);
                footer.AddView(new View(context)
                {
                    Background = new ColorDrawable(Color.LightGray)
                }, (int)(1 * density), ViewGroup.LayoutParams.MatchParent);
                footer.AddView(okButton, (int)(150 * density), ViewGroup.LayoutParams.MatchParent);
            }
            termsAndConditionsPopup.PopupView.FooterView   = footer;
            termsAndConditionsPopup.PopupView.FooterHeight = 50;
            termsAndConditionsPopup.PopupView.ShowHeader   = true;
        }
        public override void OnViewAdded(Android.Views.View child)
        {
            base.OnViewAdded(child);
            if (child.GetType() == typeof(Android.Support.V7.Widget.Toolbar))
            {
                var lastPage = Element?.Navigation?.NavigationStack?.Last();

                /*if (_toolbar !=null)
                 * {
                 *  _toolbar.ChildViewAdded -= OnToolbarChildViewAdded;
                 *  var lPage = Element?.Navigation?.NavigationStack?.Last();
                 *  lPage.PropertyChanged -= LastPage_PropertyChanged;
                 * }*/

                _toolbar = (Android.Support.V7.Widget.Toolbar)child;
                _originalToolbarBackground = _toolbar.Background;

                var originalContent = (Context as Activity)?.Window?.DecorView?.FindViewById <FrameLayout>(Window.IdAndroidContent);
                if (originalContent != null)
                {
                    _originalWindowContent = originalContent.Foreground;
                }

                _parentLayout = new Android.Widget.FrameLayout(_toolbar.Context)
                {
                    LayoutParameters = new Android.Widget.FrameLayout.LayoutParams(LayoutParams.MatchParent, LayoutParams.MatchParent)
                };

                //Create custom title view layout
                _titleViewLayout = new Android.Widget.LinearLayout(_parentLayout.Context)
                {
                    Orientation      = Android.Widget.Orientation.Vertical,
                    LayoutParameters = new Android.Widget.FrameLayout.LayoutParams(LayoutParams.WrapContent, LayoutParams.WrapContent)
                };

                //Create custom title text view
                _titleTextView = new AppCompatTextView(_parentLayout.Context)
                {
                    LayoutParameters = new LinearLayout.LayoutParams(LayoutParams.WrapContent, LayoutParams.WrapContent)
                };

                //Create custom subtitle text view
                _subTitleTextView = new AppCompatTextView(_parentLayout.Context)
                {
                    LayoutParameters = new LinearLayout.LayoutParams(LayoutParams.WrapContent, LayoutParams.WrapContent)
                };

                //Add title/subtitle to title view layout
                _titleViewLayout.AddView(_titleTextView);
                _titleViewLayout.AddView(_subTitleTextView);

                //Add title view layout to main layout
                _parentLayout.AddView(_titleViewLayout);

                //Add main layout to toolbar
                _toolbar.AddView(_parentLayout);

                _toolbar.ChildViewAdded += OnToolbarChildViewAdded;



                lastPage.PropertyChanged += LastPage_PropertyChanged;
            }
        }
Beispiel #47
0
        public override View GetSampleContent(Context con)
        {
            float        height = con.Resources.DisplayMetrics.HeightPixels;;
            LinearLayout layout = new LinearLayout(con);
            Typeface     tf     = Typeface.CreateFromAsset(con.Assets, "Segoe_MDL2_Assets.ttf");

            layout.Orientation  = Android.Widget.Orientation.Vertical;
            sfpicker            = new SfPicker(con);
            sfpicker.ShowHeader = true;
            List <String> source = new List <string>();

            source.Add("Yellow");
            source.Add("Green");
            source.Add("Orange");
            source.Add("Lime");
            source.Add("LightBlue");
            source.Add("Pink");
            source.Add("SkyBlue");
            source.Add("White");
            source.Add("Red");
            source.Add("Aqua");
            sfpicker.ItemsSource      = source;
            sfpicker.LayoutParameters = new ViewGroup.LayoutParams(Android.Views.ViewGroup.LayoutParams.MatchParent, (int)(height * 0.60));
            sfpicker.PickerMode       = PickerMode.Default;
            sfpicker.ShowFooter       = false;

            sfpicker.ShowColumnHeader        = false;
            sfpicker.UnSelectedItemTextColor = Color.Black;
            sfpicker.SelectedIndex           = 7;
            float density = con.Resources.DisplayMetrics.Density;

            eventLog = new TextView(con);
            eventLog.LayoutParameters = new ViewGroup.LayoutParams(800, 400);
            layout.SetGravity(GravityFlags.CenterHorizontal);
            layout.AddView(sfpicker);
            string headerText1 = "PICK A COLOR";

            sfpicker.ShowHeader  = true;
            sfpicker.HeaderText  = headerText1;
            sfpicker.BorderColor = Color.Red;
            TextView textview = new TextView(con);

            textview.Text     = "Event Log";
            textview.Typeface = tf;
            textview.SetTextColor(Color.Black);

            textview.TextSize = 20;
            if (density > 2)
            {
                textview.SetPadding(20, 0, 0, 20);
            }
            else
            {
                textview.SetPadding(10, 0, 0, 10);
            }
            layout.AddView(textview);
            var scrollviewer = new ScrollView(con);
            var textFrame    = new LinearLayout(con);

            textFrame.Orientation = Android.Widget.Orientation.Vertical;
            scrollviewer.AddView(textFrame);
            scrollviewer.VerticalScrollBarEnabled = true;
            FrameLayout bottomFrame = new FrameLayout(con);

            bottomFrame.LayoutParameters = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, (int)(height * 0.40));
            bottomFrame.SetBackgroundColor(Color.Silver);
            bottomFrame.AddView(scrollviewer);
            bottomFrame.SetPadding(10, 0, 10, 0);
            layout.AddView(bottomFrame);
            sfpicker.ColumnHeaderText = "COLOR";


            sfpicker.OnSelectionChanged += (sender, e) =>
            {
                eventLog = new TextView(con);
                eventLog.SetTextColor(Color.Black);
                if (textFrame.ChildCount == 6)
                {
                    textFrame.RemoveViewAt(0);
                }

                textFrame.AddView(eventLog);
                eventLog.Text = (e.NewValue).ToString() + " " + "has been Selected";
                Color color = PickerHelper.GetColor(e.NewValue.ToString());
                sfpicker.SetBackgroundColor(color);
                sfpicker.Background.Alpha = 128;
                scrollviewer.ScrollTo(0, textFrame.Bottom);
            };

            return(layout);
        }
        public override View GetPropertyWindowLayout(Android.Content.Context context)
        {
            TextView pointervalue1 = new TextView(context);

            pointervalue1.Text     = "Opposite Position";
            pointervalue1.Typeface = Typeface.DefaultBold;
            pointervalue1.SetTextColor(Color.ParseColor("#262626"));
            pointervalue1.TextSize = 20;

            Spinner selectLabelMode = new Spinner(context, SpinnerMode.Dialog);

            adapter = new List <String>()
            {
                "False", "True"
            };
            ArrayAdapter <String> dataAdapter = new ArrayAdapter <String>
                                                    (context, Android.Resource.Layout.SimpleSpinnerItem, adapter);

            dataAdapter.SetDropDownViewResource(Android.Resource.Layout.SimpleDropDownItem1Line);
            selectLabelMode.Adapter       = dataAdapter;
            selectLabelMode.ItemSelected += SelectLabelMode_ItemSelected;

            TextView pointervalue2 = new TextView(context);

            pointervalue2.Text     = "Corner Radius Type";
            pointervalue2.Typeface = Typeface.DefaultBold;
            pointervalue2.SetTextColor(Color.ParseColor("#262626"));
            pointervalue2.TextSize = 20;

            Spinner selectLabelModel1 = new Spinner(context, SpinnerMode.Dialog);

            adapter1 = new List <String>()
            {
                "End", "Start", "Both", "None"
            };
            ArrayAdapter <String> dataAdapter1 = new ArrayAdapter <String>
                                                     (context, Android.Resource.Layout.SimpleSpinnerItem, adapter1);

            dataAdapter1.SetDropDownViewResource(Android.Resource.Layout.SimpleDropDownItem1Line);
            selectLabelModel1.Adapter       = dataAdapter1;
            selectLabelModel1.ItemSelected += SelectLabelModel1_ItemSelected;

            TextView pointervalue3 = new TextView(context);

            pointervalue3.Text     = "Marker Shapes";
            pointervalue3.Typeface = Typeface.DefaultBold;
            pointervalue3.SetTextColor(Color.ParseColor("#262626"));
            pointervalue3.TextSize = 20;

            Spinner selectLabelModel2 = new Spinner(context, SpinnerMode.Dialog);

            adapter2 = new List <String>()
            {
                "Triangle", "Inverted Triangle", "Circle", "Diamond", "Rectangle", "Image"
            };
            ArrayAdapter <String> dataAdapter2 = new ArrayAdapter <String>
                                                     (context, Android.Resource.Layout.SimpleSpinnerItem, adapter2);

            dataAdapter2.SetDropDownViewResource(Android.Resource.Layout.SimpleDropDownItem1Line);
            selectLabelModel2.Adapter       = dataAdapter2;
            selectLabelModel2.ItemSelected += SelectLabelModel2_ItemSelected;


            optionsPage             = new LinearLayout(context);
            optionsPage.Orientation = Orientation.Vertical;
            optionsPage.AddView(pointervalue1);
            optionsPage.AddView(selectLabelMode);
            optionsPage.AddView(pointervalue2);
            optionsPage.AddView(selectLabelModel1);
            optionsPage.AddView(pointervalue3);
            optionsPage.AddView(selectLabelModel2);
            optionsPage.SetPadding(10, 10, 10, 10);
            optionsPage.SetBackgroundColor(Color.White);

            return(optionsPage);
        }
Beispiel #49
0
        public override View GetSampleContent(Context con)
        {
            LinearLayout linear = new LinearLayout(con);

            linear.SetBackgroundColor(Color.White);
            linear.Orientation = Orientation.Vertical;
            linear.SetPadding(10, 10, 10, 10);

            TextView text2 = new TextView(con);

            text2.TextSize      = 17;
            text2.TextAlignment = TextAlignment.Center;
            text2.Text          = "This sample demonstrates how to convert the PowerPoint slide to an image.";
            text2.SetTextColor(Color.ParseColor("#262626"));
            text2.SetPadding(5, 5, 5, 5);

            linear.AddView(text2);

            TextView space1 = new TextView(con);

            space1.TextSize = 10;
            linear.AddView(space1);

            m_context = con;

            LinearLayout radioLinearLayout = new LinearLayout(con);

            radioLinearLayout.Orientation = Orientation.Horizontal;

            TextView imageType = new TextView(con);

            imageType.Text     = "Image Format : ";
            imageType.TextSize = 19;
            radioLinearLayout.AddView(imageType);

            radioGroup = new RadioGroup(con);
            radioGroup.TextAlignment = TextAlignment.Center;
            radioGroup.Orientation   = Orientation.Horizontal;
            pngButton      = new RadioButton(con);
            pngButton.Text = "PNG";
            radioGroup.AddView(pngButton);
            jpegButton      = new RadioButton(con);
            jpegButton.Text = "JPEG";
            radioGroup.AddView(jpegButton);
            radioGroup.Check(1);
            radioLinearLayout.AddView(radioGroup);
            linear.AddView(radioLinearLayout);
            pngButton.Checked = true;

            TextView space2 = new TextView(con);

            space2.TextSize = 10;
            linear.AddView(space2);

            Button templateButton = new Button(con);

            templateButton.Text   = "Input Template";
            templateButton.Click += OnButtonClicked;
            linear.AddView(templateButton);

            Button convertButton = new Button(con);

            convertButton.Text   = "Convert";
            convertButton.Click += OnConvertButtonClicked;
            linear.AddView(convertButton);

            return(linear);
        }
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            // Dialog UI to display
            LinearLayout dialogView = null;

            // Get the context for creating the dialog controls
            Android.Content.Context ctx = Activity.ApplicationContext;

            // Set a dialog title
            Dialog.SetTitle("Statistics Definitions");

            // Call OnCreateView on the base
            base.OnCreateView(inflater, container, savedInstanceState);

            // The container for the dialog is a vertical linear layout
            dialogView = new LinearLayout(ctx)
            {
                Orientation = Orientation.Vertical
            };

            // Spinner for choosing a field to get statistics for
            _fieldSpinner = new Spinner(ctx);

            // Create an array adapter to display the fields
            ArrayAdapter fieldsAdapter = new ArrayAdapter(ctx, Android.Resource.Layout.SimpleSpinnerItem);

            foreach (string field in _fieldNames)
            {
                fieldsAdapter.Add(field);
            }

            // Set the drop down style for the array adapter, then assign it to the field spinner control
            fieldsAdapter.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem);
            _fieldSpinner.Adapter = fieldsAdapter;

            // Create a horizontal layout to display the field spinner (with a label)
            LinearLayout fieldView = new LinearLayout(ctx)
            {
                Orientation = Orientation.Horizontal
            };

            // Create a label for the spinner
            TextView fieldLabel = new TextView(ctx)
            {
                Text     = "Field:",
                LabelFor = _fieldSpinner.Id
            };

            // Add field controls to the horizontal layout
            fieldView.AddView(fieldLabel);
            fieldView.AddView(_fieldSpinner);
            fieldView.SetPadding(140, 0, 0, 0);
            dialogView.AddView(fieldView);

            // Spinner for selecting the statistic type
            _statSpinner = new Spinner(ctx);

            // Create an array adapter to display the statistic types
            ArrayAdapter statTypeAdapter = new ArrayAdapter(ctx, Android.Resource.Layout.SimpleSpinnerItem);

            // Read the statistic types from the StatisticType enum
            Array statTypes = Enum.GetValues(typeof(StatisticType));

            foreach (object stat in statTypes)
            {
                // Add each statistic type to the adapter
                statTypeAdapter.Add(stat.ToString());
            }

            // Set the drop down style for the array adapter, then assign it to the statistic type spinner control
            statTypeAdapter.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem);
            _statSpinner.Adapter = statTypeAdapter;

            // Create a horizontal layout to display the statistic type spinner (with a label)
            LinearLayout statTypeView = new LinearLayout(ctx)
            {
                Orientation = Orientation.Horizontal
            };

            // Create the label for the statistic type list
            TextView typeLabel = new TextView(ctx)
            {
                Text     = "Type:",
                LabelFor = _statSpinner.Id
            };

            // Add statistic type controls to the horizontal layout
            statTypeView.AddView(typeLabel);
            statTypeView.AddView(_statSpinner);
            statTypeView.SetPadding(140, 0, 0, 0);

            // Add the statistic type layout to the dialog
            dialogView.AddView(statTypeView);

            // Create a button to add a new statistic definition (selected field and statistic type)
            Button addStatDefButton = new Button(ctx)
            {
                Text = "Add"
            };

            addStatDefButton.Click += AddStatisticDefinition;

            // Create a button to remove the selected statistic definition
            Button removeStatDefButton = new Button(ctx)
            {
                Text = "Remove"
            };

            removeStatDefButton.Click += RemoveStatisticDefinition;

            // Create a horizontal layout to contain the add and remove buttons
            LinearLayout buttonView = new LinearLayout(ctx)
            {
                Orientation = Orientation.Horizontal
            };

            buttonView.AddView(addStatDefButton);
            buttonView.AddView(removeStatDefButton);

            // Add the button layout to the dialog
            dialogView.AddView(buttonView);

            // Create a list view and an instance of a custom list adapter to show the statistic definitions
            StatDefinitionListAdapter listAdapter = new StatDefinitionListAdapter(Activity, _statisticDefinitions);

            _statDefListView = new ListView(ctx)
            {
                Adapter = listAdapter,

                // Only allow one choice in the statistic definitions list ('remove' button will work on the selected row)
                ChoiceMode = ChoiceMode.Single
            };

            // Add the statistic definitions list to the dialog
            dialogView.AddView(_statDefListView);

            // Return the new view for display
            return(dialogView);
        }
Beispiel #51
0
        /////////////////////////////////////////////////////////////////////////////////////////////////////////
        //////                                   START DIALOG DEFINITION                                    //////
        //////////////////////////////////////////////////////////////////////////////////////////////////////////
        private AlertDialog.Builder CreateDirectoryChooserDialog(String title, List <String> listItems, EventHandler <DialogClickEventArgs> onClickListener)
        {
            AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(_mContext);
            ////////////////////////////////////////////////
            // Create title text showing file select type //
            ////////////////////////////////////////////////
            _mTitleView1 = new TextView(_mContext);
            _mTitleView1.LayoutParameters = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent);
            //m_titleView1.setTextAppearance(m_context, android.R.style.TextAppearance_Large);
            //m_titleView1.setTextColor( m_context.getResources().getColor(android.R.color.black) );

            if (_selectType == _fileOpen)
            {
                _mTitleView1.Text = "Open";
            }
            if (_selectType == _fileSave)
            {
                _mTitleView1.Text = "Save As";
            }
            if (_selectType == _folderChoose)
            {
                _mTitleView1.Text = "Select folder";
            }

            //need to make this a variable Save as, Open, Select Directory
            _mTitleView1.Gravity = GravityFlags.CenterVertical;
            //_mTitleView1.SetBackgroundColor(Color.DarkGray); // dark gray     -12303292
            _mTitleView1.SetTextColor(Color.Black);
            // _mTitleView1.SetPadding((int).ConvertDpToPixel(_mContext.Resources, 10), (int)SystemHelper.ConvertDpToPixel(_mContext.Resources, 10), 0, (int)SystemHelper.ConvertDpToPixel(_mContext.Resources, 15));
            _mTitleView1.SetTextSize(ComplexUnitType.Dip, 18);
            _mTitleView1.SetTypeface(null, TypefaceStyle.Bold);
            // Create custom view for AlertDialog title
            LinearLayout titleLayout1 = new LinearLayout(_mContext);

            titleLayout1.Orientation = Orientation.Vertical;
            titleLayout1.AddView(_mTitleView1);

            if (_selectType == _fileSave)
            {
                ///////////////////////////////
                // Create New Folder Button  //
                ///////////////////////////////
                Button newDirButton = new Button(_mContext);
                newDirButton.LayoutParameters = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent);
                newDirButton.Text             = "New Folder";
                newDirButton.Click           += (sender, args) =>
                {
                    EditText input = new EditText(_mContext);
                    new AlertDialog.Builder(_mContext).SetTitle("New Folder Name").SetView(input).SetPositiveButton("OK", (o, eventArgs) =>
                    {
                        String newDirName = input.Text;
                        // Create new directory
                        if (CreateSubDir(_mDir + "/" + newDirName))
                        {
                            // Navigate into the new directory
                            _mDir += "/" + newDirName;
                            UpdateDirectory();
                        }
                        else
                        {
                            Toast.MakeText(_mContext, "Failed to create '" + newDirName + "' folder", ToastLength.Short).Show();
                        }
                    }).SetNegativeButton("Cancel", (o, eventArgs) => { }).Show();
                };
                titleLayout1.AddView(newDirButton);
            }
            /////////////////////////////////////////////////////
            // Create View with folder path and entry text box //
            /////////////////////////////////////////////////////
            LinearLayout titleLayout = new LinearLayout(_mContext);

            titleLayout.Orientation = Orientation.Vertical;



            var currentSelection = new TextView(_mContext);

            currentSelection.LayoutParameters = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent);
            currentSelection.SetTextColor(Color.Black);
            currentSelection.Gravity = GravityFlags.CenterVertical;
            currentSelection.Text    = "Current selection:";
            //     currentSelection.SetPadding((int)SystemHelper.ConvertDpToPixel(_mContext.Resources, 10), (int)SystemHelper.ConvertDpToPixel(_mContext.Resources, 5), 0, (int)SystemHelper.ConvertDpToPixel(_mContext.Resources, 3));
            currentSelection.SetTextSize(ComplexUnitType.Dip, 12);
            currentSelection.SetTypeface(null, TypefaceStyle.Bold);

            titleLayout.AddView(currentSelection);

            _mTitleView = new TextView(_mContext);
            _mTitleView.LayoutParameters = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent);
            _mTitleView.SetTextColor(Color.Black);
            _mTitleView.Gravity = GravityFlags.CenterVertical;
            _mTitleView.Text    = title;
            //     _mTitleView.SetPadding((int)SystemHelper.ConvertDpToPixel(_mContext.Resources, 10), 0, (int)SystemHelper.ConvertDpToPixel(_mContext.Resources, 10), (int)SystemHelper.ConvertDpToPixel(_mContext.Resources, 5));
            _mTitleView.SetTextSize(ComplexUnitType.Dip, 10);
            _mTitleView.SetTypeface(null, TypefaceStyle.Normal);

            titleLayout.AddView(_mTitleView);

            if (_selectType == _fileOpen || _selectType == _fileSave)
            {
                _inputText      = new EditText(_mContext);
                _inputText.Text = DefaultFileName;
                titleLayout.AddView(_inputText);
            }
            //////////////////////////////////////////
            // Set Views and Finish Dialog builder  //
            //////////////////////////////////////////
            dialogBuilder.SetView(titleLayout);
            dialogBuilder.SetCustomTitle(titleLayout1);
            _mListAdapter = CreateListAdapter(listItems);
            dialogBuilder.SetSingleChoiceItems(_mListAdapter, -1, onClickListener);
            dialogBuilder.SetCancelable(true);
            return(dialogBuilder);
        }
        private void AddInputControls()
        {
            var padding = 30;

            ScrollView = new ScrollView(con);
            ScrollView.ScrollTo(0, 0);
            var inputControlLayout = new LinearLayout(con);

            inputControlLayout.Orientation = Orientation.Vertical;

            subjectInput                  = new EditText(con);
            subjectInput.Gravity          = GravityFlags.Fill;
            subjectInput.LayoutParameters = new ViewGroup.LayoutParams(LinearLayout.LayoutParams.MatchParent, density.HeightPixels / 12);
            subjectInput.SetTextColor(Color.Black);
            subjectInput.Hint     = "Event name";
            subjectInput.TextSize = 30;
            subjectInput.SetLines(1);

            subjectInput.KeyPress += (object sender, View.KeyEventArgs e) =>
            {
                e.Handled = false;
                if (e.Event.Action == KeyEventActions.Down && e.KeyCode == Keycode.Enter)
                {
                    InputMethodManager inputmanager = (InputMethodManager)con.GetSystemService(Context.InputMethodService);
                    inputmanager.HideSoftInputFromWindow(subjectInput.WindowToken, 0);
                    e.Handled = true;
                }
            };

            inputControlLayout.AddView(subjectInput);

            locationInput = new EditText(con);
            locationInput.SetTextColor(Color.Black);
            locationInput.LayoutParameters = new ViewGroup.LayoutParams(LinearLayout.LayoutParams.MatchParent, density.HeightPixels / 12);
            locationInput.Gravity          = GravityFlags.Fill;
            locationInput.SetMinimumHeight(80);
            locationInput.SetLines(1);
            locationInput.TextSize  = 18;
            locationInput.Hint      = "Location";
            locationInput.KeyPress += (object sender, View.KeyEventArgs e) =>
            {
                e.Handled = false;
                if (e.Event.Action == KeyEventActions.Down && e.KeyCode == Keycode.Enter)
                {
                    InputMethodManager inputmanager = (InputMethodManager)con.GetSystemService(Context.InputMethodService);
                    inputmanager.HideSoftInputFromWindow(subjectInput.WindowToken, 0);
                    e.Handled = true;
                }
            };
            inputControlLayout.AddView(locationInput);

            LinearLayout timeLayout = new LinearLayout(con);

            timeLayout.LayoutParameters = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent);
            timeLayout.Orientation      = Orientation.Vertical;

            TextView startTimeLabel = new TextView(con);

            startTimeLabel.Text             = "FROM";
            startTimeLabel.Gravity          = GravityFlags.CenterVertical;
            startTimeLabel.LayoutParameters = new ViewGroup.LayoutParams(LinearLayout.LayoutParams.MatchParent, density.HeightPixels / 12);
            startTimeLabel.TextSize         = 18;
            timeLayout.AddView(startTimeLabel);

            //startTime row
            LinearLayout minuteLayout = new LinearLayout(con);

            minuteLayout.LayoutParameters = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, density.HeightPixels / 12);
            minuteLayout.Orientation      = Orientation.Horizontal;

            startDateName          = new TextView(con);
            startDateName.Text     = (sfSchedule.VisibleDates as IList <Calendar>).ToString();
            startDateName.TextSize = 18;
            startDateName.SetPadding(0, 0, density.WidthPixels / 4, 0);
            startDateName.SetTextColor(Color.Black);
            minuteLayout.AddView(startDateName);

            startTimeName          = new TextView(con);
            startTimeName.Text     = (sfSchedule.VisibleDates as IList <Calendar>).ToString();
            startTimeName.TextSize = 18;
            startTimeName.SetTextColor(Color.Black);
            minuteLayout.AddView(startTimeName);
            timeLayout.AddView(minuteLayout);

            TextView startTimeZoneLabel = new TextView(con);

            startTimeZoneLabel.Text             = "Start Time Zone";
            startTimeZoneLabel.TextSize         = 18;
            startTimeZoneLabel.LayoutParameters = new ViewGroup.LayoutParams(LinearLayout.LayoutParams.MatchParent, density.HeightPixels / 13);
            startTimeZoneLabel.SetTextColor(Color.Black);

            startTimeZonePicker = new Spinner(con, SpinnerMode.Dialog);
            startTimeZonePicker.SetMinimumHeight(60);
            startTimeZonePicker.SetBackgroundColor(Color.LightGray);
            startTimeZonePicker.DropDownWidth = 600;
            startTimeZonePicker.SetGravity(GravityFlags.Center);
            timeLayout.AddView(startTimeZoneLabel);
            timeLayout.AddView(startTimeZonePicker);

            ArrayAdapter <string> dataAdapter = new ArrayAdapter <string>(con, Android.Resource.Layout.SimpleSpinnerItem, TimeZoneCollection.TimeZoneList);

            dataAdapter.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem);
            startTimeZonePicker.Adapter       = dataAdapter;
            startTimeZonePicker.ItemSelected += StartTimeZone_Spinner_ItemSelected;

            //endTime label row
            TextView endTimeLabel = new TextView(con);

            endTimeLabel.Text             = "TO";
            endTimeLabel.Gravity          = GravityFlags.CenterVertical;
            endTimeLabel.LayoutParameters = new ViewGroup.LayoutParams(LinearLayout.LayoutParams.MatchParent, density.HeightPixels / 11);
            endTimeLabel.TextSize         = 18;
            timeLayout.AddView(endTimeLabel);

            //endTime row
            LinearLayout minuteToLayout = new LinearLayout(con);

            minuteToLayout.LayoutParameters = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, density.HeightPixels / 12);
            minuteToLayout.Orientation      = Orientation.Horizontal;

            endDateName = new TextView(con);
            endDateName.SetRawInputType(Android.Text.InputTypes.DatetimeVariationTime);
            endDateName.SetTextColor(Color.Black);
            endDateName.SetPadding(0, 0, density.WidthPixels / 4, 0);
            endDateName.Text     = (sfSchedule.VisibleDates as IList <Calendar>).ToString();
            endDateName.TextSize = 18;
            minuteToLayout.AddView(endDateName);

            endTimeName      = new TextView(con);
            endTimeName.Text = (sfSchedule.VisibleDates as IList <Calendar>).ToString();
            endTimeName.SetTextColor(Color.Black);
            endTimeName.TextSize = 18;
            minuteToLayout.AddView(endTimeName);
            timeLayout.AddView(minuteToLayout);

            TextView endTimeZoneLabel = new TextView(con);

            endTimeZoneLabel.Text             = "End Time Zone";
            endTimeZoneLabel.TextSize         = 18;
            endTimeZoneLabel.LayoutParameters = new ViewGroup.LayoutParams(LinearLayout.LayoutParams.MatchParent, density.HeightPixels / 13);
            endTimeZoneLabel.SetTextColor(Color.Black);
            endTimeZonePicker = new Spinner(con, SpinnerMode.Dialog);
            endTimeZonePicker.SetMinimumHeight(60);
            endTimeZonePicker.SetBackgroundColor(Color.LightGray);
            endTimeZonePicker.DropDownWidth = 600;
            endTimeZonePicker.SetGravity(GravityFlags.Center);
            timeLayout.AddView(endTimeZoneLabel);
            timeLayout.AddView(endTimeZonePicker);

            ArrayAdapter <string> endTimeZoneAdapter = new ArrayAdapter <string>(con, Android.Resource.Layout.SimpleSpinnerItem, TimeZoneCollection.TimeZoneList);

            endTimeZoneAdapter.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem);
            endTimeZonePicker.Adapter       = endTimeZoneAdapter;
            endTimeZonePicker.ItemSelected += EndTimeZone_Spinner_ItemSelected;
            inputControlLayout.AddView(timeLayout);

            var allDaylayout = new LinearLayout(con);

            allDaylayout.SetPadding(0, 10, 0, 0);
            allDaylayout.LayoutParameters = new ViewGroup.LayoutParams(LinearLayout.LayoutParams.MatchParent, density.HeightPixels / 12);
            allDaylayout.Orientation      = Orientation.Horizontal;
            TextView allDayLabel = new TextView(con);

            allDayLabel.Text             = "All Day";
            allDayLabel.TextSize         = 18;
            allDayLabel.Gravity          = GravityFlags.CenterVertical;
            allDayLabel.LayoutParameters = new ViewGroup.LayoutParams((density.WidthPixels / 2) - padding, LinearLayout.LayoutParams.MatchParent);
            allDayLabel.SetTextColor(Color.Black);

            allDaySwitch                  = new Switch(con);
            allDaySwitch.Checked          = false;
            allDaySwitch.LayoutParameters = new ViewGroup.LayoutParams((density.WidthPixels / 2) - padding, LinearLayout.LayoutParams.MatchParent);
            allDaySwitch.Gravity          = GravityFlags.CenterVertical;
            allDaySwitch.CheckedChange   += AllDaySwitch_CheckedChange;

            allDaylayout.AddView(allDayLabel);
            allDaylayout.AddView(allDaySwitch);
            inputControlLayout.AddView(allDaylayout);

            var buttonlayout = new LinearLayout(con);

            buttonlayout.SetPadding(0, 10, 0, 0);
            buttonlayout.Orientation = Orientation.Horizontal;

            CancelButton = new Button(con);
            CancelButton.SetBackgroundColor(Color.LightGray);
            CancelButton.SetPadding(0, 10, 30, 10);
            CancelButton.LayoutParameters = new ViewGroup.LayoutParams((density.WidthPixels / 2) - padding, LinearLayout.LayoutParams.MatchParent);
            CancelButton.Text             = "Cancel";
            CancelButton.TextSize         = 15;
            CancelButton.SetTextColor(Color.Black);
            buttonlayout.AddView(CancelButton);

            SaveButton = new Button(con);
            SaveButton.SetBackgroundColor(Color.ParseColor("#2196F3"));
            SaveButton.SetPadding(0, 10, 30, 10);
            SaveButton.LayoutParameters = new ViewGroup.LayoutParams((density.WidthPixels / 2) - padding, LinearLayout.LayoutParams.MatchParent);
            SaveButton.Text             = "Save";
            SaveButton.TextSize         = 15;
            SaveButton.SetTextColor(Color.White);
            buttonlayout.AddView(SaveButton);

            inputControlLayout.AddView(buttonlayout);
            ScrollView.AddView(inputControlLayout);
            EditorLayout.AddView(ScrollView);
            HookEvents();
        }
        public View GetSampleContent(Context con)
        {
            LinearLayout linear = new LinearLayout(con);

            linear.Orientation = Orientation.Vertical;

            LinearLayout.LayoutParams linearLayoutParams = new LinearLayout.LayoutParams(
                LinearLayout.LayoutParams.MatchParent, LinearLayout.LayoutParams.MatchParent, (int)TypedValue.ApplyDimension(ComplexUnitType.Dip, 3, con.Resources.DisplayMetrics));
            int margin;

            if (IsTabletDevice(con))
            {
                margin = (int)TypedValue.ApplyDimension(ComplexUnitType.Dip, 15, con.Resources.DisplayMetrics);
            }
            else
            {
                margin = (int)TypedValue.ApplyDimension(ComplexUnitType.Dip, 9.5f, con.Resources.DisplayMetrics);
            }

            linearLayoutParams.SetMargins(margin, margin, margin, margin);

            ImageView imageView = new ImageView(con);

            imageView.SetScaleType(ImageView.ScaleType.FitStart);
            imageView.SetAdjustViewBounds(true);
            imageView.SetImageResource(Resource.Drawable.Pizzaimage);
            linear.AddView(imageView);

            int padding = (int)TypedValue.ApplyDimension(ComplexUnitType.Dip, 7, con.Resources.DisplayMetrics);

            LinearLayout frameParent = new LinearLayout(con);

            frameParent.SetBackgroundColor(Color.White);
            frameParent.Orientation      = Orientation.Vertical;
            frameParent.LayoutParameters = linearLayoutParams;

            LinearLayout frame = new LinearLayout(con);

            frame.Orientation = Orientation.Vertical;
            int currentapiVersion = (int)Build.VERSION.SdkInt;

            if (currentapiVersion > 21)
            {
                frame.Background = con.Resources.GetDrawable(Resource.Drawable.shadow, con.Theme);
            }

            TextView headLabel = new TextView(con);

            headLabel.SetPadding(padding, headLabel.PaddingTop, headLabel.PaddingRight, headLabel.PaddingBottom);
            headLabel.TextSize = 18;
            headLabel.SetTextColor(Color.ParseColor("#FF007DE6"));
            headLabel.Text = "Add Extra Toppings";
            frame.AddView(headLabel);

            #region Items Layout

            selectAllBox          = new SfCheckBox(con);
            selectAllBox.Text     = "Select All";
            selectAllBox.TextSize = 15;
            selectAllBox.SetTextColor(Color.ParseColor("#FF000000"));
            selectAllBox.StateChanged    += SelectAll1_StateChanged;
            selectAllBox.LayoutParameters = linearLayoutParams;
            frame.AddView(selectAllBox);

            grilledBox          = new SfCheckBox(con);
            grilledBox.Text     = "Grilled Chicken";
            grilledBox.TextSize = 15;
            grilledBox.SetTextColor(Color.ParseColor("#FF000000"));
            grilledBox.StateChanged    += NonvegToppingsChanged;
            grilledBox.LayoutParameters = linearLayoutParams;
            frame.AddView(grilledBox);

            tikkaBox          = new SfCheckBox(con);
            tikkaBox.Text     = "Chicken Tikka";
            tikkaBox.TextSize = 15;
            tikkaBox.SetTextColor(Color.ParseColor("#FF000000"));
            tikkaBox.StateChanged    += NonvegToppingsChanged;
            tikkaBox.LayoutParameters = linearLayoutParams;
            frame.AddView(tikkaBox);

            sausaga          = new SfCheckBox(con);
            sausaga.Text     = "Chicken Sausage";
            sausaga.TextSize = 15;
            sausaga.SetTextColor(Color.ParseColor("#FF000000"));
            sausaga.StateChanged    += NonvegToppingsChanged;
            sausaga.LayoutParameters = linearLayoutParams;
            frame.AddView(sausaga);

            beefBox          = new SfCheckBox(con);
            beefBox.Text     = "Beef";
            beefBox.TextSize = 15;
            beefBox.SetTextColor(Color.ParseColor("#FF000000"));
            beefBox.StateChanged    += NonvegToppingsChanged;
            beefBox.LayoutParameters = linearLayoutParams;
            frame.AddView(beefBox);

            frameParent.AddView(frame);
            linear.AddView(frameParent);
            #endregion

            button = new Button(con);
            button.SetWidth(ActionBar.LayoutParams.MatchParent);
            button.SetHeight(43);
            button.TextSize = 21;
            button.Text     = "Order Now";
            button.SetBackgroundColor(Color.ParseColor("#FF007DE6"));
            button.SetTextColor(Color.ParseColor("#73FFFFFF"));
            button.Click  += SearchButton_Click;
            button.Enabled = false;

            linear.AddView(button);

            resultsDialog = new AlertDialog.Builder(con);
            resultsDialog.SetPositiveButton("OK", (object sender, DialogClickEventArgs e) =>
            {
            });

            resultsDialog.SetCancelable(true);
            return(linear);
        }
        private void CreateLayout()
        {
            // Create a new vertical layout for the app.
            LinearLayout layout = new LinearLayout(this)
            {
                Orientation = Orientation.Vertical
            };

            // Create a TextView for instructions.
            TextView instructionsTextView = new TextView(this)
            {
                Text = "Tap on the map to add points. Each point will use the buffer distance entered when it was created. " +
                       "The envelope shows the area where you can expect reasonable results for planar buffer operations with the North Central Texas State Plane spatial reference."
            };

            layout.AddView(instructionsTextView);

            // Create a horizontal sub layout for the text view and edit text controls.
            LinearLayout subLayout1 = new LinearLayout(this)
            {
                Orientation = Orientation.Horizontal
            };

            // Create a TextView for the buffer input label.
            TextView bufferDistanceTextView = new TextView(this)
            {
                Text = "Buffer distance (miles):"
            };

            subLayout1.AddView(bufferDistanceTextView);

            // Create a EditText for the buffer distance input.
            _bufferDistanceMilesEditText = new EditText(this)
            {
                Text = "10"
            };
            subLayout1.AddView(_bufferDistanceMilesEditText);

            // Add the first row of controls to the main layout.
            layout.AddView(subLayout1);

            // Create a horizontal sub layout for the text view and switch controls.
            LinearLayout subLayout2 = new LinearLayout(this)
            {
                Orientation = Orientation.Horizontal
            };

            // Create a TextView for the switch label.
            TextView switchLabelTextView = new TextView(this)
            {
                Text = "Union the buffer(s):"
            };

            subLayout2.AddView(switchLabelTextView);

            // Create a Switch for the union output option.
            _unionBufferSwitch = new Switch(this)
            {
                Checked = true
            };
            subLayout2.AddView(_unionBufferSwitch);

            // Add the second row of controls to the main layout.
            layout.AddView(subLayout2);

            // Create a horizontal sub layout for the buffer and clear buttons.
            LinearLayout subLayout3 = new LinearLayout(this)
            {
                Orientation = Orientation.Horizontal
            };

            // Create the button to create the buffers.
            Button bufferButton = new Button(this)
            {
                Text = "Make buffers"
            };

            bufferButton.Click += BufferButton_Click;
            subLayout3.AddView(bufferButton);

            // Create a button to clear the graphics from the display.
            Button resetButton = new Button(this)
            {
                Text = "Clear"
            };

            resetButton.Click += ClearButton_Click;
            subLayout3.AddView(resetButton);

            // Add the third row of controls to the main layout.
            layout.AddView(subLayout3);

            // Add the map view to the layout.
            _myMapView = new MapView(this);
            layout.AddView(_myMapView);

            // Show the layout in the app.
            SetContentView(layout);
        }
        private void CreateLayout()
        {
            #region UI for selecting parameter type and applying the renderer
            // Create a vertical layout for the page.
            LinearLayout mainLayout = new LinearLayout(this)
            {
                Orientation = Orientation.Vertical
            };

            // Add some padding to the layout.
            mainLayout.SetPadding(20, 0, 0, 5);

            // Create a horizontal layout for the parameter type list and button to apply the renderer.
            LinearLayout parameterTypeLayout = new LinearLayout(this)
            {
                Orientation = Orientation.Horizontal
            };
            string[] stretchTypes = { "Min Max", "Percent Clip", "Standard Deviation" };
            ArrayAdapter <string> stretchTypesAdapter = new ArrayAdapter <string>(this, Android.Resource.Layout.SimpleSpinnerDropDownItem, stretchTypes);

            // Create the spinner control for choosing the stretch parameter input type and handle its ItemSelected event.
            _parameterInputTypeSpinner = new Spinner(this)
            {
                Adapter       = stretchTypesAdapter,
                DropDownWidth = 340
            };
            _parameterInputTypeSpinner.ItemSelected += ParameterInputTypeSpinner_ItemSelected;

            // Create the button that applies the renderer and handle its Click event.
            _applyRendererButton = new Button(this)
            {
                Text    = "Apply",
                Enabled = false
            };
            _applyRendererButton.Click += ApplyRendererButton_Click;

            // Add a label, parameter type spinner control, and the apply button.
            TextView parameterTypeTextView = new TextView(this)
            {
                Text = "Stretch type: "
            };
            parameterTypeLayout.AddView(parameterTypeTextView);
            parameterTypeLayout.AddView(_parameterInputTypeSpinner);
            parameterTypeLayout.AddView(_applyRendererButton);

            // Add the parameter UI choice controls to the main layout.
            mainLayout.AddView(parameterTypeLayout);
            #endregion

            #region UI for defining min/max RGB values
            // Create a horizontal layout for the min/max RGB inputs.
            _minMaxLayout = new LinearLayout(this)
            {
                Orientation = Orientation.Horizontal
            };

            // Create a range of values from 0-255 and an adapter to display them.
            int[] minMaxValues = Enumerable.Range(0, 256).ToArray();
            ArrayAdapter <int> minMaxValuesAdapter = new ArrayAdapter <int>(this, Android.Resource.Layout.SimpleSpinnerDropDownItem, minMaxValues);

            // Get the width of the current device (in pixels).
            int widthPixels = Resources.DisplayMetrics.WidthPixels;

            // Use 1/5 of the device width for the drop down.
            int dropDownWidth = widthPixels / 5;

            // Create controls for specifying the minimum and maximum red values (0-255).
            _minRedSpinner = new Spinner(this, SpinnerMode.Dropdown)
            {
                Adapter       = minMaxValuesAdapter,
                DropDownWidth = dropDownWidth
            };
            _minRedSpinner.SetSelection(0);
            _maxRedSpinner = new Spinner(this, SpinnerMode.Dropdown)
            {
                Adapter       = minMaxValuesAdapter,
                DropDownWidth = dropDownWidth
            };
            _maxRedSpinner.SetSelection(255);

            // Set the background color to indicate which values the inputs are for.
            _minRedSpinner.SetBackgroundColor(Android.Graphics.Color.DarkRed);
            _maxRedSpinner.SetBackgroundColor(Android.Graphics.Color.DarkRed);

            // Create controls for specifying the minimum and maximum green values (0-255).
            _minGreenSpinner = new Spinner(this, SpinnerMode.Dropdown)
            {
                Adapter       = minMaxValuesAdapter,
                DropDownWidth = dropDownWidth
            };
            _minGreenSpinner.SetSelection(0);
            _maxGreenSpinner = new Spinner(this, SpinnerMode.Dropdown)
            {
                Adapter       = minMaxValuesAdapter,
                DropDownWidth = dropDownWidth
            };
            _maxGreenSpinner.SetSelection(255);

            // Set the background color to indicate which values the inputs are for.
            _minGreenSpinner.SetBackgroundColor(Android.Graphics.Color.DarkGreen);
            _maxGreenSpinner.SetBackgroundColor(Android.Graphics.Color.DarkGreen);

            // Create controls for specifying the minimum and maximum blue values (0-255).
            _minBlueSpinner = new Spinner(this, SpinnerMode.Dropdown)
            {
                Adapter       = minMaxValuesAdapter,
                DropDownWidth = dropDownWidth
            };
            _minBlueSpinner.SetSelection(0);
            _maxBlueSpinner = new Spinner(this, SpinnerMode.Dropdown)
            {
                Adapter       = minMaxValuesAdapter,
                DropDownWidth = dropDownWidth
            };
            _maxBlueSpinner.SetSelection(255);

            // Set the background color to indicate which values the inputs are for.
            _minBlueSpinner.SetBackgroundColor(Android.Graphics.Color.DarkBlue);
            _maxBlueSpinner.SetBackgroundColor(Android.Graphics.Color.DarkBlue);

            // Create vertical layouts for the color inputs (so they align properly).
            LinearLayout redInputsLayout = new LinearLayout(this)
            {
                Orientation = Orientation.Vertical
            };
            LinearLayout greenInputsLayout = new LinearLayout(this)
            {
                Orientation = Orientation.Vertical
            };
            LinearLayout blueInputsLayout = new LinearLayout(this)
            {
                Orientation = Orientation.Vertical
            };

            // Add the color inputs to their corresponding layout.
            redInputsLayout.AddView(_minRedSpinner);
            redInputsLayout.AddView(_maxRedSpinner);
            greenInputsLayout.AddView(_minGreenSpinner);
            greenInputsLayout.AddView(_maxGreenSpinner);
            blueInputsLayout.AddView(_minBlueSpinner);
            blueInputsLayout.AddView(_maxBlueSpinner);

            // Add the vertical color inputs to the horizontal parent layout.
            _minMaxLayout.SetPadding(50, 10, 0, 10);
            _minMaxLayout.AddView(redInputsLayout);
            _minMaxLayout.AddView(greenInputsLayout);
            _minMaxLayout.AddView(blueInputsLayout);

            // Add the UI layouts to the main layout
            mainLayout.AddView(_minMaxLayout);
            #endregion

            #region UI for defining percent clip values
            // Create a (hidden) vertical layout for the min/max percent clip sliders.
            _percentClipLayout = new LinearLayout(this)
            {
                Orientation = Orientation.Vertical,
                Visibility  = Android.Views.ViewStates.Gone
            };

            // Apply some padding for the layout.
            _percentClipLayout.SetPadding(20, 5, 0, 20);

            // Create the minimum and maximum percent sliders (SeekBar).
            _minPercentClipSlider = new SeekBar(this)
            {
                Max      = 100,
                Progress = 0
            };
            _maxPercentClipSlider = new SeekBar(this)
            {
                Max      = 100,
                Progress = 0
            };

            // Set the SeekBar dimensions and a left margin.
            ActionBar.LayoutParams layoutParamsSeekBar = new ActionBar.LayoutParams(400, 30)
            {
                LeftMargin = 5
            };
            _minPercentClipSlider.LayoutParameters = layoutParamsSeekBar;
            _maxPercentClipSlider.LayoutParameters = layoutParamsSeekBar;

            // Create labels for minimum and maximum percent.
            TextView minimumSliderLabel = new TextView(this)
            {
                Text = "Min: "
            };
            TextView maximumSliderLabel = new TextView(this)
            {
                Text = "Max: "
            };

            // Create horizontal layouts for the minimum and maximum controls.
            LinearLayout minPercentClipLayout = new LinearLayout(this)
            {
                Orientation = Orientation.Horizontal
            };
            LinearLayout maxPercentClipLayout = new LinearLayout(this)
            {
                Orientation = Orientation.Horizontal
            };

            // Add min and max percent controls to their corresponding layouts.
            minPercentClipLayout.AddView(minimumSliderLabel);
            minPercentClipLayout.AddView(_minPercentClipSlider);
            maxPercentClipLayout.AddView(maximumSliderLabel);
            maxPercentClipLayout.AddView(_maxPercentClipSlider);

            // Add the slider layouts to the percent clip layout.
            _percentClipLayout.AddView(minPercentClipLayout);
            _percentClipLayout.AddView(maxPercentClipLayout);

            // Add the percent clip UI to the main layout.
            mainLayout.AddView(_percentClipLayout);
            #endregion

            #region UI for defining standard deviation factor
            // Create a range of values from 0-5 (in 0.5 increments) and an adapter to display them.
            IEnumerable <int>     wholeStdDevs         = Enumerable.Range(1, 10);
            List <double>         halfStdDevs          = wholeStdDevs.Select(i => (double)i / 2).ToList();
            ArrayAdapter <double> stdDevFactorsAdapter = new ArrayAdapter <double>(this, Android.Resource.Layout.SimpleSpinnerDropDownItem, halfStdDevs);

            // Create a drop down (Spinner) control for specifying the standard deviation factor (0.0 - 5.0).
            _stdDeviationFactorSpinner = new Spinner(this, SpinnerMode.Dropdown)
            {
                Adapter       = stdDevFactorsAdapter,
                DropDownWidth = dropDownWidth
            };

            // Set the default selection to the 4th item (value of 2.0)
            _stdDeviationFactorSpinner.SetSelection(4);

            // Create a label (TextView) for the Spinner.
            TextView factorLabel = new TextView(this)
            {
                Text = "Factor: "
            };

            // Create a horizontal layout for the controls.
            LinearLayout stdDevFactorLayout = new LinearLayout(this)
            {
                Orientation = Orientation.Horizontal
            };

            // Add the controls for selecting a standard deviation factor.
            stdDevFactorLayout.AddView(factorLabel);
            stdDevFactorLayout.AddView(_stdDeviationFactorSpinner);

            // Create the standard deviation factor layout and add the controls.
            _stdDeviationLayout = new LinearLayout(this)
            {
                Orientation = Orientation.Vertical,
                Visibility  = Android.Views.ViewStates.Gone
            };
            _stdDeviationLayout.SetPadding(50, 5, 0, 5);
            _stdDeviationLayout.AddView(stdDevFactorLayout);

            // Add the standard deviation layout to the main layout.
            mainLayout.AddView(_stdDeviationLayout);
            #endregion

            // Create the map view control.
            _myMapView = new MapView(this);

            // Add the map view to the layout.
            mainLayout.AddView(_myMapView);

            // Set the layout as the sample view.
            SetContentView(mainLayout);
        }
        private void FillData()
        {
            _editModeHiddenViews = new List <View>();
            ImageButton currIconButton = (ImageButton)FindViewById(Resource.Id.icon_button);

            App.Kp2a.GetDb().DrawableFactory.AssignDrawableTo(currIconButton, this, App.Kp2a.GetDb().KpDatabase, State.Entry.IconId, State.Entry.CustomIconUuid, false);

            PopulateText(Resource.Id.entry_title, State.Entry.Strings.ReadSafe(PwDefs.TitleField));
            PopulateText(Resource.Id.entry_user_name, State.Entry.Strings.ReadSafe(PwDefs.UserNameField));
            PopulateText(Resource.Id.entry_url, State.Entry.Strings.ReadSafe(PwDefs.UrlField));

            String password = State.Entry.Strings.ReadSafe(PwDefs.PasswordField);

            PopulateText(Resource.Id.entry_password, password);
            PopulateText(Resource.Id.entry_confpassword, password);

            PopulateText(Resource.Id.entry_comment, State.Entry.Strings.ReadSafe(PwDefs.NotesField));

            LinearLayout container = (LinearLayout)FindViewById(Resource.Id.advanced_container);

            foreach (var key in State.EditMode.SortExtraFieldKeys(State.Entry.Strings.Select(ps => ps.Key)))
            {
                if (!PwDefs.IsStandardField(key))
                {
                    RelativeLayout ees       = CreateExtraStringView(new KeyValuePair <string, ProtectedString>(key, State.Entry.Strings.Get(key)));
                    var            isVisible = State.EditMode.IsVisible(key);
                    ees.Visibility = isVisible ? ViewStates.Visible : ViewStates.Gone;
                    if (!isVisible)
                    {
                        _editModeHiddenViews.Add(ees);
                    }
                    container.AddView(ees);
                }
            }

            PopulateBinaries();

            if (App.Kp2a.GetDb().DatabaseFormat.SupportsOverrideUrl)
            {
                PopulateText(Resource.Id.entry_override_url, State.Entry.OverrideUrl);
            }
            else
            {
                FindViewById(Resource.Id.entry_override_url_container).Visibility = ViewStates.Gone;
            }

            if (App.Kp2a.GetDb().DatabaseFormat.SupportsTags)
            {
                PopulateText(Resource.Id.entry_tags, StrUtil.TagsToString(State.Entry.Tags, true));
            }
            else
            {
                var view = FindViewById(Resource.Id.entry_tags_label);
                if (view != null)
                {
                    view.Visibility = ViewStates.Gone;
                }
                FindViewById(Resource.Id.entry_tags).Visibility = ViewStates.Gone;
            }


            UpdateExpires();

            List <KeyValuePair <string, int> > keyLayoutIds = new List <KeyValuePair <string, int> >()
            {
                new KeyValuePair <string, int>(PwDefs.TitleField, Resource.Id.title_section),
                new KeyValuePair <string, int>(PwDefs.UserNameField, Resource.Id.user_section),
                new KeyValuePair <string, int>(PwDefs.PasswordField, Resource.Id.password_section),
                new KeyValuePair <string, int>(PwDefs.UrlField, Resource.Id.url_section),
                new KeyValuePair <string, int>(PwDefs.NotesField, Resource.Id.comments_section),
                new KeyValuePair <string, int>(KeePass.TagsKey, Resource.Id.tags_section),
                new KeyValuePair <string, int>(KeePass.OverrideUrlKey, Resource.Id.entry_override_url_container),
                new KeyValuePair <string, int>(KeePass.ExpDateKey, Resource.Id.expires_section),
            };

            foreach (var kvp in keyLayoutIds)
            {
                var isVisible = State.EditMode.IsVisible(kvp.Key);
                var field     = FindViewById(kvp.Value);
                if (!isVisible)
                {
                    _editModeHiddenViews.Add(field);
                }

                field.Visibility = isVisible ? ViewStates.Visible : ViewStates.Gone;
            }
        }
Beispiel #57
0
        private LinearLayout CreateTheaterTile(LinearLayout view, TableItem item)
        {
            LinearLayout theaterInfo = new LinearLayout(context);

            theaterInfo.Orientation = Android.Widget.Orientation.Vertical;

            TextView theaterName = new TextView(context);

            theaterName.Text = item.Heading;
            theaterName.SetTextColor(Color.ParseColor("#000000"));
            theaterName.SetTextSize(ComplexUnitType.Dip, 16);
            theaterName.SetPadding((int)(12 * density), 0, 0, (int)(8 * density));

            TextView areaName = new TextView(context);

            areaName.Text = item.SubHeading;
            areaName.SetTextColor(Color.ParseColor("#000000"));
            areaName.SetTextSize(ComplexUnitType.Dip, 12);
            areaName.SetPadding((int)(12 * density), 0, 0, (int)(10 * density));

            LinearLayout timingLayout = new LinearLayout(context);

            timingLayout.Orientation = Android.Widget.Orientation.Horizontal;

            timing1        = new TextView(context);
            timing1.Text   = item.Timing1;
            timing1.Click += Timing1_Click;
            timing1.SetX((int)(12 * density));
            timing1.Gravity = GravityFlags.CenterHorizontal | GravityFlags.CenterVertical;
            timing1.SetTextColor(Color.ParseColor("#007CEE"));
            timing1.SetTextSize(ComplexUnitType.Dip, 14);
            timing1.SetBackgroundResource(Resource.Layout.BorderLayout1);

            timing2      = new TextView(context);
            timing2.Text = item.Timing2;
            timing2.SetTextColor(Color.ParseColor("#007CEE"));
            timing2.Gravity = GravityFlags.CenterHorizontal | GravityFlags.CenterVertical;
            timing2.SetX((int)(22 * density));
            if (MainActivity.IsTablet)
            {
                timing2.SetPadding(0, 2, 0, 0);
            }
            else
            {
                timing2.SetPadding(0, 20, 0, 0);
            }
            timing2.SetTextSize(ComplexUnitType.Dip, 14);
            timing2.Click += Timing2_Click;
            timing2.SetBackgroundResource(Resource.Layout.BorderLayout1);

            timingLayout.AddView(timing1, (int)(80 * density), ViewGroup.LayoutParams.MatchParent);
            timingLayout.AddView(timing2, (int)(80 * density), ViewGroup.LayoutParams.MatchParent);

            theaterInfo.AddView(theaterName);
            theaterInfo.AddView(areaName);
            if (MainActivity.IsTablet)
            {
                theaterInfo.AddView(timingLayout, ViewGroup.LayoutParams.MatchParent, (int)(25 * density));
            }
            else
            {
                theaterInfo.AddView(timingLayout, ViewGroup.LayoutParams.MatchParent, (int)(32 * density));
            }

            infoImage = new ImageView(context);
            infoImage.SetImageResource(item.ImageResourceId);
            infoImage.Click += Info_Click;
            infoImage.Alpha  = 0.5f;
            infoImage.SetY((int)(38 * density));

            view.AddView(theaterInfo, (int)(Resources.System.DisplayMetrics.WidthPixels - (48 * density)), (int)(100 * density));
            view.AddView(infoImage, (int)(24 * density), (int)(24 * density));

            if (item.Timing1 != null)
            {
                timing1.Text = item.Timing1;
            }
            else
            {
                timing1.Visibility = ViewStates.Invisible;
                timing1.Gravity    = GravityFlags.CenterHorizontal;
            }
            if (item.Timing2 != null)
            {
                timing2.Text    = item.Timing2;
                timing2.Gravity = GravityFlags.CenterHorizontal;
            }
            else
            {
                timing2.Visibility = ViewStates.Invisible;
            }
            return(view);
        }
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            // Dialog to display
            LinearLayout dialogView = null;

            // Get the context for creating the dialog controls
            Android.Content.Context ctx = Activity.ApplicationContext;

            // Set a dialog title
            Dialog.SetTitle("Save Map to Portal");

            try
            {
                base.OnCreateView(inflater, container, savedInstanceState);

                // The container for the dialog is a vertical linear layout
                dialogView             = new LinearLayout(ctx);
                dialogView.Orientation = Orientation.Vertical;

                // Add a text box for entering a title for the new web map
                _mapTitleTextbox      = new EditText(ctx);
                _mapTitleTextbox.Hint = "Title";
                dialogView.AddView(_mapTitleTextbox);

                // Add a text box for entering a description
                _mapDescriptionTextbox      = new EditText(ctx);
                _mapDescriptionTextbox.Hint = "Description";
                dialogView.AddView(_mapDescriptionTextbox);

                // Add a text box for entering tags (populate with some values so the user doesn't have to fill this in)
                _tagsTextbox      = new EditText(ctx);
                _tagsTextbox.Text = "ArcGIS Runtime, Web Map";
                dialogView.AddView(_tagsTextbox);

                // Add a button to save the map
                Button saveMapButton = new Button(ctx);
                saveMapButton.Text   = "Save";
                saveMapButton.Click += SaveMapButtonClick;
                dialogView.AddView(saveMapButton);

                // If there's an existing portal item, configure the dialog for "update" (read-only entries)
                if (_portalItem != null)
                {
                    _mapTitleTextbox.Text    = _portalItem.Title;
                    _mapTitleTextbox.Enabled = false;

                    _mapDescriptionTextbox.Text    = _portalItem.Description;
                    _mapDescriptionTextbox.Enabled = false;

                    _tagsTextbox.Text    = string.Join(",", _portalItem.Tags);
                    _tagsTextbox.Enabled = false;

                    // Change some of the control text
                    Dialog.SetTitle("Save Changes to Map");
                    saveMapButton.Text = "Update";
                }
            }
            catch (Exception ex)
            {
                // Show the exception message
                var alertBuilder = new AlertDialog.Builder(Activity);
                alertBuilder.SetTitle("Error");
                alertBuilder.SetMessage(ex.Message);
                alertBuilder.Show();
            }

            // Return the new view for display
            return(dialogView);
        }
Beispiel #59
0
        private View CreateUserListStatusView(IReadOnlyList <AniListStatusDistribution> statusDistribution)
        {
            var detailView      = LayoutInflater.Inflate(Resource.Layout.View_AniListObjectDetail, null);
            var detailContainer = detailView.FindViewById <LinearLayout>(Resource.Id.AniListObjectDetail_InnerContainer);

            detailView.FindViewById <TextView>(Resource.Id.AniListObjectDetail_Name).Text = "User Lists";
            detailContainer.Orientation = Orientation.Horizontal;

            var chartHeight  = Resources.GetDimensionPixelSize(Resource.Dimension.Details_ChartHeight);
            var legendMargin = Resources.GetDimensionPixelSize(Resource.Dimension.Details_MarginSmall);

            var chartContainer = new LinearLayout(this)
            {
                LayoutParameters = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, chartHeight, 1)
            };

            var legendContainer = new LinearLayout(this)
            {
                LayoutParameters =
                    new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, chartHeight, 1)
                {
                    RightMargin = legendMargin,
                    LeftMargin  = legendMargin
                },
                Orientation = Orientation.Vertical
            };

            var typedColorArray = Resources.ObtainTypedArray(Resource.Array.Chart_Colors);
            var colorList       = new List <int>();

            for (var i = 0; i < typedColorArray.Length(); i++)
            {
                colorList.Add(typedColorArray.GetColor(i, 0));
            }

            var statusChart = new PieChart(this)
            {
                LayoutParameters =
                    new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent)
            };
            var slices = statusDistribution.Select(x => new PieEntry(x.Amount, x.Status.DisplayValue)
            {
                Data = x.Status.DisplayValue
            }).ToList();
            var dataSet = new PieDataSet(slices, "Status")
            {
                SliceSpace = 1,
            };

            dataSet.SetDrawValues(false);
            dataSet.SetColors(colorList.ToArray(), 255);
            var data = new PieData(dataSet);

            statusChart.TransparentCircleRadius = 0;
            statusChart.HoleRadius = 0;
            statusChart.Data       = data;
            statusChart.SetDrawEntryLabels(false);
            statusChart.Description.Enabled = false;
            statusChart.Legend.Enabled      = false;
            statusChart.RotationEnabled     = false;

            chartContainer.AddView(statusChart);

            for (var i = 0; i < statusDistribution.Count; i++)
            {
                var cell   = LayoutInflater.Inflate(Resource.Layout.View_ChartLegendCell, legendContainer, false);
                var status = statusDistribution[i];
                cell.SetBackgroundColor(new Color(colorList[i % 10]));
                cell.FindViewById <TextView>(Resource.Id.ChartLegendCell_Count).Text = status.Amount.ToTruncatedString();
                cell.FindViewById <TextView>(Resource.Id.ChartLegendCell_Text).Text  = status.Status.DisplayValue;
                cell.Tag = status.Status.DisplayValue;
                legendContainer.AddView(cell);
            }

            detailContainer.AddView(chartContainer);
            detailContainer.AddView(legendContainer);

            return(detailView);
        }
        private void ShowTransactionDetailDialog()
        {
            ObservableCollection <TransactionDisplayData> data =
                new ObservableCollection <TransactionDisplayData>();
            string currency      = "";
            string transSizeUnit = "";
            string cellValue;

            foreach (var column in dataGrid.Columns)
            {
                if ((column.MappingName == "StatusIcon") || (column.MappingName == "LabelStatusIcon"))
                {
                    continue;
                }

                var rowData = dataGrid.GetRecordAtRowIndex(selectedRowIndex);

                if (column.MappingName == "Currency")
                {
                    currency = dataGrid.GetCellValue(rowData, column.MappingName).ToString();
                    continue;
                }

                if (column.MappingName == "TransactionSizeUnit")
                {
                    transSizeUnit = dataGrid.GetCellValue(rowData, column.MappingName).ToString();
                    continue;
                }

                cellValue = dataGrid.GetCellValue(rowData, column.MappingName).ToString();

                if ((column.MappingName == "Debit") || (column.MappingName == "TransactionFee") ||
                    (column.MappingName == "Amount"))
                {
                    cellValue += " " + currency;
                }
                else if (column.MappingName == "TransactionSize")
                {
                    cellValue += " " + transSizeUnit;
                }

                data.Add(new TransactionDisplayData(column.MappingName, cellValue));
            }

            SfDataGrid grid = new SfDataGrid(Context)
            {
                RowHeight           = 30,
                HeaderRowHeight     = 0,
                GridStyle           = new SyncFusionUtilities.CustomGridStyle(),
                AutoGenerateColumns = false,
                ColumnSizer         = ColumnSizer.None,
                FrozenColumnsCount  = 1,
                ItemsSource         = data
            };

            grid.Columns.Add(SyncFusionUtilities.DataGridUtilities.CreateTextColumn("ColumnOneData", "One", "", 125));
            grid.Columns.Add(SyncFusionUtilities.DataGridUtilities.CreateTextColumn("ColumnTwoData", "Two", "", 500));

            var builder = new Android.Support.V7.App.AlertDialog.Builder(Context);

            builder.SetTitle("Transaction Details");

            LayoutInflater layoutInflater = Activity.LayoutInflater;

            View dialogView = layoutInflater.Inflate(Resource.Layout.customdialoglayout, null);

            LinearLayout lay = dialogView.FindViewById <LinearLayout>(Resource.Id.customLinearLayout);

            lay.AddView(grid);

            builder.SetView(dialogView);

            builder.SetNegativeButton(Android.Resource.String.Ok, (senderAlert, args) => { });

            builder.Show();
        }