Example #1
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;
        }
        // create a new ImageView for each item referenced by the Adapter
        public override View GetView(int position, View convertView, ViewGroup parent)
        {
            //Button tagButton;
            TextView tagButton;

            if (convertView == null)
            {  // if it's not recycled, initialize some attributes
                //tagButton = new Button(context);
                tagButton = new TextView(context);
                //tagButton.LayoutParameters = new GridView.LayoutParams(190, 190);
                tagButton.LayoutParameters = new GridView.LayoutParams(ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent);
                tagButton.SetTextColor(Color.Rgb(34, 191, 185));
                //tagButton.SetPadding(5, 2, 5, 2);// ltrb
                tagButton.SetPadding(10, 4, 10, 4);// ltrb
                tagButton.SetBackgroundResource(Resource.Drawable.flame_style);

                //imageView.SetScaleType(ImageView.ScaleType.CenterCrop);
            }
            else
            {
                //tagButton = (Button)convertView;
                tagButton = (TextView)convertView;
            }

            // Bitmap bmp = MediaStore.Images.Thumbnails.GetThumbnail(cr, items[position].ImageId, ThumbnailKind.MicroKind, null);
            //imageView.SetImageBitmap(bmp);
            tagButton.Text = items[position].TagStr;
            return tagButton;
        }
		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;
		}
		/// <summary>
		/// Creates a new view for the profile fragment whenever a new username is selected 
		/// and displays the corresponding profile bios.
		/// <param name="inflater">Android layout inflater.</param>
		/// <param name="container">.ndroid view container</param>
		/// <param name="savedInstanceState">Bundle.</param>
        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 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;

			try {
				text.Text = nearbyBios[ShownUserId];
			}
			catch(IndexOutOfRangeException e) {
				string error = "\n\nServer offline\n\n" + e.Message;
				System.Diagnostics.Debug.WriteLine (error);
				nearbyBios = new string[1];
				nearbyBios [0] = error;
			}
			

            scroller.AddView(text);

            return scroller;
        }
Example #5
0
		public static void TextViewDialog(Context context, string path, string text = null)
		{
			var textView = new TextView(context);
			textView.SetPadding(10, 10, 10, 10);
			textView.SetTextSize(ComplexUnitType.Sp, 10f);
			var scrollView = new ScrollView(context);
			scrollView.AddView(textView);
			AlertDialog.Builder dialog = new AlertDialog.Builder(context);
			dialog.SetView(scrollView);

			if (text == null) {
				try {
					using (StreamReader sr = new StreamReader(path, Encoding.GetEncoding("euc-kr"))) {
						textView.Text = sr.ReadToEnd();
						sr.Close();
					}
				} catch { }
			} else {
				textView.Text = text;
			}

			dialog.SetPositiveButton("닫기", delegate
			{ });

			dialog.Show();
		}
		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);
			video = new VideoView (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);
			video.LayoutParameters = new ViewGroup.LayoutParams(Configuration.getWidth(582),Configuration.getHeight(394));


			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);


		}
 private View RenderName(Car car)
 {
     var textView = new TextView(Context);
     textView.Text = car.Name;
     textView.SetPadding(20, 10, 20, 10);
     textView.TextSize = TextSize;
     return textView;
 }
Example #8
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;
        }
        public override View GetView(int position, View convertView, ViewGroup parent)
        {
            var textView = new TextView(_context);

            textView.Text = _items.ElementAt(position).Label;
            textView.SetPadding(5, 10, 0, 10);

            return textView;
        }
Example #10
0
 private View createColumn(Context context, string ev)
 {
     TextView view = new TextView(context);
     view.SetPadding(20, 0, 0, 0);
     view.SetBackgroundColor(Android.Graphics.Color.White);
     view.Text = ev;
     view.SetTextColor(Android.Graphics.Color.ParseColor("#3B3477"));
     return view;
 }
        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();
        }
        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);
        }
Example #13
0
		public override View GetView (int position, View convertView, ViewGroup parent)
		{
			TextView result = convertView as TextView;
			if (result == null) {
				result = new TextView (_activity) {
					TextSize = 28.0f,
					Text = _gestureActivities.Keys.ElementAt(position)
				};
				result.SetPadding (0, 15, 0, 15);
			}

			return result;
		}
		public override bool OnCreateOptionsMenu (IMenu menu)
		{
			tv = new TextView (this);
			tv.Text = "  Save ";
			tv.TextSize = 20;
			tv.SetPadding (0, 0, 20, 0);
			tv.SetTextColor (Resources.GetColor(Resource.Color.mass_blue));
			tv.Click += (sender, e) => {
				saveClicked();
			};
			menu.Add (Resource.String.change_pin).SetActionView (tv).SetShowAsAction (ShowAsAction.Always);
			return base.OnCreateOptionsMenu (menu);

		}
		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;        
		}
Example #16
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);
		}
Example #17
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 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;
        }
        //@Override
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            TextView text = new TextView(this.Activity);
            text.Gravity = GravityFlags.Center;
            text.Text = mContent;
            text.TextSize = 20 * this.Resources.DisplayMetrics.Density;
            text.SetPadding(20, 20, 20, 20);

            LinearLayout layout = new LinearLayout(this.Activity);
            layout.LayoutParameters = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent);
            layout.SetGravity(GravityFlags.Center);
            layout.AddView(text);

            return 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;
        }
Example #21
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 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;
		}
       public override View GetSampleContent(Context context)
        {
            var chart = new SfChart(context);
            chart.SetBackgroundColor(Color.White);

            var primaryAxis = new CategoryAxis { LabelPlacement = LabelPlacement.BetweenTicks };
            primaryAxis.Title.Text = "Month";
            chart.PrimaryAxis = primaryAxis;

            var secondaryAxis = new NumericalAxis();
            secondaryAxis.Title.Text = "Sales";
            secondaryAxis.LabelStyle.LabelFormat = "$##.##";
            chart.SecondaryAxis = secondaryAxis;

            var columnSeries = new ColumnSeries
            {
                DataSource = MainPage.GetSelectionData(),
                DataMarkerPosition = DataMarkerPosition.Center,
                SelectedDataPointIndex = 2,
                DataPointSelectionEnabled = true,
            };

            columnSeries.DataMarker.ShowLabel = true;
            chart.Series.Add(columnSeries);
            
            chart.Behaviors.Add(new ChartSelectionBehavior());
            chart.SelectionChanged += chart_SelectionChanged;

            label = new TextView(context){ TextSize = 20 };
            label.SetPadding(5, 5, 5, 5);

            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;
        }
        protected override View CreateView(LayoutInflater inflater, ViewGroup container)
        {
            LinearLayout rootView = new LinearLayout(Activity)
            {
                Orientation = Orientation.Vertical,
            };
            rootView.SetGravity(GravityFlags.Center);
            rootView.SetPaddingRelative(16, 10, 16, 10);

            _pickerView = new ColorPickerView(Activity);
            _oldPanelView = new ColorPanelView(Activity);
            _currentPanelView = new ColorPanelView(Activity);

            TextView textView = new TextView(Activity)
            {
                Text = "→",
                TextSize = 40,
                Gravity = GravityFlags.Center
            };
            textView.SetTextColor(Color.White);
            textView.SetPadding(10, 1, 10, 1);
            float density = Application.Context.Resources.DisplayMetrics.Density;

            LinearLayout bottomView = new LinearLayout(Activity)
            {
                Orientation = Orientation.Horizontal
            };
            LinearLayout.LayoutParams layoutparams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent, 0.5f);

            rootView.AddView(_pickerView);
            LinearLayout.LayoutParams rootLayoutParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, (int) (density*40));
            rootLayoutParams.SetMargins(10, 10, 10, 10);
            rootView.AddView(bottomView, rootLayoutParams);

            bottomView.AddView(_oldPanelView, layoutparams);
            bottomView.AddView(textView);
            bottomView.AddView(_currentPanelView, layoutparams);

            //setting up colors
            _pickerView.OnColorChanged += OnPickerColorChanged;

            _oldPanelView.Color = OldColor;
            _pickerView.setColor((int)OldColor, true);

            return rootView;
        }
Example #24
0
		public void InitView(List<BookingDocumentDto> _bookingDocs) {
			this.RemoveAllViews ();
			int size = _bookingDocs.Count;
			for(int i = 0; i < size; i ++) {
				LinearLayout ll = new LinearLayout (_context);
				ll.Orientation = Orientation.Horizontal;
				ll.SetVerticalGravity (GravityFlags.CenterVertical);

				ImageView imgFile = new ImageView (_context);
				imgFile.SetImageResource (Resource.Drawable.ic_attach);

				var tvFileAttach = new TextView (_context) {
					Text = _bookingDocs[i].OriginalFileName
				};
				tvFileAttach.Id = i;
				tvFileAttach.SetTextColor (Color.Blue);
				tvFileAttach.PaintFlags = PaintFlags.UnderlineText;
				tvFileAttach.SetTypeface (null, TypefaceStyle.Bold);
				tvFileAttach.SetSingleLine (true);
				tvFileAttach.Ellipsize = global::Android.Text.TextUtils.TruncateAt.Middle;
				tvFileAttach.SetPadding (5, 0, 10, 0);
				LayoutParams param = new TableRow.LayoutParams(0, LayoutParams.WrapContent, 1f);
				tvFileAttach.LayoutParameters = param;
				tvFileAttach.Click += (sender, e) => {
					utilsAndroid.onViewFile(_context, _bookingDocs[tvFileAttach.Id].S3FileName);
				};

				ImageButton imgDelete = new ImageButton (_context);
				imgDelete.Id = i;
				imgDelete.SetImageResource (Resource.Drawable.ic_delete);
				imgDelete.SetMinimumWidth (50);
				imgDelete.SetMinimumHeight (50);
				imgDelete.SetBackgroundColor (Color.Transparent);
				imgDelete.Click += (sender, e) => {
					_deleteFile.onDeleteFile(_isInConference, _bookingDocs[imgDelete.Id]);
				};

				ll.AddView (imgFile);
				ll.AddView (tvFileAttach);
				ll.AddView (imgDelete);
				ll.SetPadding (0, 5, 0, 5);

				this.AddView (ll);
			}
		}
       public override View GetSampleContent(Context context)
        {
            var chart = new SfChart(context);
            chart.SetBackgroundColor(Color.White);

            var primaryAxis = new CategoryAxis {LabelPlacement = LabelPlacement.BetweenTicks};
            primaryAxis.Title.Text = "Month";
            chart.PrimaryAxis = primaryAxis;

            var secondaryAxis = new NumericalAxis();
            secondaryAxis.Title.Text = "Sales";
            secondaryAxis.LabelStyle.LabelFormat = "$##.##";
            chart.SecondaryAxis = secondaryAxis;

            var columnSeries = new ColumnSeries
            {
                DataSource = MainPage.GetSelectionData(),
                DataMarkerPosition = DataMarkerPosition.Center,
            };

            chart.Series.Add(columnSeries);
            chart.Behaviors.Add(new ChartZoomPanBehavior {SelectionZoomingEnabled = true, SelectionRectStrokeWidth = 1});

           
            var label = new TextView(context);;
            label.SetPadding(5, 5, 5, 5);
            label.Text = "Pinch to zoom or double tap and drag to select a region to zoom in.";

            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;
        }
		void AppendRow (TableLayout table)
		{
			TableRow row = new TableRow (this);

			TextView label = new TextView (this);
			label.SetText (Resource.String.table_layout_8_quit);
			label.SetPadding (3, 3, 3, 3);

			TextView shortcut = new TextView (this);
			shortcut.SetText (Resource.String.table_layout_8_ctrlq);
			shortcut.SetPadding (3, 3, 3, 3);
			shortcut.Gravity = GravityFlags.Right | GravityFlags.Top;

			row.AddView (label, new TableRow.LayoutParams (1));
			row.AddView (shortcut, new TableRow.LayoutParams ());

			table.AddView (row, new TableLayout.LayoutParams ());
		}
        private View RenderPrice(Car car)
        {
            var textView = new TextView(Context);
            textView.Text = (car.Price / 1000).ToString("R #,##0K");
            textView.SetPadding(20, 10, 20, 10);
            textView.TextSize = TextSize;

            if (car.Price < 500000)
            {
                textView.SetTextColor(Color.DarkGreen);
            }
            else if (car.Price > 1000000)
            {
                textView.SetTextColor(Color.DarkRed);
            }

            return textView;
        }
        public override View GetSampleContent(Context context)
        {
            random = new System.Random();
            LoadData();

            chart = new SfChart(context);
            chart.SetBackgroundColor(Color.White);

            chart.PrimaryAxis = new DateTimeAxis { AutoScrollingDelta = 5, AutoScrollingDeltaType = DateTimeDeltaType.Seconds };
            chart.PrimaryAxis.LabelStyle.LabelFormat = "HH:mm:ss";
            
            var axis = new NumericalAxis {Minimum = 0, Maximum = 100};
            chart.SecondaryAxis = axis;

            var columnSeries = new ColumnSeries {DataSource = data};
            chart.Series.Add(columnSeries);

            chart.Behaviors.Add(new ChartZoomPanBehavior {ScrollingEnabled = true, ZoomingEnabled = false});
            
            UpdateData();

            var label = new TextView(context);
            label.SetPadding(5, 5, 5, 5);
            label.Text = "In this demo, a data point is being added every 500 milliseconds." +
                         " The Chart is then automatically scrolled to display the fixed range of data points at the end." +
                         " You can also pan to view previous data points. In this sample the delta value is 5 seconds.";

            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;
        }
		public override View OnCreateView (LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
		{
			if ((savedInstanceState != null) && savedInstanceState.ContainsKey (KEY_CONTENT)) {
				mContent = savedInstanceState.GetString (KEY_CONTENT);
			}
	
			TextView text = new TextView (Activity);
			text.Gravity = GravityFlags.Center;
			text.Text = mContent;
			text.TextSize = (20 * Resources.DisplayMetrics.Density);
			text.SetPadding (20, 20, 20, 20);
	
			LinearLayout layout = new LinearLayout (Activity);
			layout.LayoutParameters = new ViewGroup.LayoutParams (ViewGroup.LayoutParams.FillParent, ViewGroup.LayoutParams.FillParent);
			layout.SetGravity (GravityFlags.Center);
			layout.AddView (text);
	
			return layout;
		}
        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 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;
            text.Text = Shakespeare.Dialogue[ShownPlayId];

            scroller.AddView(text);

            return scroller;
        }