当前位置: 首页>>代码示例>>C#>>正文


C# Button.SetBackgroundResource方法代码示例

本文整理汇总了C#中Button.SetBackgroundResource方法的典型用法代码示例。如果您正苦于以下问题:C# Button.SetBackgroundResource方法的具体用法?C# Button.SetBackgroundResource怎么用?C# Button.SetBackgroundResource使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Button的用法示例。


在下文中一共展示了Button.SetBackgroundResource方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnCreateView

		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);
			var rootView = inflater.Inflate(Resource.Layout.Settings, container, false);
			cbNLT = rootView.FindViewById<CheckBox> (Resource.Id.ckboxRemindLT);
			cbUpdate=rootView.FindViewById<CheckBox> (Resource.Id.ckboxAutoUpdateData);
			btupdateData=rootView.FindViewById<Button> (Resource.Id.btUpdateData);
			progressup=rootView.FindViewById<ProgressBar> (Resource.Id.proUpdateData);
			txtResult = rootView.FindViewById<TextView> (Resource.Id.txtresult);
			progressNL=rootView.FindViewById<ProgressBar> (Resource.Id.proNL);
			//About
			TextView txtVersion = rootView.FindViewById<TextView> (Resource.Id.txtVersion_Set);
			txtVersion.Click += TxtVersion_Click;
			Bundle bundle=this.Arguments;
			bool check = bundle.GetBoolean ("Remind");
			autoupdate = bundle.GetBoolean ("AutoUpdateData");
			cbUpdate.Checked = autoupdate;
			cbNLT.Checked = check;
			btupdateData.Click+= BtupdateData_Click;
			cbNLT.CheckedChange += CbNLT_CheckedChange;
			cbUpdate.CheckedChange+= CbUpdate_CheckedChange;
			if (cbUpdate.Checked) {
				btupdateData.SetBackgroundResource (Android.Resource.Color.DarkerGray);
			}

			else
			{
				btupdateData.SetBackgroundResource (Android.Resource.Color.HoloBlueDark);
			}
			btupdateData.Enabled = !cbUpdate.Checked;
			return rootView;
		}
开发者ID:tienbui123,项目名称:Mobile-VS2,代码行数:33,代码来源:SettingsFragment.cs

示例2: OnCreateView

		public override View OnCreateView (LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
		{

			//Theo Tuan

			var rootView = inflater.Inflate (Resource.Layout.LichHoc_Tuan, container, false);
			listView_Tuan = rootView.FindViewById<ExpandableListView> (Resource.Id.listLH_Tuan);
			listView_Tuan.GroupClick += (sender, e) => {
				listView_ItemClick(sender,e);
			};
			isfirst = true;
			progress = rootView.FindViewById<ProgressBar> (Resource.Id.progressLHTuan);
			lbl_TuNgay = rootView.FindViewById<TextView> (Resource.Id.lbl_TuNgay);
			lbl_DenNgay = rootView.FindViewById<TextView> (Resource.Id.lbl_DenNgay);
			lbl_HK = rootView.FindViewById<TextView> (Resource.Id.lbl_HK_Tuan);
			LinearLayout linear_ThoiGian= rootView.FindViewById<LinearLayout> (Resource.Id.linear_LH_Tuan_ThoiGian);
			TextView txtNotify = rootView.FindViewById<TextView> (Resource.Id.txtNotify_LH_Tuan);
			//RadioGroup radioGroup = rootView.FindViewById<RadioGroup>(Resource.Id.radioGroup2);
			//button 
			 btnTuanTruoc = rootView.FindViewById<Button> (Resource.Id.btnTuanTruoc);
			 btnTuanKe = rootView.FindViewById<Button> (Resource.Id.btnTuanKe);
			//bundle
			bundle=this.Arguments;
			check = bundle.GetBoolean ("Remind");
			autoupdate = bundle.GetBoolean ("AutoUpdateData");

			LichHoc lh = BLichHoc.GetLast (SQLite_Android.GetConnection ());
			if (lh != null) {
				btnTuanTruoc.Enabled = true;
				btnTuanKe.Enabled = true;
				btnTuanTruoc.SetBackgroundResource(Android.Resource.Color.HoloBlueDark);
				btnTuanKe.SetBackgroundResource(Android.Resource.Color.HoloBlueDark);
			//	radioGroup.Visibility = ViewStates.Visible;
				linear_ThoiGian.Visibility = ViewStates.Visible;
				txtNotify.Visibility = ViewStates.Gone;
				LoadData_Tuan (DateTime.Today);
			}
			else {
				progress.Visibility = ViewStates.Gone;
				btnTuanTruoc.Enabled = false;
				btnTuanKe.Enabled = false;
				btnTuanTruoc.SetBackgroundResource(Android.Resource.Color.DarkerGray);
				btnTuanKe.SetBackgroundResource(Android.Resource.Color.DarkerGray);
			//	radioGroup.Visibility = ViewStates.Gone;
				linear_ThoiGian.Visibility = ViewStates.Gone;
				txtNotify.Visibility = ViewStates.Visible;
				txtNotify.Text = "Hiện tại lịch học chưa có dữ liệu. Xin vui lòng thử lại sau!!!";
			}

			// button event
			btnTuanTruoc.Click += new EventHandler (btnTuanTruoc_Click);
			btnTuanKe.Click += new EventHandler (btnTuanKe_Click);



			return rootView;
		}
开发者ID:tienbui123,项目名称:Mobile-VS2,代码行数:57,代码来源:LichHocTuanFragment.cs

示例3: OnCreate

        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            SetContentView(Resource.Layout.SessionDetailsScreen);

            favoriteButton = FindViewById<Button>(Resource.Id.FavouriteButton);
            favoriteButton.Click += new EventHandler(_favouriteButton_Click);

            var id = Intent.GetIntExtra("SessionID", -1);

            if (id >= 0) {
                session = BL.Managers.SessionManager.GetSession(id);
                if (session != null) {
                    FindViewById<TextView>(Resource.Id.TitleTextView).Text = session.Title;
                    FindViewById<TextView>(Resource.Id.SpeakersTextView).Text = session.SpeakerNames;
                    FindViewById<TextView>(Resource.Id.DateTimeTextView).Text = session.Start.ToString("dddd H:mm")
                                                                    + " - " + session.End.ToString("H:mm");

                    var roomTextView = FindViewById<TextView>(Resource.Id.RoomTextView); 
                    var roomPanel = FindViewById<LinearLayout>(Resource.Id.RoomPanel);
                    if (String.IsNullOrEmpty(session.Room)) {
                        roomPanel.Visibility = ViewStates.Gone;
                    }  else {
                        roomPanel.Visibility = ViewStates.Visible;
                        roomTextView.SetText(session.Room, TextView.BufferType.Normal);
                    }


                    FindViewById<TextView>(Resource.Id.OverviewTextView).Text = session.Overview;

                    isFavorite = BL.Managers.FavoritesManager.IsFavorite(session.Key);

                    if (isFavorite) {
                        favoriteButton.SetBackgroundResource(Resource.Drawable.star_gold_selector);
                    } else {
                        favoriteButton.SetBackgroundResource(Resource.Drawable.star_grey_selector);
                    }
                } else {   // shouldn't happen...
                    FindViewById<TextView>(Resource.Id.TitleTextView).Text = "Session not found: " + id;
                }
            }
        }
开发者ID:Adameg,项目名称:mobile-samples,代码行数:43,代码来源:SessionDetailsScreen.cs

示例4: OnCreateView

		public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
		{
			base.OnCreateView (inflater, container, savedInstanceState);

			// Save ScreenController for later use
			ctrl = ((ScreenController)this.Activity);

			if (container == null)
				return null;

			var view = inflater.Inflate(Resource.Layout.CheckLocation, container, false);

			textDescription = view.FindViewById<TextView> (Resource.Id.textDescription);
			textCoordinates = view.FindViewById<TextView> (Resource.Id.textCoords);
			textAccuracy = view.FindViewById<TextView> (Resource.Id.textAccuracy);
			button = view.FindViewById<Button> (Resource.Id.buttonStart);

			button.SetBackgroundResource(Resource.Drawable.apptheme_btn_default_holo_light_red);
			button.Click += OnButtonClicked;

			return view;
		}
开发者ID:jonny65,项目名称:WF.Player.Android,代码行数:22,代码来源:CheckLocation.cs

示例5: OnCreateView

        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            var rootView = inflater.Inflate(Resource.Layout.RegisterItemFragment, container, false);
            _imageView = rootView.FindViewById<ImageView>(Resource.Id.imageProduct);
            _textName = rootView.FindViewById<TextView>(Resource.Id.textName);
            _textPrice = rootView.FindViewById<TextView>(Resource.Id.textPrice);
            _buttonBuy = rootView.FindViewById<Button>(Resource.Id.buttonBuy);

            _textName.Text = RegisterItem.Name;
            _textPrice.Text = RegisterItem.Price;
            _imageView.SetImageResource(ResourceHelper.TranslateDrawable(RegisterItem.ImageName));

            if (RegisterItem.Sold)
            {
                _buttonBuy.SetBackgroundResource(Resource.Drawable.buttonSold);
                _buttonBuy.Text = "SOLD!";
            }
            else
            {
                _buttonBuy.Click += ButtonBuy_Click;
            }

            return rootView;
        }
开发者ID:dustynl,项目名称:Presentation,代码行数:24,代码来源:RegisterItemFragment.cs

示例6: Refresh

		void Refresh(object o = null)
		{
			string what = o == null ? "" : (string)o;

			if (activeObject == null || this.Activity == null)
				return;

			Activity.RunOnUiThread(() => {
				if(Activity == null)
					return;

				// Assign this item's values to the various subviews
				ctrl.SupportActionBar.SetDisplayShowHomeEnabled(true);

				string name = activeObject.Name == null ? "" : activeObject.Name;

				if (what.Equals ("") || what.Equals ("Name"))
				{
					if (activeObject is Task)
						ctrl.SupportActionBar.Title = (((Task)activeObject).Complete ? (((Task)activeObject).CorrectState == TaskCorrectness.NotCorrect ? Strings.TaskNotCorrect : Strings.TaskCorrect) + " " : "") + name;
					else
						ctrl.SupportActionBar.Title = name;
				}

				if (what.Equals ("") || what.Equals ("Media")) {
					if (activeObject.Image != null) {
						using (Bitmap bm = ctrl.ConvertMediaToBitmap(activeObject.Image)) {
							_imageView.SetImageBitmap(null);
							_imageView.SetImageBitmap(bm);
						}
						_imageView.Visibility = ViewStates.Visible;
					} else {
						_imageView.Visibility = ViewStates.Gone;
					}
				}

				if (what.Equals ("") || what.Equals ("Description")) {
					if (!String.IsNullOrWhiteSpace (activeObject.Description)) {
						_textDescription.Visibility = ViewStates.Visible;
						_textDescription.Text = activeObject.Description; // Html.FromHtml(activeObject.HTML.Replace("&lt;BR&gt;", "<br>").Replace("<br>\n", "<br>").Replace("\n", "<br>"));
						_textDescription.Gravity = Main.Prefs.TextAlignment.ToSystem();
						_textDescription.SetTextSize(global::Android.Util.ComplexUnitType.Sp, (float)Main.Prefs.TextSize);
					} else {
						_textDescription.Visibility = ViewStates.Visible;
						_textDescription.Text = "";
						_textDescription.Gravity = Main.Prefs.TextAlignment.ToSystem();
						_textDescription.SetTextSize(global::Android.Util.ComplexUnitType.Sp, (float)Main.Prefs.TextSize);
					}
				}
				// Tasks don't have any command button or direction
				if (activeObject is Task) {
					_layoutBottom.Visibility =  ViewStates.Gone;
					return;
				}

				// Check, if the bottom should be displayed or not
				_layoutButtons.Visibility = ((Thing)activeObject).ActiveCommands.Count == 0 ? ViewStates.Invisible : ViewStates.Visible;
				_layoutDirection.Visibility = ctrl.Engine.Player.Inventory.Contains(activeObject) ? ViewStates.Gone : (((Thing)activeObject).VectorFromPlayer == null ? ViewStates.Gone : ViewStates.Visible);
				_layoutBottom.Visibility =  (_layoutButtons.Visibility == ViewStates.Visible || _layoutDirection.Visibility == ViewStates.Visible) ? ViewStates.Visible : ViewStates.Gone;

				if (_layoutButtons.Visibility == ViewStates.Visible) {
					_layoutButtons.RemoveAllViews ();
					commands = ((Thing)activeObject).ActiveCommands;
					_layoutButtons.WeightSum = 1;
					if (commands.Count > 0) {
						Button btnView = new Button (Activity.ApplicationContext);
						btnView.Text = commands.Count == 1 ? commands[0].Text : GetString(Resource.String.screen_detail_commands);
						btnView.SetTextColor(Color.White);
						btnView.SetHighlightColor(Color.White);
						btnView.SetBackgroundResource(Resource.Drawable.apptheme_btn_default_holo_light);
						btnView.LayoutChange += (object sender, View.LayoutChangeEventArgs e) => SetTextScale(btnView);
						btnView.Click += OnButtonClicked;
						// Set size of button
						Android.Views.ViewGroup.LayoutParams lp = new Android.Views.ViewGroup.LayoutParams(Android.Views.ViewGroup.LayoutParams.FillParent, Android.Views.ViewGroup.LayoutParams.FillParent);
						// Add button to view
						_layoutButtons.AddView (btnView, lp);
					}
				}

				if (_layoutDirection.Visibility == ViewStates.Visible) {
					// Draw direction content
					var direction = ((Thing)activeObject).VectorFromPlayer;
					if ( direction != null) {
						_textDirection.Visibility = ViewStates.Visible;
						_imageDirection.Visibility = ViewStates.Visible;
						_textDirection.Text = direction.Distance.BestMeasureAs(DistanceUnit.Meters);
						Bitmap bm;
						_imageDirection.SetImageBitmap(null);
						if (direction.Distance.Value == 0) {
							_imageDirection.SetImageBitmap (BitmapFactory.DecodeResource(Resources, Resource.Drawable.ic_direction_position));
						} else {
							_imageDirection.SetImageBitmap(BitmapArrow.Draw(Math.Min(_imageDirection.Width, _imageDirection.Height), direction.Bearing.Value + Main.GPS.Bearing));
	//							AsyncImageFromDirection.LoadBitmap(_imageDirection, direction.Bearing.Value + Main.GPS.Bearing, 48, 48);
							// TODO:
							// Remove
	//							bm = ctrl.DrawArrow (direction.Bearing.Value + Main.GPS.Bearing);
	//							_imageDirection.SetImageBitmap (bm);
	//							bm = null;
						}
					}
//.........这里部分代码省略.........
开发者ID:WFoundation,项目名称:WF.Player.Android,代码行数:101,代码来源:GameDetailScreenAndroid.cs

示例7: Initialize

        void Initialize()
        {
            this.Orientation = Orientation.Vertical;
            this.WeightSum = 1;

            var padding = PixelConverter.DpToPixels(5);
            SetPadding(padding, padding, padding, padding);

            //Event handler is detached in proceed button handler. Very important!
            ((MainActivity)(this.context)).OptionItemSelected += OnOptionItemSelected;

            SearchCityText = new TextView(context);
            SearchCityText.LayoutParameters = new ViewGroup.LayoutParams(LayoutParams.WrapContent, LayoutParams.WrapContent);
            SearchCityText.Text = string.Format("Search {0} for: ", location.SiteName);
            SearchCityText.SetTextSize(Android.Util.ComplexUnitType.Px, rowHeight * 0.50f);
            SearchCityText.SetPadding((int)(rowHeight * 0.1), (int)(rowHeight * 0.15), (int)(rowHeight * 0.1), (int)(rowHeight * 0.15));

            LinearLayout searchCityHolder = RowHolder();
            searchCityHolder.AddView(SearchCityText);
            AddView(searchCityHolder);

            proceedButton = new Button(context);
            proceedButton.LayoutParameters = new LayoutParams(0, LayoutParams.WrapContent, 0.5f);
            proceedButton.Text = "Search";
            proceedButton.SetTextSize(ComplexUnitType.Px, rowHeight * 0.5f);
            proceedButton.SetBackgroundResource(Resource.Drawable.roundedButton);
            proceedButton.SetTextColor(context.Resources.GetColor(Resource.Color.lightTextColor));

            LinearLayout buttonLayout = RowHolder();
            buttonLayout.AddView(proceedButton);
            AddView(buttonLayout);

            var tableItems = GetTableSetup();
            foreach (var item in tableItems)
            {
                AddRowToLayout(item);
            }

            proceedButton.Click += ProceedButton_Click;
        }
开发者ID:erdennis13,项目名称:EthansList,代码行数:40,代码来源:SearchOptionsFragment.cs

示例8: GetSampleContent

		public override View GetSampleContent (Context context)
		{
			btn = new Button(context);
			btn.SetBackgroundResource(Resource.Drawable.burgericon);
			FrameLayout.LayoutParams btlayoutParams = new FrameLayout.LayoutParams(42,32, GravityFlags.Center);

			btn.LayoutParameters = btlayoutParams;
			btn.SetPadding (10,0,0,0);
			btn.Gravity=GravityFlags.CenterVertical;


			TextView textView = new TextView(context);
			textView.TextSize=20;
			textView.Text="Home";
			textView.SetTextColor (Color.White);
			textView.Gravity=GravityFlags.Center;
			LinearLayout linearLayout =  new LinearLayout(context);
			FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, 70, GravityFlags.Center);
			layoutParams.SetMargins (10,0,0,0);
			linearLayout.SetPadding (10,0,0,0);
			linearLayout.AddView(btn);linearLayout.AddView(textView,layoutParams);
			linearLayout.SetBackgroundColor(Color.Rgb(47,173,227));



			height = context.Resources.DisplayMetrics.HeightPixels-75;
			width =context.Resources.DisplayMetrics.WidthPixels;

			LinearLayout linear2 = new LinearLayout(context);
			linear2.Orientation=Orientation.Vertical;
			linear2.LayoutParameters = new ViewGroup.LayoutParams (ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent);
			FrameLayout.LayoutParams layout2= new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent, GravityFlags.Center);
			linear2.AddView(linearLayout,layout2);

			/**
			 * Main Content
			 * */




			FrameLayout gridLayout = new FrameLayout(context);
			gridLayout.LayoutParameters=new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent);

			/**
         * item1
         */

			FrameLayout grid1 = new FrameLayout(context);
			ImageView img1 = new ImageView(context);
			img1.SetScaleType (ImageView.ScaleType.FitXy);
			img1.SetImageResource(Resource.Drawable.profile);

			FrameLayout.LayoutParams layoutParams1 = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent, GravityFlags.Center);

			grid1.AddView(img1, layoutParams1);

			grid1.LayoutParameters=new ViewGroup.LayoutParams((width-20) / 2,(height - 100)/3);

			/**
         * item2
         */

			FrameLayout grid2 = new FrameLayout(context);
			ImageView img2 = new ImageView(context);
			img2.SetImageResource(Resource.Drawable.inbox);
			img2.SetScaleType (ImageView.ScaleType.FitXy);
			grid2.AddView(img2, layoutParams1);
			grid2.LayoutParameters=new ViewGroup.LayoutParams((width-20) / 2,(height - 100)/3);

			/**
         * item3
         */

			FrameLayout grid3 = new FrameLayout(context);
			ImageView img3 = new ImageView(context);
			img3.SetImageResource(Resource.Drawable.outbox);
			img3.SetScaleType (ImageView.ScaleType.FitXy);
			grid3.AddView(img3, layoutParams1);
			grid3.LayoutParameters=new ViewGroup.LayoutParams((width-20) / 2,(height - 100)/3);


			/**
         * item4
         */

			FrameLayout grid4 = new FrameLayout(context);
			ImageView img4 = new ImageView(context);
			img4.SetImageResource(Resource.Drawable.flag);
			img4.SetScaleType (ImageView.ScaleType.FitXy);
			grid4.AddView(img4, layoutParams1);
			grid4.LayoutParameters=new ViewGroup.LayoutParams((width-20) / 2,(height - 100)/3);
			/**
         * item5
         */
			FrameLayout grid5 = new FrameLayout(context);
			ImageView img5 = new ImageView(context);
			img5.SetImageResource(Resource.Drawable.trash);
			img5.SetScaleType (ImageView.ScaleType.FitXy);

//.........这里部分代码省略.........
开发者ID:IanLeatherbury,项目名称:tryfsharpforms,代码行数:101,代码来源:NavigationDrawer.cs

示例9: OnCreateView

		public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
		{
			base.OnCreateView (inflater, container, savedInstanceState);

			// Save ScreenController for later use
			ctrl = ((GameController)this.Activity);

			if (container == null)
				return null;

			var view = inflater.Inflate(Resource.Layout.GameDialogScreen, container, false);

			imageView = view.FindViewById<ImageView> (Resource.Id.imageView);
			textDescription = view.FindViewById<TextView> (Resource.Id.textDescription);
			spinnerInput = view.FindViewById<Spinner> (Resource.Id.spinnerMulti);
			editInput = view.FindViewById<EditText> (Resource.Id.editInput);
			layoutDialog = view.FindViewById<LinearLayout> (Resource.Id.layoutDialog);
			layoutInput = view.FindViewById<LinearLayout> (Resource.Id.layoutInput);
			layoutButton = view.FindViewById<LinearLayout> (Resource.Id.layoutButton);

			// Don't know a better way
			layoutDialog.SetBackgroundResource(Main.BottomBackground);
			layoutButton.SetBackgroundResource(Main.BottomBackground);

			if (input == null) {
				// Normal dialog
				layoutDialog.Visibility = ViewStates.Visible;
				layoutInput.Visibility = ViewStates.Gone;

				btnView1 = view.FindViewById<Button> (Resource.Id.button1);
				btnView1.SetTextColor(Color.White);
				btnView1.SetBackgroundResource(Main.ButtonBackground);
				btnView1.Click += OnButtonClicked;

				btnView2 = view.FindViewById<Button> (Resource.Id.button2);
				btnView2.SetTextColor(Color.White);
				btnView2.SetBackgroundResource(Main.ButtonBackground);
				btnView2.Click += OnButtonClicked;
			} else {
				if (input.InputType == InputType.MultipleChoice) {
					// Multiple choice dialog
					layoutDialog.Visibility = ViewStates.Gone;
					layoutInput.Visibility = ViewStates.Visible;
					spinnerInput.Visibility = ViewStates.Visible;
					editInput.Visibility = ViewStates.Gone;
				} else {
					// Input dialog
					layoutDialog.Visibility = ViewStates.Gone;
					layoutInput.Visibility = ViewStates.Visible;
					spinnerInput.Visibility = ViewStates.Gone;
					editInput.Visibility = ViewStates.Visible;

					editInput.Text = "";
					editInput.EditorAction += HandleEditorAction;  
				}

				btnInput = view.FindViewById<Button> (Resource.Id.buttonInput);
				btnInput.Text = ctrl.Resources.GetString(Resource.String.done);
				btnInput.SetBackgroundResource(Resource.Drawable.apptheme_btn_default_holo_light);
				btnInput.Click += OnInputClicked;
			}

			return view;
		}
开发者ID:WFoundation,项目名称:WF.Player.Android,代码行数:64,代码来源:GameDialogScreen.cs

示例10: OnCreate


//.........这里部分代码省略.........
				Toast.MakeText (Application.Context, "Ocurrió un error al recuperar la información del negocio", ToastLength.Long).Show ();
				Finish ();
			}

			//aqui en un nuevo try catch, cargamos los comentarios

			ProgressBar waitrv = FindViewById<ProgressBar> (Resource.Id.waitrv);
			try{

				ReviewsObj=await plifserver.FetchWeatherAsync("http://plif.mx/mobile/get_neg_reviews?nid="+Intent.GetStringExtra("id")+"&uid="+userid);
				//Aqui vamos a cargar los reviews con ayuda del adapter

				LinearLayout reviewscont = FindViewById<LinearLayout> (Resource.Id.reviewscont);
				LayoutInflater inflater = LayoutInflater.From(this);

				/*
				for(int i=0; i<=5; i++){
					View view = inflater.Inflate(Resource.Layout.listview_comentarios, reviewscont, false);
					TextView revlikes = view.FindViewById<TextView> (Resource.Id.user_corazonlikes);
					revlikes.SetTypeface(font, TypefaceStyle.Normal);
					reviewscont.AddView(view);
				
				
				}*/

				foreach(JsonObject data in ReviewsObj){
					View row = inflater.Inflate(Resource.Layout.listview_comentarios, reviewscont, false);
					ReviewDetalles holder=null;
					LinearDetalles preholder=null;
					/*TextView revlikes = view.FindViewById<TextView> (Resource.Id.user_corazonlikes);
					revlikes.SetTypeface(font, TypefaceStyle.Normal);*/

					LinearLayout fondo_coment = row.FindViewById<LinearLayout> (Resource.Id.fondo_coment);
					fondo_coment.SetBackgroundResource(Resource.Drawable.fondoinfopremium);


					//EMPIEZA
					//ESTE SETEA LA IMAGEN
					ImageView imagen = row.FindViewById<ImageView> (Resource.Id.user_imagen);

					if (data["i"]["ruta"] == null || data["i"]["ruta"] == "" || data["i"]["ruta"] == "null") {
						//pon la imagen por defecto
						imagen.SetImageResource (Resource.Drawable.noprof);
					} else {
						//TENEMOS QUE VERIFICAR SI LA IMAGEN ES DE GOOGLE O DE NOSOTROS!!!
						string extra="http://plif.mx/";
						string ruta=data["i"]["ruta"];
						string first=ruta[0].ToString();

						if(first=="u" || first=="U"){
							ruta=extra+ruta;
						}else{
							//no hagas nada, la imagen es de google
						}

						Koush.UrlImageViewHelper.SetUrlDrawable (imagen, ruta, Resource.Drawable.bolaplace);

					}//TERMINA SI LA IMAGEN NO ES NULA

					//Ponemos el nombre
					TextView nombre = row.FindViewById<TextView> (Resource.Id.user_nombre);
					nombre.Text = data["u"]["nombre"]+" "+data["u"]["apellidos"];

					nombre.SetTextColor(Color.ParseColor("#FFFFFF"));

					//ESTE SETEA LAS ESTRELLAS DE LA CALIFICACION
开发者ID:scrafty614,项目名称:XamarinStudio_Example,代码行数:67,代码来源:PerfilPremium.cs

示例11: releaseClick

        /// <summary>
        /// Opens a dialog window with the choice to release the object we picked up (ring)
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public void releaseClick(object sender, EventArgs e)
        {
            //reset the button drawable
            btnDrawableReset();
            //set the background
            release.SetBackgroundResource(Resource.Drawable.releasebutton_pressed);

            updateThread.Abort();

            //set the content view to the dialogwindow content
            //outside this contentview we are unable to find our resources
            SetContentView(Resource.Layout.DialogWindow);

            //create a new dialog
            dialog = new Dialog(this);
            dialog.SetContentView(Resource.Layout.DialogWindow);
            dialog.SetTitle("Release ring");
            dialog.SetCancelable(true);

            //set the dialog text
            dialogTxt = FindViewById<TextView>(Resource.Id.dialogText);
            dialogTxt.Text = "Are you sure you want to release the ring?";

            //set the buttons
            okButton = FindViewById<Button>(Resource.Id.okButton);
            cancelButton = FindViewById<Button>(Resource.Id.cancelButton);

            //handle click events
            okButton.Click += delegate
            {
                //change the background and finish the current activity (controller)
                okButton.SetBackgroundResource(Resource.Drawable.okbutton_pressed);

                //set bool true to get carmen to release the ring
                Send_Singleton.Instance.releaseRing = 1;

                SetContentView(Resource.Layout.Controller);
                this.OnCreate(bundle);
                //Close the dialog
                dialog.Cancel();
            };//end delegate
            cancelButton.Click += delegate
            {
                //change the background, cancel the dialog and set the contentview back to the controller
                //so we can continue with our activity
                cancelButton.SetBackgroundResource(Resource.Drawable.cancelbutton_pressed);
                dialog.Cancel();
                this.OnCreate(bundle);
            };//end delegate
        }
开发者ID:OML,项目名称:OML_App,代码行数:55,代码来源:Controller.cs

示例12: OnMarkerClick

 public bool OnMarkerClick(Marker marker)
 {
     Button button = new Button(overlayDemo.ApplicationContext);
     button.SetBackgroundResource(Resource.Drawable.popup);
     LatLng ll = marker.Position;// ����
     Point p = overlayDemo.mBaiduMap.Projection.ToScreenLocation(ll);
     p.Y -= 47;
     LatLng llInfo = overlayDemo.mBaiduMap.Projection.FromScreenLocation(p);
     InfoWindow.IOnInfoWindowClickListener listener = null;
     if (marker.Equals(overlayDemo.mMarkerA) || marker.Equals(overlayDemo.mMarkerD))
     {
         button.Text = "�����";
         listener = new IOnInfoWindowClickListenerImplA(this, ll, marker);
     }
     else if (marker.Equals(overlayDemo.mMarkerB))
     {
         button.Text = "����ͼ��";
         listener = new IOnInfoWindowClickListenerImplB(this, marker);
     }
     else if (marker.Equals(overlayDemo.mMarkerC))
     {
         button.Text = "ɾ��";
         listener = new IOnInfoWindowClickListenerImplC(this, marker);
     }
     overlayDemo.mInfoWindow = new InfoWindow(button, llInfo, listener);
     overlayDemo.mBaiduMap.ShowInfoWindow(overlayDemo.mInfoWindow);
     return true;
 }
开发者ID:Yi-shion,项目名称:Xamarin,代码行数:28,代码来源:OverlayDemo.cs

示例13: DisplayDialogOkey

        private void DisplayDialogOkey()
        {
            //Close Keyboard
            InputMethodManager inputMgr = GetSystemService(InputMethodService) as InputMethodManager;
            if (CurrentFocus != null)
                inputMgr.HideSoftInputFromWindow(CurrentFocus.WindowToken, 0);

            //Open Connect Dialog!
            //set the content view to the dialogwindow content
            //outside this contentview we are unable to find our resources
            SetContentView(Resource.Layout.DialogWindow);

            //create a new dialog
            dialog = new Dialog(this);
            dialog.SetContentView(Resource.Layout.DialogWindow);
            dialog.SetTitle("OML");
            dialog.SetCancelable(true);

            //set the dialog text
            dialogTxt = FindViewById<TextView>(Resource.Id.dialogText);

            //set the buttons
            okButton = FindViewById<Button>(Resource.Id.okButton);
            cancelButton = FindViewById<Button>(Resource.Id.cancelButton);

            //Hide Cancel buttom, Only Okey needed
            cancelButton.Visibility = ViewStates.Invisible;

            okButton.Click += delegate
            {
                //change the background, close the dialog and set the contentview back to the live / connection screen
                //so we can continue with our activity
                //Draw Click
                okButton.SetBackgroundResource(Resource.Drawable.okbutton_pressed);
                //Close Dialog
                dialog.Cancel();
                this.OnCreate(bundle);
            };//end delegate
        }
开发者ID:OML,项目名称:OML_App,代码行数:39,代码来源:Live.cs

示例14: OnCreateView

		public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
		{
			View view = inflater.Inflate(Resource.Layout.PopularActivity, container, false);


			Scope = "Local";
			Type = "Timed";

			TopTimedGlobalPostFeedFragment = new PostFeedFragment();
			TopTimedGlobalPostFeedFragment.EmptyTableString = Strings.no_active_posts;
			TopTimedGlobalPostFeedFragment.Master = this;
			TopTimedGlobalPostFeedFragment.Target = FeedTypeEnum.FeedType.PopularGlobalTimedFeed;
			TopTimedGlobalPostFeedFragment.NewPageContainerID = Resource.Id.fragment_container_page;

			TopTimedLocalFeedFragment = new PostFeedFragment();
			TopTimedLocalFeedFragment.EmptyTableString = Strings.no_active_posts;
			TopTimedLocalFeedFragment.Master = this;
			TopTimedLocalFeedFragment.Target = FeedTypeEnum.FeedType.PopularLocalTimedFeed;
			TopTimedLocalFeedFragment.NewPageContainerID = Resource.Id.fragment_container_page;

			TopTimersGlobalUserFeedFragment = new UserFeedFragment();
			TopTimersGlobalUserFeedFragment.EmptyTableString = Strings.no_users_found;
			TopTimersGlobalUserFeedFragment.Master = this;
			TopTimersGlobalUserFeedFragment.Target = FeedTypeEnum.FeedType.PopularGlobalTimersFeed;

			TopTimersLocalUserFeedFragment = new UserFeedFragment();
			TopTimersLocalUserFeedFragment.EmptyTableString = Strings.no_users_found;
			TopTimersLocalUserFeedFragment.Master = this;
			TopTimersLocalUserFeedFragment.Target = FeedTypeEnum.FeedType.PopularLocalTimersFeed;

			View toolbarLayout = view.FindViewById(Resource.Id.toolbarLayout);
			((TextView)toolbarLayout.FindViewById(Resource.Id.toolbar_titleCenter)).Text = "Popular";


			timersButton = (Button)view.FindViewById(Resource.Id.timers);
			timersButton.Click += delegate
			{
				timedButton.SetBackgroundResource(Resource.Drawable.LeftSegmentedControl);
				timedButton.SetTextColor(Android.Graphics.Color.ParseColor("#338a9e"));
				timersButton.SetBackgroundResource(Resource.Drawable.RightSegmentedControlSelected);
				timersButton.SetTextColor(Android.Graphics.Color.White);
				Type = "Timers";
				ShowCorrectPage();
			};

			timedButton = (Button)view.FindViewById(Resource.Id.timed);
			timedButton.Click += delegate
			{
				timedButton.SetBackgroundResource(Resource.Drawable.LeftSegmentedControlSelected);
				timedButton.SetTextColor(Android.Graphics.Color.White);
				timersButton.SetBackgroundResource(Resource.Drawable.RightSegmentedControl);
				timersButton.SetTextColor(Android.Graphics.Color.ParseColor("#338a9e"));
				Type = "Timed";
				ShowCorrectPage();
			};


			localButton = (ImageButton)view.FindViewById(Resource.Id.local);
			localButton.Click += delegate
			{
				localButton.SetImageResource(Resource.Drawable.localselected);
				globalButton.SetImageResource(Resource.Drawable.global);
				Scope = "Local";
				ShowCorrectPage();
			};

			globalButton = (ImageButton)view.FindViewById(Resource.Id.global);
			globalButton.Click += delegate
			{
				localButton.SetImageResource(Resource.Drawable.local);
				globalButton.SetImageResource(Resource.Drawable.globalselected);
				Scope = "Global";
				ShowCorrectPage();
			};

			timedButton.CallOnClick();
			localButton.CallOnClick();

			return view;

		}
开发者ID:natevarghese,项目名称:XamarinTen,代码行数:81,代码来源:PopularFragment.cs

示例15: MenuButtonSetupSuperClass

 public void MenuButtonSetupSuperClass(Button m_button)
 {
     m_button.Click += (s, arg) => {
         m_button.SetBackgroundResource(Resource.Drawable.pressed_lines);
         PopupMenu menu = new PopupMenu (this, m_button);
         menu.Inflate (Resource.Menu.Main_Menu);
         menu.MenuItemClick += this.MenuButtonClick;
         menu.DismissEvent += (s2, arg2) => {
             m_button.SetBackgroundResource(Resource.Drawable.menu_lines);
             Console.WriteLine ("menu dismissed");
         };
         menu.Show ();
     };
 }
开发者ID:aliarobinson,项目名称:SpeedyChef_375,代码行数:14,代码来源:CustomActivity.cs


注:本文中的Button.SetBackgroundResource方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。