Skip to content

Commit

Permalink
Merge branch 'develop' into feature/accessibility
Browse files Browse the repository at this point in the history
# Conflicts:
#	course/src/main/res/values/strings.xml
  • Loading branch information
PavloNetrebchuk committed Nov 8, 2023
2 parents 1f1cb91 + b23156f commit a643d99
Show file tree
Hide file tree
Showing 42 changed files with 1,585 additions and 132 deletions.
14 changes: 14 additions & 0 deletions .github/ISSUE_TEMPLATE/roadmap-entry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
name: Roadmap project entry
about: Add roadmap entry to the project
title: '[Mobile] [Android] Roadmap project name'
labels: ''
assignees: ''

---

### Goal
Describe the goal for this project

**Slack:** #wg-product-mobile
**Requirement Definition:** add Confluence project page link (or external public documentation)
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@ Modern vision of the mobile application for the Open EdX platform from Raccoon G
[Documentation](Documentation/Documentation.md)

## Building

1. Check out the source code:

git clone https://github.com/raccoongang/educationx-app-ios.git
git clone https://github.com/openedx/openedx-app-android.git

2. Open Android Studio and choose Open an Existing Android Studio Project.

3. Choose ``educationx-app-android``.
3. Choose ``openedx-app-android``.

4. Configure the [config.yaml](config.yaml) with URLs and OAuth credentials for your Open edX instance.

Expand All @@ -20,11 +21,13 @@ Modern vision of the mobile application for the Open EdX platform from Raccoon G
6. Click the **Run** button.

## API plugin

This project uses custom APIs to improve performance and reduce the number of requests to the server.

You can find the plugin with the API and installation guide [here](https://github.com/raccoongang/mobile-api-extensions).

## License

The code in this repository is licensed under the Apache-2.0 license unless otherwise noted.

Please see [LICENSE](https://github.com/raccoongang/educationx-app-android/blob/main/LICENSE) file for details.
Please see [LICENSE](https://github.com/openedx/openedx-app-android/blob/main/LICENSE) file for details.
10 changes: 10 additions & 0 deletions app/src/main/java/org/openedx/app/AnalyticsManager.kt
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,15 @@ class AnalyticsManager(context: Context) : DashboardAnalytics, AuthAnalytics, Ap
)
}

override fun datesTabClickedEvent(courseId: String, courseName: String) {
logEvent(
Event.DATES_TAB_CLICKED, bundleOf(
Key.COURSE_ID.keyName to courseId,
Key.COURSE_NAME.keyName to courseName
)
)
}

override fun handoutsTabClickedEvent(courseId: String, courseName: String) {
logEvent(
Event.HANDOUTS_TAB_CLICKED, bundleOf(
Expand Down Expand Up @@ -402,6 +411,7 @@ private enum class Event(val eventName: String) {
COURSE_TAB_CLICKED("Course_Outline_Course_tab_Clicked"),
VIDEO_TAB_CLICKED("Course_Outline_Videos_tab_Clicked"),
DISCUSSION_TAB_CLICKED("Course_Outline_Discussion_tab_Clicked"),
DATES_TAB_CLICKED("Course_Outline_Dates_tab_Clicked"),
HANDOUTS_TAB_CLICKED("Course_Outline_Handouts_tab_Clicked"),
DISCUSSION_ALL_POSTS_CLICKED("Discussion_All_Posts_Clicked"),
DISCUSSION_FOLLOWING_CLICKED("Discussion_Following_Clicked"),
Expand Down
12 changes: 7 additions & 5 deletions app/src/main/java/org/openedx/app/di/ScreenModule.kt
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,14 @@ import org.openedx.core.presentation.dialog.selectorbottomsheet.SelectDialogView
import org.openedx.course.data.repository.CourseRepository
import org.openedx.course.domain.interactor.CourseInteractor
import org.openedx.course.presentation.container.CourseContainerViewModel
import org.openedx.course.presentation.dates.CourseDatesViewModel
import org.openedx.course.presentation.detail.CourseDetailsViewModel
import org.openedx.course.presentation.handouts.HandoutsViewModel
import org.openedx.course.presentation.outline.CourseOutlineViewModel
import org.openedx.course.presentation.section.CourseSectionViewModel
import org.openedx.course.presentation.unit.container.CourseUnitContainerViewModel
import org.openedx.course.presentation.unit.video.EncodedVideoUnitViewModel
import org.openedx.course.presentation.unit.video.VideoUnitViewModel
import org.openedx.course.presentation.unit.video.VideoViewModel
import org.openedx.course.presentation.videos.CourseVideoViewModel
import org.openedx.dashboard.data.repository.DashboardRepository
Expand All @@ -41,14 +44,12 @@ import org.openedx.discussion.presentation.topics.DiscussionTopicsViewModel
import org.openedx.profile.data.repository.ProfileRepository
import org.openedx.profile.domain.interactor.ProfileInteractor
import org.openedx.profile.domain.model.Account
import org.openedx.profile.presentation.anothers_account.AnothersProfileViewModel
import org.openedx.profile.presentation.delete.DeleteProfileViewModel
import org.openedx.profile.presentation.edit.EditProfileViewModel
import org.openedx.profile.presentation.profile.ProfileViewModel
import org.openedx.profile.presentation.settings.video.VideoQualityViewModel
import org.openedx.profile.presentation.settings.video.VideoSettingsViewModel
import org.openedx.course.presentation.unit.video.EncodedVideoUnitViewModel
import org.openedx.course.presentation.unit.video.VideoUnitViewModel
import org.openedx.profile.presentation.anothers_account.AnothersProfileViewModel
import org.openedx.whatsnew.presentation.whatsnew.WhatsNewViewModel

val screenModule = module {
Expand Down Expand Up @@ -88,9 +89,10 @@ val screenModule = module {
viewModel { (courseId: String) -> CourseSectionViewModel(get(), get(), get(), get(), get(), get(), get(), get(), courseId) }
viewModel { (courseId: String) -> CourseUnitContainerViewModel(get(), get(), get(), courseId) }
viewModel { (courseId: String) -> CourseVideoViewModel(courseId, get(), get(), get(), get(), get(), get(), get()) }
viewModel { (courseId: String) -> VideoViewModel(courseId, get(), get()) }
viewModel { (courseId: String) -> VideoViewModel(courseId, get(), get(), get()) }
viewModel { (courseId: String) -> VideoUnitViewModel(courseId, get(), get(), get(), get()) }
viewModel { (courseId: String, blockId: String) -> EncodedVideoUnitViewModel(courseId, blockId, get(), get(), get(), get(), get()) }
viewModel { (courseId: String, blockId: String) -> EncodedVideoUnitViewModel(courseId, blockId, get(), get(), get(), get(), get(), get()) }
viewModel { (courseId: String) -> CourseDatesViewModel(courseId, get(), get(), get()) }
viewModel { (courseId:String, handoutsType: String) -> HandoutsViewModel(courseId, handoutsType, get()) }
viewModel { CourseSearchViewModel(get(), get(), get()) }
viewModel { SelectDialogViewModel(get()) }
Expand Down
2 changes: 2 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ ext {

window_version = '1.1.0'

extented_spans_version = "1.3.0"

//testing
mockk_version = '1.13.3'
android_arch_version = '2.2.0'
Expand Down
77 changes: 23 additions & 54 deletions core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -40,66 +40,15 @@ android {
productFlavors {
prod {
dimension 'env'

def envMap = config.environments.find { it.key == "PROD" }
def clientId = envMap.value.OAUTH_CLIENT_ID
def envUrls = envMap.value.URLS
def firebase = getFirebaseConfig(envMap)

buildConfigField "String", "BASE_URL", "\"${envUrls.API_HOST_URL}\""
buildConfigField "String", "CLIENT_ID", "\"${clientId}\""
buildConfigField "String", "FIREBASE_PROJECT_ID", "\"${firebase.projectId}\""
buildConfigField "String", "FIREBASE_API_KEY", "\"${firebase.apiKey}\""
buildConfigField "String", "FIREBASE_GCM_SENDER_ID", "\"${firebase.gcmSenderId}\""
resValue "string", "google_app_id", firebase.appId
resValue "string", "platform_name", config.platformName
resValue "string", "platform_full_name", config.platformFullName
resValue "string", "privacy_policy_link", envUrls.privacyPolicy
resValue "string", "terms_of_service_link", envUrls.termsOfService
resValue "string", "contact_us_link", envUrls.contactUs
resValue "string", "feedback_email_address", envUrls.FEEDBACK_EMAIL_ADDRESS
insertBuildConfigFields(config, it, "PROD")
}
develop {
dimension 'env'

def envMap = config.environments.find { it.key == "DEV" }
def clientId = envMap.value.OAUTH_CLIENT_ID
def envUrls = envMap.value.URLS
def firebase = getFirebaseConfig(envMap)

buildConfigField "String", "BASE_URL", "\"${envUrls.API_HOST_URL}\""
buildConfigField "String", "CLIENT_ID", "\"${clientId}\""
buildConfigField "String", "FIREBASE_PROJECT_ID", "\"${firebase.projectId}\""
buildConfigField "String", "FIREBASE_API_KEY", "\"${firebase.apiKey}\""
buildConfigField "String", "FIREBASE_GCM_SENDER_ID", "\"${firebase.gcmSenderId}\""
resValue "string", "google_app_id", firebase.appId
resValue "string", "platform_name", config.platformName
resValue "string", "platform_full_name", config.platformFullName
resValue "string", "privacy_policy_link", envUrls.privacyPolicy
resValue "string", "terms_of_service_link", envUrls.termsOfService
resValue "string", "contact_us_link", envUrls.contactUs
resValue "string", "feedback_email_address", envUrls.FEEDBACK_EMAIL_ADDRESS
insertBuildConfigFields(config, it, "DEV")
}
stage {
dimension 'env'

def envMap = config.environments.find { it.key == "STAGE" }
def clientId = envMap.value.OAUTH_CLIENT_ID
def envUrls = envMap.value.URLS
def firebase = getFirebaseConfig(envMap)

buildConfigField "String", "BASE_URL", "\"${envUrls.API_HOST_URL}\""
buildConfigField "String", "CLIENT_ID", "\"${clientId}\""
buildConfigField "String", "FIREBASE_PROJECT_ID", "\"${firebase.projectId}\""
buildConfigField "String", "FIREBASE_API_KEY", "\"${firebase.apiKey}\""
buildConfigField "String", "FIREBASE_GCM_SENDER_ID", "\"${firebase.gcmSenderId}\""
resValue "string", "google_app_id", firebase.appId
resValue "string", "platform_name", config.platformName
resValue "string", "platform_full_name", config.platformFullName
resValue "string", "privacy_policy_link", envUrls.privacyPolicy
resValue "string", "terms_of_service_link", envUrls.termsOfService
resValue "string", "contact_us_link", envUrls.contactUs
resValue "string", "feedback_email_address", envUrls.FEEDBACK_EMAIL_ADDRESS
insertBuildConfigFields(config, it, "STAGE")
}
}

Expand Down Expand Up @@ -216,3 +165,23 @@ def setValue(value) {
}
return result
}

def insertBuildConfigFields(config, buildType, String keyName) {
def envMap = config.environments.find { it.key == keyName }
def clientId = envMap.value.OAUTH_CLIENT_ID
def envUrls = envMap.value.URLS
def firebase = getFirebaseConfig(envMap)

buildType.buildConfigField "String", "BASE_URL", "\"${envUrls.API_HOST_URL}\""
buildType.buildConfigField "String", "CLIENT_ID", "\"${clientId}\""
buildType.buildConfigField "String", "FIREBASE_PROJECT_ID", "\"${firebase.projectId}\""
buildType.buildConfigField "String", "FIREBASE_API_KEY", "\"${firebase.apiKey}\""
buildType.buildConfigField "String", "FIREBASE_GCM_SENDER_ID", "\"${firebase.gcmSenderId}\""
buildType.resValue "string", "google_app_id", firebase.appId
buildType.resValue "string", "platform_name", config.platformName
buildType.resValue "string", "platform_full_name", config.platformFullName
buildType.resValue "string", "privacy_policy_link", envUrls.privacyPolicy
buildType.resValue "string", "terms_of_service_link", envUrls.termsOfService
buildType.resValue "string", "contact_us_link", envUrls.contactUs
buildType.resValue "string", "feedback_email_address", envUrls.FEEDBACK_EMAIL_ADDRESS
}
5 changes: 4 additions & 1 deletion core/src/main/java/org/openedx/core/data/api/CourseApi.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.openedx.core.data.api

import org.openedx.core.data.model.*
import okhttp3.ResponseBody
import org.openedx.core.data.model.*
import retrofit2.http.*

interface CourseApi {
Expand Down Expand Up @@ -65,6 +65,9 @@ interface CourseApi {
blocksCompletionBody: BlocksCompletionBody
)

@GET("/api/course_home/v1/dates/{course_id}")
suspend fun getCourseDates(@Path("course_id") courseId: String): CourseDates

@GET("/api/mobile/v1/course_info/{course_id}/handouts")
suspend fun getHandouts(@Path("course_id") courseId: String): HandoutsModel

Expand Down
28 changes: 28 additions & 0 deletions core/src/main/java/org/openedx/core/data/model/CourseDateBlock.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package org.openedx.core.data.model

import com.google.gson.annotations.SerializedName
import java.util.*

data class CourseDateBlock(
@SerializedName("complete")
val complete: Boolean = false,
@SerializedName("date")
val date: String = "", // ISO 8601 compliant format
@SerializedName("assignment_type")
val assignmentType: String? = "",
@SerializedName("date_type")
val dateType: DateType = DateType.NONE,
@SerializedName("description")
val description: String = "",
@SerializedName("learner_has_access")
val learnerHasAccess: Boolean = false,
@SerializedName("link")
val link: String = "",
@SerializedName("link_text")
val linkText: String = "",
@SerializedName("title")
val title: String = "",
// component blockId in-case of navigating inside the app for component available in mobile
@SerializedName("first_component_block_id")
val blockId: String = "",
)
Loading

0 comments on commit a643d99

Please sign in to comment.