mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
Merge branch 'master' into doubleTap-location
This commit is contained in:
79
CHANGELOG.md
79
CHANGELOG.md
@@ -1,3 +1,42 @@
|
||||
## 6.4.1 (2020-02-17)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* flipLeft and flipRight on Android ([#8307](https://github.com/NativeScript/NativeScript/issues/8307)) ([c13b104](https://github.com/NativeScript/NativeScript/commit/c13b104))
|
||||
* **andoid:** crash when setting font on tab-item with no image ([2dd3bb2](https://github.com/NativeScript/NativeScript/commit/2dd3bb2))
|
||||
* **android:** tap-trip-item title disappearing ([cb8cea8](https://github.com/NativeScript/NativeScript/commit/cb8cea8))
|
||||
* **build:** Add platforms/android to NPM package ([#8312](https://github.com/NativeScript/NativeScript/issues/8312)) ([a644e40](https://github.com/NativeScript/NativeScript/commit/a644e40))
|
||||
|
||||
# 6.4.0 (2020-01-31)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* button textAlignment on IOS (UIButton) ([#8181](https://github.com/NativeScript/NativeScript/issues/8181)) ([05ef9b0](https://github.com/NativeScript/NativeScript/commit/05ef9b0))
|
||||
* **android:** crash on setting elevation on API21 ([#8269](https://github.com/NativeScript/NativeScript/issues/8269)) ([02763ec](https://github.com/NativeScript/NativeScript/commit/02763ec))
|
||||
* **android:** Request Timeout [#6523](https://github.com/NativeScript/NativeScript/issues/6523) ([#8194](https://github.com/NativeScript/NativeScript/issues/8194)) ([d65a2db](https://github.com/NativeScript/NativeScript/commit/d65a2db))
|
||||
* invoke done callback in image cache unit test for API Level < 20 ([#8267](https://github.com/NativeScript/NativeScript/issues/8267)) ([f293398](https://github.com/NativeScript/NativeScript/commit/f293398))
|
||||
* make integer type visible ([ea8a436](https://github.com/NativeScript/NativeScript/commit/ea8a436))
|
||||
* remove the password for TextField as well ([#8290](https://github.com/NativeScript/NativeScript/issues/8290)) ([0b50f3e](https://github.com/NativeScript/NativeScript/commit/0b50f3e))
|
||||
* return default tab background color when the background color is not explicitely set through css ([#8240](https://github.com/NativeScript/NativeScript/issues/8240)) ([8569b51](https://github.com/NativeScript/NativeScript/commit/8569b51))
|
||||
* **ios:** ActionBar style wrong after cancelled swipe back navigation ([#8252](https://github.com/NativeScript/NativeScript/issues/8252)) ([6133d6b](https://github.com/NativeScript/NativeScript/commit/6133d6b))
|
||||
* **ios/bottom-navigation:** move TabStrip items event emitting to selectedIndex changed handler ([#8160](https://github.com/NativeScript/NativeScript/issues/8160)) ([8550c32](https://github.com/NativeScript/NativeScript/commit/8550c32))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **html-view:** Additional properties for HtmlView component ([#8207](https://github.com/NativeScript/NativeScript/issues/8207)) ([9217094](https://github.com/NativeScript/NativeScript/commit/9217094))
|
||||
* **http:** better binary support & XHR support ([#7707](https://github.com/NativeScript/NativeScript/issues/7707)) ([e293367](https://github.com/NativeScript/NativeScript/commit/e293367))
|
||||
* **ios:** set preferredStatusBarStyle in Page VCs ([#8241](https://github.com/NativeScript/NativeScript/issues/8241)) ([4e48e68](https://github.com/NativeScript/NativeScript/commit/4e48e68))
|
||||
* add longPress state with UIGestureRecognizer (iOS) ([416f1c8](https://github.com/NativeScript/NativeScript/commit/416f1c8))
|
||||
* **textview:** added maxLines property ([#7943](https://github.com/NativeScript/NativeScript/issues/7943)) ([3c79ded](https://github.com/NativeScript/NativeScript/commit/3c79ded))
|
||||
* Add 3D rotation to view - takeover of PR# 5950 ([#8136](https://github.com/NativeScript/NativeScript/issues/8136)) ([e8f5ac8](https://github.com/NativeScript/NativeScript/commit/e8f5ac8)), closes [#8076](https://github.com/NativeScript/NativeScript/issues/8076) [#8041](https://github.com/NativeScript/NativeScript/issues/8041)
|
||||
* Add Android APIs usage list ([#8286](https://github.com/NativeScript/NativeScript/issues/8286)) ([f031f6f](https://github.com/NativeScript/NativeScript/commit/f031f6f))
|
||||
* add integer only keyboard type for text-field and for all editable text components ([954e1c6](https://github.com/NativeScript/NativeScript/commit/954e1c6))
|
||||
* Add iOS APIs usage list ([#8291](https://github.com/NativeScript/NativeScript/issues/8291)) ([3bb8a40](https://github.com/NativeScript/NativeScript/commit/3bb8a40))
|
||||
* Make css-tree the default parser ([ab4c389](https://github.com/NativeScript/NativeScript/commit/ab4c389))
|
||||
|
||||
## [6.3.2](https://github.com/NativeScript/NativeScript/compare/6.3.1...6.3.2) (2019-12-20)
|
||||
|
||||
|
||||
@@ -347,7 +386,7 @@ Before:
|
||||
* double tap: child tap -> parent tap -> child double tap -> parent double tap
|
||||
* tap: child tap -> parent tap
|
||||
|
||||
After:
|
||||
After:
|
||||
* **iOS**:
|
||||
* double tap: child double tap
|
||||
* tap: child tap
|
||||
@@ -679,7 +718,7 @@ Move event handlers accordingly.
|
||||
* **android:** NativeScript core framework now extends support library APIs versus native framework classes as per Google's latest guidelines ([#6129](https://github.com/NativeScript/NativeScript/issues/6129)) ([cf034dd](https://github.com/NativeScript/NativeScript/commit/cf034dd)):
|
||||
- NativeScript activities now extend `android.support.v7.app.AppCompatActivity` (vs android.app.Activity)
|
||||
- NativeScript fragments now extend `android.support.v4.app.Fragment` (vs android.app.Fragment)
|
||||
- NativeScript now works internally with `android.support.v4.app.FragmentManager` (vs android.app.FragmentManager)
|
||||
- NativeScript now works internally with `android.support.v4.app.FragmentManager` (vs android.app.FragmentManager)
|
||||
|
||||
The implications of these changes should be mostly transparent to the developer except for the fact that the support library Fragment / FragmentManager work with Animation APIs versus Animator APIs.
|
||||
|
||||
@@ -722,7 +761,7 @@ let wrapLayout: LayoutBase; // or let wrapLayout: WrapLayout;
|
||||
|
||||
export function pageLoaded(args: EventData) {
|
||||
const page = <Page>args.object;
|
||||
wrapLayout = page.getViewById<LayoutBase>("wrapLayout"); // or wrapLayout = page.getViewById<WrapLayout>("wrapLayout");
|
||||
wrapLayout = page.getViewById<LayoutBase>("wrapLayout"); // or wrapLayout = page.getViewById<WrapLayout>("wrapLayout");
|
||||
}
|
||||
```
|
||||
* **android:** change androidOffscreenTabLimit to 1 when using bottom tabs of tab-view([#6476](https://github.com/NativeScript/NativeScript/issues/6476)) ([371fc9b](https://github.com/NativeScript/NativeScript/commit/371fc9b))
|
||||
@@ -807,7 +846,7 @@ The change is that now if these widgets touch the edge of the safe area, they wi
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
* **typings:**
|
||||
* **typings:**
|
||||
* There is no longer added `I` prefix in the names of the interfaces. For example, `android.view.IMenuItem` is now `android.view.MenuItem`. This matches the original name of the interface in the Android framework.
|
||||
* We are now generating only **public** methods, so all the methods which you override when extending Android class should be **public**.
|
||||
* You need to use **Array\<string>** (lowercase **string**) instead of **Array\<String>** (uppercase **String**) when overriding a method accepting string array type.
|
||||
@@ -1004,7 +1043,7 @@ our @CSSType decorated classes will now have to be marked with @CSSType.
|
||||
- [(# 4582)](https://github.com/NativeScript/NativeScript/issues/4582) IOS: Label with formatted text and theme classes crashes
|
||||
- [(# 4138)](https://github.com/NativeScript/NativeScript/issues/4138) Cannot change TabView icon
|
||||
- [(# 4419)](https://github.com/NativeScript/NativeScript/issues/4419) Debugger.js exception for HTTP requests with no Content-Type
|
||||
- [(# 4650)](https://github.com/NativeScript/NativeScript/issues/4650) Image replacement is not respected during tns run android
|
||||
- [(# 4650)](https://github.com/NativeScript/NativeScript/issues/4650) Image replacement is not respected during tns run android
|
||||
- [(# 3963)](https://github.com/NativeScript/NativeScript/issues/3963) ListView multiple item templates do not work inside a TabView
|
||||
- [(# 4647)](https://github.com/NativeScript/NativeScript/issues/4647) Rename utils.ad.getPalleteColor to getPaletteColor
|
||||
- [(# 4725)](https://github.com/NativeScript/NativeScript/pull/4725) Remove ListView selected state when rowHeight is set
|
||||
@@ -1017,18 +1056,18 @@ our @CSSType decorated classes will now have to be marked with @CSSType.
|
||||
## 3.1.1 (2017, August 08)
|
||||
|
||||
### Fixed
|
||||
- [(# 4514)](https://github.com/NativeScript/NativeScript/issues/4514) IOS: Text/xml content type not treated as text
|
||||
- [(# 4450)](https://github.com/NativeScript/NativeScript/issues/4450) IOS: TNS 3.1 breaks background-color through css binding
|
||||
- [(# 4443)](https://github.com/NativeScript/NativeScript/issues/4443) IOS: Can't load local files in a WebView on device
|
||||
- [(# 4514)](https://github.com/NativeScript/NativeScript/issues/4514) IOS: Text/xml content type not treated as text
|
||||
- [(# 4450)](https://github.com/NativeScript/NativeScript/issues/4450) IOS: TNS 3.1 breaks background-color through css binding
|
||||
- [(# 4443)](https://github.com/NativeScript/NativeScript/issues/4443) IOS: Can't load local files in a WebView on device
|
||||
- [(# 4415)](https://github.com/NativeScript/NativeScript/issues/4415) Style error when setting background after upgrading to NS 3
|
||||
- [(# 4342)](https://github.com/NativeScript/NativeScript/issues/4342) Unable to change the fontWeight.
|
||||
- [(# 4322)](https://github.com/NativeScript/NativeScript/issues/4322) Flashing border on scroll within ListView on Android when border-radius is applied
|
||||
- [(# 4283)](https://github.com/NativeScript/NativeScript/issues/4283) IOS: ActionBar will appear broken when internet sharing bar is displayed
|
||||
- [(# 4046)](https://github.com/NativeScript/NativeScript/issues/4046) Animating a view is broken and freezes the animated properties
|
||||
- [(# 4342)](https://github.com/NativeScript/NativeScript/issues/4342) Unable to change the fontWeight.
|
||||
- [(# 4322)](https://github.com/NativeScript/NativeScript/issues/4322) Flashing border on scroll within ListView on Android when border-radius is applied
|
||||
- [(# 4283)](https://github.com/NativeScript/NativeScript/issues/4283) IOS: ActionBar will appear broken when internet sharing bar is displayed
|
||||
- [(# 4046)](https://github.com/NativeScript/NativeScript/issues/4046) Animating a view is broken and freezes the animated properties
|
||||
|
||||
### New
|
||||
- [(# 4522)](https://github.com/NativeScript/NativeScript/issues/4522) Allow toggling of ScrollBar indicators on ScrollView
|
||||
- [(# 2740)](https://github.com/NativeScript/NativeScript/issues/2740) Improved ActionBar CSS Support
|
||||
- [(# 4522)](https://github.com/NativeScript/NativeScript/issues/4522) Allow toggling of ScrollBar indicators on ScrollView
|
||||
- [(# 2740)](https://github.com/NativeScript/NativeScript/issues/2740) Improved ActionBar CSS Support
|
||||
- [(# 1664)](https://github.com/NativeScript/NativeScript/issues/1664) Implemented css line-height property
|
||||
|
||||
## 3.1.0 (2017, June 22)
|
||||
@@ -1324,7 +1363,7 @@ A full list of breaking changes could be found [here](https://github.com/NativeS
|
||||
|
||||
- [(#2344)](https://github.com/NativeScript/NativeScript/pull/2344) Action bar doesn't handle events properly when a custom button
|
||||
|
||||
- [(#1655)](https://github.com/nativescript/nativescript/issues/1655) Added CSS not cascadded after screen is built
|
||||
- [(#1655)](https://github.com/nativescript/nativescript/issues/1655) Added CSS not cascadded after screen is built
|
||||
|
||||
- [(#2310)](https://github.com/NativeScript/NativeScript/pull/2310) Sorting issue with Css Selectors with same specificity.
|
||||
|
||||
@@ -1356,7 +1395,7 @@ A full list of breaking changes could be found [here](https://github.com/NativeS
|
||||
|
||||
- [(#2191)](https://github.com/NativeScript/NativeScript/pull/2191) SegmentedBar unbound items not firing selectedIndex change events
|
||||
|
||||
- [(#2177)](https://github.com/NativeScript/NativeScript/issues/2177) iOS CSS Animation rotate() do not reset the value after 360 degrees rotation
|
||||
- [(#2177)](https://github.com/NativeScript/NativeScript/issues/2177) iOS CSS Animation rotate() do not reset the value after 360 degrees rotation
|
||||
|
||||
- [(#2161)](https://github.com/NativeScript/NativeScript/issues/2161) TranslateX and Animate in iOS strange behaviour on 2.0
|
||||
|
||||
@@ -1416,7 +1455,7 @@ A full list of breaking changes could be found [here](https://github.com/NativeS
|
||||
|
||||
- [(#2126)](https://github.com/NativeScript/NativeScript/pull/2126) zIndex fixed for Android buttons
|
||||
|
||||
- [(#2113)](https://github.com/NativeScript/NativeScript/issues/2113) Panning gesture in Android creates non-smooth delta coordinates.
|
||||
- [(#2113)](https://github.com/NativeScript/NativeScript/issues/2113) Panning gesture in Android creates non-smooth delta coordinates.
|
||||
|
||||
- [(#2100)](https://github.com/NativeScript/NativeScript/pull/2100) Fix navigatedFrom event raised when Activity is destroyed without act…
|
||||
|
||||
@@ -1617,7 +1656,7 @@ A full list of breaking changes could be found [here](https://github.com/NativeS
|
||||
|
||||
- [(#1275)](https://github.com/NativeScript/NativeScript/issues/1275) ActionBar disappears when app closes with back button
|
||||
|
||||
- [(#1240)](https://github.com/NativeScript/NativeScript/issues/1240) Android 5.x: setting View.opacity (setAlpha) removes its background
|
||||
- [(#1240)](https://github.com/NativeScript/NativeScript/issues/1240) Android 5.x: setting View.opacity (setAlpha) removes its background
|
||||
|
||||
- [(#1232)](https://github.com/NativeScript/NativeScript/issues/1232) WrapLayout crashes when itemWidth value is too high
|
||||
|
||||
@@ -2009,7 +2048,7 @@ animation1.play().then(()=>console.log("Finished"));
|
||||
|
||||
- [(#541)](https://github.com/NativeScript/NativeScript/issues/541) Make TabViewItem properties data-bindable
|
||||
|
||||
- [(#530)](https://github.com/NativeScript/NativeScript/issues/530) Ability to set text size of searchBar
|
||||
- [(#530)](https://github.com/NativeScript/NativeScript/issues/530) Ability to set text size of searchBar
|
||||
|
||||
- [(#481)](https://github.com/NativeScript/NativeScript/issues/481) Support padding on TextField and Button elements
|
||||
|
||||
@@ -2172,7 +2211,7 @@ application.ios.removeNotificationObserver(observer, UIDeviceBatteryLevelDidChan
|
||||
* iOS dialog OK button now appears last.
|
||||
|
||||
### Breaking changes
|
||||
* `image-cache` now stores native image instances, i.e., `android.graphics.Bitmap` or `UIImage`.
|
||||
* `image-cache` now stores native image instances, i.e., `android.graphics.Bitmap` or `UIImage`.
|
||||
* `Image.src` property is now of type `any` and can accept either a string containing an image url or a native image instance.
|
||||
* Gesture-related enum values changed to start with a small letter in order to be consistent with all other enums within NativeScript. For example, "gesturesModule.GestureType.Tap" should be used like "gesturesModule.GestureType.tap".
|
||||
* `knownEvents` modules within all UI controls are removed and replaced with a static string values. In that case, all possible events will be visible through the inheritance tree. These static strings have an `Event` suffix. Every place where `viewModule.knownEvents.loaded` is used should be changed to `viewModule.View.loadedEvent` or `pageModule.Page.loadedEvent`. This change is relevant to code-behind only (xml declaration will not be affected).
|
||||
|
||||
@@ -2934,7 +2934,7 @@ export abstract class ViewBase extends Observable {
|
||||
// (undocumented)
|
||||
_setupAsRootView(context: any): void;
|
||||
_setupUI(context: any /* android.content.Context */, atIndex?: number): void;
|
||||
_shouldDelayLoad(): boolean;
|
||||
_shouldDelayLayout(): boolean;
|
||||
showModal(moduleName: string, modalOptions: ShowModalOptions): ViewBase;
|
||||
showModal(view: ViewBase, modalOptions: ShowModalOptions): ViewBase;
|
||||
public readonly style: Style;
|
||||
|
||||
@@ -13,6 +13,8 @@ DIST=dist;
|
||||
ROOT_DIR=$(cd `dirname $0` && pwd)/..;
|
||||
cd "$ROOT_DIR"
|
||||
|
||||
# Aways execute npx tsc from repo root to use the local typescript
|
||||
npx tsc -v
|
||||
npx tsc -p nativescript-core/tsconfig.barrels.json
|
||||
|
||||
FROM="temp/dts-out"
|
||||
|
||||
@@ -11,12 +11,15 @@ set -e
|
||||
|
||||
## Pack tns-core-modules
|
||||
(
|
||||
cd "dist/tns-core-modules"
|
||||
|
||||
echo 'Run tsc ...'
|
||||
npx tsc
|
||||
# Aways execute npx tsc from repo root to use the local typescript
|
||||
echo 'TypeScript transpile...'
|
||||
npx tsc -v
|
||||
npx tsc -p "dist/tns-core-modules"
|
||||
|
||||
|
||||
echo 'NPM packing ...'
|
||||
cd "dist/tns-core-modules"
|
||||
TGZ="$(npm pack)"
|
||||
mv "$TGZ" "../$TGZ"
|
||||
)
|
||||
@@ -65,11 +65,14 @@ mkdir -p "$DIST"
|
||||
npx ncp README.md "$DIST"/"$PACKAGE"/README.md
|
||||
|
||||
(
|
||||
echo 'TypeScript transpile...'
|
||||
cd "$DIST/$PACKAGE"
|
||||
npm install
|
||||
npx tsc
|
||||
)
|
||||
|
||||
# Aways execute npx tsc from repo root to use the local typescript
|
||||
echo 'TypeScript transpile...'
|
||||
npx tsc -v
|
||||
npx tsc -p "$DIST/$PACKAGE"
|
||||
|
||||
echo "Clearing typescript definitions from private APIs..."
|
||||
npx ts-node --project ./build/tsconfig.json build/clear-private-definitions "$DIST/$PACKAGE"
|
||||
|
||||
@@ -13,9 +13,9 @@
|
||||
"license": "SEE LICENSE IN <your-license-filename>",
|
||||
"repository": "<fill-your-repository-here>",
|
||||
"dependencies": {
|
||||
"@nativescript/core": "file:../../dist/nativescript-core-6.3.0.tgz",
|
||||
"@nativescript/core": "file:../../dist/nativescript-core-6.5.0.tgz",
|
||||
"nativescript-theme-core": "~1.0.6",
|
||||
"tns-core-modules": "file:../../dist/tns-core-modules-6.3.0.tgz"
|
||||
"tns-core-modules": "file:../../dist/tns-core-modules-6.5.0.tgz"
|
||||
},
|
||||
"devDependencies": {
|
||||
"nativescript-dev-webpack": "~1.2.0",
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"main": "index",
|
||||
"types": "index.d.ts",
|
||||
"description": "Telerik NativeScript Core Modules",
|
||||
"version": "6.3.0",
|
||||
"version": "6.5.0",
|
||||
"homepage": "https://www.nativescript.org",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -13,6 +13,7 @@
|
||||
"**/*.d.ts",
|
||||
"**/*.js",
|
||||
"**/platforms/ios/**",
|
||||
"**/platforms/android/**",
|
||||
"**/package.json",
|
||||
"!org.nativescript.widgets.d.ts"
|
||||
],
|
||||
@@ -59,4 +60,4 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -391,7 +391,7 @@ export class BottomNavigation extends TabNavigationBase {
|
||||
if (this._manager && this._manager.isDestroyed()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
this._attachedToWindow = true;
|
||||
this.changeTab(this.selectedIndex);
|
||||
}
|
||||
@@ -614,6 +614,9 @@ export class BottomNavigation extends TabNavigationBase {
|
||||
|
||||
private getIcon(tabStripItem: TabStripItem): android.graphics.drawable.BitmapDrawable {
|
||||
const iconSource = tabStripItem.image && tabStripItem.image.src;
|
||||
if (!iconSource) {
|
||||
return null;
|
||||
}
|
||||
|
||||
let is: ImageSource;
|
||||
if (isFontIconURI(iconSource)) {
|
||||
@@ -705,7 +708,10 @@ export class BottomNavigation extends TabNavigationBase {
|
||||
}
|
||||
|
||||
public setTabBarItemFontInternal(tabStripItem: TabStripItem, value: Font): void {
|
||||
tabStripItem.nativeViewProtected.setTextSize(value.fontSize);
|
||||
if (value.fontSize) {
|
||||
tabStripItem.nativeViewProtected.setTextSize(value.fontSize);
|
||||
}
|
||||
|
||||
tabStripItem.nativeViewProtected.setTypeface(value.getAndroidTypeface());
|
||||
}
|
||||
|
||||
|
||||
@@ -377,7 +377,7 @@ export class BottomNavigation extends TabNavigationBase {
|
||||
|
||||
public setTabBarItemColor(tabStripItem: TabStripItem, value: UIColor | Color): void {
|
||||
const states = getTitleAttributesForStates(tabStripItem.label);
|
||||
applyStatesToItem(tabStripItem.nativeView, states);
|
||||
applyStatesToItem(tabStripItem.nativeView, states, this.viewController.tabBar);
|
||||
}
|
||||
|
||||
public setTabBarIconColor(tabStripItem: TabStripItem, value: UIColor | Color): void {
|
||||
@@ -389,7 +389,7 @@ export class BottomNavigation extends TabNavigationBase {
|
||||
|
||||
public setTabBarItemFontInternal(tabStripItem: TabStripItem, value: Font): void {
|
||||
const states = getTitleAttributesForStates(tabStripItem.label);
|
||||
applyStatesToItem(tabStripItem.nativeView, states);
|
||||
applyStatesToItem(tabStripItem.nativeView, states, this.viewController.tabBar);
|
||||
}
|
||||
|
||||
public setTabBarItemTextTransform(tabStripItem: TabStripItem, value: TextTransform): void {
|
||||
@@ -519,7 +519,7 @@ export class BottomNavigation extends TabNavigationBase {
|
||||
updateTitleAndIconPositions(tabStripItem, tabBarItem, controller);
|
||||
|
||||
const states = getTitleAttributesForStates(tabStripItem.label);
|
||||
applyStatesToItem(tabBarItem, states);
|
||||
applyStatesToItem(tabBarItem, states, this.viewController.tabBar);
|
||||
|
||||
controller.tabBarItem = tabBarItem;
|
||||
tabStripItem._index = i;
|
||||
@@ -719,11 +719,20 @@ function getTitleAttributesForStates(view: View): TabStates {
|
||||
return result;
|
||||
}
|
||||
|
||||
function applyStatesToItem(item: UITabBarItem, states: TabStates) {
|
||||
function applyStatesToItem(item: UITabBarItem, states: TabStates, tabBar: UITabBar) {
|
||||
if (!states) {
|
||||
return;
|
||||
}
|
||||
|
||||
item.setTitleTextAttributesForState(states.normalState, UIControlState.Normal);
|
||||
item.setTitleTextAttributesForState(states.selectedState, UIControlState.Selected);
|
||||
|
||||
// there's a bug when setting the item color on ios 13 if there's no background set to the tabstrip
|
||||
// https://books.google.bg/books?id=99_BDwAAQBAJ&q=tabBar.unselectedItemTintColor
|
||||
// to fix the above issue we are applying the selected fix only for the case, when there is no background set
|
||||
// in that case we have the following known issue:
|
||||
// we will set the color to all unselected items, so you won't be able to set different colors for the different not selected items
|
||||
if (!tabBar.barTintColor && states.normalState[UITextAttributeTextColor] && (majorVersion > 9)) {
|
||||
tabBar.unselectedItemTintColor = states.normalState[UITextAttributeTextColor];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -474,7 +474,7 @@ export abstract class ViewBase extends Observable {
|
||||
* When returning true the callLoaded method will be run in setTimeout
|
||||
* Method is intended to be overridden by inheritors and used as "protected"
|
||||
*/
|
||||
_shouldDelayLoad(): boolean;
|
||||
_shouldDelayLayout(): boolean;
|
||||
|
||||
/**
|
||||
* @private
|
||||
|
||||
@@ -561,12 +561,24 @@ export abstract class ViewBase extends Observable implements ViewBaseDefinition
|
||||
}
|
||||
}
|
||||
|
||||
private performLayout(currentRun = 0) {
|
||||
// if there's an animation in progress we need to delay the layout
|
||||
// we've added a guard of 5000 milliseconds execution
|
||||
// to make sure that the layout will happen even if the animation haven't finished in 5 seconds
|
||||
if (this._shouldDelayLayout() && currentRun < 100) {
|
||||
setTimeout(() => this.performLayout(currentRun), currentRun);
|
||||
currentRun++;
|
||||
} else {
|
||||
this.parent.requestLayout();
|
||||
}
|
||||
}
|
||||
|
||||
@profile
|
||||
public requestLayout(): void {
|
||||
// Default implementation for non View instances (like TabViewItem).
|
||||
const parent = this.parent;
|
||||
if (parent) {
|
||||
parent.requestLayout();
|
||||
this.performLayout();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -615,15 +627,11 @@ export abstract class ViewBase extends Observable implements ViewBaseDefinition
|
||||
|
||||
public loadView(view: ViewBase): void {
|
||||
if (view && !view.isLoaded) {
|
||||
if (this._shouldDelayLoad()) {
|
||||
setTimeout(() => view.callLoaded());
|
||||
} else {
|
||||
view.callLoaded();
|
||||
}
|
||||
view.callLoaded();
|
||||
}
|
||||
}
|
||||
|
||||
public _shouldDelayLoad(): boolean {
|
||||
public _shouldDelayLayout(): boolean {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -145,7 +145,7 @@ export function _setAndroidFragmentTransitions(
|
||||
if (currentFragmentNeedsDifferentAnimation) {
|
||||
setupCurrentFragmentExplodeTransition(navigationTransition, currentEntry);
|
||||
}
|
||||
} else if (name === "flip") {
|
||||
} else if (name.indexOf("flip") === 0) {
|
||||
const direction = name.substr("flip".length) || "right"; //Extract the direction from the string
|
||||
const flipTransition = new FlipTransition(direction, navigationTransition.duration, navigationTransition.curve);
|
||||
|
||||
|
||||
@@ -348,7 +348,7 @@ export class Page extends PageBase {
|
||||
//
|
||||
}
|
||||
|
||||
public _shouldDelayLoad(): boolean {
|
||||
public _shouldDelayLayout(): boolean {
|
||||
return this._frame && this._frame._animationInProgress;
|
||||
}
|
||||
|
||||
|
||||
@@ -127,7 +127,7 @@ export class TabStripItem extends View implements TabStripItemDefinition, AddChi
|
||||
const parent = <TabStrip>this.parent;
|
||||
const tabStripParent = parent && <TabNavigationBase>parent.parent;
|
||||
|
||||
return tabStripParent && (<any>tabStripParent).setTabBarIconColor(this, args.value);
|
||||
return tabStripParent && tabStripParent.setTabBarIconColor(this, args.value);
|
||||
});
|
||||
this.image.style.on("colorChange", this._imageColorHandler);
|
||||
|
||||
@@ -135,7 +135,7 @@ export class TabStripItem extends View implements TabStripItemDefinition, AddChi
|
||||
const parent = <TabStrip>this.parent;
|
||||
const tabStripParent = parent && <TabNavigationBase>parent.parent;
|
||||
|
||||
return tabStripParent && (<any>tabStripParent).setTabBarIconColor(this, args.value);
|
||||
return tabStripParent && tabStripParent.setTabBarIconColor(this, args.value);
|
||||
});
|
||||
this.image.style.on("fontInternalChange", this._imageFontHandler);
|
||||
|
||||
@@ -143,7 +143,7 @@ export class TabStripItem extends View implements TabStripItemDefinition, AddChi
|
||||
const parent = <TabStrip>this.parent;
|
||||
const tabStripParent = parent && <TabNavigationBase>parent.parent;
|
||||
|
||||
return tabStripParent && (<any>tabStripParent).setTabBarIconColor(this, args.value);
|
||||
return tabStripParent && tabStripParent.setTabBarIconColor(this, args.value);
|
||||
});
|
||||
this.image.on("srcChange", this._imageSrcHandler);
|
||||
}
|
||||
|
||||
@@ -689,6 +689,9 @@ export class Tabs extends TabsBase {
|
||||
|
||||
private getIcon(tabStripItem: TabStripItem): android.graphics.drawable.BitmapDrawable {
|
||||
const iconSource = tabStripItem.image && tabStripItem.image.src;
|
||||
if (!iconSource) {
|
||||
return null;
|
||||
}
|
||||
|
||||
let is: ImageSource;
|
||||
if (isFontIconURI(iconSource)) {
|
||||
@@ -814,12 +817,14 @@ export class Tabs extends TabsBase {
|
||||
const tabBarItem = this._tabsBar.getViewForItemAt(index);
|
||||
const imgView = <android.widget.ImageView>tabBarItem.getChildAt(0);
|
||||
const drawable = this.getIcon(tabStripItem);
|
||||
|
||||
|
||||
imgView.setImageDrawable(drawable);
|
||||
}
|
||||
|
||||
public setTabBarItemFontInternal(tabStripItem: TabStripItem, value: Font): void {
|
||||
tabStripItem.nativeViewProtected.setTextSize(value.fontSize);
|
||||
if (value.fontSize) {
|
||||
tabStripItem.nativeViewProtected.setTextSize(value.fontSize);
|
||||
}
|
||||
tabStripItem.nativeViewProtected.setTypeface(value.getAndroidTypeface());
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import { TabContentItem } from "../tab-navigation-base/tab-content-item";
|
||||
import { TabStrip } from "../tab-navigation-base/tab-strip";
|
||||
import { TabStripItem } from "../tab-navigation-base/tab-strip-item";
|
||||
import { TextTransform } from "../text-base";
|
||||
import { TextTransform, ViewBase } from "../text-base";
|
||||
|
||||
// Requires
|
||||
import { Color } from "../../color";
|
||||
@@ -873,6 +873,9 @@ export class Tabs extends TabsBase {
|
||||
// TODO: investigate why this call is necessary to actually toggle item appearance
|
||||
this.viewController.tabBar.sizeToFit();
|
||||
this.tabStrip.setNativeView(this.viewController.tabBar);
|
||||
if (this.selectedIndex) {
|
||||
this.viewController.tabBar.setSelectedItemAnimated(this.tabBarItems[this.selectedIndex], false);
|
||||
}
|
||||
}
|
||||
|
||||
// const length = items ? items.length : 0;
|
||||
@@ -1066,6 +1069,17 @@ export class Tabs extends TabsBase {
|
||||
this._ios.tabBar.tintColor = nativeColor;
|
||||
}
|
||||
|
||||
private visitFrames(view: ViewBase, operation: (frame: Frame) => {}) {
|
||||
if (view instanceof Frame) {
|
||||
operation(view);
|
||||
}
|
||||
view.eachChild(child => {
|
||||
this.visitFrames(child, operation);
|
||||
|
||||
return true;
|
||||
});
|
||||
}
|
||||
|
||||
[selectedIndexProperty.setNative](value: number) {
|
||||
// TODO
|
||||
// if (traceEnabled()) {
|
||||
@@ -1092,17 +1106,11 @@ export class Tabs extends TabsBase {
|
||||
|
||||
this._currentNativeSelectedIndex = value;
|
||||
|
||||
let itemControllerOwner = null;
|
||||
if (itemController._owner) {
|
||||
let itemControllerOwner = <Frame>itemController._owner.get();
|
||||
// do not load new views while the animation is in progress https://stackoverflow.com/a/47031524/613113
|
||||
itemControllerOwner._animationInProgress = true;
|
||||
}
|
||||
// do not make layout changes while the animation is in progress https://stackoverflow.com/a/47031524/613113
|
||||
this.visitFrames(item, frame => frame._animationInProgress = true);
|
||||
|
||||
this.viewController.setViewControllersDirectionAnimatedCompletion(controllers, navigationDirection, true, (finished: boolean) => {
|
||||
if (itemControllerOwner) {
|
||||
itemControllerOwner._animationInProgress = false;
|
||||
}
|
||||
this.visitFrames(item, frame => frame._animationInProgress = false);
|
||||
if (finished) {
|
||||
// HACK: UIPageViewController fix; see https://stackoverflow.com/a/17330606
|
||||
invokeOnRunLoop(() => this.viewController.setViewControllersDirectionAnimatedCompletion(controllers, navigationDirection, false, null));
|
||||
|
||||
@@ -177,7 +177,7 @@ export class XMLHttpRequest {
|
||||
}
|
||||
|
||||
public addEventListener(eventName: string, handler: Function) {
|
||||
if (["abort", "error", "load", "loadend", "loadstart", "progress"].indexOf(eventName) === -1) {
|
||||
if (["abort", "error", "load", "loadend", "loadstart", "progress", "readystatechange"].indexOf(eventName) === -1) {
|
||||
throw new Error("Event not supported: " + eventName);
|
||||
}
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
"tslint": "^5.4.3",
|
||||
"typedoc": "^0.13.0",
|
||||
"typedoc-plugin-external-module-name": "git://github.com/PanayotCankov/typedoc-plugin-external-module-name.git#with-js",
|
||||
"typescript": "^3.1.6"
|
||||
"typescript": "^3.7.5"
|
||||
},
|
||||
"scripts": {
|
||||
"setup": "npm run build-core && npm run build-compat && npm run setup-link",
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"main": "index",
|
||||
"types": "index.d.ts",
|
||||
"description": "Telerik NativeScript Core Modules",
|
||||
"version": "6.3.0",
|
||||
"version": "6.5.0",
|
||||
"homepage": "https://www.nativescript.org",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "tns-core-modules-widgets",
|
||||
"version": "6.3.0",
|
||||
"version": "6.5.0",
|
||||
"description": "Native widgets used in the NativeScript framework.",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "tns-platform-declarations",
|
||||
"version": "6.3.0",
|
||||
"version": "6.5.0",
|
||||
"description": "Platform-specific TypeScript declarations for NativeScript for accessing native objects",
|
||||
"main": "",
|
||||
"scripts": {
|
||||
@@ -32,6 +32,6 @@
|
||||
},
|
||||
"homepage": "https://github.com/NativeScript/NativeScript#readme",
|
||||
"devDependencies": {
|
||||
"typescript": "^3.1.6"
|
||||
"typescript": "^3.7.5"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user