Skip to content

Conversation

@islam-abdel-halem
Copy link
Collaborator

  • Implements the UI and ViewModel for the course player feature.
  • Enhance verification screen.
  • Includes new bookmark icons for the course player UI.

- Implements the UI and ViewModel for the course player feature.
- Enhance verification screen.
- Includes new bookmark icons for the course player UI.
@islam-abdel-halem islam-abdel-halem merged commit 4c7e563 into WAHID-QANDIL:main Jun 21, 2025
1 check passed
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements the UI and ViewModel scaffolding for a new course player feature, introduces bookmark icons, and refines the verification screen imports and icon usage.

  • Added scalable vector drawables for bookmark icons.
  • Created CoursePlayerViewModel, CoursePlayerUiState, and composable UI in CoursePlayerScreen.
  • Updated VerificationScreen imports and switched to auto-mirrored back icon.

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
app/src/main/res/drawable/bookmarkborder.xml Added vector for bookmark outline icon
app/src/main/res/drawable/bookmark.xml Added vector for filled bookmark icon
app/src/main/java/org/mahd_e_learning_platform/presentation/screens/course_player/CoursePlayerViewModel.kt Implemented UI state flow and toggle bookmark logic; stubbed TODOs
app/src/main/java/org/mahd_e_learning_platform/presentation/screens/course_player/CoursePlayerUiState.kt Defined data models and default UI state
app/src/main/java/org/mahd_e_learning_platform/presentation/screens/course_player/CoursePlayerScreen.kt Built composable layout for course player UI
app/src/main/java/org/mahd_e_learning_platform/presentation/screens/auth/verification/Verification.kt Refined layout imports and switched to Icons.AutoMirrored.Filled.ArrowBack

Comment on lines +2 to +3
android:width="800dp"
android:height="800dp"
Copy link

Copilot AI Jun 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The vector drawable width is set to 800dp, which is unusually large—standard Android vector icons typically use 24dp to match the viewportWidth. Consider changing to 24dp.

Suggested change
android:width="800dp"
android:height="800dp"
android:width="24dp"
android:height="24dp"

Copilot uses AI. Check for mistakes.
Comment on lines +2 to +3
android:width="800dp"
android:height="800dp"
Copy link

Copilot AI Jun 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The vector drawable width is set to 800dp; use a more appropriate size such as 24dp to align with viewportHeight and common icon dimensions.

Suggested change
android:width="800dp"
android:height="800dp"
android:width="24dp"
android:height="24dp"

Copilot uses AI. Check for mistakes.
class CoursePlayerViewModel : ViewModel() {

private val _uiState = MutableStateFlow(CoursePlayerUiState())
val uiState = _uiState
Copy link

Copilot AI Jun 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expose the state as an immutable StateFlow rather than the mutable _uiState; e.g., val uiState: StateFlow<CoursePlayerUiState> = _uiState.asStateFlow() to prevent external modification.

Suggested change
val uiState = _uiState
val uiState = _uiState.asStateFlow()

Copilot uses AI. Check for mistakes.
}
Spacer(Modifier.height(4.dp))
LinearProgressIndicator(
progress = { progress.progress },
Copy link

Copilot AI Jun 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The LinearProgressIndicator expects a Float for the progress parameter, not a lambda. Pass progress.progress directly without curly braces.

Suggested change
progress = { progress.progress },
progress = progress.progress,

Copilot uses AI. Check for mistakes.
IconButton(onClick = onPlayPause) {
Icon(
imageVector = Icons.Filled.PlayArrow,
contentDescription = "Play/Pause",
Copy link

Copilot AI Jun 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Hard-coded content descriptions can hinder localization; consider using stringResource(R.string.play_pause) for contentDescription.

Copilot uses AI. Check for mistakes.
Copy link
Owner

@WAHID-QANDIL WAHID-QANDIL left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants