1 min read

Swipe to like

The Swipe to like SDK is where your customers can see a stack of products to be added to their wishlist.

Without any customisation, Swipe to like screen looks like this:

Swipe to like screen
Swipe to like screen

Start using Swipe to like SDK

To start using it, you need to:

  1. Add the feature module to your build.gradle
    implementation ("com.poqstudio:catalogue.swipetolike:$VERSION_NAME")
  2. Open the screen using SwipeToLikeActivity or PoqSwipeToLikeFragment. Swipe to like screen accepts any SearchType as a parameter, you can use SwipeToLikeActivity.getStartIntent to get the appropriate Intent or poqSwipeToLikeFragment.setArgs to set the SearchType on the fragment.

If you want to include Swipe to like on the main screen as a new bottom tab, you need to:

  1. Override BottomNavigationItemFactory and create the appropriate BottomNavigationItem:
    class CustomBottomNavigationItemFactory(
    decorator: BottomNavigationItemFactory
    ) : BottomNavigationItemFactory by decorator {
    override fun createItemFive(): BottomNavigationItem {
    return BottomNavigationItem(
    R.string.title_swipe_to_like,
    R.drawable.ic_swipe_to_like
    )
    }
    }
  2. Override BottomNavigationFragmentFactory and create the fragment setting the SearchType:
    class CustomBottomNavigationFragmentFactory(
    decorator: BottomNavigationFragmentFactory
    ) : BottomNavigationFragmentFactory by decorator {
    override fun createFragmentFive(): BottomNavigationFragment {
    return PoqSwipeToLikeFragment().apply {
    setArgs(SearchType.Keyword("example"))
    }
    }
    }

Swipe to like SDK is composed of these modules:

Koin modules

Swipe to like SDK dependencies are injected using Koin. Swipe to like SDK injects automatically all the necessary Koin modules when you include the feature module into your project. These are the Koin modules included:

  • swipeToLikeDataModule
  • swipeToLikeDomainModule
  • swipeToLikePresentationModule

Swipe to like SDK provides these deep links:

  • Keyword: it opens SwipeToLikeActivity with SearchType.Keyword.
  • Category: it opens SwipeToLikeActivity with SearchType.Category.
  • Default: it does nothing by default but it allows you to customise it to open Swipe to like with your own configuration.

Since Swipe to like SDK does not know where it is being display, the deep links open the activity by default. If you are displaying Swipe to like in a different way, such as a bottom tab, you need to customise SwipeToLikeAdditionalDeepLinkNavigator