Skip to content

Commit

Permalink
dependency update and code refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
aman-alfresco committed Oct 9, 2024
1 parent 4e5e49b commit 1109093
Show file tree
Hide file tree
Showing 45 changed files with 207 additions and 172 deletions.
9 changes: 5 additions & 4 deletions actions/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
plugins{
id('com.android.library')
id('kotlin-android')
id('kotlin-kapt')
id 'com.android.library'
id 'kotlin-android'
// id('kotlin-kapt')
id 'com.google.devtools.ksp'
}

android {
Expand Down Expand Up @@ -35,7 +36,7 @@ dependencies {
implementation libs.epoxy.core
implementation libs.mavericks

kapt libs.epoxy.processor
ksp libs.epoxy.processor

// Testing
testImplementation libs.junit
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class ActionMoveFragment : Fragment() {
arguments?.let { bundle ->
val entryObj = bundle.getParcelable(ENTRY_OBJ_KEY) as Entry?
requestLauncher = registerForActivityResult(MoveResultContract(entryObj)) {
viewModel.onResult?.resume(it, null)
viewModel.onResult?.resume(it) { cause, _, _ -> null(cause) }
}
}
}
Expand Down
6 changes: 5 additions & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ android {
resources {
pickFirsts += ['META-INF/auth_release.kotlin_module']
}
dex {
useLegacyPackaging false
}
}

// Temporary kotlin module duplication fix
Expand Down Expand Up @@ -102,7 +105,8 @@ dependencies {
implementation project(':move')
implementation project(':process-app')
implementation project(':data')
implementation libs.alfresco.content
// implementation libs.alfresco.content
implementation project(':content')

implementation libs.kotlin.stdlib

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.alfresco.content.app.activity

import android.annotation.SuppressLint
import android.content.Context
import android.content.Intent
import android.content.pm.ActivityInfo
Expand Down Expand Up @@ -150,13 +151,13 @@ class MainActivity : AppCompatActivity(), MavericksView, ActionMode.Callback {
}
}

override fun onNewIntent(intent: Intent?) {
override fun onNewIntent(intent: Intent) {
super.onNewIntent(intent)
this.intent = intent
isNewIntent = true
viewModel.handleDataIntent(
intent?.extras?.getString(MODE_KEY, ""),
intent?.extras?.getBoolean(KEY_FOLDER, false) ?: false,
intent.extras?.getString(MODE_KEY, ""),
intent.extras?.getBoolean(KEY_FOLDER, false) ?: false,
)
}

Expand Down
6 changes: 3 additions & 3 deletions auth/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ dependencies {

implementation libs.kotlin.stdlib

api libs.alfresco.auth

// api libs.alfresco.auth
api project(':alfresco-auth')
implementation libs.google.material

implementation libs.androidx.appcompat
implementation libs.androidx.core
implementation libs.androidx.constraintlayout
implementation libs.constraintlayout

implementation libs.androidx.lifecycle.viewmodel
implementation libs.androidx.lifecycle.runtime
Expand Down
19 changes: 12 additions & 7 deletions browse/build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
plugins{
id('com.android.library')
id('kotlin-android')
id('kotlin-kapt')
id('kotlin-parcelize')
id 'com.android.library'
id 'kotlin-android'
// id('kotlin-kapt')
id 'kotlin-parcelize'
id 'com.google.devtools.ksp'
}
android {

Expand Down Expand Up @@ -34,8 +35,10 @@ dependencies {
implementation project(':component')
implementation project(':process-app')

implementation libs.alfresco.content
implementation libs.alfresco.process
// implementation libs.alfresco.content
// implementation libs.alfresco.process
implementation project(':content')
implementation project(':process')
implementation libs.kotlin.reflect
implementation libs.androidx.core
implementation libs.androidx.lifecycle.viewmodel
Expand All @@ -50,7 +53,7 @@ dependencies {
implementation libs.mavericks

implementation libs.epoxy.core
kapt libs.epoxy.processor
ksp libs.epoxy.processor

// Testing
testImplementation libs.junit
Expand All @@ -69,4 +72,6 @@ dependencies {
testImplementation libs.mockito.core
// Optional -- Mockk framework
testImplementation libs.mockk

implementation libs.retrofit.core
}
7 changes: 7 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,16 @@ buildscript {
classpath libs.spotless
classpath libs.gradleVersionsPlugin
classpath libs.gradleLicensePlugin

classpath libs.kotlin.serialization.plugin
classpath libs.dokka
}
}

plugins {
id 'com.google.devtools.ksp' version '2.0.20-1.0.25' apply false
}

allprojects {
repositories {
maven {
Expand Down
13 changes: 7 additions & 6 deletions capture/build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
plugins{
id('com.android.library')
id('kotlin-android')
id('kotlin-kapt')
id('kotlin-parcelize')
id 'com.android.library'
id 'kotlin-android'
// id 'kotlin-kapt'
id 'kotlin-parcelize'
id 'com.google.devtools.ksp'
}

android {
Expand Down Expand Up @@ -49,10 +50,10 @@ dependencies {
implementation libs.androidx.camera.lifecycle
implementation libs.androidx.camera.view

implementation libs.androidx.constraintlayout
implementation libs.constraintlayout

implementation libs.mavericks

implementation libs.epoxy.core
kapt libs.epoxy.processor
ksp libs.epoxy.processor
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import androidx.fragment.app.Fragment
import com.alfresco.content.withFragment
import kotlinx.coroutines.CancellableContinuation
import kotlinx.coroutines.suspendCancellableCoroutine
import kotlin.coroutines.cancellation.CancellationException
import kotlin.coroutines.resume

class CaptureHelperFragment : Fragment() {
private lateinit var requestLauncher: ActivityResultLauncher<Unit>
Expand All @@ -17,7 +19,16 @@ class CaptureHelperFragment : Fragment() {
super.onCreate(savedInstanceState)

requestLauncher = registerForActivityResult(CapturePhotoResultContract()) {
onResult?.resume(it, null)
// onResult?.resume(it, null)
onResult?.let { continuation ->
continuation.resume(it) { cause, _, _ ->
// Send null if cancelled
if (cause is CancellationException) {
continuation.resume(null)
}
}
}

}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class SaveFragment : Fragment(), MavericksView {

if (savedInstanceState == null) {
withState(viewModel) {
binding.fileNameInputLayout.text = it.listCapture.first()?.name ?: ""
binding.fileNameInputLayout.text = it.listCapture.first().name
}
}

Expand Down
1 change: 1 addition & 0 deletions common/src/main/res/values-de/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,5 @@
<string name="message_content_in_queue">Das Hochladen von Dateien ist in Bearbeitung. Tippen Sie auf Bestätigen, um ohne laufende Dateien fortzufahren.</string>
<string name="no_attached_files">Keine angehängten Dateien</string>
<string name="title_no_name">Kein Name</string>
<string name="component_action_reset">Zurücksetzen</string>
</resources>
1 change: 1 addition & 0 deletions common/src/main/res/values-es/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,5 @@
<string name="message_content_in_queue">La carga de ficheros está en curso. Toque Confirmar para continuar sin los ficheros en curso.</string>
<string name="no_attached_files">No hay ficheros adjuntos</string>
<string name="title_no_name">No tiene ningún nombre</string>
<string name="component_action_reset">Reiniciar</string>
</resources>
1 change: 1 addition & 0 deletions common/src/main/res/values-fr/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,5 @@
<string name="message_content_in_queue">Le téléchargement des fichiers est en cours. Tapez sur Confirmer pour continuer sans fichiers en cours.</string>
<string name="no_attached_files">Aucun fichier joint</string>
<string name="title_no_name">Sans nom</string>
<string name="component_action_reset">Réinitialiser</string>
</resources>
1 change: 1 addition & 0 deletions common/src/main/res/values-it/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,5 @@
<string name="message_content_in_queue">Il caricamento dei file è in corso. Toccare su Conferma per continuare senza questi file.</string>
<string name="no_attached_files">Nessun file allegato</string>
<string name="title_no_name">Nessun nome</string>
<string name="component_action_reset">Reimposta</string>
</resources>
1 change: 1 addition & 0 deletions common/src/main/res/values-night/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@
<color name="color_bg_initial">#1FFFFFFF</color>
<color name="color_text_initial">@android:color/white</color>
<color name="colorGray1">@android:color/white</color>
<color name="color_blue_30">#3D2A7DE1</color>
</resources>
1 change: 1 addition & 0 deletions common/src/main/res/values-nl/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,5 @@
<string name="message_content_in_queue">Er worden bestanden geüpload. Tik om te bevestigen dat u wilt doorgaan zonder de bestanden in uitvoering.</string>
<string name="no_attached_files">Geen bijgevoegde bestanden</string>
<string name="title_no_name">Geen naam</string>
<string name="component_action_reset">Opnieuw instellen</string>
</resources>
1 change: 1 addition & 0 deletions common/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@
<color name="colorGray1">#212121</color>
<color name="color_bg_initial">#1F212121</color>
<color name="color_text_initial">#262626</color>
<color name="color_blue_30">#3D2A7DE1</color>
</resources>
1 change: 1 addition & 0 deletions common/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,5 @@
<string name="message_content_in_queue">Files uploading is in progress. Tap on Confirm to continue without in-progress files.</string>
<string name="no_attached_files">No Attached Files</string>
<string name="title_no_name">No Name</string>
<string name="component_action_reset">Reset</string>
</resources>
13 changes: 6 additions & 7 deletions component/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ plugins {
id 'org.jetbrains.kotlin.android'
id 'kotlin-android'
id 'kotlin-parcelize'
id 'kotlin-kapt'
// id 'kotlin-kapt'
id 'com.google.devtools.ksp'
id 'org.jetbrains.kotlin.plugin.compose' version '2.0.20'
}

android {
Expand All @@ -21,18 +23,15 @@ android {
}
}

kapt {
correctErrorTypes = true
}

dependencies {

implementation project(':base')
implementation project(':common')
implementation project(':data')
implementation project(':theme')

implementation libs.alfresco.content
// implementation libs.alfresco.content
implementation project(':content')

implementation libs.coroutines.core
implementation libs.androidx.appcompat
Expand All @@ -44,7 +43,7 @@ dependencies {
implementation libs.mavericks

implementation libs.epoxy.core
kapt libs.epoxy.processor
ksp libs.epoxy.processor

implementation libs.ui
implementation libs.activity.compose
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ internal class ListViewActionsRow @JvmOverloads constructor(

@ModelProp
fun setData(options: ComponentOptions) {
binding.actionButton.text = context.getLocalizedName(options.label ?: "")
binding.actionButton.text = context.getLocalizedName(options.label)
}

@CallbackProp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ internal class ListViewCheckRow @JvmOverloads constructor(

@ModelProp
fun setData(options: ComponentOptions) {
binding.title.text = context.getLocalizedName(options.label ?: "")
binding.title.text = context.getLocalizedName(options.label)
}

@ModelProp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ internal class ListViewUserRow @JvmOverloads constructor(
@ModelProp
fun setData(dataObj: UserGroupDetails) {
binding.tvUserInitial.text = context.getLocalizedName(dataObj.nameInitial)
binding.tvName.text = dataObj.groupName.ifEmpty { context.getLocalizedName(dataObj.name ?: "") }
binding.tvName.text = dataObj.groupName.ifEmpty { context.getLocalizedName(dataObj.name) }
}

/**
Expand Down
1 change: 0 additions & 1 deletion component/src/main/res/values-de/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
<string name="hint_range_from_date">Startdatum</string>
<string name="hint_range_to_date">Enddatum</string>
<string name="component_number_range_invalid_input">Der \„Von\“ Wert muss kleiner als der \„Bis\“ Wert sein</string>
<string name="component_action_reset">Zurücksetzen</string>
<string name="component_action_apply">Anwenden</string>
<string name="component_action_cancel">Abbrechen</string>
<string name="component_number_range_empty">Erforderlicher Wert</string>
Expand Down
1 change: 0 additions & 1 deletion component/src/main/res/values-es/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
<string name="hint_range_from_date">Desde la fecha</string>
<string name="hint_range_to_date">Hasta la fecha</string>
<string name="component_number_range_invalid_input">El valor \'De\' debe ser menor que el valor \'A\'</string>
<string name="component_action_reset">Reiniciar</string>
<string name="component_action_apply">Aplicar</string>
<string name="component_action_cancel">Cancelar</string>
<string name="component_number_range_empty">Valor requerido</string>
Expand Down
1 change: 0 additions & 1 deletion component/src/main/res/values-fr/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
<string name="hint_range_from_date">Date de début</string>
<string name="hint_range_to_date">Date de fin</string>
<string name="component_number_range_invalid_input">La valeur \'De\' doit être inférieure à la valeur \'A\'</string>
<string name="component_action_reset">Réinitialiser</string>
<string name="component_action_apply">Appliquer</string>
<string name="component_action_cancel">Annuler</string>
<string name="component_number_range_empty">Valeur requise</string>
Expand Down
1 change: 0 additions & 1 deletion component/src/main/res/values-it/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
<string name="hint_range_from_date">Data di inizio</string>
<string name="hint_range_to_date">Data di fine</string>
<string name="component_number_range_invalid_input">Il valore \'Da\' deve essere inferiore al valore \'A\'</string>
<string name="component_action_reset">Reimposta</string>
<string name="component_action_apply">Applica</string>
<string name="component_action_cancel">Annulla</string>
<string name="component_number_range_empty">Valore obbligatorio</string>
Expand Down
1 change: 0 additions & 1 deletion component/src/main/res/values-night/colors.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>

<color name="color_blue_30">#3D2A7DE1</color>
<color name="alfresco_gray_radio_text_color">@color/white</color>
<color name="alfresco_gray_radio_text_color_60">@color/white_60</color>
</resources>
1 change: 0 additions & 1 deletion component/src/main/res/values-nl/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
<string name="hint_range_from_date">Begindatum</string>
<string name="hint_range_to_date">Einddatum</string>
<string name="component_number_range_invalid_input">Van-waarde moet kleiner zijn dan Tot-waarde</string>
<string name="component_action_reset">Opnieuw instellen</string>
<string name="component_action_apply">Toepassen</string>
<string name="component_action_cancel">Annuleren</string>
<string name="component_number_range_empty">Vereiste waarde</string>
Expand Down
1 change: 0 additions & 1 deletion component/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="color_blue_30">#3D2A7DE1</color>
<color name="color_search_filter">#212121</color>
<color name="color_view_line">#1F212121</color>
<color name="color_component_secondary">#0D212328</color>
Expand Down
1 change: 0 additions & 1 deletion component/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
<string name="hint_range_from_date">From Date</string>
<string name="hint_range_to_date">To Date</string>
<string name="component_number_range_invalid_input">From value should be less than To value</string>
<string name="component_action_reset">Reset</string>
<string name="component_action_apply">Apply</string>
<string name="component_action_cancel">Cancel</string>
<string name="component_number_range_empty">Required value</string>
Expand Down
Loading

0 comments on commit 1109093

Please sign in to comment.