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
class MainPresenterImpl: MainPresenter { | |
override fun getData(): String { | |
return "data" | |
} | |
} |
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
interface MainPresenter { | |
fun getData(): String | |
} |
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
class MainActivity: AppCompatActivity() { | |
lateinit var mainPresenter: MainPresenter | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
// inject mainPresenter here | |
mainPresenter.getData() |
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
webView.webViewClient = object : WebViewClient() { | |
@RequiresApi(Build.VERSION_CODES.O) | |
override fun onRenderProcessGone( | |
view: WebView?, | |
detail: RenderProcessGoneDetail? | |
): Boolean { | |
if (view == webView && detail?.didCrash() == true) { | |
recreateWebView() |
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
webView.webViewClient = object : WebViewClient() { | |
override fun shouldOverrideUrlLoading( | |
view: WebView?, | |
request: WebResourceRequest? | |
): Boolean { | |
val url = request?.url.toString() | |
if (isDeepLinkURL(url)) { | |
redirectToNativePage(url) | |
return true |
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
webView.webViewClient = object : WebViewClient() { | |
override fun onPageStarted(view: WebView?, url: String?, favicon: Bitmap?) { | |
super.onPageStarted(view, url, favicon) | |
showLoading() | |
} | |
override fun onPageFinished(view: WebView?, url: String?) { | |
super.onPageFinished(view, url) | |
dismissLoading() | |
} |
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
webView.webViewClient = object : WebViewClient() { | |
override fun shouldOverrideUrlLoading( | |
view: WebView?, | |
request: WebResourceRequest? | |
): Boolean { | |
return super.shouldOverrideUrlLoading(view, request) | |
} | |
override fun onPageStarted(view: WebView?, url: String?, favicon: Bitmap?) { | |
super.onPageStarted(view, url, favicon) |
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
class MainActivity : AppCompatActivity() { | |
companion object { | |
private const val URL = "https://www.google.com" | |
} | |
private lateinit var webView: WebView | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) |
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
<androidx.constraintlayout.widget.ConstraintLayout | |
xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
tools:context=".MainActivity"> | |
<WebView | |
android:id="@+id/wv_main" |
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
io.reactivex.rxjava3.exceptions.UndeliverableException: The exception could not be delivered to the consumer because it has already canceled/disposed the flow or the exception has nowhere to go to begin with. Further reading: https://github.com/ReactiveX/RxJava/wiki/What's-different-in-2.0#error-handling | java.lang.Exception |