I'm trying to get a sliding drawer to pull down from the top in my application, but I can't figure out a way to do it. Any help?
The built in sliding drawer is not that flexible, your best bet is to extend it and modify its behavior, or take a look at this http://code.google.com/p/android-misc-widgets/
I had to do the same for one of my projects and I ended up writing my own widget for this. I called it SlidingTray is now part of my open source Aniqroid library. It allows sliding from all four corners and feel free to modify the code as your like.
http://aniqroid.sileria.com/doc/api/ (Look for download options to get it)
(Disclosure: I am the maintainer of the project.)
I have created a complete replacement for SlidingDrawer. It can slide from any direction and I find that it greatly outperforms the original. http://www.github.com/kedzie/DraggableDrawers
Related
I want to create the following customized BottomNavigationBar. How can I set custom layout for the same?
Can somebody tell me how to approach it ?
You can check this library, hope this helps! BottomNavigationCircles-Android
If you are OK with using Material components, this article should be of use: https://protocoderspoint.com/custom-bottom-navigation-bar-android/.
This is a relatively easy thing to find on Google, so I advise looking there for some help.
Check out sites like https://github.com/roughike/BottomBar if you want to build upon a pre-built layout/system.
As far as I can tell though, there is no method to set android:layout="#layout/mylayout" function for bottom nav bars.
Search GitHub for "custom bottom navigation bar" and try to build off of the dirty work that has been done there. It will save a lot of time and headache while you're trying to build the back-end navigation patterns and layout inflators.
I would like to implement a custom navigation drawer (such as the one shown here) and I have been trying all kinds of navigation menu libraries for Android and iOS but haven't come up with a good option. Is there any library that could achieve this kind of navigation or does anyone have any idea how this could be done as a custom component?
You can try SlidingMenu. Its one of the most widely used alternatives for navigation drawer. Its gives you a whole host of options which are listed on their homepage.
First
Second
Second I used before and it is nice as for me, but first one looks more promising.
Happy coding :)
I want to use sliding drawer from left to right ?
So can you tell me anybody how it is possible? and also use this drawer to all activity in my project.
Use the concept of viewpager.You can find doc and example below...
doc
Example
Check that library. API 6+ (even less, not quite sure)
https://github.com/6wunderkinder/android-sliding-layer-lib
You can attach a layer to any part of the screen with the addition that you can swipe the layout directly in and out, unlike the SlidingDrawer in which you just can drag from a small piece of UI (drawer).
You could also use the new NavigationDrawer pattern from Google.
http://developer.android.com/design/patterns/navigation-drawer.html
I need to incorporate a youtube like drawer navigation drawer for both(left,right) sides. AFAIK android apis don't provide means for the right-to-left drawer functionality. There're quite a lot of implementations out there(sliding menu) which do.
This sliding menu feature seems to present a performance issue. Should I try to rewrite original NavigationDrawer, which I expect to be the least performance-impact solution, or there is another performance-optimal library?
Thanks.
I would choose NavigationDrawer. I used both and I find NavigationDrawer smoother. If you try to mimic google UX then with NavigationDrawer should be enought for your needs.
I recently made a project/demo to implement NavigationDrawer with ActionBarSherlock for pre Honeycomb devices because I need for an app.
SherlockNavigationDrawer impl
Another thing to take in mind is that if you use NavigationDrawer try to avoid Tabs because all the tabs items could fit perfectly as a listview in NavigationDrawer.
Actually NavigationDrawer supports drawers on both edges.
You have to supply the two drawer views inside your layout xml; one with gravity:left and one with gravity:right.
Then, in your Activity you call setDrawerLockMode(DrawerLayout.LOCK_MODE_UNLOCKED) on your DrawerLayout object.
This will enable swiping either from left or right edge.
#MichaĆ The question is actually implementation of both left as well as the right drawer.
#midnight NavigationDrawer right now only implements one-sided menu which you can place either on the left or the right. If you want to implement the other pane also you can make your content layout as SlidingPaneLayout.
This was also added to the latest support library along with the NavgationDrawer. For an implemented example you can look at the newest Hangouts app on how they are using it. This layout will probably suit your purposes better rather than rewriting the NavigationDrawer. In any case i'd hold off on re-writing it since it is the first release of the Layout and may undergo changes fairly quickly.
Since the last version of SupportLibrary there is a NavigationDrawer in Android.
I've been using firefox for Android and really like the use of the sidebar to hold shortcut icons and the like. How would I go about creating a similar bar myself with the following attributes:
progressively revealed as I swipe in one direction
progressively hides as I swipe in the other direction
can be a custom width
I can dynamically inject layout in to it or it can hold static content
Is there any open source code available? If not, what approach would I use to create this?
Sound like you're describing a Gallery control. There are some examples in the ApiDemos project here.
The first part can be solved by using a ListView. The second part I don't know yet. I'm looking for such a component as well.