The Capsule App is an Android application designed to provide users with a curated sequence of screens, forming a cohesive and engaging user experience. This README.md file provides an overview of the project, its key features, technical details, and instructions for running the app.
- Task: Display a video using the YouTube Player API.
- Implementation: Utilizes the YouTube Player API for seamless video playback within the app.
- Task: Display textual content related to a specific topic.
- Implementation: Loads content from a provided PDF hosted on Google Drive, rendering it in a WebView.
- Task: Present a set of multiple-choice questions.
- Implementation: Questions are stored in a
Quiz
class, providing a shuffled set for users to answer.
- Task: Display the result of the quiz.
- Implementation: After completing the quiz, users are shown their score as a percentage on the Quiz Result Screen.
- Why: Ensuring a clean and modular code structure.
- How: Follows the clean architecture pattern with MVVM design, promoting separation of concerns.
- Why: Binding UI components in a type-safe manner.
- How: Utilizes View Binding, allowing for more robust and type-safe access to UI elements.
- Why: Managing UI-related data efficiently.
- How: Implements ViewModels using Android's
ViewModel
class, separating UI logic from UI components.
- Why: Facilitating navigation between different screens.
- How: Uses the
FragmentTransaction
mechanism for fragment navigation, ensuring a smooth transition.
- Why: Embedding and playing YouTube videos within the app.
- How: Integrates the YouTube Player API to allow users to watch videos seamlessly without leaving the app.
- Why: Enforcing an optional time limit for completing the entire capsule.
- How: Implements a countdown timer using Kotlin Coroutines (
viewModelScope.launch
) and Android'sDispatchers
for asynchronous execution.
Screen_recording_20231208_105950.webm
The project is organized into several packages:
fragments
: Contains individual fragments for different screens (Video, Notes, Quiz, Quiz Result).adapters
: Includes theCollectionAdapter
responsible for managing the ViewPager.utility
: Holds utility classes and data structures, such as theQuiz
class and constants.
- Clone the repository.
- Open the project in Android Studio.
- Build and run the application on an emulator or physical device.
Feel free to reach out if you have any questions or need further clarification on the assignment.