Skip to content

Commit 100c7cd

Browse files
msfjarvismaestromac
authored andcommitted
Codestyle and dependency upgrades (#28)
1 parent 7d5fd39 commit 100c7cd

File tree

7 files changed

+48
-22
lines changed

7 files changed

+48
-22
lines changed

app/src/main/java/to/dev/dev_android/view/main/view/CustomWebViewClient.kt

+10-12
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package to.dev.dev_android.view.main.view
22

33
import android.content.Context
44
import android.content.Intent
5+
import android.graphics.Color
56
import android.net.Uri
67
import android.os.Build
78
import android.view.View
@@ -14,6 +15,7 @@ import to.dev.dev_android.databinding.ActivityMainBinding
1415
class CustomWebViewClient(private val context: Context, private val binding: ActivityMainBinding) : WebViewClient() {
1516

1617
private val overrideUrlList = listOf(
18+
"://dev.to",
1719
"api.twitter.com/oauth",
1820
"api.twitter.com/account/login_verification",
1921
"github.com/login",
@@ -37,21 +39,17 @@ class CustomWebViewClient(private val context: Context, private val binding: Act
3739
}
3840
}
3941

40-
if (url.contains("://dev.to")) {
41-
return false
42-
} else {
43-
for (i in 0 until overrideUrlList.size) {
44-
if (url.contains(overrideUrlList[i])) {
45-
return false
46-
}
42+
for (i in 0 until overrideUrlList.size) {
43+
if (url.contains(overrideUrlList[i])) {
44+
return false
4745
}
48-
val builder = CustomTabsIntent.Builder()
49-
builder.setToolbarColor(-0x1000000)
50-
val customTabsIntent = builder.build()
51-
customTabsIntent.launchUrl(context, Uri.parse(url))
52-
return true
5346
}
5447

48+
val builder = CustomTabsIntent.Builder()
49+
builder.setToolbarColor(Color.parseColor("#00000000"))
50+
val customTabsIntent = builder.build()
51+
customTabsIntent.launchUrl(context, Uri.parse(url))
52+
return true
5553
}
5654

5755
private fun openBrowser(url: String): Boolean {

baseui/build.gradle

-4
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,13 @@ apply plugin: 'kotlin-kapt'
66
android {
77
compileSdkVersion 28
88

9-
10-
119
defaultConfig {
1210
minSdkVersion 19
1311
targetSdkVersion 28
1412
versionCode 1
1513
versionName "1.0"
1614

1715
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
18-
1916
}
2017

2118
buildTypes {
@@ -49,5 +46,4 @@ dependencies {
4946
testImplementation 'junit:junit:4.12'
5047
androidTestImplementation 'androidx.test:runner:1.1.1'
5148
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
52-
5349
}

build.gradle

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
// Top-level build file where you can add configuration options common to all sub-projects/modules.
22

33
buildscript {
4-
ext.kotlin_version = '1.3.30'
4+
ext.kotlin_version = '1.3.31'
55
repositories {
66
google()
77
jcenter()
88
}
99
dependencies {
10-
classpath 'com.android.tools.build:gradle:3.4.0'
10+
classpath 'com.android.tools.build:gradle:3.4.1'
1111
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
1212

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

2525
tasks {
2626
wrapper {
27-
gradleVersion = "5.4"
27+
gradleVersion = "5.4.1"
2828
distributionType = Wrapper.DistributionType.ALL
2929
}
3030
}

gradle/wrapper/gradle-wrapper.jar

426 Bytes
Binary file not shown.
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4-all.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

gradlew

+17-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
#!/usr/bin/env sh
22

3+
#
4+
# Copyright 2015 the original author or authors.
5+
#
6+
# Licensed under the Apache License, Version 2.0 (the "License");
7+
# you may not use this file except in compliance with the License.
8+
# You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing, software
13+
# distributed under the License is distributed on an "AS IS" BASIS,
14+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
# See the License for the specific language governing permissions and
16+
# limitations under the License.
17+
#
18+
319
##############################################################################
420
##
521
## Gradle start up script for UN*X
@@ -28,7 +44,7 @@ APP_NAME="Gradle"
2844
APP_BASE_NAME=`basename "$0"`
2945

3046
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
31-
DEFAULT_JVM_OPTS='"-Xmx64m"'
47+
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
3248

3349
# Use the maximum available, or set MAX_FD != -1 to use that value.
3450
MAX_FD="maximum"

gradlew.bat

+17-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
@rem
2+
@rem Copyright 2015 the original author or authors.
3+
@rem
4+
@rem Licensed under the Apache License, Version 2.0 (the "License");
5+
@rem you may not use this file except in compliance with the License.
6+
@rem You may obtain a copy of the License at
7+
@rem
8+
@rem http://www.apache.org/licenses/LICENSE-2.0
9+
@rem
10+
@rem Unless required by applicable law or agreed to in writing, software
11+
@rem distributed under the License is distributed on an "AS IS" BASIS,
12+
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
@rem See the License for the specific language governing permissions and
14+
@rem limitations under the License.
15+
@rem
16+
117
@if "%DEBUG%" == "" @echo off
218
@rem ##########################################################################
319
@rem
@@ -14,7 +30,7 @@ set APP_BASE_NAME=%~n0
1430
set APP_HOME=%DIRNAME%
1531

1632
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
17-
set DEFAULT_JVM_OPTS="-Xmx64m"
33+
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
1834

1935
@rem Find java.exe
2036
if defined JAVA_HOME goto findJavaFromJavaHome

0 commit comments

Comments
 (0)