-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added ability to add movies to watchlist and mark them as watched fro…
…m Movie Info screen. Also added feature to redirect to profile screen when the user clicks on the ProfileIcon or Username
- Loading branch information
Showing
21 changed files
with
237 additions
and
46 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
app/src/main/java/com/example/moviemate/api/FirebaseHelper.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package com.example.moviemate.api | ||
|
||
import com.google.firebase.auth.FirebaseAuth | ||
import com.google.firebase.firestore.DocumentReference | ||
import com.google.firebase.firestore.FirebaseFirestore | ||
import kotlinx.coroutines.tasks.await | ||
|
||
|
||
// Check if movie is in user collection | ||
suspend fun isMovieInUserCol( | ||
auth: FirebaseAuth, | ||
db: FirebaseFirestore, | ||
collectionName: String, | ||
movieID: Int | ||
): Boolean { | ||
val userEmail = auth.currentUser!!.email.toString() | ||
val docRef = db.collection("users") | ||
.document(userEmail) | ||
.collection(collectionName) | ||
.document(movieID.toString()) | ||
|
||
val docSnapshot = docRef.get().await() | ||
return docSnapshot.exists() | ||
} | ||
|
||
|
||
// Get reference to document in user collection | ||
fun getDocRefToUserCol( | ||
auth: FirebaseAuth, | ||
db: FirebaseFirestore, | ||
collectionName: String, | ||
movieID: Int, | ||
): DocumentReference { | ||
val userEmail = auth.currentUser!!.email.toString() | ||
|
||
return db.collection("users") | ||
.document(userEmail) | ||
.collection(collectionName) | ||
.document(movieID.toString()) | ||
} |
Binary file not shown.
4 changes: 2 additions & 2 deletions
4
app/src/main/res/drawable/ic_bookmark.xml → .../main/res/drawable/ic_bookmark_filled.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<vector android:height="24dp" android:tint="#FFFFFF" | ||
<vector android:height="32dp" android:tint="#FFFFFF" | ||
android:viewportHeight="24" android:viewportWidth="24" | ||
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android"> | ||
android:width="32dp" xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<path android:fillColor="@android:color/white" android:pathData="M17,3H7c-1.1,0 -1.99,0.9 -1.99,2L5,21l7,-3 7,3V5c0,-1.1 -0.9,-2 -2,-2z"/> | ||
</vector> |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:autoMirrored="true" android:height="32dp" android:tint="#FFFFFF" android:viewportHeight="24" android:viewportWidth="24" android:width="32dp"> | ||
|
||
<path android:fillColor="@android:color/white" android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM10,17l-5,-5 1.41,-1.41L10,14.17l7.59,-7.59L19,8l-9,9z"/> | ||
|
||
</vector> |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:autoMirrored="true" android:height="32dp" android:tint="#FFFFFF" android:viewportHeight="24" android:viewportWidth="24" android:width="32dp"> | ||
|
||
<path android:fillColor="@android:color/white" android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM12,18.5c-0.83,0 -1.5,-0.67 -1.5,-1.5h3c0,0.83 -0.67,1.5 -1.5,1.5zM17,16L7,16v-1l1,-1v-2.61C8,9.27 9.03,7.47 11,7v-0.5c0,-0.57 0.43,-1 1,-1s1,0.43 1,1L13,7c1.97,0.47 3,2.28 3,4.39L16,14l1,1v1z"/> | ||
|
||
</vector> |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.