Scrolling Navigation Bar Help Android - android

I was wondering how to create a navigation bar
like the one at the top of the screen that moves when "flicked" or scrolled.

Use a HorizontalScrollView, wrapped around a LinearLayout of Buttons or ImageButtons.

Related

How can I add a Bar on top bottom android?

I want to have a tool bar on top and another bar at bottom of my activity,
make it look like that:
you can use Bottom navigation bars.
https://www.google.com/design/spec/components/bottom-navigation.html
Create a linear layout and align layout on top. For bottom, create another linear layout and align layout to bottom. Add your views into the layouts.

Sticking a bar to the bottom of the screen

I have a scrollview that extends beyond the visible screen, but I would like to keep a bar affixed to the bottom of the screen. How do I do so while still allowing the user to scroll beyond the visible screen?
you can make a LinearLayout vertical mode, put a scrollview first, then another layout that is your bar, it will be below the scrollview

How to Create menu top and bottom both of them in Android?

I wanna create a menu that be seen when clicked on the center of screen like Aldiko.
I've tested PopupWindow for create menu items but I didn't any solution for trackbar.
Are there any solutions?
Using Default Menu you can create Bottom or TOP layout. So you cant used this. But you can create your own layouts. Align one layout to top & second to bottom. Initially did INVISIBLE both layouts, when you click on center then VISIBLE both layouts.
You can use split ActionBar for getting something like you want. The only repercussion of using it will be the look in different screen modes (portrait and landscape). Your action items will align themselves as per the available screen space. Let me know if you are looking for some code for doing it with ActionBar.
You can use FrameLayout and put the main app layout on back frame and menu (with transparent background) on the top frame. Initial set the visibility of the menu layout to invisible so you app main layout would only be visible. Now when you clicks on the main layout just change the visibility to visible, when user press again set the top layout again to invisible.

sliding drawer with content below it

I am having a sliding drawer positioned at the bottom . and below that I have a linear layout of 50dp .
So my layout looks like this :
Where red rectangle is the sliding drawer handle
Now when I slide my finger from bottom of the screen to the sliding drawer , i.e. along the blue path
The sliding drawer doesn't open . It doesn't open because the click activity is captured by the bottom layout.
The sliding drawer opens only when I click EXACTLY within the red rectangle.
I tried making the bottom layout clickable=>false focussable=>false still no good.
Any idea on how can I make the click event of bottom layout loose its click as soon as the finger is out of the layout ? , so that the handle can capture the click
I would suggest you to create the entire linear layout (brown bottom bar) as handler for your drawer. Doing so will allow you to slide the drawer as you want in the second picture.
Or, alternatively, you can make use of FrameLayout to present LinearLayout and drawer's view as with in a single layout and set the width and height of your drawer as linear layout - covering the entire area of linear layout.
Or, at last, implement SimpleOnGestureListener on linearlayout (for upwards direction) to execute drawer's click action.
You said you tried clickable=false and focusable=false... did you also set focusableintouchmode=false? (I would set all three and see what happens).
As I painfully discovered recently, focusable-false only covers the hardware, not the touch screen. I had to add focusableintouchmode="false".. maybe that will work for you too.

Android - Positioning layout items relative to top of sliding drawer handle

I would like to position an element of an activity's layout relative to the top of a sliding drawer handle in its closed state. The standard Layout above relative layout attribute obviously doesn't work given the floating nature of sliding drawer.
It seems to me that the only (non-programmatic) alternative is to bottom-align and used fixed margins or bottom padding to ensure the element sits above the closed sliding drawer handle. This approach is pretty crude and I'm hoping to avoid this because I would like the sliding drawer handle height to be dependent on its content (which is dynamic).
Any suggestions to help achieve a more fluid layout?
You can control the height of the sliding drawer if you want to and I think that is the case with this question. The sliding drawer is just taking some space of the screen and other content should be above it
Can't you use a LinearLayout (Vertical), and set its position to bottom-align

Categories

Resources