FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

feat(): local icon handling in actionbar and tabview by MartoYankov · Pull Request #7009 · NativeScript/NativeScript · GitHub

feat(): local icon handling in actionbar and tabview - #7009

Merged
SvetoslavTsenov merged 3 commits into
masterfrom
myankov/android-icons
Mar 12, 2019
Merged

SvetoslavTsenov merged 3 commits into
masterfrom
myankov/android-icons

Conversation

Copy link
Copy Markdown
Contributor

PR Checklist

What is the current behavior?

On Android, icons rendered in TabView and Actionbar are not scaled correctly due to the use of a deprecated native Android constructor https://developer.android.com/reference/android/graphics/drawable/BitmapDrawable#BitmapDrawable(android.graphics.Bitmap).

On iOS, there was no property on ActionBar to specify icon rendering mode and it is hard coded to alwaysOriginal, which made the use of image icons limited.

What is the new behavior?

Fixed the Android issue with the use of the new constructor.

Added iosIconRenderingMode on ActionBar. To avoid breaking changes, on ActionBar this property defaults to alwaysOriginal and on TabView, it defaults to automatic. We should probably change this for 6.0.

Fixes #5887

Tests

  • Added 2 new e2e tests for Action Bar - actLocalIcons and actResIcons.
  • Added 1 new e2e test for TabView - tab-view-icons-local

MartoYankov added e2e test needed docs needed Additional documentation on this issue/PR is needed labels Mar 8, 2019
MartoYankov self-assigned this Mar 8, 2019
cla-bot Bot added the cla: yes label Mar 8, 2019
ghost added the in progress label Mar 8, 2019
MartoYankov force-pushed the myankov/android-icons branch from 0d711d3 to 4206704 Compare March 8, 2019 14:09
ghost assigned SvetoslavTsenov Mar 8, 2019
MartoYankov force-pushed the myankov/android-icons branch from c69fe70 to 89c96c8 Compare March 11, 2019 11:48

Copy link
Copy Markdown
Contributor

test ios#/tns-dist/tns-ios/PR/e34f49eb5af64946cf1257bd2b39760518235427/tns-ios.tgz

} else if (item.icon) {
const img = loadActionIconFromFileOrResource(item.icon);
barButtonItem = UIBarButtonItem.alloc().initWithImageStyleTargetAction(img, UIBarButtonItemStyle.Plain, tapHandler, "tap");
const image = img.imageWithRenderingMode(this._getIconRenderingMode());

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Guard the img usage as here

?

SvetoslavTsenov merged commit cd66300 into master Mar 12, 2019
ghost removed the in progress label Mar 12, 2019
SvetoslavTsenov deleted the myankov/android-icons branch March 12, 2019 13:08

lock Bot commented Mar 17, 2020

Copy link
Copy Markdown

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

lock Bot locked and limited conversation to collaborators Mar 17, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

cla: yes docs needed Additional documentation on this issue/PR is needed

Projects

Development

Successfully merging this pull request may close these issues.

Android uses deprecated method to create Drawable from Bitmap

3 participants


Back | FazBrowse Home | New Git URL