Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release/2.7.4 #125

Merged
merged 2 commits into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
### 2.7.4
* Fix: Inpage text is not appropriate when the size is recommended
* Fix: Inpage text for on-boarding user has 2 patterns at random

### 2.7.3
* Fix: Inpage doesn’t recommend anything after coming back to PDP from Comparison screen
* Fix: Inpage text for on-boarding user has 2 patterns at random
* Fix: Inpage shows different size from that VS widget shows
* Fix: Body data tuning is not saved once closing the widget

Expand Down
12 changes: 6 additions & 6 deletions README-COMPOSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,15 @@ In your app `build.gradle` file, add the following dependencies:

```groovy
dependencies {
implementation 'com.virtusize.android:virtusize:2.7.3'
implementation 'com.virtusize.android:virtusize:2.7.4'
}
```

- Kotlin (build.gradle.kts)

```kotlin
dependencies {
implementation("com.virtusize.android:virtusize:2.7.3")
implementation("com.virtusize.android:virtusize:2.7.4")
}
```

Expand Down Expand Up @@ -354,15 +354,15 @@ There are two types of InPage in our Virtusize SDK.
There are two default design variations.

| Teal Theme | Black Theme |
| :----------------------------------------------------------: | :----------------------------------------------------------: |
| :----------------------------------------------------------: | :----------------------------------------------------------: |
| ![InPageStandardTeal](https://user-images.githubusercontent.com/7802052/92672035-b9e6cd00-f352-11ea-9e9e-5385a19e96da.png) | ![InPageStandardBlack](https://user-images.githubusercontent.com/7802052/92672031-b81d0980-f352-11ea-8b7a-564dd6c2a7f1.png) |

- ##### Layout Variations

Here are some possible layouts

| 1 thumbnail + 2 lines of message | 2 thumbnails + 2 lines of message |
| :----------------------------------------------------------: | :----------------------------------------------------------: |
| :----------------------------------------------------------: | :----------------------------------------------------------: |
| ![1 thumbnail + 2 lines of message](https://user-images.githubusercontent.com/7802052/97399368-5e879300-1930-11eb-8b77-b49e06813550.png) | ![2 thumbnails + 2 lines of message](https://user-images.githubusercontent.com/7802052/97399370-5f202980-1930-11eb-9a2d-7b71714aa7b4.png) |
| **1 thumbnail + 1 line of message** | **2 animated thumbnails + 2 lines of message** |
| ![1 thumbnail + 1 line of message](https://user-images.githubusercontent.com/7802052/97399373-5f202980-1930-11eb-81fe-9946b656eb4c.png) | ![2 animated thumbnails + 2 lines of message](https://user-images.githubusercontent.com/7802052/97399355-59c2df00-1930-11eb-8a52-292956b8762d.gif) |
Expand Down Expand Up @@ -443,13 +443,13 @@ for layouts where customers are browsing product images and size tables.
There are two default design variations.

| Teal Theme | Black Theme |
| :----------------------------------------------------------: | :----------------------------------------------------------: |
| :----------------------------------------------------------: | :----------------------------------------------------------: |
| ![InPageMiniTeal](https://user-images.githubusercontent.com/7802052/92672234-2d88da00-f353-11ea-99d9-b9e9b6aa5620.png) | ![InPageMiniBlack](https://user-images.githubusercontent.com/7802052/92672232-2c57ad00-f353-11ea-80f6-55a9c72fb0b5.png) |

- ##### Recommended Placements

| Underneath the product image | Underneath or near the size table |
| :----------------------------------------------------------: | :----------------------------------------------------------: |
| :----------------------------------------------------------: | :----------------------------------------------------------: |
| <img src="https://user-images.githubusercontent.com/7802052/92672261-3c6f8c80-f353-11ea-995c-ede56e0aacc3.png" /> | <img src="https://user-images.githubusercontent.com/7802052/92672266-40031380-f353-11ea-8f63-a67c9cf46c68.png" /> |

- ##### Default Fonts
Expand Down
12 changes: 6 additions & 6 deletions README-JP.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,15 @@ In your appの`build.gradle`ファイルに下記のdependencyを追加

```groovy
dependencies {
implementation 'com.virtusize.android:virtusize:2.7.3'
implementation 'com.virtusize.android:virtusize:2.7.4'
}
```

- Kotlin (build.gradle.kts)

```kotlin
dependencies {
implementation("com.virtusize.android:virtusize:2.7.3")
implementation("com.virtusize.android:virtusize:2.7.4")
}
```

Expand Down Expand Up @@ -521,15 +521,15 @@ Virtusize SDKには2種類のInPageがあります。
デフォルトデザインは2種類あります。

| Teal Theme | Black Theme |
| :----------------------------------------------------------: | :----------------------------------------------------------: |
| :----------------------------------------------------------: | :----------------------------------------------------------: |
| ![InPageStandardTeal](https://user-images.githubusercontent.com/7802052/92672035-b9e6cd00-f352-11ea-9e9e-5385a19e96da.png) | ![InPageStandardBlack](https://user-images.githubusercontent.com/7802052/92672031-b81d0980-f352-11ea-8b7a-564dd6c2a7f1.png) |

- ##### レイアウトのバリエーション

設定可能なレイアウト例

| 1 thumbnail + 2 lines of message | 2 thumbnails + 2 lines of message |
| :----------------------------------------------------------: | :----------------------------------------------------------: |
| :----------------------------------------------------------: | :----------------------------------------------------------: |
| ![1 thumbnail + 2 lines of message](https://user-images.githubusercontent.com/7802052/97399368-5e879300-1930-11eb-8b77-b49e06813550.png) | ![2 thumbnails + 2 lines of message](https://user-images.githubusercontent.com/7802052/97399370-5f202980-1930-11eb-9a2d-7b71714aa7b4.png) |
| **1 thumbnail + 1 line of message** | **2 animated thumbnails + 2 lines of message** |
| ![1 thumbnail + 1 line of message](https://user-images.githubusercontent.com/7802052/97399373-5f202980-1930-11eb-81fe-9946b656eb4c.png) | ![2 animated thumbnails + 2 lines of message](https://user-images.githubusercontent.com/7802052/97399355-59c2df00-1930-11eb-8a52-292956b8762d.gif) |
Expand Down Expand Up @@ -643,13 +643,13 @@ Virtusize SDKには2種類のInPageがあります。
2種類のでフォルトデザインを用意しています。

| Teal Theme | Black Theme |
| :----------------------------------------------------------: | :----------------------------------------------------------: |
| :----------------------------------------------------------: | :----------------------------------------------------------: |
| ![InPageMiniTeal](https://user-images.githubusercontent.com/7802052/92672234-2d88da00-f353-11ea-99d9-b9e9b6aa5620.png) | ![InPageMiniBlack](https://user-images.githubusercontent.com/7802052/92672232-2c57ad00-f353-11ea-80f6-55a9c72fb0b5.png) |

- ##### 推奨設置箇所

| Underneath the product image | Underneath or near the size table |
| :----------------------------------------------------------: | :----------------------------------------------------------: |
| :----------------------------------------------------------: | :----------------------------------------------------------: |
| <img src="https://user-images.githubusercontent.com/7802052/92672261-3c6f8c80-f353-11ea-995c-ede56e0aacc3.png" /> | <img src="https://user-images.githubusercontent.com/7802052/92672266-40031380-f353-11ea-8f63-a67c9cf46c68.png" /> |

- ##### デフォルトのフォント
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,15 @@ In your app `build.gradle` file, add the following dependencies:

```groovy
dependencies {
implementation 'com.virtusize.android:virtusize:2.7.3'
implementation 'com.virtusize.android:virtusize:2.7.4'
}
```

- Kotlin (build.gradle.kts)

```kotlin
dependencies {
implementation("com.virtusize.android:virtusize:2.7.3")
implementation("com.virtusize.android:virtusize:2.7.4")
}
```

Expand Down Expand Up @@ -521,15 +521,15 @@ There are two types of InPage in our Virtusize SDK.
There are two default design variations.

| Teal Theme | Black Theme |
| :----------------------------------------------------------: | :----------------------------------------------------------: |
| :----------------------------------------------------------: | :----------------------------------------------------------: |
| ![InPageStandardTeal](https://user-images.githubusercontent.com/7802052/92672035-b9e6cd00-f352-11ea-9e9e-5385a19e96da.png) | ![InPageStandardBlack](https://user-images.githubusercontent.com/7802052/92672031-b81d0980-f352-11ea-8b7a-564dd6c2a7f1.png) |

- ##### Layout Variations

Here are some possible layouts

| 1 thumbnail + 2 lines of message | 2 thumbnails + 2 lines of message |
| :----------------------------------------------------------: | :----------------------------------------------------------: |
| :----------------------------------------------------------: | :----------------------------------------------------------: |
| ![1 thumbnail + 2 lines of message](https://user-images.githubusercontent.com/7802052/97399368-5e879300-1930-11eb-8b77-b49e06813550.png) | ![2 thumbnails + 2 lines of message](https://user-images.githubusercontent.com/7802052/97399370-5f202980-1930-11eb-9a2d-7b71714aa7b4.png) |
| **1 thumbnail + 1 line of message** | **2 animated thumbnails + 2 lines of message** |
| ![1 thumbnail + 1 line of message](https://user-images.githubusercontent.com/7802052/97399373-5f202980-1930-11eb-81fe-9946b656eb4c.png) | ![2 animated thumbnails + 2 lines of message](https://user-images.githubusercontent.com/7802052/97399355-59c2df00-1930-11eb-8a52-292956b8762d.gif) |
Expand Down Expand Up @@ -641,13 +641,13 @@ for layouts where customers are browsing product images and size tables.
There are two default design variations.

| Teal Theme | Black Theme |
| :----------------------------------------------------------: | :----------------------------------------------------------: |
| :----------------------------------------------------------: | :----------------------------------------------------------: |
| ![InPageMiniTeal](https://user-images.githubusercontent.com/7802052/92672234-2d88da00-f353-11ea-99d9-b9e9b6aa5620.png) | ![InPageMiniBlack](https://user-images.githubusercontent.com/7802052/92672232-2c57ad00-f353-11ea-80f6-55a9c72fb0b5.png) |

- ##### Recommended Placements

| Underneath the product image | Underneath or near the size table |
| :----------------------------------------------------------: | :----------------------------------------------------------: |
| :----------------------------------------------------------: | :----------------------------------------------------------: |
| <img src="https://user-images.githubusercontent.com/7802052/92672261-3c6f8c80-f353-11ea-995c-ede56e0aacc3.png" /> | <img src="https://user-images.githubusercontent.com/7802052/92672266-40031380-f353-11ea-8f63-a67c9cf46c68.png" /> |

- ##### Default Fonts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ object Constants {
const val TARGET_SDK = 34

// Update versionName when publishing a new release
const val VERSION_NAME = "2.7.3"
const val VERSION_NAME = "2.7.4"
const val GROUP_ID = "com.virtusize.android"
}
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ material = "1.12.0"
nextPublish = "1.1.0"
robolectric = "4.13"
truth = "1.4.4"
virtusize = "2.7.3"
virtusize = "2.7.4"
virtusizeAuth = "1.0.6"

[libraries]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package com.virtusize.android.data.local

import java.lang.UnsupportedOperationException

@JvmInline
value class StoreId(val value: Int)

enum class StoreName(val value: String) {
UNITED_ARROWS("united_arrows"),
}

object VirtusizeStoreRepository {
private val storeMap: Map<StoreName, StoreId> =
mapOf(
StoreName.UNITED_ARROWS to StoreId(99),
)

fun getStoreId(storeName: StoreName): StoreId = storeMap[storeName] ?: throw UnsupportedOperationException("Store name not found")
}

val StoreId?.isUnitedArrows: Boolean
get() = this?.value == VirtusizeStoreRepository.getStoreId(StoreName.UNITED_ARROWS).value
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
package com.virtusize.android.data.remote

import android.content.Context
import com.virtusize.android.data.local.SizeComparisonRecommendedSize
import com.virtusize.android.data.local.VirtusizeLanguage
import com.virtusize.android.data.local.isUnitedArrows
import com.virtusize.android.network.VirtusizeApi
import com.virtusize.android.util.ConfigurationUtils
import com.virtusize.android.util.I18nConstants

/**
* This class wraps the i18n localization texts
*/
data class I18nLocalization(
val language: VirtusizeLanguage?,
val defaultAccessoryText: String,
val hasProductAccessoryTopText: String,
val hasProductAccessoryBottomText: String,
Expand All @@ -16,10 +22,11 @@ data class I18nLocalization(
val oneSizeCloseBottomText: String,
val oneSizeSmallerBottomText: String,
val oneSizeLargerBottomText: String,
val bodyProfileOneSizeText: String,
val oneSizeWillFitResultText: String,
val sizeComparisonMultiSizeText: String,
val bodyProfileMultiSizeText: String,
val defaultNoDataText: String,
val willFitResultText: String,
val willNotFitResultText: String,
val bodyDataEmptyText: String,
) {
enum class TrimType {
ONELINE,
Expand Down Expand Up @@ -61,8 +68,19 @@ data class I18nLocalization(
/**
* Gets the recommendation text for a multi-size product based on a user body profile
*/
internal fun getMultiSizeBodyProfileText(bodyProfileRecommendedSizeName: String): String {
return "$bodyProfileMultiSizeText ${I18nConstants.BOLD_START_PLACEHOLDER}" +
internal fun getMultiSizeBodyProfileText(
context: Context,
bodyProfileRecommendedSizeName: String,
): String {
val configuredContext = ConfigurationUtils.getConfiguredContext(context, language)
// Override the willFitResultText for United Arrows
val adjustedWillFitResultText =
if (VirtusizeApi.currentStoreId.isUnitedArrows) {
configuredContext.getString(com.virtusize.android.core.R.string.inpage_will_fit_result_text_united_arrows)
} else {
willFitResultText
}
return "$adjustedWillFitResultText ${I18nConstants.BOLD_START_PLACEHOLDER}" +
"$bodyProfileRecommendedSizeName${I18nConstants.BOLD_END_PLACEHOLDER}"
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.virtusize.android.data.remote

import android.content.Context
import com.virtusize.android.data.local.SizeComparisonRecommendedSize
import com.virtusize.android.util.dpInPx

Expand Down Expand Up @@ -36,6 +37,7 @@ data class Product(
* @return the InPage text
*/
fun getRecommendationText(
context: Context,
i18nLocalization: I18nLocalization,
sizeComparisonRecommendedSize: SizeComparisonRecommendedSize?,
bodyProfileRecommendedSizeName: String?,
Expand All @@ -44,12 +46,13 @@ data class Product(
isAccessory() -> accessoryText(i18nLocalization, sizeComparisonRecommendedSize)
sizes.size == 1 ->
oneSizeText(
i18nLocalization,
sizeComparisonRecommendedSize,
bodyProfileRecommendedSizeName,
i18nLocalization = i18nLocalization,
sizeComparisonRecommendedSize = sizeComparisonRecommendedSize,
bodyProfileRecommendedSizeName = bodyProfileRecommendedSizeName,
)
else ->
multiSizeText(
context = context,
i18nLocalization,
sizeComparisonRecommendedSize,
bodyProfileRecommendedSizeName,
Expand Down Expand Up @@ -88,29 +91,33 @@ data class Product(
bodyProfileRecommendedSizeName: String?,
): String {
bodyProfileRecommendedSizeName?.let {
return i18nLocalization.bodyProfileOneSizeText
return i18nLocalization.oneSizeWillFitResultText
}
sizeComparisonRecommendedSize?.let {
return i18nLocalization.getOneSizeProductComparisonText(it)
}
return i18nLocalization.defaultNoDataText
return i18nLocalization.bodyDataEmptyText
}

/**
* Gets the text for a multi-size product
*/
private fun multiSizeText(
context: Context,
i18nLocalization: I18nLocalization,
sizeComparisonRecommendedSize: SizeComparisonRecommendedSize?,
bodyProfileRecommendedSizeName: String?,
): String {
bodyProfileRecommendedSizeName?.let {
return i18nLocalization.getMultiSizeBodyProfileText(it)
return i18nLocalization.getMultiSizeBodyProfileText(
context = context,
bodyProfileRecommendedSizeName = bodyProfileRecommendedSizeName,
)
}
sizeComparisonRecommendedSize?.bestStoreProductSize?.name?.let {
return i18nLocalization.getMultiSizeProductComparisonText(it)
}
return i18nLocalization.defaultNoDataText
return i18nLocalization.bodyDataEmptyText
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package com.virtusize.android.network
import android.net.Uri
import com.virtusize.android.data.local.BodyProfileRecommendedSizeParams
import com.virtusize.android.data.local.I18N_URL
import com.virtusize.android.data.local.StoreId
import com.virtusize.android.data.local.VirtusizeEnvironment
import com.virtusize.android.data.local.VirtusizeEvent
import com.virtusize.android.data.local.VirtusizeLanguage
Expand Down Expand Up @@ -49,15 +50,15 @@ data class ApiRequest(
* @param userId the user ID that is unique from the client system
*/
object VirtusizeApi {
const val DEFAULT_AOYAMA_VERSION = "3.3.1"
const val DEFAULT_AOYAMA_VERSION = "3.3.6"

private var environment = VirtusizeEnvironment.GLOBAL
private lateinit var apiKey: String

var currentUserId: String? = null
private set

var currentStoreId: String? = null
var currentStoreId: StoreId? = null
private set

/**
Expand All @@ -80,8 +81,8 @@ object VirtusizeApi {
currentUserId = userId
}

fun setStoreId(storeId: Int) {
currentStoreId = storeId.toString()
fun setStoreId(storeId: StoreId) {
currentStoreId = storeId
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ class VirtusizeApiTask(
VirtusizeApi.currentStoreId?.let { storeId ->
setRequestProperty(
HEADER_VS_STORE_ID,
storeId,
storeId.value.toString(),
)
}

Expand Down
Loading