Skip to content

Create an Action ButtonStyle#1547

Merged
LePips merged 62 commits intojellyfin:mainfrom
JPKribs:actionButtons
Aug 11, 2025
Merged

Create an Action ButtonStyle#1547
LePips merged 62 commits intojellyfin:mainfrom
JPKribs:actionButtons

Conversation

@JPKribs
Copy link
Copy Markdown
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 Impacts 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
Copy Markdown
Contributor

chickdan commented Jun 9, 2025

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

@JPKribs
Copy link
Copy Markdown
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 JPKribs requested a review from LePips July 26, 2025 02:36
Copy link
Copy Markdown
Member

@LePips LePips left a comment

Choose a reason for hiding this comment

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

Apologies for not keeping up with this PR. For these buttons I've always wanted a tinted material instead of a solid color and I've added those in my latest commit. Play around with that for these buttons to see what it looks like.

Edit: apologies for no example, usage would look somewhat like the following:

Button {} label: {
    Image(systemName: "heart.fill")
        .foregroundStyle(.white)
        .padding(10)
        .background(
            TintedMaterial()
        )
        .tint(.green)
        .cornerRadius(10)
}

@JPKribs
Copy link
Copy Markdown
Member Author

JPKribs commented Aug 7, 2025

Apologies for not keeping up with this PR. For these buttons I've always wanted a tinted material instead of a solid color and I've added those in my latest commit. Play around with that for these buttons to see what it looks like.

Edit: apologies for no example, usage would look somewhat like the following:

Button {} label: {
    Image(systemName: "heart.fill")
        .foregroundStyle(.white)
        .padding(10)
        .background(
            TintedMaterial()
        )
        .tint(.green)
        .cornerRadius(10)
}

I think I'm off. I have this on my latest commit:

Dark.Mode.mp4
Light.Mode.mp4
Simple Screenshot 2025-08-07 at 13 49 29
Poster Screenshot 2025-08-07 at 13 49 57

I added a 50% gray tint because otherwise I would get:

Poster Screenshot 2025-08-07 at 13 52 03
Simple Simulator Screenshot - iPhone 16 Pro - 2025-08-07 at 13 52 10

I don't love how this looks though. I'm not sure what our best route is for making the icon visible since the tinting makes it easy to lose it

@JPKribs
Copy link
Copy Markdown
Member Author

JPKribs commented Aug 8, 2025

@LePips I cleaned this up a little. Made this more transparent to see the color through and made the text always white. I'm using mostly transparent gray so you can still see the material underneath. Let me know if this isn't the way I should do this. I'm happy with how this version looks now. Please find demos below.

Should I use this same material format for tvOS as well?

Simulator.Screen.Recording.-.iPhone.16.Pro.-.2025-08-08.at.11.06.16.mp4
Simulator.Screen.Recording.-.iPhone.16.Pro.-.2025-08-08.at.11.18.45.mp4
Simulator.Screen.Recording.-.iPhone.16.Pro.-.2025-08-08.at.11.20.17.mp4
Simulator.Screen.Recording.-.iPhone.16.Pro.-.2025-08-08.at.11.20.44.mp4

@JPKribs
Copy link
Copy Markdown
Member Author

JPKribs commented Aug 9, 2025

Also, an option if we want to do the PlayButton in the same styling. IMO, I think this looks good:

Simulator.Screen.Recording.-.iPhone.16.Pro.-.2025-08-08.at.21.26.18.mp4
Simulator.Screen.Recording.-.iPhone.16.Pro.-.2025-08-08.at.21.26.47.mp4
Simulator.Screen.Recording.-.iPhone.16.Pro.-.2025-08-08.at.21.27.04.mp4

@LePips
Copy link
Copy Markdown
Member

LePips commented Aug 10, 2025

I've changed the visual effect style and opacity used since it dulled the colors a bit too much. We will probably still tweak these over time.

PlayButton in the same styling

Yes, that it also an intention of this style.

same material format for tvOS as well?

Maybe, but we can take a look at that later.

@JPKribs
Copy link
Copy Markdown
Member Author

JPKribs commented Aug 10, 2025

Those were a big help, thank you! I have this in a place where I think this looks good. The last question is whether we'd want to fully mirror Apple where the text for the button is the accent color. I like what Apple does for Apple Music and Podcasts but they also have a static accent color so they've selected colors that are more distinct and less likely to be hard to see:

Screenshot 2025-08-10 at 13 29 38

In Swiftfin, this is what I have in my last commit. Please let me know if this is not the direction we want to go:

Disabled Play Button:
Screenshot 2025-08-10 at 13 19 30

Standard
Screenshot 2025-08-10 at 13 19 57

Screenshot 2025-08-10 at 13 20 27
How Collections Look Simulator Screenshot - iPhone 16 Pro - 2025-08-10 at 13 16 36

@LePips
Copy link
Copy Markdown
Member

LePips commented Aug 10, 2025

the text for the button is the accent color.

No, just please have the styling as it was prior.

@JPKribs
Copy link
Copy Markdown
Member Author

JPKribs commented Aug 10, 2025

Sounds good. Using this:

White Accent
Screenshot 2025-08-10 at 15 36 39

Orange Accent
Screenshot 2025-08-10 at 15 36 56

Purple? Accent
Screenshot 2025-08-10 at 15 37 20

Simple View
Screenshot 2025-08-10 at 15 44 06

There is one part of this I think is wrong. For the PlayButton, to get this to conform to the existing .tintedMaterial, I have .isSelected(true). Should I just manually set up this button instead of reusing the button style? Or, should the buttonstyle be primary, secondary, tertiary with text, background unselected, background selected?

        var body: some View {
            Button {
                play()
            } label: {
                HStack {
                    Label(title, systemImage: "play.fill")
                        .font(.callout)
                        .fontWeight(.semibold)

                    if let source {
                        Marquee(source, speed: 40, delay: 3, fade: 5)
                            .font(.caption)
                            .fontWeight(.medium)
                            .frame(maxWidth: 175)
                    }
                }
                .padding(.horizontal, 5)
            }
            .buttonStyle(.tintedMaterial)
            .foregroundStyle(.white, accentColor)
            .isSelected(true)
            .contextMenu {
                if viewModel.playButtonItem?.userData?.playbackPositionTicks != 0 {
                    Button(L10n.playFromBeginning, systemImage: "gobackward") {
                        play(fromBeginning: true)
                    }
                }
            }
            .disabled(!isEnabled)
        }

@LePips LePips merged commit e71dc35 into jellyfin:main Aug 11, 2025
4 checks passed
@JPKribs JPKribs deleted the actionButtons branch August 14, 2025 21:28
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 Impacts 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

3 participants