Merge pull request #8058 from nextcloud/fixScreenshotColorTests

Fix screenshot tests on TestActivity
This commit is contained in:
Andy Scherzinger 2021-02-25 21:48:06 +01:00 committed by GitHub
commit 08053f5dbc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
26 changed files with 19 additions and 8 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5 KiB

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.9 KiB

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 51 KiB

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

After

Width:  |  Height:  |  Size: 48 KiB

View file

@ -1,5 +1,4 @@
/*
*
* Nextcloud Android client application
*
* @author Tobias Kaminsky
@ -104,9 +103,11 @@ class TestActivity :
if (!this::storage.isInitialized) {
storage = FileDataStorageManager(account, contentResolver)
val ocCapability = OCCapability()
ocCapability.versionMayor = OwnCloudVersion.nextcloud_20.majorVersionNumber
storage.saveCapabilities(ocCapability)
if (!storage.capabilityExistsForAccount(account.name)) {
val ocCapability = OCCapability()
ocCapability.versionMayor = OwnCloudVersion.nextcloud_20.majorVersionNumber
storage.saveCapabilities(ocCapability)
}
}
return storage

View file

@ -2126,6 +2126,15 @@ public class FileDataStorageManager {
return capability;
}
public boolean capabilityExistsForAccount(String accountName) {
Cursor cursor = getCapabilityCursorForAccount(accountName);
boolean exists = cursor.moveToFirst();
cursor.close();
return exists;
}
private OCCapability createCapabilityInstance(Cursor cursor) {
OCCapability capability = null;
if (cursor != null) {

View file

@ -194,10 +194,11 @@ public class SendShareDialog extends BottomSheetDialogFragment {
}
private void themeShareButtonImage(ImageView shareImageView) {
shareImageView.getBackground().setColorFilter(ThemeColorUtils.primaryColor(getContext(), true),
shareImageView.getBackground().setColorFilter(ThemeColorUtils.primaryColor(getContext().getApplicationContext(),
true),
PorterDuff.Mode.SRC_IN);
shareImageView.getDrawable().mutate().setColorFilter(ThemeColorUtils.fontColor(getContext()),
PorterDuff.Mode.SRC_IN);
shareImageView.getDrawable().mutate().setColorFilter(ThemeColorUtils.fontColor(getContext().getApplicationContext()),
PorterDuff.Mode.SRC_IN);
}
private void showResharingNotAllowedSnackbar() {

View file

@ -232,7 +232,7 @@ public class FileDetailFragment extends FileFragment implements OnClickListener,
binding.tabLayout.addTab(binding.tabLayout.newTab().setText(R.string.drawer_item_activities).setIcon(R.drawable.ic_activity));
binding.tabLayout.addTab(binding.tabLayout.newTab().setText(R.string.share_dialog_title).setIcon(R.drawable.shared_via_users));
ThemeLayoutUtils.colorTabLayout(getContext(), binding.tabLayout);
ThemeLayoutUtils.colorTabLayout(getContext().getApplicationContext(), binding.tabLayout);
final FileDetailTabAdapter adapter = new FileDetailTabAdapter(getFragmentManager(), getFile(), user);
binding.pager.setAdapter(adapter);