Supported attributes list
Name | Type | Description |
---|---|---|
Auth0.HeaderLogo | drawable - reference | Logo drawable to display inside the header. The minimum recommended resolution is 200 pixels (width) by 200 pixels (height). |
Auth0.HeaderTitle | string - reference | Text to display as Title inside the header. |
Auth0.HeaderTitleColor | color - reference | Color for the Title text. |
Auth0.HeaderBackground | color - reference | Used as background color in the header. |
Auth0.PrimaryColor | color - reference | Used as normal state in widgets like the Submit button. Also used as accent color. |
Auth0.DarkPrimaryColor | color - reference | Used as pressed state in widgets like the Submit button. |
Create a New Resource File
First, create a newTheme
that extends from Lock.Theme
, and override the attributes you want to customize. Those attributes not overridden will default to the ones defined in Lock.Theme
.
AndroidManifest.xml
file with the android:theme
attribute. Depending on if you are using Classic Lock or Lock, the activity declaration to update will differ. Because the Lock library declares these activities internally, you need to re-declare them with the special tools:replace
attribute that will override the library’s declaration only for the theme attribute.
Please note that if you define your own Theme in a style resource file and forget to specify that the Theme’s parent is
Lock.Theme
, or you forget to tell the Manifest which will be the Theme for the Activity, you will end up with a really bad looking UI. This may also happen if the values you specify in your custom Theme are invalid.Custom OAuth Connection Buttons
To customize the style of a third-party connection, you must create a new connection by using theCustom Social Connections
extension, filling in every required field before saving the changes.
To customize the style of a third-party identity provider connection in Lock, call the builder and pass both the connectionName
and the style
to use.
First, create a custom style that extends Lock.Theme.AuthStyle.
Define the logo, background color, and name of the connection using names of the keys similar to the example below.
AuthStyle
for the connection name that you want to override.
builder.withAuthStyle("facebook", R.style.Style_Facebook) .build(...);
When Lock needs to display that connection in a SocialButton, it will first search for user-overridden styles. If none is found, it will default to the default Lock style. Following the example above, this means that for facebook
it would use the Facebook background color, Facebook logo and “FACEBOOK"
as name.