Kotlin 1.1 update.

This commit is contained in:
Erik C. Thauvin 2017-03-01 19:38:40 -08:00
parent f2c7019453
commit e5ada7422e
5 changed files with 24 additions and 11 deletions

View file

@ -0,0 +1,7 @@
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<option name="myLocal" value="true" />
<inspection_tool class="UnusedParameters" enabled="false" level="WARNING" enabled_by_default="false" />
</profile>
</component>

View file

@ -0,0 +1,7 @@
<component name="InspectionProjectProfileManager">
<settings>
<option name="PROJECT_PROFILE" value="Project Default" />
<option name="USE_PROJECT_PROFILE" value="true" />
<version value="1.0" />
</settings>
</component>

View file

@ -29,14 +29,14 @@ dependencies {
testCompile 'junit:junit:4.12'
compile 'com.android.support:support-v13:25.0.1'
compile 'com.android.support:appcompat-v7:25.0.1'
compile 'com.android.support:support-v13:25.2.0'
compile 'com.android.support:appcompat-v7:25.2.0'
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
compile 'org.jetbrains.anko:anko-sdk23:0.9.1'
compile 'org.jetbrains.anko:anko-appcompat-v7:0.9.1'
compile 'org.jetbrains.anko:anko-support-v4:0.9.1'
compile 'org.jetbrains.anko:anko-design:0.9.1'
compile 'com.android.support:design:25.0.1'
compile 'com.android.support:design:25.2.0'
compile group: 'com.google.code.gson', name: 'gson', version: '2.7'
// https://github.com/JakeWharton/ViewPagerIndicator
@ -51,7 +51,6 @@ dependencies {
}
repositories {
maven { url 'https://dl.bintray.com/jetbrains/anko/'}
mavenCentral()
maven { url "https://jitpack.io" }
}

View file

@ -76,9 +76,9 @@ class MainActivity : AppCompatActivity(), AnkoLogger {
val PAUSE = ','
}
inline fun ViewManager.textInputEditText(theme: Int = 0, init: TextInputEditText.() -> Unit) = ankoView({ TextInputEditText(it) }, theme, init)
inline fun ViewManager.textInputEditText(theme: Int = 0, init: TextInputEditText.() -> Unit) = ankoView(::TextInputEditText, theme, init)
fun fromHtml(s: String) : Spanned {
fun fromHtml(s: String): Spanned {
if (Build.VERSION.SDK_INT >= 24) {
return Html.fromHtml(s, Html.FROM_HTML_MODE_LEGACY)
} else {
@ -181,7 +181,7 @@ class MainActivity : AppCompatActivity(), AnkoLogger {
// phone
textInputLayout {
horizontalPadding = dip(40)
val editText = textInputEditText() {
val editText = textInputEditText {
lparams(width = matchParent)
inputType = InputType.TYPE_CLASS_PHONE
hint = getString(R.string.hint_phone_number)
@ -204,7 +204,7 @@ class MainActivity : AppCompatActivity(), AnkoLogger {
// master code
textInputLayout {
horizontalPadding = dip(40)
val editText = textInputEditText() {
val editText = textInputEditText {
lparams(width = matchParent)
inputType = InputType.TYPE_CLASS_NUMBER or InputType.TYPE_NUMBER_VARIATION_PASSWORD
hint = getString(R.string.hint_master_code)
@ -456,7 +456,7 @@ class MainActivity : AppCompatActivity(), AnkoLogger {
if (field == null) {
errors.append(getString(
R.string.validate_syntax_error,
"opts[${i+1}], field[$j]"))
"opts[${i + 1}], field[$j]"))
} else {
with(field) {
// size

View file

@ -1,12 +1,12 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.0.6'
ext.kotlin_version = '1.1.0'
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.0-beta4'
classpath 'com.android.tools.build:gradle:2.3.0-rc1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong