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


C# ImageView.StartAnimation方法代码示例

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


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

示例1: LikePost

		public static async Task<bool> LikePost (Post post, ImageView likeButton, ListView lsitViewAdaper = null)
		{
			if (post.liked) {
				//todo delete
				likeButton.StartAnimation(AnimationUtils.LoadAnimation(TabHostActivity.GetTabHost(), Resource.Animation.grow));
				MediaPlayer.Create(TabHostActivity.GetTabHost(), Resource.Raw.ticksound).Start();


				likeButton.SetImageResource(Resource.Drawable.likeselected);
				return false;
			}

			if (post.userPoster.idUser != Globe.SharedInstance.User.idUser) {
				post.liked = true;
				likeButton.SetImageResource(Resource.Drawable.likeselected);
	
				try {
					likeButton.StartAnimation(AnimationUtils.LoadAnimation(TabHostActivity.GetTabHost(), Resource.Animation.grow));
					MediaPlayer.Create(TabHostActivity.GetTabHost(), Resource.Raw.ticksound).Start();
					bool result = await TenServices.LikePost (post);
					if (!result) {
						post.liked = false;
						likeButton.SetImageResource(Resource.Drawable.like);
					} 
					return result;
				} catch (RESTError) {
					post.liked = false;
					likeButton.SetImageResource(Resource.Drawable.like);
				}
			}

			return false;
		}
开发者ID:natevarghese,项目名称:XamarinTen,代码行数:33,代码来源:TenServiceHelper.cs

示例2: FindViews

 private void FindViews (View v)
 {
     EmailEditText = v.FindViewById<EditText> (Resource.Id.CreateUserEmailEditText).SetFont (Font.Roboto);
     PasswordInputLayout = v.FindViewById<TextInputLayout> (Resource.Id.CreateUserPasswordLayout);
     PasswordEditText = v.FindViewById<EditText> (Resource.Id.CreateUserPasswordEditText).SetFont (Font.Roboto);
     RegisterButton = v.FindViewById<Button> (Resource.Id.CreateUserButton).SetFont (Font.Roboto);
     LoginButton = v.FindViewById<Button> (Resource.Id.LoginButton);
     SpinningImage = v.FindViewById<ImageView> (Resource.Id.RegisterLoadingImageView);
     RegisterFormLayout = v.FindViewById<LinearLayout> (Resource.Id.RegisterForm);
     RegisterSuccessLayout = v.FindViewById<LinearLayout> (Resource.Id.RegisterSuccessScreen);
     PasswordToggleButton = v.FindViewById<Button> (Resource.Id.RegisterPasswordToggleButton).SetFont (Font.Roboto);
     SuccessTimerButton = v.FindViewById<Button> (Resource.Id.GoToTimerButton);
     LegalTextView = v.FindViewById<TextView> (Resource.Id.RegisterLegalTextView);
     GoogleRegisterButton = v.FindViewById<Button> (Resource.Id.GoogleRegisterButton);
     var spinningImageAnimation = AnimationUtils.LoadAnimation (Activity.BaseContext, Resource.Animation.SpinningAnimation);
     SpinningImage.StartAnimation (spinningImageAnimation);
     SpinningImage.ImageAlpha = 0;
 }
开发者ID:eatskolnikov,项目名称:mobile,代码行数:18,代码来源:RegisterUserFragment.cs

示例3: ProcesarImagenes


//.........这里部分代码省略.........

								case 8:
									//270 grados
									mutable = imagencomentario.Copy(Bitmap.Config.Argb8888, true);
									cnv = new Canvas(mutable);
									matrix = new Matrix();
									Log.Debug("Orientation", "270 Grados");
									matrix.PostRotate(270);
									imagencomentario=Bitmap.CreateBitmap(mutable, 0, 0,  imagencomentario.Width, imagencomentario.Height, matrix, true);
									break;

								default:
									Log.Debug("Orientation", "0 Grados (0 360, como se quiera ver :P)");
									//0 grados
									//No hagas nada
									break;
								};

								Log.Debug("Orientation", "Termina Switch");
								}//ELSE orientation = 1
							}catch(Exception ex){
								Log.Debug("Orientation", "ERROR! Posiblemente no hay EXIF: "+ex);
							}
							*/

							if(imagencomentario!=null){
								//Toast.MakeText(this, "Si se creó el Bitmap!!!", ToastLength.Long).Show();
								//Lo añadimos a la lista
								//Bitmap tmp = imagencomentario;

								Log.Debug("FOSSBYTES","Inicia conversión a bytes!");
								byte[] tmp2 = PathToByte2(p[i]);
								Log.Debug("FOSSBYTES","Termina conversión a bytes!");
								fossbytes.Add(tmp2);
								//Toast.MakeText(this, "Elementos en lista: "+contenedorimagenes.Count, ToastLength.Long).Show();

								//aqui haremos el img


								//Creamos el imageview con sus parámetros
								ImageView prev = new ImageView(this);
								imgcomprev.AddView(prev);
								GridLayout.LayoutParams lp = new  GridLayout.LayoutParams();    
								lp.SetMargins(15,15,0,15);
								lp.Width=130;
								lp.Height=130;
								prev.LayoutParameters=lp;
								prev.SetScaleType(ImageView.ScaleType.CenterCrop);
								prev.SetImageBitmap(Bitmap.CreateScaledBitmap(imagencomentario, 175, 175, false));
								prev.StartAnimation(bounce);





								//imgcount++;

								//Liberamos la memoria Inmediatamente!
								if (imagencomentario != null && !imagencomentario.IsRecycled) {
									imagencomentario.Recycle();
									imagencomentario = null; 
								}
								//Mala idea, esto causó que tronara .-. si lo voy a hacer pero cuando no tenga que usarlo

							}else{//por si algun acaso intenta procesar una ruta null
								var fabee = FindViewById<CoordinatorLayout> (Resource.Id.snackbarPosition);
								Snackbar
									.Make (fabee, "Ocurrió un error. Por favor intenta con una imágen diferente", Snackbar.LengthLong)
									.SetAction ("Ok", (view) => {  })
									.Show ();	
								break;
							}

						}//TERMINA EL FOR PARA CADA IMAGEN 


						int restantes=limite-imgcount;
						if(restantes==0){
							imgrestantes.Text="¡Excelente!";
						}else{
							imgrestantes.Text="Puedes cargar "+restantes+" imágenes más!";
						}



					}//TERMINA EL ELSE DE COMPROBAR SI HAY MAS IMAGENES DE LAS QUE SE PUEDEN CARGAR

				}));//GETIMAGE

			}else{

				var fabee = FindViewById<CoordinatorLayout> (Resource.Id.snackbarPosition);
				Snackbar
					.Make (fabee, "Solo puedes subir hasta 3 imágenes!", Snackbar.LengthLong)
					.SetAction ("Ok", (view) => {  })
					.Show ();	

			}//ELSE COUNTIMAGES < 3

		}
开发者ID:scrafty614,项目名称:XamarinStudio_Example,代码行数:101,代码来源:PerfilPremium.cs

示例4: OnCreate

        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            // Create your application here
            SetContentView(Resource.Layout.Plan5_Progress);

            #region variable initialisations
            trickButtons = new TrickButton[Data.tricksPerRank];
            selectedRank = Data.CurrentRank;

            NewGamePlusStars = new ImageView[5];

            currentRankImage = FindViewById<ImageView>(Resource.Id.CurrentRankImage);
            currentRankImage.SetImageDrawable(Data.RankImages[(int)selectedRank]);
            currentRankImage.LayoutParameters.Height = (int)(Data.deviceHeight * 0.15f);
            rankUpOut = AnimationUtils.LoadAnimation(this, Resource.Animation.rankup_animOut);
            selectNextRankOut = AnimationUtils.LoadAnimation(this, Resource.Animation.selectRank_Next_Out);
            selectPreviousRankOut = AnimationUtils.LoadAnimation(this, Resource.Animation.selectRank_Previous_Out);

            selectNextRankButton = FindViewById<ImageView>(Resource.Id.SelectNextRank);
            selectPreviousRankButton = FindViewById<ImageView>(Resource.Id.SelectPreviousRank);

            PopulateArray();
            FragmentManager.FindFragmentById<OverlayFragment>(Resource.Id.Overlay).SetImageResources(Resource.Drawable.overlay_plan5, Resource.Drawable.overlay_readmore);

            using (var prefs = PreferenceManager.GetDefaultSharedPreferences(this))
            {
                StarsToShow = prefs.GetInt(Flags.Stars, 0);
            }

            for (int i = 0; i < StarsToShow; i++)
            {

                NewGamePlusStars[i].Visibility = Android.Views.ViewStates.Visible;
            }
            #endregion

            CheckSideArrowVisibility();
            #region animation delegates
            rankUpOut.AnimationEnd += delegate
            {
                selectedRank = ++Data.CurrentRank;

                using (var prefs = PreferenceManager.GetDefaultSharedPreferences(this))
                {
                    using (var edit = prefs.Edit())
                    {
                        edit.PutInt(Flags.CurrentRank, (int)Data.CurrentRank);
                        edit.Commit();
                    }
                }

                currentRankImage.SetImageDrawable(Data.RankImages[(int)selectedRank]);
                var rankup_animIn = AnimationUtils.LoadAnimation(this, Resource.Animation.rankup_animIn);
                currentRankImage.StartAnimation(rankup_animIn);
                ReloadTricks();
                CheckSideArrowVisibility();
            };

            selectNextRankOut.AnimationEnd += delegate
            {
                selectNextRankButton.Clickable = true;
                selectPreviousRankButton.Clickable = true;
                if (selectedRank++ == Data.MaxRank) selectedRank = 0;

                currentRankImage.SetImageDrawable(Data.RankImages[(int)selectedRank]);
                var selectNextRankIn = AnimationUtils.LoadAnimation(this, Resource.Animation.selectRank_Next_In);
                currentRankImage.StartAnimation(selectNextRankIn);
                ReloadTricks();
                CheckSideArrowVisibility();
                LockRank();
            };

            selectPreviousRankOut.AnimationEnd += delegate
            {
                selectPreviousRankButton.Clickable = true;
                selectNextRankButton.Clickable = true;
                if (selectedRank-- == 0) selectedRank = Data.MaxRank;

                currentRankImage.SetImageDrawable(Data.RankImages[(int)selectedRank]);
                var selectPreviousRankIn = AnimationUtils.LoadAnimation(this, Resource.Animation.selectRank_Previous_In);
                currentRankImage.StartAnimation(selectPreviousRankIn);
                ReloadTricks();
                CheckSideArrowVisibility();
                LockRank();
            };
            #endregion

            //TODO Separate this stuff? contains both initialisation and delegate logic.
            For(0, trickButtons.Length, (i) =>
            {
                AlterTrick(i, trickButtons[i].Trick);
                trickButtons[i].Box.CheckedChange += delegate (object sender, CompoundButton.CheckedChangeEventArgs e)
                {
                    SelectedRankTricks[i].Cleared = e.IsChecked;
                    if (canRankUp)
                    {
                        var oscillateAnim = AnimationUtils.LoadAnimation(this, Resource.Animation.rankup_animOscillate);
                        currentRankImage.StartAnimation(oscillateAnim);
                    }
//.........这里部分代码省略.........
开发者ID:JMHornberg,项目名称:PJ6000-Hovedprosjekt,代码行数:101,代码来源:Plan5ProgressActivity.cs

示例5: OnCreate


//.........这里部分代码省略.........
				}//For


			}catch(Exception ex){
				Log.Debug (tag, "Algo en el blog falló D: "+ex.ToString());
			}


			updatefoto.SetTypeface(font, TypefaceStyle.Normal);

			updatefoto.Click += async (object sender, EventArgs e) => {
				//actualizamos la foto

				alert.SetTitle("Actualizar foto");

				alert.SetPositiveButton ("Desde cámara", (senderAlert, args) => {
					//abrimos el intent de la cámara
					updatefoto.Visibility=ViewStates.Gone;
					esperafoto.Visibility=ViewStates.Visible;
						

					source=2;

					Dictionary<string,string> diccionario = new Dictionary<string,string>();

					List <byte[]> fossbytes = new List<byte[]>();
					GetImage((async (b, p) =>  {
						Log.Debug(tag,"Inicia GETIMAGE");

						AlphaAnimation alpha = new AlphaAnimation(1.0F, 0.4F); // change values as you want
						alpha.Duration=500; // Make animation instant
						alpha.FillAfter=true; // Tell it to persist after the animation ends
						// And then on your imageview
						fotoperfil.StartAnimation(alpha);

						Java.IO.File f = new Java.IO.File(p[0]);
						stream = this.ContentResolver.OpenInputStream(Android.Net.Uri.FromFile(f));
						Bitmap temp =BitmapFactory.DecodeStream(stream);

						if(temp!=null){
							Log.Debug("FOSSBYTES","Inicia conversión a bytes!");
							byte[] tmp2 = pliffunctions.PathToByte2(p[0]);
							Log.Debug("FOSSBYTES","Termina conversión a bytes!");

							fossbytes.Add(tmp2);
							diccionario.Add("imagen_usuario_id",hayimagen);
							diccionario.Add("usuario_id",idusuario);


							try{
							//AQUI vamos a actualizar la foto del perfil con el codigo del multipart
							string resp = await plifserver.PostMultiPartForm ("http://plif.mx/pages/UpdateImgPerfil", fossbytes, "nada", "file[]", "image/jpeg", diccionario, true);
							Log.Debug(tag,"Respuesta del servidor: "+resp);

							//PONEMOS LA IMAGEN, MOSTRAMOS EL BOTON Y OCULTAMOS EL PROGRESSBAR
							JsonValue rutapre = await plifserver.FetchWeatherAsync ("http://plif.mx/mobile/get_img_usr?id="+idusuario);
							Log.Debug ("json","SI existe la ruta");
							string path = "http://plif.mx/"+rutapre [0] ["imagen_usuarios"] ["ruta"];
							Log.Debug (tag, "La ruta es: "+path);
								rutafoto=path;
							Koush.UrlImageViewHelper.SetUrlDrawable(fotoperfil, path, Resource.Drawable.profile);
							hayimagen="si";

							

							AlphaAnimation alpha2 = new AlphaAnimation(0.4F, 1.0F); // change values as you want
开发者ID:scrafty614,项目名称:XamarinStudio_Example,代码行数:67,代码来源:profile.cs


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