-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(app): fix issue with external link redirection in android app
- Loading branch information
1 parent
ebd9253
commit b18120b
Showing
6 changed files
with
36 additions
and
62 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
21 changes: 21 additions & 0 deletions
21
app/app/src/main/java/me/rxresu/app/CustomWebViewClient.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,21 @@ | ||
package me.rxresu.app | ||
|
||
import android.content.Intent | ||
import android.net.Uri | ||
import android.webkit.WebView | ||
import android.webkit.WebViewClient | ||
|
||
internal class CustomWebViewClient : WebViewClient() { | ||
override fun shouldOverrideUrlLoading(view: WebView, url: String): Boolean { | ||
val hostname = "rxresu.me" | ||
val uri = Uri.parse(url) | ||
|
||
if (uri.host != null && uri.host!!.endsWith(hostname)) { | ||
return false | ||
} | ||
|
||
view.context.startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,6 @@ | ||
<resources> | ||
<style name="Theme.ReactiveResume" parent="Theme.MaterialComponents.DayNight.DarkActionBar" /> | ||
|
||
<style name="Theme.ReactiveResume.NoActionBar"> | ||
<style name="AppTheme" parent="Theme.MaterialComponents.DayNight.DarkActionBar"> | ||
<item name="windowActionBar">false</item> | ||
<item name="windowNoTitle">true</item> | ||
</style> | ||
|
||
<style name="Theme.ReactiveResume.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" /> | ||
|
||
<style name="Theme.ReactiveResume.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" /> | ||
</resources> |