comments) {
64 | this.mComments = comments;
65 | }
66 |
67 | @Exclude
68 | public String getKey() {
69 | return mKey;
70 | }
71 |
72 | @Exclude
73 | public void setKey(String key) {
74 | this.mKey = key;
75 | }
76 |
77 | @Override
78 | public boolean equals(Object o) {
79 | if (this == o) return true;
80 | if (o == null || getClass() != o.getClass()) return false;
81 | Discussion that = (Discussion) o;
82 | return Objects.equals(mQuizId, that.mQuizId) &&
83 | Objects.equals(mQuizTitle, that.mQuizTitle);
84 | }
85 |
86 | @Override
87 | public int hashCode() {
88 |
89 | return Objects.hash(mQuizId, mQuizTitle);
90 | }
91 | }
92 |
--------------------------------------------------------------------------------
/app/src/main/java/com/developervishalsehgal/udacityscholarsapp/data/models/NotificationPrefs.java:
--------------------------------------------------------------------------------
1 |
2 | package com.developervishalsehgal.udacityscholarsapp.data.models;
3 |
4 | import com.google.firebase.database.Exclude;
5 | import com.google.firebase.database.IgnoreExtraProperties;
6 | import com.google.firebase.database.PropertyName;
7 | import com.google.gson.annotations.Expose;
8 | import com.google.gson.annotations.SerializedName;
9 |
10 | /**
11 | * Model class representing a User's notification preferences
12 | */
13 | @IgnoreExtraProperties
14 | public class NotificationPrefs {
15 |
16 | @Expose
17 | @PropertyName("comment-notifs")
18 | @SerializedName("comment-notifs")
19 | boolean mCommentNotifs;
20 |
21 | @Expose
22 | @PropertyName("member-messages")
23 | @SerializedName("member-messages")
24 | boolean mMemberMessages;
25 |
26 | @Expose
27 | @PropertyName("moderator-messages")
28 | @SerializedName("moderator-messages")
29 | boolean mModeratorMessages;
30 |
31 | @Expose
32 | @PropertyName("quiz-notifs")
33 | @SerializedName("quiz-notifs")
34 | boolean mQuizNotifs;
35 |
36 | /**
37 | * This field should be used for storing key of realtime database snapshot, otherwise ignore it
38 | */
39 | @Exclude
40 | String mKey;
41 |
42 | @Exclude
43 | public boolean getCommentNotifs() {
44 | return mCommentNotifs;
45 | }
46 |
47 | @Exclude
48 | public void setCommentNotifs(boolean commentNotifs) {
49 | mCommentNotifs = commentNotifs;
50 | }
51 |
52 | @Exclude
53 | public boolean getMemberMessages() {
54 | return mMemberMessages;
55 | }
56 |
57 | @Exclude
58 | public void setMemberMessages(boolean memberMessages) {
59 | mMemberMessages = memberMessages;
60 | }
61 |
62 | @Exclude
63 | public boolean getModeratorMessages() {
64 | return mModeratorMessages;
65 | }
66 |
67 | @Exclude
68 | public void setModeratorMessages(boolean moderatorMessages) {
69 | mModeratorMessages = moderatorMessages;
70 | }
71 |
72 | @Exclude
73 | public boolean getQuizNotifs() {
74 | return mQuizNotifs;
75 | }
76 |
77 | @Exclude
78 | public void setQuizNotifs(boolean quizNotifs) {
79 | mQuizNotifs = quizNotifs;
80 | }
81 |
82 | @Exclude
83 | public String getKey() {
84 | return mKey;
85 | }
86 |
87 | @Exclude
88 | public void setKey(String key) {
89 | this.mKey = key;
90 | }
91 |
92 | }
93 |
--------------------------------------------------------------------------------
/app/src/main/java/com/developervishalsehgal/udacityscholarsapp/data/models/Option.java:
--------------------------------------------------------------------------------
1 |
2 | package com.developervishalsehgal.udacityscholarsapp.data.models;
3 |
4 | import android.support.annotation.NonNull;
5 |
6 | import com.google.firebase.database.Exclude;
7 | import com.google.firebase.database.IgnoreExtraProperties;
8 | import com.google.firebase.database.PropertyName;
9 | import com.google.gson.annotations.Expose;
10 | import com.google.gson.annotations.SerializedName;
11 |
12 | import java.util.Objects;
13 |
14 | /**
15 | * Model class representing a quiz's options
16 | */
17 | @IgnoreExtraProperties
18 | public class Option {
19 |
20 | @Expose
21 | @SerializedName("description")
22 | private String mDescription;
23 |
24 | /**
25 | * Since we are using the same model to store correct answers and scholar's answers, this field
26 | * can represent either
27 | */
28 | @Expose
29 | @SerializedName("is-correct")
30 | private boolean mIsCorrect;
31 |
32 | @Expose
33 | @SerializedName("remarks")
34 | private String mRemarks;
35 |
36 | /**
37 | * This field should be used for storing key of realtime database snapshot, otherwise ignore it
38 | */
39 | @Exclude
40 | String mKey;
41 |
42 | public Option() {
43 |
44 | }
45 |
46 | /**
47 | * Copy constructor
48 | *
49 | * @param toClone Option object to be shallow copied
50 | */
51 | public Option(@NonNull Option toClone) {
52 | mDescription = toClone.mDescription;
53 | mIsCorrect = toClone.mIsCorrect;
54 | mRemarks = toClone.mRemarks;
55 | }
56 |
57 | @PropertyName("description")
58 | public String getDescription() {
59 | return mDescription;
60 | }
61 |
62 | @PropertyName("description")
63 | public void setDescription(String description) {
64 | mDescription = description;
65 | }
66 |
67 | @PropertyName("is-correct")
68 | public boolean isCorrect() {
69 | return mIsCorrect;
70 | }
71 |
72 | @PropertyName("is-correct")
73 | public void setIsCorrect(boolean isCorrect) {
74 | mIsCorrect = isCorrect;
75 | }
76 |
77 | @PropertyName("remarks")
78 | public String getRemarks() {
79 | return mRemarks;
80 | }
81 |
82 | @PropertyName("remarks")
83 | public void setRemarks(String remarks) {
84 | mRemarks = remarks;
85 | }
86 |
87 | @Exclude
88 | public String getKey() {
89 | return mKey;
90 | }
91 |
92 | @Exclude
93 | public void setKey(String key) {
94 | this.mKey = key;
95 | }
96 |
97 | @Override
98 | public boolean equals(Object o) {
99 | if (this == o) return true;
100 | if (o == null || getClass() != o.getClass()) return false;
101 | Option option = (Option) o;
102 | return mIsCorrect == option.mIsCorrect &&
103 | Objects.equals(mDescription, option.mDescription) &&
104 | Objects.equals(mRemarks, option.mRemarks);
105 | }
106 |
107 | @Override
108 | public int hashCode() {
109 |
110 | return Objects.hash(mDescription, mIsCorrect, mRemarks);
111 | }
112 | }
113 |
--------------------------------------------------------------------------------
/app/src/main/java/com/developervishalsehgal/udacityscholarsapp/data/models/QuizAttempted.java:
--------------------------------------------------------------------------------
1 |
2 | package com.developervishalsehgal.udacityscholarsapp.data.models;
3 |
4 | import com.google.firebase.database.Exclude;
5 | import com.google.firebase.database.IgnoreExtraProperties;
6 | import com.google.firebase.database.PropertyName;
7 | import com.google.gson.annotations.Expose;
8 |
9 | import java.util.Objects;
10 |
11 | /**
12 | * Model class representing a quiz attempted by a user
13 | */
14 | @IgnoreExtraProperties
15 | public class QuizAttempted {
16 |
17 | @Expose
18 | private long mLesson;
19 |
20 | @Expose
21 | private long mMaxMarks;
22 |
23 | @Expose
24 | private long mPercentage;
25 |
26 | @Expose
27 | private String mQuizId;
28 |
29 | @Expose
30 | private String mQuizTitle;
31 |
32 | @Expose
33 | private String mRemarks;
34 |
35 | @Expose
36 | private long mScore;
37 |
38 | /**
39 | * This field should be used for storing key of realtime database snapshot, otherwise ignore it
40 | */
41 | @Exclude
42 | private String mKey;
43 |
44 | @PropertyName("lesson")
45 | public long getLesson() {
46 | return mLesson;
47 | }
48 |
49 | @PropertyName("lesson")
50 | public void setLesson(long lesson) {
51 | mLesson = lesson;
52 | }
53 |
54 | @PropertyName("max-marks")
55 | public long getMaxMarks() {
56 | return mMaxMarks;
57 | }
58 |
59 | @PropertyName("max-marks")
60 | public void setMaxMarks(long maxMarks) {
61 | mMaxMarks = maxMarks;
62 | }
63 |
64 | @PropertyName("percentage")
65 | public long getPercentage() {
66 | return mPercentage;
67 | }
68 |
69 | @PropertyName("percentage")
70 | public void setPercentage(long percentage) {
71 | mPercentage = percentage;
72 | }
73 |
74 | @PropertyName("quiz-id")
75 | public String getQuizId() {
76 | return mQuizId;
77 | }
78 |
79 | @PropertyName("quiz-id")
80 | public void setQuizId(String quizId) {
81 | mQuizId = quizId;
82 | }
83 |
84 | @PropertyName("quiz-title")
85 | public String getQuizTitle() {
86 | return mQuizTitle;
87 | }
88 |
89 | @PropertyName("quiz-title")
90 | public void setQuizTitle(String quizTitle) {
91 | mQuizTitle = quizTitle;
92 | }
93 |
94 | @PropertyName("remarks")
95 | public String getRemarks() {
96 | return mRemarks;
97 | }
98 |
99 | @PropertyName("remarks")
100 | public void setRemarks(String remarks) {
101 | mRemarks = remarks;
102 | }
103 |
104 | @PropertyName("score")
105 | public long getScore() {
106 | return mScore;
107 | }
108 |
109 | @PropertyName("score")
110 | public void setScore(long score) {
111 | mScore = score;
112 | }
113 |
114 | @Exclude
115 | public String getKey() {
116 | return mKey;
117 | }
118 |
119 | @Exclude
120 | public void setKey(String key) {
121 | this.mKey = key;
122 | }
123 |
124 | @Override
125 | public boolean equals(Object o) {
126 | if (this == o) return true;
127 | if (o == null || getClass() != o.getClass()) return false;
128 | QuizAttempted that = (QuizAttempted) o;
129 | return mLesson == that.mLesson &&
130 | mMaxMarks == that.mMaxMarks &&
131 | mPercentage == that.mPercentage &&
132 | mScore == that.mScore &&
133 | Objects.equals(mQuizId, that.mQuizId) &&
134 | Objects.equals(mQuizTitle, that.mQuizTitle);
135 | }
136 |
137 | @Override
138 | public int hashCode() {
139 |
140 | return Objects.hash(mLesson, mMaxMarks, mPercentage, mQuizId, mQuizTitle, mScore);
141 | }
142 | }
143 |
--------------------------------------------------------------------------------
/app/src/main/java/com/developervishalsehgal/udacityscholarsapp/data/remote/FirebaseHandler.java:
--------------------------------------------------------------------------------
1 | package com.developervishalsehgal.udacityscholarsapp.data.remote;
2 |
3 | import android.graphics.Bitmap;
4 |
5 | import com.developervishalsehgal.udacityscholarsapp.data.models.Comment;
6 | import com.developervishalsehgal.udacityscholarsapp.data.models.NotificationPrefs;
7 | import com.developervishalsehgal.udacityscholarsapp.data.models.Quiz;
8 | import com.developervishalsehgal.udacityscholarsapp.data.models.QuizAttempted;
9 | import com.developervishalsehgal.udacityscholarsapp.data.models.Resource;
10 | import com.developervishalsehgal.udacityscholarsapp.data.models.User;
11 |
12 | import java.util.List;
13 |
14 | /**
15 | * The only point of interaction with firebase remote database. This contract is kept separate from
16 | * implementation for loose coupling
17 | *
18 | * TODO change description after implementation
19 | *
20 | * @Author kaushald
21 | */
22 | public interface FirebaseHandler {
23 |
24 | String REF_USERS_NODE = "users";
25 | String REF_QUIZZES_NODE = "quizzes";
26 | String REF_DISCUSSION_NODE = "discussions";
27 | String REF_RESOURCES_NODE = "resources";
28 |
29 | /**
30 | * Fetches quizzes based on parameters passed
31 | *
32 | * @param limitToFirst how many quizzes to be fetched? pass 0 to fetch all
33 | */
34 | void fetchQuizzes(int limitToFirst, Callback> callback);
35 |
36 | void fetchAttemptedQuizzes(Callback> callback);
37 |
38 | void fetchQuizById(String quizId, Callback callback);
39 |
40 | void updateSlackHandle(String slackHandle, Callback callback);
41 |
42 | void updateUserName(String userName, Callback callback);
43 |
44 | void updateProfilePic(String profielPicUrl, Callback callback);
45 |
46 | void uploadProfilePic(String localPicturePath, Callback callback);
47 |
48 | void uploadProfilePic(Bitmap picBitmap, Callback callback);
49 |
50 | void fetchUserInfo(String userIdentifier, Callback callback);
51 |
52 | void fetchUserScore(String quizId, Callback callback);
53 |
54 | void setUserInfo(User currentUser, Callback callback);
55 |
56 | void postComment(String discussionId, String quizId, Comment comment, Callback callback);
57 |
58 | void getComments(String discussionId, String quizId, Callback> callback);
59 |
60 | void updateMyAttemptedQuizzes(QuizAttempted quizAttempt, Callback callback);
61 |
62 | void updateQuizBookmarkStatus(String quizIdentifier, boolean isBookmarked, Callback callback);
63 |
64 | void getMyBookmarks(Callback> callback);
65 |
66 | void getMyPreferences(Callback callback);
67 |
68 | void updateMyPrefs(NotificationPrefs prefs, Callback callback);
69 |
70 | void updateMyFCMToken(String fcmToken);
71 |
72 | void updateMyStatus(String newStatus, Callback callback);
73 |
74 | void fetchResources(int startFrom, int limit, Callback> callback);
75 |
76 | void destroy();
77 |
78 | /**
79 | * Generic callback interface for passing response to caller.
80 | *
81 | * TODO Replace all such callbacks with reactive programing, just pass observables
82 | *
83 | * @param Type of expected response
84 | */
85 | interface Callback {
86 | void onReponse(T result);
87 |
88 | void onError();
89 | }
90 |
91 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/developervishalsehgal/udacityscholarsapp/data/remote/FirebaseProvider.java:
--------------------------------------------------------------------------------
1 | package com.developervishalsehgal.udacityscholarsapp.data.remote;
2 |
3 | /**
4 | *
5 | * Provides an implementation of {@link FirebaseHandler}. This provider can decide whether to
6 | * provide real or mock implementation
7 | *
8 | * @Author kaushald
9 | */
10 | public class FirebaseProvider {
11 |
12 | public static FirebaseHandler provide() {
13 | return new FirebaseHandlerImpl();
14 | }
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/app/src/main/java/com/developervishalsehgal/udacityscholarsapp/services/FCMTokenFetcher.java:
--------------------------------------------------------------------------------
1 | package com.developervishalsehgal.udacityscholarsapp.services;
2 |
3 | import com.developervishalsehgal.udacityscholarsapp.data.DataHandlerProvider;
4 | import com.google.firebase.iid.FirebaseInstanceId;
5 | import com.google.firebase.iid.FirebaseInstanceIdService;
6 |
7 | public class FCMTokenFetcher extends FirebaseInstanceIdService {
8 |
9 | @Override
10 | public void onTokenRefresh() {
11 | super.onTokenRefresh();
12 | String fcmToken = FirebaseInstanceId.getInstance().getToken();
13 | saveToken(fcmToken);
14 | }
15 |
16 | private void saveToken(String fcmToken) {
17 | DataHandlerProvider.provide().updateFCMToken(fcmToken);
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/app/src/main/java/com/developervishalsehgal/udacityscholarsapp/ui/BasePresenter.java:
--------------------------------------------------------------------------------
1 | package com.developervishalsehgal.udacityscholarsapp.ui;
2 |
3 | import android.os.Bundle;
4 | import android.support.annotation.Nullable;
5 |
6 | /**
7 | * Base Presenter interface to be extended by all presenters of the app
8 | */
9 | public interface BasePresenter {
10 |
11 | void start(@Nullable Bundle extras);
12 |
13 | void destroy();
14 |
15 | }
16 |
--------------------------------------------------------------------------------
/app/src/main/java/com/developervishalsehgal/udacityscholarsapp/ui/BaseView.java:
--------------------------------------------------------------------------------
1 | package com.developervishalsehgal.udacityscholarsapp.ui;
2 |
3 | /**
4 | * Base View interface to be extended by all Views of the app
5 | */
6 |
7 | public interface BaseView {
8 |
9 | void setPresenter(T presenter);
10 |
11 | void showLoading();
12 |
13 | void hideLoading();
14 |
15 | }
16 |
--------------------------------------------------------------------------------
/app/src/main/java/com/developervishalsehgal/udacityscholarsapp/ui/PresenterInjector.java:
--------------------------------------------------------------------------------
1 | package com.developervishalsehgal.udacityscholarsapp.ui;
2 |
3 | import com.developervishalsehgal.udacityscholarsapp.ui.discussion.QuizDiscussionContract;
4 | import com.developervishalsehgal.udacityscholarsapp.ui.discussion.QuizDiscussionPresenter;
5 | import com.developervishalsehgal.udacityscholarsapp.ui.home.HomeContract;
6 | import com.developervishalsehgal.udacityscholarsapp.ui.home.HomePresenter;
7 | import com.developervishalsehgal.udacityscholarsapp.ui.notification.NotificationContract;
8 | import com.developervishalsehgal.udacityscholarsapp.ui.notification.NotificationPresenter;
9 | import com.developervishalsehgal.udacityscholarsapp.ui.profile.ProfileContract;
10 | import com.developervishalsehgal.udacityscholarsapp.ui.profile.ProfilePresenter;
11 | import com.developervishalsehgal.udacityscholarsapp.ui.quizattempt.AttemptQuizContract;
12 | import com.developervishalsehgal.udacityscholarsapp.ui.quizattempt.AttemptQuizPresenter;
13 | import com.developervishalsehgal.udacityscholarsapp.ui.quizdetails.QuizDetailsContract;
14 | import com.developervishalsehgal.udacityscholarsapp.ui.quizdetails.QuizDetailsPresenter;
15 | import com.developervishalsehgal.udacityscholarsapp.ui.signin.SignInContract;
16 | import com.developervishalsehgal.udacityscholarsapp.ui.signin.SignInPresenter;
17 |
18 | /**
19 | * Encapsulates creation of all Presenters
20 | */
21 | public class PresenterInjector {
22 |
23 | public static void injectSignInPresenter(SignInContract.View signInView) {
24 | new SignInPresenter(signInView);
25 | }
26 |
27 | public static void injectProfilePresenter(ProfileContract.View profileView) {
28 | new ProfilePresenter(profileView);
29 | }
30 |
31 | public static void injectHomePresenter(HomeContract.View homeView) {
32 | new HomePresenter(homeView);
33 | }
34 |
35 | public static void injectQuizDiscussionPresenter(QuizDiscussionContract.View quizDiscussionView) {
36 | new QuizDiscussionPresenter(quizDiscussionView);
37 | }
38 |
39 | public static void injectNotificationPresenter(NotificationContract.View notificationView) {
40 | new NotificationPresenter(notificationView);
41 | }
42 |
43 | public static void injectQuizDetailsPresenter(QuizDetailsContract.View quizDetailsView) {
44 | new QuizDetailsPresenter(quizDetailsView);
45 | }
46 |
47 | public static void injectQuizAttemptPresenter(AttemptQuizContract.View view) {
48 | new AttemptQuizPresenter(view);
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/app/src/main/java/com/developervishalsehgal/udacityscholarsapp/ui/components/CustomTextView.java:
--------------------------------------------------------------------------------
1 | package com.developervishalsehgal.udacityscholarsapp.ui.components;
2 |
3 | import android.content.Context;
4 | import android.support.v7.widget.AppCompatTextView;
5 |
6 | /**
7 | * Created by kaushald on 16/04/18.
8 | *
9 | * @Author kaushald
10 | */
11 | public class CustomTextView extends AppCompatTextView {
12 | public CustomTextView(Context context) {
13 | super(context);
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/app/src/main/java/com/developervishalsehgal/udacityscholarsapp/ui/create/CreateQuizContract.java:
--------------------------------------------------------------------------------
1 | package com.developervishalsehgal.udacityscholarsapp.ui.create;
2 |
3 | import com.developervishalsehgal.udacityscholarsapp.ui.BasePresenter;
4 | import com.developervishalsehgal.udacityscholarsapp.ui.BaseView;
5 |
6 | /**
7 | * Create Quiz Contract. Keeps Create Quiz View and Presenter interfaces in one place.
8 | *
9 | * @Author kaushald
10 | */
11 | public interface CreateQuizContract {
12 |
13 | /**
14 | * Create Quiz view
15 | */
16 | interface View extends BaseView {
17 |
18 | }
19 |
20 | /**
21 | * Create Quiz presenter
22 | */
23 | interface Presenter extends BasePresenter {
24 |
25 | }
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/app/src/main/java/com/developervishalsehgal/udacityscholarsapp/ui/discussion/QuizDiscussionAdapter.java:
--------------------------------------------------------------------------------
1 | package com.developervishalsehgal.udacityscholarsapp.ui.discussion;
2 |
3 | import android.support.annotation.NonNull;
4 | import android.support.v7.widget.RecyclerView;
5 | import android.view.LayoutInflater;
6 | import android.view.View;
7 | import android.view.ViewGroup;
8 | import android.widget.ImageView;
9 | import android.widget.TextView;
10 |
11 | import com.bumptech.glide.Glide;
12 | import com.developervishalsehgal.udacityscholarsapp.R;
13 | import com.developervishalsehgal.udacityscholarsapp.data.models.Comment;
14 | import com.developervishalsehgal.udacityscholarsapp.utils.Utils;
15 |
16 | import java.util.ArrayList;
17 | import java.util.Collections;
18 | import java.util.List;
19 |
20 | public class QuizDiscussionAdapter extends RecyclerView.Adapter {
21 |
22 | private List mComments;
23 |
24 | QuizDiscussionAdapter() {
25 | mComments = new ArrayList<>();
26 | }
27 |
28 | @NonNull
29 | @Override
30 | public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
31 |
32 | /* *
33 | * treating viewType as layout id as returned from getItemViewType(int position)
34 | * */
35 | View view = LayoutInflater.from(parent.getContext()).inflate(viewType, parent, false);
36 | return new ViewHolder(view);
37 | }
38 |
39 | @Override
40 | public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
41 | Comment comment = mComments.get(position);
42 | holder.bindComment(comment);
43 |
44 | }
45 |
46 | @Override
47 | public int getItemViewType(int position) {
48 | Comment comment = mComments.get(position);
49 | return comment.isMyComment() ? R.layout.item_discussion_self : R.layout.item_discussion_others;
50 | }
51 |
52 | @Override
53 | public int getItemCount() {
54 | return mComments.size();
55 | }
56 |
57 | public void setComments(List comments) {
58 | this.mComments.clear();
59 | this.mComments.addAll(comments);
60 |
61 | Collections.sort(mComments, (o1, o2) -> (int) (o1.getCommentedOn() - o2.getCommentedOn()));
62 |
63 | notifyDataSetChanged();
64 | }
65 |
66 | public void addComment(@NonNull Comment comment) {
67 | mComments.add(comment);
68 |
69 | Collections.sort(mComments, (o1, o2) -> (int) (o1.getCommentedOn() - o2.getCommentedOn()));
70 |
71 | notifyDataSetChanged();
72 | }
73 |
74 |
75 | class ViewHolder extends RecyclerView.ViewHolder {
76 |
77 | ImageView userImageView;
78 | TextView userNameTextView;
79 | TextView commentTimeTextView;
80 | TextView commentTextView;
81 |
82 | ViewHolder(View itemView) {
83 | super(itemView);
84 | userImageView = itemView.findViewById(R.id.item_discussion_chat_user_image);
85 | userNameTextView = itemView.findViewById(R.id.item_discussion_user_text_view);
86 | commentTimeTextView = itemView.findViewById(R.id.item_discussion_time_text_view);
87 | commentTextView = itemView.findViewById(R.id.item_discussion_comment_text_view);
88 |
89 | }
90 |
91 | void bindComment(Comment comment) {
92 |
93 | userNameTextView.setText(comment.getCommentBy());
94 | commentTextView.setText(comment.getComment());
95 | //TODO need to normalize the date
96 | commentTimeTextView.setText(Utils.getDisplayDate(comment.getCommentedOn()));
97 |
98 | //TODO need to add circular bitmap transformation for circular image
99 | Glide.with(userImageView).load(comment.getImage()).into(userImageView);
100 | }
101 | }
102 | }
103 |
--------------------------------------------------------------------------------
/app/src/main/java/com/developervishalsehgal/udacityscholarsapp/ui/discussion/QuizDiscussionContract.java:
--------------------------------------------------------------------------------
1 | package com.developervishalsehgal.udacityscholarsapp.ui.discussion;
2 |
3 |
4 | import com.developervishalsehgal.udacityscholarsapp.data.models.Comment;
5 | import com.developervishalsehgal.udacityscholarsapp.ui.BasePresenter;
6 | import com.developervishalsehgal.udacityscholarsapp.ui.BaseView;
7 |
8 | import java.util.List;
9 |
10 | /**
11 | * Discussion screen contract. Keeps Discussion Screen View and Presenter interfaces in one place.
12 | *
13 | * @Author Rahil
14 | */
15 | public interface QuizDiscussionContract {
16 |
17 | String KEY_QUIZ_ID = "quiz_id";
18 |
19 | /**
20 | * Discussion View
21 | */
22 | interface View extends BaseView {
23 | void loadComments(List discussions);
24 |
25 | void onCommentsLoadError();
26 |
27 | void loadComment(Comment comment);
28 |
29 | void showInvalidInput();
30 | }
31 |
32 | /**
33 | * Discussion Presenter
34 | */
35 | interface Presenter extends BasePresenter {
36 | void onClickedSendComment(String comment);
37 | }
38 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/developervishalsehgal/udacityscholarsapp/ui/discussion/QuizDiscussionPresenter.java:
--------------------------------------------------------------------------------
1 | package com.developervishalsehgal.udacityscholarsapp.ui.discussion;
2 |
3 | import android.os.Bundle;
4 | import android.support.annotation.Nullable;
5 |
6 | import com.developervishalsehgal.udacityscholarsapp.data.DataHandler;
7 | import com.developervishalsehgal.udacityscholarsapp.data.DataHandlerProvider;
8 | import com.developervishalsehgal.udacityscholarsapp.data.models.Comment;
9 |
10 | import java.util.List;
11 |
12 | public class QuizDiscussionPresenter implements QuizDiscussionContract.Presenter {
13 |
14 | private QuizDiscussionContract.View mView;
15 | private DataHandler mDataHandler;
16 |
17 | private String quizId;
18 |
19 | public QuizDiscussionPresenter(QuizDiscussionContract.View view) {
20 | this.mView = view;
21 | this.mDataHandler = DataHandlerProvider.provide();
22 |
23 | this.mView.setPresenter(this);
24 | }
25 |
26 | @Override
27 | public void start(@Nullable Bundle extras) {
28 | if (extras == null || !extras.containsKey(QuizDiscussionContract.KEY_QUIZ_ID)) {
29 | mView.showInvalidInput();
30 | return;
31 | }
32 |
33 | quizId = extras.getString(QuizDiscussionContract.KEY_QUIZ_ID);
34 |
35 | mDataHandler.fetchComments(quizId, quizId, new DataHandler.Callback>() {
36 | @Override
37 | public void onResponse(List result) {
38 | mView.loadComments(result);
39 | }
40 |
41 | @Override
42 | public void onError() {
43 | mView.onCommentsLoadError();
44 | }
45 | });
46 | }
47 |
48 | @Override
49 | public void destroy() {
50 | this.mView = null;
51 | this.mDataHandler = null;
52 | }
53 |
54 | @Override
55 | public void onClickedSendComment(String comment) {
56 | mDataHandler.postComment(quizId, quizId, comment, new DataHandler.Callback() {
57 | @Override
58 | public void onResponse(Void result) {
59 | // DO nothing
60 | }
61 |
62 | @Override
63 | public void onError() {
64 |
65 | }
66 | });
67 | }
68 | }
69 |
--------------------------------------------------------------------------------
/app/src/main/java/com/developervishalsehgal/udacityscholarsapp/ui/home/HomeContract.java:
--------------------------------------------------------------------------------
1 | package com.developervishalsehgal.udacityscholarsapp.ui.home;
2 |
3 | import com.developervishalsehgal.udacityscholarsapp.data.models.Quiz;
4 | import com.developervishalsehgal.udacityscholarsapp.ui.BasePresenter;
5 | import com.developervishalsehgal.udacityscholarsapp.ui.BaseView;
6 |
7 | import java.util.List;
8 |
9 | /**
10 | * Home screen contract. Keeps Home Screen View and Presenter interfaces in one place.
11 | *
12 | * @Author kaushald
13 | */
14 | public interface HomeContract {
15 |
16 | int NAVIGATION_SCOREBOARD = 0;
17 | int NAVIGATION_CREATE_QUIZ = 1;
18 | int NAVIGATION_NOTIFICATIONS = 2;
19 | int NAVIGATION_RESOURCES = 3;
20 | int NAVIGATION_SETTINGS = 4;
21 | int NAVIGATION_ABOUT = 5;
22 | int NAVIGATION_EDIT_PROFILE = 6;
23 | String BOOKMARKED_QUIZZES = "bookmarked-quizzes";
24 | String ATTEMPTED_QUIZZES = "attempted-quizzes";
25 | String UNATTEMPTED_QUIZZES = "un-attempted-quizzes";
26 |
27 | /**
28 | * Home View
29 | */
30 | interface View extends BaseView {
31 | void loadQuizzes(List quizzes);
32 |
33 | void onQuizLoadError();
34 |
35 | void loadUserImageInDrawer(String imageUrl);
36 |
37 | void loadUserNameInDrawer(String username);
38 |
39 | void loadSlackHandleInDrawer(String slackHandle);
40 |
41 | void navigateToQuizDesc(Quiz quiz);
42 |
43 | void navigateToScoreboard();
44 |
45 | void navigateToCreateQuiz();
46 |
47 | void navigateToNotifications();
48 |
49 | void navigateToResources();
50 |
51 | void navigateToSettings();
52 |
53 | void navigateToAboutScreen();
54 |
55 | void navigateToEditProfile();
56 |
57 | void navigateToQuizDiscussion(String quizId);
58 |
59 | void navigateToQuizDetails(String quizId);
60 |
61 | void handleEmptyView(String selectedFilter);
62 | }
63 |
64 | /**
65 | * Home Presenter
66 | */
67 | interface Presenter extends BasePresenter {
68 | void onQuizClicked(Quiz quiz);
69 |
70 | void onNavigationItemSelected(int navItemSpecifier);
71 |
72 | void onLogoutClicked();
73 |
74 | void onAllQuizSelected();
75 |
76 | void onAttemptedQuizSelected();
77 |
78 | void onUnAttemptedQuizSelected();
79 |
80 | void onBookmarkSelected();
81 |
82 | void onBookmarkStatusChange(Quiz quiz);
83 | }
84 |
85 | }
86 |
--------------------------------------------------------------------------------
/app/src/main/java/com/developervishalsehgal/udacityscholarsapp/ui/intro/IntroductionContract.java:
--------------------------------------------------------------------------------
1 | package com.developervishalsehgal.udacityscholarsapp.ui.intro;
2 |
3 | import com.developervishalsehgal.udacityscholarsapp.ui.BasePresenter;
4 | import com.developervishalsehgal.udacityscholarsapp.ui.BaseView;
5 |
6 | /**
7 | * Introduction screen contract. Keeps Introduction View and Presenter interfaces in one place.
8 | *
9 | * @Author kaushald
10 | */
11 | public interface IntroductionContract {
12 |
13 | /**
14 | * Introduction view
15 | */
16 | interface View extends BaseView {
17 |
18 | }
19 |
20 | /**
21 | * Introduction presenter
22 | */
23 | interface Presenter extends BasePresenter {
24 |
25 | }
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/app/src/main/java/com/developervishalsehgal/udacityscholarsapp/ui/notification/NotificationContract.java:
--------------------------------------------------------------------------------
1 | package com.developervishalsehgal.udacityscholarsapp.ui.notification;
2 |
3 | import com.developervishalsehgal.udacityscholarsapp.data.models.Notification;
4 | import com.developervishalsehgal.udacityscholarsapp.ui.BasePresenter;
5 | import com.developervishalsehgal.udacityscholarsapp.ui.BaseView;
6 |
7 | import java.util.List;
8 |
9 | /**
10 | * Notification screen contract. Keeps Notification View and Presenter interfaces in one place.
11 | *
12 | * @Author kaushald
13 | */
14 | public interface NotificationContract {
15 |
16 | /**
17 | * Notification Screen view
18 | */
19 | interface View extends BaseView {
20 | void loadNewQuizNotifications(List newQuizNotifications);
21 |
22 | void loadDeadlineNotifications(List deadlineNotifications);
23 |
24 | void loadResourceNotifications(List resourceNotifications);
25 |
26 | void showError();
27 |
28 | void showResourcesTab();
29 | }
30 |
31 | /**
32 | * Notification Screen presenter
33 | */
34 | interface Presenter extends BasePresenter {
35 | void onTabSwitched(int tabId);
36 | void fetchNewQuizNotifications();
37 | void fetchDeadlineNotifications();
38 | void fetchResources();
39 | }
40 |
41 | }
42 |
--------------------------------------------------------------------------------
/app/src/main/java/com/developervishalsehgal/udacityscholarsapp/ui/notification/NotificationPresenter.java:
--------------------------------------------------------------------------------
1 | package com.developervishalsehgal.udacityscholarsapp.ui.notification;
2 |
3 | import android.os.Bundle;
4 | import android.support.annotation.Nullable;
5 |
6 | import com.developervishalsehgal.udacityscholarsapp.data.DataHandler;
7 | import com.developervishalsehgal.udacityscholarsapp.data.DataHandlerProvider;
8 | import com.developervishalsehgal.udacityscholarsapp.data.models.Notification;
9 | import com.developervishalsehgal.udacityscholarsapp.data.models.Quiz;
10 | import com.developervishalsehgal.udacityscholarsapp.data.models.Resource;
11 | import com.developervishalsehgal.udacityscholarsapp.utils.AppConstants;
12 |
13 | import java.util.List;
14 |
15 | public class NotificationPresenter implements NotificationContract.Presenter {
16 |
17 | private NotificationContract.View mView;
18 | private DataHandler mDataHandler;
19 |
20 | public NotificationPresenter(NotificationContract.View view) {
21 | this.mView = view;
22 | this.mDataHandler = DataHandlerProvider.provide();
23 |
24 | mView.setPresenter(this);
25 | }
26 |
27 | @Override
28 | public void onTabSwitched(int tabId) {
29 | // Do nothing
30 | }
31 |
32 | @Override
33 | public void fetchNewQuizNotifications() {
34 | mView.showLoading();
35 | mDataHandler.fetchQuizzes(5, new DataHandler.Callback>() {
36 | @Override
37 | public void onResponse(List result) {
38 | List newQuizNotifications = Notification.fromQuizzes(result, true);
39 | mView.loadNewQuizNotifications(newQuizNotifications);
40 | mView.hideLoading();
41 | }
42 |
43 | @Override
44 | public void onError() {
45 | mView.showError();
46 | mView.hideLoading();
47 | }
48 | });
49 | }
50 |
51 | @Override
52 | public void fetchDeadlineNotifications() {
53 | mDataHandler.fetchQuizzes(5, new DataHandler.Callback>() {
54 | @Override
55 | public void onResponse(List result) {
56 | List newQuizNotifications = Notification.fromQuizzes(result, false);
57 | mView.loadDeadlineNotifications(newQuizNotifications);
58 | mView.hideLoading();
59 | }
60 |
61 | @Override
62 | public void onError() {
63 | mView.showError();
64 | mView.hideLoading();
65 | }
66 | });
67 | }
68 |
69 | @Override
70 | public void fetchResources() {
71 | mDataHandler.fetchResources(0, 0, new DataHandler.Callback>() {
72 | @Override
73 | public void onResponse(List result) {
74 | List resourceNotifications = Notification.fromResources(result);
75 | mView.loadResourceNotifications(resourceNotifications);
76 | mView.hideLoading();
77 | }
78 |
79 | @Override
80 | public void onError() {
81 | mView.hideLoading();
82 | }
83 | });
84 | }
85 |
86 | @Override
87 | public void start(@Nullable Bundle extras) {
88 | if(extras != null && extras.containsKey(AppConstants.NOTIFICATION_TYPE_RESOURCES)){
89 | mView.showResourcesTab();
90 | }
91 | }
92 |
93 | @Override
94 | public void destroy() {
95 | this.mView = null;
96 | this.mDataHandler = null;
97 | }
98 | }
99 |
--------------------------------------------------------------------------------
/app/src/main/java/com/developervishalsehgal/udacityscholarsapp/ui/profile/ProfileContract.java:
--------------------------------------------------------------------------------
1 | package com.developervishalsehgal.udacityscholarsapp.ui.profile;
2 |
3 | import android.graphics.Bitmap;
4 | import android.support.annotation.Nullable;
5 |
6 | import com.developervishalsehgal.udacityscholarsapp.ui.BasePresenter;
7 | import com.developervishalsehgal.udacityscholarsapp.ui.BaseView;
8 |
9 | /**
10 | * Profile screen contract. Keeps profile View and Presenter interfaces in one place.
11 | *
12 | * @Author kaushald
13 | */
14 | public interface ProfileContract {
15 |
16 | /**
17 | * Profile view
18 | */
19 | interface View extends BaseView {
20 |
21 | void loadUserPic(String picUrl);
22 |
23 | void loadUserName(String userName);
24 |
25 | void loadSlackHandle(String slackHandle);
26 |
27 | void loadEmailAddress(String emailAddress);
28 |
29 | void loadUserTrack(String userTrack);
30 |
31 | void onPictureUploadError();
32 |
33 | void onSaveError();
34 |
35 | void onProfileSaved();
36 |
37 | }
38 |
39 | /**
40 | * Profile presenter
41 | */
42 | interface Presenter extends BasePresenter {
43 |
44 | void saveProfile(@Nullable Bitmap picture, String slackHandle, String courseTrack);
45 |
46 | void saveProfile(@Nullable String pictureUrl, String username, String slackHandle, String courseTrack);
47 |
48 | }
49 |
50 | }
51 |
--------------------------------------------------------------------------------
/app/src/main/java/com/developervishalsehgal/udacityscholarsapp/ui/profile/ProfilePresenter.java:
--------------------------------------------------------------------------------
1 | package com.developervishalsehgal.udacityscholarsapp.ui.profile;
2 |
3 | import android.graphics.Bitmap;
4 | import android.os.Bundle;
5 | import android.support.annotation.Nullable;
6 |
7 | import com.developervishalsehgal.udacityscholarsapp.data.DataHandler;
8 | import com.developervishalsehgal.udacityscholarsapp.data.DataHandlerProvider;
9 |
10 | public class ProfilePresenter implements ProfileContract.Presenter {
11 |
12 | private ProfileContract.View mView;
13 | private DataHandler mDataHandler;
14 |
15 | public ProfilePresenter(ProfileContract.View view) {
16 | this.mView = view;
17 | this.mDataHandler = DataHandlerProvider.provide();
18 | this.mView.setPresenter(this);
19 | }
20 |
21 | @Override
22 | public void saveProfile(Bitmap picture, String slackHandle, String courseTrack) {
23 |
24 | // Upload the image in firebase storage
25 | // This is yet to be implemented. THROWS RUNTIME EXCEPTION.
26 | mDataHandler.uploadProfilePic(picture, new DataHandler.Callback() {
27 | @Override
28 | public void onResponse(String result) {
29 | // This result is the public URL of the bitmap we just uploaded
30 | if (result != null && !result.isEmpty()) {
31 | mDataHandler.saveUserPic(result);
32 | }
33 | mDataHandler.saveSlackHandle(slackHandle);
34 | mDataHandler.saveUserTrack(courseTrack);
35 |
36 | mDataHandler.setUserInfo(new DataHandler.Callback() {
37 | @Override
38 | public void onResponse(Void result) {
39 | mView.onProfileSaved();
40 | }
41 |
42 | @Override
43 | public void onError() {
44 | mView.onSaveError();
45 | }
46 | });
47 | }
48 |
49 | @Override
50 | public void onError() {
51 | mView.onPictureUploadError();
52 | }
53 | });
54 | }
55 |
56 | @Override
57 | public void saveProfile(String pictureUrl, String username, String slackHandle, String courseTrack) {
58 |
59 | if (pictureUrl != null && !pictureUrl.isEmpty()) {
60 | mDataHandler.saveUserPic(pictureUrl);
61 | }
62 |
63 | if (!slackHandle.startsWith("@")) {
64 | slackHandle = "@" + slackHandle;
65 | }
66 |
67 | mDataHandler.saveSlackHandle(slackHandle);
68 | mDataHandler.saveUserTrack(courseTrack);
69 | mDataHandler.saveUserName(username);
70 |
71 | mDataHandler.setUserInfo(new DataHandler.Callback() {
72 | @Override
73 | public void onResponse(Void result) {
74 | mView.onProfileSaved();
75 | }
76 |
77 | @Override
78 | public void onError() {
79 | mView.onSaveError();
80 | }
81 | });
82 | }
83 |
84 | @Override
85 | public void start(@Nullable Bundle extras) {
86 |
87 | if (mDataHandler.isLoggedIn()) {
88 | // If user is logged in directly navigate to home
89 | mView.onProfileSaved();
90 | return;
91 | }
92 |
93 | // Updating UI with data we have
94 | mView.loadEmailAddress(mDataHandler.getUserEmail());
95 | mView.loadSlackHandle(mDataHandler.getSlackHandle());
96 | mView.loadUserName(mDataHandler.getUserName());
97 | mView.loadUserPic(mDataHandler.getUserPic());
98 | mView.loadUserTrack(mDataHandler.getUserTrack());
99 |
100 | }
101 |
102 | @Override
103 | public void destroy() {
104 | this.mView = null;
105 | }
106 | }
107 |
--------------------------------------------------------------------------------
/app/src/main/java/com/developervishalsehgal/udacityscholarsapp/ui/quizattempt/AttemptQuizContract.java:
--------------------------------------------------------------------------------
1 | package com.developervishalsehgal.udacityscholarsapp.ui.quizattempt;
2 |
3 | import com.developervishalsehgal.udacityscholarsapp.data.models.Question;
4 | import com.developervishalsehgal.udacityscholarsapp.ui.BasePresenter;
5 | import com.developervishalsehgal.udacityscholarsapp.ui.BaseView;
6 |
7 | /**
8 | * Quiz screen contract. Keeps Quiz View and Presenter interfaces in one place.
9 | *
10 | * @Author kaushald
11 | */
12 | public interface AttemptQuizContract {
13 |
14 | String KEY_QUIZ_ID = "quiz_identifier";
15 |
16 | /**
17 | * Quiz View
18 | */
19 | interface View extends BaseView {
20 |
21 | void enablePreviousButton();
22 |
23 | void disablePreviousButton();
24 |
25 | void showSubmitButton();
26 |
27 | void showNextButton();
28 |
29 | void loadQuestion(Question question);
30 |
31 | void loadQuestionForReview(Question question, Question attemptedQuestion);
32 |
33 | void loadAttemptedStatusText(int currentQuestionNumber, int totalQuestions);
34 |
35 | void loadTitle(String quizTitle);
36 |
37 | void loadResultSummary(int score, int total, double percentage);
38 |
39 | void showError();
40 |
41 | void showInvalidInput();
42 |
43 | void showSubmitConfirmation();
44 |
45 | void dismissView();
46 |
47 | }
48 |
49 | /**
50 | * Quiz Presenter
51 | */
52 | interface Presenter extends BasePresenter {
53 | void onNextClicked();
54 |
55 | void onReviewClicked();
56 |
57 | void onPreviousClicked();
58 |
59 | void onSubmitClicked();
60 | }
61 |
62 | }
63 |
--------------------------------------------------------------------------------
/app/src/main/java/com/developervishalsehgal/udacityscholarsapp/ui/quizdetails/QuizDetailsContract.java:
--------------------------------------------------------------------------------
1 | package com.developervishalsehgal.udacityscholarsapp.ui.quizdetails;
2 |
3 | import android.os.Bundle;
4 |
5 | import com.developervishalsehgal.udacityscholarsapp.ui.BasePresenter;
6 | import com.developervishalsehgal.udacityscholarsapp.ui.BaseView;
7 |
8 | public interface QuizDetailsContract {
9 |
10 | String KEY_QUIZ_ID = "quiz_id";
11 |
12 | /**
13 | * Quiz Details View
14 | */
15 | interface View extends BaseView {
16 |
17 | void enableStartButton();
18 |
19 | void showTitle(String quizTitle);
20 |
21 | void showAuthor(String quizAuthor);
22 |
23 | void showReleaseDate(String releaseDate);
24 |
25 | void showDeadline(String quizDeadline);
26 |
27 | void showDescription(String quizDescription);
28 |
29 | void showUserScore(String score, String maxMarks);
30 |
31 | void navigateToDiscussion(String quizId);
32 |
33 | void startQuiz(String quizId);
34 |
35 | void showInvalidInput();
36 |
37 | void onError();
38 |
39 | void dismissView();
40 |
41 | }
42 |
43 | /**
44 | * Quiz Details Presenter
45 | */
46 | interface Presenter extends BasePresenter {
47 | void onDiscussionClicked();
48 |
49 | void startQuizClicked();
50 | }
51 |
52 | }
53 |
--------------------------------------------------------------------------------
/app/src/main/java/com/developervishalsehgal/udacityscholarsapp/ui/quizdetails/QuizDetailsPresenter.java:
--------------------------------------------------------------------------------
1 | package com.developervishalsehgal.udacityscholarsapp.ui.quizdetails;
2 |
3 | import android.os.Bundle;
4 | import android.support.annotation.Nullable;
5 |
6 | import com.developervishalsehgal.udacityscholarsapp.data.DataHandler;
7 | import com.developervishalsehgal.udacityscholarsapp.data.DataHandlerProvider;
8 | import com.developervishalsehgal.udacityscholarsapp.data.models.Quiz;
9 |
10 | public class QuizDetailsPresenter implements QuizDetailsContract.Presenter {
11 |
12 | private QuizDetailsContract.View mView;
13 | private DataHandler mDataHandler;
14 |
15 | private String mCurrentQuizId;
16 |
17 | public QuizDetailsPresenter(QuizDetailsContract.View view) {
18 | this.mView = view;
19 | this.mDataHandler = DataHandlerProvider.provide();
20 |
21 | mView.setPresenter(this);
22 | }
23 |
24 | @Override
25 | public void onDiscussionClicked() {
26 | mView.navigateToDiscussion(mCurrentQuizId);
27 | }
28 |
29 | @Override
30 | public void startQuizClicked() {
31 | mView.startQuiz(mCurrentQuizId);
32 | }
33 |
34 | @Override
35 | public void start(@Nullable Bundle extras) {
36 | if (extras == null || !extras.containsKey(QuizDetailsContract.KEY_QUIZ_ID)) {
37 | mView.showInvalidInput();
38 | return;
39 | }
40 |
41 | String quizId = extras.getString(QuizDetailsContract.KEY_QUIZ_ID);
42 | this.mCurrentQuizId = quizId;
43 |
44 | mView.showLoading();
45 | mDataHandler.fetchQuizById(quizId, new DataHandler.Callback() {
46 | @Override
47 | public void onResponse(Quiz result) {
48 |
49 | mView.showAuthor(result.getCreatorName());
50 | mView.showDeadline(result.getDeadline());
51 | mView.showDescription(result.getDescription());
52 | mView.showReleaseDate(result.getLastModified());
53 | mView.showTitle(result.getTitle());
54 |
55 | if (result.isAttempted()) {
56 | // User score is stored in rated-by field
57 | mView.showUserScore(String.valueOf(result.getRatedBy()),
58 | String.valueOf(result.getMaxMarks()));
59 | } else {
60 | mView.enableStartButton();
61 | }
62 | mView.hideLoading();
63 | }
64 |
65 | @Override
66 | public void onError() {
67 | mView.onError();
68 | mView.hideLoading();
69 | }
70 | });
71 | }
72 |
73 | @Override
74 | public void destroy() {
75 | this.mView = null;
76 | this.mDataHandler = null;
77 | }
78 | }
79 |
--------------------------------------------------------------------------------
/app/src/main/java/com/developervishalsehgal/udacityscholarsapp/ui/settings/SettingsActivity.java:
--------------------------------------------------------------------------------
1 | package com.developervishalsehgal.udacityscholarsapp.ui.settings;
2 |
3 | import android.os.Bundle;
4 | import android.support.annotation.Nullable;
5 | import android.support.v4.app.NavUtils;
6 | import android.support.v7.app.AppCompatActivity;
7 | import android.support.v7.widget.Toolbar;
8 |
9 | import com.developervishalsehgal.udacityscholarsapp.R;
10 |
11 | public class SettingsActivity extends AppCompatActivity {
12 |
13 | Toolbar toolbar;
14 |
15 | @Override
16 | protected void onCreate(@Nullable Bundle savedInstanceState) {
17 | super.onCreate(savedInstanceState);
18 | setTheme(R.style.SettingsTheme);
19 | setContentView(R.layout.activity_settings);
20 | toolbar = findViewById(R.id.settings_toolbar);
21 | toolbar.setNavigationIcon(R.drawable.ic_close);
22 | toolbar.setNavigationOnClickListener(v -> NavUtils.navigateUpFromSameTask(SettingsActivity.this));
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/app/src/main/java/com/developervishalsehgal/udacityscholarsapp/ui/signin/SignInContract.java:
--------------------------------------------------------------------------------
1 | package com.developervishalsehgal.udacityscholarsapp.ui.signin;
2 |
3 | import android.net.Uri;
4 | import android.os.Bundle;
5 |
6 | import com.developervishalsehgal.udacityscholarsapp.ui.BasePresenter;
7 | import com.developervishalsehgal.udacityscholarsapp.ui.BaseView;
8 |
9 | /**
10 | * Sign In Contract contract. Keeps SignIn Screen View and Presenter interfaces in one place.
11 | *
12 | * @Author kaushald
13 | */
14 | public interface SignInContract {
15 |
16 | /**
17 | * SignIn View
18 | */
19 | interface View extends BaseView {
20 |
21 | void loginSuccess();
22 |
23 | void loginFailure(int statusCode, String message);
24 |
25 | void startSignIn();
26 |
27 | void navigateToProfile();
28 | }
29 |
30 | /**
31 | * SignIn Presenter
32 | */
33 | interface Presenter extends BasePresenter {
34 |
35 | void handleLoginRequest();
36 |
37 | void handleLoginSuccess(String email, String displayName, Uri photoUrl);
38 |
39 | void handleLoginFailure(int statusCode, String message);
40 | }
41 |
42 | }
43 |
--------------------------------------------------------------------------------
/app/src/main/java/com/developervishalsehgal/udacityscholarsapp/ui/signin/SignInPresenter.java:
--------------------------------------------------------------------------------
1 | package com.developervishalsehgal.udacityscholarsapp.ui.signin;
2 |
3 | import android.net.Uri;
4 | import android.os.Bundle;
5 | import android.support.annotation.Nullable;
6 |
7 | import com.developervishalsehgal.udacityscholarsapp.data.DataHandler;
8 | import com.developervishalsehgal.udacityscholarsapp.data.DataHandlerProvider;
9 |
10 | public class SignInPresenter implements SignInContract.Presenter {
11 |
12 | private SignInContract.View mView;
13 | private DataHandler mDataHandler;
14 |
15 | public SignInPresenter(SignInContract.View view) {
16 | this.mView = view;
17 | this.mDataHandler = DataHandlerProvider.provide();
18 | view.setPresenter(this);
19 | }
20 |
21 | @Override
22 | public void handleLoginRequest() {
23 | mView.showLoading();
24 | mView.startSignIn();
25 | }
26 |
27 | @Override
28 | public void handleLoginSuccess(String email, String displayName, Uri photoUrl) {
29 | mDataHandler.saveUserEmail(email);
30 | mDataHandler.saveUserName(displayName);
31 | mDataHandler.saveUserPic(photoUrl.toString());
32 | mView.hideLoading();
33 | mView.loginSuccess();
34 | }
35 |
36 | @Override
37 | public void handleLoginFailure(int statusCode, String message) {
38 | mView.hideLoading();
39 | mView.loginFailure(statusCode, message);
40 | }
41 |
42 | @Override
43 | public void start(@Nullable Bundle extras) {
44 | // Do nothing on start
45 | }
46 |
47 | @Override
48 | public void destroy() {
49 | this.mView = null;
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/app/src/main/java/com/developervishalsehgal/udacityscholarsapp/ui/transformers/ParallaxPageTransformer.java:
--------------------------------------------------------------------------------
1 | package com.developervishalsehgal.udacityscholarsapp.ui.transformers;
2 |
3 | import android.support.v4.view.ViewPager;
4 | import android.view.View;
5 |
6 | import java.util.ArrayList;
7 | import java.util.List;
8 |
9 | /**
10 | * Created by Vishal Sehgal on 02-08-2017.
11 | */
12 |
13 | public class ParallaxPageTransformer implements ViewPager.PageTransformer {
14 |
15 | private List mViewsToParallax = new ArrayList();
16 |
17 | public ParallaxPageTransformer() {
18 | }
19 |
20 | public ParallaxPageTransformer(List viewsToParallax) {
21 | mViewsToParallax = viewsToParallax;
22 | }
23 |
24 | public ParallaxPageTransformer addViewToParallax(
25 | ParallaxTransformInformation viewInfo) {
26 | if (mViewsToParallax != null) {
27 | mViewsToParallax.add(viewInfo);
28 | }
29 | return this;
30 | }
31 |
32 | public void transformPage(View view, float position) {
33 |
34 | int pageWidth = view.getWidth();
35 |
36 | if (position < -1) {
37 | // This page is way off-screen to the left.
38 | view.setAlpha(1);
39 |
40 | } else if (position <= 1 && mViewsToParallax != null) { // [-1,1]
41 | for (ParallaxTransformInformation parallaxTransformInformation : mViewsToParallax) {
42 | applyParallaxEffect(view, position, pageWidth, parallaxTransformInformation,
43 | position > 0);
44 | }
45 | } else {
46 | // This page is way off-screen to the right.
47 | view.setAlpha(1);
48 | }
49 | }
50 |
51 | private void applyParallaxEffect(View view, float position, int pageWidth,
52 | ParallaxTransformInformation information, boolean isEnter) {
53 | if (information.isValid() && view.findViewById(information.resource) != null) {
54 | if (isEnter && !information.isEnterDefault()) {
55 | view.findViewById(information.resource)
56 | .setTranslationX(-position * (pageWidth / information.parallaxEnterEffect));
57 | } else if (!isEnter && !information.isExitDefault()) {
58 | view.findViewById(information.resource)
59 | .setTranslationX(-position * (pageWidth / information.parallaxExitEffect));
60 | }
61 | }
62 | }
63 |
64 |
65 | /**
66 | * Information to make the parallax effect in a concrete view.
67 | *
68 | * parallaxEffect positive values reduces the speed of the view in the translation
69 | * ParallaxEffect negative values increase the speed of the view in the translation
70 | * Try values to see the different effects. I recommend 2, 0.75 and 0.5
71 | */
72 | public static class ParallaxTransformInformation {
73 |
74 | public static final float PARALLAX_EFFECT_DEFAULT = -101.1986f;
75 |
76 | int resource = -1;
77 | float parallaxEnterEffect = 1f;
78 | float parallaxExitEffect = 1f;
79 |
80 | public ParallaxTransformInformation(int resource, float parallaxEnterEffect,
81 | float parallaxExitEffect) {
82 | this.resource = resource;
83 | this.parallaxEnterEffect = parallaxEnterEffect;
84 | this.parallaxExitEffect = parallaxExitEffect;
85 | }
86 |
87 | public boolean isValid() {
88 | return parallaxEnterEffect != 0 && parallaxExitEffect != 0 && resource != -1;
89 | }
90 |
91 | public boolean isEnterDefault() {
92 | return parallaxEnterEffect == PARALLAX_EFFECT_DEFAULT;
93 | }
94 |
95 | public boolean isExitDefault() {
96 | return parallaxExitEffect == PARALLAX_EFFECT_DEFAULT;
97 | }
98 | }
99 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/developervishalsehgal/udacityscholarsapp/utils/AppConstants.java:
--------------------------------------------------------------------------------
1 | package com.developervishalsehgal.udacityscholarsapp.utils;
2 |
3 | public class AppConstants {
4 |
5 | public static final String QUESTION_SINGLE_CHOICE = "single-choice";
6 | public static final String QUESTION_MULTIPLE_CHOICE = "multiple-choice";
7 | public static final String QUESTION_SUBJECTIVE_TYPE = "subjective";
8 |
9 | public AppConstants() {
10 | // Prevents accidental initialization
11 | }
12 |
13 | // Notification Keys
14 | public static final String KEY_TITLE = "title";
15 | public static final String KEY_DESCRIPTION = "description";
16 | public static final String KEY_FROM = "sender";
17 | public static final String KEY_TYPE = "type";
18 | public static final String KEY_ACTION = "action";
19 | public static final String KEY_EXTRA_1 = "extra_1";
20 | public static final String KEY_EXTRA_2 = "extra_2";
21 |
22 | // Notification Types
23 | public static final String NOTIFICATION_TYPE_QUIZ = "quiz";
24 | public static final String NOTIFICATION_TYPE_DEADLINE = "deadline";
25 | public static final String NOTIFICATION_TYPE_RESOURCES = "resources";
26 | public static final String NOTIFICATION_TYPE_DISCUSSION = "discussion";
27 | public static final String NOTIFICATION_TYPE_ANNOUNCEMENTS = "announcements";
28 | }
29 |
--------------------------------------------------------------------------------
/app/src/main/java/com/developervishalsehgal/udacityscholarsapp/utils/Connectivity.java:
--------------------------------------------------------------------------------
1 | package com.developervishalsehgal.udacityscholarsapp.utils;
2 |
3 | import android.content.Context;
4 | import android.net.ConnectivityManager;
5 | import android.net.NetworkInfo;
6 |
7 | /**
8 | * Connectivity Utility class. Contains all utility methods related to connection
9 | */
10 | public class Connectivity {
11 |
12 | public static boolean isNetworkAvailable(Context context) {
13 | ConnectivityManager connectivityManager
14 | = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
15 | assert connectivityManager != null;
16 | NetworkInfo activeNetworkInfo = connectivityManager.getActiveNetworkInfo();
17 | return activeNetworkInfo != null && activeNetworkInfo.isConnectedOrConnecting();
18 | }
19 |
20 | public static boolean isOnline() {
21 | try {
22 | Process p1 = Runtime.getRuntime().exec("ping -c 1 www.google.com");
23 | int returnVal = p1.waitFor();
24 | return (returnVal == 0);
25 | } catch (Exception e) {
26 | e.printStackTrace();
27 | }
28 | return false;
29 | }
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/app/src/main/java/com/developervishalsehgal/udacityscholarsapp/utils/Utils.java:
--------------------------------------------------------------------------------
1 | package com.developervishalsehgal.udacityscholarsapp.utils;
2 |
3 | import java.text.ParseException;
4 | import java.text.SimpleDateFormat;
5 | import java.util.Date;
6 |
7 | public class Utils {
8 |
9 | private Utils() {
10 | // Utility class. Not for initialization
11 | }
12 |
13 | public static long getDateInSeconds(String dateyyyyMMdd) {
14 | try {
15 | SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
16 | Date d = df.parse(dateyyyyMMdd);
17 | return d.getTime() / 1000;
18 | } catch (ParseException e) {
19 | e.printStackTrace();
20 | }
21 | return 0;
22 | }
23 |
24 | public static String getDisplayDate(long timeInSeconds) {
25 | try {
26 | timeInSeconds = timeInSeconds * 1000;
27 | SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
28 | Date d = new Date(timeInSeconds);
29 | return df.format(d);
30 | } catch (Exception e) {
31 | e.printStackTrace();
32 | }
33 | return "NA";
34 | }
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/anim_nothing.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/slide_in_left.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/slide_in_right.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/slide_in_up.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/slide_out_down.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/slide_out_right.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/res/animator/appbar_elevated.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | -
4 |
8 |
9 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/details_page_profile_pic.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UdacityAndroidDevScholarship/quiz-app/fa62bc736f0be86ee019ccb8617c014937dde532/app/src/main/res/drawable-hdpi/details_page_profile_pic.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/ic_person.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UdacityAndroidDevScholarship/quiz-app/fa62bc736f0be86ee019ccb8617c014937dde532/app/src/main/res/drawable-hdpi/ic_person.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/ic_rating_star.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UdacityAndroidDevScholarship/quiz-app/fa62bc736f0be86ee019ccb8617c014937dde532/app/src/main/res/drawable-hdpi/ic_rating_star.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/ic_track.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UdacityAndroidDevScholarship/quiz-app/fa62bc736f0be86ee019ccb8617c014937dde532/app/src/main/res/drawable-hdpi/ic_track.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/udacity_toolbar_logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UdacityAndroidDevScholarship/quiz-app/fa62bc736f0be86ee019ccb8617c014937dde532/app/src/main/res/drawable-hdpi/udacity_toolbar_logo.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/details_page_profile_pic.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UdacityAndroidDevScholarship/quiz-app/fa62bc736f0be86ee019ccb8617c014937dde532/app/src/main/res/drawable-mdpi/details_page_profile_pic.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/ic_person.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UdacityAndroidDevScholarship/quiz-app/fa62bc736f0be86ee019ccb8617c014937dde532/app/src/main/res/drawable-mdpi/ic_person.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/ic_rating_star.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UdacityAndroidDevScholarship/quiz-app/fa62bc736f0be86ee019ccb8617c014937dde532/app/src/main/res/drawable-mdpi/ic_rating_star.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/ic_track.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UdacityAndroidDevScholarship/quiz-app/fa62bc736f0be86ee019ccb8617c014937dde532/app/src/main/res/drawable-mdpi/ic_track.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/udacity_toolbar_logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UdacityAndroidDevScholarship/quiz-app/fa62bc736f0be86ee019ccb8617c014937dde532/app/src/main/res/drawable-mdpi/udacity_toolbar_logo.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-nodpi-v4/nav_header.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UdacityAndroidDevScholarship/quiz-app/fa62bc736f0be86ee019ccb8617c014937dde532/app/src/main/res/drawable-nodpi-v4/nav_header.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-nodpi-v4/profile.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UdacityAndroidDevScholarship/quiz-app/fa62bc736f0be86ee019ccb8617c014937dde532/app/src/main/res/drawable-nodpi-v4/profile.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-nodpi-v4/splash_background.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UdacityAndroidDevScholarship/quiz-app/fa62bc736f0be86ee019ccb8617c014937dde532/app/src/main/res/drawable-nodpi-v4/splash_background.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable-nodpi-v4/udacitylogo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UdacityAndroidDevScholarship/quiz-app/fa62bc736f0be86ee019ccb8617c014937dde532/app/src/main/res/drawable-nodpi-v4/udacitylogo.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-nodpi-v4/wallpaper.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UdacityAndroidDevScholarship/quiz-app/fa62bc736f0be86ee019ccb8617c014937dde532/app/src/main/res/drawable-nodpi-v4/wallpaper.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
1 |
7 |
12 |
13 |
19 |
22 |
25 |
26 |
27 |
28 |
34 |
35 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/details_page_profile_pic.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UdacityAndroidDevScholarship/quiz-app/fa62bc736f0be86ee019ccb8617c014937dde532/app/src/main/res/drawable-xhdpi/details_page_profile_pic.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/ic_person.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UdacityAndroidDevScholarship/quiz-app/fa62bc736f0be86ee019ccb8617c014937dde532/app/src/main/res/drawable-xhdpi/ic_person.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/ic_rating_star.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UdacityAndroidDevScholarship/quiz-app/fa62bc736f0be86ee019ccb8617c014937dde532/app/src/main/res/drawable-xhdpi/ic_rating_star.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/ic_track.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UdacityAndroidDevScholarship/quiz-app/fa62bc736f0be86ee019ccb8617c014937dde532/app/src/main/res/drawable-xhdpi/ic_track.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/udacity_toolbar_logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UdacityAndroidDevScholarship/quiz-app/fa62bc736f0be86ee019ccb8617c014937dde532/app/src/main/res/drawable-xhdpi/udacity_toolbar_logo.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/details_page_profile_pic.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UdacityAndroidDevScholarship/quiz-app/fa62bc736f0be86ee019ccb8617c014937dde532/app/src/main/res/drawable-xxhdpi/details_page_profile_pic.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/ic_person.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UdacityAndroidDevScholarship/quiz-app/fa62bc736f0be86ee019ccb8617c014937dde532/app/src/main/res/drawable-xxhdpi/ic_person.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/ic_rating_star.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UdacityAndroidDevScholarship/quiz-app/fa62bc736f0be86ee019ccb8617c014937dde532/app/src/main/res/drawable-xxhdpi/ic_rating_star.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/ic_track.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UdacityAndroidDevScholarship/quiz-app/fa62bc736f0be86ee019ccb8617c014937dde532/app/src/main/res/drawable-xxhdpi/ic_track.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/udacity_toolbar_logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UdacityAndroidDevScholarship/quiz-app/fa62bc736f0be86ee019ccb8617c014937dde532/app/src/main/res/drawable-xxhdpi/udacity_toolbar_logo.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/akshit.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UdacityAndroidDevScholarship/quiz-app/fa62bc736f0be86ee019ccb8617c014937dde532/app/src/main/res/drawable/akshit.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable/btn_submit_bg.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 | -
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/createquiz.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/details_page_linerlayout_border.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | -
4 |
6 |
7 |
10 |
11 |
12 | -
13 |
15 |
16 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/google_logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UdacityAndroidDevScholarship/quiz-app/fa62bc736f0be86ee019ccb8617c014937dde532/app/src/main/res/drawable/google_logo.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/gradient.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
9 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_android_black_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_bookmark_black_24dp.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_bookmark_border_black_24dp.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_bookmark_warning.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_check_circle_24dp.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_check_circle_black_24dp.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_chevron_right_black_24dp.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_clear_black_24dp.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_close.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_close_black_24dp.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_controls.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_edit.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_edit_nav.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_frown_face.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_help.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UdacityAndroidDevScholarship/quiz-app/fa62bc736f0be86ee019ccb8617c014937dde532/app/src/main/res/drawable/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_loved.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UdacityAndroidDevScholarship/quiz-app/fa62bc736f0be86ee019ccb8617c014937dde532/app/src/main/res/drawable/ic_loved.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_menu_white_24dp.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_next_circle_filled.xml:
--------------------------------------------------------------------------------
1 |
3 |
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_notification_deadline.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UdacityAndroidDevScholarship/quiz-app/fa62bc736f0be86ee019ccb8617c014937dde532/app/src/main/res/drawable/ic_notification_deadline.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_notification_quiz.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UdacityAndroidDevScholarship/quiz-app/fa62bc736f0be86ee019ccb8617c014937dde532/app/src/main/res/drawable/ic_notification_quiz.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_notification_resource.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UdacityAndroidDevScholarship/quiz-app/fa62bc736f0be86ee019ccb8617c014937dde532/app/src/main/res/drawable/ic_notification_resource.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_notifications.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_picture.xml:
--------------------------------------------------------------------------------
1 |
3 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_play_arrow_black_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_previous_circle_filled.xml:
--------------------------------------------------------------------------------
1 |
3 |
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_quiz_list.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
13 |
16 |
19 |
22 |
25 |
28 |
31 |
34 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_resources_android.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_scoreboard.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_send_color_bg.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | -
5 |
8 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_send_white_24dp.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_slack.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
13 |
16 |
19 |
22 |
25 |
28 |
31 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_submit_btn.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_udacity.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/image_border.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/india_2018.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
11 |
14 |
17 |
20 |
23 |
26 |
29 |
32 |
35 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/intro_diagnol_layout_one.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | -
5 |
6 |
7 |
8 | -
12 |
16 |
18 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/intro_diagnol_layout_two.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | -
5 |
6 |
7 |
8 | -
12 |
16 |
18 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/item_counter_one.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/item_counter_two.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/label_border.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
7 |
8 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/notifications.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/quizlist.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/resources.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ripple_effect.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 | -
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/scoreboard.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/scrim_bg_quiz_list.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
9 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/scrim_bottom.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
9 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/scrim_top.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/shape_whit_radius_bg.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/signin_pic.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UdacityAndroidDevScholarship/quiz-app/fa62bc736f0be86ee019ccb8617c014937dde532/app/src/main/res/drawable/signin_pic.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/splashscreen_progressbar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | -
4 |
5 |
6 |
7 |
8 |
9 |
10 | -
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/udacity_app_logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UdacityAndroidDevScholarship/quiz-app/fa62bc736f0be86ee019ccb8617c014937dde532/app/src/main/res/drawable/udacity_app_logo.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/user_profile_gradient.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/white_radius.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
9 |
--------------------------------------------------------------------------------
/app/src/main/res/font/roboto.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
--------------------------------------------------------------------------------
/app/src/main/res/font/roboto_bold.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
--------------------------------------------------------------------------------
/app/src/main/res/font/roboto_medium.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
--------------------------------------------------------------------------------
/app/src/main/res/font/roboto_thin.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_intro.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
12 |
13 |
14 |
23 |
24 |
25 |
26 |
32 |
33 |
39 |
40 |
46 |
47 |
48 |
49 |
50 |
51 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
12 |
16 |
17 |
21 |
22 |
33 |
34 |
39 |
40 |
46 |
47 |
51 |
52 |
53 |
54 |
62 |
63 |
70 |
71 |
72 |
73 |
74 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_notification.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
17 |
18 |
27 |
28 |
29 |
30 |
34 |
35 |
40 |
41 |
46 |
47 |
52 |
53 |
54 |
55 |
56 |
61 |
62 |
63 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_quiz_discussion.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
17 |
18 |
19 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
18 |
19 |
31 |
32 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_sign_in.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
18 |
19 |
27 |
28 |
39 |
40 |
48 |
49 |
50 |
51 |
52 |
53 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_splash_screen.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
20 |
21 |
31 |
32 |
42 |
43 |
44 |
45 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/chk_multiple_choice.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/content_quiz_discussion.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
12 |
22 |
23 |
24 |
43 |
44 |
57 |
58 |
59 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_home.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_quizzes.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
14 |
15 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/intro_screen_one.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
13 |
14 |
15 |
21 |
22 |
28 |
35 |
36 |
46 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_discussion_others.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
16 |
17 |
21 |
22 |
33 |
34 |
40 |
41 |
45 |
46 |
57 |
58 |
64 |
65 |
66 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/menu_counter_notifications.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
17 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/menu_counter_quizzes.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
16 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/nav_header_navigation_drawer.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
10 |
11 |
21 |
22 |
32 |
33 |
41 |
42 |
51 |
52 |
58 |
59 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/rb_single_choice.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/tab_notification_screen.xml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
17 |
18 |
34 |
35 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/main_menu.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/navigation_drawer_items.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/quiz_detail_menu.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher_12.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UdacityAndroidDevScholarship/quiz-app/fa62bc736f0be86ee019ccb8617c014937dde532/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UdacityAndroidDevScholarship/quiz-app/fa62bc736f0be86ee019ccb8617c014937dde532/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UdacityAndroidDevScholarship/quiz-app/fa62bc736f0be86ee019ccb8617c014937dde532/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UdacityAndroidDevScholarship/quiz-app/fa62bc736f0be86ee019ccb8617c014937dde532/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UdacityAndroidDevScholarship/quiz-app/fa62bc736f0be86ee019ccb8617c014937dde532/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UdacityAndroidDevScholarship/quiz-app/fa62bc736f0be86ee019ccb8617c014937dde532/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UdacityAndroidDevScholarship/quiz-app/fa62bc736f0be86ee019ccb8617c014937dde532/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UdacityAndroidDevScholarship/quiz-app/fa62bc736f0be86ee019ccb8617c014937dde532/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UdacityAndroidDevScholarship/quiz-app/fa62bc736f0be86ee019ccb8617c014937dde532/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UdacityAndroidDevScholarship/quiz-app/fa62bc736f0be86ee019ccb8617c014937dde532/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UdacityAndroidDevScholarship/quiz-app/fa62bc736f0be86ee019ccb8617c014937dde532/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UdacityAndroidDevScholarship/quiz-app/fa62bc736f0be86ee019ccb8617c014937dde532/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UdacityAndroidDevScholarship/quiz-app/fa62bc736f0be86ee019ccb8617c014937dde532/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UdacityAndroidDevScholarship/quiz-app/fa62bc736f0be86ee019ccb8617c014937dde532/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UdacityAndroidDevScholarship/quiz-app/fa62bc736f0be86ee019ccb8617c014937dde532/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/values/arrays.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | - Android developer
5 |
8 |
9 |
10 |
11 | - @string/theme_option_dark
12 | - @string/theme_option_light
13 |
14 |
15 |
16 | - @string/theme_option_dark
17 | - @string/theme_option_light
18 |
19 |
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #243447
4 | #000D20
5 | #02B4E1
6 |
7 | #4e5d72
8 | #ffffff
9 | #6c6c6c
10 | #000000
11 | #00ffffff
12 | #283747
13 | #D32F2F
14 |
15 | #1B2836
16 |
17 | #90ffffff
18 |
19 | #90000000
20 | #e9e9e9
21 | #22ffffff
22 | #ADD8E6
23 |
24 |
25 | #22C461
26 | #DC1A2E
27 | #FFBE4E
28 |
29 | #00BCD4
30 | #009688
31 |
32 | #6f000000
33 | #0D000000
34 |
35 | #86000000
36 |
37 |
38 | #151e3f
39 | #63adf2
40 | #32e875
41 | #ea7317
42 |
43 |
44 | #0288D1
45 | #00796B
46 | #7B1FA2
47 | #C2185B
48 | #D32F2F
49 |
50 | #81D4FA
51 | #80CBC4
52 | #CE93D8
53 | #F48FB1
54 | #EF9A9A
55 | #22C461
56 | #DC1A2E
57 |
58 |
59 | - @color/dot_dark1
60 | - @color/dot_dark2
61 | - @color/dot_dark3
62 | - @color/dot_dark4
63 | - @color/dot_dark5
64 |
65 |
66 |
67 | - @color/dot_light1
68 | - @color/dot_light2
69 | - @color/dot_light3
70 | - @color/dot_light4
71 | - @color/dot_light5
72 |
73 |
74 | #BDBDBD
75 | #bdbdbd
76 |
77 |
--------------------------------------------------------------------------------
/app/src/main/res/values/font_certs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | - @array/com_google_android_gms_fonts_certs_dev
5 | - @array/com_google_android_gms_fonts_certs_prod
6 |
7 |
8 | -
9 | MIIEqDCCA5CgAwIBAgIJANWFuGx90071MA0GCSqGSIb3DQEBBAUAMIGUMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEQMA4GA1UEChMHQW5kcm9pZDEQMA4GA1UECxMHQW5kcm9pZDEQMA4GA1UEAxMHQW5kcm9pZDEiMCAGCSqGSIb3DQEJARYTYW5kcm9pZEBhbmRyb2lkLmNvbTAeFw0wODA0MTUyMzM2NTZaFw0zNTA5MDEyMzM2NTZaMIGUMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEQMA4GA1UEChMHQW5kcm9pZDEQMA4GA1UECxMHQW5kcm9pZDEQMA4GA1UEAxMHQW5kcm9pZDEiMCAGCSqGSIb3DQEJARYTYW5kcm9pZEBhbmRyb2lkLmNvbTCCASAwDQYJKoZIhvcNAQEBBQADggENADCCAQgCggEBANbOLggKv+IxTdGNs8/TGFy0PTP6DHThvbbR24kT9ixcOd9W+EaBPWW+wPPKQmsHxajtWjmQwWfna8mZuSeJS48LIgAZlKkpFeVyxW0qMBujb8X8ETrWy550NaFtI6t9+u7hZeTfHwqNvacKhp1RbE6dBRGWynwMVX8XW8N1+UjFaq6GCJukT4qmpN2afb8sCjUigq0GuMwYXrFVee74bQgLHWGJwPmvmLHC69EH6kWr22ijx4OKXlSIx2xT1AsSHee70w5iDBiK4aph27yH3TxkXy9V89TDdexAcKk/cVHYNnDBapcavl7y0RiQ4biu8ymM8Ga/nmzhRKya6G0cGw8CAQOjgfwwgfkwHQYDVR0OBBYEFI0cxb6VTEM8YYY6FbBMvAPyT+CyMIHJBgNVHSMEgcEwgb6AFI0cxb6VTEM8YYY6FbBMvAPyT+CyoYGapIGXMIGUMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEQMA4GA1UEChMHQW5kcm9pZDEQMA4GA1UECxMHQW5kcm9pZDEQMA4GA1UEAxMHQW5kcm9pZDEiMCAGCSqGSIb3DQEJARYTYW5kcm9pZEBhbmRyb2lkLmNvbYIJANWFuGx90071MAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEEBQADggEBABnTDPEF+3iSP0wNfdIjIz1AlnrPzgAIHVvXxunW7SBrDhEglQZBbKJEk5kT0mtKoOD1JMrSu1xuTKEBahWRbqHsXclaXjoBADb0kkjVEJu/Lh5hgYZnOjvlba8Ld7HCKePCVePoTJBdI4fvugnL8TsgK05aIskyY0hKI9L8KfqfGTl1lzOv2KoWD0KWwtAWPoGChZxmQ+nBli+gwYMzM1vAkP+aayLe0a1EQimlOalO762r0GXO0ks+UeXde2Z4e+8S/pf7pITEI/tP+MxJTALw9QUWEv9lKTk+jkbqxbsh8nfBUapfKqYn0eidpwq2AzVp3juYl7//fKnaPhJD9gs=
10 |
11 |
12 |
13 | -
14 | MIIEQzCCAyugAwIBAgIJAMLgh0ZkSjCNMA0GCSqGSIb3DQEBBAUAMHQxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtHb29nbGUgSW5jLjEQMA4GA1UECxMHQW5kcm9pZDEQMA4GA1UEAxMHQW5kcm9pZDAeFw0wODA4MjEyMzEzMzRaFw0zNjAxMDcyMzEzMzRaMHQxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtHb29nbGUgSW5jLjEQMA4GA1UECxMHQW5kcm9pZDEQMA4GA1UEAxMHQW5kcm9pZDCCASAwDQYJKoZIhvcNAQEBBQADggENADCCAQgCggEBAKtWLgDYO6IIrgqWbxJOKdoR8qtW0I9Y4sypEwPpt1TTcvZApxsdyxMJZ2JORland2qSGT2y5b+3JKkedxiLDmpHpDsz2WCbdxgxRczfey5YZnTJ4VZbH0xqWVW/8lGmPav5xVwnIiJS6HXk+BVKZF+JcWjAsb/GEuq/eFdpuzSqeYTcfi6idkyugwfYwXFU1+5fZKUaRKYCwkkFQVfcAs1fXA5V+++FGfvjJ/CxURaSxaBvGdGDhfXE28LWuT9ozCl5xw4Yq5OGazvV24mZVSoOO0yZ31j7kYvtwYK6NeADwbSxDdJEqO4k//0zOHKrUiGYXtqw/A0LFFtqoZKFjnkCAQOjgdkwgdYwHQYDVR0OBBYEFMd9jMIhF1Ylmn/Tgt9r45jk14alMIGmBgNVHSMEgZ4wgZuAFMd9jMIhF1Ylmn/Tgt9r45jk14aloXikdjB0MQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEUMBIGA1UEChMLR29vZ2xlIEluYy4xEDAOBgNVBAsTB0FuZHJvaWQxEDAOBgNVBAMTB0FuZHJvaWSCCQDC4IdGZEowjTAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBAUAA4IBAQBt0lLO74UwLDYKqs6Tm8/yzKkEu116FmH4rkaymUIE0P9KaMftGlMexFlaYjzmB2OxZyl6euNXEsQH8gjwyxCUKRJNexBiGcCEyj6z+a1fuHHvkiaai+KL8W1EyNmgjmyy8AW7P+LLlkR+ho5zEHatRbM/YAnqGcFh5iZBqpknHf1SKMXFh4dd239FJ1jWYfbMDMy3NS5CTMQ2XFI1MvcyUTdZPErjQfTbQe3aDQsQcafEQPD+nqActifKZ0Np0IS9L9kR/wbNvyz6ENwPiTrjV2KRkEjH78ZMcUQXg0L3BYHJ3lc69Vs5Ddf9uUGGMYldX3WfMBEmh/9iFBDAaTCK
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/app/src/main/res/values/ic_launcher_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #FFFFFF
4 |
--------------------------------------------------------------------------------
/app/src/main/res/values/integers.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 4
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/values/preloaded_fonts.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | - @font/roboto_medium
5 | - @font/roboto_thin
6 |
7 |
8 |
--------------------------------------------------------------------------------
/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
14 |
15 |
18 |
19 |
25 |
26 |
29 |
30 |
31 |
35 |
36 |
47 |
48 |
49 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
74 |
75 |
78 |
79 |
80 |
81 |
--------------------------------------------------------------------------------
/app/src/main/res/xml/my_backup_rules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/xml/settings_app.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
13 |
14 |
15 |
21 |
22 |
23 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/app/src/test/java/com/developervishalsehgal/udacityscholarsapp/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.developervishalsehgal.udacityscholarsapp;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() throws Exception {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 |
5 | repositories {
6 | google()
7 | jcenter()
8 | maven {
9 | url 'https://maven.fabric.io/public'
10 | }
11 | }
12 | dependencies {
13 | classpath 'com.android.tools.build:gradle:3.1.2'
14 |
15 |
16 | // NOTE: Do not place your application dependencies here; they belong
17 | // in the individual module build.gradle files
18 | classpath 'com.google.gms:google-services:3.2.0'
19 |
20 | // For Crashlytics
21 | classpath 'io.fabric.tools:gradle:1.25.1'
22 | }
23 | }
24 |
25 | allprojects {
26 | repositories {
27 | google()
28 | jcenter()
29 | maven {
30 | url 'https://maven.fabric.io/public'
31 | }
32 | }
33 | }
34 |
35 | task clean(type: Delete) {
36 | delete rootProject.buildDir
37 | }
38 |
39 |
40 | // Define versions in a singleplace
41 | ext {
42 | // Sdk and tools
43 | minSdkVersion = 21
44 | targetSdkVersion = 27
45 | compileSdkVersion = 27
46 | // App dependencies
47 | supportLibVersion = "27.1.1"
48 | glideVersion = '4.7.1'
49 | junitVersion = '4.12'
50 | constraintLayoutVersion = '1.1.0'
51 | gsonVersion = '2.8.0'
52 | circleimageviewVersion = '3.0.2'
53 | }
--------------------------------------------------------------------------------
/docs/app_arch.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UdacityAndroidDevScholarship/quiz-app/fa62bc736f0be86ee019ccb8617c014937dde532/docs/app_arch.png
--------------------------------------------------------------------------------
/docs/issue_template.md:
--------------------------------------------------------------------------------
1 | **Please remove whichever section is not relevant.** (e.g. If you are creating a feature request issue, remove all bug and UI enhancement related details below)
2 |
3 | **Is it a? (pick one)**
4 |
5 | - [x] Bug
6 |
7 | - [ ] Feature Request
8 |
9 | - [ ] UI Enhancement Request
10 |
11 | ## Bug Report
12 |
13 | ### Are you ready to report?
14 | - Your issue may already be reported! Please search on the [issue track](../) before creating one.
15 | - Ensure you have tested with the last (dev) version of the software. (If not, and if possible, run your test again with the most recent version available.)
16 |
17 | ### Environment
18 | * Android studio version : _____
19 | * Operating system : _____
20 | * Tested on (emulator/device - details) : _____
21 |
22 | ### The Bug:
23 | * Description: _____
24 | * When does this occur?: _____
25 | * attach screenshot / stacktrace: _____
26 |
27 | #### As per your understanding what is:
28 | * Expected behaviour: ______
29 | * Actual Behaviour: ______
30 |
31 | #### Steps to reproduce:
32 | 1. _____
33 | 2. _____
34 | 3. _____
35 | ...
36 |
37 |
38 | ### Other Comments:
39 | * What is the context of this ticket? If not obvious, explain why you need to do this.
40 | * If you have an idea about the technical background of the ticket, please share it.
41 |
42 | ## Feature Request
43 |
44 | #### Feature Description
45 |
46 | Please describe the feature you want to add to the project.
47 |
48 | ## UI Enhancement Request
49 |
50 | #### Description
51 |
52 | Please describe the UI changes/enhancements you want to add to the project. Try Uploading a screenshot/image for reference.
53 |
--------------------------------------------------------------------------------
/docs/mvp_simple.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UdacityAndroidDevScholarship/quiz-app/fa62bc736f0be86ee019ccb8617c014937dde532/docs/mvp_simple.png
--------------------------------------------------------------------------------
/docs/pull_request_template.md:
--------------------------------------------------------------------------------
1 |
2 | Fixes #[Insert_issue_number_here]
3 |
4 | ## Description
5 |
6 | _A few sentences describing the overall goals of the pull request's commits.
7 | What is the current behavior of the app? What is the updated/expected behavior
8 | with this PR?_
9 |
10 |
11 | ## Screenshots
12 |
13 | **BEFORE**:
14 | [if applicable, insert screenshot here]
15 |
16 | **AFTER**:
17 | [insert screenshot here]
18 |
19 |
20 | ## Other changes (e.g. bug fixes, UI tweaks, refactors)
21 |
22 | _Descriptions of minor changes here._
23 |
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Gradle settings configured through the IDE *will override*
5 | # any settings specified in this file.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | org.gradle.jvmargs=-Xmx1536m
13 |
14 | # When configured, Gradle will run in incubating parallel mode.
15 | # This option should only be used with decoupled projects. More details, visit
16 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
17 | # org.gradle.parallel=true
18 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UdacityAndroidDevScholarship/quiz-app/fa62bc736f0be86ee019ccb8617c014937dde532/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Tue Apr 17 05:30:22 IST 2018
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
7 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
--------------------------------------------------------------------------------