Questions tagged [android-tablayout]

Android TabLayout provides a layout to organize pages of information.

TabLayout provides a horizontal layout to display tabs.

Population of the tabs to display is done through TabLayout.Tab instances. You create tabs via newTab(). From there you can change the tab's label or icon via setText(int) and setIcon(int) respectively. To display the tab, you need to add it to the layout via one of the addTab(Tab) methods.

Useful links

2044 questions
0
votes
1 answer

Material Component TabLayout inside Fragment in Kotlin

I'm developing an app using Kotlin and Material Components (https://material.io/develop/android). I'm trying to use TabLayout (https://material.io/develop/android/components/tab-layout) inside a Fragment, and I want to open fragments using this…
0
votes
1 answer

CustomLayout for Bottom Tabbed Activity

I have a tabbedactivity layout, but i need to customize that layout for swipe between 2 activities, like this. I cant change the background color, just the line indicator. Anyone knows how can i do that?
Flavio Luiz
  • 37
  • 1
  • 7
0
votes
1 answer

Expandable List View using fragments and tab layout

Hey guys so basically im trying to create an expandable list view in one of the tabs of my app (say the "active" tab) so it is made of fragments of course so i have tried this code to make the expandable list view work with fragments, it is showing…
0
votes
1 answer

Remove Tab Fragment from ViewPager and TabLayout Android

I have an activity that hosts tablayout with viewpager and fragments. I have successfully setup the tablayout and viewpager with user-populated values from a local database like below code(trying to be brief, showing only one tab here) - public void…
0
votes
2 answers

TabLayout Android, How to fill entire screen width with a few tabs & scroll with large of amount tab?

Please show me how to resolve this problem, I want all tabs will spread to entire screen width in case have a few tabs, but auto matic scroll in case have many tabs. How to detect have a tabs is out of display screen in scroll mode ? Thanks
0
votes
2 answers

SharedPreferences Across Multiple Activities Returns NULL

I have shared prefs to be used throughout my app but right now only four activities. The first activity is a recyclerview with checkboxes and the checked status is saved (in the recycler adapter) for each checkbox using a shared prefs helper class.…
0
votes
1 answer

tabs in tablayout not displaying

I've a very simple code for making tabs , this is my layout code :
Navid Abutorab
  • 1,667
  • 7
  • 31
  • 58
0
votes
1 answer

How to create a draggable TabLayout?

My layout contains a TabLayout and a ViewPager, This views sits at the bottom. I want to TabLayout to be draggable to the top of the page. Just the like the image below. The view is currently made with ConstraintLayout, how to do it?
Aslam
  • 683
  • 1
  • 7
  • 20
0
votes
1 answer

Refresh fragment in Tab layout viewpager on change of spinner value

In my app, I am using tab layout, navigation drawer and viewpager with three fragments. In each fragment, I have a spinner and when I changed the value of spinner it goes to server. But problem is, when I change value of spinner in second tab…
Ana
  • 174
  • 2
  • 8
0
votes
0 answers

TabView Fragment not Refresh after callback from another Tab

I have set up RecyclerView in the Fragments of TabView.The Recylerview data is set using RestApi.When one item in Tab2 is deleted,the item need to be added in Tab3 by calling RestApi.Tab2 contain a list of Inactive members.Tab3 contain a list of…
0
votes
1 answer

How can I get a view of tab in tablayout? not fragment's view

I want to get a view of the second tab in the tab layout. not Fragment's view in ViewPager. I'm using TakuSemba's Spotlight Library. I want spotlight to 2nd Tab. But I can't get View of 2nd Tab in Tablayout. How can I get a View of Tab? EDIT : …
01hanst
  • 577
  • 6
  • 19
0
votes
1 answer

TabLayout Scroll and RecyclerView Scroll

I'm using a tabLayout with a horizontal recyclerView The problem is when I scroll the recyclerView, the tabLayout takes priority instead of RecyclerView. This only happens when the tabLayout is in the last tab, the tabLayout has no more…
BlueSeph
  • 543
  • 1
  • 8
  • 25
0
votes
3 answers

Cant see tablayout with viewpager

this my code to link tablayout with viewpager it was working fine but now it is not working i am unable to see tab layout in my device can any one tell what is causing this problem i think my code is right…
vinit
  • 39
  • 1
  • 11
0
votes
1 answer

setCustomView didnot work for tablayout in android studio

I have a tablayout with 5 tabs. Each tab has an icon and title. I want to change color of icon and title for tab that is selected and tab that is un-selected. For this i try using custom tabs but it didn't work. Here is my code for…
BeginnerProgrammer
  • 664
  • 3
  • 13
  • 27
0
votes
0 answers

viewpager selected two tab (be crazy)

I've created a viewpager and three tabs. And I have two problems. after starting the activity inside that viewpager and tablayout, automatically selected first tab (normally) and second tab in getItem's method in my adapter and show first tab…
Vahid
  • 1
  • 2