-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MOB-3463
- Loading branch information
Showing
24 changed files
with
217 additions
and
161 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 5 additions & 17 deletions
22
...tssdk/src/main/java/com/glia/widgets/core/dialog/domain/ConfirmationDialogLinksUseCase.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,20 @@ | ||
package com.glia.widgets.core.dialog.domain | ||
|
||
import androidx.annotation.VisibleForTesting | ||
import com.glia.widgets.locale.LocaleString | ||
import com.glia.widgets.R | ||
import com.glia.widgets.core.dialog.model.Link | ||
import com.glia.widgets.core.dialog.model.ConfirmationDialogLinks | ||
import com.glia.widgets.locale.LocaleProvider | ||
|
||
internal class ConfirmationDialogLinksUseCase( | ||
private val localeProvider: LocaleProvider | ||
) { | ||
internal class ConfirmationDialogLinksUseCase { | ||
|
||
operator fun invoke(): ConfirmationDialogLinks { | ||
val link1Title = LocaleString(R.string.engagement_confirm_link1_text) | ||
val link1Url = localeProvider.getString(R.string.engagement_confirm_link1_url) | ||
val link1Url = LocaleString(R.string.engagement_confirm_link1_url) | ||
val link2Title = LocaleString(R.string.engagement_confirm_link2_text) | ||
val link2Url = localeProvider.getString(R.string.engagement_confirm_link2_url) | ||
val link2Url = LocaleString(R.string.engagement_confirm_link2_url) | ||
return ConfirmationDialogLinks( | ||
link1 = makeLink(link1Title, link1Url), | ||
link2 = makeLink(link2Title, link2Url) | ||
link1 = Link(link1Title, link1Url), | ||
link2 = Link(link2Title, link2Url) | ||
) | ||
} | ||
|
||
@VisibleForTesting | ||
fun makeLink(title: LocaleString, url: String?): Link? { | ||
if (url.isNullOrEmpty()) { | ||
return null | ||
} | ||
return Link(title, url) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
widgetssdk/src/main/java/com/glia/widgets/webbrowser/domain/GetUrlFromLinkUseCase.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package com.glia.widgets.webbrowser.domain | ||
|
||
import com.glia.widgets.core.dialog.model.Link | ||
import com.glia.widgets.locale.LocaleProvider | ||
|
||
internal interface GetUrlFromLinkUseCase { | ||
operator fun invoke(link: Link): String? | ||
} | ||
|
||
internal class GetUrlFromLinkUseCaseImpl( | ||
private val localeProvider: LocaleProvider | ||
) : GetUrlFromLinkUseCase { | ||
override operator fun invoke(link: Link): String? { | ||
val string = localeProvider.getString(link.url) | ||
if (string.isBlank()) { | ||
return null | ||
} | ||
return string | ||
} | ||
} |
Oops, something went wrong.