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
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ enum class QuickPermissionType(val iconId: Int, val textId: Int) {
VIEW_ONLY(R.drawable.ic_eye, R.string.share_permission_view_only),
CAN_EDIT(R.drawable.ic_edit, R.string.share_permission_can_edit),
FILE_REQUEST(R.drawable.ic_file_request, R.string.share_permission_file_request),
SECURE_FILE_DROP(R.drawable.ic_file_request, R.string.share_permission_secure_file_drop),
SECURE_FILE_DROP(R.drawable.ic_file_request, R.string.create_end_to_end_encrypted_share),
CUSTOM_PERMISSIONS(R.drawable.ic_custom_permissions, R.string.share_custom_permission);

fun getText(context: Context): String = context.getString(textId)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,24 @@ package com.owncloud.android.ui.adapter
import android.view.View
import androidx.recyclerview.widget.RecyclerView
import com.owncloud.android.databinding.FileDetailsShareSecureFileDropAddNewItemBinding
import com.owncloud.android.utils.theme.ViewThemeUtils

internal class NewSecureFileDropViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
class NewSecureFileDropViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
private var binding: FileDetailsShareSecureFileDropAddNewItemBinding? = null
private var viewThemeUtils: ViewThemeUtils? = null

constructor(binding: FileDetailsShareSecureFileDropAddNewItemBinding) : this(binding.root) {
constructor(
binding: FileDetailsShareSecureFileDropAddNewItemBinding,
viewThemeUtils: ViewThemeUtils
) : this(binding.root) {
this.binding = binding
this.viewThemeUtils = viewThemeUtils
}

fun bind(listener: ShareeListAdapterListener) {
binding!!.addNewSecureFileDrop.setOnClickListener { v: View? -> listener.createSecureFileDrop() }
binding?.addPublicShare?.let {
it.setOnClickListener { listener.createSecureFileDrop() }
viewThemeUtils?.material?.colorMaterialButtonPrimaryTonal(it)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class ShareeListAdapter(
shareType == ShareType.NEW_PUBLIC_LINK -> {
if (encrypted) {
val binding = FileDetailsShareSecureFileDropAddNewItemBinding.inflate(inflater, parent, false)
NewSecureFileDropViewHolder(binding)
NewSecureFileDropViewHolder(binding, viewThemeUtils)
} else {
val binding = FileDetailsSharePublicLinkAddNewItemBinding.inflate(inflater, parent, false)
NewLinkShareViewHolder(binding)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,10 @@ private void setupView() {

if (file.canReshare() && !FileDetailSharingFragmentHelper.isPublicShareDisabled(capabilities)) {
if (file.isEncrypted() || (parentFile != null && parentFile.isEncrypted())) {
binding.internalShareHeadline.setText(getResources().getString(R.string.internal_share_headline_end_to_end_encrypted));
binding.internalShareDescription.setVisibility(View.VISIBLE);
binding.externalSharesHeadline.setText(getResources().getString(R.string.create_end_to_end_encrypted_share_title));

if (file.getE2eCounter() == -1) {
// V1 cannot share
binding.searchContainer.setVisibility(View.GONE);
Expand Down Expand Up @@ -613,9 +617,17 @@ public void refreshSharesFromDB() {
}

private void addExternalAndPublicShares(List<OCShare> externalShares) {
final var publicShares = fileDataStorageManager.getSharesByPathAndType(file.getRemotePath(), ShareType.PUBLIC_LINK, "");
final var publicShares = fileDataStorageManager.getSharesByPathAndType(
file.getRemotePath(), ShareType.PUBLIC_LINK, "");
externalShareeListAdapter.removeAll();
final var shares = OCShareExtensionsKt.mergeDistinctByToken(externalShares, publicShares);

if (file.isEncrypted()) {
OCShare placeholder = new OCShare();
placeholder.setShareType(ShareType.NEW_PUBLIC_LINK);
shares.add(placeholder);
}

externalShareeListAdapter.addShares(shares);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,43 +2,18 @@
<!--
~ Nextcloud - Android Client
~
~ SPDX-FileCopyrightText: 2020 Andy Scherzinger <info@andy-scherzinger.de>
~ SPDX-FileCopyrightText: 2020 Tobias Kaminsky <tobias@kaminsky.me>
~ SPDX-FileCopyrightText: 2020 Nextcloud GmbH
~ SPDX-License-Identifier: AGPL-3.0-or-later OR GPL-2.0-only
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/add_public_share"
android:layout_width="match_parent"
android:layout_height="@dimen/sharee_list_item_size"
android:orientation="horizontal">

<ImageView
android:layout_width="@dimen/share_icon_size"
android:layout_height="@dimen/share_icon_size"
android:layout_gravity="center_vertical"
android:layout_marginStart="@dimen/standard_margin"
android:layout_marginEnd="@dimen/standard_margin"
android:background="@drawable/round_bgnd"
android:contentDescription="@string/share"
android:padding="@dimen/standard_half_padding"
android:src="@drawable/shared_via_link" />

<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:text="@string/share_permission_secure_file_drop"
android:textSize="@dimen/two_line_primary_text_size" />

<ImageView
android:id="@+id/add_new_secure_file_drop"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="center_vertical"
android:contentDescription="@string/add_new_secure_file_drop"
android:paddingStart="@dimen/standard_padding"
android:paddingEnd="@dimen/standard_padding"
android:src="@drawable/ic_plus" />
</LinearLayout>
~ SPDX-FileCopyrightText: 2026 Alper Ozturk <alper.ozturk@nextcloud.com>
~ SPDX-License-Identifier: AGPL-3.0-or-later
-->
<com.google.android.material.button.MaterialButton android:id="@+id/add_public_share"
style="@style/Widget.Material3.Button.IconButton.Filled.Tonal"
android:layout_width="wrap_content"
android:layout_marginStart="@dimen/standard_half_margin"
android:layout_marginTop="@dimen/standard_half_margin"
android:layout_height="@dimen/minimum_size_for_touchable_area"
android:text="@string/create_end_to_end_encrypted_share"
app:icon="@drawable/ic_plus"
android:textColor="@color/text_color"
app:iconPadding="@dimen/standard_half_padding"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:android="http://schemas.android.com/apk/res/android" />
15 changes: 15 additions & 0 deletions app/src/main/res/layout/file_details_sharing_fragment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@
android:text="@string/send_copy_to" />

<TextView
android:id="@+id/internal_share_headline"
android:paddingStart="@dimen/standard_padding"
android:paddingEnd="@dimen/zero"
android:paddingTop="@dimen/standard_half_padding"
Expand All @@ -153,6 +154,20 @@
android:text="@string/internal_shares"
android:textAppearance="?android:attr/textAppearanceMedium" />

<TextView
android:id="@+id/internal_share_description"
android:paddingStart="@dimen/standard_padding"
android:visibility="gone"
tools:visibility="visible"
android:paddingEnd="@dimen/zero"
android:paddingTop="@dimen/standard_half_padding"
android:paddingBottom="@dimen/standard_half_padding"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/internal_share_description_end_to_end_encrypted"
android:textAppearance="?android:attr/textAppearanceMedium" />


<androidx.recyclerview.widget.RecyclerView
android:id="@+id/sharesList_internal"
android:layout_width="match_parent"
Expand Down
6 changes: 4 additions & 2 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1196,8 +1196,10 @@
<string name="share_permission_file_request">File request</string>
<string name="share_permission_view_only">View only</string>
<string name="share_permission_can_edit">Can edit</string>
<string name="share_permission_secure_file_drop">Secure file drop</string>

<string name="create_end_to_end_encrypted_share_title">End-to-end encrypted link shares</string>
<string name="create_end_to_end_encrypted_share">Link share</string>
<string name="internal_share_headline_end_to_end_encrypted">End-to-end encrypted shares</string>
<string name="internal_share_description_end_to_end_encrypted">Share recipients always have access to the full encrypted folder. It is only possible to share with accounts that have already setup end-to-end encryption.</string>
<string name="sync_not_enough_space_dialog_action_choose">Choose what to sync</string>
<string name="sync_not_enough_space_dialog_action_free_space">Free up space</string>
<string name="sync_not_enough_space_dialog_placeholder">%1$s is %2$s, but there is only %3$s available on device.</string>
Expand Down
Loading