├── .gitignore ├── CONTRIBUTING.md ├── README.md ├── app ├── .gitignore ├── build.gradle ├── google-services.json ├── keys │ └── quiz_temp_key.jks ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── developervishalsehgal │ │ └── udacityscholarsapp │ │ └── ExampleInstrumentedTest.java │ ├── main │ ├── AndroidManifest.xml │ ├── assets │ │ ├── fonts │ │ │ └── font_app_title.ttf │ │ └── loading_animation.json │ ├── ic_launcher-web.png │ ├── java │ │ └── com │ │ │ └── developervishalsehgal │ │ │ └── udacityscholarsapp │ │ │ ├── application │ │ │ └── AppClass.java │ │ │ ├── data │ │ │ ├── AppDataHandler.java │ │ │ ├── DataHandler.java │ │ │ ├── DataHandlerProvider.java │ │ │ ├── PrefsHelper.java │ │ │ ├── local │ │ │ │ ├── DBHandler.java │ │ │ │ ├── DBHelper.java │ │ │ │ ├── FilesContract.java │ │ │ │ ├── NotificationContract.java │ │ │ │ ├── OptionContract.java │ │ │ │ └── QuestionContract.java │ │ │ ├── models │ │ │ │ ├── Comment.java │ │ │ │ ├── Discussion.java │ │ │ │ ├── Notification.java │ │ │ │ ├── NotificationPrefs.java │ │ │ │ ├── Option.java │ │ │ │ ├── Question.java │ │ │ │ ├── Quiz.java │ │ │ │ ├── QuizAttempted.java │ │ │ │ ├── Resource.java │ │ │ │ └── User.java │ │ │ └── remote │ │ │ │ ├── FirebaseHandler.java │ │ │ │ ├── FirebaseHandlerImpl.java │ │ │ │ └── FirebaseProvider.java │ │ │ ├── services │ │ │ ├── FBMessagingService.java │ │ │ └── FCMTokenFetcher.java │ │ │ ├── ui │ │ │ ├── BasePresenter.java │ │ │ ├── BaseView.java │ │ │ ├── PresenterInjector.java │ │ │ ├── components │ │ │ │ └── CustomTextView.java │ │ │ ├── create │ │ │ │ └── CreateQuizContract.java │ │ │ ├── discussion │ │ │ │ ├── QuizDiscussionActivity.java │ │ │ │ ├── QuizDiscussionAdapter.java │ │ │ │ ├── QuizDiscussionContract.java │ │ │ │ └── QuizDiscussionPresenter.java │ │ │ ├── home │ │ │ │ ├── HomeActivity.java │ │ │ │ ├── HomeContract.java │ │ │ │ ├── HomePresenter.java │ │ │ │ └── QuizAdapter.java │ │ │ ├── intro │ │ │ │ └── IntroductionContract.java │ │ │ ├── notification │ │ │ │ ├── NotificationActivity.java │ │ │ │ ├── NotificationContract.java │ │ │ │ ├── NotificationPresenter.java │ │ │ │ ├── NotificationTabFragment.java │ │ │ │ └── NotificationsAdapter.java │ │ │ ├── profile │ │ │ │ ├── ProfileContract.java │ │ │ │ ├── ProfilePresenter.java │ │ │ │ └── UserProfileActivity.java │ │ │ ├── quizattempt │ │ │ │ ├── AttemptQuizActivity.java │ │ │ │ ├── AttemptQuizContract.java │ │ │ │ └── AttemptQuizPresenter.java │ │ │ ├── quizdetails │ │ │ │ ├── QuizDetailsActivity.java │ │ │ │ ├── QuizDetailsContract.java │ │ │ │ └── QuizDetailsPresenter.java │ │ │ ├── settings │ │ │ │ ├── SettingsActivity.java │ │ │ │ └── SettingsFragment.java │ │ │ ├── signin │ │ │ │ ├── SignInActivity.java │ │ │ │ ├── SignInContract.java │ │ │ │ └── SignInPresenter.java │ │ │ └── transformers │ │ │ │ └── ParallaxPageTransformer.java │ │ │ └── utils │ │ │ ├── AppConstants.java │ │ │ ├── Connectivity.java │ │ │ ├── NotificationUtils.java │ │ │ └── Utils.java │ └── res │ │ ├── anim │ │ ├── anim_nothing.xml │ │ ├── slide_in_left.xml │ │ ├── slide_in_right.xml │ │ ├── slide_in_up.xml │ │ ├── slide_out_down.xml │ │ └── slide_out_right.xml │ │ ├── animator │ │ └── appbar_elevated.xml │ │ ├── drawable-hdpi │ │ ├── details_page_profile_pic.png │ │ ├── ic_person.png │ │ ├── ic_rating_star.png │ │ ├── ic_track.png │ │ └── udacity_toolbar_logo.png │ │ ├── drawable-mdpi │ │ ├── details_page_profile_pic.png │ │ ├── ic_person.png │ │ ├── ic_rating_star.png │ │ ├── ic_track.png │ │ └── udacity_toolbar_logo.png │ │ ├── drawable-nodpi-v4 │ │ ├── nav_header.png │ │ ├── profile.png │ │ ├── splash_background.jpg │ │ ├── udacitylogo.png │ │ └── wallpaper.jpg │ │ ├── drawable-v24 │ │ └── ic_launcher_foreground.xml │ │ ├── drawable-xhdpi │ │ ├── details_page_profile_pic.png │ │ ├── ic_person.png │ │ ├── ic_rating_star.png │ │ ├── ic_track.png │ │ └── udacity_toolbar_logo.png │ │ ├── drawable-xxhdpi │ │ ├── details_page_profile_pic.png │ │ ├── ic_person.png │ │ ├── ic_rating_star.png │ │ ├── ic_track.png │ │ └── udacity_toolbar_logo.png │ │ ├── drawable │ │ ├── akshit.jpg │ │ ├── btn_submit_bg.xml │ │ ├── createquiz.xml │ │ ├── details_page_linerlayout_border.xml │ │ ├── google_logo.png │ │ ├── gradient.xml │ │ ├── ic_android_black_24dp.xml │ │ ├── ic_bookmark_black_24dp.xml │ │ ├── ic_bookmark_border_black_24dp.xml │ │ ├── ic_bookmark_warning.xml │ │ ├── ic_check_circle_24dp.xml │ │ ├── ic_check_circle_black_24dp.xml │ │ ├── ic_chevron_right_black_24dp.xml │ │ ├── ic_clear_black_24dp.xml │ │ ├── ic_close.xml │ │ ├── ic_close_black_24dp.xml │ │ ├── ic_controls.xml │ │ ├── ic_create_quiz.xml │ │ ├── ic_edit.xml │ │ ├── ic_edit_nav.xml │ │ ├── ic_fireworks.xml │ │ ├── ic_frown_face.xml │ │ ├── ic_help.xml │ │ ├── ic_launcher.png │ │ ├── ic_launcher_background.xml │ │ ├── ic_loved.png │ │ ├── ic_menu_white_24dp.xml │ │ ├── ic_next_circle_filled.xml │ │ ├── ic_notification_deadline.png │ │ ├── ic_notification_quiz.png │ │ ├── ic_notification_resource.png │ │ ├── ic_notifications.xml │ │ ├── ic_picture.xml │ │ ├── ic_play_arrow_black_24dp.xml │ │ ├── ic_previous_circle_filled.xml │ │ ├── ic_quiz_list.xml │ │ ├── ic_resources_android.xml │ │ ├── ic_scoreboard.xml │ │ ├── ic_send_color_bg.xml │ │ ├── ic_send_white_24dp.xml │ │ ├── ic_slack.xml │ │ ├── ic_submit_btn.xml │ │ ├── ic_udacity.xml │ │ ├── image_border.xml │ │ ├── india_2018.xml │ │ ├── intro_diagnol_layout_one.xml │ │ ├── intro_diagnol_layout_two.xml │ │ ├── item_counter_one.xml │ │ ├── item_counter_two.xml │ │ ├── label_border.xml │ │ ├── notifications.xml │ │ ├── quizlist.xml │ │ ├── resources.xml │ │ ├── ripple_effect.xml │ │ ├── scoreboard.xml │ │ ├── scrim_bg_quiz_list.xml │ │ ├── scrim_bottom.xml │ │ ├── scrim_top.xml │ │ ├── shape_whit_radius_bg.xml │ │ ├── signin_pic.png │ │ ├── splashscreen_progressbar.xml │ │ ├── udacity_app_logo.png │ │ ├── user_profile_gradient.xml │ │ └── white_radius.xml │ │ ├── font │ │ ├── roboto.xml │ │ ├── roboto_bold.xml │ │ ├── roboto_medium.xml │ │ └── roboto_thin.xml │ │ ├── layout │ │ ├── activity_attempt_quiz.xml │ │ ├── activity_details_page.xml │ │ ├── activity_home.xml │ │ ├── activity_intro.xml │ │ ├── activity_main.xml │ │ ├── activity_notification.xml │ │ ├── activity_notification_detail.xml │ │ ├── activity_quiz_details.xml │ │ ├── activity_quiz_discussion.xml │ │ ├── activity_settings.xml │ │ ├── activity_sign_in.xml │ │ ├── activity_splash_screen.xml │ │ ├── activity_user_profile.xml │ │ ├── chk_multiple_choice.xml │ │ ├── content_quiz_discussion.xml │ │ ├── fragment_home.xml │ │ ├── fragment_quizzes.xml │ │ ├── home_quiz_list_filter.xml │ │ ├── intro_screen_one.xml │ │ ├── item_discussion_others.xml │ │ ├── item_discussion_self.xml │ │ ├── list_item_notifications.xml │ │ ├── list_item_quizzes.xml │ │ ├── list_item_resources.xml │ │ ├── menu_counter_notifications.xml │ │ ├── menu_counter_quizzes.xml │ │ ├── nav_header_navigation_drawer.xml │ │ ├── quizzes_list_item.xml │ │ ├── rb_single_choice.xml │ │ └── tab_notification_screen.xml │ │ ├── menu │ │ ├── main_menu.xml │ │ ├── navigation_drawer_items.xml │ │ └── quiz_detail_menu.xml │ │ ├── mipmap-anydpi-v26 │ │ ├── ic_launcher_12.xml │ │ └── ic_launcher_round.xml │ │ ├── mipmap-hdpi │ │ ├── ic_launcher.png │ │ ├── ic_launcher_foreground.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-mdpi │ │ ├── ic_launcher.png │ │ ├── ic_launcher_foreground.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xhdpi │ │ ├── ic_launcher.png │ │ ├── ic_launcher_foreground.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxhdpi │ │ ├── ic_launcher.png │ │ ├── ic_launcher_foreground.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxxhdpi │ │ ├── ic_launcher.png │ │ ├── ic_launcher_foreground.png │ │ └── ic_launcher_round.png │ │ ├── values │ │ ├── arrays.xml │ │ ├── colors.xml │ │ ├── dimens.xml │ │ ├── font_certs.xml │ │ ├── ic_launcher_background.xml │ │ ├── integers.xml │ │ ├── preloaded_fonts.xml │ │ ├── strings.xml │ │ └── styles.xml │ │ └── xml │ │ ├── my_backup_rules.xml │ │ └── settings_app.xml │ └── test │ └── java │ └── com │ └── developervishalsehgal │ └── udacityscholarsapp │ └── ExampleUnitTest.java ├── build.gradle ├── docs ├── CODESTYLE.md ├── app_arch.png ├── index.js ├── issue_template.md ├── mvp_simple.png └── pull_request_template.md ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── india_text.svg └── settings.gradle /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | .externalNativeBuild 10 | /.idea 11 | .idea 12 | app/google-services.json 13 | /app/debug 14 | /app/release -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | Thank you for showing interest in contributing to **Quiz App**. We appreciate your time and effort. Let’s work together, implement our learnings and build an awesome app. 4 | 5 | When contributing to this repository, please first discuss the change you wish to make via [issue](https://github.com/UdacityAndroidDevScholarship/quiz-app/issues), email, or [Slack](https://anddevindiascholars.slack.com) with the Mods/Co-Mods of this repository before making a change. You can find the details of all moderators in [README.md](https://github.com/UdacityAndroidDevScholarship/quiz-app/blob/master/README.md). 6 | 7 | Please note we have a code of conduct, follow it in all your interactions. 8 | Only valid contributions will be given proper attribution which are in line with the contribution guidelines listed below 9 | 10 | # Code of Conduct 11 | 12 | ## Standards 13 | 14 | * Welcoming and Respectful language and behavior 15 | * Constructive Criticism 16 | * Accepting Different Viewpoints and Team decision 17 | 18 | ## Unacceptable Behavior: 19 | 20 | * Trolling, insulting/derogatory, personal comments 21 | * Unethical means to highlight your contribution 22 | 23 | # How to get started? 24 | 25 | To get started, please abide by the following steps: 26 | 27 | 1. First check out the [issues](https://github.com/UdacityAndroidDevScholarship/quiz-app/issues) board. You can join the conversation if the topic you want to discuss is already open, otherwise create a new issue. You can create a new issue according to issue template. 28 | 2. After creating the issue, please drop a comment on the issue about you willing to work on the same & start working on it. The best and the most efficient PR will be merged to the project after the deadline provided the PR follows all the guidelines. 29 | 3. You can [fork](https://help.github.com/articles/fork-a-repo/) the repo and use the **development branch** of the repository. Please ensure you create a branch from **development branch** only. This is where the latest and approved changes reside. 30 | 4. [Create a branch](https://github.com/Kunena/Kunena-Forum/wiki/Create-a-new-branch-with-git-and-manage-branches) on your local repo specific to the issue or feature you are working on. [Push](https://help.github.com/articles/pushing-to-a-remote/) your work on that branch. 31 | 5. **Branch naming convention**: `bugfix-xxxxx`, `feature-xxxxx`, `enhance-xxxxx`, `refactor-xxxxx` or `misc-xxxxx`. 32 | `xxxxx`: 1-2 word description of the bug or feature or issue_id (separated by underscore “_”. E.g. feature-login_screen, refactor-notification_module etc.) 33 | 6. Please ensure your pull request is mergeable, take pull from original repo and resolve all conflicts locally before creating a PR. 34 | 7. After all is done on your end, you can submit a pull request from your branch to Quiz App's **development** branch. The PR will be reviewed and feedback will be given accordingly. 35 | 36 | >**Note**: 37 | >* Only the PRs that follow our guidelines will be entertained, so make sure you read the guidelines before raising a PR. 38 | >* For any future modifications or bugs please raise issue from the issue tab. 39 | >* Look out for all kinds of labels, specially the `High Priority` Label which requires immediate action. 40 | 41 | For complaints, queries and help, please contact us on slack at channel `#cp_quiz_app`. 42 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # QUIZ APP 2 | 3 | Hello, 4 | 5 | Thank you for showing interest in the project. Let's work together and make it big. 6 | 7 | ## Purpose of the Project - 8 | 9 | - Attempting all the quizzes will be easy for everyone. 10 | - Reminder and Notifications for the quizzes. 11 | - Access to the quiz for the revision even after the 3 months challenge. 12 | - Easy to manage quizzes and keeping the track of all attempted quizzes. 13 | - Android Resources: Useful resources related to Android based on a search keyword 14 | 15 | ### Mods: 16 | * Aditi Soni (@aditi.soni) 17 | * Vishal Sehgal (@sehgalvishal31) 18 | * Parth Joshi (@Parth J) 19 | 20 | 21 | ### Co-Mod: 22 | * Kaushal Dhruw(@Kaushal) 23 | * Vansh Badkul(@Vansh) 24 | * Sagarsrao(@Sagarsrao) 25 | * Thayumaanavan(@Thayumaanavan C R) 26 | 27 | #### Please have a look at this [video](https://drive.google.com/open?id=1vSSUh3LSNw9PfjyXhiXlF_j-zIO8SjYj) for better understanding. 28 | 29 | #### App Walkthrough 30 | [Click this link to view Prototype](https://invis.io/BPHUT69YG6A#/294684583_Home_Screen_Dark_Theme_Final) 31 | 32 | #### To get started, please read [Contributing Guidelines](https://github.com/UdacityAndroidDevScholarship/quiz-app/blob/master/CONTRIBUTING.md). 33 | 34 | > Please make sure to create a Pull Request to the *development* branch. 35 | 36 | #### Before committing any changes, please read [Code Style Guidelines](https://github.com/UdacityAndroidDevScholarship/quiz-app/wiki/Code-Style-Guidelines). 37 | 38 | #### For App Requirements, please read our [Github Wiki](https://github.com/UdacityAndroidDevScholarship/quiz-app/wiki). 39 | 40 | #### For Project Boards, please read our [Projects Section](https://github.com/UdacityAndroidDevScholarship/quiz-app/wiki/Project-Board). 41 | 42 | #### For mockups of all screens of the app, please have a look to [App-Mockups Wiki](https://github.com/UdacityAndroidDevScholarship/quiz-app/wiki/App-Mockups) 43 | 44 | #### For queries, you can reach out to us on our slack channel [#cp_quiz_app](https://anddevindiascholars.slack.com/messages/CA5HLKWEA). 45 | 46 | #### Know how to contribute to collaborative projects and git / github basics [YouTube](https://youtu.be/lXY02pZWR58) 47 | 48 | 49 | -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | /.idea -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | apply plugin: 'io.fabric' 3 | 4 | android { 5 | compileSdkVersion 27 6 | defaultConfig { 7 | applicationId "com.developervishalsehgal.udacityscholarsapp" 8 | minSdkVersion rootProject.ext.minSdkVersion 9 | targetSdkVersion rootProject.ext.targetSdkVersion 10 | versionCode 4 11 | versionName "1.1.4" 12 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 13 | } 14 | 15 | signingConfigs { 16 | debug { 17 | storeFile file("keys/quiz_temp_key.jks") 18 | storePassword "quizapprocks" 19 | keyAlias "quizapptemp" 20 | keyPassword "quizapprocks" 21 | } 22 | release { 23 | storeFile file("keys/quiz_temp_key.jks") 24 | storePassword "quizapprocks" 25 | keyAlias "quizapptemp" 26 | keyPassword "quizapprocks" 27 | } 28 | } 29 | 30 | buildTypes { 31 | release { 32 | shrinkResources false 33 | minifyEnabled false 34 | useProguard false 35 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 36 | signingConfig signingConfigs.release 37 | } 38 | 39 | debug { 40 | minifyEnabled false 41 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 42 | signingConfig signingConfigs.debug 43 | } 44 | } 45 | 46 | compileOptions { 47 | sourceCompatibility JavaVersion.VERSION_1_8 48 | targetCompatibility JavaVersion.VERSION_1_8 49 | } 50 | 51 | } 52 | 53 | dependencies { 54 | implementation fileTree(dir: 'libs', include: ['*.jar']) 55 | implementation "com.android.support.constraint:constraint-layout:$rootProject.constraintLayoutVersion" 56 | implementation 'com.airbnb.android:lottie:2.5.4' 57 | testImplementation "junit:junit:$rootProject.junitVersion" 58 | androidTestImplementation 'com.android.support.test:runner:1.0.2' 59 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' 60 | 61 | 62 | implementation "com.android.support:appcompat-v7:$rootProject.supportLibVersion" 63 | implementation "com.android.support:cardview-v7:$rootProject.supportLibVersion" 64 | implementation "com.android.support:design:$rootProject.supportLibVersion" 65 | implementation "com.android.support:recyclerview-v7:$rootProject.supportLibVersion" 66 | implementation "com.android.support:preference-v7:$rootProject.supportLibVersion" 67 | implementation "com.github.bumptech.glide:glide:$rootProject.glideVersion" 68 | annotationProcessor "com.github.bumptech.glide:compiler:$rootProject.glideVersion" 69 | implementation "com.mikhaellopez:circularimageview:$rootProject.circleimageviewVersion" 70 | implementation "com.android.support:support-v4:$rootProject.supportLibVersion" 71 | 72 | implementation "com.google.android.gms:play-services-auth:15.0.1" 73 | 74 | // Firebase dependencies 75 | implementation "com.google.firebase:firebase-core:15.0.2" 76 | implementation "com.google.firebase:firebase-auth:15.1.0" 77 | implementation "com.google.firebase:firebase-database:15.0.1" 78 | implementation "com.google.firebase:firebase-messaging:15.0.2" 79 | // Ends 80 | 81 | implementation group: 'com.google.code.gson', name: 'gson', version: "$rootProject.gsonVersion" 82 | 83 | implementation 'com.crashlytics.sdk.android:crashlytics:2.9.2' 84 | 85 | } 86 | 87 | apply plugin: 'com.google.gms.google-services' 88 | -------------------------------------------------------------------------------- /app/google-services.json: -------------------------------------------------------------------------------- 1 | { 2 | "project_info": { 3 | "project_number": "897350396907", 4 | "firebase_url": "https://udacityscholarsapp-91da6.firebaseio.com", 5 | "project_id": "udacityscholarsapp-91da6", 6 | "storage_bucket": "udacityscholarsapp-91da6.appspot.com" 7 | }, 8 | "client": [ 9 | { 10 | "client_info": { 11 | "mobilesdk_app_id": "1:897350396907:android:3527301905ca6725", 12 | "android_client_info": { 13 | "package_name": "com.developervishalsehgal.udacityscholarsapp" 14 | } 15 | }, 16 | "oauth_client": [ 17 | { 18 | "client_id": "897350396907-tnb23f600919uvj8up7hhh0v8go4spe4.apps.googleusercontent.com", 19 | "client_type": 1, 20 | "android_info": { 21 | "package_name": "com.developervishalsehgal.udacityscholarsapp", 22 | "certificate_hash": "e5fa556081e3efc8cd0efc90139ddbb98cae1bcc" 23 | } 24 | }, 25 | { 26 | "client_id": "897350396907-p9alch81qro22j44741h668glbn7uqic.apps.googleusercontent.com", 27 | "client_type": 3 28 | } 29 | ], 30 | "api_key": [ 31 | { 32 | "current_key": "AIzaSyAnqgG_GPIB0kNxWJutDKgVRNm3WxAer9U" 33 | } 34 | ], 35 | "services": { 36 | "analytics_service": { 37 | "status": 1 38 | }, 39 | "appinvite_service": { 40 | "status": 2, 41 | "other_platform_oauth_client": [ 42 | { 43 | "client_id": "897350396907-p9alch81qro22j44741h668glbn7uqic.apps.googleusercontent.com", 44 | "client_type": 3 45 | } 46 | ] 47 | }, 48 | "ads_service": { 49 | "status": 2 50 | } 51 | } 52 | } 53 | ], 54 | "configuration_version": "1" 55 | } -------------------------------------------------------------------------------- /app/keys/quiz_temp_key.jks: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UdacityAndroidDevScholarship/quiz-app/fa62bc736f0be86ee019ccb8617c014937dde532/app/keys/quiz_temp_key.jks -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /app/src/androidTest/java/com/developervishalsehgal/udacityscholarsapp/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package com.developervishalsehgal.udacityscholarsapp; 2 | 3 | import android.content.Context; 4 | import android.support.test.InstrumentationRegistry; 5 | import android.support.test.runner.AndroidJUnit4; 6 | 7 | import org.junit.Test; 8 | import org.junit.runner.RunWith; 9 | 10 | import static org.junit.Assert.*; 11 | 12 | /** 13 | * Instrumented test, which will execute on an Android device. 14 | * 15 | * @see Testing documentation 16 | */ 17 | @RunWith(AndroidJUnit4.class) 18 | public class ExampleInstrumentedTest { 19 | @Test 20 | public void useAppContext() throws Exception { 21 | // Context of the app under test. 22 | Context appContext = InstrumentationRegistry.getTargetContext(); 23 | 24 | assertEquals("com.developervishalsehgal.udacityscholarsapp", appContext.getPackageName()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/src/main/assets/fonts/font_app_title.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UdacityAndroidDevScholarship/quiz-app/fa62bc736f0be86ee019ccb8617c014937dde532/app/src/main/assets/fonts/font_app_title.ttf -------------------------------------------------------------------------------- /app/src/main/ic_launcher-web.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UdacityAndroidDevScholarship/quiz-app/fa62bc736f0be86ee019ccb8617c014937dde532/app/src/main/ic_launcher-web.png -------------------------------------------------------------------------------- /app/src/main/java/com/developervishalsehgal/udacityscholarsapp/application/AppClass.java: -------------------------------------------------------------------------------- 1 | package com.developervishalsehgal.udacityscholarsapp.application; 2 | 3 | import android.annotation.SuppressLint; 4 | import android.app.Application; 5 | import android.content.Context; 6 | 7 | /** 8 | * Created by dru on 16/04/18. 9 | */ 10 | 11 | public class AppClass extends Application { 12 | 13 | @SuppressLint("StaticFieldLeak") 14 | private static Context sContext = null; 15 | 16 | @Override 17 | public void onCreate() { 18 | super.onCreate(); 19 | sContext = this.getApplicationContext(); 20 | } 21 | 22 | public static Context getAppContext(){ 23 | return sContext; 24 | } 25 | } -------------------------------------------------------------------------------- /app/src/main/java/com/developervishalsehgal/udacityscholarsapp/data/DataHandlerProvider.java: -------------------------------------------------------------------------------- 1 | package com.developervishalsehgal.udacityscholarsapp.data; 2 | 3 | public class DataHandlerProvider { 4 | 5 | public static DataHandler provide() { 6 | return AppDataHandler.getInstance(); 7 | } 8 | 9 | } 10 | -------------------------------------------------------------------------------- /app/src/main/java/com/developervishalsehgal/udacityscholarsapp/data/local/FilesContract.java: -------------------------------------------------------------------------------- 1 | package com.developervishalsehgal.udacityscholarsapp.data.local; 2 | 3 | import android.provider.BaseColumns; 4 | 5 | /** 6 | * Files table contract based on schema by @pramodbharti. This class is kept for future when we 7 | * do implement FilesContract. Right now it is not implemented 8 | */ 9 | class FilesContract { 10 | 11 | private FilesContract() { 12 | // To prevent accidental instantiation 13 | } 14 | 15 | /** 16 | * Files Entry class defining the Files table columns. 17 | */ 18 | public static final class FilesEntry implements BaseColumns { 19 | 20 | public static final String TABLE_NAME = "files"; 21 | 22 | public static final String COLUMN_QUESTION_ID = "question_id"; 23 | 24 | public static final String COLUMN_FILES_PATH = "path"; 25 | 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /app/src/main/java/com/developervishalsehgal/udacityscholarsapp/data/local/NotificationContract.java: -------------------------------------------------------------------------------- 1 | package com.developervishalsehgal.udacityscholarsapp.data.local; 2 | 3 | import android.provider.BaseColumns; 4 | 5 | /** 6 | * Created by dell on 4/21/2018. 7 | */ 8 | 9 | public class NotificationContract { 10 | 11 | private NotificationContract() { 12 | // To prevent accidental instantiation 13 | } 14 | 15 | public static final class NotificationEntry implements BaseColumns { 16 | //DEFINING TABLE_NAME 17 | public static final String TABLE_NAME = "notification"; 18 | //DEFINING COLUMN_NAMES 19 | public static final String COLUMN_TIMESTAMP = "timestamp"; 20 | public static final String COLUMN_TITLE = "title"; 21 | public static final String COLUMN_DESCRIPTION = "description"; 22 | public static final String COLUMN_FROM = "sender"; 23 | public static final String COLUMN_TYPE = "type"; 24 | public static final String COLUMN_ACTION = "action_extra"; 25 | public static final String COLUMN_EXTRA_1 = "extra1"; 26 | public static final String COLUMN_EXTRA_2 = "extra2"; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /app/src/main/java/com/developervishalsehgal/udacityscholarsapp/data/local/OptionContract.java: -------------------------------------------------------------------------------- 1 | package com.developervishalsehgal.udacityscholarsapp.data.local; 2 | 3 | import android.provider.BaseColumns; 4 | 5 | /** 6 | * Option Contract Class based on the schema by @pramodbharti 7 | */ 8 | class OptionContract { 9 | 10 | private OptionContract(){ 11 | // To prevent accidental instantiation 12 | } 13 | 14 | public static final class OptionEntry implements BaseColumns { 15 | 16 | public static final String TABLE_NAME = "options"; 17 | 18 | public static final String COLUMN_QUESTION_ID = "question_id"; 19 | 20 | public static final String COLUMN_DESCRIPTION = "description"; 21 | 22 | public static final String COLUMN_IS_CORRECT = "is_correct"; 23 | 24 | public static final String COLUMN_REMARKS = "remarks"; 25 | 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /app/src/main/java/com/developervishalsehgal/udacityscholarsapp/data/local/QuestionContract.java: -------------------------------------------------------------------------------- 1 | package com.developervishalsehgal.udacityscholarsapp.data.local; 2 | 3 | import android.provider.BaseColumns; 4 | 5 | /** 6 | * Question Contract Class based on schema by @pramodbharti 7 | */ 8 | class QuestionContract { 9 | 10 | private QuestionContract() { 11 | // To prevent accidental instantiation 12 | } 13 | 14 | /** 15 | * Question Entry Class defining the columns of Question Table. 16 | */ 17 | public static final class QuestionEntry implements BaseColumns { 18 | 19 | public static final String TABLE_NAME = "questions"; 20 | 21 | public static final String COLUMN_DESCRIPTION = "description"; 22 | 23 | public static final String COLUMN_MARKS = "marks"; 24 | 25 | public static final String COLUMN_TYPE = "type"; 26 | 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /app/src/main/java/com/developervishalsehgal/udacityscholarsapp/data/models/Comment.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 | import java.util.Objects; 11 | 12 | @IgnoreExtraProperties 13 | public class Comment { 14 | 15 | @Expose 16 | @SerializedName("comment") 17 | private String mComment; 18 | 19 | @Expose 20 | @SerializedName("comment-by") 21 | private String mCommentBy; 22 | 23 | @Expose 24 | @SerializedName("commented-on") 25 | private long mCommentedOn; 26 | 27 | @Expose 28 | @SerializedName("commenter-id") 29 | private String mCommenterId; 30 | 31 | @Expose 32 | @SerializedName("commenter-pic") 33 | private String mImageUrl; 34 | 35 | /** 36 | * This field should be used for storing key of realtime database snapshot, otherwise ignore it 37 | */ 38 | @Exclude 39 | private String mKey; 40 | 41 | @Exclude 42 | private boolean mIsMyComment; 43 | 44 | @PropertyName("comment") 45 | public String getComment() { 46 | return mComment; 47 | } 48 | 49 | @PropertyName("comment") 50 | public void setComment(String comment) { 51 | mComment = comment; 52 | } 53 | 54 | @PropertyName("comment-by") 55 | public String getCommentBy() { 56 | return mCommentBy; 57 | } 58 | 59 | @PropertyName("comment-by") 60 | public void setCommentBy(String commentBy) { 61 | mCommentBy = commentBy; 62 | } 63 | 64 | @PropertyName("commented-on") 65 | public long getCommentedOn() { 66 | return mCommentedOn; 67 | } 68 | 69 | @PropertyName("commented-on") 70 | public void setCommentedOn(long commentedOn) { 71 | mCommentedOn = commentedOn; 72 | } 73 | 74 | @PropertyName("commenter-id") 75 | public String getCommenterId() { 76 | return mCommenterId; 77 | } 78 | 79 | @PropertyName("commenter-id") 80 | public void setCommenterId(String commenterId) { 81 | mCommenterId = commenterId; 82 | } 83 | 84 | @Exclude 85 | public String getKey() { 86 | return mKey; 87 | } 88 | 89 | @Exclude 90 | public void setKey(String key) { 91 | this.mKey = key; 92 | } 93 | 94 | @PropertyName("commenter-pic") 95 | public String getImage() { 96 | return mImageUrl; 97 | } 98 | 99 | @PropertyName("commenter-pic") 100 | public void setImage(String imageUrl) { 101 | this.mImageUrl = imageUrl; 102 | } 103 | 104 | @Exclude 105 | public boolean isMyComment() { 106 | return mIsMyComment; 107 | } 108 | 109 | @Exclude 110 | public void setMyComment(boolean myComment) { 111 | mIsMyComment = myComment; 112 | } 113 | 114 | @Override 115 | public boolean equals(Object o) { 116 | if (this == o) return true; 117 | if (o == null || getClass() != o.getClass()) return false; 118 | Comment comment = (Comment) o; 119 | return mCommentedOn == comment.mCommentedOn && 120 | Objects.equals(mComment, comment.mComment) && 121 | Objects.equals(mCommentBy, comment.mCommentBy) && 122 | Objects.equals(mCommenterId, comment.mCommenterId) && 123 | Objects.equals(mImageUrl, comment.mImageUrl); 124 | } 125 | 126 | @Override 127 | public int hashCode() { 128 | 129 | return Objects.hash(mComment, mCommentBy, mCommentedOn, mCommenterId); 130 | } 131 | } 132 | -------------------------------------------------------------------------------- /app/src/main/java/com/developervishalsehgal/udacityscholarsapp/data/models/Discussion.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 | import java.util.List; 11 | import java.util.Objects; 12 | 13 | /** 14 | * Model class representing a Quiz Discussion 15 | */ 16 | @IgnoreExtraProperties 17 | public class Discussion { 18 | 19 | @Expose 20 | @SerializedName("quiz-id") 21 | private String mQuizId; 22 | 23 | @Expose 24 | @SerializedName("quiz-title") 25 | private String mQuizTitle; 26 | 27 | @Expose 28 | @SerializedName("comments") 29 | private List mComments; 30 | 31 | /** 32 | * This field should be used for storing key of realtime database snapshot, otherwise ignore it 33 | */ 34 | @Exclude 35 | String mKey; 36 | 37 | @PropertyName("quiz-id") 38 | public String getQuizId() { 39 | return mQuizId; 40 | } 41 | 42 | @PropertyName("quiz-id") 43 | public void setQuizId(String quizId) { 44 | mQuizId = quizId; 45 | } 46 | 47 | @PropertyName("quiz-title") 48 | public String getQuizTitle() { 49 | return mQuizTitle; 50 | } 51 | 52 | @PropertyName("quiz-title") 53 | public void setQuizTitle(String quizTitle) { 54 | mQuizTitle = quizTitle; 55 | } 56 | 57 | @PropertyName("comments") 58 | public List getComments() { 59 | return mComments; 60 | } 61 | 62 | @PropertyName("comments") 63 | public void setComments(List 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 |

4 | 8 | 9 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/menu/navigation_drawer_items.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 8 | 9 | 15 | 16 | 19 | 20 | 24 | 25 | 28 | 29 | -------------------------------------------------------------------------------- /app/src/main/res/menu/quiz_detail_menu.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 9 | -------------------------------------------------------------------------------- /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 | 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 | --------------------------------------------------------------------------------