Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiasKaminsky committed Nov 8, 2024
2 parents 98536b4 + aa77375 commit bf6955b
Show file tree
Hide file tree
Showing 51 changed files with 3,485 additions and 157 deletions.
8 changes: 4 additions & 4 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -288,11 +288,11 @@ dependencies {
implementation 'androidx.webkit:webkit:1.12.1'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.exifinterface:exifinterface:1.3.7'
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.8.6"
implementation "androidx.lifecycle:lifecycle-service:2.8.6"
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.8.7"
implementation "androidx.lifecycle:lifecycle-service:2.8.7"
implementation "androidx.work:work-runtime:$workRuntime"
implementation "androidx.work:work-runtime-ktx:$workRuntime"
implementation "androidx.fragment:fragment-ktx:1.8.4"
implementation "androidx.fragment:fragment-ktx:1.8.5"
implementation 'com.github.albfernandez:juniversalchardet:2.0.3' // need this version for Android <7
compileOnly 'com.google.code.findbugs:annotations:3.0.1u2'
implementation 'commons-io:commons-io:2.17.0'
Expand All @@ -312,7 +312,7 @@ dependencies {
implementation 'com.caverock:androidsvg:1.4'
implementation 'androidx.annotation:annotation:1.9.1'
implementation 'com.vanniktech:emoji-google:0.21.0'
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.8.6")
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.8.7")

// document scanner not available on FDroid (generic) due to OpenCV binaries
gplayImplementation project(':appscan')
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 14 additions & 2 deletions app/src/main/java/com/nextcloud/ui/ChooseAccountDialogFragment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import android.view.View
import android.view.ViewGroup
import android.widget.ImageView
import androidx.fragment.app.DialogFragment
import androidx.lifecycle.lifecycleScope
import com.google.android.material.dialog.MaterialAlertDialogBuilder
import com.nextcloud.client.account.User
import com.nextcloud.client.account.UserAccountManager
Expand All @@ -33,10 +34,10 @@ import com.owncloud.android.ui.activity.BaseActivity
import com.owncloud.android.ui.activity.DrawerActivity
import com.owncloud.android.ui.adapter.UserListAdapter
import com.owncloud.android.ui.adapter.UserListItem
import com.owncloud.android.ui.asynctasks.RetrieveStatusAsyncTask
import com.owncloud.android.utils.DisplayUtils
import com.owncloud.android.utils.DisplayUtils.AvatarGenerationListener
import com.owncloud.android.utils.theme.ViewThemeUtils
import kotlinx.coroutines.launch
import javax.inject.Inject

private const val ARG_CURRENT_USER_PARAM = "currentUser"
Expand Down Expand Up @@ -151,12 +152,23 @@ class ChooseAccountDialogFragment :
binding.statusView.visibility = View.VISIBLE
}

RetrieveStatusAsyncTask(user, this, clientFactory).execute()
loadAndSetUserStatus(user)
}

themeViews()
}

private fun loadAndSetUserStatus(user: User) {
viewLifecycleOwner.lifecycleScope.launch {
val status = retrieveUserStatus(user, clientFactory)

if (isAdded && !isDetached) {
val context = requireContext()
setStatus(status, context)
}
}
}

private fun themeViews() {
viewThemeUtils.platform.themeDialogDivider(binding.separatorLine)
viewThemeUtils.platform.themeDialog(binding.root)
Expand Down
37 changes: 37 additions & 0 deletions app/src/main/java/com/nextcloud/ui/RetrieveStatus.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
* Nextcloud - Android Client
*
* SPDX-FileCopyrightText: 2024 Edvard Holst <[email protected]>
* SPDX-License-Identifier: AGPL-3.0-or-later
*/

package com.nextcloud.ui

import com.nextcloud.client.account.User
import com.nextcloud.client.network.ClientFactory
import com.owncloud.android.lib.resources.users.GetStatusRemoteOperation
import com.owncloud.android.lib.resources.users.Status
import com.owncloud.android.lib.resources.users.StatusType
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
import java.io.IOException

suspend fun retrieveUserStatus(user: User, clientFactory: ClientFactory): Status {
return withContext(Dispatchers.IO) {
try {
val client = clientFactory.createNextcloudClient(user)
val result = GetStatusRemoteOperation().execute(client)
if (result.isSuccess && result.resultData is Status) {
result.resultData as Status
} else {
offlineStatus()
}
} catch (e: ClientFactory.CreationException) {
offlineStatus()
} catch (e: IOException) {
offlineStatus()
}
}
}

private fun offlineStatus() = Status(StatusType.OFFLINE, "", "", -1)

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ private void setupView() {
binding.searchView.setQueryHint(getResources().getString(R.string.share_search));
}
} else {
binding.searchView.setQueryHint(getResources().getString(R.string.reshare_not_allowed));
binding.searchView.setQueryHint(getResources().getString(R.string.resharing_is_not_allowed));
binding.searchView.setInputType(InputType.TYPE_NULL);
binding.pickContactEmailBtn.setVisibility(View.GONE);
disableSearchView(binding.searchView);
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-ar/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1093,7 +1093,7 @@
<string name="whats_new_skip">تخطى</string>
<string name="whats_new_title">جديد على %1$s</string>
<string name="whats_your_status">ماهي حالتك؟</string>
<string name="widgets_not_available">الأدوات مُتاحة فقط في %1$s الإصدار 25 و ما بعده </string>
<string name="widgets_not_available">الودجات widgets متاحة في %1$s الإصدار 25 فما أحدث فقط عندما تكون لوحة المعلومات مُفعّلة</string>
<string name="widgets_not_available_title">غير متوفر</string>
<string name="worker_download">جارٍ تنزيل الملفات…</string>
<string name="write_email">إرسال بريد</string>
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/values-b+en+001/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1066,7 +1066,6 @@
<string name="whats_new_skip">Skip</string>
<string name="whats_new_title">New in %1$s</string>
<string name="whats_your_status">What is your status?</string>
<string name="widgets_not_available">Widgets are only available on %1$s 25 or later</string>
<string name="widgets_not_available_title">Not available</string>
<string name="worker_download">Downloading files…</string>
<string name="write_email">Send email</string>
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/values-bg-rBG/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -904,7 +904,6 @@
<string name="whats_new_skip">Пропусни</string>
<string name="whats_new_title">Ново в %1$s</string>
<string name="whats_your_status">Какъв е вашият статус?</string>
<string name="widgets_not_available">Изпълнимите модули са налични само в %1$s, 25 или по-нова версия</string>
<string name="widgets_not_available_title">Не е наличен</string>
<string name="worker_download">Сваляне на файлове...</string>
<string name="write_email">Изпращане на имейл</string>
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/values-ca/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -898,7 +898,6 @@
<string name="whats_new_skip">Omet</string>
<string name="whats_new_title">Nou a %1$s</string>
<string name="whats_your_status">Quin és el vostre estat?</string>
<string name="widgets_not_available">Els ginys només estan disponibles a %1$s 25 o una versió posterior</string>
<string name="widgets_not_available_title">No disponible</string>
<string name="worker_download">S\'està descarregant fitxers…</string>
<string name="write_email">Enviar correu</string>
Expand Down
16 changes: 15 additions & 1 deletion app/src/main/res/values-cs-rCZ/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -696,7 +696,9 @@
<string name="prefs_synced_folders_local_path_title">Místní složka</string>
<string name="prefs_synced_folders_remote_path_title">Vzdálená složka</string>
<string name="prefs_theme_title">Motiv vzhledu</string>
<string name="prefs_two_way_sync_interval">Interval</string>
<string name="prefs_two_way_sync_summary">Spravovat interní složky pro dvoucestnou synchronizaci</string>
<string name="prefs_two_way_sync_switch_title">Zapnout obousměrnou synchronizaci</string>
<string name="prefs_value_theme_dark">Tmavý</string>
<string name="prefs_value_theme_light">Světlý</string>
<string name="prefs_value_theme_system">Převzít od systému</string>
Expand Down Expand Up @@ -1060,12 +1062,24 @@
<string name="whats_new_skip">Přeskočit</string>
<string name="whats_new_title">Co je v %1$s nového</string>
<string name="whats_your_status">Jaký je váš stav?</string>
<string name="widgets_not_available">Ovládací prvky jsou k dispozici pouze na %1$s 25 a novějším</string>
<string name="widgets_not_available">Ovládací prvky jsou k dispozici v %1$s 25 a novějším (pokud je zapnutá aplikace Nástěnka)</string>
<string name="widgets_not_available_title">Není k dispozici</string>
<string name="worker_download">Stahování souborů…</string>
<string name="write_email">Odeslat e-mail</string>
<string name="wrong_storage_path">Složka pro ukládání dat neexistuje!</string>
<string name="wrong_storage_path_desc">Toto může být způsobeno obnovením ze zálohy na jiném zařízení. Náhradně vráceno do výchozího stavu. Zkontrolujte nastavení a upravte popis umístění složky pro ukládání dat.</string>
<plurals name="hours">
<item quantity="one">%d hodina</item>
<item quantity="few">%d hodiny</item>
<item quantity="many">%d hodin</item>
<item quantity="other">%d hodiny</item>
</plurals>
<plurals name="minutes">
<item quantity="one">%d minuta</item>
<item quantity="few">%d minuty</item>
<item quantity="many">%d minut</item>
<item quantity="other">%d minuty</item>
</plurals>
<plurals name="sync_fail_in_favourites_content">
<item quantity="one">Nedaří se synchronizovat %1$d soubor (konflikty: %2$d)</item>
<item quantity="few">Nedaří se synchronizovat %1$d soubory (konflikty: %2$d)</item>
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/values-da/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -970,7 +970,6 @@ Enheds legitimationsoplysninger er sat op
<string name="whats_new_skip">Spring over</string>
<string name="whats_new_title">Nyt i %1$s</string>
<string name="whats_your_status">Hvad er din status</string>
<string name="widgets_not_available">Widgets er kun tilgængelige for %1$s 25 eller senere</string>
<string name="widgets_not_available_title">Ikke tilgængelig</string>
<string name="worker_download">Henter filer...</string>
<string name="write_email">Send email</string>
Expand Down
12 changes: 11 additions & 1 deletion app/src/main/res/values-de/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -696,7 +696,9 @@
<string name="prefs_synced_folders_local_path_title">Lokaler Ordner</string>
<string name="prefs_synced_folders_remote_path_title">Remote-Ordner</string>
<string name="prefs_theme_title">Design</string>
<string name="prefs_two_way_sync_interval">Intervall</string>
<string name="prefs_two_way_sync_summary">Interne Ordner für 2-Wege-Synchronisierung verwalten</string>
<string name="prefs_two_way_sync_switch_title">2-Wege-Synchronisierung aktivieren</string>
<string name="prefs_value_theme_dark">Dunkel</string>
<string name="prefs_value_theme_light">Hell</string>
<string name="prefs_value_theme_system">Systemvorgaben verwenden</string>
Expand Down Expand Up @@ -1064,12 +1066,20 @@
<string name="whats_new_skip">Überspringen</string>
<string name="whats_new_title">Neu in %1$s</string>
<string name="whats_your_status">Wie ist Ihr Status?</string>
<string name="widgets_not_available">Widgets sind nur auf %1$s 25 oder neuer verfügbar</string>
<string name="widgets_not_available">Widgets sind nur in %1$s 25 oder neuer verfügbar, wenn die Dashboard-App aktiviert ist</string>
<string name="widgets_not_available_title">Nicht verfügbar</string>
<string name="worker_download">Dateien werden heruntergeladen…</string>
<string name="write_email">E-Mail senden</string>
<string name="wrong_storage_path">Speicherordner existiert nicht!</string>
<string name="wrong_storage_path_desc">Ursache könnte die Wiederherstellung einer Sicherungskopie auf einem anderen Gerät sein. Der Standard-Ordner wird jetzt wieder verwendet. Bitte überprüfen Sie die Einstellungen bezüglich des Speicherortes.</string>
<plurals name="hours">
<item quantity="one">%d Stunde</item>
<item quantity="other">%d Stunden</item>
</plurals>
<plurals name="minutes">
<item quantity="one">%d Minute</item>
<item quantity="other">%d Minuten</item>
</plurals>
<plurals name="sync_fail_in_favourites_content">
<item quantity="one">Inhalte von %1$d Datei konnten nicht synchronisiert werden (Konflikte: %2$d)</item>
<item quantity="other">Inhalte von %1$d Dateien konnten nicht synchronisiert werden (Konflikte: %2$d)</item>
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/values-el/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -911,7 +911,6 @@
<string name="whats_new_skip">Παράλειψη</string>
<string name="whats_new_title">Τι νέο υπάρχει στο %1$s</string>
<string name="whats_your_status">Ποια είναι η κατάστασή σας;</string>
<string name="widgets_not_available">Τα γραφικά στοιχεία είναι διαθέσιμα μόνο στην %1$s 25 ή νεότερη</string>
<string name="widgets_not_available_title">Δεν είναι διαθέσιμο</string>
<string name="worker_download">Λήψη αρχείων…</string>
<string name="write_email">Αποστολή email</string>
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/values-es-rAR/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1023,7 +1023,6 @@
<string name="whats_new_skip">Saltar</string>
<string name="whats_new_title">Nuevo en %1$s</string>
<string name="whats_your_status">¿Cuál es su estado?</string>
<string name="widgets_not_available">Los widgets sólo están disponibles para %1$s 25 o superior</string>
<string name="widgets_not_available_title">No disponible</string>
<string name="worker_download">Descargando archivos…</string>
<string name="write_email">Enviar correo electrónico</string>
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/values-es-rEC/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -913,7 +913,6 @@
<string name="whats_new_skip">Omitir</string>
<string name="whats_new_title">Nuevo en %1$s</string>
<string name="whats_your_status">¿Cuál es tu estado?</string>
<string name="widgets_not_available">Los widgets solo están disponibles en %1$s 25 o posterior</string>
<string name="widgets_not_available_title">No disponible</string>
<string name="worker_download">Descargando archivos…</string>
<string name="write_email">Enviar correo electrónico</string>
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/values-es-rMX/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1024,7 +1024,6 @@
<string name="whats_new_skip">Omitir</string>
<string name="whats_new_title">Nuevo en %1$s</string>
<string name="whats_your_status">¿Cuál es su estado?</string>
<string name="widgets_not_available">Los widgets sólo están disponibles para %1$s 25 o superior</string>
<string name="widgets_not_available_title">No disponible</string>
<string name="worker_download">Descargando archivos…</string>
<string name="write_email">Enviar correo electrónico</string>
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/values-es/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1028,7 +1028,6 @@
<string name="whats_new_skip">Omitir</string>
<string name="whats_new_title">Nuevo en %1$s</string>
<string name="whats_your_status">¿Cuál es su estado?</string>
<string name="widgets_not_available">Los widgets solo están disponibles para %1$s 25 o superior</string>
<string name="widgets_not_available_title">No disponible</string>
<string name="worker_download">Bajando archivos…</string>
<string name="write_email">Enviar email</string>
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/values-eu/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1060,7 +1060,6 @@
<string name="whats_new_skip">Salto egin</string>
<string name="whats_new_title">Berria %1$s-n</string>
<string name="whats_your_status">Zein da zure egoera?</string>
<string name="widgets_not_available">Widgetak %1$s 25 edo geroago bakarrik daude eskuragarri</string>
<string name="widgets_not_available_title">Ez dago erabilgarri</string>
<string name="worker_download">Fitxategiak deskargatzen…</string>
<string name="write_email">Bidali mezu elektronikoa</string>
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/values-fa/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -981,7 +981,6 @@
<string name="whats_new_skip">رد شدن</string>
<string name="whats_new_title">جدید در %1$s</string>
<string name="whats_your_status">وضعیت شما چیست؟</string>
<string name="widgets_not_available">ویجت ها فقط در%1$s 25 یا بالاتر در دسترس هستند</string>
<string name="widgets_not_available_title">در دسترس نیست</string>
<string name="worker_download">در حال دریافت فایل ها...</string>
<string name="write_email">ارسال ایمیل</string>
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/values-fr/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1064,7 +1064,6 @@
<string name="whats_new_skip">Ignorer</string>
<string name="whats_new_title">Nouveautés dans %1$s</string>
<string name="whats_your_status">Quel est votre statut ?</string>
<string name="widgets_not_available">Les widgets ne sont disponibles que sur %1$s 25 ou plus tard</string>
<string name="widgets_not_available_title">Non disponible</string>
<string name="worker_download">Téléchargement des fichiers…</string>
<string name="write_email">Envoyer un e-mail</string>
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/values-ga/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1066,7 +1066,6 @@
<string name="whats_new_skip">Scipeáil</string>
<string name="whats_new_title">Nua i %1$s</string>
<string name="whats_your_status">Cad é do stádas?</string>
<string name="widgets_not_available">Níl giuirléidí ar fáil ach ar %1$s 25 nó níos déanaí</string>
<string name="widgets_not_available_title">Níl sé ar fáil</string>
<string name="worker_download">Comhaid á n-íoslódáil…</string>
<string name="write_email">Seol ríomhphost</string>
Expand Down
Loading

0 comments on commit bf6955b

Please sign in to comment.