Creating a second android navigation bar inside a fragment - java

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

Related

What is the best way to create pages(about/my home/references tabs) as in the image below?

I just started learning Android programming. I've created a page and I want to create "About/My Home/References" tabs in the image below.
The "About/My Home/References" tabs (you can see them in the link below) all act like a button. When I click the "About" tab, I can see the things about the users. When I click the "My Home" tab, I can see the some text about my home. The third tab also does the same thing.
Image link: https://imgyukle.com/i/4LgQH
My question is how can I do this in Android Studio? I've added three button but it doesn't look like that. Any idea?
You can use TabLayout with TabItems widgets. Visit, for example, https://material.io/develop/android/components/tab-layout/ for short overview and https://www.codingdemos.com/android-tablayout-example-viewpager/ as step-by-step manual.
For that layout, you want to use Fragments and a ViewPager with a TabLayout.
Your main Activity would contain 3 Fragments, AboutFragment, HomeFragment and ReferencesFragment.
This would allow you to build each layout separately. The ViewPager would contain the Fragment, and lets you swipe between them. The TabLayout contains your buttons, to tell the ViewPager which to show.

Android - Main menu for simple app

I'm making a simple android app, and I'm trying to work out the best way to make the main menu. The users of this app are not likely to be that sophisticated, so I want to make it as simple as possible.
So I want the first screen they see when the app opens to be this menu - they click on what they want, and it takes them to that part of the app (Not pressing a "Menu" button to bring it across from the left, which is common nowdays).
So, I want the menu to look a bit like this: http://cloud.addictivetips.com/wp-content/uploads/2012/10/AppZapp-Android-Menu.jpg , minus the search box, and the strip down the right hand side. (also this looks like it is one of those menus that slide out from the left, which I dont want)
I have had a look into menus (https://developer.android.com/guide/topics/ui/menus.html#options-menu), but it seems it is more used for contextual stuff, or letting the user select an option), then a navigation menu.
So - what is the best way to do this? Do I just create a list and put a button in each item?
Based on the your requirement , Use Navigation drawer see the below link.
Navigation drawer tutorial
NavigationDrawerSample
After used navigation drawer, you need to add search view on navigation header.For more info see the link
SearchView tutorial

Android app: 2 problems with layout

After ionic and angular i'm trying to develop apps in native java. After setting up a toolbar and a drawer-menu i wasn't able to make it work:
First problem: How can i use myitems in my drawer to show different views (in separate .xml files) in the main view.
Second problem: How can i create a view, similar to a full-height snackbar, whitin a text input field?
thank you for your time.
You should use fragment replacement. So in your main activity layout file create Frame Layout and onNavigationDrawerClick change fragments. Take a look at this as example.
2.I recommend you to use Bottom Sheet in it. Sample
If you need some code recommendations comment here. Good luck

Adding A navigation drawer bar to the following code?

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.

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.

Categories

Resources