Creating an Android Nav Bar that replaces button with image when that activity is active
I am looking to create a Nav Bar in my Android application that functions very similar to the Nav Bar used by the Netflix app. There will be 4 buttons aligned horizontally.  When one of those buttons is selected, the appropriate activity loads and that button is replaced by an image.

There are multiple ways I can achieve this, but since I am new to programming for Android, I figured I'd ask the community first.  I list the first two that come to my head below.

1. Create a Linear Layout and define a separate layout for each activity.  The Layout would include two more linear layouts, a horizontal linear layout for the nav bar and a vertical layout for the content.

2. Create a custom ui component named nav bar that extends a linear layout (based upon earlier threads I have seen about nav bars on here). Inflate that layout for each activity, then make a framelayout that overlays an image on top of the active button (the button that was just pressed).  Then create onButtonClick listeners for each button except for the active button.

I'm not sure if there is a better way to achieve this and I am open to any suggestions.  Any feedback would be great.


Creating an Android Nav Bar that replaces button with image when that activity is active
===

I am looking to create a Nav Bar in my Android application that functions very similar to the Nav Bar used by the Netflix app. There will be 4 buttons aligned horizontally.  When one of those buttons is selected, the appropriate activity loads and that button is replaced by an image.

There are multiple ways I can achieve this, but since I am new to programming for Android, I figured I'd ask the community first.  I list the first two that come to my head below.

1. Create a Linear Layout and define a separate layout for each activity.  The Layout would include two more linear layouts, a horizontal linear layout for the nav bar and a vertical layout for the content.

2. Create a custom ui component named nav bar that extends a linear layout (based upon earlier threads I have seen about nav bars on here). Inflate that layout for each activity, then make a framelayout that overlays an image on top of the active button (the button that was just pressed).  Then create onButtonClick listeners for each button except for the active button.

I'm not sure if there is a better way to achieve this and I am open to any suggestions.  Any feedback would be great.

