Android Question increase height with animation

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
 

Attachments

  • Component-Menus-Usage_Appbar_Dropdown_xhdpi_004.zip
    105.8 KB · Views: 403

ArminKH

Well-Known Member
@LucaMs
this is my sample code
B4X:
#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
 
Upvote 0

ArminKH

Well-Known Member
(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.
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
 
Upvote 0

ArminKH

Well-Known Member
I hope you want something like this
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
 
Upvote 0

ArminKH

Well-Known Member
Then I'm afraid you have to use the timer; I think that all animations on the panel also act on its children.
the animation in the attached video in first post is using timer? :(
ok thank u luca :(
 
Upvote 0

LucaMs

Expert
Licensed User
Longtime User
You can probably create a class for this and then create a library

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



Alt + 5
 
Upvote 0

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
 
Upvote 0

ArminKH

Well-Known Member
Here are two examples with NOA that increase the size of a panel without modifying the child views.
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:
Upvote 0

ArminKH

Well-Known Member
@Informatix
what is this error ?
B4X:
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!!
 
Upvote 0
Top