forked from openedx/openedx-app-android
-
Notifications
You must be signed in to change notification settings - Fork 0
chore: cherry-pick eshe specific customizations to sumac.3 #13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
kaustavb12
merged 6 commits into
eshe-mvp-release/sumac.3
from
kaustav/cherry_pick_eshe_customization_sumac3
Oct 27, 2025
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
f577f3f
feat: hide some options for the MVP (#1)
navinkarkera 05d850d
feat: add "Gated" UI state for subsections
0x29a 926b889
feat: "Go To Prerequisite Section" button and previews
0x29a 6b091b9
fix: downloaded videos were not working due to gating API needing onl…
xitij2000 1a20ad7
fixup! fix: downloaded videos were not working due to gating API need…
xitij2000 4b5871a
fix: ProgressBarRangeInfo IllegalArgumentException - current must not…
volodymyr-chekyrta File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
27 changes: 27 additions & 0 deletions
27
core/src/main/java/org/openedx/core/data/model/GatedContentModel.kt
This file contains hidden or 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,27 @@ | ||
| package org.openedx.core.data.model | ||
|
|
||
| import com.google.gson.annotations.SerializedName | ||
| import org.openedx.core.domain.model.GatedContent | ||
|
|
||
| data class GatedContentModel( | ||
| @SerializedName("prereq_id") | ||
| val prereqId: String?, | ||
| @SerializedName("prereq_url") | ||
| val prereqUrl: String?, | ||
| @SerializedName("prereq_section_name") | ||
| val prereqSectionName: String?, | ||
| @SerializedName("gated") | ||
| val gated: Boolean, | ||
| @SerializedName("gated_section_name") | ||
| val gatedSectionName: String?, | ||
| ) { | ||
| fun mapToDomain(): GatedContent { | ||
| return GatedContent( | ||
| prereqId = prereqId, | ||
| prereqUrl = prereqUrl, | ||
| prereqSubsectionName = prereqSectionName, | ||
| gated = gated, | ||
| gatedSubsectionName = gatedSectionName | ||
| ) | ||
| } | ||
| } | ||
30 changes: 30 additions & 0 deletions
30
core/src/main/java/org/openedx/core/data/model/SequenceModel.kt
This file contains hidden or 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,30 @@ | ||
| package org.openedx.core.data.model | ||
|
|
||
| import com.google.gson.annotations.SerializedName | ||
|
||
| import org.openedx.core.domain.model.Subsection | ||
|
|
||
| data class SequenceModel( | ||
| @SerializedName("element_id") | ||
| val elementId: String, | ||
| @SerializedName("item_id") | ||
| val itemId: String, | ||
| @SerializedName("banner_text") | ||
| val bannerText: String?, | ||
| @SerializedName("gated_content") | ||
| val gatedContentModel: GatedContentModel, | ||
| @SerializedName("sequence_name") | ||
| val sequenceName: String, | ||
| @SerializedName("display_name") | ||
| val displayName: String, | ||
| ) { | ||
| fun mapToDomain(): Subsection { | ||
| return Subsection( | ||
| elementId = elementId, | ||
| itemId = itemId, | ||
| bannerText = bannerText, | ||
| subsectionName = sequenceName, | ||
| displayName = displayName, | ||
| gatedContent = gatedContentModel.mapToDomain(), | ||
| ) | ||
| } | ||
| } | ||
This file contains hidden or 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
13 changes: 13 additions & 0 deletions
13
core/src/main/java/org/openedx/core/domain/model/GatedContent.kt
This file contains hidden or 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,13 @@ | ||
| package org.openedx.core.domain.model | ||
|
|
||
| import android.os.Parcelable | ||
| import kotlinx.parcelize.Parcelize | ||
|
|
||
| @Parcelize | ||
| data class GatedContent( | ||
| val prereqId: String?, | ||
| val prereqUrl: String?, | ||
| val prereqSubsectionName: String?, | ||
| val gated: Boolean, | ||
| val gatedSubsectionName: String? | ||
| ) : Parcelable |
This file contains hidden or 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
14 changes: 14 additions & 0 deletions
14
core/src/main/java/org/openedx/core/domain/model/Subsection.kt
This file contains hidden or 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,14 @@ | ||
| package org.openedx.core.domain.model | ||
|
|
||
| import android.os.Parcelable | ||
| import kotlinx.parcelize.Parcelize | ||
|
|
||
| @Parcelize | ||
| data class Subsection( | ||
| val elementId: String, | ||
| val itemId: String, | ||
| val bannerText: String?, | ||
| val gatedContent: GatedContent, | ||
| val subsectionName: String, | ||
| val displayName: String | ||
| ) : Parcelable |
This file contains hidden or 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,19 @@ | ||
| package org.openedx.core.extension | ||
|
|
||
| /** | ||
| * Safely divides this Float by [divisor], returning 0f if: | ||
| * - [divisor] is zero, | ||
| * - the result is NaN. | ||
| * | ||
| * Workaround for accessibility issue: | ||
| * https://github.com/openedx/openedx-app-android/issues/442 | ||
| */ | ||
| fun Float.safeDivBy(divisor: Float): Float = try { | ||
| var result = this / divisor | ||
| if (result.isNaN()) { | ||
| result = 0f | ||
| } | ||
| result | ||
| } catch (_: ArithmeticException) { | ||
| 0f | ||
| } |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.