Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package to.dev.dev_android.view.main.view

import android.content.Context
import android.content.Intent
import android.graphics.Color
import android.net.Uri
import android.os.Build
import android.view.View
Expand All @@ -14,6 +15,7 @@ import to.dev.dev_android.databinding.ActivityMainBinding
class CustomWebViewClient(private val context: Context, private val binding: ActivityMainBinding) : WebViewClient() {

private val overrideUrlList = listOf(
"://dev.to",
"api.twitter.com/oauth",
"api.twitter.com/account/login_verification",
"github.com/login",
Expand All @@ -37,21 +39,17 @@ class CustomWebViewClient(private val context: Context, private val binding: Act
}
}

if (url.contains("://dev.to")) {
return false
} else {
for (i in 0 until overrideUrlList.size) {
if (url.contains(overrideUrlList[i])) {
return false
}
for (i in 0 until overrideUrlList.size) {
if (url.contains(overrideUrlList[i])) {
return false
}
val builder = CustomTabsIntent.Builder()
builder.setToolbarColor(-0x1000000)
val customTabsIntent = builder.build()
customTabsIntent.launchUrl(context, Uri.parse(url))
return true
}

val builder = CustomTabsIntent.Builder()
builder.setToolbarColor(Color.parseColor("#00000000"))
val customTabsIntent = builder.build()
customTabsIntent.launchUrl(context, Uri.parse(url))
return true
}

private fun openBrowser(url: String): Boolean {
Expand Down
4 changes: 0 additions & 4 deletions baseui/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,13 @@ apply plugin: 'kotlin-kapt'
android {
compileSdkVersion 28



defaultConfig {
minSdkVersion 19
targetSdkVersion 28
versionCode 1
versionName "1.0"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

}

buildTypes {
Expand Down Expand Up @@ -49,5 +46,4 @@ dependencies {
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'

}
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
ext.kotlin_version = '1.3.30'
ext.kotlin_version = '1.3.31'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.0'
classpath 'com.android.tools.build:gradle:3.4.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

// NOTE: Do not place your application dependencies here; they belong
Expand All @@ -24,7 +24,7 @@ allprojects {

tasks {
wrapper {
gradleVersion = "5.4"
gradleVersion = "5.4.1"
distributionType = Wrapper.DistributionType.ALL
}
}
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
18 changes: 17 additions & 1 deletion gradlew

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 17 additions & 1 deletion gradlew.bat

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.