Skip to content
This repository was archived by the owner on Jun 28, 2022. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
7143972
2.04 Edit Shopping List Name - Solution
Oct 24, 2015
09ab6cd
2.05 Add a New Shopping List - Quiz
Oct 22, 2015
53f2d69
2.06 Add a New Shopping List - Solution
Oct 22, 2015
e9b610a
2.07 The Firebase List Adapter Repo - Quiz
Dec 10, 2015
19b5c2d
2.08 The Firebase List Adapter Repo - Solution
Jan 22, 2016
5898f81
2.09 Send Over The Push ID Spec - Quiz
Nov 5, 2015
11709f9
2.10 Send Over The Push ID - Solution
Nov 6, 2015
341c89d
2.11 Removing A Shopping List - Quiz
Oct 22, 2015
1a1f47e
2.12 Removing A Shopping List - Solution
Oct 22, 2015
a26ca99
2.13 Items - Quiz
Oct 21, 2015
0a4a455
2.14 Items - Solution
Nov 6, 2015
b54c8f4
2.15 Add Items to the List Detail - Quiz
Nov 6, 2015
1e12514
2.16 Add Items to the List Detail - Solution
Oct 24, 2015
ffe869c
2.17 Remove Event Listeners - Quiz
Oct 22, 2015
8698f1b
2.18 Remove Event Listeners - Solution
Oct 22, 2015
3751978
2.19 OYO Edit and Remove List
Dec 10, 2015
9d4e781
3.00 Version 0.3 Start Code
Oct 29, 2015
64ab9d1
3.01 Creating a User - Quiz
Oct 29, 2015
7585c94
3.02 Creating a User - Solution
Oct 29, 2015
059dfbf
3.03 Logging In - Quiz
Oct 29, 2015
676fef5
3.04 Logging In - Solution
Oct 29, 2015
ae54eb6
3.05 Add Google Login - Quiz
Oct 29, 2015
8667554
3.06 Add Google Login - Solution
Oct 29, 2015
8540857
3.07 User Data with Email/Password - Quiz
Nov 9, 2015
fa5803e
3.08 User Data with Email/Password - Solution
Nov 10, 2015
65c0417
3.09 User Data with Google - Quiz
Nov 9, 2015
54d0170
3.10 User Data with Google - Solution
Nov 10, 2015
2678fe7
3.11 Use Owner Data - Quiz
Nov 10, 2015
807f5dc
3.12 Use Owner Data - Solution
Nov 10, 2015
0592de8
3.13 Logging Out and Kicking Off - Quiz
Nov 10, 2015
1337931
3.14 Logging Out and Kicking Off - Solution
Dec 10, 2015
4386080
3.15 Owner List Permissions - Quiz
Oct 29, 2015
2e70173
3.16 Owner List Permissions - Solution
Oct 29, 2015
9039588
3.17 Reset Password Login Flow - Quiz
Oct 29, 2015
df96314
3.18 Reset Password Login Flow - Solution
Nov 10, 2015
12c934a
3.19 Check Off Items - Quiz
Oct 29, 2015
1dde65a
3.20 Check Off Items - Solution
Oct 29, 2015
1d17232
3.21 Shopping Mode - Quiz
Oct 30, 2015
b02fee2
3.22 Shopping Mode - Solution
Nov 6, 2015
93004bc
3.23 Who is Shopping - Quiz
Oct 30, 2015
2eb9934
3.24 Who is Shopping - Solution
Oct 30, 2015
ddd33e7
3.25 OYO List Fragment Who is Shopping
Nov 5, 2015
44c0e68
3.26 OYO Permissions for Items
Dec 10, 2015
f203f6c
3.27 OYO Restore Signed In Session
Nov 10, 2015
04d8147
4.00 Version 0.4 Start Code
Nov 3, 2015
8ce64dd
4.01 Sorting with orderBy - Quiz
Nov 13, 2015
81a9c5c
4.02 Sorting with orderBy - Solution
Dec 10, 2015
783feb8
4.03 Separate Bought And Unbought - Quiz
Nov 3, 2015
b7bbbdc
4.04 Separate Bought And Unbought - Solution
Nov 3, 2015
b254871
4.05 Efficiency at Scale Refactor - Quiz
Nov 3, 2015
93d3c35
4.06 Efficiency at Scale Refactor - Solution
Dec 4, 2015
a3795d3
4.07 User Friends - Quiz
Nov 3, 2015
e868512
4.08 User Friends - Solution
Nov 6, 2015
ccaf792
4.09 Adding to the Share List - Quiz
Nov 17, 2015
e01cfda
4.10 Adding to the Share List - Solution
Jan 22, 2016
52c85dd
4.11 Implementing Sharing - Quiz
Nov 17, 2015
7391490
4.12 Implementing Sharing - Solution
Dec 4, 2015
145be03
4.13 Searching - Quiz
Nov 17, 2015
196cfd5
4.14 Searching - Solution
Nov 4, 2015
a9e601f
4.15 OYO Cleanup FriendAdapter
Nov 17, 2015
67bfebe
4.16 OYO Sort By Last Edited Timestamp
Nov 17, 2015
6a97d5d
5.00 Version 0.5 Start Code
Jan 7, 2016
48bd8e2
5.01 Simple Off-line - Quiz
Jan 7, 2016
9b69670
5.02 Simple Off-line - Solution
Jan 7, 2016
94303e9
5.03 Basic Rule Syntax - Quiz
Jan 10, 2016
9631327
5.04 Basic Rule Syntax - Solution
Jan 10, 2016
704508a
5.05 Validation for Shopping List Items - Quiz
Jan 10, 2016
9f8029d
5.06 Validation for Shopping List Items - Solution
Jan 7, 2016
69c8214
5.07 Finish the Validate Rules - Quiz
Jan 7, 2016
00f9747
5.08 Finish the Validate Rules - Solution
Jan 10, 2016
e7dccb2
5.09 Write the User Read Rule - Quiz
Jan 7, 2016
5e27ca1
5.10 Write the User Read Rule - Solution
Jan 7, 2016
ae58b60
5.11 UID Email Mapping - Quiz
Jan 8, 2016
ac4df8c
5.12 UID Email Mapping - Solution
Jan 8, 2016
de1d103
5.13 Checking for List Access - Quiz
Jan 8, 2016
0ad4df3
5.14 Checking for List Access - Solution
Jan 8, 2016
b805eb0
5.15 Finish the Rules - Solution
Jan 8, 2016
46d3e25
Add archival note to README
SudKul Jun 28, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,8 @@ As mistakes in the original repository are fixed, the code will be <a href="http

- **1/26/2016** : [Changelog](https://docs.google.com/document/d/1SgBmUu7COQQT5maqKVvIV4Iv0Oyva9-9-YRnpQ88XuY/pub)
- **12/10/2015** : [Changelog](https://docs.google.com/document/d/1A5BSoLyEHkXrcBC50lNXqrl1Rkh0G2nM-h4ER8lKovw/pub)
- **11/30/2015** : Lesson 1 and 2 launch
- **11/30/2015** : Lesson 1 and 2 launch
# Archival Note
This repository is deprecated; therefore, we are going to archive it. However, learners will be able to fork it to their personal Github account but cannot submit PRs to this repository. If you have any issues or suggestions to make, feel free to:
- Utilize the https://knowledge.udacity.com/ forum to seek help on content-specific issues.
- Submit a support ticket along with the link to your forked repository if (learners are) blocked for other reasons. Here are the links for the [retail consumers](https://udacity.zendesk.com/hc/en-us/requests/new) and [enterprise learners](https://udacityenterprise.zendesk.com/hc/en-us/requests/new?ticket_form_id=360000279131).
5 changes: 5 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'

android {
compileSdkVersion 23
Expand Down Expand Up @@ -43,8 +44,12 @@ dependencies {
compile 'com.android.support:support-v4:23.0.1'
compile 'com.android.support:cardview-v7:23.0.1'

/* Firebase SDK */
compile 'com.firebase:firebase-client-android:2.4.0'

/* Firebase UI */
compile 'com.firebaseui:firebase-ui:0.2.2'

/* For Google Play Services */
compile 'com.google.android.gms:play-services-safetynet:8.3.0'
compile 'com.google.android.gms:play-services-auth:8.3.0'
Expand Down
43 changes: 38 additions & 5 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
package="com.udacity.firebase.shoppinglistplusplus">

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.USE_CREDENTIALS" />

<application
android:name="com.udacity.firebase.shoppinglistplusplus.ShoppingListApplication"
Expand All @@ -17,11 +19,6 @@
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.udacity.firebase.shoppinglistplusplus.ui.MainActivity" />
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

<activity
Expand All @@ -33,5 +30,41 @@
android:name="android.support.PARENT_ACTIVITY"
android:value=".ui.MainActivity" />
</activity>

<activity android:name=".ui.login.LoginActivity">
<intent-filter android:label="@string/app_name">
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

<activity
android:name=".ui.login.CreateAccountActivity"
android:label="@string/title_activity_create_account"
android:parentActivityName=".ui.login.LoginActivity">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".ui.login.LoginActivity" />
</activity>
<activity
android:name=".ui.SettingsActivity"
android:label="@string/action_settings" />
<activity
android:name=".ui.sharing.ShareListActivity"
android:label="@string/title_activity_share_list"
android:parentActivityName=".ui.activeListDetails.ActiveListDetailsActivity"
android:windowSoftInputMode="adjustPan">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".ui.activeListDetails.ActiveListDetailsActivity" />
</activity>
<activity
android:name=".ui.sharing.AddFriendActivity"
android:label="@string/title_activity_add_friend"
android:parentActivityName=".ui.sharing.ShareListActivity">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".ui.sharing.ShareListActivity" />
</activity>
</application>
</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ public void onCreate() {
super.onCreate();
/* Initialize Firebase */
Firebase.setAndroidContext(this);
/* Enable disk persistence */
Firebase.getDefaultConfig().setPersistenceEnabled(true);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ public class ShoppingList {
private String listName;
private String owner;
private HashMap<String, Object> timestampLastChanged;
private HashMap<String, Object> timestampCreated;
private HashMap<String, Object> timestampLastChangedReverse;
private HashMap<String, User> usersShopping;

/**
* Required public constructor
Expand All @@ -28,15 +31,16 @@ public ShoppingList() {
*
* @param listName
* @param owner
*
*/
public ShoppingList(String listName, String owner) {
public ShoppingList(String listName, String owner, HashMap<String, Object> timestampCreated) {
this.listName = listName;
this.owner = owner;
HashMap<String, Object> timestampLastChangedObj = new HashMap<String, Object>();
timestampLastChangedObj.put(Constants.FIREBASE_PROPERTY_TIMESTAMP, ServerValue.TIMESTAMP);
this.timestampLastChanged = timestampLastChangedObj;

this.timestampCreated = timestampCreated;
HashMap<String, Object> timestampNowObject = new HashMap<String, Object>();
timestampNowObject.put(Constants.FIREBASE_PROPERTY_TIMESTAMP, ServerValue.TIMESTAMP);
this.timestampLastChanged = timestampNowObject;
this.timestampLastChangedReverse = null;
this.usersShopping = new HashMap<>();
}

public String getListName() {
Expand All @@ -51,12 +55,41 @@ public HashMap<String, Object> getTimestampLastChanged() {
return timestampLastChanged;
}

public HashMap<String, Object> getTimestampCreated() {
return timestampCreated;
}

public HashMap<String, Object> getTimestampLastChangedReverse() {
return timestampLastChangedReverse;
}

@JsonIgnore
public long getTimestampLastChangedLong() {

return (long) timestampLastChanged.get(Constants.FIREBASE_PROPERTY_TIMESTAMP);
}

@JsonIgnore
public long getTimestampCreatedLong() {
return (long) timestampLastChanged.get(Constants.FIREBASE_PROPERTY_TIMESTAMP);
}

@JsonIgnore
public long getTimestampLastChangedReverseLong() {

return (long) timestampLastChangedReverse.get(Constants.FIREBASE_PROPERTY_TIMESTAMP);
}

public HashMap getUsersShopping() {
return usersShopping;
}

public void setTimestampLastChangedToNow() {
HashMap<String, Object> timestampNowObject = new HashMap<String, Object>();
timestampNowObject.put(Constants.FIREBASE_PROPERTY_TIMESTAMP, ServerValue.TIMESTAMP);
this.timestampLastChanged = timestampNowObject;
}


}

Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
package com.udacity.firebase.shoppinglistplusplus.model;

/**
* Defines the data structure for ShoppingListItem objects.
*/
public class ShoppingListItem {
private String itemName;
private String owner;
private String boughtBy;
private boolean bought;

/**
* Required public constructor
*/
public ShoppingListItem() {
}

/**
* Use this constructor to create new ShoppingListItem.
* Takes shopping list item name and list item owner email as params
*
* @param itemName
* @param owner
*/
public ShoppingListItem(String itemName, String owner) {
this.itemName = itemName;
this.owner = owner;
this.boughtBy = null;
this.bought = false;

}

public String getItemName() { return itemName; }

public String getOwner() {
return owner;
}

public String getBoughtBy() {
return boughtBy;
}

public boolean isBought() {
return bought;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
package com.udacity.firebase.shoppinglistplusplus.model;

import java.util.HashMap;

/**
* Defines the data structure for User objects.
*/
public class User {
private String name;
private String email;
private HashMap<String, Object> timestampJoined;
private boolean hasLoggedInWithPassword;


/**
* Required public constructor
*/
public User() {
}

/**
* Use this constructor to create new User.
* Takes user name, email and timestampJoined as params
*
* @param name
* @param email
* @param timestampJoined
*/
public User(String name, String email, HashMap<String, Object> timestampJoined) {
this.name = name;
this.email = email;
this.timestampJoined = timestampJoined;
this.hasLoggedInWithPassword = false;
}

public String getName() {
return name;
}

public String getEmail() {
return email;
}

public HashMap<String, Object> getTimestampJoined() {
return timestampJoined;
}

public boolean isHasLoggedInWithPassword() {
return hasLoggedInWithPassword;
}
}
Loading