Last active
March 23, 2020 18:17
-
-
Save dnnyg33/8a1d7f96c03ca81f2976cfce38366831 to your computer and use it in GitHub Desktop.
File template for Kotlin Custom view
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
import android.content.Context | |
import android.util.AttributeSet | |
import android.view.LayoutInflater | |
import android.widget.FrameLayout | |
import com.tengentllc.scripturegames.R | |
class ${NAME}(context: Context, attrs: AttributeSet?) : FrameLayout(context, attrs) { | |
constructor(context: Context) : this(context, null) | |
init { | |
LayoutInflater.from(context).inflate(getLayoutId(), this, true) | |
} | |
private fun getLayoutId(): Int { | |
return R.layout.$xml_layout | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment