-
Notifications
You must be signed in to change notification settings - Fork 58
feat: [FC-0047] Full-Bleed Header + Top Navigation #278
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
volodymyr-chekyrta
merged 24 commits into
openedx:develop
from
raccoongang:feat/course_home_header
Apr 30, 2024
Merged
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
daeab51
feat: New header and navigation on CourseContainerFragment
PavloNetrebchuk 1b02a48
feat: Changed logic of swipe to refresh, added blur for android <= 12…
PavloNetrebchuk 378e876
feat: removed COURSE_TOP_BAR_ENABLED and COURSE_BANNER_ENABLED featur…
PavloNetrebchuk 76cda81
feat: special header style for android < 12
PavloNetrebchuk 9707ac8
fix: Fixed header image blur for android < 12. Added courseContainerT…
PavloNetrebchuk e9fc5af
Merge remote-tracking branch 'origin/develop' into feat/course_home_h…
PavloNetrebchuk 38709fe
feat: auto scrolling header to collapsed and expanded states
PavloNetrebchuk d8d2f57
fix: Fixed junit tests
PavloNetrebchuk 6aadad1
fix: Fixed CourseContainerViewModelTest
PavloNetrebchuk ada422d
fix: auto scroll fling fix
PavloNetrebchuk a6ab821
feat: CourseContainerFragment refactoring
PavloNetrebchuk ad32e9f
Merge remote-tracking branch 'origin/develop' into feat/course_home_h…
PavloNetrebchuk e079ded
fix: Removed expanded header content top padding
PavloNetrebchuk d98af9e
Merge remote-tracking branch 'origin/develop' into feat/course_home_h…
PavloNetrebchuk 3427c99
fix: Collapsing header and navigation tabs UI fixes
PavloNetrebchuk 0b450a2
Merge remote-tracking branch 'origin/develop' into feat/course_home_h…
PavloNetrebchuk 3bf503d
fix: Fixes according to PR feedback
PavloNetrebchuk 8462925
refactor: Course home tabs layout
PavloNetrebchuk 655d2f4
fix: Fixes according to PR feedback
PavloNetrebchuk 64030e4
fix: Fixes according to PR feedback
PavloNetrebchuk 0e1fd12
Merge remote-tracking branch 'upstream/develop' into feat/course_home…
PavloNetrebchuk a314e3d
refactor: Refactored view models of course container screens
PavloNetrebchuk a71796d
Merge remote-tracking branch 'origin/develop' into feat/course_home_h…
PavloNetrebchuk ef48f3b
fix: Fixes according to PR feedback
PavloNetrebchuk 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| @file:Suppress("DEPRECATION") | ||
|
|
||
| package org.openedx.core | ||
|
|
||
| import android.content.Context | ||
| import android.graphics.Bitmap | ||
| import android.graphics.drawable.Drawable | ||
| import android.renderscript.Allocation | ||
| import android.renderscript.RenderScript | ||
| import android.renderscript.ScriptIntrinsicBlur | ||
| import androidx.annotation.DrawableRes | ||
| import coil.ImageLoader | ||
| import coil.request.ImageRequest | ||
|
|
||
| class ImageProcessor(private val context: Context) { | ||
| fun loadImage( | ||
| @DrawableRes | ||
| defaultImage: Int, | ||
| imageUrl: String, | ||
| onComplete: (result: Drawable) -> Unit | ||
| ) { | ||
| val loader = ImageLoader(context) | ||
| val request = ImageRequest.Builder(context) | ||
| .data(imageUrl) | ||
| .target { result -> | ||
| onComplete(result) | ||
| } | ||
| .error(defaultImage) | ||
| .placeholder(defaultImage) | ||
| .allowHardware(false) | ||
| .build() | ||
| loader.enqueue(request) | ||
| } | ||
|
|
||
| fun applyBlur( | ||
| bitmap: Bitmap, | ||
| blurRadio: Float | ||
| ): Bitmap { | ||
| val renderScript = RenderScript.create(context) | ||
| val bitmapAlloc = Allocation.createFromBitmap(renderScript, bitmap) | ||
| ScriptIntrinsicBlur.create(renderScript, bitmapAlloc.element).apply { | ||
| setRadius(blurRadio) | ||
| setInput(bitmapAlloc) | ||
| repeat(3) { | ||
| forEach(bitmapAlloc) | ||
| } | ||
| } | ||
| val newBitmap: Bitmap = Bitmap.createBitmap( | ||
| bitmap.width, | ||
| bitmap.height, | ||
| Bitmap.Config.ARGB_8888 | ||
| ) | ||
| bitmapAlloc.copyTo(newBitmap) | ||
| renderScript.destroy() | ||
| return newBitmap | ||
| } | ||
| } |
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
24 changes: 24 additions & 0 deletions
24
core/src/main/java/org/openedx/core/presentation/course/CourseContainerTab.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,24 @@ | ||
| package org.openedx.core.presentation.course | ||
|
|
||
| import androidx.annotation.StringRes | ||
| import androidx.compose.material.icons.Icons | ||
| import androidx.compose.material.icons.automirrored.filled.Chat | ||
| import androidx.compose.material.icons.automirrored.filled.TextSnippet | ||
| import androidx.compose.material.icons.filled.Home | ||
| import androidx.compose.material.icons.outlined.CalendarMonth | ||
| import androidx.compose.material.icons.rounded.PlayCircleFilled | ||
| import androidx.compose.ui.graphics.vector.ImageVector | ||
| import org.openedx.core.R | ||
| import org.openedx.core.ui.TabItem | ||
|
|
||
| enum class CourseContainerTab( | ||
| @StringRes | ||
| override val labelResId: Int, | ||
| override val icon: ImageVector | ||
| ) : TabItem { | ||
| HOME(R.string.core_course_container_nav_home, Icons.Default.Home), | ||
| VIDEOS(R.string.core_course_container_nav_videos, Icons.Rounded.PlayCircleFilled), | ||
| DATES(R.string.core_course_container_nav_dates, Icons.Outlined.CalendarMonth), | ||
| DISCUSSIONS(R.string.core_course_container_nav_discussions, Icons.AutoMirrored.Filled.Chat), | ||
| MORE(R.string.core_course_container_nav_more, Icons.AutoMirrored.Filled.TextSnippet) | ||
| } |
5 changes: 5 additions & 0 deletions
5
core/src/main/java/org/openedx/core/system/notifier/CourseDataReady.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,5 @@ | ||
| package org.openedx.core.system.notifier | ||
|
|
||
| import org.openedx.core.domain.model.CourseStructure | ||
|
|
||
| data class CourseDataReady(val courseStructure: CourseStructure) : CourseEvent |
3 changes: 3 additions & 0 deletions
3
core/src/main/java/org/openedx/core/system/notifier/CourseDatesShifted.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,3 @@ | ||
| package org.openedx.core.system.notifier | ||
|
|
||
| object CourseDatesShifted : CourseEvent |
3 changes: 3 additions & 0 deletions
3
core/src/main/java/org/openedx/core/system/notifier/CourseLoading.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,3 @@ | ||
| package org.openedx.core.system.notifier | ||
|
|
||
| data class CourseLoading(val isLoading: Boolean) : CourseEvent |
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
5 changes: 5 additions & 0 deletions
5
core/src/main/java/org/openedx/core/system/notifier/CourseRefresh.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,5 @@ | ||
| package org.openedx.core.system.notifier | ||
|
|
||
| import org.openedx.core.presentation.course.CourseContainerTab | ||
|
|
||
| data class CourseRefresh(val courseContainerTab: CourseContainerTab) : CourseEvent |
3 changes: 1 addition & 2 deletions
3
core/src/main/java/org/openedx/core/system/notifier/CourseStructureUpdated.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 |
|---|---|---|
| @@ -1,6 +1,5 @@ | ||
| package org.openedx.core.system.notifier | ||
|
|
||
| class CourseStructureUpdated( | ||
| val courseId: String, | ||
| val withSwipeRefresh: Boolean, | ||
| val courseId: String | ||
| ) : CourseEvent |
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.