Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix(core): actionBar to use appearance api on ios13+ #9530

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

Merged
merged 1 commit into from
Sep 1, 2021

Conversation

rigor789
Copy link
Member

@rigor789 rigor789 commented Sep 1, 2021

PR Checklist

What is the current behavior?

What is the new behavior?

Fixes/Implements/Closes #[Issue Number].

@cla-bot cla-bot bot added the cla: yes label Sep 1, 2021
@farfromrefug
Copy link
Collaborator

@rigor789 we should merge this #9223 as ir will cause your PR to be refactored

@NathanWalker NathanWalker merged commit 8e3f16d into release/8.1.0 Sep 1, 2021
@NathanWalker NathanWalker deleted the fix/ios-action-bar-background branch September 1, 2021 15:52
@rigor789
Copy link
Member Author

rigor789 commented Sep 1, 2021

@farfromrefug should be fine because #9223 only touches android side, this only affects ios. I did change the base to release/8.1.0 for your PR, and we can get that merged shortly!

@farfromrefug
Copy link
Collaborator

@rigor789 that s what i thought at first but i think _applyBackground exists also on iOS

@bmacdonald
Copy link

Is there any plan to roll this to and 8.0.x release? It is likely the new iOS / Xcode updates will be live in a month. Right now, I am not seeing a time table on the 8.1.0 release. It is fairly unrealistic to force developers to upgrade to the next version of nativescript in such a short amount of time.

@rigor789
Copy link
Member Author

rigor789 commented Sep 2, 2021

Once 8.1.0 is out it should be an easy upgrade, but we can definitely get this backported to 8.0.x

@bmacdonald
Copy link

Thanks for the response Rigor.

Back porting for us is critical. It is a rather large application and each release has 3 rounds of regression lasting a week each. In this time we are at code freeze and cannot do a port until QA has signed off on the release.

@rigor789
Copy link
Member Author

rigor789 commented Sep 2, 2021

@bmacdonald we just backported it to a 8.0.9 patch released here: https://github.com/NativeScript/NativeScript/releases/tag/8.0.9-core

If you run into any issues with XCode 13 do let us know asap so we can work on a fix before it goes stable.

@bmacdonald
Copy link

Thank you Rigor.

I will test it either later this evening or in the morning tomorrow and get back with you.

@bmacdonald
Copy link

@rigor789
I think with the changes required for iOS, setting the text color is broken. This will likely impact the 8.1 release as well. Here is my test case and some info.

✔ Getting NativeScript components versions information...
✔ Component nativescript has 8.0.2 version and is up to date.
✔ Component @nativescript/core has 8.0.9 version and is up to date.
✔ Component @nativescript/ios has 8.0.0 version and is up to date.

Steps:

  • Create a basic app

ns create actionbar-ios15 --angular

  • Open the file /src/app/item/items.component.html

  • Change the ActionBar markup to:

<ActionBar title="My App" style="background-color:red;color:white;"> </ActionBar>

You will notice the title bar color stays at black.

I think this has to do with the setColor property and changing the color of the text.

We can bandaid it by doing something like this:

if (appearance) {
    appearance.titleTextAttributes = NSDictionary.dictionaryWithObjectForKey(
        color.ios,
        NSForegroundColorAttributeName
    );
}

However, this should be fixed at the framework level.

Let me know if you need any more information or testing.

@NathanWalker
Copy link
Contributor

@bmacdonald thanks for this additional detail, we'll work that into a 8.0.10 patch update by early next week.

@bmacdonald
Copy link

@NathanWalker
Thanks for the response. I will be more than happy to test the changes.

@NathanWalker
Copy link
Contributor

NathanWalker commented Sep 3, 2021

@bmacdonald 8.0.10 is published now with this fix; see reference pr below. Please let us know if you find anything else.

@bmacdonald
Copy link

bmacdonald commented Sep 6, 2021

@NathanWalker
I apologize for taking so long to get back to you. I've been out of town on vacation.

However, I have noticed another issue. If you have an action item, you can't set the color. Using my same steps above, change the action bar code to this:

<ActionBar title="My App" style="background-color:red;color:white">
    <ActionItem
        ios.systemIcon="4"
        ios.position="right"
    >
    </ActionItem>
</ActionBar>

You will notice the icon to the right is blue. It should be white. If you try to add a style property for color 'style="color:white"' the color does not change.

Before if you set the actionbar color, the buttons / actionitems would match the color you set on the actionbar.

@bmacdonald
Copy link

Looks like you might need to add back tintColor for both legacy and new style.

'navBar.tintColor = color.ios;'

@NathanWalker
Copy link
Contributor

@bmacdonald We just published 8.1.0-rc.0 which contains this fix now as well, thank you for the additional insights here. We are targeting a Thursday release so if anything else comes up just let us know.

@bmacdonald
Copy link

@NathanWalker
Thanks for the response.

Are you planning on doing an 8.0.11?

I've had several dev looking around to see if any other issues came up. So far, aside from the header issue, everything else appears to be working.

Is the 8.1.0 upgrade going to be a major upgrade like 7 and 8 (huge webpack changes etc)?

@NathanWalker
Copy link
Contributor

Yes this is published along with 8.0.11 now. https://github.com/NativeScript/NativeScript/releases/tag/8.0.11-core

@NathanWalker
Copy link
Contributor

8.1 update is just bug fixes and stabilization primarily so easy update.

@bmacdonald
Copy link

Thank you!
I've blocked off time to run some testing on 8.1.0. When it releases, I will switch focus on it.

If you have an update script to point at the RC packages to update, I'd be more than happy to take a look before it's released. I could probably throw a couple of dev at it to take a look.

@NathanWalker
Copy link
Contributor

NathanWalker commented Sep 7, 2021

@bmacdonald You can try the following anytime to have a look:

// install latest next cli (it's backwards compat so feel free to begin using it)
npm i -g nativescript@next

@nativescript/core: "rc" // will become 8.1

@nativescript/webpack: "rc"  // will become 5.0.0 final

@nativescript/ios: "8.1.0-alpha.7" // this one is at rc level from our testing, will become 8.1

// flavors
@nativescript/angular: "rc"  // will become 12.1 or 12.2 (depending on what makes it in time)

Would absolutely appreciate you having a look against your app and let us know if anything jumps out.

@bmacdonald
Copy link

I wanted to give you an update. I've had several developers testing the packages for 8.1 rc. I noticed the 8.1 cli was released so I had everyone update to that version. We have not found any issues with the 8.1 rc so far. We will continue to test for the rest of the day. If you don't hear back, then we have not found any issues.

Also, it looks like the 8.0.11 release is not available on NPM.

Thank you for your time. @NathanWalker @rigor789

@NathanWalker
Copy link
Contributor

Thank you @bmacdonald for update - I'll double check 8.0.11 and great to hear about 8.1!

@NathanWalker
Copy link
Contributor

8.0.11 is confirmed up now. We'll be publishing 8.1 tomorrow.

@bmacdonald
Copy link

Awesome!

We are about to start our regression testing. It will be a good time to sneak an upgrade in.

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

Successfully merging this pull request may close these issues.

4 participants