@nativescript/core 9.0.0-next-09-27-2025-18063560861 → 9.0.0-next-10-06-2025-18277360121
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/platforms/android/include.gradle +51 -0
- package/platforms/android/java/org/nativescript/Process.java +59 -0
- package/platforms/android/java/org/nativescript/widgets/AbsoluteLayout.java +88 -0
- package/platforms/android/java/org/nativescript/widgets/AnimatorHelper.java +61 -0
- package/platforms/android/java/org/nativescript/widgets/Async.java +1356 -0
- package/platforms/android/java/org/nativescript/widgets/BorderDrawable.java +936 -0
- package/platforms/android/java/org/nativescript/widgets/BottomNavigationBar.java +308 -0
- package/platforms/android/java/org/nativescript/widgets/BoxShadowDrawable.java +175 -0
- package/platforms/android/java/org/nativescript/widgets/CSSValue.java +34 -0
- package/platforms/android/java/org/nativescript/widgets/CommonLayoutParams.java +456 -0
- package/platforms/android/java/org/nativescript/widgets/ContentLayout.java +85 -0
- package/platforms/android/java/org/nativescript/widgets/CustomTransition.java +135 -0
- package/platforms/android/java/org/nativescript/widgets/CustomTypefaceSpan.java +44 -0
- package/platforms/android/java/org/nativescript/widgets/Dock.java +15 -0
- package/platforms/android/java/org/nativescript/widgets/DockLayout.java +185 -0
- package/platforms/android/java/org/nativescript/widgets/FileHelper.java +815 -0
- package/platforms/android/java/org/nativescript/widgets/FlexLine.java +177 -0
- package/platforms/android/java/org/nativescript/widgets/FlexboxLayout.java +2769 -0
- package/platforms/android/java/org/nativescript/widgets/FragmentBase.java +14 -0
- package/platforms/android/java/org/nativescript/widgets/GridLayout.java +1172 -0
- package/platforms/android/java/org/nativescript/widgets/GridUnitType.java +10 -0
- package/platforms/android/java/org/nativescript/widgets/HorizontalScrollView.java +256 -0
- package/platforms/android/java/org/nativescript/widgets/ImageView.java +423 -0
- package/platforms/android/java/org/nativescript/widgets/ItemSpec.java +56 -0
- package/platforms/android/java/org/nativescript/widgets/LayoutBase.java +98 -0
- package/platforms/android/java/org/nativescript/widgets/LinearGradientDefinition.java +46 -0
- package/platforms/android/java/org/nativescript/widgets/Orientation.java +9 -0
- package/platforms/android/java/org/nativescript/widgets/OriginPoint.java +74 -0
- package/platforms/android/java/org/nativescript/widgets/ScrollSavedState.java +63 -0
- package/platforms/android/java/org/nativescript/widgets/SegmentedBarColorDrawable.java +27 -0
- package/platforms/android/java/org/nativescript/widgets/StackLayout.java +231 -0
- package/platforms/android/java/org/nativescript/widgets/StyleableTextView.java +50 -0
- package/platforms/android/java/org/nativescript/widgets/TabIconRenderingMode.java +6 -0
- package/platforms/android/java/org/nativescript/widgets/TabItemSpec.java +15 -0
- package/platforms/android/java/org/nativescript/widgets/TabLayout.java +451 -0
- package/platforms/android/java/org/nativescript/widgets/TabStrip.java +294 -0
- package/platforms/android/java/org/nativescript/widgets/TabViewPager.java +64 -0
- package/platforms/android/java/org/nativescript/widgets/TabsBar.java +443 -0
- package/platforms/android/java/org/nativescript/widgets/Utils.java +546 -0
- package/platforms/android/java/org/nativescript/widgets/VerticalScrollView.java +258 -0
- package/platforms/android/java/org/nativescript/widgets/ViewHelper.java +564 -0
- package/platforms/android/java/org/nativescript/widgets/WrapLayout.java +252 -0
- package/platforms/android/java/org/nativescript/widgets/image/AsyncTask.java +679 -0
- package/platforms/android/java/org/nativescript/widgets/image/BitmapOwner.java +17 -0
- package/platforms/android/java/org/nativescript/widgets/image/Cache.java +471 -0
- package/platforms/android/java/org/nativescript/widgets/image/DiskLruCache.java +970 -0
- package/platforms/android/java/org/nativescript/widgets/image/Fetcher.java +747 -0
- package/platforms/android/java/org/nativescript/widgets/image/Utils.java +58 -0
- package/platforms/android/java/org/nativescript/widgets/image/Worker.java +571 -0
- package/platforms/ios/src/TNSWidgets/Info.plist +26 -0
- package/platforms/ios/src/TNSWidgets/NSData+Async.m +42 -0
- package/platforms/ios/src/TNSWidgets/NSFileHandle+Async.m +82 -0
- package/platforms/ios/src/TNSWidgets/NSObject+Swizzling.m +68 -0
- package/platforms/ios/src/TNSWidgets/NSString+Async.m +51 -0
- package/platforms/ios/src/TNSWidgets/TNSLabel.m +42 -0
- package/platforms/ios/src/TNSWidgets/UIImage+TNSBlocks.m +77 -0
- package/platforms/ios/src/TNSWidgets/UIView+PassThroughParent.m +53 -0
- package/platforms/ios/src/TNSWidgets/UIView+PropertyBag.m +72 -0
- package/platforms/ios/src/module.modulemap +5 -0
- package/platforms/android/widgets-release.aar +0 -0
- package/platforms/ios/TNSWidgets.xcframework/Info.plist +0 -102
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64/TNSWidgets.framework/Headers/NSCCrypto.h +0 -60
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64/TNSWidgets.framework/Headers/TNSProcess.h +0 -29
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64/TNSWidgets.framework/Info.plist +0 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64/TNSWidgets.framework/Modules/module.modulemap +0 -6
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64/TNSWidgets.framework/TNSWidgets +0 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64/dSYMs/TNSWidgets.framework.dSYM/Contents/Info.plist +0 -20
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64/dSYMs/TNSWidgets.framework.dSYM/Contents/Resources/DWARF/TNSWidgets +0 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64/dSYMs/TNSWidgets.framework.dSYM/Contents/Resources/Relocations/aarch64/TNSWidgets.yml +0 -82
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Headers/NSCCrypto.h +0 -60
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Headers/NSData+Async.h +0 -24
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Headers/NSFileHandle+Async.h +0 -22
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Headers/NSString+Async.h +0 -25
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Headers/TNSLabel.h +0 -16
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Headers/TNSProcess.h +0 -29
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Headers/TNSWidgets.h +0 -25
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Headers/UIImage+TNSBlocks.h +0 -26
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Headers/UIView+PassThroughParent.h +0 -17
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Modules/module.modulemap +0 -6
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/PrivateHeaders/NSObject+Swizzling.h +0 -17
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/PrivateHeaders/UIView+PropertyBag.h +0 -18
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Resources/Info.plist +0 -52
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/A/Headers/NSCCrypto.h +0 -60
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/A/Headers/NSData+Async.h +0 -24
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/A/Headers/NSFileHandle+Async.h +0 -22
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/A/Headers/NSString+Async.h +0 -25
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/A/Headers/TNSLabel.h +0 -16
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/A/Headers/TNSProcess.h +0 -29
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/A/Headers/TNSWidgets.h +0 -25
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/A/Headers/UIImage+TNSBlocks.h +0 -26
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/A/Headers/UIView+PassThroughParent.h +0 -17
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/A/Modules/module.modulemap +0 -6
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/A/PrivateHeaders/NSObject+Swizzling.h +0 -17
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/A/PrivateHeaders/UIView+PropertyBag.h +0 -18
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/A/Resources/Info.plist +0 -52
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/A/TNSWidgets +0 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/Current/Headers/NSCCrypto.h +0 -60
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/Current/Headers/NSData+Async.h +0 -24
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/Current/Headers/NSFileHandle+Async.h +0 -22
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/Current/Headers/NSString+Async.h +0 -25
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/Current/Headers/TNSLabel.h +0 -16
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/Current/Headers/TNSProcess.h +0 -29
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/Current/Headers/TNSWidgets.h +0 -25
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/Current/Headers/UIImage+TNSBlocks.h +0 -26
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/Current/Headers/UIView+PassThroughParent.h +0 -17
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/Current/Modules/module.modulemap +0 -6
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/Current/PrivateHeaders/NSObject+Swizzling.h +0 -17
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/Current/PrivateHeaders/UIView+PropertyBag.h +0 -18
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/Current/Resources/Info.plist +0 -52
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/Current/TNSWidgets +0 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/dSYMs/TNSWidgets.framework.dSYM/Contents/Info.plist +0 -20
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/dSYMs/TNSWidgets.framework.dSYM/Contents/Resources/DWARF/TNSWidgets +0 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/dSYMs/TNSWidgets.framework.dSYM/Contents/Resources/Relocations/aarch64/TNSWidgets.yml +0 -82
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/dSYMs/TNSWidgets.framework.dSYM/Contents/Resources/Relocations/x86_64/TNSWidgets.yml +0 -82
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/TNSWidgets.framework/Headers/NSCCrypto.h +0 -60
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/TNSWidgets.framework/Headers/NSData+Async.h +0 -24
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/TNSWidgets.framework/Headers/NSFileHandle+Async.h +0 -22
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/TNSWidgets.framework/Headers/NSString+Async.h +0 -25
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/TNSWidgets.framework/Headers/TNSLabel.h +0 -16
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/TNSWidgets.framework/Headers/TNSProcess.h +0 -29
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/TNSWidgets.framework/Headers/TNSWidgets.h +0 -25
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/TNSWidgets.framework/Headers/UIImage+TNSBlocks.h +0 -26
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/TNSWidgets.framework/Headers/UIView+PassThroughParent.h +0 -17
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/TNSWidgets.framework/Info.plist +0 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/TNSWidgets.framework/Modules/module.modulemap +0 -6
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/TNSWidgets.framework/PrivateHeaders/NSObject+Swizzling.h +0 -17
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/TNSWidgets.framework/PrivateHeaders/UIView+PropertyBag.h +0 -18
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/TNSWidgets.framework/TNSWidgets +0 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/TNSWidgets.framework/_CodeSignature/CodeResources +0 -223
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/dSYMs/TNSWidgets.framework.dSYM/Contents/Info.plist +0 -20
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/dSYMs/TNSWidgets.framework.dSYM/Contents/Resources/DWARF/TNSWidgets +0 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/dSYMs/TNSWidgets.framework.dSYM/Contents/Resources/Relocations/aarch64/TNSWidgets.yml +0 -82
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/dSYMs/TNSWidgets.framework.dSYM/Contents/Resources/Relocations/x86_64/TNSWidgets.yml +0 -82
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64/TNSWidgets.framework/Headers/NSCCrypto.h +0 -60
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64/TNSWidgets.framework/Headers/NSData+Async.h +0 -24
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64/TNSWidgets.framework/Headers/NSFileHandle+Async.h +0 -22
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64/TNSWidgets.framework/Headers/NSString+Async.h +0 -25
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64/TNSWidgets.framework/Headers/TNSLabel.h +0 -16
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64/TNSWidgets.framework/Headers/TNSProcess.h +0 -29
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64/TNSWidgets.framework/Headers/TNSWidgets.h +0 -25
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64/TNSWidgets.framework/Headers/UIImage+TNSBlocks.h +0 -26
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64/TNSWidgets.framework/Headers/UIView+PassThroughParent.h +0 -17
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64/TNSWidgets.framework/Info.plist +0 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64/TNSWidgets.framework/Modules/module.modulemap +0 -6
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64/TNSWidgets.framework/PrivateHeaders/NSObject+Swizzling.h +0 -17
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64/TNSWidgets.framework/PrivateHeaders/UIView+PropertyBag.h +0 -18
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64/TNSWidgets.framework/TNSWidgets +0 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64/dSYMs/TNSWidgets.framework.dSYM/Contents/Info.plist +0 -20
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64/dSYMs/TNSWidgets.framework.dSYM/Contents/Resources/DWARF/TNSWidgets +0 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64/dSYMs/TNSWidgets.framework.dSYM/Contents/Resources/Relocations/aarch64/TNSWidgets.yml +0 -82
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64_x86_64-simulator/TNSWidgets.framework/Headers/NSCCrypto.h +0 -60
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64_x86_64-simulator/TNSWidgets.framework/Headers/NSData+Async.h +0 -24
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64_x86_64-simulator/TNSWidgets.framework/Headers/NSFileHandle+Async.h +0 -22
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64_x86_64-simulator/TNSWidgets.framework/Headers/NSString+Async.h +0 -25
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64_x86_64-simulator/TNSWidgets.framework/Headers/TNSLabel.h +0 -16
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64_x86_64-simulator/TNSWidgets.framework/Headers/TNSProcess.h +0 -29
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64_x86_64-simulator/TNSWidgets.framework/Headers/TNSWidgets.h +0 -25
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64_x86_64-simulator/TNSWidgets.framework/Headers/UIImage+TNSBlocks.h +0 -26
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64_x86_64-simulator/TNSWidgets.framework/Headers/UIView+PassThroughParent.h +0 -17
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64_x86_64-simulator/TNSWidgets.framework/Info.plist +0 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64_x86_64-simulator/TNSWidgets.framework/Modules/module.modulemap +0 -6
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64_x86_64-simulator/TNSWidgets.framework/PrivateHeaders/NSObject+Swizzling.h +0 -17
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64_x86_64-simulator/TNSWidgets.framework/PrivateHeaders/UIView+PropertyBag.h +0 -18
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64_x86_64-simulator/TNSWidgets.framework/TNSWidgets +0 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64_x86_64-simulator/TNSWidgets.framework/_CodeSignature/CodeResources +0 -223
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64_x86_64-simulator/dSYMs/TNSWidgets.framework.dSYM/Contents/Info.plist +0 -20
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64_x86_64-simulator/dSYMs/TNSWidgets.framework.dSYM/Contents/Resources/DWARF/TNSWidgets +0 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64_x86_64-simulator/dSYMs/TNSWidgets.framework.dSYM/Contents/Resources/Relocations/aarch64/TNSWidgets.yml +0 -82
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64_x86_64-simulator/dSYMs/TNSWidgets.framework.dSYM/Contents/Resources/Relocations/x86_64/TNSWidgets.yml +0 -82
- /package/platforms/ios/{TNSWidgets.xcframework/ios-arm64/TNSWidgets.framework/Headers → src/TNSWidgets}/NSData+Async.h +0 -0
- /package/platforms/ios/{TNSWidgets.xcframework/ios-arm64/TNSWidgets.framework/Headers → src/TNSWidgets}/NSFileHandle+Async.h +0 -0
- /package/platforms/ios/{TNSWidgets.xcframework/ios-arm64/TNSWidgets.framework/PrivateHeaders → src/TNSWidgets}/NSObject+Swizzling.h +0 -0
- /package/platforms/ios/{TNSWidgets.xcframework/ios-arm64/TNSWidgets.framework/Headers → src/TNSWidgets}/NSString+Async.h +0 -0
- /package/platforms/ios/{TNSWidgets.xcframework/ios-arm64/TNSWidgets.framework/Headers → src/TNSWidgets}/TNSLabel.h +0 -0
- /package/platforms/ios/{TNSWidgets.xcframework/ios-arm64/TNSWidgets.framework/Headers → src/TNSWidgets}/TNSWidgets.h +0 -0
- /package/platforms/ios/{TNSWidgets.xcframework/ios-arm64/TNSWidgets.framework/Headers → src/TNSWidgets}/UIImage+TNSBlocks.h +0 -0
- /package/platforms/ios/{TNSWidgets.xcframework/ios-arm64/TNSWidgets.framework/Headers → src/TNSWidgets}/UIView+PassThroughParent.h +0 -0
- /package/platforms/ios/{TNSWidgets.xcframework/ios-arm64/TNSWidgets.framework/PrivateHeaders → src/TNSWidgets}/UIView+PropertyBag.h +0 -0
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2014 Google Inc. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
package org.nativescript.widgets;
|
|
18
|
+
|
|
19
|
+
import android.content.Context;
|
|
20
|
+
import android.graphics.Color;
|
|
21
|
+
import android.graphics.drawable.Drawable;
|
|
22
|
+
import android.text.TextUtils;
|
|
23
|
+
import android.util.AttributeSet;
|
|
24
|
+
import android.util.SparseArray;
|
|
25
|
+
import android.util.TypedValue;
|
|
26
|
+
import android.view.Gravity;
|
|
27
|
+
import android.view.View;
|
|
28
|
+
import android.view.ViewGroup;
|
|
29
|
+
import android.widget.ImageView;
|
|
30
|
+
import android.widget.ImageView.ScaleType;
|
|
31
|
+
import android.widget.LinearLayout;
|
|
32
|
+
import android.widget.TextView;
|
|
33
|
+
|
|
34
|
+
public class BottomNavigationBar extends LinearLayout {
|
|
35
|
+
/**
|
|
36
|
+
* Allows complete control over the colors drawn in the tab layout. Set with
|
|
37
|
+
* {@link #setCustomTabColorizer(TabColorizer)}.
|
|
38
|
+
*/
|
|
39
|
+
public interface TabColorizer {
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* @return return the color of the indicator used when {@code position}
|
|
43
|
+
* is selected.
|
|
44
|
+
*/
|
|
45
|
+
int getIndicatorColor(int position);
|
|
46
|
+
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
private static final int BOTTOM_NAV_HEIGHT = 56;
|
|
50
|
+
private static final int ITEM_TEXT_SIZE_SP = 12;
|
|
51
|
+
private static final int ITEM_TEXT_MAX_WIDTH = 144;
|
|
52
|
+
|
|
53
|
+
private TabItemSpec[] mTabItems;
|
|
54
|
+
private final SparseArray<String> mContentDescriptions = new SparseArray<String>();
|
|
55
|
+
|
|
56
|
+
private final TabStrip mTabStrip;
|
|
57
|
+
private int mMaxImageHeight;
|
|
58
|
+
|
|
59
|
+
public BottomNavigationBar(Context context) {
|
|
60
|
+
this(context, null);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
public BottomNavigationBar(Context context, AttributeSet attrs) {
|
|
64
|
+
this(context, attrs, 0);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
public BottomNavigationBar(Context context, AttributeSet attrs, int defStyle) {
|
|
68
|
+
super(context, attrs, defStyle);
|
|
69
|
+
|
|
70
|
+
mTabStrip = new TabStrip(context);
|
|
71
|
+
mTabStrip.setSelectedIndicatorColors(0x00FFFFFF);
|
|
72
|
+
int bottomNavHeight = (int) (BOTTOM_NAV_HEIGHT * getResources().getDisplayMetrics().density);
|
|
73
|
+
addView(mTabStrip, LayoutParams.MATCH_PARENT, bottomNavHeight);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Set the custom {@link TabColorizer} to be used.
|
|
78
|
+
* <p>
|
|
79
|
+
* If you only require simple customisation then you can use
|
|
80
|
+
*/
|
|
81
|
+
public void setCustomTabColorizer(TabColorizer tabColorizer) {
|
|
82
|
+
// mTabStrip.setCustomTabColorizer(tabColorizer);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
public void setTabTextColor(int color) {
|
|
86
|
+
mTabStrip.setTabTextColor(color);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
public int getTabTextColor() {
|
|
90
|
+
return mTabStrip.getTabTextColor();
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
public void setSelectedTabTextColor(int color) {
|
|
94
|
+
mTabStrip.setSelectedTabTextColor(color);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
public int getSelectedTabTextColor() {
|
|
98
|
+
return mTabStrip.getSelectedTabTextColor();
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
public void setTabTextFontSize(float fontSize) {
|
|
102
|
+
mTabStrip.setTabTextFontSize(fontSize);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
public float getTabTextFontSize() {
|
|
106
|
+
return mTabStrip.getTabTextFontSize();
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
public void setItems(TabItemSpec[] items) {
|
|
110
|
+
mTabStrip.removeAllViews();
|
|
111
|
+
mTabItems = items;
|
|
112
|
+
setImageHeights();
|
|
113
|
+
populateTabStrip();
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Updates the UI of an item at specified index
|
|
118
|
+
*/
|
|
119
|
+
public void updateItemAt(int position, TabItemSpec tabItem) {
|
|
120
|
+
LinearLayout ll = (LinearLayout) mTabStrip.getChildAt(position);
|
|
121
|
+
ImageView imgView = (ImageView) ll.getChildAt(0);
|
|
122
|
+
TextView textView = (TextView) ll.getChildAt(1);
|
|
123
|
+
this.setupItem(ll, textView, imgView, tabItem);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Gets the TextView for tab item at index
|
|
128
|
+
*/
|
|
129
|
+
public TextView getTextViewForItemAt(int index) {
|
|
130
|
+
LinearLayout ll = this.getViewForItemAt(index);
|
|
131
|
+
return (ll != null) ? (TextView) ll.getChildAt(1) : null;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Gets the LinearLayout container for tab item at index
|
|
136
|
+
*/
|
|
137
|
+
public LinearLayout getViewForItemAt(int index) {
|
|
138
|
+
LinearLayout result = null;
|
|
139
|
+
|
|
140
|
+
if (this.mTabStrip.getChildCount() > index) {
|
|
141
|
+
result = (LinearLayout) this.mTabStrip.getChildAt(index);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
return result;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Gets the number of realized tabs.
|
|
149
|
+
*/
|
|
150
|
+
public int getItemCount() {
|
|
151
|
+
return this.mTabStrip.getChildCount();
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Create a default view to be used for tabs.
|
|
156
|
+
*/
|
|
157
|
+
protected View createDefaultTabView(Context context, TabItemSpec tabItem) {
|
|
158
|
+
float density = getResources().getDisplayMetrics().density;
|
|
159
|
+
|
|
160
|
+
LinearLayout tabItemLayout = new LinearLayout(context);
|
|
161
|
+
tabItemLayout.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.MATCH_PARENT));
|
|
162
|
+
tabItemLayout.setGravity(Gravity.CENTER);
|
|
163
|
+
tabItemLayout.setOrientation(LinearLayout.VERTICAL);
|
|
164
|
+
TypedValue backgroundOutValue = new TypedValue();
|
|
165
|
+
getContext().getTheme().resolveAttribute(android.R.attr.selectableItemBackground, backgroundOutValue, true);
|
|
166
|
+
tabItemLayout.setBackgroundResource(backgroundOutValue.resourceId);
|
|
167
|
+
|
|
168
|
+
ImageView iconImageView = new ImageView(context);
|
|
169
|
+
iconImageView.setScaleType(ScaleType.FIT_CENTER);
|
|
170
|
+
int iconImageHeight = this.mMaxImageHeight > 0 ? this.mMaxImageHeight : ViewGroup.LayoutParams.WRAP_CONTENT;
|
|
171
|
+
int iconImageWidth = ViewGroup.LayoutParams.WRAP_CONTENT;
|
|
172
|
+
LinearLayout.LayoutParams iconImageLayoutParams = new LinearLayout.LayoutParams(iconImageWidth, iconImageHeight);
|
|
173
|
+
iconImageLayoutParams.gravity = Gravity.CENTER;
|
|
174
|
+
iconImageView.setLayoutParams(iconImageLayoutParams);
|
|
175
|
+
|
|
176
|
+
TextView titleTextView = new TextView(context);
|
|
177
|
+
titleTextView.setGravity(Gravity.CENTER);
|
|
178
|
+
titleTextView.setMaxWidth((int) (ITEM_TEXT_MAX_WIDTH * density));
|
|
179
|
+
titleTextView.setTextSize(TypedValue.COMPLEX_UNIT_SP, ITEM_TEXT_SIZE_SP);
|
|
180
|
+
titleTextView.setEllipsize(TextUtils.TruncateAt.END);
|
|
181
|
+
titleTextView.setMaxLines(1);
|
|
182
|
+
titleTextView.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT));
|
|
183
|
+
|
|
184
|
+
this.setupItem(tabItemLayout, titleTextView, iconImageView, tabItem);
|
|
185
|
+
|
|
186
|
+
tabItemLayout.addView(iconImageView);
|
|
187
|
+
tabItemLayout.addView(titleTextView);
|
|
188
|
+
return tabItemLayout;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
private void setupItem(LinearLayout ll, TextView textView, ImageView imgView, TabItemSpec tabItem) {
|
|
192
|
+
float density = getResources().getDisplayMetrics().density;
|
|
193
|
+
if (tabItem.iconId != 0) {
|
|
194
|
+
imgView.setImageResource(tabItem.iconId);
|
|
195
|
+
imgView.setVisibility(VISIBLE);
|
|
196
|
+
} else if (tabItem.iconDrawable != null) {
|
|
197
|
+
imgView.setImageDrawable(tabItem.iconDrawable);
|
|
198
|
+
imgView.setVisibility(VISIBLE);
|
|
199
|
+
} else {
|
|
200
|
+
imgView.setVisibility(GONE);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
if (tabItem.title != null && !tabItem.title.isEmpty()) {
|
|
204
|
+
textView.setText(tabItem.title);
|
|
205
|
+
textView.setVisibility(VISIBLE);
|
|
206
|
+
|
|
207
|
+
if (tabItem.typeFace != null) {
|
|
208
|
+
textView.setTypeface(tabItem.typeFace);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
if (tabItem.fontSize != 0) {
|
|
212
|
+
textView.setTextSize(tabItem.fontSize);
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
if (tabItem.color != 0) {
|
|
216
|
+
textView.setTextColor(tabItem.color);
|
|
217
|
+
mTabStrip.setShouldUpdateTabsTextColor(false);
|
|
218
|
+
}
|
|
219
|
+
} else {
|
|
220
|
+
textView.setVisibility(GONE);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
if (tabItem.backgroundColor != 0) {
|
|
224
|
+
ll.setBackgroundColor(tabItem.backgroundColor);
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
ll.setMinimumHeight((int) (BOTTOM_NAV_HEIGHT * density));
|
|
228
|
+
|
|
229
|
+
LinearLayout.LayoutParams lp = (LinearLayout.LayoutParams) ll.getLayoutParams();
|
|
230
|
+
lp.width = 0;
|
|
231
|
+
lp.weight = 1;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
public boolean onTap(int position) {
|
|
235
|
+
// to be overridden in JS
|
|
236
|
+
return true;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
public void onSelectedPositionChange(int position, int prevPosition) {
|
|
240
|
+
// to be overridden in JS
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
private void setImageHeights() {
|
|
244
|
+
if (this.mTabItems != null) {
|
|
245
|
+
for (TabItemSpec tabItem : this.mTabItems) {
|
|
246
|
+
if (tabItem.imageHeight == 0 && tabItem.iconId != 0) {
|
|
247
|
+
Drawable drawable = getResources().getDrawable(tabItem.iconId);
|
|
248
|
+
tabItem.imageHeight = drawable.getIntrinsicHeight();
|
|
249
|
+
}
|
|
250
|
+
if (tabItem.imageHeight > this.mMaxImageHeight) {
|
|
251
|
+
this.mMaxImageHeight = tabItem.imageHeight;
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
private void populateTabStrip() {
|
|
258
|
+
final OnClickListener tabClickListener = new TabClickListener();
|
|
259
|
+
|
|
260
|
+
if (this.mTabItems != null) {
|
|
261
|
+
int count = this.mTabItems.length < 5 ? this.mTabItems.length : 5;
|
|
262
|
+
for (int i = 0; i < count; i++) {
|
|
263
|
+
TabItemSpec tabItem;
|
|
264
|
+
tabItem = this.mTabItems[i];
|
|
265
|
+
View tabView = createDefaultTabView(getContext(), tabItem);
|
|
266
|
+
tabView.setOnClickListener(tabClickListener);
|
|
267
|
+
|
|
268
|
+
String desc = mContentDescriptions.get(i, null);
|
|
269
|
+
if (desc != null) {
|
|
270
|
+
tabView.setContentDescription(desc);
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
mTabStrip.addView(tabView);
|
|
274
|
+
}
|
|
275
|
+
int tabTextColor = mTabStrip.getTabTextColor();
|
|
276
|
+
mTabStrip.setTabTextColor(Color.argb(100, Color.red(tabTextColor), Color.green(tabTextColor), Color.blue(tabTextColor)));
|
|
277
|
+
mTabStrip.setSelectedTabTextColor(Color.argb(255, Color.red(tabTextColor), Color.green(tabTextColor), Color.blue(tabTextColor)));
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
public void setSelectedPosition(int position) {
|
|
282
|
+
int prevPosition = mTabStrip.getSelectedPosition();
|
|
283
|
+
if (prevPosition == position) {
|
|
284
|
+
return;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
mTabStrip.setSelectedPosition(position);
|
|
288
|
+
onSelectedPositionChange(position, prevPosition);
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
public void setContentDescription(int i, String desc) {
|
|
292
|
+
mContentDescriptions.put(i, desc);
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
private class TabClickListener implements OnClickListener {
|
|
296
|
+
@Override
|
|
297
|
+
public void onClick(View v) {
|
|
298
|
+
for (int i = 0; i < mTabStrip.getChildCount(); i++) {
|
|
299
|
+
if (v == mTabStrip.getChildAt(i)) {
|
|
300
|
+
if (onTap(i)) {
|
|
301
|
+
setSelectedPosition(i);
|
|
302
|
+
}
|
|
303
|
+
return;
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
}
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
package org.nativescript.widgets;
|
|
2
|
+
|
|
3
|
+
import android.graphics.BlurMaskFilter;
|
|
4
|
+
import android.graphics.Color;
|
|
5
|
+
import android.graphics.drawable.Drawable;
|
|
6
|
+
import android.graphics.drawable.LayerDrawable;
|
|
7
|
+
import android.graphics.drawable.ShapeDrawable;
|
|
8
|
+
import android.graphics.drawable.shapes.RectShape;
|
|
9
|
+
import android.graphics.drawable.shapes.RoundRectShape;
|
|
10
|
+
import android.os.Build;
|
|
11
|
+
import android.util.Log;
|
|
12
|
+
|
|
13
|
+
import androidx.annotation.RequiresApi;
|
|
14
|
+
|
|
15
|
+
import org.json.JSONException;
|
|
16
|
+
import org.json.JSONObject;
|
|
17
|
+
|
|
18
|
+
import java.util.Arrays;
|
|
19
|
+
|
|
20
|
+
@RequiresApi(api = Build.VERSION_CODES.M)
|
|
21
|
+
public class BoxShadowDrawable extends LayerDrawable {
|
|
22
|
+
// Static parameters
|
|
23
|
+
protected final static int DEFAULT_BACKGROUND_COLOR = Color.WHITE;
|
|
24
|
+
protected final static String TAG = "BoxShadowDrawable";
|
|
25
|
+
|
|
26
|
+
// BoxShadow Parameters
|
|
27
|
+
protected int offsetX = 0;
|
|
28
|
+
protected int offsetY = 0;
|
|
29
|
+
protected int blurRadius = 0;
|
|
30
|
+
protected int spreadRadius = 0;
|
|
31
|
+
protected int shadowColor = Color.BLACK;
|
|
32
|
+
|
|
33
|
+
// Layers
|
|
34
|
+
protected final ShapeDrawable shadowLayer;
|
|
35
|
+
protected final ShapeDrawable overlayLayer;
|
|
36
|
+
protected final Drawable wrappedLayer;
|
|
37
|
+
|
|
38
|
+
protected float[] currentCornerRadii;
|
|
39
|
+
|
|
40
|
+
public BoxShadowDrawable(Drawable wrappedDrawable, String value) {
|
|
41
|
+
super(new Drawable[]{});
|
|
42
|
+
|
|
43
|
+
Log.d(TAG, "Constructing BoxShadowDrawable!");
|
|
44
|
+
|
|
45
|
+
this.shadowLayer = new ShapeDrawable(new RectShape());
|
|
46
|
+
this.wrappedLayer = wrappedDrawable;
|
|
47
|
+
|
|
48
|
+
if(shouldHideOverlayLayer()) {
|
|
49
|
+
this.overlayLayer = null;
|
|
50
|
+
} else {
|
|
51
|
+
this.overlayLayer = this.createOverlayLayer();
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// add our layers
|
|
55
|
+
this.addLayer(shadowLayer);
|
|
56
|
+
if(this.overlayLayer != null) {
|
|
57
|
+
this.addLayer(overlayLayer);
|
|
58
|
+
}
|
|
59
|
+
this.addLayer(wrappedLayer);
|
|
60
|
+
|
|
61
|
+
this.setValue(value);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// to allow applying any bg changes on original Drawable
|
|
65
|
+
public Drawable getWrappedDrawable() {
|
|
66
|
+
return this.wrappedLayer;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
public void setValue(String value) {
|
|
70
|
+
try {
|
|
71
|
+
JSONObject config = new JSONObject(value);
|
|
72
|
+
offsetX = config.getInt("offsetX");
|
|
73
|
+
offsetY = config.getInt("offsetY");
|
|
74
|
+
blurRadius = config.getInt("blurRadius");
|
|
75
|
+
spreadRadius = config.getInt("spreadRadius");
|
|
76
|
+
shadowColor = config.getInt("shadowColor");
|
|
77
|
+
|
|
78
|
+
float[] outerRadius;
|
|
79
|
+
|
|
80
|
+
// if we are wrapping a BorderDrawable - we can get the radii from it
|
|
81
|
+
if (wrappedLayer instanceof BorderDrawable) {
|
|
82
|
+
BorderDrawable b = (BorderDrawable) wrappedLayer;
|
|
83
|
+
outerRadius = new float[]{
|
|
84
|
+
b.getBorderTopLeftRadius(),
|
|
85
|
+
b.getBorderTopLeftRadius(),
|
|
86
|
+
|
|
87
|
+
b.getBorderTopRightRadius(),
|
|
88
|
+
b.getBorderTopRightRadius(),
|
|
89
|
+
|
|
90
|
+
b.getBorderBottomRightRadius(),
|
|
91
|
+
b.getBorderBottomRightRadius(),
|
|
92
|
+
|
|
93
|
+
b.getBorderBottomLeftRadius(),
|
|
94
|
+
b.getBorderBottomLeftRadius(),
|
|
95
|
+
};
|
|
96
|
+
} else {
|
|
97
|
+
int cornerRadius = 0;
|
|
98
|
+
try {
|
|
99
|
+
cornerRadius = config.getInt("cornerRadius");
|
|
100
|
+
} catch (JSONException ignore) {
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
outerRadius = new float[8];
|
|
104
|
+
Arrays.fill(outerRadius, cornerRadius);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
if (!Arrays.equals(outerRadius, currentCornerRadii)) {
|
|
108
|
+
Log.d(TAG, "Update layer shape");
|
|
109
|
+
shadowLayer.setShape(new RoundRectShape(outerRadius, null, null));
|
|
110
|
+
if(overlayLayer != null) {
|
|
111
|
+
overlayLayer.setShape(new RoundRectShape(outerRadius, null, null));
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
// update current
|
|
115
|
+
currentCornerRadii = outerRadius;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
// apply new shadow parameters
|
|
119
|
+
this.applyShadow();
|
|
120
|
+
} catch (JSONException exception) {
|
|
121
|
+
Log.d(TAG, "Caught JSONException...");
|
|
122
|
+
exception.printStackTrace();
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
private void applyShadow() {
|
|
127
|
+
Log.d(TAG, "applyShadow: " + this);
|
|
128
|
+
|
|
129
|
+
// apply boxShadow
|
|
130
|
+
shadowLayer.getPaint().setColor(shadowColor);
|
|
131
|
+
shadowLayer.getPaint().setMaskFilter(new BlurMaskFilter(
|
|
132
|
+
Float.MIN_VALUE + blurRadius,
|
|
133
|
+
BlurMaskFilter.Blur.NORMAL
|
|
134
|
+
));
|
|
135
|
+
shadowLayer.getPaint().setAntiAlias(true);
|
|
136
|
+
|
|
137
|
+
// apply insets that mimic offsets/spread to the shadowLayer
|
|
138
|
+
int inset = -spreadRadius;
|
|
139
|
+
Log.d(TAG, "Insets:"
|
|
140
|
+
+ "\n l: " + (inset + offsetX)
|
|
141
|
+
+ "\n t: " + (inset + offsetY)
|
|
142
|
+
+ "\n r: " + (inset - offsetX)
|
|
143
|
+
+ "\n b: " + (inset - offsetY)
|
|
144
|
+
);
|
|
145
|
+
this.setLayerInset(0,
|
|
146
|
+
inset + offsetX,
|
|
147
|
+
inset + offsetY,
|
|
148
|
+
inset - offsetX,
|
|
149
|
+
inset - offsetY
|
|
150
|
+
);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
private ShapeDrawable createOverlayLayer() {
|
|
154
|
+
ShapeDrawable shapeDrawable = new ShapeDrawable(new RectShape());
|
|
155
|
+
shapeDrawable.getPaint().setColor(DEFAULT_BACKGROUND_COLOR);
|
|
156
|
+
|
|
157
|
+
return shapeDrawable;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
private boolean shouldHideOverlayLayer() {
|
|
161
|
+
if (wrappedLayer instanceof BorderDrawable) {
|
|
162
|
+
BorderDrawable bd = (BorderDrawable) this.wrappedLayer;
|
|
163
|
+
if (bd.getBackgroundColor() != 0 || bd.getBackgroundBitmap() != null || bd.getBackgroundGradient() != null) {
|
|
164
|
+
return true;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
return false;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
@Override
|
|
172
|
+
public String toString() {
|
|
173
|
+
return "BoxShadowDrawable { oX:" + offsetX + " oY:" + offsetY + " br:" + blurRadius + " sr:" + spreadRadius + " c:" + shadowColor + " }";
|
|
174
|
+
}
|
|
175
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
package org.nativescript.widgets;
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Created by hristov on 6/16/2016.
|
|
5
|
+
*/
|
|
6
|
+
public class CSSValue {
|
|
7
|
+
private final String type;
|
|
8
|
+
private final String str;
|
|
9
|
+
private final String unit;
|
|
10
|
+
private final float value;
|
|
11
|
+
|
|
12
|
+
public String getType() {
|
|
13
|
+
return type;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
public String getString() {
|
|
17
|
+
return str;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
public String getUnit() {
|
|
21
|
+
return unit;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
public float getValue() {
|
|
25
|
+
return value;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
public CSSValue(String type, String str, String unit, float value) {
|
|
29
|
+
this.type = type;
|
|
30
|
+
this.str = str;
|
|
31
|
+
this.unit = unit;
|
|
32
|
+
this.value = value;
|
|
33
|
+
}
|
|
34
|
+
}
|