Is it possible to create a tabbed activity with a tablayout inside just one fragment ? I want this tablayout to slide from all fragments of the activity but I want it inside just one fragment. Here is an image for a better explanation.
tabbed activity tablayout
PS.: got the original image from here and edited it
Related
I currently have the following code to make TabLayout invisible:
final TabLayout tabLayout = (TabLayout) findViewById(R.id.tabs);
tabLayout.setVisibility(View.INVISIBLE);
What the above code does is make the TabLayout and tab fragments invisible but it stays in the same spot. I need to make it hide and move ABOVE the screen.
final TabLayout tabLayout = (TabLayout) findViewById(R.id.tabs);
tabLayout....?
As the above states, what code would I need for the TabLayout to actually move above the screen and hide instead of be invisible and stay in same spot?
Give this a try.
final TabLayout tabLayout = (TabLayout) findViewById(R.id.tabs);
tabLayout.setVisibility(View.GONE);
I have a BottomSheetDialogFragment which is opened from another fragment.
bottom_sheet_fragment.xml:
<LinearLayout>
<TabLayout/>
<ViewPager>
</LinearLayout>
I have two fragments for the view pager each of which contains an EditText and a RecyclerView in vertical fashion.
view_pager_fragment1.xml:
<LinearLayout>
<EditText/>
<RecyclerView>
</LinearLayout>
Now when ever I click on the edit text a part of recycler view is getting hidden behind the key board.
Expected:
When ever keyboard appears the bottomsheet should scroll up so that the recycler view contents remain visible.
I've managed to achieve the behavior you want by making the root view of the BottomSheetFragment layout a android.support.v4.widget.NestedScrollView. Don't know if its going to work for you, as you seem to be using other scroll views inside.
After thorough searching I still cannot find an answer.. So please help!!
I have a navigation drawer linked to an activity. The navigation drawer contains a listview inside it.
I need to update this listview by a Button click which is inside a fragment.
How do I do it?
(I also have a same navigation drawer and listview for different activities. So the listview should be updated in all the activities.)
Thanks in advance.
I wanted to create ActionBar with icons in center and I made it with getSupportActionBar().setCustomView(R.layout.abs_layout);. But there problems with events. when I click to ImageView onOptionsItemSelected not working.
Where is my mistake? Can I do this other ways?
there is my code:code_files
How can I add OnClickListener to the ImageViews
What i want in my activity is two buttons on the top in one single line.. and below that i want a framelayout in which i want an imageview and i wil add my custom view on the top of imageview. I tried a lot but i am having a lot of confusion.
Shown in the image below is somewhat like i want.
I want to use framelayout because i want to add my custom view over my imageview. But if i add button on framelayout it comes above the image. It is getting really confusing and messy for me.
I did'nt know that we could nest two layouts in a single activity. I nested LinearLayout with FrameLayout and my problem got solved.. Cheers!