Adding A navigation drawer bar to the following code? - java

I'm fairly new here so I was wondering can someone advise me on a way to implement a navigation drawer activity in the main activity? The code is downloadable from the following links with the source code being the second link and the first link the explanation of how it is done (This isn't my code just to point out):
http://blog.grafixartist.com/image-gallery-app-android-studio-1-4-glide/
https://github.com/Suleiman19/Gallery
It would be very much appreciated and thank you in advance

you can directly implement navigation drawer in your main activity if you are using android studio.
right click on your java folder and go to new->activity->navigation drawer activity.
everything is setup for you (action bar toggle button , lists , icons , onclick methods etc.)
you can edit the list items in menu folder take activity_main_drawer.xml file.

Related

Creating a second android navigation bar inside a fragment

i'm trying to create another navigation bar (top navigation bar) inside a fragment that already have bottom navigation bar. but i only find a way to do it (based on searching the android docs and sites) on a new activity not on a fragment that already had bottom navigation bar. Those 4 menus are fragment (Home, History, Message and profile)
edit : i already found kotlin solution (https://medium.com/#avinriyan/android-kotlin-bottom-navigation-tab-layout-19d062256882) sadly i'm using java and knows java only
it should look like above link (image)
i tried to browse a way to do it but i can't find a single tutorial either on youtube nor google.
i already have bottom navigation view like shown on above link (image)
i'm a complete beginner i need this for my project. thank you
You can use TabLayout for that purpose. Here is an article about it on medium
Or you can use libraries with custom views that also implement such feature. For example DViews that has TopMenuView which is easy-to-use analog of TabLayout
Screenshot of TopMenuView

Side bar in android

Does anyone know what this UI element is called in Android, and where to look for the documentation to implement such a layout.
Yup its called a navigation drawer, here is a link to some documentation https://developer.android.com/training/implementing-navigation/nav-drawer.html. Also I believe its one of the standard options when creating an initial project
Navigation Drawer Android Example as follow:
http://javatechig.com/android/navigation-drawer-android-example
its called navigation drawer in android.
to add navigation drawer simply follow these steps-
in android studio go to file - new project - your application name click on next - next - to add an activity scroll down in pop up window - and select navigation drawer activity click to next - type activity name as required - finish.
it will add navigation drawer in your project.
This type of user interface is the most common User Interface used in modern android apps. It is called a Navigation Drawer. The drawer stays outside the screen on the left/right side(where you choose it to be) and comes to action when you click the open drawer button.
For development reference, you can head over to the documentation page.
If you want to add a new such activity to your app, you can click New>activity>Navigation Drawer Activity.
Or when starting a new project, on the Add an Activity to Mobile Screen Page, you can select a Navigation Drawer Activity.

Navigation Drawer app behaivour when open fragments

Im working with a Android app that uses Navigation Drawer. This app use the template provided with Eclipse ADT (when you select the navigation drawer template).
I dont understand the behaivour of the navigation drawer very well.
My main requeriment is make a "search" option, I have on the Navigation Drawer a EditText to get the query string from the user. I want that I press search button and open my SearchFragment getting the search query.
I know that I can make this:
Bundle args = new Bundle();
args.putString("searchQuery",searchQuery);
fragment.setArguments(args);
And this for getting:
getArguments().getString("searchQuery");
But I have the next:
MainActivity
NavigationDrawerFragment
SearchFragment
OtherFragments.. (I think this arent relevant in the question)
I dont understand where I can make this steps.
More data:
I have in the navigation drawer class the EditText with the setOnEditorActionListener for the search press.
Any info that I can add I will be add. Sorry my english
Thanks for the help
Navigation drawer is basically a component that show 2 pane in the way that one is the main pane (usually fragment) that is used to show content and the other one is usually a listview that is just used to choose which fragment to show in main pane
so if you want to switch between 2 different layouts you have to create 2 different fragments and then you can add or replace these fragments based on listview's selected item.
You may refer to below link for complete code
http://developer.android.com/training/implementing-navigation/nav-drawer.html
Hope it helps!

navigation bar expandable list view android

I've been trying to recreate a navigation drawer looking something like this:
http://developer.android.com/design/media/navigation_drawer_holo_dark_light.png
It appears to just be an expandable list view within a navigation drawer but the trouble is I'm a bit of a newbie so i'm not sure on how to do it, any advice on how I would go about creating something like this?
Try this tutorial, you'll learn as well.
http://www.androidhive.info/2013/07/android-expandable-list-view-tutorial/
As for the Navigation Drawer implementation, use a Menu Drawer library, it will make it much easier.

Trying to develop a sliding drawer type View in android?

I am working on an app which requires me to make a layout something like this:
Here you could see a black button like view at the right bottom . I want this button to work as a sliding drawer type view.
when I drag this button this would happen:
How could I implement this .Please someone help me with this .
Where could I start from (Please give some link to source or example)?
i cant see ur images so edit ur link and try this one. http://blog.sephiroth.it/2011/03/29/widget-slidingdrawer-top-to-bottom/
I've implemented my own drawer after reading this very good article :
http://w2davids.wordpress.com/android-damn-that-sliding-drawer/
Good luck.

Categories

Resources