Printing text based on the position of a button - android

I have a SlidingDrawer menu in my app, and when the drawer is open I want the name for each button on the drawer to display as the buttons go pass it.
Do you all have any ideas to whether this is possible or not? I have been searching for about an hour and I can't find any answers.

Assuming I understood what you want correctly (adding text from the drawer on top of buttons on the main layout) you can try this. I don't know how accurate it would be:
Place the sliding drawer as the topmost element in your layout with a transparent background.
Use exactly the same layout you're using for your "main" layout (where the buttons are) and use a textView where your buttons are.
When your sliding drawer opens, the text from its content will appear on top of the button

Related

Sliding drawer - how to make it pull from above?

I'm making a game for 2 players, this is a mockup, the problem is with the sliding drawer on top - purple one. The "handle" button must be exactly the opposite to blue handle below. How do I reverse it?
If the top purple drawer is a RelativeLayout, just set in the button the ALIGN_PARENT_TOP to true. If the drawer is not a RelativeLayout, declare one RelativeLayout(which fills all the purple drawer) inside it and put in it the button with ALIGN_PARENT_TOP to true.
Then, for having the text in the button upside down, just add android:rotation="180" to the button in your XML file or give the button a 180 degree rotation programatically.

Android: highlighted navigation buttons at the bottom of the screens, Split Actionbar?

Many apps (Instagram for example) have these navigation buttons at the bottom of the screens for switching activities. A button is highlighted AFTER clicking and stays highlighted during the activity until the user switches to other activities.
I'm trying to implement these buttons in my app. Are these buttons part of the split action bar, or tabs placed at the bottom, or just regular image buttons in a group (like push-buttons/radio-buttons)? I tried using split action bar. It works well, however, I cannot figure out how to highlight or change the background of the button which was clicked. I searched but couldn't find a solution. There are postings about changing the background color of the action bar item using custom selector, but it only applies to the time the button is pressed. Since so many apps these days have these buttons, I believe there are must be solutions that I'm not aware. Please help! Thanks.
try to use the tabwidget for highlighting the tab(or)button for switching in bottom

Custom animate navigation drawer

I have implemented Google's navigation drawer and I would like to add a custom animation when I click a menu item.
Ideally the menu would slide back as if closing, leaving a small sliver of the menu open. A dialog would open with an animation, originating from the space beside the selected menu item.
Something like this..
I tried to animate the left_drawer element on the x axis using ObjectAnimator, but this displaces the whole screen.
Can anyone help?
If you want it so the drawer is only peaking, try using drawerLayout.closeDrawers(true).
According to the source though, this closes all drawers (if you have more then one).
DrawLayout source

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.
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.
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.
I'm not sure how the netflix app looks, but you might want to check out ye good olde tab-layout? ( http://developer.android.com/resources/tutorials/views/hello-tabwidget.html )
Also be sure to take a look at the android design page: http://developer.android.com/resources/tutorials/views/hello-tabwidget.html

Custom Component in android

I have created custom component with a Button Bar on the Bottom of
the screen and a Title and status bar on the top of the screen. I want
to include this custom component in every one of my Activities. Now,
in a any given activity, how do I go about adding content on the
screen (say a button in the middle of the screen) in a addition to my
custom component thats ever present?
How about adding a base layout with can contain the header and footer that you use everywhere and then have a stub in the middle that you can inflate with whatever you like?
I think that will solve your problem.
You can read about ViewStub here:
http://android-developers.blogspot.com/2009/03/android-layout-tricks-3-optimize-with.html

Categories

Resources