Skip to content

Releases: pixlee/android-sdk

A bug-fix of missing a Parcelable variable

26 Apr 21:30
f8f62a2
Compare
Choose a tag to compare

uploaderAdditionalFields: JSONObject was able to be passed to Activity and Fragment. This is fixed now.

Added PXLWidgetView having API, analytics, list , grid

16 Apr 01:56
f0b3c12
Compare
Choose a tag to compare

improvement: PXLPhotoProductView (similar to Lightbox)

  • Lifecycle, which is used to play&pause a video can be acquired from the view inside now.

A new view: PXLWidgetView (similar to Widget)

  • automatically fire APIs[api/v2/albums/from_sku, api/v2/albums/{album_id}/photos] to get and display photos
  • automatically fire Analytics[openedWidget, widgetVisible]
  • provide grid (2 and more grid columns) and list layouts

UI Options

List

  • turn infinite scroll on/off
  • turn auto video playing on/off: play a video located at the top of the list

Grid

  • Line Size between items
  • Header
    • Image URL: jpg / gif / png / webp / ect
    • Customizable text: can change the color and size of each charector using SpannableString

Added a new Demo project

  • This is to provide you a quick start and a demonstration of PXLWidgetView
  • its directory: /simpleapp
    • you can run the project from the IDE(Android Studio)
      Grid Mode ListMode

Added square_medium_url to PXLPhoto

12 Apr 00:08
e55ac7a
Compare
Choose a tag to compare

Added square_medium_url to PXLPhoto

Added fields of PXLPhoto and postMedia API

08 Apr 02:40
0924cdd
Compare
Choose a tag to compare

A new field of PXLPhoto

#!java
public JSONObject uploaderAdditionalFields;
  • uploaderAdditionalFields is from connectedUser that can be uploaded via pxlKtxAlbum.postMediaWithFile() or pxlKtxAlbum.postMediaWithURI.

New addional fields for uploading content

  • productSKUs: List // Optional
  • categoryNames: List // Optional
  • connectedUser: JSONObject // Optional

Example

  • Option 1: Upload an image file
    #!kotlin
    pxlKtxAlbum.postMediaWithFile(
        localMediaPath = "<local file path>",
        title = "uploaded from SDK-" + System.currentTimeMillis() + " using a file",
        email = "[email protected]",
        username = "replace this with your user name",
        approved = true,
        productSKUs = listOf("productA", "productB"), // Optional
        categoryNames = listOf("Clothing", "Shoes"),  // Optional
        connectedUser = JSONObject().apply { // Optional
            put("name", "sample name")
            put("age", 24)
            put("points", JSONArray().apply {
                put(10)
                put(20)
                put(35)
            })
        })
  • Option 2: Upload an image url
    #!kotlin
    pxlKtxAlbum.postMediaWithURI(
            photoURI = "<photo URI>",
            title = "uploaded from SDK-" + System.currentTimeMillis() + " using a file",
            email = "[email protected]",
            username = "replace this with your user name",
            approved = true,
            productSKUs = listOf("productA", "productB"), // Optional
            categoryNames = listOf("Clothing", "Shoes"),  // Optional
            connectedUser = JSONObject().apply { // Optional
                put("name", "Sample name")
                put("age", 24)
                put("points", JSONArray().apply {
                    put(10)
                    put(20)
                    put(35)
                })
            })

Added global region id & global Automatic Analytics

08 Feb 00:40
ae1fbeb
Compare
Choose a tag to compare

region id

  • setting up regionId can now be done globally in your application that extends Application.
  • if you use multi-region, you can set your region id here(see the example below) to get photos, a photo, and products available in the region.
#!kotlin
class YourApplication: Application {
    override fun onCreate() {
        super.onCreate()
        // initializing SDK
        PXLClient.initialize(<your api key>, <your secret key>)

        PXLClient.regionId = your region id <--- set it if you use multi-region.
    }
}

Automatic Analytics

  • Enabling Automatic Analytics can now be done globally.
  • If you want to enable auto-anlaytics, you need PXLClient.autoAnalyticsEnabled = true in your application that extends Application. Then, these PXLPhotoRecyclerView, PXLPhotoRecyclerViewInGrid and PXLPhotoProductView will fire analytics automatically in the right moments.

which Events are related to Automatic Analytics?

  • 'VisibleWidget' and 'OpenedWidget': PXLPhotoRecyclerView and PXLPhotoRecyclerViewInGrid
  • OpenedLightbox: PXLPhotoProductView

NOTICE: Please be aware that you need to remove your implementation of these analytics events you fire manually in your app. Because these views handle the events for you if you enable it by PXLClient.autoAnalyticsEnabled = true.

#!kotlin
class YourApplication: Application {
    override fun onCreate() {
        super.onCreate()
        // initializing SDK
        PXLClient.initialize(<your api key>, <your secret key>)

        PXLClient.autoAnalyticsEnabled = true <----- This activates this feature
        PXLClient.regionId = your region id <--- set it if you use multi-region.
    }
}

class YourActivityOrFrament: Activity or Fragment {
    // load this when you need
    func setup() {
        pxlPhotoProductView.setContent(...)
    }
}

Added automatic analytics to UI components

19 Jan 02:44
5353c91
Compare
Choose a tag to compare

This update is for those who use our UI components and want to avoid implementing as many analytics as possible.

UI components now have an option of firing analytics events automatically. FYI, loadmore has always been fired automatically on album class(Java: PXLAlbum, Kotlin: PXLKtxAlbum) when getting a list of photos.

However, for the analytics events such as actionClicked, addToCart, and conversion, you still need to manually implement it.

Supported automatic Analytics events

PXLPhotoRecyclerViewInGrid (similar to Widget)

  • VisibleWidget
  • OpenedWidget

PXLPhotoRecyclerView (similar to Widget)

  • VisibleWidget
  • OpenedWidget

PXLPhotoProductView (similar to Lightbox)

  • OpenLightbox

How to enable it?

PXLPhotoRecyclerViewInGrid

#!kotlin
// alternative: pxlPhotoRecyclerViewInGrid.enableAutoAnalytics(pxlKtxAlbum, "photowall") // newly added one
pxlPhotoRecyclerViewInGrid.enableAutoAnalytics(pxlKtxAlbum, PXLWidgetType.photowall) // newly added one
pxlPhotoRecyclerViewInGrid.initiate(...) // existing code, where  you set up the photo list data and customize UI elements.

PXLPhotoRecyclerView

#!kotlin
// alternative: pxlPhotoRecyclerView.enableAutoAnalytics(pxlKtxAlbum, "photowall") // newly added one
pxlPhotoRecyclerView.enableAutoAnalytics(pxlKtxAlbum, PXLWidgetType.photowall) // newly added one
pxlPhotoRecyclerView.initiate(...) // existing code, where  you set up the photo list data and customize UI elements.```

PXLPhotoProductView

#!kotlin
// set one of your region ids if you have.
val regionId: Int? = null
// alternative: pxlPhotoProductView.enableAutoAnalytics(regionId) // newly added one
pxlPhotoProductView.enableAutoAnalytics(regionId)// newly added one
pxlPhotoProductView.setContent(...) // existing code, where  you set up the photo data and customize UI elements.```

Added region id

23 Dec 03:18
09a07f9
Compare
Choose a tag to compare

This release is for those who have multi regions. You can now get photos from a specific region and differentiate analytics events by region.

initiation

#!Kotlin
val pxlKtxAlbum = PXLKtxAlbum(context)
val searchId = PXLKtxBaseAlbum.SearchId.Album("<your ALBUM ID>")
pxlKtxAlbum.params = PXLKtxBaseAlbum.Params(
     searchId = searchId
)
pxlKtxAlbum.params = PXLKtxBaseAlbum.Params(
    searchId = searchId,
    perPage = 30,
    filterOptions = PXLAlbumFilterOptions().apply {
        hasPermission = true
        hasProduct = true
        // ... there's more
    },
    sortOptions = PXLAlbumSortOptions().apply {
        sortType = PXLAlbumSortType.RECENCY
        descending = true
        // ... there's more.
    },
    regionId = <Optional: your region id(Int)>       //<-------------- HERE is where you need to add your region id (Optional). If you don't know your region ids, please ask your account manager to give you it. 
)

region id related APIs

Get the first page

#!Kotlin
val result = pxlKtxAlbum.getFirstPage()

Get the next pages

#!Kotlin
val result = pxlKtxAlbum.getNextPage()

Get PXLPhoto from default region

  • if you have multi regions, your default region is set on the server. to get more detail about your default region, please reach out your customer success manager
#!Kotlin.coroutines

val albumPhotoId:String = <one of your album photo ids>
val result:PXLPhoto = pxlKtxAlbum.getPhotoWithId(albumPhotoId)

Get a PXLPhoto from a region

  • before firing this, you must basically add region when setting up pxlKtxAlbum.params
#!Kotlin.coroutines

val albumPhotoId:String = <one of your album photo ids>
val result:PXLPhoto = pxlKtxAlbum.getPhotoFromRegion(albumPhotoId)

all analytics APIs are related to region id

  • Step 1: get through the initiation process at the top of this release note to set region id
  • Step 2: fire analytics APIs

UI Components

16 Nov 22:51
3c5791a
Compare
Choose a tag to compare

This is the same version from 1.5.0-rc02.
For more information please check the document.

Downgraded ExoPlayer from 2.12.1 to 2.8.2

12 Nov 14:37
Compare
Choose a tag to compare

Downgraded ExoPlayer from 2.12.1 to 2.8.2

Replaced the old video player with ExoPlayer

12 Nov 08:51
Compare
Choose a tag to compare

What's improved

  • ExoPlayer is now the video player in the SDK.
  • The video loading speed is faster.
  • The problem of content not displaying intermittently is fixed.
  • The issue of playing the video background is fixed.

What's changed

PXLPhotoProductView and PXLPhotoRecyclerView

Play and stop the video

  • Option 1: Automatic using androidx.lifecycle.Lifecycle(Jetpack)
    • You just update the SDK the this version, the SDK will work automatically.
  • Option 2: Manual (use this if you want to play, stop and release the video when you need)
    • we renamed from playVideo() to playVideoOnResume()
    • we renamed from stopVideo() to stopVideoOnPause()
    • we added playVideoOnStart()
    • we added stopVideoOnStop()

PXLPhotoView

  • we removed releaseAllVideos()
  • you use pxlPhotoView.playVideo() to play the video
  • you use pxlPhotoView.pauseVideo() to pause the video