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

Create cell component for the button with icon style #17002

Closed
Tracked by #16995
dvdchr opened this issue Aug 10, 2021 · 0 comments · Fixed by #17005
Closed
Tracked by #16995

Create cell component for the button with icon style #17002

dvdchr opened this issue Aug 10, 2021 · 0 comments · Fixed by #17005
Assignees

Comments

@dvdchr
Copy link
Contributor

dvdchr commented Aug 10, 2021

Parent issue: #16995

Create a new table view cell that fulfills the design requirement. Here's the design of the cell:

cell

Some exploratory notes:

  • Option 1: Reuse ButtonRow, which is currently used for login and logout button in the Me screen.
    • The class is an ImmuTableRow type, which is constraint for ImmuTable – while the About page uses plain table view. We'd need to directly use the table view cell class WPTableViewCellDefault and replicate the cell configuration done in ButtonRow.
    • WPTableViewCellDefault uses plain UITableViewCell. This means, the button is actually the default textLabel of UITableViewCell with center alignment.
    • Another problem with using a default UITableViewCell is the icon requirement – the icon needs to be on the leading side of the title label, and the default imageView is displayed on the leading edge of the cell.
  • Option 2: Create a new table view cell with a single UIButton element. The UIButton has an imageView component built-in that displays the image on the leading side of the button and it follows to the tint color.
    • Problem is, UIButton absorbs touch event, preventing the cell to trigger tableView(_ tableView:didSelectRowAt indexPath:).
    • There's also the issue with the unconfigurable spacing between the button's image and title. There are some workarounds, but needs more testing for localization compatibility (particularly RTL layout).
    • Potential multiline + accessibility issue.
  • Option 3: Create a new table view cell with a UIImageView and UILabel pair, replicating the looks of UIButton when it's image is set.
    • Need to ensure that it has the right accessibility traits and label, since it's a label that's presented as a button.
  • Lastly, since the contents for the project are fetched asynchronously, the button should be able to show a loading state to indicate an asynchronous activity.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant