예제 #1
0
 void UpdateToolbarTextColor(Android.Widget.TextView textView, Xamarin.Forms.Color?titleColor, ColorStateList defaultColorStateList)
 {
     if (titleColor != null)
     {
         textView.SetTextColor(titleColor?.ToAndroid() ?? Android.Graphics.Color.White);
     }
     else
     {
         textView.SetTextColor(defaultColorStateList);
     }
 }
예제 #2
0
 public virtual Com.Zhy.Adapter.Abslistview.ViewHolder SetTextColor(int viewId, int
                                                                    textColor)
 {
     Android.Widget.TextView view = GetView <TextView>(viewId);
     view.SetTextColor(Android.Content.Res.ColorStateList.ValueOf(new Android.Graphics.Color(textColor)));
     return(this);
 }
예제 #3
0
		public void UpdateTextColor(TextView control, Color color)
		{
			if (color == _currentTextColor)
				return;

			_currentTextColor = color;

			if (color.IsDefault)
				control.SetTextColor(_defaultTextColors);
			else
			{
				// Set the new enabled state color, preserving the default disabled state color
				int defaultDisabledColor = _defaultTextColors.GetColorForState(s_colorStates[1], color.ToAndroid());
				control.SetTextColor(new ColorStateList(s_colorStates, new[] { color.ToAndroid().ToArgb(), defaultDisabledColor }));
			}
		}
        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);
        }
 public View GetCustomTabView(ViewGroup p0, int p1)
 {
     var txt = new TextView(p0.Context);
     txt.SetTextColor(new Color(ResourceExtension.BrushText));
     txt.Tag = p1;
     switch (p1)
     {
         case 0:
             txt.Text = "General";
             break;
         case 1:
             txt.Text = "Details";
             break;
         case 2:
             txt.Text = "Reviews";
             break;
         case 3:
             txt.Text = "Recoms";
             break;
         case 4:
             txt.Text = "Related";
             break;
     }
     
     return txt;
 }
예제 #6
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);


		}
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            var display = WindowManager.DefaultDisplay;
            var horiPager = new HorizontalPager(this.ApplicationContext, display);
            horiPager.ScreenChanged += new ScreenChangedEventHandler(horiPager_ScreenChanged);

            //You can also use:
            /*horiPager.ScreenChanged += (sender, e) =>
            {
                System.Diagnostics.Debug.WriteLine("Switched to screen: " + ((HorizontalPager)sender).CurrentScreen);
            };*/

            var backgroundColors = new Color[] { Color.Red, Color.Blue, Color.Cyan, Color.Green, Color.Yellow };

            for (int i = 0; i < 5; i++)
            {
                var textView = new TextView(this.ApplicationContext);
                textView.Text = (i + 1).ToString();
                textView.TextSize = 100;
                textView.SetTextColor(Color.Black);
                textView.Gravity = GravityFlags.Center;
                textView.SetBackgroundColor(backgroundColors[i]);
                horiPager.AddView(textView);
            }

            SetContentView(horiPager);
        }
        public BasicPackageManagerView(Context context)
            : base(context, Resource.Drawable.icon_menu_round)
        {
            // Initialize & style Status label
            StatusLabel = new TextView(context);
            StatusLabel.SetTextColor(Color.Black);

            GradientDrawable background = new GradientDrawable();
            background.SetCornerRadius(5);
            background.SetColor(Color.Argb(160, 255, 255, 255));
            StatusLabel.Background = background;

            StatusLabel.Gravity = Android.Views.GravityFlags.Center;
            StatusLabel.Typeface = Typeface.Create("HelveticaNeue", TypefaceStyle.Normal);

            DisplayMetrics screen = Resources.DisplayMetrics;

            int width = screen.WidthPixels / 2;
            int height = width / 4;

            int x = screen.WidthPixels / 2 - width / 2;
            int y = screen.HeightPixels / 100;

            var parameters = new RelativeLayout.LayoutParams(width, height);
            parameters.TopMargin = y;
            parameters.LeftMargin = x;

            AddView(StatusLabel, parameters);

            Menu = new CityChoiceMenu(context);
            AddView(Menu);
        }
예제 #9
0
        //here we only have img and text for each item
        //create a RelativeLayout and add it to dic
        //squear image
        public void AddItem(int imgresource,string text,Action OnCellClick)
        {
            RelativeLayout menucell = new RelativeLayout (nn_context);
            menucell.SetPadding (TapUtil.dptodx(padding),TapUtil.dptodx(padding),TapUtil.dptodx(padding),TapUtil.dptodx(padding));
            menucell.LayoutParameters = new LinearLayout.LayoutParams (TapUtil.dptodx(cellwidth),TapUtil.dptodx(cellheight));
            menucell.Click+= (object sender, EventArgs e) => {

                if(OnCellClick!=null){
                    OnCellClick();
                }
            };

            ImageView img = new ImageView (nn_context);
            img.Id = TapUtil.generateViewId ();
            img.LayoutParameters = new RelativeLayout.LayoutParams (TapUtil.dptodx(imagewidth),TapUtil.dptodx(imagewidth));
            //			Bitmap.CreateScaledBitmap(imgresource, TapUtil.dptodx(imagewidth), TapUtil.dptodx(imageheight), false);
            img.SetImageResource (imgresource);
            img.SetBackgroundColor (Color.White);

            TextView textview = new TextView (nn_context);
            RelativeLayout.LayoutParams textviewparam=new RelativeLayout.LayoutParams (TapUtil.dptodx(textwidth),TapUtil.dptodx(textheight));
            textviewparam.AddRule(LayoutRules.RightOf,img.Id);
            textviewparam.LeftMargin = TapUtil.dptodx (space);
            textview.LayoutParameters =textviewparam;
            textview.Text = text;
            textview.SetTypeface (Typeface.Default, TypefaceStyle.Bold);
            textview.SetTextColor(Color.Black);
            textview.Gravity = global::Android.Views.GravityFlags.Center;

            menucell.AddView (img);
            menucell.AddView (textview);

            nn_itemlist.Add (menucell);
        }
예제 #10
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate (bundle);
            SetContentView (Resource.Layout.RecipeView);

            //this.Recid = CachedData.Instance.mostRecentRecSel;

            /*//MENU VIEW
            Button menu_button = FindViewById<Button> (Resource.Id.menu_button);
            menu_button.Click += (s, arg) => {
                menu_button.SetBackgroundResource(Resource.Drawable.pressed_lines);
                PopupMenu menu = new PopupMenu (this, menu_button);
                menu.Inflate (Resource.Menu.Main_Menu);
                menu.MenuItemClick += this.MenuButtonClick;
                menu.DismissEvent += (s2, arg2) => {
                    menu_button.SetBackgroundResource(Resource.Drawable.menu_lines);
                    Console.WriteLine ("menu dismissed");
                };
                menu.Show ();
            };*/
            int varTest = CachedData.Instance.mostRecentRecSel;
            Recipe recipe = WebUtils.getRecipeViewInfo (varTest);
            System.Diagnostics.Debug.WriteLine (recipe.title);
            FindViewById<TextView> (Resource.Id.recipe_view_title).Text = recipe.title;
            //FindViewById<TextView> (Resource.Id.recipe_view_time).Text = recipe.time + " minutes";

            ViewGroup ingredientView = (ViewGroup) FindViewById (Resource.Id.recipe_view_ingredients);

            for (int i = 0; i < recipe.ingredients.Length; i++) {
                Console.WriteLine ("Adding Ingredient " + recipe.ingredients [i]);
                TextView tv = new TextView (this);
                //tv.Visibility = ViewStates.Visible;
                //tv.TextSize = 20;
                tv.SetTextColor (Resources.GetColor(Resource.Color.gray_icon));
                tv.TextSize = 14;
                tv.Text = recipe.ingredients [i];
                ingredientView.AddView (tv);
            }

            ViewGroup taskView = (ViewGroup) FindViewById (Resource.Id.recipe_view_steps);

            for (int i = 0; i < recipe.tasks.Length; i++) {
                Console.WriteLine ("Adding Step " + recipe.tasks [i]);
                TextView tv = new TextView (this);
                tv.SetTextColor (Resources.GetColor(Resource.Color.gray_icon));
                tv.TextSize = 14;
                tv.Text = recipe.tasks [i];
                taskView.AddView (tv);
            }
            Button addToMealButton = FindViewById<Button> (Resource.Id.add_rec_to_meal_button);
            addToMealButton.Click += (object sender, EventArgs e) => {
                CachedData.Instance.mostRecentMealAdd = CachedData.Instance.mostRecentRecSel;
                if (CachedData.Instance.PreviousActivity.GetType() == typeof(SearchActivity)) {
                    CachedData.Instance.PreviousActivity.Finish();
                    CachedData.Instance.PreviousActivity.SetResult(Result.Ok);
                    SetResult(Result.Ok, CachedData.Instance.PreviousActivity.Intent);
                    Finish();
                }
            };
        }
예제 #11
0
        // 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;
        }
예제 #12
0
        private void Calendar_DaySlotLoading(object sender, CalendarDaySlotLoadingEventArgs e)
        {
            // get day
            Java.Util.Date date = e.Date;
            Java.Util.Calendar cal = Java.Util.Calendar.GetInstance(Java.Util.Locale.English);
            cal.Time = date;
            int day = cal.Get(Java.Util.CalendarField.DayOfMonth);

            // create day slot layout container
            CalendarDaySlotBase layout = new CalendarDaySlotBase(ApplicationContext);
            layout.SetGravity(GravityFlags.Top);
            layout.SetVerticalGravity(GravityFlags.Top);
            layout.Orientation = Orientation.Vertical;
            layout.SetPadding(5, 5, 5, 5);
            LinearLayout.LayoutParams linearLayoutParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FillParent, LinearLayout.LayoutParams.FillParent);
            layout.LayoutParameters = linearLayoutParams;

            // create text element
            TextView tv = new TextView(ApplicationContext);
            //LinearLayout.LayoutParams linearLayoutParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MatchParent, LinearLayout.LayoutParams.WrapContent);
            //vv.LayoutParameters = linearLayoutParams;
            tv.Gravity = GravityFlags.Top;
            tv.Text = day.ToString();

            if (e.AdjacentDay)
            {
                // format adjacent day text
                tv.SetTextColor(Android.Graphics.Color.DarkGray);
            }

            // add text element to layout
            layout.AddView(tv);


            // add weather image for certain days
            if (day >= 14 && day <= 23)
            {
                ImageView iv = new ImageView(ApplicationContext);
                switch (day % 5)
                {
                    case 0: iv.SetImageResource(Resource.Drawable.Cloudy);
                        break;
                    case 1: iv.SetImageResource(Resource.Drawable.PartlyCloudy);
                        break;
                    case 2: iv.SetImageResource(Resource.Drawable.Rain);
                        break;
                    case 3: iv.SetImageResource(Resource.Drawable.Storm);
                        break;
                    case 4: iv.SetImageResource(Resource.Drawable.Sun);
                        break;

                }
                layout.AddView(iv);
               
            }

            // finally, set layout to day slot
            e.DaySlot = layout;
        }
예제 #13
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);
			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);


		}
예제 #14
0
		public static void SetTimeRemaining(Post post, TextView timeRemainingTextView, ImageView clockImageView)
		{
			if (post.IsExpired())
			{
				timeRemainingTextView.Text = StringUtils.GetTopTime(post);
				timeRemainingTextView.SetTextColor(Color.White);
				timeRemainingTextView.SetBackgroundResource(Resource.Drawable.RoundedCorners5Black);
				clockImageView.Visibility = ViewStates.Invisible;
			}
			else
			{
				timeRemainingTextView.Text = StringUtils.GetPrettyDateAbs(post.expiration);
				timeRemainingTextView.SetTextColor(ViewUtils.GetTimeRemainingColor(post.expiration));
				//timeRemainingTextView.SetBackgroundColor(Android.Graphics.Color.Transparent);
				clockImageView.Visibility = ViewStates.Visible;
			}
		}
		private void InitTextView( ) {
			tvTabmyAlarm = View.FindViewById<Button>(Resource.Id.tv_tab_myAlarm);
			tvTabotherAlarm = View.FindViewById<Button>(Resource.Id.tv_tab_otherAlarm);
			tvTabmyAlarm.SetTextColor(Resources.GetColor(Resource.Color.blue));

			tvTabmyAlarm.SetOnClickListener(this);
			tvTabotherAlarm.SetOnClickListener(this);
		}
예제 #16
0
        public static void StyleUILabel( TextView label, string font, uint size )
        {
            label.SetTextColor( Rock.Mobile.UI.Util.GetUIColor( ControlStylingConfig.Label_TextColor ) );
            label.SetBackgroundColor( Android.Graphics.Color.Transparent );

            label.SetTypeface( Rock.Mobile.PlatformSpecific.Android.Graphics.FontManager.Instance.GetFont( font ), TypefaceStyle.Normal );
            label.SetTextSize( Android.Util.ComplexUnitType.Dip, size );
        }
예제 #17
0
        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;
        }
예제 #18
0
        public virtual Com.Zhy.Adapter.Abslistview.ViewHolder SetTextColorRes(int viewId,
                                                                              int textColorRes)
        {
            Android.Widget.TextView view = GetView <TextView>(viewId);
#pragma warning disable CS0618 // Type or member is obsolete
            view.SetTextColor(mContext.Resources.GetColor(textColorRes));
#pragma warning restore CS0618 // Type or member is obsolete
            return(this);
        }
예제 #19
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;
 }
예제 #20
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.Settings);

            // setting views
            input_server = FindViewById<EditText>(Resource.Id.input_serverRoot);
            input_user = FindViewById<EditText>(Resource.Id.input_user);
            input_pass = FindViewById<EditText>(Resource.Id.input_pass);
            input_filePath = FindViewById<EditText>(Resource.Id.input_filepath);
            btn_checkConnection = FindViewById<Button>(Resource.Id.btn_checkConnection);
            btn_saveSettings= FindViewById<Button>(Resource.Id.btn_saveSetting);
            loader = FindViewById<ProgressBar>(Resource.Id.loader_checkConnection);
            lbl_connectionResult = FindViewById<TextView>(Resource.Id.lbl_connectionResult);
            lbl_saveResult = FindViewById<TextView>(Resource.Id.lbl_saveResult);
            layout_success = FindViewById<LinearLayout>(Resource.Id.layout_success);

            // set visibility
            layout_success.Visibility = Android.Views.ViewStates.Gone;

            // getting preferences
            getSettings();

            // bindings
            btn_checkConnection.Click += async delegate
            {
                Util.Do.HideSoftKeyboard(this);
                loader.Visibility = Android.Views.ViewStates.Visible;
                lbl_connectionResult.Visibility = Android.Views.ViewStates.Invisible;
                layout_success.Visibility = Android.Views.ViewStates.Gone;
                var res = await Util.Do.CheckConnection(input_server.Text, input_user.Text, input_pass.Text);
                loader.Visibility = Android.Views.ViewStates.Gone;
                lbl_connectionResult.Text = res.Message;
                lbl_connectionResult.SetTextColor(res.Connected ? Color.LightGreen : Color.IndianRed);
                lbl_connectionResult.Visibility = Android.Views.ViewStates.Visible;
                if(res.Connected) OnSuccessfulConnect();
            };
            btn_saveSettings.Click += delegate
            {
                lbl_saveResult.Visibility = ViewStates.Gone;
                try
                {
                    saveSettings();
                    lbl_saveResult.SetTextColor(Color.LightGreen);
                    lbl_saveResult.Text = "saved!";
                }
                catch (Exception err)
                {
                    lbl_saveResult.SetTextColor(Color.IndianRed);
                    lbl_saveResult.Text = err.Message;
                }
                lbl_saveResult.Visibility = ViewStates.Visible;

            };
        }
예제 #21
0
		public StockCell (Context context) : base (context)
		{
			stockText = new TextView (context);
			stockImage = new ImageView (context);
			stockText.Gravity = GravityFlags.Right;
			stockText.SetTextColor (Color.Rgb (51, 51, 51));
			this.CanRenderUnLoad = false;
			this.AddView (stockText);
			this.AddView (stockImage);
		}
		protected override void OnElementChanged (ElementChangedEventArgs<Page> e)
		{
			base.OnElementChanged (e);
			MessagingCenter.Subscribe<RootPage, AlertArguments> (this, "DisplayAlert", (sender, arguments) => {

				//If you would like to use style attributes, you can pass this into the builder
//				ContextThemeWrapper customDialog = new ContextThemeWrapper(Context, Resource.Style.AlertDialogCustom);
//				AlertDialog.Builder builder = new AlertDialog.Builder(customDialog);

				//Create instance of AlertDialog.Builder and create the alert
				AlertDialog.Builder builder = new AlertDialog.Builder(Context);
				var alert = builder.Create();

				//Utilize context to get LayoutInflator to set the view used for the dialog
				var layoutInflater = (LayoutInflater) Context.GetSystemService(Context.LayoutInflaterService);
				alert.SetView(layoutInflater.Inflate(Resource.Layout.CustomDialog,null));

				//Create a custom title element 
				TextView title = new TextView (Context) {
					Text = arguments.Title,
				};
				title.SetTextColor(Android.Graphics.Color.DodgerBlue);
				title.SetBackgroundColor(Android.Graphics.Color.White);
				//Add the custom title to the AlertDialog
				alert.SetCustomTitle(title);

				//Set the buttons text and click handler events
				if (arguments.Accept != null)
					alert.SetButton ((int)DialogButtonType.Positive, arguments.Accept, (o, args) => arguments.SetResult (true));
				alert.SetButton ((int)DialogButtonType.Negative, arguments.Cancel, (o, args) => arguments.SetResult (false));
				alert.CancelEvent += (o, args) => { arguments.SetResult (false); };
				alert.Show ();

				//This code grabs the line that separates the title and dialog. 
				int titleDividerId = Resources.GetIdentifier("titleDivider", "id", "android");
				Android.Views.View titleDivider = alert.FindViewById(titleDividerId);
				if (titleDivider != null)
					titleDivider.SetBackgroundColor(Android.Graphics.Color.DarkRed);

				//Set properties of the buttons
				Android.Widget.Button positiveButton = alert.GetButton((int)DialogButtonType.Positive);
				positiveButton.SetTextColor(Android.Graphics.Color.Green);
				positiveButton.SetBackgroundColor(Android.Graphics.Color.White);

				Android.Widget.Button negativeButton = alert.GetButton((int)DialogButtonType.Negative);
				negativeButton.SetTextColor(Android.Graphics.Color.Red);
				negativeButton.SetBackgroundColor(Android.Graphics.Color.White);

				//Set the text of the TextView in the dialog
				var textView = alert.FindViewById<TextView>(Resource.Id.textview);
				textView.SetText(arguments.Message,null);

			});
		}
예제 #23
0
		protected override void OnCreate (Bundle savedInstanceState)
		{
			base.OnCreate (savedInstanceState);
			SetContentView (Resource.Layout.VacationInfoEdit);

			_localizer = new Localizer (Application.Context);

			_startDate = (new DateTime (1970, 1, 1, 0, 0, 0, DateTimeKind.Utc)).AddMilliseconds (VTSModelSingleton.VTSModel.StartDate).ToLocalTime ();
			_endDate = (new DateTime (1970, 1, 1, 0, 0, 0, DateTimeKind.Utc)).AddMilliseconds (VTSModelSingleton.VTSModel.EndDate).ToLocalTime (); 

			_vacationType = FindViewById<TextView> (Resource.Id.VacationType);
			_vacationStartDateBtn = FindViewById<Button> (Resource.Id.VacationStartDateBtn);
			_vacationEndDateBtn = FindViewById<Button> (Resource.Id.VacationEndDateBtn);
			_vacationStatus = FindViewById<TextView> (Resource.Id.VacationStatus);
			_vacationUpdate = FindViewById<Button> (Resource.Id.VacationUpdate);
			_vacationError = FindViewById<TextView> (Resource.Id.VacationError);
			_vacationPickImageFromGallery =  FindViewById<Button> (Resource.Id.VacationPickImageFromGallery);
			_vacationPickImageFromCamera =  FindViewById<Button> (Resource.Id.VacationPickImageFromCamera);

			_vacationImageView = FindViewById<ImageView> (Resource.Id.VacationImageView);

			if (VTSModelSingleton.VTSModel.Image != null) {
				Bitmap bmp = BitmapFactory.DecodeByteArray (VTSModelSingleton.VTSModel.Image, 0, VTSModelSingleton.VTSModel.Image.Length);
				_vacationImageView.SetImageBitmap (bmp);
			}

			_vacationType.Text = VTSModelSingleton.VTSModel.VacationType;
			_vacationStartDateBtn.Text = _startDate.ToString ("d");  
			_vacationEndDateBtn.Text = _endDate.ToString ("d");


			if (VTSModelSingleton.VTSModel.Status != "greenCircle.png") {				
				_vacationStartDateBtn.Click += delegate { ShowDialog (0); };
				_vacationEndDateBtn.Click += delegate { ShowDialog (1); };

				_vacationStatus.Text = _localizer.Localize("statusCancelled");
				_vacationStatus.SetTextColor (Android.Graphics.Color.DarkRed);

				_vacationPickImageFromGallery.Visibility = ViewStates.Visible;
				_vacationPickImageFromCamera.Visibility = ViewStates.Visible;
				_vacationUpdate.Visibility = ViewStates.Visible;
			} else {
				_vacationStartDateBtn.Enabled = false;
				_vacationEndDateBtn.Enabled = false;
				_vacationStatus.Text = _localizer.Localize("statusClosed");
				_vacationStatus.SetTextColor (Android.Graphics.Color.DarkSeaGreen);
			}

			_vacationUpdate.Click += onVacationUpdateButtonClicked;
			_vacationPickImageFromGallery.Click += onVacationPickImageFromGalleryClicked;
			_vacationPickImageFromCamera.Click += onVacationPickImageFromCameraClicked;
		}
		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;        
		}
예제 #26
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;
		}
예제 #27
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;
		}
예제 #28
0
		protected override void OnCreate (Bundle bundle)
		{
			base.OnCreate (bundle);

			SetContentView (Resource.Layout.ChoosePlayer);
			SetHomeButtonEnabled (false);
			var list = this.FindViewById<ListView>(Resource.Id.playerList);
			_adapter = new PlayerListAdapter(this);

			list.Adapter = _adapter;
			_readyButton = (TextView)CreateActionButton(Resource.Drawable.table_button);
			SetTextButtonEnabled (false);
			_readyButton.SetText (Resource.String.ConfirmString);
			_readyButton.SetTextColor (Resources.GetColorStateList(Resource.Drawable.ready_label_enable));
			
            RegisterSubscribes();
		}
예제 #29
0
		void Initialize ()
		{

			this.LayoutParameters = new RelativeLayout.LayoutParams (-1,-2);
			this.SetGravity (GravityFlags.Center);

			linearAll = new LinearLayout (context);
			linearTextContainer= new LinearLayout (context);
			linearBarra = new LinearLayout (context);

			txtAuthor = new TextView (context);
			txtPhrase = new TextView (context);
			imgBarra = new ImageView (context);
			imgComilla = new ImageView (context);

			linearAll.LayoutParameters = new LinearLayout.LayoutParams (Configuration.getWidth (582), -2);
			linearTextContainer.LayoutParameters = new LinearLayout.LayoutParams (Configuration.getWidth(552),-2);
			linearBarra.LayoutParameters = new LinearLayout.LayoutParams (Configuration.getWidth(30),-2);

			linearAll.Orientation = Orientation.Horizontal;
			linearBarra.Orientation = Orientation.Vertical;
			linearTextContainer.Orientation = Orientation.Vertical;

			linearAll.SetGravity (GravityFlags.Center);
			//linearBarra.SetGravity (GravityFlags.CenterHorizontal);
			linearTextContainer.SetGravity (GravityFlags.CenterVertical);

			//txtPhrase.SetTextSize (ComplexUnitType.Px, Configuration.getHeight (40));
			//txtAuthor.SetTextSize(ComplexUnitType.Px, Configuration.getHeight (30));

			txtPhrase.SetTextSize (ComplexUnitType.Dip, 21.0f);
			txtAuthor.SetTextSize(ComplexUnitType.Dip, 16.0f);

			txtAuthor.SetTextColor (Color.ParseColor("#b0afb5"));

			linearBarra.AddView (imgComilla);
			//linearBarra.AddView (imgBarra);
			linearTextContainer.AddView (txtPhrase);
			linearTextContainer.AddView (txtAuthor);

			linearAll.AddView (linearBarra);
			linearAll.AddView (linearTextContainer);

			this.AddView (linearAll);

		}
예제 #30
0
        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;
        }
예제 #31
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);
			}
		}
예제 #32
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate (bundle);
            SetContentView (Resource.Layout.ChoosePlayer);
            SetHomeButtonEnabled (false);
            var list = this.FindViewById<ListView>(Resource.Id.playerList);
            _adapter = new PlayerListAdapter(this);

            list.Adapter = _adapter;
            _readyButton = (TextView)CreateActionButton(Resource.Drawable.table_button);
            SetTextButtonEnabled (false);
            _readyButton.SetText (Resource.String.ConfirmString);
            _readyButton.SetTextColor (Resources.GetColorStateList(Resource.Drawable.ready_label_enable));
            _readyButton.Click+= delegate {
                SetResult(Result.Ok, new Intent().PutExtra("player_id",_adapter.SelectedPosition));
                base.OnBackPressed();
            };
        }
예제 #33
0
        public PackageRow(Context context)
            : base(context)
        {
            SetBackgroundColor(Color.Rgb(240, 240, 240));

            Orientation = Orientation.Horizontal;

            textContainer = new LinearLayout(context);
            textContainer.Orientation = Orientation.Vertical;

            AddView(textContainer);

            buttonContainer = new LinearLayout(context);
            AddView(buttonContainer);

            int height = context.Resources.DisplayMetrics.HeightPixels / 10;
            LayoutParameters = new AbsListView.LayoutParams(LayoutParams.MatchParent, height);

            textContainer.LayoutParameters = new LinearLayout.LayoutParams(0, LayoutParams.MatchParent, 7);
            buttonContainer.LayoutParameters = new LinearLayout.LayoutParams(0, LayoutParams.MatchParent, 3);

            nameLabel = new TextView(context);
            nameLabel.SetTextColor(Color.Black);
            nameLabel.Gravity = Android.Views.GravityFlags.CenterVertical;
            nameLabel.Typeface = Typeface.Create("Helvetica Neue", TypefaceStyle.Normal);
            nameLabel.SetTextSize(Android.Util.ComplexUnitType.Dip, 16);
            textContainer.AddView(nameLabel);

            statusLabel = new TextView(context);
            statusLabel.SetTextColor(Color.DarkGray);
            statusLabel.Gravity = Android.Views.GravityFlags.Top;
            statusLabel.Typeface = Typeface.Create("Helvetica Neue", TypefaceStyle.Normal);

            textContainer.AddView(statusLabel);

            Button = new PMButton(context);
            buttonContainer.AddView(Button);

            buttonContainer.Measure(0, 0);

            padding = buttonContainer.MeasuredHeight / 3;

            Button.LayoutParameters = GetButtonParams(padding);
        }