Skip to content

Commit a21f3a6

Browse files
committed
fix indentation
1 parent b4ae94a commit a21f3a6

File tree

1 file changed

+74
-75
lines changed

1 file changed

+74
-75
lines changed

README.md

+74-75
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,11 @@ Next, add the `LockActivity` inside the `application` tag:
101101

102102
```xml
103103
<activity
104-
android:name="com.auth0.android.lock.LockActivity"
105-
android:label="@string/app_name"
106-
android:launchMode="singleTask"
107-
android:screenOrientation="portrait"
108-
android:theme="@style/Lock.Theme"/>
104+
android:name="com.auth0.android.lock.LockActivity"
105+
android:label="@string/app_name"
106+
android:launchMode="singleTask"
107+
android:screenOrientation="portrait"
108+
android:theme="@style/Lock.Theme"/>
109109
```
110110

111111
Make sure the Activity's `launchMode` is declared as `singleTask` or the authentication result won't come back into your application.
@@ -117,37 +117,37 @@ Then, in any of your Activities, you need to initialize **Lock** and handle the
117117
// This activity will show Lock
118118
class MyActivity : AppCompatActivity() {
119119

120-
private var lock: Lock? = null
120+
private var lock: Lock? = null
121121

122-
override fun onCreate(savedInstanceState: Bundle?) {
123-
super.onCreate(savedInstanceState)
122+
override fun onCreate(savedInstanceState: Bundle?) {
123+
super.onCreate(savedInstanceState)
124124

125-
val account = Auth0(this)
126-
// Instantiate Lock once
127-
lock = Lock.newBuilder(account, callback)
128-
// Customize Lock
129-
.build(this)
130-
}
131-
132-
override fun onDestroy() {
133-
super.onDestroy()
134-
// Important! Release Lock and its resources
135-
lock?.onDestroy(this)
136-
}
137-
138-
private val callback = object : AuthenticationCallback() {
139-
override fun onAuthentication(credentials: Credentials) {
125+
val account = Auth0(this)
126+
// Instantiate Lock once
127+
lock = Lock.newBuilder(account, callback)
128+
// Customize Lock
129+
.build(this)
130+
}
131+
132+
override fun onDestroy() {
133+
super.onDestroy()
134+
// Important! Release Lock and its resources
135+
lock?.onDestroy(this)
136+
}
137+
138+
private val callback = object : AuthenticationCallback() {
139+
override fun onAuthentication(credentials: Credentials) {
140140
// Authenticated
141-
}
142-
143-
override fun onCanceled() {
141+
}
142+
143+
override fun onCanceled() {
144144
// User pressed back and closed Lock
145-
}
146-
147-
override fun onError(error: LockException) {
145+
}
146+
147+
override fun onError(error: LockException) {
148148
// An exception occurred
149-
}
150-
}
149+
}
150+
}
151151
}
152152
```
153153

@@ -174,22 +174,21 @@ Next, add the `PasswordlessLockActivity` inside the `application` tag. Note that
174174

175175
```xml
176176
<activity
177-
android:name="com.auth0.android.lock.PasswordlessLockActivity"
178-
android:label="@string/app_name"
179-
android:launchMode="singleTask"
180-
android:screenOrientation="portrait"
181-
android:theme="@style/Lock.Theme">
177+
android:name="com.auth0.android.lock.PasswordlessLockActivity"
178+
android:label="@string/app_name"
179+
android:launchMode="singleTask"
180+
android:screenOrientation="portrait"
181+
android:theme="@style/Lock.Theme">
182182
<intent-filter>
183-
<action android:name="android.intent.action.VIEW" />
184-
185-
<category android:name="android.intent.category.DEFAULT" />
186-
<category android:name="android.intent.category.BROWSABLE" />
187-
188-
<data
183+
<action android:name="android.intent.action.VIEW" />
184+
185+
<category android:name="android.intent.category.DEFAULT" />
186+
<category android:name="android.intent.category.BROWSABLE" />
187+
188+
<data
189189
android:host="@string/com_auth0_domain"
190190
android:pathPrefix="/android/${applicationId}/email"
191191
android:scheme="https" />
192-
193192
</intent-filter>
194193
</activity>
195194
```
@@ -202,8 +201,8 @@ When the Passwordless connection is SMS you must also add the `CountryCodeActivi
202201

203202
```xml
204203
<activity
205-
android:name="com.auth0.android.lock.CountryCodeActivity"
206-
android:theme="@style/Lock.Theme.ActionBar" />
204+
android:name="com.auth0.android.lock.CountryCodeActivity"
205+
android:theme="@style/Lock.Theme.ActionBar" />
207206
```
208207

209208

@@ -212,38 +211,38 @@ Then, in any of your Activities, you need to initialize **PasswordlessLock** and
212211
```kotlin
213212
// This activity will show PasswordlessLock
214213
class MyActivity : AppCompatActivity() {
215-
216-
private var lock: PasswordlessLock? = null
217-
218-
override fun onCreate(savedInstanceState: Bundle?) {
219-
super.onCreate(savedInstanceState)
220214

221-
val account = Auth0(this)
222-
// Instantiate Lock once
223-
lock = PasswordlessLock.newBuilder(account, callback)
224-
// Customize Lock
225-
.build(this)
226-
}
227-
228-
override fun onDestroy() {
229-
super.onDestroy()
230-
// Important! Release Lock and its resources
231-
lock?.onDestroy(this)
232-
}
233-
234-
private val callback = object : AuthenticationCallback() {
235-
override fun onAuthentication(credentials: Credentials) {
215+
private var lock: PasswordlessLock? = null
216+
217+
override fun onCreate(savedInstanceState: Bundle?) {
218+
super.onCreate(savedInstanceState)
219+
220+
val account = Auth0(this)
221+
// Instantiate Lock once
222+
lock = PasswordlessLock.newBuilder(account, callback)
223+
// Customize Lock
224+
.build(this)
225+
}
226+
227+
override fun onDestroy() {
228+
super.onDestroy()
229+
// Important! Release Lock and its resources
230+
lock?.onDestroy(this)
231+
}
232+
233+
private val callback = object : AuthenticationCallback() {
234+
override fun onAuthentication(credentials: Credentials) {
236235
// Authenticated
237-
}
238-
239-
override fun onCanceled() {
236+
}
237+
238+
override fun onCanceled() {
240239
// User pressed back and closed Lock
241-
}
242-
243-
override fun onError(error: LockException) {
240+
}
241+
242+
override fun onError(error: LockException) {
244243
// An exception occurred
245-
}
246-
}
244+
}
245+
}
247246
}
248247
```
249248

@@ -266,14 +265,14 @@ newBuilder(account, callback)
266265
.withScope('new-scope') // Changes the scope to be requested on authentication
267266
.withAudience('my-api') // Changes the audience to be requested on authentication
268267
.withScheme('myapp') // Changes the scheme part used to generate the Callback URL (more below)
269-
268+
270269
// Lock specific options
271270
.initialScreen(InitialScreen.SIGN_UP) // Allows to choose the screen to be displayed first
272271
.allowLogIn(false) // Disables the Log In screen
273272
.allowSignUp(false) // Disables the Sign Up screen
274273
.allowForgotPassword(false) // Disables the Change Password screen
275274
.setDefaultDatabaseConnection('my-connection') // When multiple are available, select one
276-
275+
277276
// PasswordlessLock specific options
278277
.useCode(true) // Requests to receive a OTP that will need to be filled in your android app to authenticate the user
279278
.useLink(false) // Requests to receive a link that will open your android app to authenticate the user

0 commit comments

Comments
 (0)