Skip to content

Commit 5e96d68

Browse files
committed
Finish #59 (or at least, I hope so)
1 parent 544fc98 commit 5e96d68

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

codelabs/chat/README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ Now that we can send messages to Firebase, it is time for the next step: making
232232

233233
A chat app that doesn’t show existing messages is not very useful. So in this step we’ll add a list of the existing messages to our Android app. And since we're using Firebase, new chat messages will be added to this list automatically. At the end of this section we’ll have a fully functional chat app.
234234

235-
![Chat messages Android app and new message](images/5_1.png)
235+
<img alt="Chat messages Android app and new message" src="images/5_1.png" height="600">
236236

237237
Let's take this in chunks: first we'll create a Java class to represent each message, then we'll create an Adapter that gets each of the messages from Firebase and puts them into a ListView.
238238

@@ -369,11 +369,7 @@ First add a button to the top right of activity_main.xml
369369

370370
![main_activity.xml with login button](images/6_2.png)
371371

372-
Extend FirebaseLoginBaseActivity
373-
374-
Although extending `ListActivity` was useful earlier, when it saved some lines of code, it's now more important that we extend `FirebaseLoginBaseActivity`.
375-
376-
We'll change our `MainActivity` definition to extend `FirebaseLoginBaseActivity`.
372+
We'll change our `MainActivity` definition to extend `FirebaseLoginBaseActivity`. This allows us to make use of FirebaseUIs headful auth in the easiest way.
377373

378374
```java
379375
public class MainActivity extends FirebaseLoginBaseActivity {
@@ -397,7 +393,7 @@ listView.setAdapter(mListAdapter);
397393

398394
![Update FirebaseListAdapter code](images/6_3.png)
399395

400-
Finally we need to add a few event handlers onto `MainActivity` so we can react to login events.
396+
We'll need to add a few event handlers onto `MainActivity` so we can react to login events.
401397
402398
```java
403399
@Override
@@ -418,7 +414,7 @@ protected void onFirebaseLoginUserError(FirebaseLoginError firebaseLoginError) {
418414
419415
![Add Firebase event handlers](images/6_3.5.png)
420416
421-
Enable Password Authentication
417+
Then we can enable an auth provider. In this example we'll just use `PASSWORD` but social providers can be enabled here, too.
422418

423419
```java
424420
@Override
@@ -430,7 +426,7 @@ protected void onStart() {
430426

431427
![Enable PASSWORD auth](images/6_4.png)
432428

433-
Wire up login button
429+
We want our users to be able to click a button to be prompted to log in, so we'll wire up the button we added a moment ago to call `showFirebaseLoginPrompt()`.
434430
435431
```java
436432
Button loginButton = (Button) this.findViewById(R.id.login);
@@ -451,6 +447,10 @@ Now go into your Firebase Dashboard and go to the Auth tab and select "Email/Pas
451447

452448
This is also where you can configure the password reset emails that you can send to your users, in case they forgot their password.
453449

450+
Now run your app and click the Login button and you'll see the FirebaseUI dialog. When a user logs in the event handlers we added on our activity will be called and you can interact with their authentication data however you want.
451+
452+
<img alt="Chat login" src="images/0_1.png" height="600">
453+
454454
## Wrap-up
455455
456456
Wrap-up

0 commit comments

Comments
 (0)