Skip to content

Commit

Permalink
Merge pull request #49 from hegocre/maintenance/updates
Browse files Browse the repository at this point in the history
Library updates and bug fixes
  • Loading branch information
hegocre authored Sep 8, 2023
2 parents 48865ed + a5c0f73 commit 44876e5
Show file tree
Hide file tree
Showing 34 changed files with 400 additions and 682 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
java-version: '17'
distribution: 'zulu'
- name: Build with Gradle
run: ./gradlew clean && ./gradlew assembleDebug
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ de l'assignatura de Software Lliure i Desenvolupament Social.
# Funcionalitats

- Consultar els avisos i rebre notificacions
- Consultar el teu horari
- Consultar el teu horari, els teus examens, i dies festius.
- Dur a terme un control sobre les avaluacions

# Captures de pantalla

| ![Screenshot 1](/screenshots/screenshot1.png) | ![Screenshot 2](/screenshots/screenshot2.png) | ![Screenshot 3](/screenshots/screenshot3.png) | ![Screenshot 4](/screenshots/screenshot4.png) | ![Screenshot 5](/screenshots/screenshot5.png)
| ![Screenshot 1](/screenshots/screenshot1.png) | ![Screenshot 2](/screenshots/screenshot2.png) | ![Screenshot 3](/screenshots/screenshot3.png) | ![Screenshot 4](/screenshots/screenshot4.png) | ![Screenshot 5](/screenshots/screenshot5.png) |
|-----------------------------------------------|-----------------------------------------------|-----------------------------------------------|-----------------------------------------------|-----------------------------------------------|


Expand Down
73 changes: 37 additions & 36 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompilationTask

plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
id 'kotlin-android'
//id 'com.google.devtools.ksp' version "$ksp_version"
id 'org.jetbrains.kotlin.kapt'
id 'org.jetbrains.kotlin.plugin.serialization' version "$kotlin_version"
Expand All @@ -12,26 +14,26 @@ apiKeyProperties.load(new FileInputStream(apiKeyPropertiesFile))

android {
namespace 'com.yara.raco'
compileSdk 33
compileSdk 34

defaultConfig {
applicationId "com.yara.raco"
minSdk 26
targetSdk 33
versionCode 26
versionName "1.0.4"
targetSdk 34
versionCode 32
versionName "1.0.6"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
useSupportLibrary true
}
resConfigs 'ca', 'es', 'en'
resourceConfigurations += ['ca', 'es', 'en']


buildConfigField("String", "CLIENT_ID", apiKeyProperties['CLIENT_ID'])
buildConfigField("String", "CLIENT_SECRET", apiKeyProperties['CLIENT_SECRET'])

applicationVariants.all { variant ->
applicationVariants.configureEach { variant ->
variant.resValue "string", "version_name", variant.versionName
variant.resValue "string", "version_code", variant.versionCode.toString()
}
Expand All @@ -55,17 +57,17 @@ android {
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = '11'
jvmTarget = '17'
}
buildFeatures {
compose true
}
composeOptions {
kotlinCompilerExtensionVersion '1.4.0'
kotlinCompilerExtensionVersion '1.4.8'
}
packagingOptions {
resources {
Expand All @@ -75,50 +77,49 @@ android {
}

dependencies {

//Android dependencies
implementation 'androidx.core:core-ktx:1.9.0'
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.5.1'
implementation 'androidx.core:core-ktx:1.12.0'
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.6.2'
implementation 'androidx.datastore:datastore-preferences:1.0.0'

//Compose dependencies
implementation 'androidx.activity:activity-compose:1.6.1'
implementation 'androidx.navigation:navigation-compose:2.5.3'
implementation "androidx.compose.ui:ui:$compose_version"
implementation "androidx.compose.runtime:runtime-livedata:$compose_version"
implementation "androidx.compose.ui:ui-tooling-preview:$compose_version"
implementation 'androidx.compose.material:material-icons-extended:1.3.1'
implementation 'androidx.compose.material3:material3:1.0.1'
implementation platform('androidx.compose:compose-bom:2023.09.00')
implementation "androidx.compose.ui:ui"
implementation "androidx.compose.runtime:runtime-livedata"
implementation "androidx.compose.ui:ui-tooling-preview"
implementation 'androidx.compose.material:material-icons-extended'
implementation 'androidx.compose.material3:material3'

implementation 'androidx.activity:activity-compose:1.7.2'
implementation 'androidx.navigation:navigation-compose:2.7.2'

//Room dependencies
implementation "androidx.room:room-ktx:$room_version"
annotationProcessor "androidx.room:room-compiler:$room_version"
//annotationProcessor "androidx.room:room-compiler:$room_version"
//ksp "androidx.room:room-compiler:$room_version"
kapt "androidx.room:room-compiler:$room_version"

implementation "com.google.accompanist:accompanist-swiperefresh:$accompanist_version"
implementation "com.google.accompanist:accompanist-pager:$accompanist_version"
implementation 'com.google.accompanist:accompanist-swiperefresh:0.30.1'

implementation 'androidx.work:work-runtime-ktx:2.8.0'
implementation 'androidx.work:work-runtime-ktx:2.8.1'

implementation 'com.squareup.okhttp3:okhttp:4.10.0'
implementation 'com.squareup.okhttp3:okhttp:4.11.0'

implementation 'org.jetbrains.kotlinx:kotlinx-serialization-json:1.4.1'
implementation 'org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.0'

//Debug and test implementations
testImplementation 'junit:junit:4.13.2'
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-tooling:$compose_version"
debugImplementation "androidx.compose.ui:ui-test-manifest:$compose_version"
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.0'
implementation 'androidx.compose.ui:ui-test-junit4'
debugImplementation "androidx.compose.ui:ui-tooling"
debugImplementation "androidx.compose.ui:ui-test-manifest"
}

// Compiler flag to use experimental Compose APIs
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
kotlinOptions {
jvmTarget = "11"
freeCompilerArgs += [
"-opt-in=kotlin.RequiresOptIn", "-Xjvm-default=all-compatibility"
]
tasks.withType(KotlinCompilationTask).configureEach {
compilerOptions {
freeCompilerArgs.addAll("-opt-in=kotlin.RequiresOptIn", "-Xjvm-default=all-compatibility")
}
}
26 changes: 22 additions & 4 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,23 +40,41 @@
android:theme="@style/Theme.Raco">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="com.yara.raco.action.main" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>

<meta-data
android:name="android.app.lib_name"
android:value="" />
</activity>
<activity
android:name=".ui.activities.LoginActivity"
android:exported="false" />
android:exported="false">
<intent-filter>
<action android:name="com.yara.raco.action.login" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".ui.activities.WebLoginActivity"
android:exported="false" />
android:exported="false">
<intent-filter>
<action android:name="com.yara.raco.action.weblogin" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".ui.activities.AboutActivity"
android:exported="false" />
android:exported="false">
<intent-filter>
<action android:name="com.yara.raco.action.about" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>

</manifest>
3 changes: 1 addition & 2 deletions app/src/main/java/com/yara/raco/api/EventsApi.kt
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
package com.yara.raco.api

import com.yara.raco.model.event.Event
import com.yara.raco.utils.Json
import com.yara.raco.utils.OkHttpRequest
import com.yara.raco.utils.Result
import com.yara.raco.utils.ResultCode
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
import kotlinx.serialization.decodeFromString
import kotlinx.serialization.json.Json

class EventsApi private constructor() {

Expand Down
13 changes: 10 additions & 3 deletions app/src/main/java/com/yara/raco/api/NoticesApi.kt
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
package com.yara.raco.api

import android.annotation.SuppressLint
import android.app.DownloadManager
import android.content.*
import android.net.Uri
import android.os.Build
import android.os.Environment
import android.webkit.MimeTypeMap
import android.widget.Toast
import androidx.core.content.FileProvider
import com.yara.raco.R
import com.yara.raco.model.files.File
import com.yara.raco.model.notices.Notice
import com.yara.raco.utils.Json
import com.yara.raco.utils.OkHttpRequest
import com.yara.raco.utils.Result
import com.yara.raco.utils.ResultCode
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
import kotlinx.serialization.Serializable
import kotlinx.serialization.decodeFromString
import kotlinx.serialization.json.Json

class NoticesApi private constructor() {

Expand Down Expand Up @@ -50,6 +51,7 @@ class NoticesApi private constructor() {
Result.Error(ResultCode.ERROR_API_BAD_REQUEST)
}

@SuppressLint("UnspecifiedRegisterReceiverFlag")
fun getAttachment(context: Context, file: File, accessToken: String) {
val request = DownloadManager.Request(Uri.parse(file.url))
.setTitle(file.nom)
Expand Down Expand Up @@ -116,7 +118,12 @@ class NoticesApi private constructor() {
}
}

context.registerReceiver(downloadReceiver, filter)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
context.registerReceiver(downloadReceiver, filter, Context.RECEIVER_NOT_EXPORTED)
} else {
//suppress UnspecifiedRegisterReceiverFlag
context.registerReceiver(downloadReceiver, filter)
}

downloadManager.enqueue(request)

Expand Down
3 changes: 1 addition & 2 deletions app/src/main/java/com/yara/raco/api/ScheduleApi.kt
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
package com.yara.raco.api

import com.yara.raco.model.schedule.Schedule
import com.yara.raco.utils.Json
import com.yara.raco.utils.OkHttpRequest
import com.yara.raco.utils.Result
import com.yara.raco.utils.ResultCode
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
import kotlinx.serialization.Serializable
import kotlinx.serialization.decodeFromString
import kotlinx.serialization.json.Json

class ScheduleApi private constructor() {

Expand Down
3 changes: 1 addition & 2 deletions app/src/main/java/com/yara/raco/api/SemesterApi.kt
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
package com.yara.raco.api

import com.yara.raco.model.exam.Exam
import com.yara.raco.utils.Json
import com.yara.raco.utils.OkHttpRequest
import com.yara.raco.utils.Result
import com.yara.raco.utils.ResultCode
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
import kotlinx.serialization.SerialName
import kotlinx.serialization.decodeFromString
import kotlinx.serialization.json.Json

class SemesterApi private constructor() {

Expand Down
3 changes: 1 addition & 2 deletions app/src/main/java/com/yara/raco/api/SubjectsAPI.kt
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
package com.yara.raco.api

import com.yara.raco.model.subject.Subject
import com.yara.raco.utils.Json
import com.yara.raco.utils.OkHttpRequest
import com.yara.raco.utils.Result
import com.yara.raco.utils.ResultCode
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
import kotlinx.serialization.Serializable
import kotlinx.serialization.decodeFromString
import kotlinx.serialization.json.Json

class SubjectsAPI private constructor() {

Expand Down
3 changes: 1 addition & 2 deletions app/src/main/java/com/yara/raco/api/TokenApi.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@ package com.yara.raco.api

import com.yara.raco.BuildConfig
import com.yara.raco.model.user.AccessToken
import com.yara.raco.utils.Json
import com.yara.raco.utils.OkHttpRequest
import com.yara.raco.utils.Result
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
import kotlinx.serialization.decodeFromString
import kotlinx.serialization.json.Json

class TokenApi private constructor() {

Expand Down
13 changes: 3 additions & 10 deletions app/src/main/java/com/yara/raco/ui/components/RacoAboutScreen.kt
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,6 @@ fun AboutTextField(
}
}

@OptIn(ExperimentalMaterial3Api::class)
@Composable
fun LicensesDialog(
licenses: List<LicenseNotice>,
Expand Down Expand Up @@ -272,13 +271,13 @@ fun LicensesDialog(
LazyColumn(modifier = Modifier.weight(1f, fill = false)) {
items(items = licenses, key = { it.name }) { license ->
ListItem(
headlineText = {
headlineContent = {
Text(text = license.name)
},
overlineText = {
overlineContent = {
Text(text = license.licenseName)
},
supportingText = {
supportingContent = {
Text(text = license.copyright)
},
modifier = Modifier
Expand Down Expand Up @@ -341,12 +340,6 @@ val licenses = listOf(
licenseName = "Apache License 2.0",
licenseUrl = "https://github.com/square/okhttp/blob/master/LICENSE.txt"
),
LicenseNotice(
name = "Compose Tooltip",
copyright = "Copyright 2022 Patrick Goldinger",
licenseName = "Apache License 2.0",
licenseUrl = "https://github.com/patrickgold/compose-tooltip/blob/main/LICENSE"
),
LicenseNotice(
name = "WeekSchedule",
copyright = "Copyright 2021 Daniel Rampelt",
Expand Down
Loading

0 comments on commit 44876e5

Please sign in to comment.