Skip to content

Conversation

@alperozturk96
Copy link
Collaborator

@alperozturk96 alperozturk96 commented Mar 26, 2025

  • Tests written, or not not needed

Library PR: nextcloud/android-library#1706

@alperozturk96 alperozturk96 changed the title Feature - Add Share Permissions Feature - Add Custom Share Permissions Mar 27, 2025
/**
* get the permissions on the basis of selection
*/
private fun getSelectedPermission() = when {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need this function anymore. clickEvents assigns value for the permission

@nextcloud nextcloud deleted a comment from github-actions bot Mar 27, 2025
@alperozturk96 alperozturk96 force-pushed the feature/add-share-permissions branch from cbf504a to c27d9ee Compare March 27, 2025 10:30
@nextcloud nextcloud deleted a comment from github-actions bot Mar 27, 2025
@alperozturk96 alperozturk96 force-pushed the feature/add-share-permissions branch 2 times, most recently from bf9eb82 to 5eae6b1 Compare April 1, 2025 14:43
Comment on lines -40 to -87
/**
* Sets checked/visibility state on the given {@link MenuItem} based on the given criteria.
*
* @param menuItem the {@link MenuItem} to be setup
*/
public static void setupHideFileDownload(MenuItem menuItem,
boolean hideFileDownload,
boolean isFileDrop) {
if (isFileDrop) {
menuItem.setVisible(false);
} else {
menuItem.setVisible(true);
menuItem.setChecked(hideFileDownload);
}
}

/**
* sets up the password {@link MenuItem}'s title based on the fact if a password is present.
*
* @param password the password {@link MenuItem}
* @param isPasswordProtected flag is a password is present
*/
public static void setupPasswordMenuItem(MenuItem password, boolean isPasswordProtected) {
if (isPasswordProtected) {
password.setTitle(R.string.share_password_title);
} else {
password.setTitle(R.string.share_no_password_title);
}
}

/**
* sets up the expiration date {@link MenuItem}'s title based on the fact if an expiration date is present.
*
* @param expirationDate the expiration date {@link MenuItem}
* @param expirationDateValue the expiration date
* @param res Resources to load the corresponding strings.
*/
public static void setupExpirationDateMenuItem(MenuItem expirationDate, long expirationDateValue, Resources res) {
if (expirationDateValue > 0) {
expirationDate.setTitle(res.getString(
R.string.share_expiration_date_label,
SimpleDateFormat.getDateInstance().format(new Date(expirationDateValue))
));
} else {
expirationDate.setTitle(R.string.share_no_expiration_date_label);
}
}

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused functions

@alperozturk96 alperozturk96 force-pushed the feature/add-share-permissions branch from 3fcc813 to 1b1bc00 Compare April 2, 2025 09:18
@nextcloud nextcloud deleted a comment from github-actions bot Apr 2, 2025
@alperozturk96 alperozturk96 force-pushed the feature/add-share-permissions branch 2 times, most recently from f1196f6 to 2aaa34d Compare April 3, 2025 07:00
@alperozturk96 alperozturk96 requested a review from mpivchev April 14, 2025 06:54
@alperozturk96 alperozturk96 force-pushed the feature/add-share-permissions branch from 12beb86 to 735ee0b Compare April 14, 2025 07:00
@mpivchev

This comment was marked as resolved.

@mpivchev

This comment was marked as resolved.

@mpivchev

This comment was marked as resolved.

@alperozturk96 alperozturk96 force-pushed the feature/add-share-permissions branch from a789b30 to 43fd840 Compare April 17, 2025 07:55
@alperozturk96 alperozturk96 force-pushed the feature/add-share-permissions branch 2 times, most recently from 4328310 to a5a560a Compare May 5, 2025 11:38
@mpivchev

This comment was marked as resolved.

@alperozturk96 alperozturk96 force-pushed the feature/add-share-permissions branch 2 times, most recently from 2dcf77e to 63df1a9 Compare May 7, 2025 12:21
@mpivchev

This comment was marked as resolved.

Signed-off-by: alperozturk <alper_ozturk@proton.me>
Signed-off-by: alperozturk <alper_ozturk@proton.me>
Signed-off-by: alperozturk <alper_ozturk@proton.me>
Signed-off-by: alperozturk <alper_ozturk@proton.me>
Signed-off-by: alperozturk <alper_ozturk@proton.me>
Signed-off-by: alperozturk <alper_ozturk@proton.me>
Signed-off-by: alperozturk <alper_ozturk@proton.me>
Signed-off-by: alperozturk <alper_ozturk@proton.me>
Signed-off-by: alperozturk <alper_ozturk@proton.me>
Signed-off-by: alperozturk <alper_ozturk@proton.me>
Signed-off-by: alperozturk <alper_ozturk@proton.me>
Signed-off-by: alperozturk <alper_ozturk@proton.me>
Signed-off-by: alperozturk <alper_ozturk@proton.me>
Signed-off-by: alperozturk <alper_ozturk@proton.me>
Signed-off-by: alperozturk <alper_ozturk@proton.me>
Signed-off-by: alperozturk <alper_ozturk@proton.me>
Signed-off-by: alperozturk <alper_ozturk@proton.me>
Signed-off-by: alperozturk <alper_ozturk@proton.me>
Signed-off-by: alperozturk <alper_ozturk@proton.me>
Signed-off-by: alperozturk <alper_ozturk@proton.me>
Signed-off-by: alperozturk <alper_ozturk@proton.me>
Signed-off-by: alperozturk <alper_ozturk@proton.me>
Signed-off-by: alperozturk <alper_ozturk@proton.me>
@alperozturk96 alperozturk96 force-pushed the feature/add-share-permissions branch from f9a902f to 6e5ade0 Compare June 10, 2025 08:35
Signed-off-by: alperozturk <alper_ozturk@proton.me>
@github-actions
Copy link

APK file: https://www.kaminsky.me/nc-dev/android-artifacts/14729.apk

qrcode

To test this change/fix you can simply download above APK file and install and test it in parallel to your existing Nextcloud app.

@github-actions
Copy link

Codacy

Lint

TypemasterPR
Warnings5151
Errors1111

SpotBugs

CategoryBaseNew
Bad practice6565
Correctness5860
Dodgy code292275
Experimental11
Internationalization77
Malicious code vulnerability11
Multithreaded correctness77
Performance5149
Security1818
Total500483

@alperozturk96 alperozturk96 merged commit 507e694 into master Jun 11, 2025
20 checks passed
@alperozturk96 alperozturk96 deleted the feature/add-share-permissions branch June 11, 2025 07:27
@tobiasKaminsky tobiasKaminsky added this to the Nextcloud App 3.32.0 milestone Jun 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants