forked from openedx/openedx-app-android
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Course Level Error Handling for Empty States (openedx#393)
Co-authored-by: Farhan Arshad <[email protected]>
- Loading branch information
1 parent
2839535
commit a4eac8d
Showing
27 changed files
with
603 additions
and
304 deletions.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
core/src/main/java/org/openedx/core/NoContentScreenType.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package org.openedx.core | ||
|
||
enum class NoContentScreenType( | ||
val iconResId: Int, | ||
val messageResId: Int, | ||
) { | ||
COURSE_OUTLINE( | ||
iconResId = R.drawable.core_ic_no_content, | ||
messageResId = R.string.core_no_course_content | ||
), | ||
COURSE_VIDEOS( | ||
iconResId = R.drawable.core_ic_no_videos, | ||
messageResId = R.string.core_no_videos | ||
), | ||
COURSE_DATES( | ||
iconResId = R.drawable.core_ic_no_content, | ||
messageResId = R.string.core_no_dates | ||
), | ||
COURSE_DISCUSSIONS( | ||
iconResId = R.drawable.core_ic_no_content, | ||
messageResId = R.string.core_no_discussion | ||
), | ||
COURSE_HANDOUTS( | ||
iconResId = R.drawable.core_ic_no_handouts, | ||
messageResId = R.string.core_no_handouts | ||
), | ||
COURSE_ANNOUNCEMENTS( | ||
iconResId = R.drawable.core_ic_no_announcements, | ||
messageResId = R.string.core_no_announcements | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="86dp" | ||
android:height="86dp" | ||
android:viewportWidth="960" | ||
android:viewportHeight="960"> | ||
|
||
<path | ||
android:fillColor="#ffffff" | ||
android:pathData="M720,520v-80h160v80L720,520ZM768,800 L640,704 688,640 816,736 768,800ZM688,320 L640,256 768,160 816,224 688,320ZM200,760v-160h-40q-33,0 -56.5,-23.5T80,520v-80q0,-33 23.5,-56.5T160,360h160l200,-120v480L320,600h-40v160h-80ZM440,578v-196l-98,58L160,440v80h182l98,58ZM560,614v-268q27,24 43.5,58.5T620,480q0,41 -16.5,75.5T560,614ZM300,480Z" /> | ||
|
||
</vector> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="86dp" | ||
android:height="86dp" | ||
android:viewportWidth="20" | ||
android:viewportHeight="20"> | ||
|
||
<path | ||
android:fillColor="#ffffff" | ||
android:pathData="M10,0C4.48,0 0,4.48 0,10C0,15.52 4.48,20 10,20C15.52,20 20,15.52 20,10C20,4.48 15.52,0 10,0ZM10,11C9.45,11 9,10.55 9,10V6C9,5.45 9.45,5 10,5C10.55,5 11,5.45 11,6V10C11,10.55 10.55,11 10,11ZM11,15H9V13H11V15Z" /> | ||
|
||
</vector> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="86dp" | ||
android:height="86dp" | ||
android:viewportWidth="18" | ||
android:viewportHeight="18"> | ||
|
||
<path | ||
android:fillColor="#ffffff" | ||
android:pathData="M16,0H2C0.9,0 0,0.9 0,2V16C0,17.1 0.9,18 2,18H16C17.1,18 18,17.1 18,16V2C18,0.9 17.1,0 16,0ZM10,14H5C4.45,14 4,13.55 4,13C4,12.45 4.45,12 5,12H10C10.55,12 11,12.45 11,13C11,13.55 10.55,14 10,14ZM13,10H5C4.45,10 4,9.55 4,9C4,8.45 4.45,8 5,8H13C13.55,8 14,8.45 14,9C14,9.55 13.55,10 13,10ZM13,6H5C4.45,6 4,5.55 4,5C4,4.45 4.45,4 5,4H13C13.55,4 14,4.45 14,5C14,5.55 13.55,6 13,6Z" /> | ||
|
||
</vector> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="86dp" | ||
android:height="58dp" | ||
android:viewportWidth="18" | ||
android:viewportHeight="12"> | ||
|
||
<path | ||
android:fillColor="#ffffff" | ||
android:pathData="M14,4.5V1C14,0.45 13.55,0 13,0H1C0.45,0 0,0.45 0,1V11C0,11.55 0.45,12 1,12H13C13.55,12 14,11.55 14,11V7.5L16.29,9.79C16.92,10.42 18,9.97 18,9.08V2.91C18,2.02 16.92,1.57 16.29,2.2L14,4.5Z" /> | ||
|
||
</vector> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
course/src/main/java/org/openedx/course/presentation/handouts/HandoutsUIState.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package org.openedx.course.presentation.handouts | ||
|
||
sealed class HandoutsUIState { | ||
data object Loading : HandoutsUIState() | ||
data class HTMLContent(val htmlContent: String) : HandoutsUIState() | ||
data object Error : HandoutsUIState() | ||
} |
Oops, something went wrong.