Android Question CustomView Animation

Discussion in 'Android Questions' started by BarryW, May 23, 2015.

  1. BarryW

    BarryW Active Member Licensed User

    Hi masters... Why does the customview is not animating when loadlayout is called...

    Im refering on iconbutton customview. It not animating

    Tnx
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    I'm not familiar with the implementation of this specific view, however custom views can be animated. I guess that this view doesn't use the base panel and adds itself directly to the layout.
     
  3. DonManfred

    DonManfred Expert Licensed User

    This is the code i use in ALL my view-wrappers

    Code:
    public class IconButtonWrapper  extends ViewWrapper<IconButton> implements DesignerCustomView {
    [...]
        /**
         * programmatically add the 
    view (the Button)
         */
        
    public void AddToParent(ViewGroup Parent, @Pixel int left, @Pixel int top, @Pixel int width, @Pixel int height) {
            //AttributeSet attrs;      
            Parent.addView(ib, new BALayout.LayoutParams(left, top, width, height));
        
    }

        //this method cannot be hidden.
        public void DesignerCreateView(PanelWrapper base, LabelWrapper lw, anywheresoftware.b4a.objects.collections.Map props) {
            ViewGroup vg = (ViewGroup) base.getObject().getParent();
            AddToParent(vg, base.getLeft(), base.getTop(), base.getWidth(), base.getHeight());
            base.RemoveView();
            //set text properties
        }
     
    Last edited: May 24, 2015
  4. BarryW

    BarryW Active Member Licensed User

    Then ehy does ur view is not animating?

    Tnx Don...
     
  5. DonManfred

    DonManfred Expert Licensed User

    I dont know if i do something wrong in my libraries...

    If i do tell me what i need to make another way; i´ll change that then.
     
  6. BarryW

    BarryW Active Member Licensed User

    I dont know what to change but just try to load a layout with ur iconbutton and you see what I mean...

    Tnx
     
  7. Erel

    Erel Administrator Staff Member Licensed User

    You can add the custom view to a panel instead of the activity. It will then animate.
     
    Devan likes this.
  8. BarryW

    BarryW Active Member Licensed User

    Tnx.. It works...
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice