Created
September 21, 2018 16:44
-
-
Save ar-android/10f096e6a940055afdc6611be83c6678 to your computer and use it in GitHub Desktop.
Game Character
This file contains hidden or 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.graphics.Canvas | |
import android.graphics.Color | |
import android.graphics.Paint | |
import android.util.AttributeSet | |
import android.view.View | |
class FluppyBirdView @JvmOverloads constructor( | |
context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0 | |
) : View(context, attrs, defStyleAttr) { | |
override fun onDraw(canvas: Canvas?) { | |
super.onDraw(canvas) | |
canvas?.drawCircle((width / 2).toFloat(), (height / 2).toFloat(), 100F, Paint().apply { | |
style = Paint.Style.FILL | |
color = Color.BLUE | |
}) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment