Skip to content

Commit 5186686

Browse files
committed
align wording style with web
Signed-off-by: alperozturk96 <alper_ozturk@proton.me>
1 parent 1c60a82 commit 5186686

File tree

7 files changed

+53
-52
lines changed

7 files changed

+53
-52
lines changed

app/src/main/java/com/owncloud/android/datamodel/quickPermission/QuickPermissionType.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ enum class QuickPermissionType(val iconId: Int, val textId: Int) {
1818
VIEW_ONLY(R.drawable.ic_eye, R.string.share_permission_view_only),
1919
CAN_EDIT(R.drawable.ic_edit, R.string.share_permission_can_edit),
2020
FILE_REQUEST(R.drawable.ic_file_request, R.string.share_permission_file_request),
21-
SECURE_FILE_DROP(R.drawable.ic_file_request, R.string.share_permission_secure_file_drop),
21+
SECURE_FILE_DROP(R.drawable.ic_file_request, R.string.create_end_to_end_encrypted_share),
2222
CUSTOM_PERMISSIONS(R.drawable.ic_custom_permissions, R.string.share_custom_permission);
2323

2424
fun getText(context: Context): String = context.getString(textId)

app/src/main/java/com/owncloud/android/ui/adapter/NewSecureFileDropViewHolder.kt

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,24 @@ package com.owncloud.android.ui.adapter
1010
import android.view.View
1111
import androidx.recyclerview.widget.RecyclerView
1212
import com.owncloud.android.databinding.FileDetailsShareSecureFileDropAddNewItemBinding
13+
import com.owncloud.android.utils.theme.ViewThemeUtils
1314

14-
internal class NewSecureFileDropViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
15+
class NewSecureFileDropViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
1516
private var binding: FileDetailsShareSecureFileDropAddNewItemBinding? = null
17+
private var viewThemeUtils: ViewThemeUtils? = null
1618

17-
constructor(binding: FileDetailsShareSecureFileDropAddNewItemBinding) : this(binding.root) {
19+
constructor(
20+
binding: FileDetailsShareSecureFileDropAddNewItemBinding,
21+
viewThemeUtils: ViewThemeUtils
22+
) : this(binding.root) {
1823
this.binding = binding
24+
this.viewThemeUtils = viewThemeUtils
1925
}
2026

2127
fun bind(listener: ShareeListAdapterListener) {
22-
binding!!.addNewSecureFileDrop.setOnClickListener { v: View? -> listener.createSecureFileDrop() }
28+
binding?.addPublicShare?.let {
29+
it.setOnClickListener { listener.createSecureFileDrop() }
30+
viewThemeUtils?.material?.colorMaterialButtonPrimaryTonal(it)
31+
}
2332
}
2433
}

app/src/main/java/com/owncloud/android/ui/adapter/ShareeListAdapter.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ class ShareeListAdapter(
7777
shareType == ShareType.NEW_PUBLIC_LINK -> {
7878
if (encrypted) {
7979
val binding = FileDetailsShareSecureFileDropAddNewItemBinding.inflate(inflater, parent, false)
80-
NewSecureFileDropViewHolder(binding)
80+
NewSecureFileDropViewHolder(binding, viewThemeUtils)
8181
} else {
8282
val binding = FileDetailsSharePublicLinkAddNewItemBinding.inflate(inflater, parent, false)
8383
NewLinkShareViewHolder(binding)

app/src/main/java/com/owncloud/android/ui/fragment/FileDetailSharingFragment.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,10 @@ private void setupView() {
321321

322322
if (file.canReshare() && !FileDetailSharingFragmentHelper.isPublicShareDisabled(capabilities)) {
323323
if (file.isEncrypted() || (parentFile != null && parentFile.isEncrypted())) {
324+
binding.internalShareHeadline.setText(getResources().getString(R.string.internal_share_headline_end_to_end_encrypted));
325+
binding.internalShareDescription.setVisibility(View.VISIBLE);
326+
binding.externalSharesHeadline.setText(getResources().getString(R.string.create_end_to_end_encrypted_share_title));
327+
324328
if (file.getE2eCounter() == -1) {
325329
// V1 cannot share
326330
binding.searchContainer.setVisibility(View.GONE);
@@ -618,11 +622,7 @@ private void addExternalAndPublicShares(List<OCShare> externalShares) {
618622
externalShareeListAdapter.removeAll();
619623
final var shares = OCShareExtensionsKt.mergeDistinctByToken(externalShares, publicShares);
620624

621-
boolean hasNoSecureFileDrop = shares.stream()
622-
.noneMatch(s -> s.getShareType() == ShareType.PUBLIC_LINK
623-
|| s.getShareType() == ShareType.NEW_PUBLIC_LINK);
624-
625-
if (file.isEncrypted() && hasNoSecureFileDrop) {
625+
if (file.isEncrypted()) {
626626
OCShare placeholder = new OCShare();
627627
placeholder.setShareType(ShareType.NEW_PUBLIC_LINK);
628628
shares.add(placeholder);

app/src/main/res/layout/file_details_share_secure_file_drop_add_new_item.xml

Lines changed: 15 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -2,43 +2,18 @@
22
<!--
33
~ Nextcloud - Android Client
44
~
5-
~ SPDX-FileCopyrightText: 2020 Andy Scherzinger <info@andy-scherzinger.de>
6-
~ SPDX-FileCopyrightText: 2020 Tobias Kaminsky <tobias@kaminsky.me>
7-
~ SPDX-FileCopyrightText: 2020 Nextcloud GmbH
8-
~ SPDX-License-Identifier: AGPL-3.0-or-later OR GPL-2.0-only
9-
-->
10-
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
11-
android:id="@+id/add_public_share"
12-
android:layout_width="match_parent"
13-
android:layout_height="@dimen/sharee_list_item_size"
14-
android:orientation="horizontal">
15-
16-
<ImageView
17-
android:layout_width="@dimen/share_icon_size"
18-
android:layout_height="@dimen/share_icon_size"
19-
android:layout_gravity="center_vertical"
20-
android:layout_marginStart="@dimen/standard_margin"
21-
android:layout_marginEnd="@dimen/standard_margin"
22-
android:background="@drawable/round_bgnd"
23-
android:contentDescription="@string/share"
24-
android:padding="@dimen/standard_half_padding"
25-
android:src="@drawable/shared_via_link" />
26-
27-
<TextView
28-
android:layout_width="0dp"
29-
android:layout_height="wrap_content"
30-
android:layout_gravity="center_vertical"
31-
android:layout_weight="1"
32-
android:text="@string/share_permission_secure_file_drop"
33-
android:textSize="@dimen/two_line_primary_text_size" />
34-
35-
<ImageView
36-
android:id="@+id/add_new_secure_file_drop"
37-
android:layout_width="wrap_content"
38-
android:layout_height="match_parent"
39-
android:layout_gravity="center_vertical"
40-
android:contentDescription="@string/add_new_secure_file_drop"
41-
android:paddingStart="@dimen/standard_padding"
42-
android:paddingEnd="@dimen/standard_padding"
43-
android:src="@drawable/ic_plus" />
44-
</LinearLayout>
5+
~ SPDX-FileCopyrightText: 2026 Alper Ozturk <alper.ozturk@nextcloud.com>
6+
~ SPDX-License-Identifier: AGPL-3.0-or-later
7+
-->
8+
<com.google.android.material.button.MaterialButton android:id="@+id/add_public_share"
9+
style="@style/Widget.Material3.Button.IconButton.Filled.Tonal"
10+
android:layout_width="wrap_content"
11+
android:layout_marginStart="@dimen/standard_half_margin"
12+
android:layout_marginTop="@dimen/standard_half_margin"
13+
android:layout_height="@dimen/minimum_size_for_touchable_area"
14+
android:text="@string/create_end_to_end_encrypted_share"
15+
app:icon="@drawable/ic_plus"
16+
android:textColor="@color/text_color"
17+
app:iconPadding="@dimen/standard_half_padding"
18+
xmlns:app="http://schemas.android.com/apk/res-auto"
19+
xmlns:android="http://schemas.android.com/apk/res/android" />

app/src/main/res/layout/file_details_sharing_fragment.xml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@
144144
android:text="@string/send_copy_to" />
145145

146146
<TextView
147+
android:id="@+id/internal_share_headline"
147148
android:paddingStart="@dimen/standard_padding"
148149
android:paddingEnd="@dimen/zero"
149150
android:paddingTop="@dimen/standard_half_padding"
@@ -153,6 +154,20 @@
153154
android:text="@string/internal_shares"
154155
android:textAppearance="?android:attr/textAppearanceMedium" />
155156

157+
<TextView
158+
android:id="@+id/internal_share_description"
159+
android:paddingStart="@dimen/standard_padding"
160+
android:visibility="gone"
161+
tools:visibility="visible"
162+
android:paddingEnd="@dimen/zero"
163+
android:paddingTop="@dimen/standard_half_padding"
164+
android:paddingBottom="@dimen/standard_half_padding"
165+
android:layout_width="wrap_content"
166+
android:layout_height="wrap_content"
167+
android:text="@string/internal_share_description_end_to_end_encrypted"
168+
android:textAppearance="?android:attr/textAppearanceMedium" />
169+
170+
156171
<androidx.recyclerview.widget.RecyclerView
157172
android:id="@+id/sharesList_internal"
158173
android:layout_width="match_parent"

app/src/main/res/values/strings.xml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1196,8 +1196,10 @@
11961196
<string name="share_permission_file_request">File request</string>
11971197
<string name="share_permission_view_only">View only</string>
11981198
<string name="share_permission_can_edit">Can edit</string>
1199-
<string name="share_permission_secure_file_drop">Secure file drop</string>
1200-
1199+
<string name="create_end_to_end_encrypted_share_title">End-to-end encrypted link shares</string>
1200+
<string name="create_end_to_end_encrypted_share">Link share</string>
1201+
<string name="internal_share_headline_end_to_end_encrypted">End-to-end encrypted shares</string>
1202+
<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>
12011203
<string name="sync_not_enough_space_dialog_action_choose">Choose what to sync</string>
12021204
<string name="sync_not_enough_space_dialog_action_free_space">Free up space</string>
12031205
<string name="sync_not_enough_space_dialog_placeholder">%1$s is %2$s, but there is only %3$s available on device.</string>

0 commit comments

Comments
 (0)