leandroBorgesFerreira / LoadingButtonAndroid

A button to substitute the ProgressDialog
MIT License
1.95k stars 214 forks source link

Keep the button in middle of the screen when animating #158

Closed appsdev85 closed 4 years ago

appsdev85 commented 4 years ago

Hi,

Is there a way to keep the button in the middle of the screen after animation start ? its going to the screen left side

samair commented 4 years ago

Even i have the same problem..

appsdev85 commented 4 years ago

@samair I think its because of the frame layout that i use, check layout gravity its should work i will update once get solution

appsdev85 commented 4 years ago

No, still not working even when change the layout and set the layout gravity to center!

samair commented 4 years ago

Yep, found solution, put it in a relativelayout and make the buton "layout_CenterInParent " to true and then it works.. let me know.

leandroBorgesFerreira commented 4 years ago

Sorry that I took so long to answer that question. The button animation will respected the gravity of the ViewGroup it is inserted, so put it inside a LinearLayout with centre gravity would be the best idea for this view. Also, you can use relativelayout, like @samair suggested.

leandroBorgesFerreira commented 4 years ago

I'm closing this bug since there's no correction to be done, just fix the gravity of the ViewGroup that contains this button and everything should be fine.