Package io.rong.imkit.widget.adapter

## Class ProviderManager

- All Implemented Interfaces:

      public class ProviderManager<T>

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class | Description
    --- | --- | ---

  - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `ProviderManager()` |
    `ProviderManager(List<IViewProvider<T>> providerList)` |

  - ### Enum Constant Summary

    Enum Constants
    Enum Constant | Description
    --- | ---

  - ### Method Summary

    Modifier and Type | Method | Description
    --- | --- | ---
    `int` | `getProviderCount()` |
    `void` | `)>addProvider(IViewProvider<T> provider)` |
    `void` | `)>addProvider(int viewType, IViewProvider<T> provider)` |
    `void` | `)>setDefaultProvider(IViewProvider<T> defaultProvider)` | 设置默认模板。当找不到和 viewType 对应的模板时，使用此默认模板进行 ui 处理。
    `void` | `)>removeProvider(IViewProvider<T> provider)` |
    `void` | `)>replaceProvider(Class oldProviderClass, IViewProvider<T> provider)` |
    `void` | `removeProvider(int itemType)` |
    `IViewProvider<T>` | `getProvider(int viewType)` |
    `int` | `)>getItemViewType(IViewProvider<T> provider)` |
    `int` | `getItemViewType(T item, int position)` |
    `IViewProvider<T>` | `getProvider(T item)` |

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ProviderManager

          ProviderManager()

    - #### ProviderManager

          ProviderManager(List<IViewProvider<T>> providerList)

  - ### Method Detail

    - #### getProviderCount

           int getProviderCount()

    - #### addProvider

           void )>addProvider(IViewProvider<T> provider)

    - #### addProvider

           void )>addProvider(int viewType, IViewProvider<T> provider)

    - #### setDefaultProvider

           void )>setDefaultProvider(IViewProvider<T> defaultProvider)

      设置默认模板。当找不到和 viewType 对应的模板时，使用此默认模板进行 ui 处理。

    - #### removeProvider

           void )>removeProvider(IViewProvider<T> provider)

    - #### replaceProvider

           void )>replaceProvider(Class oldProviderClass, IViewProvider<T> provider)

    - #### removeProvider

           void removeProvider(int itemType)

    - #### getProvider

           IViewProvider<T> getProvider(int viewType)

    - #### getItemViewType

           int )>getItemViewType(IViewProvider<T> provider)

    - #### getItemViewType

           int getItemViewType(T item, int position)

    - #### getProvider

           IViewProvider<T> getProvider(T item)