-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat : MobileWebMode 때 url 변경을 체크 가능케함
1. IamPortMobileModeWebViewClient 상속해서 사용 2. LiveData mobileWebModeShouldOverrideUrlLoading observe 해서 사용 refactor : example 앱 gradle update fix : bankpay 앱 종료시 데이터 nullable 처리
- Loading branch information
Showing
23 changed files
with
203 additions
and
91 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
17 changes: 17 additions & 0 deletions
17
app/src/main/java/com/iamport/sampleapp/MyWebViewClient.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,17 @@ | ||
package com.iamport.sampleapp | ||
|
||
import android.util.Log | ||
import android.webkit.WebResourceRequest | ||
import android.webkit.WebView | ||
import com.iamport.sdk.domain.strategy.webview.IamPortMobileModeWebViewClient | ||
|
||
open class MyWebViewClient : IamPortMobileModeWebViewClient() { | ||
|
||
override fun shouldOverrideUrlLoading(view: WebView?, request: WebResourceRequest?): Boolean { | ||
|
||
Log.i("MyWebViewClient", "updated webview url ${view?.url}") | ||
|
||
return super.shouldOverrideUrlLoading(view, request) | ||
} | ||
|
||
} |
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
14 changes: 0 additions & 14 deletions
14
sdk/src/main/java/com/iamport/sdk/domain/strategy/webview/CertificationWebViewStrategy.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,18 +1,4 @@ | ||
package com.iamport.sdk.domain.strategy.webview | ||
|
||
import android.net.Uri | ||
import android.os.Build | ||
import android.webkit.WebResourceError | ||
import android.webkit.WebResourceRequest | ||
import android.webkit.WebView | ||
import androidx.annotation.RequiresApi | ||
import com.iamport.sdk.data.sdk.Payment | ||
import com.iamport.sdk.domain.strategy.base.BaseWebViewStrategy | ||
import com.iamport.sdk.domain.utils.Event | ||
import com.iamport.sdk.domain.utils.Util | ||
import com.orhanobut.logger.Logger.d | ||
import org.koin.core.component.KoinApiExtension | ||
|
||
|
||
@KoinApiExtension | ||
open class CertificationWebViewStrategy : WebViewStrategy() |
23 changes: 23 additions & 0 deletions
23
sdk/src/main/java/com/iamport/sdk/domain/strategy/webview/IamPortMobileModeWebViewClient.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,23 @@ | ||
package com.iamport.sdk.domain.strategy.webview | ||
|
||
import android.os.Build | ||
import android.webkit.WebResourceRequest | ||
import android.webkit.WebView | ||
import androidx.annotation.RequiresApi | ||
import com.iamport.sdk.domain.utils.Event | ||
import com.orhanobut.logger.Logger | ||
|
||
open class IamPortMobileModeWebViewClient : NiceTransWebViewStrategy() { | ||
|
||
@RequiresApi(Build.VERSION_CODES.LOLLIPOP) | ||
override fun shouldOverrideUrlLoading(view: WebView?, request: WebResourceRequest?): Boolean { | ||
|
||
request?.url?.let { | ||
// bus.changeUrl.postValue(Event(it)) | ||
bus.changeUrl.value = (Event(it)) | ||
} | ||
|
||
return super.shouldOverrideUrlLoading(view, request) | ||
} | ||
|
||
} |
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
Oops, something went wrong.