material-components / material-components/material-components-android
Add tabs adapter for TabLayout
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- Java
- Estrellas
- 17.4k
- Forks
- 3.2k
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
`TabLayout` creates the tabs in an opaque, non-extensible way and there is no way to provide a custom view at creation time, you have to hack around it with an observer set on the content source (e.g., a `ViewPager` adapter) and then use `setCustomView()` on each tab, after they're created.
Besides, the way tabs' views are created prevents libraries such as [Calligraphy](https://github.com/chrisjenx/Calligraphy/) from correctly applying a typeface to the default tab views, because the `TextAppearance` is applied only after inflating the view, and there's no way to access the tabs pool nor any hook into the creation of new tabs.
### Suggested changes
Have a mechanism to create and bind the tabs' views, similar to list adapters, that have a `createTabView()` and a `bindTabView()` methods. The default implementation would simply retain the current behaviour; users could extend the default implementation to tweak the tabs' appearance (e.g., `CalligraphyUtils.applyFontToTextView(tabTextView, typeface);`) or to inflate their custom tab views without the waste of always inflating the default layout anyways.
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Comienza en la ruta de creación de pestañas descrita en el issue, incluida su interacción con un adaptador de ViewPager. Define cómo createTabView() y bindTabView() conservarían el comportamiento predeterminado y permitirían vistas personalizadas y la aplicación de typeface; se considera terminado cuando los llamadores pueden personalizar la creación sin inspeccionar la fuente de contenido ni inflar un layout predeterminado no utilizado.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- android, java
- Área
- mobile
- Tipo de issue
- Nueva funcionalidad
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 35/100