Customization
You can customize your screen texts, colors, images, and buttons.
See a Complete Example below.

Understand the Flow

There are 4 flows:
  • PinEnrollment: This flow allows the user to register their PIN for the first time, then register their biometrics
  • PinVerification: This is used to verify the user's biometrics or use PIN.
  • PinReset : This is used to reset user's pin if they forgot the pin by sending a code to their email or phone number.
  • PinChange : This is used to change the user's pin if they know what the current pin is.

1. Customize the header title of each screen

  • Screen names for Pin Enrollment flow: PinEnrollmentEnterPin ,PinEnrollmentReEnterPin
  • Screen names for Pin Verification flow: PinVerification
  • Screen names for Pin Reset flow: PinReset , PinResetEnterPin , PinResetReEnterPin
  • Screen names for Pin Change flow: PinChangeVerifyPin , PinChangeEnterPin , PinChangeReEnterPin
To customize the Header of each screen, call Cotter.strings.setHeaders(<ScreenName>, <YourHeader>).
Do this right after your call Cotter.init, before starting any flow.
1
Cotter.init(this.getApplicationContext(), "https://www.cotter.app/api/v0",
2
getString(R.string.user_id), // user id
3
getString(R.string.api_key_id), // api key id
4
getString(R.string.api_secret_key)); // api secret key
5
​
6
// Setting strings for Headers
7
Cotter.strings.setHeaders(ScreenNames.PinEnrollmentEnterPin, "Activate PIN");
8
Cotter.strings.setHeaders(ScreenNames.PinEnrollmentReEnterPin, "Confirm PIN");
9
Cotter.strings.setHeaders(ScreenNames.PinVerification, "Verification");
10
Cotter.strings.setHeaders(ScreenNames.PinChangeVerifyPin, "Change PIN");
11
Cotter.strings.setHeaders(ScreenNames.PinChangeEnterPin, "New PIN");
12
Cotter.strings.setHeaders(ScreenNames.PinChangeReEnterPin, "Confirm New PIN");
13
Cotter.strings.setHeaders(ScreenNames.PinReset, "Reset PIN");
14
Cotter.strings.setHeaders(ScreenNames.PinResetEnterPin, "Activate New PIN");
15
Cotter.strings.setHeaders(ScreenNames.PinResetReEnterPin, "Confirm New PIN");
Copied!

2. Customize Pin-Enrollment Enter Pin Screen

This is the first screen on the PinEnrollment flow.
PinEnrollment Flow
To set the text for a specific element on a screen, specify the screen name, the name of the element, and the value.
The syntax is like the following:
1
Cotter.strings.set___<ScreenName>___Strings(Strings.__<ElementName>__, <ValueYouWant>)
Copied!
For example, if you want to update the Title to "Enter PIN":
1
Cotter.strings.setPinEnrollmentEnterPinStrings(Strings.Title, "Enter PIN");
Copied!
Put this below Cotter.init before you start any flow.

Advanced Customization

Setting the colors

As shown in the picture, there are 3 main colors that you can set:
  • ColorAccent
  • ColorPrimary
  • ColorDanger
1
Cotter.colors.setColorPrimary("#5E9051");
2
Cotter.colors.setColorAccent("#53228B");
3
Cotter.colors.setColorDanger("#B00020");
Copied!
For the full list of colors that you can set, see Setting Colors and Images.

Error Text Views

There are 3 different places where errors may pop up:
  • PinEnrollmentEnterPin: Error happens when the PIN is too weak, with the error Strings.ErrorCombination. To update:
1
Cotter.strings.setPinEnrollmentEnterPinStrings(Strings.ErrorCombination, "Your PIN is too weak!");
Copied!
  • PinEnrollmentReEnterPin: Error happens when the PIN is not the same as the PIN entered originally, with the error Strings.ErrorNoMatch. To update:
1
Cotter.strings.setPinEnrollmentReEnterPinStrings(Strings.ErrorNoMatch, "Your PINs don't match");
Copied!
  • PinVerification: Error happens when the user entered an invalid PIN, with the error Strings.ErrorInvalid. To update:
1
Cotter.strings.setPinVerificationStrings(Strings.ErrorInvalid, "Invalid PIN");
Copied!

3. Customize PinEnrollmentSuccess page

To change the image, add the image in your /drawable directory, and add the following:
1
Cotter.colors.setSuccessImage(R.drawable.check);
Copied!
To edit the texts, it's the same as the instructions before. See the Complete Example below.
For the full list of images that you can set, see Setting Colors and Images.

4. Customize PinVerification and PinReset Screen

PinVerification and PinReset screen
1
// PinVerification
2
Cotter.strings.setPinVerificationStrings(Strings.ForgotPin, "Lupa PIN");
3
​
4
// PinReset
5
Cotter.strings.setPinReset(Strings.Title, "Verification Code");
6
Cotter.strings.setPinReset(Strings.Subtitle, "We have sent the code to");
7
Cotter.strings.setPinReset(Strings.ResendCode, "Reset Code");
8
Cotter.strings.setPinReset(Strings.ErrorInvalid, "The code you entered is wrong");
Copied!

4. Customize Alert Dialogs.

There are 2 places where an AlertDialog will pop-up:
  • PinEnrollmentEnterPin: AlertDialog pop up when the user clicks 'X' to exit the screen.
  • PinVerification: On a very rare occasion, the signature generated by the biometrics may be invalid. In which case, the AlertDialog will pop up.
To update the AlertDialog strings on the PinEnrollmentEnterPin screen:
1
Cotter.strings.setPinEnrollmentEnterPinStrings(Strings.DialogTitle, "Are you sure you don't want to setup PIN?");
2
Cotter.strings.setPinEnrollmentEnterPinStrings(Strings.DialogSubtitle, "Setting up your PIN is important to secure your account.");
3
Cotter.strings.setPinEnrollmentEnterPinStrings(Strings.DialogPositiveButton, "Setup PIN");
4
Cotter.strings.setPinEnrollmentEnterPinStrings(Strings.DialogNegativeButton, "Next Time");
Copied!

5. Customize Biometric Prompt

There are 2 screens where the BiometricPrompt will pop up:
  • PinEnrollmentSuccess: when Pin Enrollment is successful, user can then enroll their biometrics
  • PinVerification: When user's default authentication method is biometrics, user will be prompted to verify their biometrics when an authentication is required.
​

Complete Example

See the full list of API for:
MainActivity.java
1
@Override
2
protected void onCreate(Bundle savedInstanceState) {
3
super.onCreate(savedInstanceState);
4
setContentView(R.layout.activity_main);
5
6
// Initialize Cotter
7
Cotter.init(this.getApplicationContext(), "https://www.cotter.app/api/v0","<your user id>", "<your api key id>", "<your api secret key>");
8
9
// ------ Setting strings for Headers ------ //
10
Cotter.strings.setHeaders(ScreenNames.PinEnrollmentEnterPin, "Aktivasi PIN");
11
Cotter.strings.setHeaders(ScreenNames.PinEnrollmentReEnterPin, "Konfirmasi PIN");
12
Cotter.strings.setHeaders(ScreenNames.PinVerification, "Verifikasi");
13
Cotter.strings.setHeaders(ScreenNames.PinChangeVerifyPin, "Ganti PIN");
14
Cotter.strings.setHeaders(ScreenNames.PinChangeEnterPin, "PIN Baru");
15
Cotter.strings.setHeaders(ScreenNames.PinChangeReEnterPin, "Konfirmasi PIN Baru");
16
Cotter.strings.setHeaders(ScreenNames.PinReset, "Reset PIN");
17
Cotter.strings.setHeaders(ScreenNames.PinResetEnterPin, "Aktivasi PIN Baru");
18
Cotter.strings.setHeaders(ScreenNames.PinResetReEnterPin, "Konfirmasi PIN Baru");
19
20
​
21
// ----- SETTING STRINGS FOR PIN VERIFICATION -----//
22
// Pin Verification page
23
Cotter.strings.setPinVerificationStrings(Strings.Title, "Masukkan PIN");
24
Cotter.strings.setPinVerificationStrings(Strings.ForgotPin, "Lupa PIN");
25
Cotter.strings.setPinVerificationStrings(Strings.ErrorInvalid, "PIN tidak sesuai.");
26
// Biometric prompt
27
Cotter.strings.setPinVerificationStrings(Strings.BiometricTitle, "Verifikasi");
28
Cotter.strings.setPinVerificationStrings(Strings.BiometricSubtitle,
29
"Sentuh sensor sidik jari untuk melanjutkan");
30
Cotter.strings.setPinVerificationStrings(Strings.BiometricNegativeButton, "Input PIN");
31
// Alert dialog when biometric signature is not valid
32
Cotter.strings.setPinVerificationStrings(Strings.DialogTitle, "Biometric kamu tidak bisa diverifikasi");
33
Cotter.strings.setPinVerificationStrings(Strings.DialogSubtitle, "Kamu boleh masukkan PIN atau coba lagi.");
34
Cotter.strings.setPinVerificationStrings(Strings.DialogPositiveButton, "Input PIN");
35
Cotter.strings.setPinVerificationStrings(Strings.DialogNegativeButton, "Coba lagi");
36
// ----- END SETTING STRINGS FOR PIN VERIFICATION -----//
37
​
38
​
39
// Setting colors
40
Cotter.colors.setColorPrimary("#5E9051");
41
Cotter.colors.setColorAccent("#53228B");
42
Cotter.colors.setColorDanger("#B00020");
43
}
44
​
45
public void openPinEnrollment(View view) {
46
Cotter.PinEnrollment.startFlow(view, <CallbackScreen>.class, "PIN_ENROLLMENT");
47
}
48
​
49
public void openPinVerification(View view) {
50
Cotter.user.setUserInformation("Emily", "[email protected]", "EMAIL");
51
Cotter.PinVerification.startFlow(view, <CallbackScreen>.class, "LOGIN");
52
}
Copied!

Screen Names Reference

Pin Enrollment Flow
​
Last modified 1yr ago