Skip to content

Commit

Permalink
Codestyle and dependency upgrades (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
Harsh Shandilya authored and maestromac committed May 30, 2019
1 parent 7d5fd39 commit 100c7cd
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 22 deletions.
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
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
#!/usr/bin/env sh

#
# Copyright 2015 the original author or authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

##############################################################################
##
## Gradle start up script for UN*X
Expand Down Expand Up @@ -28,7 +44,7 @@ APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`

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

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
Expand Down
18 changes: 17 additions & 1 deletion gradlew.bat
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem http://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem

@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
Expand All @@ -14,7 +30,7 @@ set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

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

@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
Expand Down

0 comments on commit 100c7cd

Please sign in to comment.