Skip to content

Commit fea9eb3

Browse files
SUPERCILEXsamtstern
authored andcommitted
Cleanup (#2)
1 parent 90ea9c2 commit fea9eb3

37 files changed

+317
-462
lines changed

app/src/main/AndroidManifest.xml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3-
xmlns:tools="http://schemas.android.com/tools"
4-
package="com.firebase.uidemo">
2+
<manifest
3+
xmlns:android="http://schemas.android.com/apk/res/android"
4+
xmlns:tools="http://schemas.android.com/tools"
5+
package="com.firebase.uidemo">
56

67
<uses-permission android:name="android.permission.INTERNET" />
78
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
@@ -31,16 +32,16 @@
3132

3233
<!-- Chat demo -->
3334
<activity
34-
android:name=".database.ChatActivity"
35+
android:name=".database.realtime.ChatActivity"
3536
android:label="@string/name_chat" />
3637
<activity
37-
android:name=".database.ChatIndexActivity"
38+
android:name=".database.realtime.ChatIndexActivity"
3839
android:label="@string/name_chat" />
3940

4041
<!-- Firestore demo -->
4142
<activity
42-
android:name=".firestore.FirestoreChatActivity"
43-
android:label="@string/name_chat"/>
43+
android:name=".database.firestore.FirestoreChatActivity"
44+
android:label="@string/name_chat" />
4445

4546
<!-- Auth UI demo -->
4647
<activity

app/src/main/java/com/firebase/uidemo/ChooserActivity.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
import android.widget.TextView;
2727

2828
import com.firebase.uidemo.auth.AuthUiActivity;
29-
import com.firebase.uidemo.database.ChatActivity;
30-
import com.firebase.uidemo.firestore.FirestoreChatActivity;
29+
import com.firebase.uidemo.database.firestore.FirestoreChatActivity;
30+
import com.firebase.uidemo.database.realtime.ChatActivity;
3131
import com.firebase.uidemo.storage.ImageActivity;
3232

3333
import butterknife.BindView;
@@ -96,8 +96,8 @@ private static class ActivityStarterHolder extends RecyclerView.ViewHolder imple
9696

9797
public ActivityStarterHolder(View itemView) {
9898
super(itemView);
99-
mTitle = (TextView) itemView.findViewById(R.id.text1);
100-
mDescription = (TextView) itemView.findViewById(R.id.text2);
99+
mTitle = itemView.findViewById(R.id.text1);
100+
mDescription = itemView.findViewById(R.id.text2);
101101
}
102102

103103
private void bind(Class aClass, @StringRes int name, @StringRes int description) {

app/src/main/java/com/firebase/uidemo/auth/SignedInActivity.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ public class SignedInActivity extends AppCompatActivity {
6969
@BindView(R.id.user_display_name)
7070
TextView mUserDisplayName;
7171

72-
7372
@BindView(R.id.user_phone_number)
7473
TextView mUserPhoneNumber;
7574

app/src/main/java/com/firebase/uidemo/database/AbstractChat.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,4 @@ public abstract class AbstractChat {
1111

1212
public abstract String getUid();
1313

14-
1514
}

app/src/main/java/com/firebase/uidemo/firestore/Chat.java renamed to app/src/main/java/com/firebase/uidemo/database/firestore/Chat.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.firebase.uidemo.firestore;
1+
package com.firebase.uidemo.database.firestore;
22

33
import com.firebase.uidemo.database.AbstractChat;
44
import com.google.firebase.firestore.IgnoreExtraProperties;
@@ -12,7 +12,7 @@ public class Chat extends AbstractChat {
1212
private String mName;
1313
private String mMessage;
1414
private String mUid;
15-
private @ServerTimestamp Date mTimestamp;
15+
private Date mTimestamp;
1616

1717
public Chat() {
1818
// Needed for Firebase

app/src/main/java/com/firebase/uidemo/firestore/FirestoreChatActivity.java renamed to app/src/main/java/com/firebase/uidemo/database/firestore/FirestoreChatActivity.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.firebase.uidemo.firestore;
1+
package com.firebase.uidemo.database.firestore;
22

33
import android.os.Bundle;
44
import android.support.annotation.NonNull;
@@ -70,7 +70,7 @@ protected void onCreate(Bundle savedInstanceState) {
7070
LinearLayoutManager manager = new LinearLayoutManager(this);
7171
mAdapter = new FirestoreRecyclerAdapter<Chat, ChatHolder>(query, Chat.class) {
7272
@Override
73-
public void onBindViewHolder(ChatHolder holder, int i, Chat model) {
73+
public void onBindViewHolder(ChatHolder holder, int position, Chat model) {
7474
holder.bind(model);
7575
}
7676

app/src/main/java/com/firebase/uidemo/database/Chat.java renamed to app/src/main/java/com/firebase/uidemo/database/realtime/Chat.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
package com.firebase.uidemo.database;
1+
package com.firebase.uidemo.database.realtime;
22

3+
import com.firebase.uidemo.database.AbstractChat;
34
import com.google.firebase.database.IgnoreExtraProperties;
45

56
@IgnoreExtraProperties

app/src/main/java/com/firebase/uidemo/database/ChatActivity.java renamed to app/src/main/java/com/firebase/uidemo/database/realtime/ChatActivity.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* limitations under the License.
1313
*/
1414

15-
package com.firebase.uidemo.database;
15+
package com.firebase.uidemo.database.realtime;
1616

1717
import android.arch.lifecycle.LifecycleRegistry;
1818
import android.arch.lifecycle.LifecycleRegistryOwner;
@@ -30,6 +30,7 @@
3030

3131
import com.firebase.ui.database.FirebaseRecyclerAdapter;
3232
import com.firebase.uidemo.R;
33+
import com.firebase.uidemo.database.ChatHolder;
3334
import com.firebase.uidemo.util.SignInResultNotifier;
3435
import com.google.android.gms.tasks.OnSuccessListener;
3536
import com.google.firebase.auth.AuthResult;
@@ -64,9 +65,9 @@ protected void onCreate(Bundle savedInstanceState) {
6465
mAuth = FirebaseAuth.getInstance();
6566
mAuth.addAuthStateListener(this);
6667

67-
mSendButton = (Button) findViewById(R.id.sendButton);
68-
mMessageEdit = (EditText) findViewById(R.id.messageEdit);
69-
mEmptyListMessage = (TextView) findViewById(R.id.emptyTextView);
68+
mSendButton = findViewById(R.id.sendButton);
69+
mMessageEdit = findViewById(R.id.messageEdit);
70+
mEmptyListMessage = findViewById(R.id.emptyTextView);
7071

7172
mChatRef = FirebaseDatabase.getInstance().getReference().child("chats");
7273

@@ -75,7 +76,7 @@ protected void onCreate(Bundle savedInstanceState) {
7576
mManager = new LinearLayoutManager(this);
7677
mManager.setReverseLayout(false);
7778

78-
mMessages = (RecyclerView) findViewById(R.id.messagesList);
79+
mMessages = findViewById(R.id.messagesList);
7980
mMessages.setHasFixedSize(true);
8081
mMessages.setLayoutManager(mManager);
8182

app/src/main/java/com/firebase/uidemo/database/ChatIndexActivity.java renamed to app/src/main/java/com/firebase/uidemo/database/realtime/ChatIndexActivity.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
package com.firebase.uidemo.database;
1+
package com.firebase.uidemo.database.realtime;
22

33
import android.view.View;
44

55
import com.firebase.ui.database.FirebaseIndexRecyclerAdapter;
66
import com.firebase.ui.database.FirebaseRecyclerAdapter;
77
import com.firebase.uidemo.R;
8+
import com.firebase.uidemo.database.ChatHolder;
89
import com.google.firebase.auth.FirebaseAuth;
910
import com.google.firebase.database.DatabaseReference;
1011
import com.google.firebase.database.FirebaseDatabase;

app/src/main/res/layout/activity_chat.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
xmlns:tools="http://schemas.android.com/tools"
55
android:layout_width="match_parent"
66
android:layout_height="match_parent"
7-
tools:context=".database.ChatActivity">
7+
tools:context=".database.realtime.ChatActivity">
88

99
<TextView
1010
android:id="@+id/emptyTextView"

0 commit comments

Comments
 (0)