This repository has been archived by the owner on Oct 15, 2020. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
177 additions
and
87 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,13 @@ | ||
apply plugin: 'com.android.application' | ||
apply plugin: 'kotlin-android' | ||
apply plugin: 'kotlin-android-extensions' | ||
apply plugin: 'kotlin-kapt' | ||
|
||
android { | ||
compileSdkVersion 29 | ||
buildToolsVersion "29.0.3" | ||
|
||
defaultConfig { | ||
applicationId "com.lockwood.robotospandemo" | ||
minSdkVersion 15 | ||
targetSdkVersion 29 | ||
versionCode 1 | ||
versionName "1.0" | ||
} | ||
|
||
compileOptions { | ||
sourceCompatibility JavaVersion.VERSION_1_8 | ||
targetCompatibility JavaVersion.VERSION_1_8 | ||
} | ||
kotlinOptions { | ||
jvmTarget = "1.8" | ||
} | ||
|
||
buildTypes { | ||
debug { | ||
applicationIdSuffix ".debug" | ||
minifyEnabled true | ||
shrinkResources true | ||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' | ||
} | ||
} | ||
} | ||
apply from: rootProject.file('gradle/android/app.gradle') | ||
apply from: rootProject.file('gradle/deps.gradle') | ||
|
||
dependencies { | ||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" | ||
implementation 'androidx.appcompat:appcompat:1.1.0' | ||
implementation 'androidx.core:core-ktx:1.2.0' | ||
implementation "com.google.android.material:material:1.2.0-alpha06" | ||
|
||
implementation( | ||
deps.kotlin.stdlib, | ||
deps.android.appcompat, | ||
deps.android.material | ||
) | ||
|
||
implementation project(':roboto-library') | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
apply plugin: 'com.android.application' | ||
apply from: rootProject.file('gradle/android/base.gradle') | ||
apply from: rootProject.file('gradle/android/build.gradle') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
apply plugin: 'kotlin-android' | ||
apply plugin: 'kotlin-android-extensions' | ||
|
||
apply from: rootProject.file('gradle/versions.gradle') | ||
|
||
android { | ||
compileSdkVersion versions.compileSdk | ||
|
||
defaultConfig { | ||
minSdkVersion versions.minSdk | ||
targetSdkVersion versions.targetSdk | ||
versionCode versions.code | ||
versionName versions.name | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
android { | ||
|
||
buildTypes { | ||
|
||
debug { | ||
applicationIdSuffix ".debug" | ||
minifyEnabled false | ||
shrinkResources false | ||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' | ||
} | ||
release { | ||
minifyEnabled true | ||
shrinkResources true | ||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
apply plugin: 'com.android.library' | ||
apply from: rootProject.file('gradle/android/base.gradle') | ||
|
||
android { | ||
defaultConfig { | ||
consumerProguardFiles 'consumer-rules.pro' | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
ext.deps = [:] | ||
|
||
def versions = [:] | ||
versions.kotlin = "1.3.72" | ||
versions.ktx = "1.4.0-alpha01" | ||
versions.appcompat = "1.3.0-alpha01" | ||
versions.multispan = "1.0.2" | ||
versions.material = "1.2.0-alpha06" | ||
|
||
def android = [:] | ||
android.ktx = "androidx.core:core-ktx:$versions.ktx" | ||
android.appcompat = "androidx.appcompat:appcompat:$versions.appcompat" | ||
android.material = "com.google.android.material:material:$versions.material" | ||
deps.android = android | ||
|
||
def kotlin = [:] | ||
kotlin.stdlib = "org.jetbrains.kotlin:kotlin-stdlib:$versions.kotlin" | ||
deps.kotlin = kotlin | ||
|
||
def lndmflngs = [:] | ||
lndmflngs.multispan = "com.github.lndmflngs:multispan-view:$versions.multispan" | ||
deps.lndmflngs = lndmflngs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
android { | ||
|
||
compileOptions { | ||
sourceCompatibility = '1.8' | ||
targetCompatibility = '1.8' | ||
} | ||
|
||
kotlinOptions { | ||
jvmTarget = "1.8" | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
apply plugin: 'com.github.dcendents.android-maven' | ||
|
||
group = 'com.github.lndmflngs' | ||
|
||
repositories { | ||
mavenCentral() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
ext.versions = [ | ||
minSdk : 15, | ||
compileSdk: 29, | ||
targetSdk : 29, | ||
code : 1, | ||
name : '1.0.0' | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,14 @@ | ||
apply plugin: 'com.android.library' | ||
apply plugin: 'kotlin-android' | ||
apply plugin: 'kotlin-android-extensions' | ||
apply plugin: 'com.github.dcendents.android-maven' | ||
|
||
group = 'com.github.lndmflngs' | ||
|
||
android { | ||
compileSdkVersion 29 | ||
|
||
defaultConfig { | ||
minSdkVersion 15 | ||
targetSdkVersion 29 | ||
versionCode 1 | ||
versionName "1.0" | ||
consumerProguardFiles 'consumer-rules.pro' | ||
} | ||
|
||
compileOptions { | ||
sourceCompatibility JavaVersion.VERSION_1_8 | ||
targetCompatibility JavaVersion.VERSION_1_8 | ||
} | ||
kotlinOptions { | ||
jvmTarget = "1.8" | ||
} | ||
} | ||
apply from: rootProject.file('gradle/android/library.gradle') | ||
apply from: rootProject.file('gradle/kotlin/target.gradle') | ||
apply from: rootProject.file('gradle/publish.gradle') | ||
apply from: rootProject.file('gradle/deps.gradle') | ||
|
||
dependencies { | ||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" | ||
implementation "androidx.appcompat:appcompat:1.1.0" | ||
implementation "androidx.core:core-ktx:1.2.0" | ||
api "com.github.lndmflngs:multispan-view:1.0.1" | ||
} | ||
implementation( | ||
deps.kotlin.stdlib, | ||
deps.android.appcompat, | ||
deps.android.ktx | ||
) | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
api deps.lndmflngs.multispan | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
roboto-library/src/main/java/com/lockwood/multispan/roboto/extensions/Attrs.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package com.lockwood.multispan.roboto.extensions | ||
|
||
import android.content.Context | ||
import android.content.res.TypedArray | ||
import android.util.AttributeSet | ||
import androidx.annotation.AttrRes | ||
import androidx.annotation.StyleRes | ||
|
||
internal inline fun fetchAttrs( | ||
context: Context, | ||
attrs: IntArray, | ||
set: AttributeSet? = null, | ||
@AttrRes defStyleAttr: Int = 0, | ||
@StyleRes defStyleRes: Int = 0, | ||
fetch: TypedArray .() -> Unit = {} | ||
) { | ||
val typedArray = context.theme.obtainStyledAttributes( | ||
set, | ||
attrs, | ||
defStyleAttr, | ||
defStyleRes | ||
) | ||
with(typedArray) { | ||
try { | ||
fetch() | ||
} finally { | ||
recycle() | ||
} | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
roboto-library/src/main/java/com/lockwood/multispan/roboto/extensions/Color.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package com.lockwood.multispan.roboto.extensions | ||
|
||
import android.content.res.ColorStateList | ||
import androidx.annotation.ColorInt | ||
|
||
internal fun colorToStateList(@ColorInt color: Int): ColorStateList { | ||
return ColorStateList.valueOf(color) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters