Skip to content
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

Develop to main. Release v2 #399

Merged
merged 58 commits into from
Nov 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
223fc43
fix: Ensure cookies authentication prior to webview loading (#312)
HamzaIsrar12 May 6, 2024
498f0ef
fix: crash when restoring the app after a long period of inactivity
dixidroid Apr 15, 2024
ae777dd
Merge pull request #290 from touchapp/fix/crash_when_restore
volodymyr-chekyrta May 15, 2024
4d78460
feat: Course home. Moved certificate access.
volodymyr-chekyrta May 14, 2024
f7d4d5f
Merge pull request #321 from raccoongang/feature/course_home_certificate
volodymyr-chekyrta May 20, 2024
a712170
chore: enhance app theme capability for prod edX theme/branding (#262)
farhan-arshad-dev May 23, 2024
0d093ea
feat: [FC-0047] Calendar main screen and dialogs (#322)
PavloNetrebchuk May 29, 2024
c2684f9
feat: [FC-0047] Improved Dashboard Level Navigation (#308)
PavloNetrebchuk May 30, 2024
3df3c05
fix: update config parsing structure (#319)
omerhabib26 May 31, 2024
3e95560
feat: delete old videos Directory (#326)
omerhabib26 May 31, 2024
22ee176
fix: Accessibility issue on courseDashboard (#327)
omerhabib26 Jun 6, 2024
1bc1d4c
feat: [FC-0047] Course progress and collapsing sections (#323)
PavloNetrebchuk Jun 6, 2024
09b422a
fix: enable Programs view for new dashboard navigation (#328)
omerhabib26 Jun 7, 2024
7d623ce
fix: Filter block IDs before download, minor refactoring (#333)
PavloNetrebchuk Jun 7, 2024
651db4c
fix: Update feature flag name (#334)
PavloNetrebchuk Jun 7, 2024
21bd1a1
fix: sourceSets dir fallback (#335)
volodymyr-chekyrta Jun 8, 2024
07f6dca
fix: Crash on opening a course from DashboardListFragment (#336)
omerhabib26 Jun 8, 2024
d845e5e
feat: added the external router for deep links (#320)
dixidroid Jun 10, 2024
5c887eb
fix: UI Issues on Auth Screens (#332)
HamzaIsrar12 Jun 11, 2024
efd3998
feat: Add Branch deep links to local calendar events (#249)
HamzaIsrar12 Jun 12, 2024
065d583
feat: atlas push pull scripts: FC-55 (#317)
Amr-Nash Jun 12, 2024
dbd02e3
fix: English plurals error in transifex should be `one` and `other` (…
OmarIthawi Jun 15, 2024
05c3544
fix: secondary courses view all button behavior (#345)
volodymyr-chekyrta Jun 19, 2024
7ff0ff4
chore: validate plurals in strings.xml | FC-55 (#348)
OmarIthawi Jun 21, 2024
948277a
feat: [FC-0047] FCM (#344)
volodymyr-chekyrta Jun 25, 2024
5abf44d
fix: update keyboard visibility and imeAction (#350)
omerhabib26 Jul 8, 2024
ba305a0
fix: show only one screen with all downloadable content (#352)
dixidroid Jul 8, 2024
02a83ed
fix: Video Subtitles on Native and Youtube Player (#349)
HamzaIsrar12 Jul 8, 2024
9f0740f
feat: Handle Branch Deeplinks from Braze Push Notification (#353)
HamzaIsrar12 Jul 9, 2024
6efdd76
feat: Fullstory Analytics SDK Implementation (#347)
HamzaIsrar12 Jul 9, 2024
559c7e4
feat: [FC-0047] Calendar synchronization (#330)
PavloNetrebchuk Jul 18, 2024
b5256ce
chore: Remove in-code ukranian translations (#342)
OmarIthawi Aug 19, 2024
ad5c646
feat: [FC-0047] xBlock offline mode (#346)
PavloNetrebchuk Sep 9, 2024
d282fb0
fix: added default value to the AppConfig to prevent crashes in some …
k1rill Sep 9, 2024
4c1a909
feat: [FC-0047] Relative Dates (#367)
PavloNetrebchuk Sep 11, 2024
1dc72d2
fix: Handle missing email in Facebook login (#377)
dixidroid Oct 7, 2024
f66b3f2
fix: `IllegalStateException` on `supportFragmentManager.popBackStack(…
dixidroid Oct 7, 2024
77cdf41
fix: disable full story plugin when disabled (#381)
dixidroid Oct 7, 2024
eddd54b
fix: bug when unable to see new loaded items on the All Courses scree…
dixidroid Oct 7, 2024
660770c
fix: Auto Playing Videos and Discovery's External Browser Pop-Up (#383)
dixidroid Oct 7, 2024
a86d95d
fix: wrong sending custom or track events as page events (#384)
dixidroid Oct 7, 2024
42f5835
fix: ignore IllegalStateException when fragment transaction fails (#373)
dixidroid Oct 7, 2024
16a3b17
fix: crash when internet disconnected right after opening a course (#…
dixidroid Oct 8, 2024
a8b7395
fix: Update course dates prefix on course cards (#380)
dixidroid Oct 8, 2024
bbf71e3
refactor: Rename EnrollmentStatus field (#385)
PavloNetrebchuk Oct 17, 2024
1daedbe
refactor: Reorganize offline logic for better readability (#386)
PavloNetrebchuk Oct 17, 2024
e2ee565
fix: Support pull to refresh for empty dashboard (#375)
xitij2000 Oct 29, 2024
aaefaa4
fix: Remove student_view_mutli_device dependency for HTML XBlocks (#388)
dixidroid Oct 29, 2024
0de8db1
feat: add flag to remove registration from app (#387)
kaustavb12 Oct 29, 2024
44f106d
feat: added ability update the primary course on the learn tab (#389)
dixidroid Oct 29, 2024
0ff62f0
fix: Minor bugbash fixes (#390)
dixidroid Oct 29, 2024
190dd87
Code refactoring and junit tests (#391)
PavloNetrebchuk Oct 30, 2024
2839535
feat: App Level WebView/No Internet Error Handling (#392)
dixidroid Oct 31, 2024
a4eac8d
feat: Course Level Error Handling for Empty States (#393)
dixidroid Oct 31, 2024
a005e85
fix: bug when unable to see downloaded html content (#396)
dixidroid Nov 1, 2024
e61523e
feat: foundation lib and analytic plugin implementation (#395)
PavloNetrebchuk Nov 4, 2024
773dac5
build: update action versions (#401)
volodymyr-chekyrta Nov 8, 2024
88dfc54
feat: added ability to handle course errors (#397)
dixidroid Nov 8, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
run: ./gradlew testProdDebugUnitTest $CI_GRADLE_ARG_PROPERTIES

- name: Upload reports
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: failure()
with:
name: failures
Expand Down
32 changes: 32 additions & 0 deletions .github/workflows/validate-english-strings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Validate English strings.xml

on:
pull_request: { }
push:
branches: [ main, develop ]

jobs:
translation_strings:
name: Validate strings.xml
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Use Python
uses: actions/setup-python@v5
with:
python-version: 3.11

- name: Install translations requirements
run: make translation_requirements

- name: Validate English plurals in strings.xml
run: make validate_english_plurals

- name: Test extract strings
run: |
make extract_translations
# Ensure the file is extracted
test -f i18n/src/main/res/values/strings.xml
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,6 @@ local.properties
/.idea/
*.log
/config_settings.yaml
.venv/
i18n/
**/values-*/strings.xml
7 changes: 3 additions & 4 deletions Documentation/ConfigurationManagement.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ TOKEN_TYPE: "JWT"

FIREBASE:
ENABLED: false
ANALYTICS_SOURCE: ''
CLOUD_MESSAGING_ENABLED: false
PROJECT_NUMBER: ''
PROJECT_ID: ''
Expand Down Expand Up @@ -82,14 +81,14 @@ android:
- **Facebook:** Sign in and Sign up via Facebook
- **Branch:** Deeplinks
- **Braze:** Cloud Messaging
- **SegmentIO:** Analytics

## Available Feature Flags
- **PRE_LOGIN_EXPERIENCE_ENABLED:** Enables the pre login courses discovery experience.
- **WHATS_NEW_ENABLED:** Enables the "What's New" feature to present the latest changes to the user.
- **SOCIAL_AUTH_ENABLED:** Enables SSO buttons on the SignIn and SignUp screens.
- **COURSE_NESTED_LIST_ENABLED:** Enables an alternative visual representation for the course structure.
- **COURSE_UNIT_PROGRESS_ENABLED:** Enables the display of the unit progress within the courseware.
- **COURSE_DROPDOWN_NAVIGATION_ENABLED:** Enables an alternative navigation through units.
- **COURSE_UNIT_PROGRESS_ENABLED:** Enables the display of the unit progress within the courseware.
- **REGISTRATION_ENABLED:** Enables user registration from the app.

## Future Support
- To add config related to some other service, create a class, e.g. `ServiceNameConfig.kt`, to be able to populate related fields.
Expand Down
25 changes: 25 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
clean_translations_temp_directory:
rm -rf i18n/

translation_requirements:
pip3 install -r i18n_scripts/requirements.txt

pull_translations: clean_translations_temp_directory
atlas pull $(ATLAS_OPTIONS) translations/openedx-app-android/i18n:i18n
python3 i18n_scripts/translation.py --split --replace-underscore

extract_translations: clean_translations_temp_directory
python3 i18n_scripts/translation.py --combine

validate_english_plurals:
@if git grep 'quantity' -- '**/res/values/strings.xml' | grep -E 'quantity=.(zero|two|few|many)'; then \
echo ""; \
echo ""; \
echo "Error: Found invalid plurals in the files listed above."; \
echo " Please only use 'one' and 'other' in English strings.xml files,"; \
echo " otherwise Transifex fails to parse them."; \
echo ""; \
exit 1; \
else \
echo "strings.xml files are valid."; \
fi
42 changes: 42 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,48 @@ Modern vision of the mobile application for the Open edX platform from Raccoon G

6. Click the **Run** button.

## Translations

### Getting Translations for the App
Translations aren't included in the source code of this repository as of [OEP-58](https://docs.openedx.org/en/latest/developers/concepts/oep58.html). Therefore, they need to be pulled before testing or publishing to App Store.

Before retrieving the translations for the app, we need to install the requirements listed in the requirements.txt file located in the i18n_scripts directory. This can be done easily by running the following make command:
```bash
make translation_requirements
```

Then, to get the latest translations for all languages use the following command:
```bash
make pull_translations
```
This command runs [`atlas pull`](https://github.com/openedx/openedx-atlas) to download the latest translations files from the [openedx/openedx-translations](https://github.com/openedx/openedx-translations) repository. These files contain the latest translations for all languages. In the [openedx/openedx-translations](https://github.com/openedx/openedx-translations) repository each language's translations are saved as a single file e.g. `i18n/src/main/res/values-uk/strings.xml` ([example](https://github.com/openedx/openedx-translations/blob/04ccea36b8e6a9889646dfb5a5acb99686fa9ae0/translations/openedx-app-android/i18n/src/main/res/values-uk/strings.xml)). After these are pulled, each language's translation file is split into the App's modules e.g. `auth/src/main/res/values-uk/strings.xml`.

After this command is run the application can load the translations by changing the device (or the emulator) language in the settings.

### Using Custom Translations

By default, the command `make pull_translations` runs [`atlas pull`](https://github.com/openedx/openedx-atlas) with no arguments which pulls translations from the [openedx-translations repository](https://github.com/openedx/openedx-translations).

You can use custom translations on your fork of the openedx-translations repository by setting the following configuration parameters:

- `--revision` (default: `"main"`): Branch or git tag to pull translations from.
- `--repository` (default: `"openedx/openedx-translations"`): GitHub repository slug. There's a feature request to [support GitLab and other providers](https://github.com/openedx/openedx-atlas/issues/20).

Arguments can be passed via the `ATLAS_OPTIONS` environment variable as shown below:
``` bash
make ATLAS_OPTIONS='--repository=<your-github-org>/<repository-name> --revision=<branch-name>' pull_translations
```
Additional arguments can be passed to `atlas pull`. Refer to the [atlas documentations ](https://github.com/openedx/openedx-atlas) for more information.

### How to Translate the App

Translations are managed in the [open-edx/openedx-translations](https://app.transifex.com/open-edx/openedx-translations/dashboard/) Transifex project.

To translate the app join the [Transifex project](https://app.transifex.com/open-edx/openedx-translations/dashboard/) and add your translations to the
[`openedx-app-android`](https://app.transifex.com/open-edx/openedx-translations/openedx-app-android/) resource.

Once the resource is both 100% translated and reviewed the [Transifex integration](https://github.com/apps/transifex-integration) will automatically push it to the [openedx-translations](https://github.com/openedx/openedx-translations) repository and developers can use the translations in their app.

## API
This project targets on the latest Open edX release and rely on the relevant mobile APIs.

Expand Down
42 changes: 16 additions & 26 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
def config = configHelper.fetchConfig()
def appId = config.getOrDefault("APPLICATION_ID", "org.openedx.app")
def platformName = config.getOrDefault("PLATFORM_NAME", "OpenEdx").toLowerCase()
def themeDirectory = config.getOrDefault("THEME_DIRECTORY", "openedx")
def firebaseConfig = config.get('FIREBASE')
def firebaseEnabled = firebaseConfig?.getOrDefault('ENABLED', false)

apply plugin: 'com.android.application'
apply plugin: 'org.jetbrains.kotlin.android'
apply plugin: 'kotlin-parcelize'
apply plugin: 'kotlin-kapt'
apply plugin: 'com.google.devtools.ksp'
apply plugin: 'org.jetbrains.kotlin.plugin.compose'

if (firebaseEnabled) {
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.google.firebase.crashlytics'
Expand Down Expand Up @@ -63,13 +65,13 @@ android {

sourceSets {
prod {
res.srcDirs = ["src/$platformName/res"]
res.srcDirs = ["src/$themeDirectory/res"]
}
develop {
res.srcDirs = ["src/$platformName/res"]
res.srcDirs = ["src/$themeDirectory/res"]
}
stage {
res.srcDirs = ["src/$platformName/res"]
res.srcDirs = ["src/$themeDirectory/res"]
}
}

Expand All @@ -91,15 +93,13 @@ android {
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_17
freeCompilerArgs = List.of("-Xstring-concat=inline")
}
buildFeatures {
viewBinding true
compose true
buildConfig true
}
composeOptions {
kotlinCompilerExtensionVersion = "$compose_compiler_version"
}
bundle {
language {
enableSplit = false
Expand All @@ -126,34 +126,24 @@ dependencies {
implementation project(path: ':discussion')
implementation project(path: ':whatsnew')

kapt "androidx.room:room-compiler:$room_version"
ksp "androidx.room:room-compiler:$room_version"

implementation 'androidx.core:core-splashscreen:1.0.1'

// Segment Library
implementation "com.segment.analytics.kotlin:android:1.14.2"
// Segment's Firebase integration
implementation 'com.segment.analytics.kotlin.destinations:firebase:1.5.2'
api platform("com.google.firebase:firebase-bom:$firebase_version")
api "com.google.firebase:firebase-messaging"

// Braze SDK Integration
implementation "com.braze:braze-segment-kotlin:1.4.2"
implementation "com.braze:android-sdk-ui:30.2.0"

// Firebase Cloud Messaging Integration for Braze
implementation 'com.google.firebase:firebase-messaging-ktx:23.4.1'

// Branch SDK Integration
implementation 'io.branch.sdk.android:library:5.9.0'
implementation 'com.google.android.gms:play-services-ads-identifier:18.0.1'
implementation "com.android.installreferrer:installreferrer:2.2"
// Plugins
implementation("com.github.openedx:openedx-app-firebase-analytics-android:1.0.0")

androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
androidTestImplementation "androidx.compose.ui:ui-test-junit4:$compose_version"
debugImplementation "androidx.compose.ui:ui-test-manifest:$compose_version"
androidTestImplementation 'androidx.test.ext:junit:1.2.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1'
testImplementation "junit:junit:$junit_version"
testImplementation "io.mockk:mockk:$mockk_version"
testImplementation "io.mockk:mockk-android:$mockk_version"
testImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-test:$coroutines_version"
testImplementation "androidx.arch.core:core-testing:$android_arch_version"
}

Expand Down
98 changes: 28 additions & 70 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -1,66 +1,3 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile

#====================/////Retrofit Rules\\\\\===============
# Retrofit does reflection on generic parameters. InnerClasses is required to use Signature and
# EnclosingMethod is required to use InnerClasses.
-keepattributes Signature, InnerClasses, EnclosingMethod

# Retrofit does reflection on method and parameter annotations.
-keepattributes RuntimeVisibleAnnotations, RuntimeVisibleParameterAnnotations

# Keep annotation default values (e.g., retrofit2.http.Field.encoded).
-keepattributes AnnotationDefault

# Retain service method parameters when optimizing.
-keepclassmembers,allowshrinking,allowobfuscation interface * {
@retrofit2.http.* <methods>;
}

# Ignore JSR 305 annotations for embedding nullability information.
-dontwarn javax.annotation.**

# Guarded by a NoClassDefFoundError try/catch and only used when on the classpath.
-dontwarn kotlin.Unit

# Top-level functions that can only be used by Kotlin.
-dontwarn retrofit2.KotlinExtensions
-dontwarn retrofit2.KotlinExtensions$*

# With R8 full mode, it sees no subtypes of Retrofit interfaces since they are created with a Proxy
# and replaces all potential values with null. Explicitly keeping the interfaces prevents this.
-if interface * { @retrofit2.http.* <methods>; }
-keep,allowobfuscation interface <1>

# Keep generic signature of Call, Response (R8 full mode strips signatures from non-kept items).
-keep,allowobfuscation,allowshrinking interface retrofit2.Call
-keep,allowobfuscation,allowshrinking class retrofit2.Response

# With R8 full mode generic signatures are stripped for classes that are not
# kept. Suspend functions are wrapped in continuations where the type argument
# is used.
-keep,allowobfuscation,allowshrinking class kotlin.coroutines.Continuation

#===============/////GSON RULES \\\\\\\============
##---------------Begin: proguard configuration for Gson ----------
# Gson uses generic type information stored in a class file when working with fields. Proguard
# removes such information by default, so configure it to keep all of it.
Expand All @@ -69,12 +6,8 @@
# For using GSON @Expose annotation
-keepattributes *Annotation*

# Gson specific classes
-dontwarn sun.misc.**
#-keep class com.google.gson.stream.** { *; }

# Application classes that will be serialized/deserialized over Gson
-keep class org.openedx.*.data.model.** { <fields>; }
-keepclassmembers class org.openedx.**.data.model.** { *; }

# Prevent proguard from stripping interface information from TypeAdapter, TypeAdapterFactory,
# JsonSerializer, JsonDeserializer instances (so they can be used in @JsonAdapter)
Expand All @@ -85,13 +18,13 @@

# Prevent R8 from leaving Data object members always null
-keepclassmembers,allowobfuscation class * {
<init>();
@com.google.gson.annotations.SerializedName <fields>;
}

# Retain generic signatures of TypeToken and its subclasses with R8 version 3.0 and higher.
-keep,allowobfuscation,allowshrinking class com.google.gson.reflect.TypeToken
-keep,allowobfuscation,allowshrinking class * extends com.google.gson.reflect.TypeToken

##---------------End: proguard configuration for Gson ----------

-keepclassmembers class * extends java.lang.Enum {
Expand All @@ -108,4 +41,29 @@
-dontwarn org.conscrypt.ConscryptHostnameVerifier
-dontwarn org.openjsse.javax.net.ssl.SSLParameters
-dontwarn org.openjsse.javax.net.ssl.SSLSocket
-dontwarn org.openjsse.net.ssl.OpenJSSE
-dontwarn org.openjsse.net.ssl.OpenJSSE
-dontwarn com.google.crypto.tink.subtle.Ed25519Sign$KeyPair
-dontwarn com.google.crypto.tink.subtle.Ed25519Sign
-dontwarn com.google.crypto.tink.subtle.Ed25519Verify
-dontwarn com.google.crypto.tink.subtle.X25519
-dontwarn edu.umd.cs.findbugs.annotations.NonNull
-dontwarn edu.umd.cs.findbugs.annotations.Nullable
-dontwarn edu.umd.cs.findbugs.annotations.SuppressFBWarnings
-dontwarn org.bouncycastle.asn1.ASN1Encodable
-dontwarn org.bouncycastle.asn1.pkcs.PrivateKeyInfo
-dontwarn org.bouncycastle.asn1.x509.AlgorithmIdentifier
-dontwarn org.bouncycastle.asn1.x509.SubjectPublicKeyInfo
-dontwarn org.bouncycastle.cert.X509CertificateHolder
-dontwarn org.bouncycastle.cert.jcajce.JcaX509CertificateHolder
-dontwarn org.bouncycastle.crypto.BlockCipher
-dontwarn org.bouncycastle.crypto.CipherParameters
-dontwarn org.bouncycastle.crypto.InvalidCipherTextException
-dontwarn org.bouncycastle.crypto.engines.AESEngine
-dontwarn org.bouncycastle.crypto.modes.GCMBlockCipher
-dontwarn org.bouncycastle.crypto.params.AEADParameters
-dontwarn org.bouncycastle.crypto.params.KeyParameter
-dontwarn org.bouncycastle.jcajce.provider.BouncyCastleFipsProvider
-dontwarn org.bouncycastle.jce.provider.BouncyCastleProvider
-dontwarn org.bouncycastle.openssl.PEMKeyPair
-dontwarn org.bouncycastle.openssl.PEMParser
-dontwarn org.bouncycastle.openssl.jcajce.JcaPEMKeyConverter
Loading
Loading