private static void ClearUpViewGroup(ViewGroup grp)
 {
     try
     {
         for (int i = 0; i < grp.ChildCount; i++)
         {
             var view = grp.GetChildAt(i);
             var viewGroup = view as ViewGroup;
             if (viewGroup != null)
             {
                 ClearUpViewGroup(viewGroup);
                 grp.RemoveView(viewGroup);
                 viewGroup.Dispose();
                 continue;
             }
             var imageView = view as ImageView;
             if (imageView != null)
                 imageView.Recycle();
             grp.RemoveView(view);
             view.Dispose();
             view = null;
         }
     }
     catch
     {
         Console.WriteLine("ClearUpViewGroup Exception");
     }
 }
 public override void DestroyItem(ViewGroup container, int position, Java.Lang.Object @object)
 {
     ScaleImageView SIV = views [position];
     container.RemoveView ((View)@object);
     SIV.SetImageBitmap (null);
     views [position] = null;
     bitmaps [position] = null;
 }
		public ShadowWrapper (Android.Content.Context context, ViewGroup realContent) : base (context)
		{
			Content = realContent;
			OriginalParent = realContent.Parent as ViewGroup;
			OriginalParent.RemoveView (realContent);
			this.SetMinimumHeight (realContent.Height);
			this.SetMinimumWidth (realContent.Width);
			this.AddView (realContent, new LinearLayout.LayoutParams (LinearLayout.LayoutParams.FillParent,
				LinearLayout.LayoutParams.FillParent));
			OriginalParent.AddView (this, new LinearLayout.LayoutParams (LinearLayout.LayoutParams.FillParent,
				LinearLayout.LayoutParams.FillParent));
			this.SetBackgroundColor (Android.Graphics.Color.Red);

		}
			public override void DestroyItem(ViewGroup container, int position, Java.Lang.Object @object)
			{
				container.RemoveView((View)@object);
			}
 public override void DestroyItem(ViewGroup container, Int32 position, Java.Lang.Object objectValue)
 {
     container.RemoveView((View)objectValue);
 }
 public override void DestroyItem(ViewGroup container, int position, Java.Lang.Object obj)
 {
     var view = (View)obj;
     container.RemoveView(view);
     view.Dispose();
 }
 public void CleanUp()
 {
     _parent.RemoveView(_overlay);
     _overlay.Dispose();
 }
 public override void DestroyItem(ViewGroup container, int position, Object @object)
 {
     var dataContext = @object.DataContext();
     if (position != PositionNone)
         position = GetPosition(dataContext);
     bool removed = position == PositionNone;
     if (removed && dataContext != null)
         ServiceProvider.AttachedValueProvider.Clear(dataContext, ContentPath);
     var fragment = @object as Fragment;
     if (fragment == null)
     {
         var view = (View)@object;
         container.RemoveView(view);
         if (removed)
             view.ClearBindingsRecursively(true, true);
     }
     else
     {
         if (_currentTransaction == null)
             _currentTransaction = _fragmentManager.BeginTransaction();
         if (removed)
             _currentTransaction.Remove(fragment);
         else
             _currentTransaction.Detach(fragment);
     }
 }
Example #9
0
        public override void DestroyItem(ViewGroup container, int position, Java.Lang.Object @object)
        {
            Console.WriteLine("Destroying item");

            lock (syncObject)
            {
                // get the view and remove from container
                ScaleImageView currentView = views[position];

                container.RemoveView(currentView);

                // clean view
                currentView.SetImageBitmap(null);

                views[position] = null;

                // dispose the corresponding bitmap
                ReplaceBitmap(position, null);
            }
        }
        private void SetupGravity(ViewGroup view)
        {
            LinearLayout itemRoot = (LinearLayout)view;
            GravityFlags gravityInt = GravityExt.GetGravity(itemGravity);
            itemRoot.SetGravity(gravityInt | GravityFlags.CenterVertical);

            if (view.ChildCount == 2)
            {
                if (itemGravity == GravityEnum.End && !IsRtl() && view.GetChildAt(0) is CompoundButton)
                {
                    CompoundButton first = (CompoundButton)view.GetChildAt(0);
                    view.RemoveView(first);

                    TextView second = (TextView)view.GetChildAt(0);
                    view.RemoveView(second);
                    second.SetPadding(second.PaddingRight, second.PaddingTop,
                        second.PaddingLeft, second.PaddingBottom);

                    view.AddView(second);
                    view.AddView(first);
                }
                else if (itemGravity == GravityEnum.Start && IsRtl() && view.GetChildAt(1) is CompoundButton)
                {
                    CompoundButton first = (CompoundButton)view.GetChildAt(1);
                    view.RemoveView(first);

                    TextView second = (TextView)view.GetChildAt(0);
                    view.RemoveView(second);
                    second.SetPadding(second.PaddingRight, second.PaddingTop,
                        second.PaddingRight, second.PaddingBottom);

                    view.AddView(first);
                    view.AddView(second);
                }
            }
        }
Example #11
0
 public void RemoveSpinner(ViewGroup rootview)
 {
     loading = false;
     if(loadingcontainer!=null&&loadingcontainer.IsShown){
         rootview.RemoveView (loadingcontainer);
     }
 }
Example #12
0
 public override void DestroyItem(ViewGroup container, int position, Java.Lang.Object objectValue)
 {
     container.RemoveView(views[position]);
 }
 public override void DestroyItem(ViewGroup container, int position, Object @object)
 {
     var dataContext = @object.DataContext();
     if (position != PositionNone)
         position = GetPosition(dataContext);
     bool removed = position == PositionNone;
     var fragment = @object as Fragment;
     if (fragment == null)
     {
         var view = (View)@object;
         container.RemoveView(view);
     }
     else
     {
         if (_currentTransaction == null)
             _currentTransaction = _fragmentManager.BeginTransaction();
         if (removed)
             _currentTransaction.Remove(fragment);
         else
             _currentTransaction.Detach(fragment);
     }
 }
Example #14
0
 public override void DestroyItem(Android.Views.ViewGroup container, int position, Java.Lang.Object objectValue)
 {
     container.RemoveView((View)objectValue);
 }
 public override void DestroyItem(ViewGroup container, int position, Object objectValue)
 {
     GC.Collect(); // feel my pain bro
     imageLoader.ClearMemoryCache();
     container.RemoveView(objectValue as View);
 }