Android Question increase height with animation

Discussion in 'Android Questions' started by ArminKH, Sep 2, 2015.

  1. ArminKH

    ArminKH Well-Known Member

    hello every body
    as you know material design has too many animations
    one of that is the animation which is appare when user clicked on menu button and then menu items shown with an animation like attached video
    i know we can create animations by xml and as my knowledge the xml animations are limited to Alpha,Rotate,Scale,...
    the scale animation is so similar to my goal but i dont want to stretch my view
    for example i want my view like panel start become visible from Width = 50dip , Height = 50dip to Width = 200dip , Height = 200dip(please see attached video)
    i know maybe this can be done by using timer but i believe this is not professional way to make animations by timer
    so , please suggest me to achieve to making this animations
    thank u guys
     

    Attached Files:

  2. LucaMs

    LucaMs Expert Licensed User

    I don't know if this can help you, sorry :), but take a look to it.
     
    ArminKH likes this.
  3. ArminKH

    ArminKH Well-Known Member

    thank u i will try that
     
    Last edited: Sep 2, 2015
  4. ArminKH

    ArminKH Well-Known Member

    @LucaMs
    this is my sample code
    Code:
    #Region  Project Attributes
        
    #ApplicationLabel: B4A Example
        
    #VersionCode: 1
        
    #VersionName:
        
    'SupportedOrientations possible values: unspecified, landscape or portrait.
        #SupportedOrientations: unspecified
        
    #CanInstallToExternalStorage: False
    #End Region

    #Region  Activity Attributes
        
    #FullScreen: False
        
    #IncludeTitle: True
    #End Region

    Sub Process_Globals

    End Sub

    Sub Globals
        
    Private Button1 As Button
        
    Private Panel1 As Panel
    End Sub

    Sub Activity_Create(FirstTime As Boolean)
        Button1.Initialize(
    "Button1")
        Panel1.Initialize(
    "")
        
    Activity.AddView(Panel1,100dip,150dip,150dip,150dip)
        Panel1.AddView(Button1,
    10dip,10dip,130dip,100DIP)
        Panel1.Color=
    Colors.White
        Button1.Color=
    Colors.Blue
        Button1.Text=
    "should not scaled"
        Button1.TextColor=
    Colors.White
    End Sub

    Sub Activity_Resume

    End Sub

    Sub Activity_Pause (UserClosed As Boolean)

    End Sub
    Sub Button1_click
       
        
    Dim NBA1 As noaObjectAnimator
           
            
    'i want to scale panel withot scale button which is a child view of panel
            NBA1.InitializeFloat(Panel1, NBA1.PROPERTY_SCALE_Y, 0,2"")
            NBA1.setDuration(
    3000)
            NBA1.Start
    End Sub
    i'm not familar with informatix NineOldAndroid at all
    as you can see at sample code if button which is a child view of my panel not scaled then i can make my own animation like the video which is atteched on post 1
    @Informatix
    Can u please help me or just a suggestion to achive to attached video animation by using your lib?
    i want the panel scale but the child viewes which are into this panel not scaled
    i tried so much times , i combine object animator and all other ways as my knowledge but it seems my experience is not enough to make this type of animations
    thank u both
     
  5. LucaMs

    LucaMs Expert Licensed User

    (mee too :)).


    That animation seems to be made differently.

    The panel (list) increases its height.

    It is what you might do: bulld the panel (invisible), set its height to 0, display it and then increase its height at each tick of a timer.
     
    ArminKH likes this.
  6. ArminKH

    ArminKH Well-Known Member

    yes if you look at post1 i said this can be done by timer but thats better if we can do this by animations(without timer)
    there is not any animation for increase or decrease height and width with animation without timer? :(
    i hate timers :D
    thank u Luca sorry for mention
     
  7. LucaMs

    LucaMs Expert Licensed User

    I hope you want something like this
     

    Attached Files:

    ArminKH likes this.
  8. ArminKH

    ArminKH Well-Known Member

    thank u
    but as you can see the list view is scaled with panel(together)
    but i dont want to scale child views of panel(list view at this sample)
    just increase height and width of panel with animation without any influence to child views
     
  9. LucaMs

    LucaMs Expert Licensed User

    Then I'm afraid you have to use the timer; I think that all animations on the panel also act on its children.
     
    ArminKH likes this.
  10. ArminKH

    ArminKH Well-Known Member

    the animation in the attached video in first post is using timer? :(
    ok thank u luca :(
     
  11. LucaMs

    LucaMs Expert Licensed User

    You can probably create a class for this and then create a library

    upload_2015-9-2_19-41-18.png


    Alt + 5
     
    ArminKH likes this.
  12. ArminKH

    ArminKH Well-Known Member

    @Informatix
    is this possible by using your NineOldAndroid lib or we should to use timer 4 increase and decrease height and width of views with smooth animation?
    please...this is necessary 4 me
     
  13. Informatix

    Informatix Expert Licensed User

    Here are two examples with NOA that increase the size of a panel without modifying the child views.
     

    Attached Files:

    • NOA.zip
      File size:
      7.6 KB
      Views:
      133
    LucaMs, MarcoRome and ArminKH like this.
  14. ArminKH

    ArminKH Well-Known Member

    I will try it thank u
    -------------------------
    Edit: Thank u @Informatix works like a charm,now i can make my own material menu animations
     
    Last edited: Sep 4, 2015
  15. ArminKH

    ArminKH Well-Known Member

    @Informatix
    what is this error ?
    Code:
    Unexpected event (missing RaiseSynchronousEvents): noax_update
    Check the unfiltered logs 
    for the full stack trace.
    Unexpected 
    event (missing RaiseSynchronousEvents): noay_update
    Check the unfiltered logs 
    for the full stack trace.
    not crash not error
    this message just printed in log windows!!
     
  16. Informatix

    Informatix Expert Licensed User

    You can ignore it. In release mode, you should not get it.
     
    ArminKH likes this.
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