Created
August 30, 2016 21:32
-
-
Save mandybess/5b8edde3b8172233c856cf5da12db3ac to your computer and use it in GitHub Desktop.
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
class SplashActivity : BaseActivity() { | |
lateinit var splashPresenter: SplashPresenter | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
SplashActivityUI().setContentView(this) | |
} | |
} | |
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
class SplashActivityUI : AnkoComponent<SplashActivity> { | |
override fun createView(ui: AnkoContext<SplashActivity>): View { | |
return with(ui) { | |
relativeLayout { | |
textView() { | |
lparams(width = matchParent, height = wrapContent) | |
text = ctx.getString(R.string.app_name) | |
textSize = 80f | |
verticalGravity = Gravity.CENTER | |
gravity = Gravity.CENTER | |
textColor = ContextCompat.getColor(ctx, android.R.color.black) | |
applyBrusherFont() | |
onClick { | |
ui.owner.splashPresenter.onNameClicked() | |
} | |
} | |
} | |
} | |
} | |
} |
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
class SplashPresenter { | |
fun onNameClicked(): Unit { | |
// do something | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment