I would like to make a Fragment show up just like a Fragment Drawer would, but not only to a list of intents.
(If you don't know what I mean by Fragment Drawer):
Google products such as Gmail, "Google app", Google Play... utilize them frequently.
The Fragment Drawer is a menu on one of these apps created by swiping from left to right or clicking the "Hamburger" button.
I would like to highlight the distinction between what I want and the Fragment Drawer is: I would like to be able to place TextViews, ImageViews, and Buttons inside of it as if it were a normal fragment in which I could just inflate a layout in it and I would rather it come from the right instead.
If a visual representation is needed I would be happy to try my hand at making one.
Related
In Android development I want to achieve interface seen in image:
Screenshot
What I want basically is activity should have two tabs and in each of them there should be a fragment and that fragment should have dot indicator so that user can swipe to second menu of fragmen or other fragment in same tab.
Please help with what kind of logic should I implement.
I currently have a bottom navigation with 3 items for my 3 activities. I have a separate button on one of the screens that opens a new activity. When this happens, I'd like to program it so none of the 3 options of the bottom navigation view are selected.
bottomNavigationView.setSelectedItemId(R.id.______)
This is the line I use to select which icon I'd like to be shown as currently clicked. If I leave this line out of my activity, the first item of the bottom navigation view is selected by default.
I think that it will be better for you to use fragments for this task.
In my app I want to combine a tabView with a bottom navigation bar. I want to have three tabs and three options in the bottom bar, so there should be nine different activities in the end. My tabs and the bar are defined in my activity_main.xml, so for every selected option in the bottom bar the tabs remain the same. How can I open a new fragment which depends on the combination of the selected tab and selected bottom bar option?
I suffered from a same problem before and here is my solution.
You will need 1 activity and 12 fragment not 9 to achieve it.
The main activity contains the bottom navigation bar, and inflate 3 fragment let's name them LeftFragment, MiddleFragment and RightFragment, this main activity should act only as an inflator for this fragments, don't write any other code in the activity just a manager for the bottom navigation bar.
Each one of this fragments should act as a holder or a manger for the tabs fragments, agian don't write any code in LeftFragment, MiddleFragment and RightFragment just a manager for the tablayout.
And your actual layout code should be in each tab fragment.
Hope this answer your question.
I have a pretty standard implementation of ViewPager using Fragments; however I'm wondering if it's possible to get rid of the preloading of tabs, and to only load a tab activity once user clicks on it?
Also, can we get rid of the swipe effect, just like in iOS?
Thank you
If you want the user to only click on tabs, then don't use a ViewPager; put the views in a FrameLayout, make them all invisible and only set the view that is selected visible. When the user clicks on a tab, make the current view invisible and selected view visible. Much simpler than implementing a PagerAdapter.
So right now I have it so I can swipe and it changes views or activitys
but how can I do it so it just changed the middle box only? With the sound clips in it
Im making this app to learn
this is the source i used
http://www.easyway2in.blogspot.ae/2014/07/android-swipe-views-example.html
and my video
https://www.youtube.com/watch?v=qD039kXYPLM
instead of having the ViewPager the only item inside activity_main
you should put the header and footer you want to remain unchanged inside activity_main,
so that the fragments in the viewpager only contains your "middle box"