Stay organized with collections
Save and categorize content based on your preferences.
public
static
interface
TabLayoutMediator.TabConfigurationStrategy
com.google.android.material.tabs.TabLayoutMediator.TabConfigurationStrategy
|
A callback interface that must be implemented to set the text and styling of newly created
tabs.
Summary
Public methods |
abstract
void
|
onConfigureTab(TabLayout.Tab tab, int position)
Called to configure the tab for the page at the specified position.
|
Public methods
public abstract void onConfigureTab (TabLayout.Tab tab,
int position)
Called to configure the tab for the page at the specified position. Typically calls TabLayout.Tab.setText(CharSequence)
, but any form of styling can be applied.
Parameters |
tab |
TabLayout.Tab : The Tab which should be configured to represent the title of the item at the given
position in the data set. |
position |
int : The position of the item within the adapter's data set.
|
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# TabLayoutMediator.TabConfigurationStrategy\n==========================================\n\n\n`\npublic\nstatic\n\n\ninterface\nTabLayoutMediator.TabConfigurationStrategy\n`\n\n\n`\n\n\n`\n\n|-----------------------------------------------------------------------------|\n| com.google.android.material.tabs.TabLayoutMediator.TabConfigurationStrategy |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nA callback interface that must be implemented to set the text and styling of newly created\ntabs.\n\nSummary\n-------\n\n| ### Public methods ||\n|------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` abstract void` | ` `[onConfigureTab](/reference/com/google/android/material/tabs/TabLayoutMediator.TabConfigurationStrategy#onConfigureTab(com.google.android.material.tabs.TabLayout.Tab,%20int))`(`[TabLayout.Tab](/reference/com/google/android/material/tabs/TabLayout.Tab)` tab, int position) ` Called to configure the tab for the page at the specified position. |\n\nPublic methods\n--------------\n\n### onConfigureTab\n\n```\npublic abstract void onConfigureTab (TabLayout.Tab tab, \n int position)\n```\n\nCalled to configure the tab for the page at the specified position. Typically calls [TabLayout.Tab.setText(CharSequence)](/reference/com/google/android/material/tabs/TabLayout.Tab#setText(java.lang.CharSequence)), but any form of styling can be applied.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|------------|--------------------------------------------------------------------------------------------------------------------------------------|\n| `tab` | `TabLayout.Tab`: The Tab which should be configured to represent the title of the item at the given position in the data set. \u003cbr /\u003e |\n| `position` | `int`: The position of the item within the adapter's data set. \u003cbr /\u003e |"]]