com.here.msdkui.routing

## Class SimpleTransportModePanelAdapter

- java.lang.Object
- - androidx.viewpager.widget.PagerAdapter
  - - androidx.fragment.app.FragmentStatePagerAdapter
    - - com.here.msdkui.routing.TransportModePanelAdapter
      - - com.here.msdkui.routing.SimpleTransportModePanelAdapter

-     public class SimpleTransportModePanelAdapter
      extends TransportModePanelAdapter

  A pre-defined adapter class for `TransportModePanel` to show a `TabLayout` structure displaying all possible transport modes with icons.

- - ### Field Summary

    - ### Fields inherited from class androidx.fragment.app.FragmentStatePagerAdapter

      `BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT, BEHAVIOR_SET_USER_VISIBLE_HINT`

    - ### Fields inherited from class androidx.viewpager.widget.PagerAdapter

      `POSITION_NONE, POSITION_UNCHANGED`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SimpleTransportModePanelAdapter(android.content.Context context)` Constructs a new instance using all supported `RouteOptions.TransportMode` elements.
    `SimpleTransportModePanelAdapter(android.content.Context context, java.util.List<com.here.android.mpa.routing.RouteOptions.TransportMode> transportModes)` Constructs a new instance using the given list of `RouteOptions.TransportMode` elements.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `androidx.fragment.app.Fragment` | `getContent(com.here.android.mpa.routing.RouteOptions.TransportMode mode)` Gets the fragment of `TransportModePanel`.
    `TabView` | `getCustomTabView(com.here.android.mpa.routing.RouteOptions.TransportMode mode)` Gets a custom `TabView` with drawable icons which can be used to add labels by calling `TabView.setLabel(String)` in the respective switch statements.
    `TabView` | `getTabCustomView(com.here.android.mpa.routing.RouteOptions.TransportMode mode)` Deprecated. Please use `getCustomTabView(com.here.android.mpa.routing.RouteOptions.TransportMode)` instead.
    `boolean` | `isContentVisible()` Indicates whether the content is visible.

    - ### Methods inherited from class com.here.msdkui.routing.TransportModePanelAdapter

      `getCount, getItem, getItemPosition, getPageTitle, getTabView, getTransportModes, setTransportModes`

    - ### Methods inherited from class androidx.fragment.app.FragmentStatePagerAdapter

      `destroyItem, finishUpdate, instantiateItem, isViewFromObject, restoreState, saveState, setPrimaryItem, startUpdate`

    - ### Methods inherited from class androidx.viewpager.widget.PagerAdapter

      `destroyItem, finishUpdate, getPageWidth, instantiateItem, notifyDataSetChanged, registerDataSetObserver, setPrimaryItem, startUpdate, unregisterDataSetObserver`

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

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

- - ### Constructor Detail

    - #### SimpleTransportModePanelAdapter

          public SimpleTransportModePanelAdapter(android.content.Context context)

      Constructs a new instance using all supported `RouteOptions.TransportMode` elements.
      Parameters:
        `context` - the required `Context`.

    - #### SimpleTransportModePanelAdapter

          public SimpleTransportModePanelAdapter(android.content.Context context,
                                                 java.util.List<com.here.android.mpa.routing.RouteOptions.TransportMode> transportModes)

      Constructs a new instance using the given list of `RouteOptions.TransportMode` elements.
      Parameters:
        `context` - the required `Context`.
        `transportModes` - a list of `RouteOptions.TransportMode` elements.

  - ### Method Detail

    - #### getContent

          public androidx.fragment.app.Fragment getContent(com.here.android.mpa.routing.RouteOptions.TransportMode mode)

      Description copied from class: `TransportModePanelAdapter`
      Gets the fragment of `TransportModePanel`.

      If you don't want to display the content and only want to have a `TabView` in `TransportModePanel`, please return null and return false from `TransportModePanelAdapter.isContentVisible()` method.

      Specified by:
        `getContent` in class `TransportModePanelAdapter`
      Parameters:
        `mode` - the `RouteOptions.TransportMode`.
      Returns:
        the fragment of the panel hosting the content.

    - #### getTabCustomView

          @Deprecated
          public TabView getTabCustomView(com.here.android.mpa.routing.RouteOptions.TransportMode mode)

      Deprecated. Please use `getCustomTabView(com.here.android.mpa.routing.RouteOptions.TransportMode)` instead.
      Gets a custom `TabView` with drawable icons which can be used to add labels by calling `TabView.setLabel(String)` in the respective switch statements.
      Specified by:
        `getTabCustomView` in class `TransportModePanelAdapter`
      Parameters:
        `mode` - the `RouteOptions.TransportMode`.
      Returns:
        the `TabView` that is used to represent the given transport mode.

    - #### getCustomTabView

          public TabView getCustomTabView(com.here.android.mpa.routing.RouteOptions.TransportMode mode)

      Gets a custom `TabView` with drawable icons which can be used to add labels by calling `TabView.setLabel(String)` in the respective switch statements.
      Specified by:
        `getCustomTabView` in class `TransportModePanelAdapter`
      Parameters:
        `mode` - the `RouteOptions.TransportMode`.
      Returns:
        the `TabView` that is used to represent the given transport mode.

    - #### isContentVisible

          public boolean isContentVisible()

      Description copied from class: `TransportModePanelAdapter`
      Indicates whether the content is visible. This is responsible for showing the fragment hosting the content for a `RouteOptions.TransportMode` in the `TransportModePanel`. If the method returns false, the method `TransportModePanelAdapter.getItem(int)` will be ignored.
      Specified by:
        `isContentVisible` in class `TransportModePanelAdapter`
      Returns:
        true if content should be visible, false will hide the content.