0

When going from Page 2 back to Page 1, I created a custom button with custom slide left/right animation between Page 1 and Page 2. Then obviously the "UP" button uses a default animation to go from Page 2 back to Page 1.

I'm referring to the following "UP" button on bottom of Android phones. That triangle "UP" button.

enter image description here

Do all Android apps have the default animation for the "UP" button when going back to page 1? Or can I customize it to have the same animation as my custom button? Or is it even pointless to have a custom back button when Android provides the "UP" button? Is the "UP" button just always default animation, no point of making a custom one?

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
iBEK
  • 622
  • 2
  • 8
  • 27
  • 1
    The button you're referring to is very much not an "up" button; it is the *back* button and its behavior is temporal instead of hierarchical. – Ben P. Nov 13 '17 at 19:42
  • I just read from Android Developers "Navigation with Back and Up" document and they're referring to the "UP" button as "consisting of the app icon and a left-point caret". – iBEK Nov 13 '17 at 19:44
  • That document is very old. It's not _wrong_, but you have to consider how the platform has changed since it was written. The "up" button is not necessarily present in all modern-day apps, but it will be the _navigation button_ on whichever toolbar the app has set as the action bar. The "back" button is present on all phones, either as a hardware or software key, and is (generally) found on the bottom left. The image you posted is of the back button. – Ben P. Nov 13 '17 at 19:49
  • That image is my Android Studio Nexus 5X emulator, it's all I have. I'm referring to the button present on all phones (hardware/software key) that "back" button. Since it's present on all phones with a default animation, is there even a point of creating a custom "back" button with custom animation? Or should I just create custom animation for android's "back" button? – iBEK Nov 13 '17 at 19:53
  • @iBEK that up button is the one in the toolbar- the app icon on the far left. Some apps choose to use it, some don't. Some choose to make it a back button, some an up, some a menu. What you posted is the back button, an entirely different button. – Gabe Sechan Nov 13 '17 at 19:53
  • @GabeSechan I don't use toolbar for my app. I'm using ActionBar and TabsLayout. So the up button is only on toolbar? – iBEK Nov 13 '17 at 19:54
  • @iBEK Action bar and toolbar are basically the same concept. So you can put an up button on your action bar. But that's the one its talking about when it talks about the "up" button. – Gabe Sechan Nov 13 '17 at 19:55
  • @GabeSechan, then about the "back" button that comes on all Android devices. I don't own an Android phone yet, I'm coming from iOS background, so with the "back" button, do all apps just use the default animation transition or is it better to have a custom transition with overridePendingTransition? – iBEK Nov 13 '17 at 20:00
  • @iBEK Its up to the app. Some use the default, some specify a custom animation. It all depends on the amount of effort they want to put into the look of their app as it goes between pages. – Gabe Sechan Nov 13 '17 at 20:01
  • @GabeSechan I'll just create custom animation then for Android "back" button. Last question, Is there also a point then to create my own "back" button with the same animation as the Android "back" button or is it pointless and just use Android's "back" button? Have you seen Android apps that use 2 "back" buttons, Android's and a custom one on the same page? – iBEK Nov 13 '17 at 20:04
  • I have sen apps with two back buttons. Generally its from when someone ports an iOS app without thinking about it, or caring about it (for example, hiring an outsourced dev and handing off screens for them to copy). I would say its generally not considered good design. For your other question- what you're actually animating is the transition between activities. So just set the animation up in your manifest and it will apply to any transition within your app, not just the hardware button. – Gabe Sechan Nov 13 '17 at 20:08
  • @GabeSechan I need various animations for different buttons, not 1 animation for all buttons. I already created the code for them with overridePendingTransition and anim.xml files. But thank you for your help in clearing up the "back" button for me. – iBEK Nov 13 '17 at 20:13

0 Answers0