Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature/v12 themeing] UI Theming updates for v12 #1191

Closed
wants to merge 5 commits into from

Conversation

hosy
Copy link
Collaborator

@hosy hosy commented Mar 15, 2023

Description

Related Issue

Motivation and Context

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • Added an issue with details about all relevant changes in the iOS documentation repository.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • Added changelog files for the fixed issues in folder changelog/unreleased

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


Matthias Hühne seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@hosy
Copy link
Collaborator Author

hosy commented Mar 15, 2023

(1)

sort header color may in navigation bar color

(2)

check file list colours:
secondary label color is currently using tint color

(3)

sidebar:
collection cell images using tint color (should use text colour)

(4)

Status bar color
currently not brandable

(5)

Action Alert
font colour is not visible (when using white tint colour)

(6)

sidebar foldable cell item has wrong indicator colour

(7)

try to set the tint colour to white

  • check Spaces
  • empty folder (button font color)

Copy link
Contributor

@felix-schwarz felix-schwarz left a comment

Choose a reason for hiding this comment

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

Overall, the look of all elements in the sidebar (incl. navigation bar) on the left should be distinct from the elements in the content area (again, including navigation bar) on the right, to provide the same visual cues as in stock iOS apps:

ownCloud.app Files.app
Simulator Screen Shot - iPad (10th generation) - 2023-03-17 at 18 00 34 Simulator Screen Shot - iPad (10th generation) - 2023-03-17 at 18 00 46

@@ -190,6 +190,40 @@ class ActionCell: ThemeableCollectionViewCell {
}
}


class ActionListCell: UICollectionViewListCell, Themeable {
Copy link
Contributor

Choose a reason for hiding this comment

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

The implementation of ActionListCell and SavedSearchListCell appear to be identical in code - and the functionality they provide is also already provided by the existing ThemeableCollectionViewListCell, so it would make sense to use ThemeableCollectionViewListCell instead of ActionListCell and SavedSearchListCell classes.

var content = cell.defaultContentConfiguration()
content.textProperties.color = Theme.shared.activeCollection.tableRowColors.labelColor
content.imageProperties.tintColor = Theme.shared.activeCollection.tintColor
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't these colors already be set via func updateConfiguration(using state: UICellConfigurationState)? If they aren't, I'd suggest to move that code into a method of the respective class and call it where it is needed (here and in updateConfiguration?), to avoid code duplication.

@@ -236,6 +238,9 @@ extension DriveListCell {

content.text = title
content.image = icon

content.textProperties.color = Theme.shared.activeCollection.tableRowColors.labelColor
content.imageProperties.tintColor = Theme.shared.activeCollection.tintColor
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't these colors already be set via func updateConfiguration(using state: UICellConfigurationState) of ThemeableCollectionViewListCell? If they aren't, I'd suggest to move that code into a method of the respective class and call it where it is needed (here and in updateConfiguration?), to avoid code duplication.

@@ -127,6 +127,9 @@ public extension CollectionViewCellProvider {
})

var content = cell.defaultContentConfiguration()

content.textProperties.color = Theme.shared.activeCollection.tableRowColors.labelColor
content.imageProperties.tintColor = Theme.shared.activeCollection.tintColor
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't these colors already be set via func updateConfiguration(using state: UICellConfigurationState) of ThemeableCollectionViewListCell? If they aren't, I'd suggest to move that code into a method of the respective class and call it where it is needed (here and in updateConfiguration?), to avoid code duplication.


default: break
}
config.backgroundColor = Theme.shared.activeCollection.tableBackgroundColor
Copy link
Contributor

Choose a reason for hiding this comment

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

.plain, .grouped and .insetGrouped appearances should have a different look, for the sidebar to look in line with how sidebars look throughout the OS.

@@ -305,11 +305,14 @@ class AccountControllerCell: ThemeableCollectionViewListCell {
}

open override func applyThemeCollection(theme: Theme, collection: ThemeCollection, event: ThemeEvent) {
titleLabel.applyThemeCollection(collection, itemStyle: .title, itemState: ThemeItemState(selected: self.isSelected))
detailLabel.applyThemeCollection(collection, itemStyle: .title, itemState: ThemeItemState(selected: self.isSelected))
Copy link
Contributor

Choose a reason for hiding this comment

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

This sets the detail label's color to the same color as the title label, whereas the detail label should have a lighter color.

var backgroundConfig = UIBackgroundConfiguration.listSidebarCell()
backgroundConfig.cornerRadius = 10
backgroundConfig.backgroundColor = UIColor(white: 1.0, alpha: 0.8)

backgroundConfig.backgroundColor = collection.tableGroupBackgroundColor
Copy link
Contributor

Choose a reason for hiding this comment

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

The AccountControllerCell background color should be distinct from background colors of table / collection views.

navigationView.applyThemeCollection(collection, itemStyle: .content)
navigationView.applyThemeCollection(collection, itemStyle: .defaultForItem)
contentViewController?.navigationItem.navigationContent.applyThemeCollection(collection)
if let items = contentViewController?.navigationItem.navigationContent.items(withIdentifier: "ios16-truncated-title-fix"), let label = items.0.first?.titleView as? UILabel {
Copy link
Contributor

Choose a reason for hiding this comment

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

That label is accessible more easily via the convenience accessor contentViewController?.navigationItem.titleLabel (implemented in UINavigationItem+Extension.swift).

@@ -189,6 +189,36 @@ extension OCSavedSearch {
}
}

class SavedSearchListCell: UICollectionViewListCell, Themeable {
Copy link
Contributor

Choose a reason for hiding this comment

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

The implementation of ActionListCell and SavedSearchListCell appear to be identical in code - and the functionality they provide is also already provided by the existing ThemeableCollectionViewListCell, so it would make sense to use ThemeableCollectionViewListCell instead of ActionListCell and SavedSearchListCell classes.

}

required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}

deinit {
Theme.shared.unregister(client: self)
Copy link
Contributor

Choose a reason for hiding this comment

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

Good catch! No objections, only a comment: in V12 Theme.unregister(client:) no longer needs to be called. The deallocation of an object also automatically unregisters it as a Theme client.

@felix-schwarz
Copy link
Contributor

Superseded by #1194

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants