mihon/app/src/main/java/eu/kanade/tachiyomi/util/ViewGroupExtensions.kt
NoodleMage 9f78c8f6b4 - Rewrote Category to Kotlin
- Moved category to ui
- Reworked Animation (smoother)
- Updated TextDrawable
2016-02-25 09:58:01 +01:00

15 lines
532 B
Kotlin

package eu.kanade.tachiyomi.util
import android.support.annotation.LayoutRes
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
/**
* Extension method to inflate a view directly from its parent.
* @param layout the layout to inflate.
* @param attachToRoot whether to attach the view to the root or not. Defaults to false.
*/
fun ViewGroup.inflate(@LayoutRes layout: Int, attachToRoot: Boolean = false): View {
return LayoutInflater.from(context).inflate(layout, this, attachToRoot)
}