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 Jul 9, 2024
2 parents a495275 + c6c96ca commit 3b57d50
Show file tree
Hide file tree
Showing 8 changed files with 158 additions and 120 deletions.
28 changes: 0 additions & 28 deletions .reuse/dep5

This file was deleted.

42 changes: 42 additions & 0 deletions REUSE.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: AGPL-3.0-or-later
version = 1
SPDX-PackageName = "Nextcloud Android"
SPDX-PackageSupplier = "Nextcloud Android team <[email protected]>"
SPDX-PackageDownloadLocation = "https://github.com/nextcloud/android"

[[annotations]]
path = "gradle/wrapper/gradle-wrapper.jar"
precedence = "aggregate"
SPDX-FileCopyrightText = "2015-2021 the original authors"
SPDX-License-Identifier = "Apache-2.0"

[[annotations]]
path = ["user_manual/images/android-1.png", "user_manual/images/android-2.png", "user_manual/images/android-3.png", "user_manual/images/android-4.png", "user_manual/images/android-10.png", "user_manual/images/davdroid-1-button-in-nextcloud-app.png", "user_manual/images/davdroid-2-install-davdroid.png", "user_manual/images/davdroid-3-enter-password.png", "user_manual/images/davdroid-4-specify-owner-email.png"]
precedence = "aggregate"
SPDX-FileCopyrightText = "2016-2024 Nextcloud GmbH and Nextcloud contributors"
SPDX-License-Identifier = "AGPL-3.0-or-later"

[[annotations]]
path = ["user_manual/conf.py", "user_manual/android_app.rst", "user_manual/index.rst", "user_manual/conf.py", "user_manual/Makefile"]
precedence = "aggregate"
SPDX-FileCopyrightText = "2015-2016 ownCloud Inc., 2016-2024 Nextcloud GmbH"
SPDX-License-Identifier = "GPL-2.0-only"

[[annotations]]
path = ["user_manual/images/android-11.png", "user_manual/images/android-12.png", "user_manual/images/android-13.png", "user_manual/images/android-14.png", "user_manual/images/android-15.png", "user_manual/images/android-5.png", "user_manual/images/android-6.png", "user_manual/images/android-8.png", "user_manual/images/android-9.png"]
precedence = "aggregate"
SPDX-FileCopyrightText = "2015-2016 ownCloud Inc."
SPDX-License-Identifier = "GPL-2.0-only"

[[annotations]]
path = ["app/src/**/res/mipmap-**dpi/ic_launcher.png", "app/src/**/ic_launcher-web.png", "src/generic/fastlane/metadata/android/en-US/images/icon.png", "src/versionDev/fastlane/metadata/android/en-US/images/icon.png", "app/src/main/ic_launcher-web-round.png"]
precedence = "aggregate"
SPDX-FileCopyrightText = "2017-2024 Nextcloud GmbH <https://nextcloud.com/trademarks/>"
SPDX-License-Identifier = "LicenseRef-NextcloudTrademarks"

[[annotations]]
path = [".idea/**", "app/schemas/com.nextcloud.client.database.NextcloudDatabase/**.json", "app/screenshots/gplay/debug/**.png", "app/src/main/res/values-**/strings.xml", "src/**/fastlane/metadata/android/**/**.txt", "src/versionDev/fastlane/metadata/android/**/changelogs/**.txt", "app/src/androidTest/assets/**", "app/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker", "app/src/**/google-services.json", "app/src/main/res/drawable-**dpi/checker_16_16.png", "app/src/main/res/raw/encryption_key_words.txt", "app/src/main/resources/ical4j.properties", "app/src/main/res/drawable-**dpi/apk.png", "app/src/main/res/drawable-**dpi/fdroid.png", "app/src/main/res/drawable-**dpi/playstore.png", "app/src/main/res/drawable-**dpi/background.png", "app/src/main/res/drawable-**dpi/background_nc18.png"]
precedence = "aggregate"
SPDX-FileCopyrightText = "2016-2024 Nextcloud GmbH and Nextcloud contributors"
SPDX-License-Identifier = "AGPL-3.0-or-later"
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/*
* Nextcloud - Android Client
*
* SPDX-FileCopyrightText: 2024 Alper Ozturk <[email protected]>
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
package com.owncloud.android.utils

import android.content.Intent
import androidx.test.core.app.ActivityScenario
import androidx.test.core.app.ApplicationProvider
import androidx.test.ext.junit.rules.ActivityScenarioRule
import com.nextcloud.client.account.UserAccountManager
import com.nextcloud.client.account.UserAccountManagerImpl
import com.nextcloud.client.mixins.SessionMixin
import com.owncloud.android.AbstractIT
import com.owncloud.android.ui.activity.FileDisplayActivity
import org.junit.Before
import org.junit.Rule
import org.junit.Test

class SessionMixinTest : AbstractIT() {

private lateinit var userAccountManager: UserAccountManager
private lateinit var session: SessionMixin

private var scenario: ActivityScenario<FileDisplayActivity>? = null
val intent = Intent(ApplicationProvider.getApplicationContext(), FileDisplayActivity::class.java)

@get:Rule
val activityRule = ActivityScenarioRule<FileDisplayActivity>(intent)

@Before
fun setUp() {
userAccountManager = UserAccountManagerImpl.fromContext(targetContext)

scenario = activityRule.scenario
scenario?.onActivity { sut ->
session = SessionMixin(
sut,
userAccountManager
)
}
}

@Test
fun startAccountCreation() {
session.startAccountCreation()

scenario = activityRule.scenario
scenario?.onActivity { sut ->
assert(sut.account.name == userAccountManager.accounts.first().name)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class SessionMixin(
private val activity: Activity,
private val accountManager: UserAccountManager
) : ActivityMixin {
lateinit var currentAccount: Account
var currentAccount: Account = getDefaultAccount()
private set

val capabilities: OCCapability?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import com.owncloud.android.datamodel.OCFile;
import com.owncloud.android.datamodel.SyncedFolderProvider;
import com.owncloud.android.datamodel.ThumbnailsCacheManager;
import com.owncloud.android.ui.asynctasks.TextEditorLoadUrlTask;
import com.owncloud.android.utils.DisplayUtils;
import com.owncloud.android.utils.MimeTypeUtil;
import com.owncloud.android.utils.WebViewUtil;
Expand Down Expand Up @@ -99,6 +100,23 @@ public void closeView() {
finish();
}

public void reload() {
if (getWebView().getVisibility() != View.VISIBLE) {
return;
}

Optional<User> user = getUser();
if (!user.isPresent()) {
return;
}

OCFile file = getFile();
if (file != null) {
TextEditorLoadUrlTask task = new TextEditorLoadUrlTask(this, user.get(), file, editorUtils);
task.execute();
}
}

@Override
protected void bindView() {
binding = RichdocumentsWebviewBinding.inflate(getLayoutInflater());
Expand Down Expand Up @@ -281,6 +299,11 @@ public void share() {
public void loaded() {
runOnUiThread(EditorWebView.this::hideLoading);
}

@JavascriptInterface
public void reload() {
EditorWebView.this.reload();
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@

import androidx.annotation.DrawableRes;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.StringRes;
import androidx.appcompat.widget.SearchView;
import androidx.core.content.ContextCompat;
Expand Down Expand Up @@ -99,8 +100,6 @@ public class ExtendedListFragment extends Fragment implements
public static final float minColumnSize = 2.0f;

private int maxColumnSize = 5;
private int maxColumnSizePortrait = 5;
private int maxColumnSizeLandscape = 10;

@Inject AppPreferences preferences;
@Inject UserAccountManager accountManager;
Expand All @@ -116,18 +115,18 @@ public class ExtendedListFragment extends Fragment implements
protected ImageView mEmptyListIcon;

// Save the state of the scroll in browsing
private ArrayList<Integer> mIndexes;
private ArrayList<Integer> mFirstPositions;
private ArrayList<Integer> mTops;
private int mHeightCell;
private ArrayList<Integer> mIndexes = new ArrayList<>();
private ArrayList<Integer> mFirstPositions = new ArrayList<>();
private ArrayList<Integer> mTops = new ArrayList<>();
private int mHeightCell = 0;

private SwipeRefreshLayout.OnRefreshListener mOnRefreshListener;

private EmptyRecyclerView mRecyclerView;

protected SearchView searchView;
private ImageView closeButton;
private Handler handler = new Handler(Looper.getMainLooper());
private final Handler handler = new Handler(Looper.getMainLooper());

private float mScale = AppPreferencesImpl.DEFAULT_GRID_COLUMN;

Expand Down Expand Up @@ -178,7 +177,7 @@ public void onCreateOptionsMenu(Menu menu, @NonNull MenuInflater inflater) {
searchView.setOnQueryTextListener(this);
searchView.setOnCloseListener(this);

final Handler handler = new Handler();
final Handler handler = new Handler(Looper.getMainLooper());

DisplayMetrics displaymetrics = new DisplayMetrics();
Activity activity;
Expand Down Expand Up @@ -399,35 +398,27 @@ protected void setupEmptyList(View view) {
mEmptyListIcon = binding.emptyList.emptyListIcon;
}

/**
* {@inheritDoc}
*/
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);

if (savedInstanceState != null) {
mIndexes = savedInstanceState.getIntegerArrayList(KEY_INDEXES);
mFirstPositions = savedInstanceState.getIntegerArrayList(KEY_FIRST_POSITIONS);
mTops = savedInstanceState.getIntegerArrayList(KEY_TOPS);
mHeightCell = savedInstanceState.getInt(KEY_HEIGHT_CELL);
setMessageForEmptyList(savedInstanceState.getString(KEY_EMPTY_LIST_MESSAGE));

if (savedInstanceState.getBoolean(KEY_IS_GRID_VISIBLE, false) && getRecyclerView().getAdapter() != null) {
switchToGridView();
}
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
if (savedInstanceState == null) {
return;
}

int referencePosition = savedInstanceState.getInt(KEY_SAVED_LIST_POSITION);
Log_OC.v(TAG, "Setting grid position " + referencePosition);
scrollToPosition(referencePosition);
} else {
mIndexes = new ArrayList<>();
mFirstPositions = new ArrayList<>();
mTops = new ArrayList<>();
mHeightCell = 0;
mIndexes = savedInstanceState.getIntegerArrayList(KEY_INDEXES);
mFirstPositions = savedInstanceState.getIntegerArrayList(KEY_FIRST_POSITIONS);
mTops = savedInstanceState.getIntegerArrayList(KEY_TOPS);
mHeightCell = savedInstanceState.getInt(KEY_HEIGHT_CELL);
setMessageForEmptyList(savedInstanceState.getString(KEY_EMPTY_LIST_MESSAGE));

if (savedInstanceState.getBoolean(KEY_IS_GRID_VISIBLE, false) && getRecyclerView().getAdapter() != null) {
switchToGridView();
}
}

int referencePosition = savedInstanceState.getInt(KEY_SAVED_LIST_POSITION);
Log_OC.v(TAG, "Setting grid position " + referencePosition);
scrollToPosition(referencePosition);
}

@Override
public void onSaveInstanceState(@NonNull Bundle savedInstanceState) {
Expand Down Expand Up @@ -485,8 +476,9 @@ private void scrollToPosition(int position) {
* Save index and top position
*/
protected void saveIndexAndTopPosition(int index) {

mIndexes.add(index);
if (mIndexes != null) {
mIndexes.add(index);
}

RecyclerView.LayoutManager layoutManager = mRecyclerView.getLayoutManager();
int firstPosition;
Expand Down Expand Up @@ -519,8 +511,7 @@ public void onRefresh() {
searchView.onActionViewCollapsed();

Activity activity;
if ((activity = getActivity()) != null && activity instanceof FileDisplayActivity) {
FileDisplayActivity fileDisplayActivity = (FileDisplayActivity) activity;
if ((activity = getActivity()) != null && activity instanceof FileDisplayActivity fileDisplayActivity) {
fileDisplayActivity.setDrawerIndicatorEnabled(fileDisplayActivity.isDrawerIndicatorAvailable());
fileDisplayActivity.hideSearchView(fileDisplayActivity.getCurrentDir());
}
Expand Down Expand Up @@ -683,9 +674,9 @@ public void onConfigurationChanged(@NonNull Configuration newConfig) {
super.onConfigurationChanged(newConfig);

if (newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE) {
maxColumnSize = maxColumnSizeLandscape;
maxColumnSize = 10;
} else if (newConfig.orientation == Configuration.ORIENTATION_PORTRAIT) {
maxColumnSize = maxColumnSizePortrait;
maxColumnSize = 5;
}

if (isGridEnabled() && getColumnsCount() > maxColumnSize) {
Expand Down
7 changes: 7 additions & 0 deletions app/src/main/res/values-es-rMX/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
<string name="auth_unsupported_multiaccount">%1$s no soporta cuentas múltiples</string>
<string name="auth_wrong_connection_title">No fue posible establecer la conexión</string>
<string name="authenticator_activity_cancel_login">Cancelar inicio de sesión</string>
<string name="authenticator_activity_login_error">Hubo un problema al procesar su solicitud de acceso. Por favor, intente más tarde.</string>
<string name="authenticator_activity_please_complete_login_process">Por favor, complete el proceso de inicio de sesión en su navegador</string>
<string name="auto_upload_file_behaviour_kept_in_folder">mantenido en la carpeta original, ya que es de solo lectura</string>
<string name="auto_upload_on_wifi">Solo cargar sobre una Wi-Fi no tarificada</string>
Expand Down Expand Up @@ -321,6 +322,7 @@
<string name="error_showing_encryption_dialog">¡Error al mostrar el diálogo de configuración de cifrado!</string>
<string name="error_starting_direct_camera_upload">Error al iniciar la cámara</string>
<string name="error_starting_doc_scan">Error al iniciar el escaneo del documento</string>
<string name="error_uploading_direct_camera_upload">No se pudo cargar el medio tomado</string>
<string name="etm_accounts">Cuentas</string>
<string name="etm_background_execution_count">Veces ejecutado en 48h</string>
<string name="etm_background_job_created">Creado</string>
Expand Down Expand Up @@ -352,6 +354,7 @@
<string name="failed_update_ui">Error al actualizar la interfaz gráfica</string>
<string name="favorite">Agregar a favoritos</string>
<string name="favorite_icon">Marcar como favorito</string>
<string name="file_activity_shared_file_cannot_be_updated">No se puede actualizar el archivo compartido</string>
<string name="file_already_exists">El nombre de archivo ya existe</string>
<string name="file_delete">Eliminar</string>
<string name="file_detail_activity_error">No se pudo recuperar las actividades del archivo</string>
Expand Down Expand Up @@ -672,6 +675,7 @@
<string name="push_notifications_old_login">No hay notificaciones push debido a un inicio de sesión caduco. Por favor vuelve a ingresar a tu cuenta. </string>
<string name="push_notifications_temp_error">En este momento las notificaciones push no están disponibles.</string>
<string name="qr_could_not_be_read">¡No se pudo leer el código QR!</string>
<string name="receive_external_files_activity_start_sync_folder_is_not_exists_message">No se pudo encontrar la carpeta, la sincronización se ha cancelado</string>
<string name="recommend_subject">¡Prueba %1$s en tu dispositivo!</string>
<string name="recommend_text">Quiero invitarte a usar %1$s en tu dispositivo\nDescárgalo aquí:%2$s </string>
<string name="recommend_urls">%1$s ó %2$s</string>
Expand Down Expand Up @@ -902,7 +906,10 @@
<string name="upload_cannot_create_file">No se puede crear el archivo local</string>
<string name="upload_chooser_title">Cargar forma…</string>
<string name="upload_content_from_other_apps">Cargar contenido de otras aplicaciones</string>
<string name="upload_direct_camera_photo">Foto</string>
<string name="upload_direct_camera_promt">¿Quiere tomar una foto o video?</string>
<string name="upload_direct_camera_upload">Cargar desde la cámara</string>
<string name="upload_direct_camera_video">Video</string>
<string name="upload_file_dialog_filename">Nombre de archivo</string>
<string name="upload_file_dialog_filetype">Tipo de archivo</string>
<string name="upload_file_dialog_filetype_googlemap_shortcut">Archivo de acceso directo a Google Maps(%s)</string>
Expand Down
Loading

0 comments on commit 3b57d50

Please sign in to comment.