Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.4.2'
classpath 'com.android.tools.build:gradle:8.0.2'
classpath 'com.google.gms:google-services:3.2.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
Expand Down
7 changes: 4 additions & 3 deletions core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ apply plugin: 'kotlin-parcelize'
android {
compileSdkVersion rootProject.compileSdkVersion
buildToolsVersion rootProject.buildToolsVersion
namespace 'in.testpress'

defaultConfig {
minSdkVersion rootProject.minSdkVersion
Expand Down Expand Up @@ -40,12 +41,12 @@ android {
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}

kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8.toString()
jvmTarget = JavaVersion.VERSION_17.toString()
}

packagingOptions {
Expand Down
271 changes: 271 additions & 0 deletions core/src/main/res/values/strings.xml

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions course/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ apply plugin: 'kotlin-android'
android {
compileSdkVersion rootProject.compileSdkVersion
buildToolsVersion rootProject.buildToolsVersion
namespace 'in.testpress.course'

defaultConfig {
minSdkVersion rootProject.minSdkVersion
Expand All @@ -26,11 +27,11 @@ android {
unitTests.includeAndroidResources = true
}
compileOptions {
sourceCompatibility 1.8
targetCompatibility 1.8
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8.toString()
jvmTarget = JavaVersion.VERSION_17.toString()
}
Comment on lines +30 to 35
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Kotlin 1.8.0 + JVM 17 is an invalid combination

jvmTarget = 17 (and JavaVersion.VERSION_17) is only supported from Kotlin 1.9.0 (¹).
With the project still pinned to ext.kotlin_version = "1.8.0" the build will fail at compile time.

Quick fixes:

-    compileOptions {
-        sourceCompatibility JavaVersion.VERSION_17
-        targetCompatibility JavaVersion.VERSION_17
-    }
-    kotlinOptions {
-        jvmTarget = JavaVersion.VERSION_17.toString()
-    }
+    compileOptions {
+        sourceCompatibility JavaVersion.VERSION_11
+        targetCompatibility JavaVersion.VERSION_11
+    }
+    kotlinOptions {
+        jvmTarget = "11"
+    }

or upgrade every module to Kotlin 1.9.x (and its matching Compose compiler).

(¹) see Kotlin release notes: https://kotlinlang.org/docs/whatsnew19.html#kotlin-jvm-target-17

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8.toString()
jvmTarget = JavaVersion.VERSION_17.toString()
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
kotlinOptions {
jvmTarget = "11"
}
🤖 Prompt for AI Agents
In course/build.gradle around lines 30 to 35, the kotlinOptions.jvmTarget is set
to JavaVersion.VERSION_17, which requires Kotlin 1.9.0 or higher, but the
project is using Kotlin 1.8.0. To fix this, either downgrade jvmTarget to 1.8 to
match Kotlin 1.8.0 or upgrade the Kotlin version in the project to 1.9.x and
update all related modules and Compose compiler accordingly.

buildFeatures {
viewBinding true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ class LiveStreamFragment : BaseContentDetailFragment(), LiveStreamCallbackListen
exoPlayerView = view!!.findViewById(R.id.exo_player_main_frame)
exoPlayerView.visibility = View.VISIBLE
exoPlayerView.setAspectRatio(16f / 9f)
exoPlayerView.findViewById<TextView>(R.id.exo_duration).visibility = View.GONE
//exoPlayerView.findViewById<TextView>(R.id.exo_duration).visibility = View.GONE

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This line is commented out. If it's no longer needed, it should be removed to keep the code clean. If it's for debugging, it should not be part of the final pull request.

exoPlayerView.findViewById<RelativeLayout>(R.id.live_label).visibility = View.VISIBLE
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class VideoDownloadQualityChooserDialog(val content: DomainContent) : DialogFrag
}

private fun initializeTrackSelectionView(view: View) {
trackSelectionView = view.findViewById(R.id.exo_track_selection_view)
trackSelectionView = view.findViewById(com.google.android.exoplayer2.ui.R.id.exo_track_selection_view)
trackSelectionView.setShowDisableOption(false)
trackSelectionView.setAllowAdaptiveSelections(false)
trackSelectionView.setAllowMultipleOverrides(false)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package `in`.testpress.course.util

import `in`.testpress.course.R

import `in`.testpress.course.databinding.LayoutDocumentViewerBinding
import `in`.testpress.course.databinding.TrackSelectionDialogBinding
import android.app.Dialog
Expand All @@ -15,6 +15,7 @@ import com.google.android.exoplayer2.C
import com.google.android.exoplayer2.trackselection.DefaultTrackSelector
import com.google.android.exoplayer2.trackselection.MappingTrackSelector
import com.google.android.exoplayer2.ui.TrackSelectionView
import `in`.testpress.course.R

open class TrackSelectionDialog(
private val parameters: DefaultTrackSelector.Parameters,
Expand Down Expand Up @@ -68,7 +69,7 @@ open class TrackSelectionDialog(
}

private fun initializeTrackSelectionView(view: View) {
trackSelectionView = view.findViewById(R.id.exo_track_selection_view)
trackSelectionView = view.findViewById(com.google.android.exoplayer2.ui.R.id.exo_track_selection_view)
trackSelectionView.setShowDisableOption(false)
trackSelectionView.setAllowAdaptiveSelections(allowAdaptiveSelections)
trackSelectionView.setAllowMultipleOverrides(false)
Expand Down
Binary file added course/src/main/res/drawable/crown.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added course/src/main/res/drawable/ic_bookmark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added course/src/main/res/drawable/ic_remove_bookmark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions course/src/main/res/drawable/testpress_difficulty_left_off.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >

<solid android:color="@color/testpress_text_gray_light" />

<corners
android:bottomLeftRadius="100dp"
android:bottomRightRadius="0dp"
android:topLeftRadius="100dp"
android:topRightRadius="0dp" />

</shape>
13 changes: 13 additions & 0 deletions course/src/main/res/drawable/testpress_difficulty_left_on.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >

<solid android:color="@color/testpress_difficulty_level_1" />

<corners
android:bottomLeftRadius="100dp"
android:bottomRightRadius="0dp"
android:topLeftRadius="100dp"
android:topRightRadius="0dp" />

</shape>
13 changes: 13 additions & 0 deletions course/src/main/res/drawable/testpress_difficulty_right_off.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >

<solid android:color="@color/testpress_text_gray_light" />

<corners
android:bottomLeftRadius="0dp"
android:bottomRightRadius="100dp"
android:topLeftRadius="0dp"
android:topRightRadius="100dp" />

</shape>
13 changes: 13 additions & 0 deletions course/src/main/res/drawable/testpress_difficulty_right_on.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >

<solid android:color="@color/testpress_difficulty_level_5" />

<corners
android:bottomLeftRadius="0dp"
android:bottomRightRadius="100dp"
android:topLeftRadius="0dp"
android:topRightRadius="100dp" />

</shape>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
61 changes: 61 additions & 0 deletions course/src/main/res/layout/base_list_layout.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">

<com.facebook.shimmer.ShimmerFrameLayout
android:id="@+id/shimmer_view_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone"
app:shimmer_duration="1000">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
>

<include
layout="@layout/testpress_list_placholder">
</include>
<include
layout="@layout/testpress_list_placholder">
</include>
<include
layout="@layout/testpress_list_placholder">
</include>
<include
layout="@layout/testpress_list_placholder">
</include>
<include
layout="@layout/testpress_list_placholder">
</include>
<include
layout="@layout/testpress_list_placholder">
</include>
<include
layout="@layout/testpress_list_placholder">
</include>
<include
layout="@layout/testpress_list_placholder">
</include>
<include
layout="@layout/testpress_list_placholder">
</include>

</LinearLayout>
</com.facebook.shimmer.ShimmerFrameLayout>

<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler_view"
android:layout_width="match_parent"
android:layout_height="match_parent" />

<FrameLayout
android:id="@+id/empty_view_fragment"
android:layout_width="match_parent"
android:layout_height="match_parent" />

</RelativeLayout>
167 changes: 167 additions & 0 deletions course/src/main/res/layout/content_list_item.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="10dp"
tools:ignore="MissingDefaultResource">

<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/container"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintEnd_toStartOf="@+id/info_conatainer"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
Comment on lines +14 to +16
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Typo in id breaks Kotlin/Java bindings

@+id/info_conatainer is miss-spelled. Any view-binding or synthetic accessor generated with the correct spelling will fail with Unresolved reference.

-    android:id="@+id/info_conatainer"
+    android:id="@+id/info_container"

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In course/src/main/res/layout/content_list_item.xml around lines 14 to 16, there
is a typo in the id reference "info_conatainer" which should be corrected to
"info_container". Fix the spelling of the id in the
layout_constraintEnd_toStartOf attribute to ensure Kotlin/Java view bindings
generate correctly and avoid unresolved reference errors.


<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/thumbnailContainer"
android:layout_width="160dp"
android:layout_height="87dp"
android:layout_margin="10dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">

<androidx.cardview.widget.CardView
android:id="@+id/thumbnailImageContainer"
android:layout_width="155dp"
android:layout_height="87dp"
android:visibility="visible"
app:cardCornerRadius="4dp"
app:cardElevation="0dp"
android:paddingRight="10dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">

<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center">

<ImageView
android:id="@+id/thumbnail"
android:layout_width="155dp"
android:layout_height="87dp"
android:adjustViewBounds="true"
android:background="#CAC8C8" />

<ImageView
android:id="@+id/content_type_icon"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_gravity="center_horizontal|center_vertical"
android:paddingBottom="10dp"
android:visibility="visible" />

</FrameLayout>

</androidx.cardview.widget.CardView>

<LinearLayout
android:id="@+id/lock_container"
android:layout_width="36dp"
android:layout_height="36dp"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_marginEnd="8dp"
android:layout_marginTop="4dp"
android:layout_marginRight="8dp"
android:background="@drawable/testpress_round_gray_background"
Comment on lines +61 to +70
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Deprecated RTL-unaware margins

layout_marginLeft / layout_marginRight are deprecated and ignore RTL. Use layout_marginStart / layout_marginEnd.

-                android:layout_marginRight="8dp"
+                android:layout_marginEnd="8dp"

(Apply to all instances in the file.)

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<LinearLayout
android:id="@+id/lock_container"
android:layout_width="36dp"
android:layout_height="36dp"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_marginEnd="8dp"
android:layout_marginTop="4dp"
android:layout_marginRight="8dp"
android:background="@drawable/testpress_round_gray_background"
<LinearLayout
android:id="@+id/lock_container"
android:layout_width="36dp"
android:layout_height="36dp"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_marginEnd="8dp"
android:layout_marginTop="4dp"
android:layout_marginEnd="8dp"
android:background="@drawable/testpress_round_gray_background"
🤖 Prompt for AI Agents
In course/src/main/res/layout/content_list_item.xml around lines 61 to 70,
replace all occurrences of the deprecated attributes layout_marginLeft and
layout_marginRight with layout_marginStart and layout_marginEnd respectively to
ensure proper RTL support. Review the entire file and update all such margin
attributes accordingly.

android:gravity="center"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent">

<ImageView
android:id="@+id/lock_image"
android:layout_width="wrap_content"
android:layout_height="16dp"
android:layout_marginLeft="10dp"
android:layout_marginTop="10dp"
android:layout_marginRight="10dp"
android:layout_marginBottom="10dp"
android:scaleType="fitXY"
android:src="@drawable/testpress_lock_outline_white" />

</LinearLayout>

</androidx.constraintlayout.widget.ConstraintLayout>

<LinearLayout
android:id="@+id/attempted_tick_container"
android:layout_width="30dp"
android:layout_height="25dp"
android:gravity="end|bottom"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent">

<ImageView
android:layout_width="20dp"
android:layout_height="20dp"
android:gravity="end|bottom"
android:background="@drawable/green_circle_background"
android:src="@drawable/ic_tick" />

</LinearLayout>

</androidx.constraintlayout.widget.ConstraintLayout>

<LinearLayout
android:id="@+id/info_conatainer"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginLeft="0dp"
android:orientation="vertical"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/container"
app:layout_constraintTop_toTopOf="parent">

<TextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:ellipsize="end"
android:maxLines="2"
android:text="Title goes here"
android:textColor="@color/testpress_black"
android:textSize="16sp" />

<LinearLayout
android:id="@+id/content_details_container"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginLeft="0dp"
android:orientation="vertical"
android:visibility="visible"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/container"
app:layout_constraintTop_toTopOf="parent">

</LinearLayout>

<LinearLayout
android:id="@+id/scheduled_info_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:visibility="gone">

<TextView
android:id="@+id/scheduled_info"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:lineSpacingExtra="4dp"
android:maxLines="1"
android:text=""
android:textColor="@color/testpress_text_gray_medium"
android:textSize="12sp" />

</LinearLayout>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
Loading