Skip to content

Commit

Permalink
Fixed parsing of cornerRadius from attributes
Browse files Browse the repository at this point in the history
Renamed attribute for cornerRadius into maskCornerRadius
Updated tools
  • Loading branch information
Faltenreich committed Jun 11, 2018
1 parent 4b1fbf9 commit 7626b8d
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 9 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@ repositories {

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlinVersion"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlinVersion"
implementation "com.android.support:design:$supportVersion"

testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'

implementation 'com.github.naz013:ColorSlider:1.0.3'

Expand Down
8 changes: 7 additions & 1 deletion app/src/main/res/layout/fragment_viewgroup.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,16 @@

<com.faltenreich.skeletonlayout.SkeletonLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/skeletonLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="@dimen/margin">
android:padding="@dimen/margin"
app:maskColor="@color/colorPrimary"
app:maskCornerRadius="10dp"
app:showShimmer="true"
app:shimmerColor="@color/colorPrimaryDark"
app:shimmerDurationInMillis="2000">

<include layout="@layout/list_item"/>

Expand Down
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ buildscript {
targetSdk = 27
kotlinVersion = '1.2.41'
supportVersion = '27.1.1'
projectVersion = '1.0.0'
projectVersionCode = 1
projectVersion = '1.0.1'
projectVersionCode = 2
}

repositories {
Expand All @@ -15,7 +15,7 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:3.1.2'
classpath 'com.android.tools.build:gradle:3.1.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.0'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0'
Expand Down
2 changes: 1 addition & 1 deletion skeletonlayout/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ dependencies {
api "com.android.support:recyclerview-v7:$supportVersion"

testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}

apply from: 'deploy.gradle'
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class SkeletonLayout @JvmOverloads constructor(
attrs?.let {
val typedArray = context.obtainStyledAttributes(it, R.styleable.SkeletonLayout, 0, 0)
this.maskColor = typedArray.getColor(R.styleable.SkeletonLayout_maskColor, maskColor)
this.maskCornerRadius = typedArray.getFloat(R.styleable.SkeletonLayout_cornerRadius, cornerRadius)
this.maskCornerRadius = typedArray.getDimensionPixelSize(R.styleable.SkeletonLayout_maskCornerRadius, cornerRadius.toInt()).toFloat()
this.showShimmer = typedArray.getBoolean(R.styleable.SkeletonLayout_showShimmer, showShimmer)
this.shimmerColor = typedArray.getColor(R.styleable.SkeletonLayout_shimmerColor, shimmerColor)
this.shimmerDurationInMillis = typedArray.getInt(R.styleable.SkeletonLayout_shimmerDurationInMillis, shimmerDurationInMillis.toInt()).toLong()
Expand Down
2 changes: 1 addition & 1 deletion skeletonlayout/src/main/res/values/attrs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<declare-styleable name="SkeletonLayout">
<attr name="maskColor" format="color"/>
<attr name="cornerRadius" format="dimension"/>
<attr name="maskCornerRadius" format="dimension"/>
<attr name="showShimmer" format="boolean"/>
<attr name="shimmerColor" format="color"/>
<attr name="shimmerDurationInMillis" format="integer"/>
Expand Down

0 comments on commit 7626b8d

Please sign in to comment.