1
0
mirror of https://github.com/TwidereProject/Twidere-Android synced 2025-01-05 13:09:48 +01:00

improved web link handler for uppercase links

close #702
This commit is contained in:
Mariotaku Lee 2017-02-07 17:01:03 +08:00
parent 213be5fa25
commit 240d8b1d39
No known key found for this signature in database
GPG Key ID: 15C10F89D7C33535
2 changed files with 3 additions and 1 deletions

View File

@ -14,6 +14,7 @@ import org.mariotaku.twidere.model.UserKey
import org.mariotaku.twidere.util.Analyzer
import org.mariotaku.twidere.util.IntentUtils
import org.mariotaku.twidere.util.Utils
import java.util.*
class WebLinkHandlerActivity : Activity() {
@ -27,7 +28,7 @@ class WebLinkHandlerActivity : Activity() {
return
}
val (handledIntent, handledSuccessfully) = when (uri.host) {
val (handledIntent, handledSuccessfully) = when (uri.host.toLowerCase(Locale.US)) {
"twitter.com", "www.twitter.com", "mobile.twitter.com" -> handleTwitterLink(regulateTwitterUri(uri))
"fanfou.com" -> handleFanfouLink(uri)
"twidere.org", "twidere.mariotaku.org" -> handleTwidereExternalLink(uri)

View File

@ -152,6 +152,7 @@ open class OnLinkClickHandler(
return
}
val builder = CustomTabsIntent.Builder()
builder.addDefaultShareMenuItem()
(ChameleonUtils.getActivity(context) as? Chameleon.Themeable)?.overrideTheme?.let { theme ->
builder.setToolbarColor(theme.colorToolbar)
}