@nativescript/core 9.0.0-next-10-06-2025-18277360121 → 9.0.0-next-10-09-2025-18367604937
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/widgets-release.aar +0 -0
- package/platforms/ios/TNSWidgets.xcframework/Info.plist +102 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64/TNSWidgets.framework/Headers/NSCCrypto.h +60 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64/TNSWidgets.framework/Headers/TNSProcess.h +29 -0
- 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 +6 -0
- 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 +20 -0
- 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 +82 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Headers/NSCCrypto.h +60 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Headers/NSData+Async.h +24 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Headers/NSFileHandle+Async.h +22 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Headers/NSString+Async.h +25 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Headers/TNSLabel.h +16 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Headers/TNSProcess.h +29 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Headers/TNSWidgets.h +25 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Headers/UIImage+TNSBlocks.h +26 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Headers/UIView+PassThroughParent.h +17 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Modules/module.modulemap +6 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/PrivateHeaders/NSObject+Swizzling.h +17 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/PrivateHeaders/UIView+PropertyBag.h +18 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Resources/Info.plist +52 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/A/Headers/NSCCrypto.h +60 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/A/Headers/NSData+Async.h +24 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/A/Headers/NSFileHandle+Async.h +22 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/A/Headers/NSString+Async.h +25 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/A/Headers/TNSLabel.h +16 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/A/Headers/TNSProcess.h +29 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/A/Headers/TNSWidgets.h +25 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/A/Headers/UIImage+TNSBlocks.h +26 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/A/Headers/UIView+PassThroughParent.h +17 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/A/Modules/module.modulemap +6 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/A/PrivateHeaders/NSObject+Swizzling.h +17 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/A/PrivateHeaders/UIView+PropertyBag.h +18 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/A/Resources/Info.plist +52 -0
- 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 +60 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/Current/Headers/NSData+Async.h +24 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/Current/Headers/NSFileHandle+Async.h +22 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/Current/Headers/NSString+Async.h +25 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/Current/Headers/TNSLabel.h +16 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/Current/Headers/TNSProcess.h +29 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/Current/Headers/TNSWidgets.h +25 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/Current/Headers/UIImage+TNSBlocks.h +26 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/Current/Headers/UIView+PassThroughParent.h +17 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/Current/Modules/module.modulemap +6 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/Current/PrivateHeaders/NSObject+Swizzling.h +17 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/Current/PrivateHeaders/UIView+PropertyBag.h +18 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/Current/Resources/Info.plist +52 -0
- 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 +20 -0
- 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 +82 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/dSYMs/TNSWidgets.framework.dSYM/Contents/Resources/Relocations/x86_64/TNSWidgets.yml +82 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/TNSWidgets.framework/Headers/NSCCrypto.h +60 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/TNSWidgets.framework/Headers/NSData+Async.h +24 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/TNSWidgets.framework/Headers/NSFileHandle+Async.h +22 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/TNSWidgets.framework/Headers/NSString+Async.h +25 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/TNSWidgets.framework/Headers/TNSLabel.h +16 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/TNSWidgets.framework/Headers/TNSProcess.h +29 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/TNSWidgets.framework/Headers/TNSWidgets.h +25 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/TNSWidgets.framework/Headers/UIImage+TNSBlocks.h +26 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/TNSWidgets.framework/Headers/UIView+PassThroughParent.h +17 -0
- 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 +6 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/TNSWidgets.framework/PrivateHeaders/NSObject+Swizzling.h +17 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/TNSWidgets.framework/PrivateHeaders/UIView+PropertyBag.h +18 -0
- 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 +223 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/dSYMs/TNSWidgets.framework.dSYM/Contents/Info.plist +20 -0
- 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 +82 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/dSYMs/TNSWidgets.framework.dSYM/Contents/Resources/Relocations/x86_64/TNSWidgets.yml +82 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64/TNSWidgets.framework/Headers/NSCCrypto.h +60 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64/TNSWidgets.framework/Headers/NSData+Async.h +24 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64/TNSWidgets.framework/Headers/NSFileHandle+Async.h +22 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64/TNSWidgets.framework/Headers/NSString+Async.h +25 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64/TNSWidgets.framework/Headers/TNSLabel.h +16 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64/TNSWidgets.framework/Headers/TNSProcess.h +29 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64/TNSWidgets.framework/Headers/TNSWidgets.h +25 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64/TNSWidgets.framework/Headers/UIImage+TNSBlocks.h +26 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64/TNSWidgets.framework/Headers/UIView+PassThroughParent.h +17 -0
- 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 +6 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64/TNSWidgets.framework/PrivateHeaders/NSObject+Swizzling.h +17 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64/TNSWidgets.framework/PrivateHeaders/UIView+PropertyBag.h +18 -0
- 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 +20 -0
- 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 +82 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64_x86_64-simulator/TNSWidgets.framework/Headers/NSCCrypto.h +60 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64_x86_64-simulator/TNSWidgets.framework/Headers/NSData+Async.h +24 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64_x86_64-simulator/TNSWidgets.framework/Headers/NSFileHandle+Async.h +22 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64_x86_64-simulator/TNSWidgets.framework/Headers/NSString+Async.h +25 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64_x86_64-simulator/TNSWidgets.framework/Headers/TNSLabel.h +16 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64_x86_64-simulator/TNSWidgets.framework/Headers/TNSProcess.h +29 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64_x86_64-simulator/TNSWidgets.framework/Headers/TNSWidgets.h +25 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64_x86_64-simulator/TNSWidgets.framework/Headers/UIImage+TNSBlocks.h +26 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64_x86_64-simulator/TNSWidgets.framework/Headers/UIView+PassThroughParent.h +17 -0
- 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 +6 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64_x86_64-simulator/TNSWidgets.framework/PrivateHeaders/NSObject+Swizzling.h +17 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64_x86_64-simulator/TNSWidgets.framework/PrivateHeaders/UIView+PropertyBag.h +18 -0
- 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 +223 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64_x86_64-simulator/dSYMs/TNSWidgets.framework.dSYM/Contents/Info.plist +20 -0
- 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 +82 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64_x86_64-simulator/dSYMs/TNSWidgets.framework.dSYM/Contents/Resources/Relocations/x86_64/TNSWidgets.yml +82 -0
- package/platforms/ios/src/module.modulemap +0 -5
- package/ui/button/index.d.ts +1 -1
- package/ui/slider/index.d.ts +1 -1
- package/platforms/android/include.gradle +0 -51
- package/platforms/android/java/org/nativescript/Process.java +0 -59
- package/platforms/android/java/org/nativescript/widgets/AbsoluteLayout.java +0 -88
- package/platforms/android/java/org/nativescript/widgets/AnimatorHelper.java +0 -61
- package/platforms/android/java/org/nativescript/widgets/Async.java +0 -1356
- package/platforms/android/java/org/nativescript/widgets/BorderDrawable.java +0 -936
- package/platforms/android/java/org/nativescript/widgets/BottomNavigationBar.java +0 -308
- package/platforms/android/java/org/nativescript/widgets/BoxShadowDrawable.java +0 -175
- package/platforms/android/java/org/nativescript/widgets/CSSValue.java +0 -34
- package/platforms/android/java/org/nativescript/widgets/CommonLayoutParams.java +0 -456
- package/platforms/android/java/org/nativescript/widgets/ContentLayout.java +0 -85
- package/platforms/android/java/org/nativescript/widgets/CustomTransition.java +0 -135
- package/platforms/android/java/org/nativescript/widgets/CustomTypefaceSpan.java +0 -44
- package/platforms/android/java/org/nativescript/widgets/Dock.java +0 -15
- package/platforms/android/java/org/nativescript/widgets/DockLayout.java +0 -185
- package/platforms/android/java/org/nativescript/widgets/FileHelper.java +0 -815
- package/platforms/android/java/org/nativescript/widgets/FlexLine.java +0 -177
- package/platforms/android/java/org/nativescript/widgets/FlexboxLayout.java +0 -2769
- package/platforms/android/java/org/nativescript/widgets/FragmentBase.java +0 -14
- package/platforms/android/java/org/nativescript/widgets/GridLayout.java +0 -1172
- package/platforms/android/java/org/nativescript/widgets/GridUnitType.java +0 -10
- package/platforms/android/java/org/nativescript/widgets/HorizontalScrollView.java +0 -256
- package/platforms/android/java/org/nativescript/widgets/ImageView.java +0 -423
- package/platforms/android/java/org/nativescript/widgets/ItemSpec.java +0 -56
- package/platforms/android/java/org/nativescript/widgets/LayoutBase.java +0 -98
- package/platforms/android/java/org/nativescript/widgets/LinearGradientDefinition.java +0 -46
- package/platforms/android/java/org/nativescript/widgets/Orientation.java +0 -9
- package/platforms/android/java/org/nativescript/widgets/OriginPoint.java +0 -74
- package/platforms/android/java/org/nativescript/widgets/ScrollSavedState.java +0 -63
- package/platforms/android/java/org/nativescript/widgets/SegmentedBarColorDrawable.java +0 -27
- package/platforms/android/java/org/nativescript/widgets/StackLayout.java +0 -231
- package/platforms/android/java/org/nativescript/widgets/StyleableTextView.java +0 -50
- package/platforms/android/java/org/nativescript/widgets/TabIconRenderingMode.java +0 -6
- package/platforms/android/java/org/nativescript/widgets/TabItemSpec.java +0 -15
- package/platforms/android/java/org/nativescript/widgets/TabLayout.java +0 -451
- package/platforms/android/java/org/nativescript/widgets/TabStrip.java +0 -294
- package/platforms/android/java/org/nativescript/widgets/TabViewPager.java +0 -64
- package/platforms/android/java/org/nativescript/widgets/TabsBar.java +0 -443
- package/platforms/android/java/org/nativescript/widgets/Utils.java +0 -546
- package/platforms/android/java/org/nativescript/widgets/VerticalScrollView.java +0 -258
- package/platforms/android/java/org/nativescript/widgets/ViewHelper.java +0 -564
- package/platforms/android/java/org/nativescript/widgets/WrapLayout.java +0 -252
- package/platforms/android/java/org/nativescript/widgets/image/AsyncTask.java +0 -679
- package/platforms/android/java/org/nativescript/widgets/image/BitmapOwner.java +0 -17
- package/platforms/android/java/org/nativescript/widgets/image/Cache.java +0 -471
- package/platforms/android/java/org/nativescript/widgets/image/DiskLruCache.java +0 -970
- package/platforms/android/java/org/nativescript/widgets/image/Fetcher.java +0 -747
- package/platforms/android/java/org/nativescript/widgets/image/Utils.java +0 -58
- package/platforms/android/java/org/nativescript/widgets/image/Worker.java +0 -571
- package/platforms/ios/src/TNSWidgets/Info.plist +0 -26
- package/platforms/ios/src/TNSWidgets/NSData+Async.m +0 -42
- package/platforms/ios/src/TNSWidgets/NSFileHandle+Async.m +0 -82
- package/platforms/ios/src/TNSWidgets/NSObject+Swizzling.m +0 -68
- package/platforms/ios/src/TNSWidgets/NSString+Async.m +0 -51
- package/platforms/ios/src/TNSWidgets/TNSLabel.m +0 -42
- package/platforms/ios/src/TNSWidgets/UIImage+TNSBlocks.m +0 -77
- package/platforms/ios/src/TNSWidgets/UIView+PassThroughParent.m +0 -53
- package/platforms/ios/src/TNSWidgets/UIView+PropertyBag.m +0 -72
- /package/platforms/ios/{src/TNSWidgets → TNSWidgets.xcframework/ios-arm64/TNSWidgets.framework/Headers}/NSData+Async.h +0 -0
- /package/platforms/ios/{src/TNSWidgets → TNSWidgets.xcframework/ios-arm64/TNSWidgets.framework/Headers}/NSFileHandle+Async.h +0 -0
- /package/platforms/ios/{src/TNSWidgets → TNSWidgets.xcframework/ios-arm64/TNSWidgets.framework/Headers}/NSString+Async.h +0 -0
- /package/platforms/ios/{src/TNSWidgets → TNSWidgets.xcframework/ios-arm64/TNSWidgets.framework/Headers}/TNSLabel.h +0 -0
- /package/platforms/ios/{src/TNSWidgets → TNSWidgets.xcframework/ios-arm64/TNSWidgets.framework/Headers}/TNSWidgets.h +0 -0
- /package/platforms/ios/{src/TNSWidgets → TNSWidgets.xcframework/ios-arm64/TNSWidgets.framework/Headers}/UIImage+TNSBlocks.h +0 -0
- /package/platforms/ios/{src/TNSWidgets → TNSWidgets.xcframework/ios-arm64/TNSWidgets.framework/Headers}/UIView+PassThroughParent.h +0 -0
- /package/platforms/ios/{src/TNSWidgets → TNSWidgets.xcframework/ios-arm64/TNSWidgets.framework/PrivateHeaders}/NSObject+Swizzling.h +0 -0
- /package/platforms/ios/{src/TNSWidgets → TNSWidgets.xcframework/ios-arm64/TNSWidgets.framework/PrivateHeaders}/UIView+PropertyBag.h +0 -0
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (C) 2012 The Android Open Source Project
|
|
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.image;
|
|
18
|
-
|
|
19
|
-
import android.os.Build;
|
|
20
|
-
import android.os.Build.VERSION_CODES;
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Class containing some static utility methods.
|
|
24
|
-
*/
|
|
25
|
-
public class Utils {
|
|
26
|
-
private Utils() {
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
public static boolean hasFroyo() {
|
|
30
|
-
// Can use static final constants like FROYO, declared in later versions
|
|
31
|
-
// of the OS since they are inlined at compile time. This is guaranteed behavior.
|
|
32
|
-
return Build.VERSION.SDK_INT >= VERSION_CODES.FROYO;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
public static boolean hasGingerbread() {
|
|
36
|
-
return Build.VERSION.SDK_INT >= VERSION_CODES.GINGERBREAD;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
public static boolean hasHoneycomb() {
|
|
40
|
-
return Build.VERSION.SDK_INT >= VERSION_CODES.HONEYCOMB;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
public static boolean hasHoneycombMR1() {
|
|
44
|
-
return Build.VERSION.SDK_INT >= VERSION_CODES.HONEYCOMB_MR1;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
public static boolean hasJellyBean() {
|
|
48
|
-
return Build.VERSION.SDK_INT >= VERSION_CODES.JELLY_BEAN;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
public static boolean hasKitKat() {
|
|
52
|
-
return Build.VERSION.SDK_INT >= VERSION_CODES.KITKAT;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
public static boolean hasN() {
|
|
56
|
-
return Build.VERSION.SDK_INT >= VERSION_CODES.N;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
@@ -1,571 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (C) 2012 The Android Open Source Project
|
|
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.image;
|
|
18
|
-
|
|
19
|
-
import android.content.ContentResolver;
|
|
20
|
-
import android.content.Context;
|
|
21
|
-
import android.content.pm.ApplicationInfo;
|
|
22
|
-
import android.content.pm.PackageManager;
|
|
23
|
-
import android.content.res.Resources;
|
|
24
|
-
import android.graphics.Bitmap;
|
|
25
|
-
import android.graphics.BitmapFactory;
|
|
26
|
-
import android.graphics.drawable.BitmapDrawable;
|
|
27
|
-
import android.graphics.drawable.Drawable;
|
|
28
|
-
import android.util.Log;
|
|
29
|
-
|
|
30
|
-
import org.nativescript.widgets.Utils;
|
|
31
|
-
|
|
32
|
-
import java.lang.ref.WeakReference;
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* This class wraps up completing some arbitrary long running work when loading a bitmap to an
|
|
36
|
-
* ImageView. It handles things like using a memory and disk cache, running the work in a background
|
|
37
|
-
* thread and setting a placeholder image.
|
|
38
|
-
*/
|
|
39
|
-
public abstract class Worker {
|
|
40
|
-
|
|
41
|
-
protected static final String RESOURCE_PREFIX = "res://";
|
|
42
|
-
protected static final String FILE_PREFIX = "file:///";
|
|
43
|
-
protected static final String CONTENT_PREFIX = "content://";
|
|
44
|
-
|
|
45
|
-
static final String TAG = "JS";
|
|
46
|
-
private static final int FADE_IN_TIME = 200;
|
|
47
|
-
|
|
48
|
-
private Cache mCache;
|
|
49
|
-
private Bitmap mLoadingBitmap;
|
|
50
|
-
private boolean mFadeInBitmap = true;
|
|
51
|
-
private boolean mExitTasksEarly = false;
|
|
52
|
-
private final Object mPauseWorkLock = new Object();
|
|
53
|
-
|
|
54
|
-
protected boolean mPauseWork = false;
|
|
55
|
-
protected Resources mResources;
|
|
56
|
-
protected ContentResolver mResolver;
|
|
57
|
-
protected Context mContext;
|
|
58
|
-
private static final int MESSAGE_CLEAR = 0;
|
|
59
|
-
private static final int MESSAGE_INIT_DISK_CACHE = 1;
|
|
60
|
-
private static final int MESSAGE_FLUSH = 2;
|
|
61
|
-
private static final int MESSAGE_CLOSE = 3;
|
|
62
|
-
|
|
63
|
-
protected static int debuggable = -1;
|
|
64
|
-
|
|
65
|
-
protected Worker(Context context) {
|
|
66
|
-
mResources = context.getResources();
|
|
67
|
-
mResolver = context.getContentResolver();
|
|
68
|
-
mContext = context;
|
|
69
|
-
// Negative means not initialized.
|
|
70
|
-
if (debuggable < 0) {
|
|
71
|
-
try {
|
|
72
|
-
ApplicationInfo ai = context.getPackageManager().getApplicationInfo(context.getPackageName(), android.content.pm.PackageManager.GET_META_DATA);
|
|
73
|
-
android.os.Bundle bundle = ai.metaData;
|
|
74
|
-
Boolean debugLayouts = bundle != null && bundle.getBoolean("debugImageCache", false);
|
|
75
|
-
debuggable = debugLayouts ? 1 : 0;
|
|
76
|
-
} catch (PackageManager.NameNotFoundException e) {
|
|
77
|
-
debuggable = 0;
|
|
78
|
-
Log.e(TAG, "Failed to load meta-data, NameNotFound: " + e.getMessage());
|
|
79
|
-
} catch (NullPointerException e) {
|
|
80
|
-
debuggable = 0;
|
|
81
|
-
Log.e(TAG, "Failed to load meta-data, NullPointer: " + e.getMessage());
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
public void removeBitmap(String uri) {
|
|
87
|
-
if (mCache != null) {
|
|
88
|
-
mCache.reduceDisplayedCounter(uri);
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
* Load an image specified by the data parameter into an ImageView (override
|
|
94
|
-
* {@link Worker#processBitmap(String, int, int, boolean)} to define the processing logic). A memory and
|
|
95
|
-
* disk cache will be used if an {@link Cache} has been added using
|
|
96
|
-
* {@link Worker#addImageCache(Cache)}. If the
|
|
97
|
-
* image is found in the memory cache, it is set immediately, otherwise an {@link AsyncTask}
|
|
98
|
-
* will be created to asynchronously load the bitmap.
|
|
99
|
-
*
|
|
100
|
-
* @param uri The URI of the image to download.
|
|
101
|
-
* @param owner The owner to bind the downloaded image to.
|
|
102
|
-
* @param listener A listener that will be called back once the image has been loaded.
|
|
103
|
-
*/
|
|
104
|
-
public void loadImage(String uri, BitmapOwner owner, int decodeWidth, int decodeHeight, boolean keepAspectRatio, boolean useCache, boolean async, OnImageLoadedListener listener) {
|
|
105
|
-
if (uri == null) {
|
|
106
|
-
return;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
Object value = null;
|
|
110
|
-
String cacheUri = uri;
|
|
111
|
-
|
|
112
|
-
if (debuggable > 0) {
|
|
113
|
-
Log.v(TAG, "loadImage on: " + owner + " to: " + uri);
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
if (mCache != null && useCache) {
|
|
117
|
-
// Create new image cache for images with different decodeHeight/decodeWidth.
|
|
118
|
-
cacheUri = createCacheUri(uri, decodeHeight, decodeWidth);
|
|
119
|
-
|
|
120
|
-
value = mCache.getBitmapFromMemCache(cacheUri);
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
if (value == null && !async) {
|
|
124
|
-
// Decode sync.
|
|
125
|
-
value = processBitmap(uri, decodeWidth, decodeHeight, keepAspectRatio, useCache);
|
|
126
|
-
if (value != null) {
|
|
127
|
-
if (mCache != null && useCache) {
|
|
128
|
-
if (debuggable > 0) {
|
|
129
|
-
Log.v(TAG, "loadImage.addBitmapToCache: " + owner + ", src: " + cacheUri);
|
|
130
|
-
}
|
|
131
|
-
mCache.addBitmapToCache(cacheUri, (Bitmap) value);
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
/* Try loading as drawable */
|
|
136
|
-
if (value == null) {
|
|
137
|
-
value = Utils.getDrawable(uri, mContext);
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
if (value != null) {
|
|
142
|
-
// Bitmap found in memory cache or loaded sync.
|
|
143
|
-
if (debuggable > 0) {
|
|
144
|
-
Log.v(TAG, "Set ImageBitmap on: " + owner + " to: " + uri);
|
|
145
|
-
}
|
|
146
|
-
if (value instanceof Drawable) {
|
|
147
|
-
owner.setDrawable((Drawable) value);
|
|
148
|
-
} else {
|
|
149
|
-
owner.setBitmap((Bitmap) value);
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
if (listener != null) {
|
|
153
|
-
if (debuggable > 0) {
|
|
154
|
-
Log.v(TAG, "OnImageLoadedListener on: " + owner + " to: " + uri);
|
|
155
|
-
}
|
|
156
|
-
listener.onImageLoaded(true);
|
|
157
|
-
}
|
|
158
|
-
} else if (cancelPotentialWork(uri, owner)) {
|
|
159
|
-
final BitmapWorkerTask task = new BitmapWorkerTask(uri, owner, decodeWidth, decodeHeight, keepAspectRatio, useCache, listener);
|
|
160
|
-
final AsyncDrawable asyncDrawable =
|
|
161
|
-
new AsyncDrawable(mResources, mLoadingBitmap, task);
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
owner.setDrawable(asyncDrawable);
|
|
165
|
-
|
|
166
|
-
// NOTE: This uses a custom version of AsyncTask that has been pulled from the
|
|
167
|
-
// framework and slightly modified. Refer to the docs at the top of the class
|
|
168
|
-
// for more info on what was changed.
|
|
169
|
-
task.executeOnExecutor(AsyncTask.DUAL_THREAD_EXECUTOR);
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
/**
|
|
174
|
-
* Set placeholder bitmap that shows when the the background thread is running.
|
|
175
|
-
*
|
|
176
|
-
* @param bitmap
|
|
177
|
-
*/
|
|
178
|
-
public void setLoadingImage(Bitmap bitmap) {
|
|
179
|
-
mLoadingBitmap = bitmap;
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
/**
|
|
183
|
-
* Set placeholder bitmap that shows when the the background thread is running.
|
|
184
|
-
*
|
|
185
|
-
* @param resId
|
|
186
|
-
*/
|
|
187
|
-
public void setLoadingImage(int resId) {
|
|
188
|
-
mLoadingBitmap = BitmapFactory.decodeResource(mResources, resId);
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
/**
|
|
192
|
-
* Adds an {@link Cache} to this {@link Worker} to handle disk and memory bitmap
|
|
193
|
-
* caching. ImageCahce should be initialized before it is passed as parameter.
|
|
194
|
-
*/
|
|
195
|
-
public void addImageCache(Cache imageCache) {
|
|
196
|
-
this.mCache = imageCache;
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
/**
|
|
200
|
-
* If set to true, the image will fade-in once it has been loaded by the background thread.
|
|
201
|
-
*/
|
|
202
|
-
public void setImageFadeIn(boolean fadeIn) {
|
|
203
|
-
mFadeInBitmap = fadeIn;
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
public void setExitTasksEarly(boolean exitTasksEarly) {
|
|
207
|
-
mExitTasksEarly = exitTasksEarly;
|
|
208
|
-
setPauseWork(false);
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
/**
|
|
212
|
-
* Subclasses should override this to define any processing or work that must happen to produce
|
|
213
|
-
* the final bitmap. This will be executed in a background thread and be long running. For
|
|
214
|
-
* example, you could resize a large bitmap here, or pull down an image from the network.
|
|
215
|
-
*
|
|
216
|
-
* @param uri The URI to identify which image to process, as provided by
|
|
217
|
-
* {@link Worker#loadImage(String, BitmapOwner, int, int, boolean, boolean, OnImageLoadedListener)}
|
|
218
|
-
* @return The processed bitmap
|
|
219
|
-
*/
|
|
220
|
-
protected abstract Bitmap processBitmap(String uri, int decodeWidth, int decodeHeight, boolean keepAspectRatio, boolean useCache);
|
|
221
|
-
|
|
222
|
-
/**
|
|
223
|
-
* @return The {@link Cache} object currently being used by this Worker.
|
|
224
|
-
*/
|
|
225
|
-
protected Cache getCache() {
|
|
226
|
-
return mCache;
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
/**
|
|
230
|
-
* Cancels any pending work attached to the provided ImageView.
|
|
231
|
-
*
|
|
232
|
-
* @param owner
|
|
233
|
-
*/
|
|
234
|
-
public static void cancelWork(BitmapOwner owner) {
|
|
235
|
-
final BitmapWorkerTask bitmapWorkerTask = getBitmapWorkerTask(owner);
|
|
236
|
-
if (bitmapWorkerTask != null) {
|
|
237
|
-
bitmapWorkerTask.cancel(true);
|
|
238
|
-
if (debuggable > 0) {
|
|
239
|
-
Log.v(TAG, "cancelWork - cancelled work for " + bitmapWorkerTask.mUri);
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
/**
|
|
245
|
-
* Returns true if the current work has been canceled or if there was no work in
|
|
246
|
-
* progress on this image view.
|
|
247
|
-
* Returns false if the work in progress deals with the same data. The work is not
|
|
248
|
-
* stopped in that case.
|
|
249
|
-
*/
|
|
250
|
-
public static boolean cancelPotentialWork(String uri, BitmapOwner owner) {
|
|
251
|
-
final BitmapWorkerTask bitmapWorkerTask = getBitmapWorkerTask(owner);
|
|
252
|
-
|
|
253
|
-
if (bitmapWorkerTask != null) {
|
|
254
|
-
final String mUri = bitmapWorkerTask.mUri;
|
|
255
|
-
if (mUri == null || !mUri.equals(uri)) {
|
|
256
|
-
bitmapWorkerTask.cancel(true);
|
|
257
|
-
if (debuggable > 0) {
|
|
258
|
-
Log.v(TAG, "cancelPotentialWork - cancelled work for " + uri);
|
|
259
|
-
}
|
|
260
|
-
} else {
|
|
261
|
-
// The same work is already in progress.
|
|
262
|
-
return false;
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
return true;
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
/**
|
|
269
|
-
* @param owner The owner that requested the bitmap;
|
|
270
|
-
* @return Retrieve the currently active work task (if any) associated with this imageView.
|
|
271
|
-
* null if there is no such task.
|
|
272
|
-
*/
|
|
273
|
-
private static BitmapWorkerTask getBitmapWorkerTask(BitmapOwner owner) {
|
|
274
|
-
if (owner != null) {
|
|
275
|
-
final Drawable drawable = owner.getDrawable();
|
|
276
|
-
if (drawable instanceof AsyncDrawable) {
|
|
277
|
-
final AsyncDrawable asyncDrawable = (AsyncDrawable) drawable;
|
|
278
|
-
return asyncDrawable.getBitmapWorkerTask();
|
|
279
|
-
}
|
|
280
|
-
}
|
|
281
|
-
return null;
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
/**
|
|
285
|
-
* Create cache key depending on image uri and decode properties.
|
|
286
|
-
*/
|
|
287
|
-
private static String createCacheUri(String uri, int decodeHeight, int decodeWidth) {
|
|
288
|
-
uri += decodeHeight != 0 ? "height%%" + decodeHeight : "";
|
|
289
|
-
uri += decodeWidth != 0 ? "width%%" + decodeWidth : "";
|
|
290
|
-
|
|
291
|
-
return uri;
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
/**
|
|
295
|
-
* The actual AsyncTask that will asynchronously process the image.
|
|
296
|
-
*/
|
|
297
|
-
private class BitmapWorkerTask extends AsyncTask<Void, Void, Object> {
|
|
298
|
-
private final int mDecodeWidth;
|
|
299
|
-
private final int mDecodeHeight;
|
|
300
|
-
private final boolean mKeepAspectRatio;
|
|
301
|
-
private final String mUri;
|
|
302
|
-
private final String mCacheUri;
|
|
303
|
-
private final boolean mCacheImage;
|
|
304
|
-
private final WeakReference<BitmapOwner> imageViewReference;
|
|
305
|
-
private final OnImageLoadedListener mOnImageLoadedListener;
|
|
306
|
-
|
|
307
|
-
public BitmapWorkerTask(String uri, BitmapOwner owner, int decodeWidth, int decodeHeight, boolean keepAspectRatio, boolean cacheImage) {
|
|
308
|
-
this(uri, owner, decodeWidth, decodeHeight, keepAspectRatio, cacheImage, null);
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
public BitmapWorkerTask(String uri, BitmapOwner owner, int decodeWidth, int decodeHeight, boolean keepAspectRatio, boolean cacheImage, OnImageLoadedListener listener) {
|
|
312
|
-
mDecodeWidth = decodeWidth;
|
|
313
|
-
mDecodeHeight = decodeHeight;
|
|
314
|
-
mKeepAspectRatio = keepAspectRatio;
|
|
315
|
-
mCacheImage = cacheImage;
|
|
316
|
-
mUri = uri;
|
|
317
|
-
mCacheUri = createCacheUri(uri, decodeHeight, decodeWidth);
|
|
318
|
-
imageViewReference = new WeakReference<BitmapOwner>(owner);
|
|
319
|
-
mOnImageLoadedListener = listener;
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
/**
|
|
323
|
-
* Background processing.
|
|
324
|
-
*/
|
|
325
|
-
@Override
|
|
326
|
-
protected Object doInBackground(Void... params) {
|
|
327
|
-
if (debuggable > 0) {
|
|
328
|
-
Log.v(TAG, "doInBackground - starting work: " + imageViewReference.get() + ", on: " + mUri);
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
Object bitmap = null;
|
|
333
|
-
|
|
334
|
-
// Wait here if work is paused and the task is not cancelled
|
|
335
|
-
synchronized (mPauseWorkLock) {
|
|
336
|
-
while (mPauseWork && !isCancelled()) {
|
|
337
|
-
try {
|
|
338
|
-
mPauseWorkLock.wait();
|
|
339
|
-
} catch (InterruptedException e) {
|
|
340
|
-
}
|
|
341
|
-
}
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
// If the bitmap was not found in the cache and this task has not been cancelled by
|
|
345
|
-
// another thread and the ImageView that was originally bound to this task is still
|
|
346
|
-
// bound back to this task and our "exit early" flag is not set, then call the main
|
|
347
|
-
// process method (as implemented by a subclass)
|
|
348
|
-
if (!isCancelled() && getAttachedOwner() != null && !mExitTasksEarly) {
|
|
349
|
-
bitmap = processBitmap(mUri, mDecodeWidth, mDecodeHeight, mKeepAspectRatio, mCacheImage);
|
|
350
|
-
}
|
|
351
|
-
|
|
352
|
-
// If the bitmap was processed and the image cache is available, then add the processed
|
|
353
|
-
// bitmap to the cache for future use. Note we don't check if the task was cancelled
|
|
354
|
-
// here, if it was, and the thread is still running, we may as well add the processed
|
|
355
|
-
// bitmap to our cache as it might be used again in the future
|
|
356
|
-
if (bitmap != null) {
|
|
357
|
-
if (mCache != null && mCacheImage) {
|
|
358
|
-
if (debuggable > 0) {
|
|
359
|
-
Log.v(TAG, "addBitmapToCache: " + imageViewReference.get() + ", src: " + mCacheUri);
|
|
360
|
-
}
|
|
361
|
-
mCache.addBitmapToCache(mCacheUri, (Bitmap) bitmap);
|
|
362
|
-
}
|
|
363
|
-
}
|
|
364
|
-
|
|
365
|
-
/* Try loading as Drawable */
|
|
366
|
-
if (bitmap == null) {
|
|
367
|
-
bitmap = Utils.getDrawable(mUri, mContext);
|
|
368
|
-
}
|
|
369
|
-
|
|
370
|
-
if (debuggable > 0) {
|
|
371
|
-
Log.v(TAG, "doInBackground - finished work");
|
|
372
|
-
}
|
|
373
|
-
|
|
374
|
-
return bitmap;
|
|
375
|
-
}
|
|
376
|
-
|
|
377
|
-
/**
|
|
378
|
-
* Once the image is processed, associates it to the imageView
|
|
379
|
-
*/
|
|
380
|
-
@Override
|
|
381
|
-
protected void onPostExecute(Object value) {
|
|
382
|
-
boolean success = false;
|
|
383
|
-
// if cancel was called on this task or the "exit early" flag is set then we're done
|
|
384
|
-
if (isCancelled() || mExitTasksEarly) {
|
|
385
|
-
value = null;
|
|
386
|
-
}
|
|
387
|
-
|
|
388
|
-
if (debuggable > 0) {
|
|
389
|
-
Log.v(TAG, "onPostExecute - setting bitmap for: " + imageViewReference.get() + " src: " + mUri);
|
|
390
|
-
}
|
|
391
|
-
|
|
392
|
-
final BitmapOwner owner = getAttachedOwner();
|
|
393
|
-
if (debuggable > 0) {
|
|
394
|
-
Log.v(TAG, "onPostExecute - current ImageView: " + owner);
|
|
395
|
-
}
|
|
396
|
-
|
|
397
|
-
if (value != null && owner != null) {
|
|
398
|
-
success = true;
|
|
399
|
-
if (debuggable > 0) {
|
|
400
|
-
Log.v(TAG, "Set ImageDrawable on: " + owner + " to: " + mUri);
|
|
401
|
-
}
|
|
402
|
-
if (value instanceof Drawable) {
|
|
403
|
-
owner.setDrawable((Drawable) value);
|
|
404
|
-
} else if (value instanceof Bitmap) {
|
|
405
|
-
owner.setBitmap((Bitmap) value);
|
|
406
|
-
}
|
|
407
|
-
}
|
|
408
|
-
|
|
409
|
-
if (mOnImageLoadedListener != null) {
|
|
410
|
-
if (debuggable > 0) {
|
|
411
|
-
Log.v(TAG, "OnImageLoadedListener on: " + owner + " to: " + mUri);
|
|
412
|
-
}
|
|
413
|
-
mOnImageLoadedListener.onImageLoaded(success);
|
|
414
|
-
}
|
|
415
|
-
}
|
|
416
|
-
|
|
417
|
-
@Override
|
|
418
|
-
protected void onCancelled(Object value) {
|
|
419
|
-
super.onCancelled(value);
|
|
420
|
-
synchronized (mPauseWorkLock) {
|
|
421
|
-
mPauseWorkLock.notifyAll();
|
|
422
|
-
}
|
|
423
|
-
}
|
|
424
|
-
|
|
425
|
-
/**
|
|
426
|
-
* Returns the ImageView associated with this task as long as the ImageView's task still
|
|
427
|
-
* points to this task as well. Returns null otherwise.
|
|
428
|
-
*/
|
|
429
|
-
private BitmapOwner getAttachedOwner() {
|
|
430
|
-
final BitmapOwner owner = imageViewReference.get();
|
|
431
|
-
final BitmapWorkerTask bitmapWorkerTask = getBitmapWorkerTask(owner);
|
|
432
|
-
|
|
433
|
-
if (this == bitmapWorkerTask) {
|
|
434
|
-
return owner;
|
|
435
|
-
}
|
|
436
|
-
|
|
437
|
-
return null;
|
|
438
|
-
}
|
|
439
|
-
}
|
|
440
|
-
|
|
441
|
-
/**
|
|
442
|
-
* Interface definition for callback on image loaded successfully.
|
|
443
|
-
*/
|
|
444
|
-
public interface OnImageLoadedListener {
|
|
445
|
-
|
|
446
|
-
/**
|
|
447
|
-
* Called once the image has been loaded.
|
|
448
|
-
*
|
|
449
|
-
* @param success True if the image was loaded successfully, false if
|
|
450
|
-
* there was an error.
|
|
451
|
-
*/
|
|
452
|
-
void onImageLoaded(boolean success);
|
|
453
|
-
}
|
|
454
|
-
|
|
455
|
-
/**
|
|
456
|
-
* A custom Drawable that will be attached to the imageView while the work is in progress.
|
|
457
|
-
* Contains a reference to the actual worker task, so that it can be stopped if a new binding is
|
|
458
|
-
* required, and makes sure that only the last started worker process can bind its result,
|
|
459
|
-
* independently of the finish order.
|
|
460
|
-
*/
|
|
461
|
-
private static class AsyncDrawable extends BitmapDrawable {
|
|
462
|
-
private final WeakReference<BitmapWorkerTask> bitmapWorkerTaskReference;
|
|
463
|
-
|
|
464
|
-
public AsyncDrawable(Resources res, Bitmap bitmap, BitmapWorkerTask bitmapWorkerTask) {
|
|
465
|
-
super(res, bitmap);
|
|
466
|
-
bitmapWorkerTaskReference =
|
|
467
|
-
new WeakReference<BitmapWorkerTask>(bitmapWorkerTask);
|
|
468
|
-
}
|
|
469
|
-
|
|
470
|
-
public BitmapWorkerTask getBitmapWorkerTask() {
|
|
471
|
-
return bitmapWorkerTaskReference.get();
|
|
472
|
-
}
|
|
473
|
-
}
|
|
474
|
-
|
|
475
|
-
// /**
|
|
476
|
-
// * Called when the processing is complete and the final drawable should be
|
|
477
|
-
// * set on the ImageView.
|
|
478
|
-
// *
|
|
479
|
-
// * @param imageView
|
|
480
|
-
// * @param bitmap
|
|
481
|
-
// */
|
|
482
|
-
// private void setImageDrawable(ImageView imageView, Bitmap bitmap) {
|
|
483
|
-
// if (mFadeInBitmap) {
|
|
484
|
-
// // Transition drawable with a transparent drawable and the final drawable
|
|
485
|
-
// final TransitionDrawable td =
|
|
486
|
-
// new TransitionDrawable(new Drawable[] {
|
|
487
|
-
// new ColorDrawable(0),
|
|
488
|
-
// new BitmapDrawable(bitmap)
|
|
489
|
-
// });
|
|
490
|
-
// // Set background to loading bitmap
|
|
491
|
-
// imageView.setBackgroundDrawable(
|
|
492
|
-
// new BitmapDrawable(mResources, mLoadingBitmap));
|
|
493
|
-
//
|
|
494
|
-
// imageView.setImageDrawable(td);
|
|
495
|
-
// td.startTransition(FADE_IN_TIME);
|
|
496
|
-
// } else {
|
|
497
|
-
// imageView.setImageBitmap(bitmap);
|
|
498
|
-
// }
|
|
499
|
-
// }
|
|
500
|
-
|
|
501
|
-
/**
|
|
502
|
-
* Pause any ongoing background work. This can be used as a temporary
|
|
503
|
-
* measure to improve performance. For example background work could
|
|
504
|
-
* be paused when a ListView or GridView is being scrolled using a
|
|
505
|
-
* {@link android.widget.AbsListView.OnScrollListener} to keep
|
|
506
|
-
* scrolling smooth.
|
|
507
|
-
* <p>
|
|
508
|
-
* If work is paused, be sure setPauseWork(false) is called again
|
|
509
|
-
* before your fragment or activity is destroyed (for example during
|
|
510
|
-
* {@link android.app.Activity#onPause()}), or there is a risk the
|
|
511
|
-
* background thread will never finish.
|
|
512
|
-
*/
|
|
513
|
-
public void setPauseWork(boolean pauseWork) {
|
|
514
|
-
synchronized (mPauseWorkLock) {
|
|
515
|
-
mPauseWork = pauseWork;
|
|
516
|
-
if (!mPauseWork) {
|
|
517
|
-
mPauseWorkLock.notifyAll();
|
|
518
|
-
}
|
|
519
|
-
}
|
|
520
|
-
}
|
|
521
|
-
|
|
522
|
-
class CacheAsyncTask extends AsyncTask<Object, Void, Void> {
|
|
523
|
-
|
|
524
|
-
@Override
|
|
525
|
-
protected Void doInBackground(Object... params) {
|
|
526
|
-
switch ((Integer) params[0]) {
|
|
527
|
-
case MESSAGE_CLEAR:
|
|
528
|
-
clearCacheInternal();
|
|
529
|
-
break;
|
|
530
|
-
case MESSAGE_INIT_DISK_CACHE:
|
|
531
|
-
initDiskCacheInternal();
|
|
532
|
-
break;
|
|
533
|
-
case MESSAGE_FLUSH:
|
|
534
|
-
flushCacheInternal();
|
|
535
|
-
break;
|
|
536
|
-
case MESSAGE_CLOSE:
|
|
537
|
-
closeCacheInternal();
|
|
538
|
-
break;
|
|
539
|
-
}
|
|
540
|
-
return null;
|
|
541
|
-
}
|
|
542
|
-
}
|
|
543
|
-
|
|
544
|
-
protected void clearCacheInternal() {
|
|
545
|
-
if (mCache != null) {
|
|
546
|
-
mCache.clearCache();
|
|
547
|
-
}
|
|
548
|
-
}
|
|
549
|
-
|
|
550
|
-
protected abstract void initDiskCacheInternal();
|
|
551
|
-
|
|
552
|
-
protected abstract void flushCacheInternal();
|
|
553
|
-
|
|
554
|
-
protected abstract void closeCacheInternal();
|
|
555
|
-
|
|
556
|
-
public void initCache() {
|
|
557
|
-
new CacheAsyncTask().execute(MESSAGE_INIT_DISK_CACHE);
|
|
558
|
-
}
|
|
559
|
-
|
|
560
|
-
public void clearCache() {
|
|
561
|
-
new CacheAsyncTask().execute(MESSAGE_CLEAR);
|
|
562
|
-
}
|
|
563
|
-
|
|
564
|
-
public void flushCache() {
|
|
565
|
-
new CacheAsyncTask().execute(MESSAGE_FLUSH);
|
|
566
|
-
}
|
|
567
|
-
|
|
568
|
-
public void closeCache() {
|
|
569
|
-
new CacheAsyncTask().execute(MESSAGE_CLOSE);
|
|
570
|
-
}
|
|
571
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
3
|
-
<plist version="1.0">
|
|
4
|
-
<dict>
|
|
5
|
-
<key>CFBundleDevelopmentRegion</key>
|
|
6
|
-
<string>en</string>
|
|
7
|
-
<key>CFBundleExecutable</key>
|
|
8
|
-
<string>$(EXECUTABLE_NAME)</string>
|
|
9
|
-
<key>CFBundleIdentifier</key>
|
|
10
|
-
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
|
11
|
-
<key>CFBundleInfoDictionaryVersion</key>
|
|
12
|
-
<string>6.0</string>
|
|
13
|
-
<key>CFBundleName</key>
|
|
14
|
-
<string>$(PRODUCT_NAME)</string>
|
|
15
|
-
<key>CFBundlePackageType</key>
|
|
16
|
-
<string>FMWK</string>
|
|
17
|
-
<key>CFBundleShortVersionString</key>
|
|
18
|
-
<string>1.0</string>
|
|
19
|
-
<key>CFBundleSignature</key>
|
|
20
|
-
<string>????</string>
|
|
21
|
-
<key>CFBundleVersion</key>
|
|
22
|
-
<string>$(CURRENT_PROJECT_VERSION)</string>
|
|
23
|
-
<key>NSPrincipalClass</key>
|
|
24
|
-
<string></string>
|
|
25
|
-
</dict>
|
|
26
|
-
</plist>
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// NSData+Async.m
|
|
3
|
-
// TNSWidgets
|
|
4
|
-
//
|
|
5
|
-
// Created by Peter Staev on 7.08.19.
|
|
6
|
-
// Copyright © 2019 Telerik A D. All rights reserved.
|
|
7
|
-
//
|
|
8
|
-
|
|
9
|
-
#import "NSData+Async.h"
|
|
10
|
-
|
|
11
|
-
@implementation NSData (Async)
|
|
12
|
-
|
|
13
|
-
+ (void)dataWithContentsOfFile:(nonnull NSString*)path
|
|
14
|
-
completion:(void (^) (NSData*))callback {
|
|
15
|
-
|
|
16
|
-
dispatch_queue_t asyncQueue = dispatch_queue_create("org.nativescript.TNSWidgets.data", NULL);
|
|
17
|
-
dispatch_async(asyncQueue, ^(void) {
|
|
18
|
-
NSData *output = [NSData dataWithContentsOfFile:path];
|
|
19
|
-
dispatch_async(dispatch_get_main_queue(), ^(void) {
|
|
20
|
-
callback(output);
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
- (void)writeToFile:(nonnull NSString*) path
|
|
27
|
-
atomically:(BOOL)atomically
|
|
28
|
-
completion:(void (^) (void))callback {
|
|
29
|
-
|
|
30
|
-
dispatch_queue_t asyncQueue = dispatch_queue_create("org.nativescript.TNSWidgets.data", NULL);
|
|
31
|
-
dispatch_async(asyncQueue, ^(void) {
|
|
32
|
-
[self writeToFile:path
|
|
33
|
-
atomically:atomically];
|
|
34
|
-
|
|
35
|
-
dispatch_async(dispatch_get_main_queue(), ^(void) {
|
|
36
|
-
callback();
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
@end
|