Skip to content

Commit

Permalink
Merge pull request #26 from ericktijerou/bugfix/framelayout
Browse files Browse the repository at this point in the history
Fix skeleton - Cardview/FrameLayout
  • Loading branch information
ericktijerou authored Jan 24, 2021
2 parents 8bc9472 + d4472b0 commit f6bf2e8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ You can [download](https://bintray.com/ericktijerou/maven/koleton/_latestVersion
```gradle
// In your module's `build.gradle.kts`
dependencies {
implementation("com.ericktijerou.koleton:koleton:0.8.1")
implementation("com.ericktijerou.koleton:koleton:0.8.2")
}
```

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ compileSdk=29
groupId=com.ericktijerou.koleton
vcsUrl=https://github.com/ericktijerou/koleton
issueTrackerUrl=https://github.com/ericktijerou/koleton/issues
publishVersion=0.8.1
publishVersion=0.8.2
6 changes: 6 additions & 0 deletions koleton-base/src/main/kotlin/koleton/util/Views.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package koleton.util

import android.graphics.Color
import android.os.Build
import android.view.View
import android.view.ViewGroup
Expand Down Expand Up @@ -47,6 +48,7 @@ internal fun ViewGroup.children(): List<View> {
internal fun View.generateSimpleKoletonView(attributes: Attributes): SimpleKoletonView {
val parent = parent as? ViewGroup
return SimpleKoletonView(context).also {
validateBackground()
it.id = id
it.layoutParams = layoutParams
it.cloneTranslations(this)
Expand All @@ -58,6 +60,10 @@ internal fun View.generateSimpleKoletonView(attributes: Attributes): SimpleKolet
}
}

internal fun View.validateBackground() {
if (this is FrameLayout) setBackgroundColor(Color.TRANSPARENT)
}

internal fun RecyclerView.generateRecyclerKoletonView(attributes: RecyclerViewAttributes): RecyclerKoletonView {
val parent = parent as? ViewGroup
return RecyclerKoletonView(context).also {
Expand Down

0 comments on commit f6bf2e8

Please sign in to comment.