Skip to content

Create an Action ButtonStyle #1547

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

Open
wants to merge 48 commits into
base: main
Choose a base branch
from
Open

Conversation

JPKribs
Copy link
Member

@JPKribs JPKribs commented May 22, 2025

Summary

Resolves: #1667

Originally Mentioned Here: #1543 (comment)

I wanted to split this out into it's own PR / Discussion for better visibility.


This PR changes the action buttons from their current floating icons to instead use more a square button similar to tvOS. I try to preserve the Icon Color so it doesn't flip when the button goes from selected to unselected. To do this, I am using the same overlay color for the PlayButton so it's consistent. Un-selected buttons are .gray to account for either black or white icon colors.

All buttons grow to fill their container, identical to tvOS, except Compact Poster they will always be exact squares similar to the existing layout.


Totally open to suggestions for this! I'm not positive this is what was meant in the original comment but this is where my mind went since this would bring iOS and tvOS in line with similar layouts.


Screenshots

Cinematic

Cinematic

Compact Poster

Compact Poster

Generic / Simple Scroll View

Episode

Collections

Collection

iPadOS - Standard

iPad Cinematic

iPadOS - Collections

iPad Collections

Minimum Items vs Maximum Items

Max vs Min Count

@JPKribs JPKribs added enhancement New feature or request iOS Specific to only iOS or iPadOS labels May 22, 2025
@JPKribs JPKribs changed the title [WIP] Square Action Buttons Square Action Buttons May 22, 2025
@JPKribs JPKribs marked this pull request as ready for review May 22, 2025 19:40
@chickdan
Copy link
Contributor

chickdan commented Jun 9, 2025

Well, it looks like Apple is moving toward pill shaped buttons in tvOS 26 😆

@JPKribs
Copy link
Member Author

JPKribs commented Jun 9, 2025

Well, it looks like Apple is moving toward pill shaped buttons in tvOS 26 😆

The only constant is change I suppose lol.

I really hope there are some revisions in iOS 26 before the final release. I personally felt like a lot of their demos were really difficult to read with the layered transparency

#Conflicts:
#	Swiftfin.xcodeproj/project.pbxproj
@JPKribs
Copy link
Member Author

JPKribs commented Jun 17, 2025

Successfully, actually did the re-base! This should be back and buildable. I think this is basically my 'final' version of this with the exception of using the .gray as the default background. I think it's really close but it's a little too light in dark mark and a little too dark in light mode.

I'm open to suggestions to the gray but I think the rest is good to go!

@JPKribs
Copy link
Member Author

JPKribs commented Jun 20, 2025

I moved the ActionButton to a ButtonStyle on iOS. It looks identical to what I have in my screenshot but the implementation feels a lot cleaner for both Buttons and Menus.

I've tested this as well, I believe we should be able to use this if we want to make the PlayButton on iOS use this same styling. I haven't included that in this same PR but below are what this looks like using the .buttonStyle(.action) for the PlayButton:

            Button(title, systemImage: "play.fill") {
                if let playButtonItem = viewModel.playButtonItem, let selectedMediaSource = viewModel.selectedMediaSource {
                    mainRouter.route(to: \.videoPlayer, OnlineVideoPlayerManager(item: playButtonItem, mediaSource: selectedMediaSource))
                } else {
                    logger.error("No media source available")
                }
            }
            .buttonStyle(.action)
            .foregroundStyle(accentColor.overlayColor, accentColor)
            .font(.callout)
            .fontWeight(.semibold)
            .disabled(viewModel.playButtonItem == nil)
Compact

Simulator Screenshot - iPhone 16 Pro - 2025-06-20 at 15 52 05

Wide

Simulator Screenshot - iPhone 16 Pro - 2025-06-20 at 15 52 22


I wish I could do the same in tvOS but I was finding any buttons you have to build EVERYTHING including the animations for pressing, focus, etc. So I left tvOS mostly alone but I tried to mirror the .foregroundStyle between them.

I am going to stop working on this now so this isn't a moving target to review but this should be done and ready for a second look.

@JPKribs JPKribs changed the title Square Action Buttons Create an Action ButtonStyle Jun 29, 2025
@JPKribs JPKribs requested a review from LePips July 26, 2025 02:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request iOS Specific to only iOS or iPadOS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[iOS] Action buttons in CompactPoster view hard to press
2 participants