Skip to content

Commit

Permalink
Merge master
Browse files Browse the repository at this point in the history
Signed-off-by: alperozturk <[email protected]>
  • Loading branch information
alperozturk96 committed Oct 20, 2023
2 parents 40c8848 + 4766d8b commit 0bc669a
Show file tree
Hide file tree
Showing 33 changed files with 277 additions and 1,084 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
echo "pr=${{ github.event.pull_request.number }}" >> "$GITHUB_OUTPUT"
echo "repo=${{ github.event.pull_request.head.repo.full_name }}" >> "$GITHUB_OUTPUT"
fi
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
repository: ${{ steps.get-vars.outputs.repo }}
ref: ${{ steps.get-vars.outputs.branch }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
language: [ 'java' ]
steps:
- name: Checkout repository
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Set Swap Space
uses: pierotofy/set-swap-space@49819abfb41bd9b44fb781159c033dba90353a7c # v1.0
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/gradle-wrapper-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ jobs:
name: "Validation"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: gradle/wrapper-validation-action@56b90f209b02bf6d1deae490e9ef18b21a389cd4 # v1.1.0
2 changes: 1 addition & 1 deletion .github/workflows/scorecard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:

steps:
- name: "Checkout code"
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
persist-credentials: false

Expand Down
23 changes: 22 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,30 @@
## 3.24.1 (February 21, 2022)
## 3.26.0 (September 16, 2023)

- image editing
- image details, with map
- show other Nextcloud apps

Minimum: NC 16 Server, Android 6.0 Marshmallow

For a full list, please see https://github.com/nextcloud/android/milestone/84

## 3.25.0 (June 13, 2023)

- show Groupfolder
- Tag in file listing

Minimum: NC 16 Server, Android 6.0 Marshmallow

For a full list, please see https://github.com/nextcloud/android/milestone/81

## 3.24.1 (February 21, 2023)

- Fix crash in previous version when connecting to old server versions

Minimum: NC 16 Server, Android 6.0 Marshmallow

For a full list, please see https://github.com/nextcloud/android/milestone/80

## 3.24.0 (February 13, 2023)

- Several performance optimizations by @starypatyk
Expand Down
18 changes: 12 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,17 @@ height="80">](https://f-droid.org/packages/com.nextcloud.client/)

## How to contribute :rocket:

If you want to [contribute](https://nextcloud.com/contribute/) to Nextcloud, you are very welcome:

* our forum at https://help.nextcloud.com
* for translations of the app on [Transifex](https://app.transifex.com/nextcloud/nextcloud/android/)
* opening issues and PRs (including a corresponding issue)
If you want to [contribute](https://nextcloud.com/contribute/) to the Nextcloud Android client app, there are many ways to help whether or not you are a coder:

* helping out other users on our forum at https://help.nextcloud.com
* providing translations of the app on [Transifex](https://app.transifex.com/nextcloud/nextcloud/android/)
* reporting problems / suggesting enhancements by [opening new issues](https://github.com/nextcloud/android/issues/new/choose)
* implementing proposed bug fixes and enhancement ideas by submitting PRs (associated with a corresponding issue preferably)
* reviewing [pull requests](https://github.com/nextcloud/android/pulls) and providing feedback on code, implementation, and functionality
* installing and testing [pull request builds](https://github.com/nextcloud/android/pulls), [daily/dev builds](https://github.com/nextcloud/android#development-version-hammer), or [RCs/release candidate builds](https://github.com/nextcloud/android/releases)
* enhancing Admin, User, or Developer [documentation](https://github.com/nextcloud/documentation/)
* hitting hard on the latest stable release by testing fundamental features and evaluating the user experience
* proactively getting familiar with [how to gather debug logs](https://github.com/nextcloud/android#getting-debug-info-via-logcat-mag) from your devices (so that you are prepared to provide a detailed report if you encounter a problem with the app in the future)

## Contribution Guidelines & License :scroll:

Expand All @@ -38,7 +44,7 @@ More information on how to contribute: <https://nextcloud.com/contribute/>
## Start contributing :hammer\_and\_wrench:

Make sure you read [SETUP.md](https://github.com/nextcloud/android/blob/master/SETUP.md) and [CONTRIBUTING.md](https://github.com/nextcloud/android/blob/master/CONTRIBUTING.md) before you start working on this project. But basically: fork this repository and contribute back using pull requests to the master branch.
Easy starting points are also reviewing [pull requests](https://github.com/nextcloud/android/pulls) and working on [starter issues](https://github.com/nextcloud/android/issues?q=is%3Aopen+is%3Aissue+label%3A%22starter+issue%22).
Easy starting points are also reviewing [pull requests](https://github.com/nextcloud/android/pulls) and working on [starter issues](https://github.com/nextcloud/android/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22).

### Getting debug info via logcat :mag:

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,19 @@ class FileDetailFragmentStaticServerIT : AbstractIT() {
@Test
@ScreenshotTest
fun showFileDetailDetailsFragment() {
val sut = testActivityRule.launchActivity(null)
sut.addFragment(ImageDetailFragment.newInstance(oCFile, user))
val activity = testActivityRule.launchActivity(null)
val sut = ImageDetailFragment.newInstance(oCFile, user)
activity.addFragment(sut)

waitForIdleSync()
shortSleep()
shortSleep()
shortSleep()
screenshot(sut)
waitForIdleSync()

activity.runOnUiThread {
sut.hideMap()
}

screenshot(activity)
}

@Test
Expand Down Expand Up @@ -182,6 +187,7 @@ class FileDetailFragmentStaticServerIT : AbstractIT() {
waitForIdleSync()

activity.runOnUiThread {
sut.fileDetailActivitiesFragment.disableLoadingActivities()
sut
.fileDetailActivitiesFragment
.setErrorContent(targetContext.resources.getString(R.string.file_detail_activity_error))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@
import com.owncloud.android.ui.dialog.LoadingDialog;
import com.owncloud.android.ui.dialog.LocalStoragePathPickerDialogFragment;
import com.owncloud.android.ui.dialog.MultipleAccountsDialog;
import com.owncloud.android.ui.dialog.NoteDialogFragment;
import com.owncloud.android.ui.dialog.RemoveFilesDialogFragment;
import com.owncloud.android.ui.dialog.RenameFileDialogFragment;
import com.owncloud.android.ui.dialog.RenamePublicShareDialogFragment;
Expand Down Expand Up @@ -404,9 +403,6 @@ abstract class ComponentsModule {
@ContributesAndroidInjector
abstract Migrations migrations();

@ContributesAndroidInjector
abstract NoteDialogFragment noteDialogFragment();

@ContributesAndroidInjector
abstract NotificationWork notificationWork();

Expand Down
6 changes: 6 additions & 0 deletions app/src/main/java/com/nextcloud/ui/ImageDetailFragment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import android.os.Parcelable
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.annotation.VisibleForTesting
import androidx.core.content.ContextCompat
import androidx.fragment.app.Fragment
import com.nextcloud.android.common.ui.theme.utils.ColorRole
Expand Down Expand Up @@ -260,6 +261,11 @@ class ImageDetailFragment : Fragment(), Injectable {
binding.imageLocationMapCopyright.text = binding.imageLocationMap.tileProvider.tileSource.copyrightNotice
}

@VisibleForTesting
fun hideMap() {
binding.imageLocationMap.visibility = View.GONE
}

@SuppressLint("SimpleDateFormat")
private fun gatherMetadata() {
val fileSize = DisplayUtils.bytesToHumanReadable(file.fileLength)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import android.app.Dialog;
import android.os.Bundle;

import com.google.android.material.button.MaterialButton;
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import com.nextcloud.client.account.User;
import com.nextcloud.client.di.Injectable;
Expand Down Expand Up @@ -59,17 +60,30 @@ public static AccountRemovalConfirmationDialog newInstance(User user) {
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
user = getArguments().getParcelable(KEY_USER);

Bundle arguments = getArguments();
if (arguments != null) {
user = arguments.getParcelable(KEY_USER);
}
}

@Override
public void onStart() {
super.onStart();

AlertDialog alertDialog = (AlertDialog) getDialog();

viewThemeUtils.platform.colorTextButtons(alertDialog.getButton(AlertDialog.BUTTON_POSITIVE),
alertDialog.getButton(AlertDialog.BUTTON_NEUTRAL));
if (alertDialog != null) {

MaterialButton positiveButton = (MaterialButton) alertDialog.getButton(AlertDialog.BUTTON_POSITIVE);
if (positiveButton != null) {
viewThemeUtils.material.colorMaterialButtonPrimaryTonal(positiveButton);
}

MaterialButton negativeButton = (MaterialButton) alertDialog.getButton(AlertDialog.BUTTON_NEGATIVE);
if (negativeButton != null) {
viewThemeUtils.material.colorMaterialButtonPrimaryBorderless(negativeButton);
}
}
}

@NonNull
Expand All @@ -82,7 +96,7 @@ public Dialog onCreateDialog(Bundle savedInstanceState) {
.setPositiveButton(R.string.common_ok,
(dialogInterface, i) -> backgroundJobManager.startAccountRemovalJob(user.getAccountName(),
false))
.setNeutralButton(R.string.common_cancel, null);
.setNegativeButton(R.string.common_cancel, null);

viewThemeUtils.dialog.colorMaterialAlertDialogBackground(requireActivity(), builder);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import android.view.View;
import android.widget.Button;

import com.google.android.material.button.MaterialButton;
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import com.google.common.collect.Sets;
import com.nextcloud.client.account.CurrentAccountProvider;
Expand Down Expand Up @@ -99,7 +100,7 @@ public class ChooseRichDocumentsTemplateDialogFragment extends DialogFragment im
private RichDocumentsTemplateAdapter adapter;
private OCFile parentFolder;
private OwnCloudClient client;
private Button positiveButton;
private MaterialButton positiveButton;
private DialogFragment waitDialog;

public enum Type {
Expand All @@ -126,11 +127,18 @@ public void onStart() {

AlertDialog alertDialog = (AlertDialog) getDialog();

positiveButton = alertDialog.getButton(AlertDialog.BUTTON_POSITIVE);
viewThemeUtils.platform.colorTextButtons(positiveButton,
alertDialog.getButton(AlertDialog.BUTTON_NEUTRAL));
positiveButton.setOnClickListener(this);
positiveButton.setEnabled(false);
if (alertDialog != null) {
positiveButton = (MaterialButton) alertDialog.getButton(AlertDialog.BUTTON_POSITIVE);
viewThemeUtils.material.colorMaterialButtonPrimaryTonal(positiveButton);

MaterialButton negativeButton = (MaterialButton) alertDialog.getButton(AlertDialog.BUTTON_NEGATIVE);
if (negativeButton != null) {
viewThemeUtils.material.colorMaterialButtonPrimaryBorderless(negativeButton);
}

positiveButton.setOnClickListener(this);
positiveButton.setEnabled(false);
}

checkEnablingCreateButton();
}
Expand Down Expand Up @@ -205,12 +213,14 @@ public void afterTextChanged(Editable s) {
}
});

int titleTextId = getTitle(type);

// Build the dialog
MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(activity);
builder.setView(view)
.setPositiveButton(R.string.create, null)
.setNeutralButton(R.string.common_cancel, null)
.setTitle(getTitle(type));
.setNegativeButton(R.string.common_cancel, null)
.setTitle(titleTextId);

viewThemeUtils.dialog.colorMaterialAlertDialogBackground(activity, builder);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import android.widget.Button;
import android.widget.TextView;

import com.google.android.material.button.MaterialButton;
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import com.google.common.collect.Sets;
import com.nextcloud.client.di.Injectable;
Expand Down Expand Up @@ -71,7 +72,7 @@ public class CreateFolderDialogFragment


private OCFile mParentFolder;
private Button positiveButton;
private MaterialButton positiveButton;


private EditBoxDialogBinding binding;
Expand Down Expand Up @@ -101,13 +102,11 @@ public void onStart() {
private void bindButton() {
Dialog dialog = getDialog();

if (dialog instanceof AlertDialog) {
AlertDialog alertDialog = (AlertDialog) dialog;

positiveButton = alertDialog.getButton(AlertDialog.BUTTON_POSITIVE);

viewThemeUtils.platform.colorTextButtons(positiveButton,
alertDialog.getButton(AlertDialog.BUTTON_NEUTRAL));
if (dialog instanceof AlertDialog alertDialog) {
positiveButton = (MaterialButton) alertDialog.getButton(AlertDialog.BUTTON_POSITIVE);
MaterialButton negativeButton = (MaterialButton) alertDialog.getButton(AlertDialog.BUTTON_NEGATIVE);
viewThemeUtils.material.colorMaterialButtonPrimaryTonal(positiveButton);
viewThemeUtils.material.colorMaterialButtonPrimaryBorderless(negativeButton);
}
}

Expand Down Expand Up @@ -186,17 +185,25 @@ public void onTextChanged(CharSequence s, int start, int before, int count) {
});

// Build the dialog
MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(requireActivity());
builder.setView(view)
.setPositiveButton(R.string.folder_confirm_create, this)
.setNeutralButton(R.string.common_cancel, this)
.setTitle(R.string.uploader_info_dirname);
MaterialAlertDialogBuilder builder = buildMaterialAlertDialog(view);

viewThemeUtils.dialog.colorMaterialAlertDialogBackground(binding.userInputContainer.getContext(), builder);

return builder.create();
}

private MaterialAlertDialogBuilder buildMaterialAlertDialog(View view) {
MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(requireActivity());

builder
.setView(view)
.setPositiveButton(R.string.folder_confirm_create, this)
.setNegativeButton(R.string.common_cancel, this)
.setTitle(R.string.uploader_info_dirname);

return builder;
}

@Override
public void onClick(DialogInterface dialog, int which) {
if (which == AlertDialog.BUTTON_POSITIVE) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import android.text.format.DateUtils;
import android.widget.DatePicker;

import com.google.android.material.button.MaterialButton;
import com.nextcloud.client.di.Injectable;
import com.owncloud.android.R;
import com.owncloud.android.utils.theme.ViewThemeUtils;
Expand Down Expand Up @@ -81,12 +82,24 @@ public void setOnExpiryDateListener(OnExpiryDateListener onExpiryDateListener) {
public void onStart() {
super.onStart();
final Dialog currentDialog = getDialog();

if (currentDialog != null) {
final DatePickerDialog dialog = (DatePickerDialog) currentDialog;

viewThemeUtils.platform.colorTextButtons(dialog.getButton(DatePickerDialog.BUTTON_NEUTRAL),
dialog.getButton(DatePickerDialog.BUTTON_NEGATIVE),
dialog.getButton(DatePickerDialog.BUTTON_POSITIVE));
MaterialButton positiveButton = (MaterialButton) dialog.getButton(DatePickerDialog.BUTTON_POSITIVE);
if (positiveButton != null) {
viewThemeUtils.material.colorMaterialButtonPrimaryTonal(positiveButton);
}

MaterialButton negativeButton = (MaterialButton) dialog.getButton(DatePickerDialog.BUTTON_NEGATIVE);
if (negativeButton != null) {
viewThemeUtils.material.colorMaterialButtonPrimaryBorderless(negativeButton);
}

MaterialButton neutralButton = (MaterialButton) dialog.getButton(DatePickerDialog.BUTTON_NEUTRAL);
if (neutralButton != null) {
viewThemeUtils.material.colorMaterialButtonPrimaryBorderless(neutralButton);
}
}
}

Expand Down Expand Up @@ -118,7 +131,7 @@ public Dialog onCreateDialog(Bundle savedInstanceState) {
//show unset button only when date is already selected
if (chosenDateInMillis > 0) {
dialog.setButton(
Dialog.BUTTON_NEUTRAL,
Dialog.BUTTON_NEGATIVE,
getText(R.string.share_via_link_unset_password),
(dialog1, which) -> {
if (onExpiryDateListener != null) {
Expand Down
Loading

0 comments on commit 0bc669a

Please sign in to comment.