Skip to content

Instantly share code, notes, and snippets.

@adrianhall
Created March 23, 2018 23:59
Show Gist options
  • Save adrianhall/9fbb3a8819bf621c6e85dda8a2a94c25 to your computer and use it in GitHub Desktop.
Save adrianhall/9fbb3a8819bf621c6e85dda8a2a94c25 to your computer and use it in GitHub Desktop.
Customize the Authentication UI
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
// Create an auth UI configuration
var uiConfig = AuthUIConfiguration.Builder()
// Specify the providers
.userPools(true)
.canCancel(true)
// Specify the UI customizations
.logoResId(R.drawable.icon_tasks)
.backgroundColor(ContextCompat.getColor(this, R.color.colorPrimary))
.isBackgroundColorFullScreen(true)
// Build the configuration
.build()
// Pull in the SignInUI
val ui = AWSProvider.instance!!.getClient(this, SignInUI::class.java) as SignInUI
ui.login(this, MainActivity::class.java)
.authUIConfiguration(uiConfig)
.execute()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment