@akylas/nativescript 9.0.25 → 9.1.4

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.
Files changed (585) hide show
  1. package/abortcontroller/abortsignal.js.map +1 -1
  2. package/abortcontroller/index.js.map +1 -1
  3. package/accessibility/accessibility-common.js.map +1 -1
  4. package/accessibility/accessibility-css-helper.js.map +1 -1
  5. package/accessibility/accessibility-properties.js.map +1 -1
  6. package/accessibility/accessibility-service-common.js.map +1 -1
  7. package/accessibility/accessibility-service.android.js.map +1 -1
  8. package/accessibility/accessibility-service.ios.js.map +1 -1
  9. package/accessibility/accessibility-types.js.map +1 -1
  10. package/accessibility/font-scale-common.js.map +1 -1
  11. package/accessibility/font-scale.android.js.map +1 -1
  12. package/accessibility/font-scale.ios.js.map +1 -1
  13. package/accessibility/index.android.js.map +1 -1
  14. package/accessibility/index.ios.js.map +1 -1
  15. package/animation-frame/animation-native.android.js.map +1 -1
  16. package/animation-frame/animation-native.ios.js.map +1 -1
  17. package/animation-frame/index.js.map +1 -1
  18. package/application/application-common.d.ts +199 -3
  19. package/application/application-common.js +425 -55
  20. package/application/application-common.js.map +1 -1
  21. package/application/application-interfaces.d.ts +67 -1
  22. package/application/application-interfaces.js.map +1 -1
  23. package/application/application-shims.js.map +1 -1
  24. package/application/application.android.d.ts +39 -0
  25. package/application/application.android.js +242 -17
  26. package/application/application.android.js.map +1 -1
  27. package/application/application.d.ts +161 -54
  28. package/application/application.ios.d.ts +189 -28
  29. package/application/application.ios.js +885 -379
  30. package/application/application.ios.js.map +1 -1
  31. package/application/helpers-common.d.ts +5 -0
  32. package/application/helpers-common.js +23 -1
  33. package/application/helpers-common.js.map +1 -1
  34. package/application/helpers.android.js.map +1 -1
  35. package/application/helpers.ios.js.map +1 -1
  36. package/application/index.android.js.map +1 -1
  37. package/application/index.ios.js.map +1 -1
  38. package/application/scene-delegate-bridge.d.ts +60 -0
  39. package/application/scene-delegate-bridge.js +138 -0
  40. package/application/scene-delegate-bridge.js.map +1 -0
  41. package/application-settings/application-settings-common.js.map +1 -1
  42. package/application-settings/index.android.js.map +1 -1
  43. package/application-settings/index.ios.js.map +1 -1
  44. package/bundle-entry-points.js.map +1 -1
  45. package/cli-hooks/before-checkForChanges.mjs +0 -11
  46. package/color/color-common.js +16 -5
  47. package/color/color-common.js.map +1 -1
  48. package/color/color-types.js.map +1 -1
  49. package/color/color-utils.d.ts +4 -1
  50. package/color/color-utils.js +14 -9
  51. package/color/color-utils.js.map +1 -1
  52. package/color/index.android.js.map +1 -1
  53. package/color/index.ios.js.map +1 -1
  54. package/color/known-colors.js.map +1 -1
  55. package/config/config.interface.d.ts +44 -2
  56. package/config/config.interface.js.map +1 -1
  57. package/config/index.js.map +1 -1
  58. package/connectivity/index.android.js.map +1 -1
  59. package/connectivity/index.ios.js.map +1 -1
  60. package/console/index.js.map +1 -1
  61. package/core-types/animation-types.js.map +1 -1
  62. package/core-types/index.d.ts +25 -2
  63. package/core-types/index.js +23 -0
  64. package/core-types/index.js.map +1 -1
  65. package/core-types/validators.js.map +1 -1
  66. package/css/CSS3Parser.js +3 -2
  67. package/css/CSS3Parser.js.map +1 -1
  68. package/css/CSSNativeScript.js.map +1 -1
  69. package/css/css-tree-parser.js +5 -1
  70. package/css/css-tree-parser.js.map +1 -1
  71. package/css/lib/parse/index.js +5 -1
  72. package/css/lib/parse/index.js.map +1 -1
  73. package/css/parser.js +20 -3
  74. package/css/parser.js.map +1 -1
  75. package/css/reworkcss.js.map +1 -1
  76. package/css/system-classes.d.ts +9 -0
  77. package/css/system-classes.js +23 -0
  78. package/css/system-classes.js.map +1 -1
  79. package/css-mediaquery/index.js +4 -4
  80. package/css-mediaquery/index.js.map +1 -1
  81. package/css-value/reworkcss-value.js.map +1 -1
  82. package/data/observable/index.d.ts +23 -0
  83. package/data/observable/index.js +50 -9
  84. package/data/observable/index.js.map +1 -1
  85. package/data/observable-array/index.js.map +1 -1
  86. package/data/virtual-array/index.js.map +1 -1
  87. package/debugger/InspectorBackendCommands.js.map +1 -1
  88. package/debugger/devtools-elements-interfaces.js.map +1 -1
  89. package/debugger/devtools-elements.common.js.map +1 -1
  90. package/debugger/devtools-elements.js.map +1 -1
  91. package/debugger/dom-types.js +31 -1
  92. package/debugger/dom-types.js.map +1 -1
  93. package/debugger/index.js.map +1 -1
  94. package/debugger/webinspector-css.js.map +1 -1
  95. package/debugger/webinspector-dom.js.map +1 -1
  96. package/debugger/webinspector-network.android.js.map +1 -1
  97. package/debugger/webinspector-network.ios.js.map +1 -1
  98. package/file-system/file-system-access.android.js.map +1 -1
  99. package/file-system/file-system-access.ios.js +21 -13
  100. package/file-system/file-system-access.ios.js.map +1 -1
  101. package/file-system/index.d.ts +3 -3
  102. package/file-system/index.js.map +1 -1
  103. package/fps-meter/fps-native.android.js.map +1 -1
  104. package/fps-meter/fps-native.ios.js.map +1 -1
  105. package/fps-meter/index.js.map +1 -1
  106. package/global-types.d.ts +39 -33
  107. package/globals/global-utils.d.ts +6 -1
  108. package/globals/global-utils.js +10 -5
  109. package/globals/global-utils.js.map +1 -1
  110. package/globals/index.js +18 -5
  111. package/globals/index.js.map +1 -1
  112. package/globals/polyfills/polyfill-xhr.js.map +1 -1
  113. package/globals/polyfills/utils.js +2 -0
  114. package/globals/polyfills/utils.js.map +1 -1
  115. package/http/http-interfaces.js.map +1 -1
  116. package/http/http-request/http-request-common.js.map +1 -1
  117. package/http/http-request/index.android.js.map +1 -1
  118. package/http/http-request/index.ios.js.map +1 -1
  119. package/http/http-request-internal/http-request-internal-common.d.ts +5 -1
  120. package/http/http-request-internal/http-request-internal-common.js +10 -0
  121. package/http/http-request-internal/http-request-internal-common.js.map +1 -1
  122. package/http/http-request-internal/index.android.d.ts +7 -1
  123. package/http/http-request-internal/index.android.js +2 -2
  124. package/http/http-request-internal/index.android.js.map +1 -1
  125. package/http/http-request-internal/index.ios.d.ts +7 -1
  126. package/http/http-request-internal/index.ios.js +2 -2
  127. package/http/http-request-internal/index.ios.js.map +1 -1
  128. package/http/index.js.map +1 -1
  129. package/image-asset/image-asset-common.js.map +1 -1
  130. package/image-asset/index.android.js.map +1 -1
  131. package/image-asset/index.ios.js.map +1 -1
  132. package/image-source/image-source-common.js.map +1 -1
  133. package/image-source/index.android.js.map +1 -1
  134. package/image-source/index.ios.js.map +1 -1
  135. package/index.d.ts +2 -0
  136. package/index.js +1 -0
  137. package/index.js.map +1 -1
  138. package/inspector_modules.js +1 -1
  139. package/inspector_modules.js.map +1 -1
  140. package/matrix/index.js.map +1 -1
  141. package/media-query-list/index.js.map +1 -1
  142. package/module-name-resolver/helpers.js.map +1 -1
  143. package/module-name-resolver/index.js.map +1 -1
  144. package/module-name-resolver/non-bundle-workflow-compat.js.map +1 -1
  145. package/module-name-resolver/qualifier-matcher/index.js.map +1 -1
  146. package/native-window/index.d.ts +426 -0
  147. package/native-window/index.js +4 -0
  148. package/native-window/index.js.map +1 -0
  149. package/native-window/native-window-common.d.ts +153 -0
  150. package/native-window/native-window-common.js +340 -0
  151. package/native-window/native-window-common.js.map +1 -0
  152. package/native-window/native-window-interfaces.d.ts +186 -0
  153. package/native-window/native-window-interfaces.js +90 -0
  154. package/native-window/native-window-interfaces.js.map +1 -0
  155. package/native-window/native-window.android.d.ts +59 -0
  156. package/native-window/native-window.android.js +175 -0
  157. package/native-window/native-window.android.js.map +1 -0
  158. package/native-window/native-window.ios.d.ts +61 -0
  159. package/native-window/native-window.ios.js +220 -0
  160. package/native-window/native-window.ios.js.map +1 -0
  161. package/native-window/window-base.d.ts +111 -0
  162. package/native-window/window-base.js +91 -0
  163. package/native-window/window-base.js.map +1 -0
  164. package/package.json +3 -2
  165. package/platform/common.js.map +1 -1
  166. package/platform/device/index.android.js.map +1 -1
  167. package/platform/device/index.ios.js.map +1 -1
  168. package/platform/index.js.map +1 -1
  169. package/platform/screen/index.android.js.map +1 -1
  170. package/platform/screen/index.ios.d.ts +1 -0
  171. package/platform/screen/index.ios.js +6 -2
  172. package/platform/screen/index.ios.js.map +1 -1
  173. package/platforms/android/java/org/nativescript/widgets/BorderDrawable.java +5 -6
  174. package/platforms/android/java/org/nativescript/widgets/BoxShadowDrawable.java +0 -6
  175. package/platforms/android/java/org/nativescript/widgets/CommonLayoutParams.java +56 -0
  176. package/platforms/android/java/org/nativescript/widgets/ContentLayout.java +20 -4
  177. package/platforms/android/java/org/nativescript/widgets/CustomTransition.java +26 -9
  178. package/platforms/android/java/org/nativescript/widgets/FlexLine.java +3 -3
  179. package/platforms/android/java/org/nativescript/widgets/FlexboxLayout.java +194 -731
  180. package/platforms/android/java/org/nativescript/widgets/ImageView.java +2 -2
  181. package/platforms/android/java/org/nativescript/widgets/Utils.java +37 -9
  182. package/platforms/android/java/org/nativescript/widgets/ViewHelper.java +78 -0
  183. package/platforms/android/java/org/nativescript/widgets/image/BitmapOwner.java +1 -4
  184. package/platforms/android/java/org/nativescript/widgets/image/Worker.java +99 -76
  185. package/platforms/android/native-api-usage.json +11 -0
  186. package/platforms/ios/src/NativeScriptMainWindow.swift +72 -39
  187. package/profiling/index.js.map +1 -1
  188. package/references.d.ts +5 -2
  189. package/text/formatted-string.js.map +1 -1
  190. package/text/index.android.js.map +1 -1
  191. package/text/index.ios.js.map +1 -1
  192. package/text/span.js.map +1 -1
  193. package/text/text-common.js +1 -1
  194. package/text/text-common.js.map +1 -1
  195. package/timer/index.android.js.map +1 -1
  196. package/timer/index.ios.js.map +1 -1
  197. package/trace/index.d.ts +2 -2
  198. package/trace/index.js.map +1 -1
  199. package/ui/action-bar/action-bar-common.js.map +1 -1
  200. package/ui/action-bar/index.android.js +2 -7
  201. package/ui/action-bar/index.android.js.map +1 -1
  202. package/ui/action-bar/index.d.ts +13 -1
  203. package/ui/action-bar/index.ios.js +26 -0
  204. package/ui/action-bar/index.ios.js.map +1 -1
  205. package/ui/activity-indicator/activity-indicator-common.js.map +1 -1
  206. package/ui/activity-indicator/index.android.js.map +1 -1
  207. package/ui/activity-indicator/index.ios.js.map +1 -1
  208. package/ui/animation/animation-common.js.map +1 -1
  209. package/ui/animation/animation-interfaces.js.map +1 -1
  210. package/ui/animation/animation-shared.js.map +1 -1
  211. package/ui/animation/animation-types.js.map +1 -1
  212. package/ui/animation/index.android.js.map +1 -1
  213. package/ui/animation/index.ios.js.map +1 -1
  214. package/ui/animation/keyframe-animation.d.ts +3 -1
  215. package/ui/animation/keyframe-animation.js +72 -3
  216. package/ui/animation/keyframe-animation.js.map +1 -1
  217. package/ui/builder/binding-builder.js.map +1 -1
  218. package/ui/builder/component-builder/index.js.map +1 -1
  219. package/ui/builder/index.js +9 -1
  220. package/ui/builder/index.js.map +1 -1
  221. package/ui/button/button-common.js.map +1 -1
  222. package/ui/button/index.android.js.map +1 -1
  223. package/ui/button/index.ios.js.map +1 -1
  224. package/ui/content-view/index.js.map +1 -1
  225. package/ui/core/bindable/bindable-expressions.js.map +1 -1
  226. package/ui/core/bindable/bindable-resources.js.map +1 -1
  227. package/ui/core/bindable/bindable-types.js.map +1 -1
  228. package/ui/core/bindable/index.js +2 -1
  229. package/ui/core/bindable/index.js.map +1 -1
  230. package/ui/core/control-state-change/index.android.js.map +1 -1
  231. package/ui/core/control-state-change/index.ios.js.map +1 -1
  232. package/ui/core/properties/index.d.ts +37 -2
  233. package/ui/core/properties/index.js +205 -29
  234. package/ui/core/properties/index.js.map +1 -1
  235. package/ui/core/properties/property-shared.js +11 -2
  236. package/ui/core/properties/property-shared.js.map +1 -1
  237. package/ui/core/view/index.android.d.ts +5 -0
  238. package/ui/core/view/index.android.js +78 -6
  239. package/ui/core/view/index.android.js.map +1 -1
  240. package/ui/core/view/index.d.ts +58 -1
  241. package/ui/core/view/index.ios.d.ts +1 -0
  242. package/ui/core/view/index.ios.js +48 -11
  243. package/ui/core/view/index.ios.js.map +1 -1
  244. package/ui/core/view/view-common.d.ts +37 -0
  245. package/ui/core/view/view-common.js +81 -0
  246. package/ui/core/view/view-common.js.map +1 -1
  247. package/ui/core/view/view-helper/index.android.d.ts +1 -0
  248. package/ui/core/view/view-helper/index.android.js +8 -0
  249. package/ui/core/view/view-helper/index.android.js.map +1 -1
  250. package/ui/core/view/view-helper/index.d.ts +46 -0
  251. package/ui/core/view/view-helper/index.ios.d.ts +42 -0
  252. package/ui/core/view/view-helper/index.ios.js +170 -5
  253. package/ui/core/view/view-helper/index.ios.js.map +1 -1
  254. package/ui/core/view/view-helper/view-helper-common.js +21 -3
  255. package/ui/core/view/view-helper/view-helper-common.js.map +1 -1
  256. package/ui/core/view/view-helper/view-helper-shared.js.map +1 -1
  257. package/ui/core/view/view-interfaces.js.map +1 -1
  258. package/ui/core/view-base/index.js +75 -36
  259. package/ui/core/view-base/index.js.map +1 -1
  260. package/ui/core/view-base/utils.js.map +1 -1
  261. package/ui/core/weak-event-listener/index.js.map +1 -1
  262. package/ui/date-picker/date-picker-common.js.map +1 -1
  263. package/ui/date-picker/index.android.js.map +1 -1
  264. package/ui/date-picker/index.ios.js.map +1 -1
  265. package/ui/dialogs/dialogs-common.js.map +1 -1
  266. package/ui/dialogs/index.android.js +5 -5
  267. package/ui/dialogs/index.android.js.map +1 -1
  268. package/ui/dialogs/index.ios.js.map +1 -1
  269. package/ui/editable-text-base/editable-text-base-common.js.map +1 -1
  270. package/ui/editable-text-base/index.android.js +2 -1
  271. package/ui/editable-text-base/index.android.js.map +1 -1
  272. package/ui/editable-text-base/index.ios.js.map +1 -1
  273. package/ui/embedding/index.android.js.map +1 -1
  274. package/ui/embedding/index.ios.js.map +1 -1
  275. package/ui/enums/enums.js.map +1 -1
  276. package/ui/enums/index.js.map +1 -1
  277. package/ui/frame/activity.android.js.map +1 -1
  278. package/ui/frame/fragment.android.js.map +1 -1
  279. package/ui/frame/fragment.ios.js.map +1 -1
  280. package/ui/frame/fragment.transitions.android.d.ts +4 -4
  281. package/ui/frame/fragment.transitions.android.js +95 -78
  282. package/ui/frame/fragment.transitions.android.js.map +1 -1
  283. package/ui/frame/fragment.transitions.types.js.map +1 -1
  284. package/ui/frame/frame-common.d.ts +14 -2
  285. package/ui/frame/frame-common.js +51 -24
  286. package/ui/frame/frame-common.js.map +1 -1
  287. package/ui/frame/frame-constants.d.ts +9 -0
  288. package/ui/frame/frame-constants.js +10 -0
  289. package/ui/frame/frame-constants.js.map +1 -0
  290. package/ui/frame/frame-helper-for-android.d.ts +2 -2
  291. package/ui/frame/frame-helper-for-android.js +14 -5
  292. package/ui/frame/frame-helper-for-android.js.map +1 -1
  293. package/ui/frame/frame-helpers.js.map +1 -1
  294. package/ui/frame/frame-interfaces.d.ts +1 -1
  295. package/ui/frame/frame-interfaces.js.map +1 -1
  296. package/ui/frame/frame-stack.d.ts +22 -1
  297. package/ui/frame/frame-stack.js +43 -5
  298. package/ui/frame/frame-stack.js.map +1 -1
  299. package/ui/frame/index.android.d.ts +1 -2
  300. package/ui/frame/index.android.js +152 -53
  301. package/ui/frame/index.android.js.map +1 -1
  302. package/ui/frame/index.d.ts +15 -5
  303. package/ui/frame/index.ios.d.ts +1 -1
  304. package/ui/frame/index.ios.js +86 -26
  305. package/ui/frame/index.ios.js.map +1 -1
  306. package/ui/gestures/gestures-common.js.map +1 -1
  307. package/ui/gestures/gestures-types.d.ts +2 -0
  308. package/ui/gestures/gestures-types.js.map +1 -1
  309. package/ui/gestures/index.android.d.ts +1 -1
  310. package/ui/gestures/index.android.js +159 -124
  311. package/ui/gestures/index.android.js.map +1 -1
  312. package/ui/gestures/index.ios.js +30 -1
  313. package/ui/gestures/index.ios.js.map +1 -1
  314. package/ui/gestures/touch-manager.d.ts +1 -2
  315. package/ui/gestures/touch-manager.js +79 -50
  316. package/ui/gestures/touch-manager.js.map +1 -1
  317. package/ui/html-view/html-view-common.js.map +1 -1
  318. package/ui/html-view/index.android.js.map +1 -1
  319. package/ui/html-view/index.ios.js.map +1 -1
  320. package/ui/image/image-common.js +1 -1
  321. package/ui/image/image-common.js.map +1 -1
  322. package/ui/image/index.android.js +13 -1
  323. package/ui/image/index.android.js.map +1 -1
  324. package/ui/image/index.ios.js.map +1 -1
  325. package/ui/image/symbol-effects-common.js.map +1 -1
  326. package/ui/image/symbol-effects.android.js.map +1 -1
  327. package/ui/image/symbol-effects.ios.js.map +1 -1
  328. package/ui/image-cache/image-cache-common.js.map +1 -1
  329. package/ui/image-cache/index.android.js.map +1 -1
  330. package/ui/image-cache/index.ios.js.map +1 -1
  331. package/ui/index.d.ts +1 -1
  332. package/ui/index.js.map +1 -1
  333. package/ui/label/index.android.js.map +1 -1
  334. package/ui/label/index.ios.js.map +1 -1
  335. package/ui/layouts/absolute-layout/absolute-layout-common.js.map +1 -1
  336. package/ui/layouts/absolute-layout/index.android.js.map +1 -1
  337. package/ui/layouts/absolute-layout/index.ios.js +3 -0
  338. package/ui/layouts/absolute-layout/index.ios.js.map +1 -1
  339. package/ui/layouts/dock-layout/dock-layout-common.js.map +1 -1
  340. package/ui/layouts/dock-layout/index.android.js.map +1 -1
  341. package/ui/layouts/dock-layout/index.ios.js +3 -0
  342. package/ui/layouts/dock-layout/index.ios.js.map +1 -1
  343. package/ui/layouts/flexbox-layout/flexbox-layout-common.d.ts +7 -0
  344. package/ui/layouts/flexbox-layout/flexbox-layout-common.js +18 -0
  345. package/ui/layouts/flexbox-layout/flexbox-layout-common.js.map +1 -1
  346. package/ui/layouts/flexbox-layout/index.android.d.ts +5 -0
  347. package/ui/layouts/flexbox-layout/index.android.js +15 -0
  348. package/ui/layouts/flexbox-layout/index.android.js.map +1 -1
  349. package/ui/layouts/flexbox-layout/index.d.ts +19 -1
  350. package/ui/layouts/flexbox-layout/index.ios.d.ts +2 -0
  351. package/ui/layouts/flexbox-layout/index.ios.js +246 -195
  352. package/ui/layouts/flexbox-layout/index.ios.js.map +1 -1
  353. package/ui/layouts/grid-layout/grid-layout-common.js.map +1 -1
  354. package/ui/layouts/grid-layout/index.android.js.map +1 -1
  355. package/ui/layouts/grid-layout/index.ios.js +3 -0
  356. package/ui/layouts/grid-layout/index.ios.js.map +1 -1
  357. package/ui/layouts/index.js.map +1 -1
  358. package/ui/layouts/layout-base-common.d.ts +1 -0
  359. package/ui/layouts/layout-base-common.js +23 -1
  360. package/ui/layouts/layout-base-common.js.map +1 -1
  361. package/ui/layouts/layout-base.android.js.map +1 -1
  362. package/ui/layouts/layout-base.ios.js.map +1 -1
  363. package/ui/layouts/liquid-glass/index.android.js.map +1 -1
  364. package/ui/layouts/liquid-glass/index.ios.d.ts +0 -1
  365. package/ui/layouts/liquid-glass/index.ios.js +2 -43
  366. package/ui/layouts/liquid-glass/index.ios.js.map +1 -1
  367. package/ui/layouts/liquid-glass/liquid-glass-common.js.map +1 -1
  368. package/ui/layouts/liquid-glass-container/index.android.js.map +1 -1
  369. package/ui/layouts/liquid-glass-container/index.ios.d.ts +0 -1
  370. package/ui/layouts/liquid-glass-container/index.ios.js +2 -43
  371. package/ui/layouts/liquid-glass-container/index.ios.js.map +1 -1
  372. package/ui/layouts/liquid-glass-container/liquid-glass-container-common.js.map +1 -1
  373. package/ui/layouts/root-layout/index.android.js.map +1 -1
  374. package/ui/layouts/root-layout/index.ios.js.map +1 -1
  375. package/ui/layouts/root-layout/root-layout-common.js.map +1 -1
  376. package/ui/layouts/root-layout/root-layout-stack.js.map +1 -1
  377. package/ui/layouts/stack-layout/index.android.js.map +1 -1
  378. package/ui/layouts/stack-layout/index.ios.js +3 -0
  379. package/ui/layouts/stack-layout/index.ios.js.map +1 -1
  380. package/ui/layouts/stack-layout/stack-layout-common.js.map +1 -1
  381. package/ui/layouts/wrap-layout/index.android.js.map +1 -1
  382. package/ui/layouts/wrap-layout/index.ios.js +3 -0
  383. package/ui/layouts/wrap-layout/index.ios.js.map +1 -1
  384. package/ui/layouts/wrap-layout/wrap-layout-common.js.map +1 -1
  385. package/ui/list-picker/index.android.js.map +1 -1
  386. package/ui/list-picker/index.ios.js.map +1 -1
  387. package/ui/list-picker/list-picker-common.js.map +1 -1
  388. package/ui/list-view/index.android.js +2 -2
  389. package/ui/list-view/index.android.js.map +1 -1
  390. package/ui/list-view/index.d.ts +47 -3
  391. package/ui/list-view/index.ios.d.ts +13 -3
  392. package/ui/list-view/index.ios.js +132 -41
  393. package/ui/list-view/index.ios.js.map +1 -1
  394. package/ui/list-view/list-view-common.d.ts +19 -0
  395. package/ui/list-view/list-view-common.js +30 -0
  396. package/ui/list-view/list-view-common.js.map +1 -1
  397. package/ui/page/events.js.map +1 -1
  398. package/ui/page/index.android.js.map +1 -1
  399. package/ui/page/index.d.ts +1 -1
  400. package/ui/page/index.ios.d.ts +3 -1
  401. package/ui/page/index.ios.js +26 -17
  402. package/ui/page/index.ios.js.map +1 -1
  403. package/ui/page/page-common.d.ts +5 -1
  404. package/ui/page/page-common.js.map +1 -1
  405. package/ui/placeholder/index.android.js.map +1 -1
  406. package/ui/placeholder/index.js.map +1 -1
  407. package/ui/placeholder/placeholder-common.js.map +1 -1
  408. package/ui/progress/index.android.js.map +1 -1
  409. package/ui/progress/index.ios.js.map +1 -1
  410. package/ui/progress/progress-common.js.map +1 -1
  411. package/ui/proxy-view-container/index.js.map +1 -1
  412. package/ui/repeater/index.d.ts +2 -1
  413. package/ui/repeater/index.js.map +1 -1
  414. package/ui/scroll-view/index.android.d.ts +2 -1
  415. package/ui/scroll-view/index.android.js +4 -1
  416. package/ui/scroll-view/index.android.js.map +1 -1
  417. package/ui/scroll-view/index.d.ts +53 -0
  418. package/ui/scroll-view/index.ios.d.ts +13 -1
  419. package/ui/scroll-view/index.ios.js +100 -20
  420. package/ui/scroll-view/index.ios.js.map +1 -1
  421. package/ui/scroll-view/scroll-view-common.d.ts +13 -0
  422. package/ui/scroll-view/scroll-view-common.js +27 -0
  423. package/ui/scroll-view/scroll-view-common.js.map +1 -1
  424. package/ui/search-bar/index.android.js.map +1 -1
  425. package/ui/search-bar/index.ios.js.map +1 -1
  426. package/ui/search-bar/search-bar-common.js.map +1 -1
  427. package/ui/segmented-bar/index.android.js.map +1 -1
  428. package/ui/segmented-bar/index.ios.js.map +1 -1
  429. package/ui/segmented-bar/segmented-bar-common.d.ts +5 -1
  430. package/ui/segmented-bar/segmented-bar-common.js +6 -1
  431. package/ui/segmented-bar/segmented-bar-common.js.map +1 -1
  432. package/ui/slider/index.android.js.map +1 -1
  433. package/ui/slider/index.ios.js.map +1 -1
  434. package/ui/slider/slider-common.js.map +1 -1
  435. package/ui/split-view/index.android.js.map +1 -1
  436. package/ui/split-view/index.ios.js.map +1 -1
  437. package/ui/split-view/split-view-common.js.map +1 -1
  438. package/ui/styling/background-common.d.ts +2 -0
  439. package/ui/styling/background-common.js +8 -0
  440. package/ui/styling/background-common.js.map +1 -1
  441. package/ui/styling/background.android.d.ts +4 -1
  442. package/ui/styling/background.android.js +5 -2
  443. package/ui/styling/background.android.js.map +1 -1
  444. package/ui/styling/background.d.ts +1 -1
  445. package/ui/styling/background.ios.js +9 -2
  446. package/ui/styling/background.ios.js.map +1 -1
  447. package/ui/styling/box-shadow.js.map +1 -1
  448. package/ui/styling/clip-path-function.js.map +1 -1
  449. package/ui/styling/converters.js.map +1 -1
  450. package/ui/styling/css-animation-parser.js.map +1 -1
  451. package/ui/styling/css-selector.d.ts +60 -13
  452. package/ui/styling/css-selector.js +311 -50
  453. package/ui/styling/css-selector.js.map +1 -1
  454. package/ui/styling/css-shadow.js.map +1 -1
  455. package/ui/styling/css-stroke.js.map +1 -1
  456. package/ui/styling/css-transform.js.map +1 -1
  457. package/ui/styling/css-utils.d.ts +16 -0
  458. package/ui/styling/css-utils.js +121 -7
  459. package/ui/styling/css-utils.js.map +1 -1
  460. package/ui/styling/font-common.js.map +1 -1
  461. package/ui/styling/font-interfaces.js.map +1 -1
  462. package/ui/styling/font.android.js.map +1 -1
  463. package/ui/styling/font.ios.js.map +1 -1
  464. package/ui/styling/length-shared.d.ts +2 -0
  465. package/ui/styling/length-shared.js +29 -2
  466. package/ui/styling/length-shared.js.map +1 -1
  467. package/ui/styling/linear-gradient.js.map +1 -1
  468. package/ui/styling/style/index.d.ts +16 -0
  469. package/ui/styling/style/index.js +1 -0
  470. package/ui/styling/style/index.js.map +1 -1
  471. package/ui/styling/style-properties.d.ts +5 -0
  472. package/ui/styling/style-properties.js +172 -101
  473. package/ui/styling/style-properties.js.map +1 -1
  474. package/ui/styling/style-scope.d.ts +24 -3
  475. package/ui/styling/style-scope.js +455 -63
  476. package/ui/styling/style-scope.js.map +1 -1
  477. package/ui/styling/styling-profile.js.map +1 -1
  478. package/ui/styling/styling-shared.js.map +1 -1
  479. package/ui/switch/index.android.js.map +1 -1
  480. package/ui/switch/index.ios.js +5 -1
  481. package/ui/switch/index.ios.js.map +1 -1
  482. package/ui/switch/switch-common.js.map +1 -1
  483. package/ui/tab-view/index.android.js +4 -1
  484. package/ui/tab-view/index.android.js.map +1 -1
  485. package/ui/tab-view/index.d.ts +5 -3
  486. package/ui/tab-view/index.ios.d.ts +2 -1
  487. package/ui/tab-view/index.ios.js +81 -18
  488. package/ui/tab-view/index.ios.js.map +1 -1
  489. package/ui/tab-view/tab-view-common.d.ts +6 -1
  490. package/ui/tab-view/tab-view-common.js +17 -1
  491. package/ui/tab-view/tab-view-common.js.map +1 -1
  492. package/ui/text-base/formatted-string.js.map +1 -1
  493. package/ui/text-base/index.android.js +5 -8
  494. package/ui/text-base/index.android.js.map +1 -1
  495. package/ui/text-base/index.ios.d.ts +3 -0
  496. package/ui/text-base/index.ios.js +25 -3
  497. package/ui/text-base/index.ios.js.map +1 -1
  498. package/ui/text-base/span.js.map +1 -1
  499. package/ui/text-base/text-base-common.js.map +1 -1
  500. package/ui/text-field/index.android.js.map +1 -1
  501. package/ui/text-field/index.ios.js +13 -5
  502. package/ui/text-field/index.ios.js.map +1 -1
  503. package/ui/text-field/text-field-common.js.map +1 -1
  504. package/ui/text-view/index.android.js.map +1 -1
  505. package/ui/text-view/index.ios.js.map +1 -1
  506. package/ui/text-view/text-view-common.js.map +1 -1
  507. package/ui/time-picker/index.android.js.map +1 -1
  508. package/ui/time-picker/index.ios.js.map +1 -1
  509. package/ui/time-picker/time-picker-common.js.map +1 -1
  510. package/ui/transition/fade-transition.android.js.map +1 -1
  511. package/ui/transition/fade-transition.ios.js.map +1 -1
  512. package/ui/transition/flip-transition.android.js.map +1 -1
  513. package/ui/transition/index.android.js.map +1 -1
  514. package/ui/transition/index.d.ts +2 -1
  515. package/ui/transition/index.ios.js.map +1 -1
  516. package/ui/transition/modal-transition.android.js.map +1 -1
  517. package/ui/transition/modal-transition.ios.js +33 -5
  518. package/ui/transition/modal-transition.ios.js.map +1 -1
  519. package/ui/transition/page-transition.android.d.ts +4 -0
  520. package/ui/transition/page-transition.android.js +174 -45
  521. package/ui/transition/page-transition.android.js.map +1 -1
  522. package/ui/transition/page-transition.ios.d.ts +5 -0
  523. package/ui/transition/page-transition.ios.js +298 -36
  524. package/ui/transition/page-transition.ios.js.map +1 -1
  525. package/ui/transition/shared-transition-helper.android.d.ts +3 -0
  526. package/ui/transition/shared-transition-helper.android.js +9 -0
  527. package/ui/transition/shared-transition-helper.android.js.map +1 -1
  528. package/ui/transition/shared-transition-helper.d.ts +7 -0
  529. package/ui/transition/shared-transition-helper.ios.d.ts +48 -0
  530. package/ui/transition/shared-transition-helper.ios.js +977 -95
  531. package/ui/transition/shared-transition-helper.ios.js.map +1 -1
  532. package/ui/transition/shared-transition.d.ts +134 -0
  533. package/ui/transition/shared-transition.js +90 -2
  534. package/ui/transition/shared-transition.js.map +1 -1
  535. package/ui/transition/slide-transition.android.js.map +1 -1
  536. package/ui/transition/slide-transition.ios.js.map +1 -1
  537. package/ui/utils.android.js.map +1 -1
  538. package/ui/utils.d.ts +2 -0
  539. package/ui/utils.ios.js.map +1 -1
  540. package/ui/web-view/index.android.js.map +1 -1
  541. package/ui/web-view/index.ios.js.map +1 -1
  542. package/ui/web-view/web-view-common.js.map +1 -1
  543. package/ui/web-view/web-view-interfaces.js.map +1 -1
  544. package/utils/animation-helpers.js.map +1 -1
  545. package/utils/common.js.map +1 -1
  546. package/utils/constants.android.js.map +1 -1
  547. package/utils/constants.ios.js.map +1 -1
  548. package/utils/debug-source.js.map +1 -1
  549. package/utils/debug.js.map +1 -1
  550. package/utils/index.android.js.map +1 -1
  551. package/utils/index.ios.js.map +1 -1
  552. package/utils/layout-helper/index.android.js.map +1 -1
  553. package/utils/layout-helper/index.ios.js +11 -3
  554. package/utils/layout-helper/index.ios.js.map +1 -1
  555. package/utils/layout-helper/layout-helper-common.js.map +1 -1
  556. package/utils/layout-helper/layout-helper-shared.js.map +1 -1
  557. package/utils/lazy.js.map +1 -1
  558. package/utils/macrotask-scheduler.js.map +1 -1
  559. package/utils/mainthread-helper.android.js.map +1 -1
  560. package/utils/mainthread-helper.ios.js.map +1 -1
  561. package/utils/module-merge.js.map +1 -1
  562. package/utils/native-helper-for-android.js +6 -2
  563. package/utils/native-helper-for-android.js.map +1 -1
  564. package/utils/native-helper.android.d.ts +66 -2
  565. package/utils/native-helper.android.js.map +1 -1
  566. package/utils/native-helper.d.ts +2 -2
  567. package/utils/native-helper.ios.d.ts +52 -2
  568. package/utils/native-helper.ios.js +35 -5
  569. package/utils/native-helper.ios.js.map +1 -1
  570. package/utils/native-helper.types.d.ts +2 -0
  571. package/utils/number-utils.js.map +1 -1
  572. package/utils/platform-check.d.ts +1 -1
  573. package/utils/platform-check.js.map +1 -1
  574. package/utils/shared.js.map +1 -1
  575. package/utils/types.js.map +1 -1
  576. package/utils/utils-shared.js.map +1 -1
  577. package/wgc/atob.js.map +1 -1
  578. package/wgc/btoa.js.map +1 -1
  579. package/wgc/crypto/SubtleCrypto.js.map +1 -1
  580. package/wgc/crypto/index.d.ts +1 -1
  581. package/wgc/crypto/index.js +12 -8
  582. package/wgc/crypto/index.js.map +1 -1
  583. package/wgc/index.js.map +1 -1
  584. package/xhr/index.js.map +1 -1
  585. package/xml/index.js.map +1 -1
@@ -17,8 +17,6 @@
17
17
  package org.nativescript.widgets;
18
18
 
19
19
  import android.content.Context;
20
- import android.graphics.Canvas;
21
- import android.graphics.drawable.Drawable;
22
20
  import android.util.AttributeSet;
23
21
  import android.util.SparseIntArray;
24
22
  import android.view.View;
@@ -51,12 +49,8 @@ import java.util.List;
51
49
  * <li>{@code justifyContent}</li>
52
50
  * <li>{@code alignItems}</li>
53
51
  * <li>{@code alignContent}</li>
54
- * <li>{@code showDivider}</li>
55
- * <li>{@code showDividerHorizontal}</li>
56
- * <li>{@code showDividerVertical}</li>
57
- * <li>{@code dividerDrawable}</li>
58
- * <li>{@code dividerDrawableHorizontal}</li>
59
- * <li>{@code dividerDrawableVertical}</li>
52
+ * <li>{@code rowGap}</li>
53
+ * <li>{@code columnGap}</li>
60
54
  * </ul>
61
55
  * for the FlexboxLayout.
62
56
  * <p>
@@ -221,77 +215,13 @@ public class FlexboxLayout extends LayoutBase {
221
215
  private int mAlignContent = ALIGN_CONTENT_STRETCH;
222
216
 
223
217
  /**
224
- * The int definition to be used as the arguments for the {@link #setShowDivider(int)},
225
- * {@link #setShowDividerHorizontal(int)} or {@link #setShowDividerVertical(int)}.
226
- * One or more of the values (such as
227
- * {@link #SHOW_DIVIDER_BEGINNING} | {@link #SHOW_DIVIDER_MIDDLE}) can be passed to those set
228
- * methods.
218
+ * This attribute controls the row gap in the flex container.
229
219
  */
230
- @IntDef(flag = true,
231
- value = {
232
- SHOW_DIVIDER_NONE,
233
- SHOW_DIVIDER_BEGINNING,
234
- SHOW_DIVIDER_MIDDLE,
235
- SHOW_DIVIDER_END
236
- })
237
- @Retention(RetentionPolicy.SOURCE)
238
- public @interface DividerMode {
239
-
240
- }
241
-
242
- /**
243
- * Constant to how no dividers
244
- */
245
- public static final int SHOW_DIVIDER_NONE = 0;
246
-
247
- /**
248
- * Constant to show a divider at the beginning of the flex lines (or flex items).
249
- */
250
- public static final int SHOW_DIVIDER_BEGINNING = 1;
251
-
252
- /**
253
- * Constant to show dividers between flex lines or flex items.
254
- */
255
- public static final int SHOW_DIVIDER_MIDDLE = 1 << 1;
256
-
257
- /**
258
- * Constant to show a divider at the end of the flex lines or flex items.
259
- */
260
- public static final int SHOW_DIVIDER_END = 1 << 2;
261
-
262
- /**
263
- * The drawable to be drawn for the horizontal dividers.
264
- */
265
- private Drawable mDividerDrawableHorizontal;
266
-
267
- /**
268
- * The drawable to be drawn for the vertical dividers.
269
- */
270
- private Drawable mDividerDrawableVertical;
271
-
220
+ private int mRowGap = 0;
272
221
  /**
273
- * Indicates the divider mode for the {@link #mDividerDrawableHorizontal}. The value needs to
274
- * be the combination of the value of {@link #SHOW_DIVIDER_NONE},
275
- * {@link #SHOW_DIVIDER_BEGINNING}, {@link #SHOW_DIVIDER_MIDDLE} and {@link #SHOW_DIVIDER_END}
222
+ * This attribute controls the column gap in the flex container.
276
223
  */
277
- private int mShowDividerHorizontal;
278
-
279
- /**
280
- * Indicates the divider mode for the {@link #mDividerDrawableVertical}. The value needs to
281
- * be the combination of the value of {@link #SHOW_DIVIDER_NONE},
282
- * {@link #SHOW_DIVIDER_BEGINNING}, {@link #SHOW_DIVIDER_MIDDLE} and {@link #SHOW_DIVIDER_END}
283
- */
284
- private int mShowDividerVertical;
285
-
286
- /**
287
- * The height of the {@link #mDividerDrawableHorizontal}.
288
- */
289
- private int mDividerHorizontalHeight;
290
-
291
- /**
292
- * The width of the {@link #mDividerDrawableVertical}.
293
- */
294
- private int mDividerVerticalWidth;
224
+ private int mColumnGap = 0;
295
225
 
296
226
  /**
297
227
  * Holds reordered indices, which {@link LayoutParams#order} parameters are taken into account
@@ -324,47 +254,6 @@ public class FlexboxLayout extends LayoutBase {
324
254
 
325
255
  public FlexboxLayout(Context context, AttributeSet attrs, int defStyleAttr) {
326
256
  super(context, attrs, defStyleAttr);
327
-
328
- // NOTE: We do not support android xml.
329
- // TypedArray a = context.obtainStyledAttributes(
330
- // attrs, R.styleable.FlexboxLayout, defStyleAttr, 0);
331
- // mFlexDirection = a.getInt(R.styleable.FlexboxLayout_flexDirection, FLEX_DIRECTION_ROW);
332
- // mFlexWrap = a.getInt(R.styleable.FlexboxLayout_flexWrap, FLEX_WRAP_NOWRAP);
333
- // mJustifyContent = a
334
- // .getInt(R.styleable.FlexboxLayout_justifyContent, JUSTIFY_CONTENT_FLEX_START);
335
- // mAlignItems = a.getInt(R.styleable.FlexboxLayout_alignItems, ALIGN_ITEMS_STRETCH);
336
- // mAlignContent = a.getInt(R.styleable.FlexboxLayout_alignContent, ALIGN_CONTENT_STRETCH);
337
- // Drawable drawable = a.getDrawable(R.styleable.FlexboxLayout_dividerDrawable);
338
- // if (drawable != null) {
339
- // setDividerDrawableHorizontal(drawable);
340
- // setDividerDrawableVertical(drawable);
341
- // }
342
- // Drawable drawableHorizontal = a
343
- // .getDrawable(R.styleable.FlexboxLayout_dividerDrawableHorizontal);
344
- // if (drawableHorizontal != null) {
345
- // setDividerDrawableHorizontal(drawableHorizontal);
346
- // }
347
- // Drawable drawableVertical = a
348
- // .getDrawable(R.styleable.FlexboxLayout_dividerDrawableVertical);
349
- // if (drawableVertical != null) {
350
- // setDividerDrawableVertical(drawableVertical);
351
- // }
352
- // int dividerMode = a.getInt(R.styleable.FlexboxLayout_showDivider, SHOW_DIVIDER_NONE);
353
- // if (dividerMode != SHOW_DIVIDER_NONE) {
354
- // mShowDividerVertical = dividerMode;
355
- // mShowDividerHorizontal = dividerMode;
356
- // }
357
- // int dividerModeVertical = a
358
- // .getInt(R.styleable.FlexboxLayout_showDividerVertical, SHOW_DIVIDER_NONE);
359
- // if (dividerModeVertical != SHOW_DIVIDER_NONE) {
360
- // mShowDividerVertical = dividerModeVertical;
361
- // }
362
- // int dividerModeHorizontal = a
363
- // .getInt(R.styleable.FlexboxLayout_showDividerHorizontal, SHOW_DIVIDER_NONE);
364
- // if (dividerModeHorizontal != SHOW_DIVIDER_NONE) {
365
- // mShowDividerHorizontal = dividerModeHorizontal;
366
- // }
367
- // a.recycle();
368
257
  }
369
258
 
370
259
  @Override
@@ -482,13 +371,15 @@ public class FlexboxLayout extends LayoutBase {
482
371
  Collections.sort(orders);
483
372
  if (mOrderCache == null) {
484
373
  mOrderCache = new SparseIntArray(childCount);
374
+ } else {
375
+ mOrderCache.clear();
485
376
  }
486
- mOrderCache.clear();
377
+
487
378
  int[] reorderedIndices = new int[childCount];
488
379
  int i = 0;
489
380
  for (Order order : orders) {
490
381
  reorderedIndices[i] = order.index;
491
- mOrderCache.append(i, order.order);
382
+ mOrderCache.append(order.index, order.order);
492
383
  i++;
493
384
  }
494
385
  return reorderedIndices;
@@ -496,7 +387,7 @@ public class FlexboxLayout extends LayoutBase {
496
387
 
497
388
  @NonNull
498
389
  private List<Order> createOrders(int childCount) {
499
- List<Order> orders = new ArrayList<>();
390
+ List<Order> orders = new ArrayList<>(childCount);
500
391
  for (int i = 0; i < childCount; i++) {
501
392
  View child = getChildAt(i);
502
393
  LayoutParams params = (LayoutParams) child.getLayoutParams();
@@ -555,6 +446,7 @@ public class FlexboxLayout extends LayoutBase {
555
446
  * @see #setFlexWrap(int)
556
447
  * @see #setAlignItems(int)
557
448
  * @see #setAlignContent(int)
449
+ * @see #setColumnGap(int)
558
450
  */
559
451
  private void measureHorizontal(int widthMeasureSpec, int heightMeasureSpec) {
560
452
  int widthMode = MeasureSpec.getMode(widthMeasureSpec);
@@ -566,109 +458,107 @@ public class FlexboxLayout extends LayoutBase {
566
458
  // Determine how many flex lines are needed in this layout by measuring each child.
567
459
  // (Expand or shrink the view depending on the flexGrow and flexShrink attributes in a later
568
460
  // loop)
569
- {
570
- int childCount = getChildCount();
571
- int paddingStart = ViewCompat.getPaddingStart(this);
572
- int paddingEnd = ViewCompat.getPaddingEnd(this);
573
- int largestHeightInRow = Integer.MIN_VALUE;
574
- FlexLine flexLine = new FlexLine();
575
-
576
- // The index of the view in a same flex line.
577
- int indexInFlexLine = 0;
578
- flexLine.mMainSize = paddingStart + paddingEnd;
579
- for (int i = 0; i < childCount; i++) {
580
- View child = getReorderedChildAt(i);
581
- if (child == null) {
582
- addFlexLineIfLastFlexItem(i, childCount, flexLine);
583
- continue;
584
- } else if (child.getVisibility() == View.GONE) {
585
- flexLine.mItemCount++;
586
- flexLine.mGoneItemCount++;
587
- addFlexLineIfLastFlexItem(i, childCount, flexLine);
588
- continue;
589
- }
461
+ int childCount = getChildCount();
462
+ int paddingStart = ViewCompat.getPaddingStart(this);
463
+ int paddingEnd = ViewCompat.getPaddingEnd(this);
464
+ int largestHeightInRow = Integer.MIN_VALUE;
465
+ FlexLine flexLine = new FlexLine();
590
466
 
591
- FlexboxLayout.LayoutParams lp = (LayoutParams) child.getLayoutParams();
592
- if (lp.alignSelf == LayoutParams.ALIGN_SELF_STRETCH) {
593
- flexLine.mIndicesAlignSelfStretch.add(i);
594
- }
467
+ // The index of the view in a same flex line.
468
+ int indexInFlexLine = 0;
469
+ flexLine.mMainSize = paddingStart + paddingEnd;
470
+ for (int i = 0; i < childCount; i++) {
471
+ View child = getReorderedChildAt(i);
472
+ if (child == null) {
473
+ addFlexLineIfLastFlexItem(i, childCount, flexLine);
474
+ continue;
475
+ } else if (child.getVisibility() == View.GONE) {
476
+ flexLine.mItemCount++;
477
+ flexLine.mGoneItemCount++;
478
+ addFlexLineIfLastFlexItem(i, childCount, flexLine);
479
+ continue;
480
+ }
595
481
 
596
- int childWidth = lp.width;
597
- if (lp.flexBasisPercent != LayoutParams.FLEX_BASIS_PERCENT_DEFAULT
598
- && widthMode == MeasureSpec.EXACTLY) {
599
- childWidth = Math.round(widthSize * lp.flexBasisPercent);
600
- // Use the dimension from the layout_width attribute if the widthMode is not
601
- // MeasureSpec.EXACTLY even if any fraction value is set to
602
- // layout_flexBasisPercent.
603
- // There are likely quite few use cases where assigning any fraction values
604
- // with widthMode is not MeasureSpec.EXACTLY (e.g. FlexboxLayout's layout_width
605
- // is set to wrap_content)
606
- }
607
- int childWidthMeasureSpec = getChildMeasureSpec(widthMeasureSpec,
608
- getPaddingLeft() + getPaddingRight() + lp.leftMargin
609
- + lp.rightMargin, childWidth < 0 ? LayoutParams.WRAP_CONTENT : childWidth);
610
- int childHeightMeasureSpec = getChildMeasureSpec(heightMeasureSpec,
611
- getPaddingTop() + getPaddingBottom() + lp.topMargin
612
- + lp.bottomMargin, lp.height < 0 ? LayoutParams.WRAP_CONTENT : lp.height);
613
-
614
- child.measure(childWidthMeasureSpec, childHeightMeasureSpec);
615
-
616
- // Check the size constraint after the first measurement for the child
617
- // To prevent the child's width/height violate the size constraints imposed by the
618
- // {@link LayoutParams#minWidth}, {@link LayoutParams#minHeight},
619
- // {@link LayoutParams#maxWidth} and {@link LayoutParams#maxHeight} attributes.
620
- // E.g. When the child's layout_width is wrap_content the measured width may be
621
- // less than the min width after the first measurement.
622
- checkSizeConstraints(child);
623
-
624
- childState = View.combineMeasuredStates(childState, child.getMeasuredState());
625
- largestHeightInRow = Math.max(largestHeightInRow,
626
- child.getMeasuredHeight() + lp.topMargin + lp.bottomMargin);
627
-
628
- if (isWrapRequired(widthMode, widthSize, flexLine.mMainSize,
629
- child.getMeasuredWidth() + lp.leftMargin + lp.rightMargin, lp,
630
- i, indexInFlexLine)) {
631
- if (flexLine.getLayoutVisibleItemCount() > 0) {
632
- addFlexLine(flexLine);
633
- }
482
+ FlexboxLayout.LayoutParams lp = (LayoutParams) child.getLayoutParams();
483
+ if (lp.alignSelf == LayoutParams.ALIGN_SELF_STRETCH) {
484
+ flexLine.mIndicesAlignSelfStretch.add(i);
485
+ }
634
486
 
635
- flexLine = new FlexLine();
636
- flexLine.mItemCount = 1;
637
- flexLine.mMainSize = paddingStart + paddingEnd;
638
- largestHeightInRow = child.getMeasuredHeight() + lp.topMargin + lp.bottomMargin;
639
- indexInFlexLine = 0;
640
- } else {
641
- flexLine.mItemCount++;
642
- indexInFlexLine++;
643
- }
644
- flexLine.mMainSize += child.getMeasuredWidth() + lp.leftMargin + lp.rightMargin;
645
- flexLine.mTotalFlexGrow += lp.flexGrow;
646
- flexLine.mTotalFlexShrink += lp.flexShrink;
647
- // Temporarily set the cross axis length as the largest child in the row
648
- // Expand along the cross axis depending on the mAlignContent property if needed
649
- // later
650
- flexLine.mCrossSize = Math.max(flexLine.mCrossSize, largestHeightInRow);
651
-
652
- // Check if the beginning or middle divider is required for the flex item
653
- if (hasDividerBeforeChildAtAlongMainAxis(i, indexInFlexLine)) {
654
- flexLine.mMainSize += mDividerVerticalWidth;
655
- flexLine.mDividerLengthInMainSize += mDividerVerticalWidth;
656
- }
487
+ int childWidth = lp.width;
488
+ if (lp.flexBasisPercent != LayoutParams.FLEX_BASIS_PERCENT_DEFAULT
489
+ && widthMode == MeasureSpec.EXACTLY) {
490
+ childWidth = Math.round(widthSize * lp.flexBasisPercent);
491
+ // Use the dimension from the layout_width attribute if the widthMode is not
492
+ // MeasureSpec.EXACTLY even if any fraction value is set to
493
+ // layout_flexBasisPercent.
494
+ // There are likely quite few use cases where assigning any fraction values
495
+ // with widthMode is not MeasureSpec.EXACTLY (e.g. FlexboxLayout's layout_width
496
+ // is set to wrap_content)
497
+ }
498
+ int childWidthMeasureSpec = getChildMeasureSpec(widthMeasureSpec,
499
+ getPaddingLeft() + getPaddingRight() + lp.leftMargin
500
+ + lp.rightMargin, childWidth < 0 ? LayoutParams.WRAP_CONTENT : childWidth);
501
+ int childHeightMeasureSpec = getChildMeasureSpec(heightMeasureSpec,
502
+ getPaddingTop() + getPaddingBottom() + lp.topMargin
503
+ + lp.bottomMargin, lp.height < 0 ? LayoutParams.WRAP_CONTENT : lp.height);
657
504
 
658
- if (mFlexWrap != FLEX_WRAP_WRAP_REVERSE) {
659
- flexLine.mMaxBaseline = Math
660
- .max(flexLine.mMaxBaseline, child.getBaseline() + lp.topMargin);
661
- } else {
662
- // if the flex wrap property is FLEX_WRAP_WRAP_REVERSE, calculate the
663
- // baseline as the distance from the cross end and the baseline
664
- // since the cross size calculation is based on the distance from the cross end
665
- flexLine.mMaxBaseline = Math
666
- .max(flexLine.mMaxBaseline,
667
- child.getMeasuredHeight() - child.getBaseline()
668
- + lp.bottomMargin);
505
+ child.measure(childWidthMeasureSpec, childHeightMeasureSpec);
506
+
507
+ // Check the size constraint after the first measurement for the child
508
+ // To prevent the child's width/height violate the size constraints imposed by the
509
+ // {@link LayoutParams#minWidth}, {@link LayoutParams#minHeight},
510
+ // {@link LayoutParams#maxWidth} and {@link LayoutParams#maxHeight} attributes.
511
+ // E.g. When the child's layout_width is wrap_content the measured width may be
512
+ // less than the min width after the first measurement.
513
+ checkSizeConstraints(child);
514
+
515
+ childState = View.combineMeasuredStates(childState, child.getMeasuredState());
516
+ largestHeightInRow = Math.max(largestHeightInRow,
517
+ child.getMeasuredHeight() + lp.topMargin + lp.bottomMargin);
518
+
519
+ if (isWrapRequired(widthMode, widthSize, flexLine.mMainSize,
520
+ child.getMeasuredWidth() + lp.leftMargin + lp.rightMargin, lp,
521
+ i, indexInFlexLine)) {
522
+ if (flexLine.getLayoutVisibleItemCount() > 0) {
523
+ addFlexLine(flexLine);
669
524
  }
670
- addFlexLineIfLastFlexItem(i, childCount, flexLine);
525
+
526
+ flexLine = new FlexLine();
527
+ flexLine.mItemCount = 1;
528
+ flexLine.mMainSize = paddingStart + paddingEnd;
529
+ largestHeightInRow = child.getMeasuredHeight() + lp.topMargin + lp.bottomMargin;
530
+ indexInFlexLine = 0;
531
+ } else {
532
+ flexLine.mItemCount++;
533
+ indexInFlexLine++;
534
+ }
535
+ flexLine.mMainSize += child.getMeasuredWidth() + lp.leftMargin + lp.rightMargin;
536
+ flexLine.mTotalFlexGrow += lp.flexGrow;
537
+ flexLine.mTotalFlexShrink += lp.flexShrink;
538
+ // Temporarily set the cross axis length as the largest child in the row
539
+ // Expand along the cross axis depending on the mAlignContent property if needed
540
+ // later
541
+ flexLine.mCrossSize = Math.max(flexLine.mCrossSize, largestHeightInRow);
542
+
543
+ // Check if column gap is required for the flex item
544
+ if (mColumnGap > 0 && hasPrecedingViews(i, indexInFlexLine)) {
545
+ flexLine.mMainSize += mColumnGap;
546
+ flexLine.mGapLengthInMainSize += mColumnGap;
547
+ }
548
+
549
+ if (mFlexWrap != FLEX_WRAP_WRAP_REVERSE) {
550
+ flexLine.mMaxBaseline = Math
551
+ .max(flexLine.mMaxBaseline, child.getBaseline() + lp.topMargin);
552
+ } else {
553
+ // if the flex wrap property is FLEX_WRAP_WRAP_REVERSE, calculate the
554
+ // baseline as the distance from the cross end and the baseline
555
+ // since the cross size calculation is based on the distance from the cross end
556
+ flexLine.mMaxBaseline = Math
557
+ .max(flexLine.mMaxBaseline,
558
+ child.getMeasuredHeight() - child.getBaseline()
559
+ + lp.bottomMargin);
671
560
  }
561
+ addFlexLineIfLastFlexItem(i, childCount, flexLine);
672
562
  }
673
563
 
674
564
  determineMainSize(mFlexDirection, widthMeasureSpec, heightMeasureSpec);
@@ -676,28 +566,28 @@ public class FlexboxLayout extends LayoutBase {
676
566
  // TODO: Consider the case any individual child's alignSelf is set to ALIGN_SELF_BASELINE
677
567
  if (mAlignItems == ALIGN_ITEMS_BASELINE) {
678
568
  int viewIndex = 0;
679
- for (FlexLine flexLine : mFlexLines) {
569
+ for (FlexLine fl : mFlexLines) {
680
570
  // The largest height value that also take the baseline shift into account
681
571
  int largestHeightInLine = Integer.MIN_VALUE;
682
- for (int i = viewIndex; i < viewIndex + flexLine.mItemCount; i++) {
572
+ for (int i = viewIndex; i < viewIndex + fl.mItemCount; i++) {
683
573
  View child = getReorderedChildAt(i);
684
574
  LayoutParams lp = (LayoutParams) child.getLayoutParams();
685
-
575
+
686
576
  if (mFlexWrap != FLEX_WRAP_WRAP_REVERSE) {
687
- int marginTop = flexLine.mMaxBaseline - child.getBaseline();
577
+ int marginTop = fl.mMaxBaseline - child.getBaseline();
688
578
  marginTop = Math.max(marginTop, lp.topMargin);
689
579
  largestHeightInLine = Math.max(largestHeightInLine,
690
580
  child.getMeasuredHeight() + marginTop + lp.bottomMargin);
691
581
  } else {
692
- int marginBottom = flexLine.mMaxBaseline - child.getMeasuredHeight() +
582
+ int marginBottom = fl.mMaxBaseline - child.getMeasuredHeight() +
693
583
  child.getBaseline();
694
584
  marginBottom = Math.max(marginBottom, lp.bottomMargin);
695
585
  largestHeightInLine = Math.max(largestHeightInLine,
696
586
  child.getMeasuredHeight() + lp.topMargin + marginBottom);
697
587
  }
698
588
  }
699
- flexLine.mCrossSize = largestHeightInLine;
700
- viewIndex += flexLine.mItemCount;
589
+ fl.mCrossSize = largestHeightInLine;
590
+ viewIndex += fl.mItemCount;
701
591
  }
702
592
  }
703
593
 
@@ -721,6 +611,8 @@ public class FlexboxLayout extends LayoutBase {
721
611
  * @see #setFlexWrap(int)
722
612
  * @see #setAlignItems(int)
723
613
  * @see #setAlignContent(int)
614
+ * @see #getRowGap()
615
+ * @see #setRowGap(int)
724
616
  */
725
617
  private void measureVertical(int widthMeasureSpec, int heightMeasureSpec) {
726
618
  int heightMode = MeasureSpec.getMode(heightMeasureSpec);
@@ -814,8 +706,8 @@ public class FlexboxLayout extends LayoutBase {
814
706
  // later
815
707
  flexLine.mCrossSize = Math.max(flexLine.mCrossSize, largestWidthInColumn);
816
708
 
817
- if (hasDividerBeforeChildAtAlongMainAxis(i, indexInFlexLine)) {
818
- flexLine.mMainSize += mDividerHorizontalHeight;
709
+ if (mRowGap > 0 && hasPrecedingViews(i, indexInFlexLine)) {
710
+ flexLine.mMainSize += mRowGap;
819
711
  }
820
712
  addFlexLineIfLastFlexItem(i, childCount, flexLine);
821
713
  }
@@ -846,7 +738,7 @@ public class FlexboxLayout extends LayoutBase {
846
738
  if (view.getMeasuredWidth() < lp.minWidth) {
847
739
  needsMeasure = true;
848
740
  childWidth = lp.minWidth;
849
- } else if (view.getMeasuredWidth() > lp.maxWidth) {
741
+ } else if (lp.maxWidth >= 0 && view.getMeasuredWidth() > lp.maxWidth) {
850
742
  needsMeasure = true;
851
743
  childWidth = lp.maxWidth;
852
744
  }
@@ -854,7 +746,7 @@ public class FlexboxLayout extends LayoutBase {
854
746
  if (childHeight < lp.minHeight) {
855
747
  needsMeasure = true;
856
748
  childHeight = lp.minHeight;
857
- } else if (childHeight > lp.maxHeight) {
749
+ } else if (lp.maxHeight >= 0 && childHeight > lp.maxHeight) {
858
750
  needsMeasure = true;
859
751
  childHeight = lp.maxHeight;
860
752
  }
@@ -872,19 +764,6 @@ public class FlexboxLayout extends LayoutBase {
872
764
  }
873
765
 
874
766
  private void addFlexLine(FlexLine flexLine) {
875
- // The size of the end divider isn't added until the flexLine is added to the flex container
876
- // take the divider width (or height) into account when adding the flex line.
877
- if (isMainAxisDirectionHorizontal(mFlexDirection)) {
878
- if ((mShowDividerVertical & SHOW_DIVIDER_END) > 0) {
879
- flexLine.mMainSize += mDividerVerticalWidth;
880
- flexLine.mDividerLengthInMainSize += mDividerVerticalWidth;
881
- }
882
- } else {
883
- if ((mShowDividerHorizontal & SHOW_DIVIDER_END) > 0) {
884
- flexLine.mMainSize += mDividerHorizontalHeight;
885
- flexLine.mDividerLengthInMainSize += mDividerHorizontalHeight;
886
- }
887
- }
888
767
  mFlexLines.add(flexLine);
889
768
  }
890
769
 
@@ -968,7 +847,7 @@ public class FlexboxLayout extends LayoutBase {
968
847
  int sizeBeforeExpand = flexLine.mMainSize;
969
848
  boolean needsReExpand = false;
970
849
  float unitSpace = (maxMainSize - flexLine.mMainSize) / flexLine.mTotalFlexGrow;
971
- flexLine.mMainSize = paddingAlongMainAxis + flexLine.mDividerLengthInMainSize;
850
+ flexLine.mMainSize = paddingAlongMainAxis + flexLine.mGapLengthInMainSize;
972
851
  float accumulatedRoundError = 0;
973
852
  for (int i = 0; i < flexLine.mItemCount; i++) {
974
853
  View child = getReorderedChildAt(childIndex);
@@ -984,7 +863,7 @@ public class FlexboxLayout extends LayoutBase {
984
863
  if (!mChildrenFrozen[childIndex]) {
985
864
  float rawCalculatedWidth = child.getMeasuredWidth() + unitSpace * lp.flexGrow + accumulatedRoundError;
986
865
  int roundedCalculatedWidth = Math.round(rawCalculatedWidth);
987
- if (roundedCalculatedWidth > lp.maxWidth) {
866
+ if (lp.maxWidth >= 0 && roundedCalculatedWidth > lp.maxWidth) {
988
867
  // This means the child can't expand beyond the value of the maxWidth attribute.
989
868
  // To adjust the flex line length to the size of maxMainSize, remaining
990
869
  // positive free space needs to be re-distributed to other flex items
@@ -1008,7 +887,7 @@ public class FlexboxLayout extends LayoutBase {
1008
887
  if (!mChildrenFrozen[childIndex]) {
1009
888
  float rawCalculatedHeight = child.getMeasuredHeight() + unitSpace * lp.flexGrow;
1010
889
  int roundedCalculatedHeight = Math.round(rawCalculatedHeight);
1011
- if (roundedCalculatedHeight > lp.maxHeight) {
890
+ if (lp.maxHeight >= 0 && roundedCalculatedHeight > lp.maxHeight) {
1012
891
  // This means the child can't expand beyond the value of the maxHeight
1013
892
  // attribute.
1014
893
  // To adjust the flex line length to the size of maxMainSize, remaining
@@ -1046,7 +925,7 @@ public class FlexboxLayout extends LayoutBase {
1046
925
  * @param flexDirection the flexDirection value for this FlexboxLayout
1047
926
  * @param maxMainSize the maximum main size. Shrank main size will be this size
1048
927
  * @param paddingAlongMainAxis the padding value along the main axis
1049
- * @param startIndex the start index of the children views to be shrank. This index
928
+ * @param startIndex the start index of the children views to be shrunk. This index
1050
929
  * needs to
1051
930
  * be an absolute index in the flex container (FlexboxLayout),
1052
931
  * not the relative index in the flex line.
@@ -1066,7 +945,7 @@ public class FlexboxLayout extends LayoutBase {
1066
945
  boolean needsReShrink = false;
1067
946
  float unitShrink = (flexLine.mMainSize - maxMainSize) / flexLine.mTotalFlexShrink;
1068
947
  float accumulatedRoundError = 0;
1069
- flexLine.mMainSize = paddingAlongMainAxis + flexLine.mDividerLengthInMainSize;
948
+ flexLine.mMainSize = paddingAlongMainAxis + flexLine.mGapLengthInMainSize;
1070
949
  for (int i = 0; i < flexLine.mItemCount; i++) {
1071
950
  View child = getReorderedChildAt(childIndex);
1072
951
  if (child == null) {
@@ -1490,6 +1369,10 @@ public class FlexboxLayout extends LayoutBase {
1490
1369
  * @return {@code true} if a wrap is required, {@code false} otherwise
1491
1370
  * @see #getFlexWrap()
1492
1371
  * @see #setFlexWrap(int)
1372
+ * @see #getRowGap()
1373
+ * @see #setRowGap(int)
1374
+ * @see #getColumnGap()
1375
+ * @see #setColumnGap(int)
1493
1376
  */
1494
1377
  private boolean isWrapRequired(int mode, int maxSize, int currentLength, int childLength,
1495
1378
  LayoutParams lp, int childAbsoluteIndex, int childRelativeIndexInFlexLine) {
@@ -1503,20 +1386,14 @@ public class FlexboxLayout extends LayoutBase {
1503
1386
  return false;
1504
1387
  }
1505
1388
  if (isMainAxisDirectionHorizontal(mFlexDirection)) {
1506
- if (hasDividerBeforeChildAtAlongMainAxis(childAbsoluteIndex,
1389
+ if (mColumnGap > 0 && hasPrecedingViews(childAbsoluteIndex,
1507
1390
  childRelativeIndexInFlexLine)) {
1508
- childLength += mDividerVerticalWidth;
1509
- }
1510
- if ((mShowDividerVertical & SHOW_DIVIDER_END) > 0) {
1511
- childLength += mDividerVerticalWidth;
1391
+ childLength += mColumnGap;
1512
1392
  }
1513
1393
  } else {
1514
- if (hasDividerBeforeChildAtAlongMainAxis(childAbsoluteIndex,
1394
+ if (mRowGap > 0 && hasPrecedingViews(childAbsoluteIndex,
1515
1395
  childRelativeIndexInFlexLine)) {
1516
- childLength += mDividerHorizontalHeight;
1517
- }
1518
- if ((mShowDividerHorizontal & SHOW_DIVIDER_END) > 0) {
1519
- childLength += mDividerHorizontalHeight;
1396
+ childLength += mRowGap;
1520
1397
  }
1521
1398
  }
1522
1399
  return maxSize < currentLength + childLength;
@@ -1536,31 +1413,21 @@ public class FlexboxLayout extends LayoutBase {
1536
1413
  }
1537
1414
 
1538
1415
  /**
1539
- * Retrieve the sum of the cross sizes of all flex lines including divider lengths.
1416
+ * Retrieve the sum of the cross sizes of all flex lines including gutters.
1540
1417
  *
1541
1418
  * @return the sum of the cross sizes
1542
1419
  */
1543
1420
  private int getSumOfCrossSize() {
1421
+ final boolean isHorizontalDirection = isMainAxisDirectionHorizontal(mFlexDirection);
1544
1422
  int sum = 0;
1423
+
1545
1424
  for (int i = 0, size = mFlexLines.size(); i < size; i++) {
1546
1425
  FlexLine flexLine = mFlexLines.get(i);
1426
+ int gap = isHorizontalDirection ? mRowGap : mColumnGap;
1547
1427
 
1548
- // Judge if the beginning or middle dividers are required
1549
- if (hasDividerBeforeFlexLine(i)) {
1550
- if (isMainAxisDirectionHorizontal(mFlexDirection)) {
1551
- sum += mDividerHorizontalHeight;
1552
- } else {
1553
- sum += mDividerVerticalWidth;
1554
- }
1555
- }
1556
-
1557
- // Judge if the end divider is required
1558
- if (hasEndDividerAfterFlexLine(i)) {
1559
- if (isMainAxisDirectionHorizontal(mFlexDirection)) {
1560
- sum += mDividerHorizontalHeight;
1561
- } else {
1562
- sum += mDividerVerticalWidth;
1563
- }
1428
+ // Judge if gap is required
1429
+ if (gap > 0 && hasPrecedingFlexLines(i)) {
1430
+ sum += gap;
1564
1431
  }
1565
1432
  sum += flexLine.mCrossSize;
1566
1433
  }
@@ -1623,6 +1490,10 @@ public class FlexboxLayout extends LayoutBase {
1623
1490
  * @see #setJustifyContent(int)
1624
1491
  * @see #getAlignItems()
1625
1492
  * @see #setAlignItems(int)
1493
+ * @see #getRowGap()
1494
+ * @see #setRowGap(int)
1495
+ * @see #getColumnGap()
1496
+ * @see #setColumnGap(int)
1626
1497
  * @see LayoutParams#alignSelf
1627
1498
  */
1628
1499
  private void layoutHorizontal(boolean isRtl, int left, int top, int right, int bottom) {
@@ -1646,9 +1517,9 @@ public class FlexboxLayout extends LayoutBase {
1646
1517
  float childRight;
1647
1518
  for (int i = 0, size = mFlexLines.size(); i < size; i++) {
1648
1519
  FlexLine flexLine = mFlexLines.get(i);
1649
- if (hasDividerBeforeFlexLine(i)) {
1650
- childBottom -= mDividerHorizontalHeight;
1651
- childTop += mDividerHorizontalHeight;
1520
+ if (mRowGap > 0 && hasPrecedingFlexLines(i)) {
1521
+ childBottom -= mRowGap;
1522
+ childTop += mRowGap;
1652
1523
  }
1653
1524
  float spaceBetweenItem = 0f;
1654
1525
  switch (mJustifyContent) {
@@ -1700,9 +1571,9 @@ public class FlexboxLayout extends LayoutBase {
1700
1571
  LayoutParams lp = ((LayoutParams) child.getLayoutParams());
1701
1572
  childLeft += lp.leftMargin;
1702
1573
  childRight -= lp.rightMargin;
1703
- if (hasDividerBeforeChildAtAlongMainAxis(currentViewIndex, j)) {
1704
- childLeft += mDividerVerticalWidth;
1705
- childRight -= mDividerVerticalWidth;
1574
+ if (mColumnGap > 0 && hasPrecedingViews(currentViewIndex, j)) {
1575
+ childLeft += mColumnGap;
1576
+ childRight -= mColumnGap;
1706
1577
  }
1707
1578
 
1708
1579
  if (mFlexWrap == FLEX_WRAP_WRAP_REVERSE) {
@@ -1842,6 +1713,10 @@ public class FlexboxLayout extends LayoutBase {
1842
1713
  * @see #setJustifyContent(int)
1843
1714
  * @see #getAlignItems()
1844
1715
  * @see #setAlignItems(int)
1716
+ * @see #getRowGap()
1717
+ * @see #setRowGap(int)
1718
+ * @see #getColumnGap()
1719
+ * @see #setColumnGap(int)
1845
1720
  * @see LayoutParams#alignSelf
1846
1721
  */
1847
1722
  private void layoutVertical(boolean isRtl, boolean fromBottomToTop, int left, int top,
@@ -1868,9 +1743,9 @@ public class FlexboxLayout extends LayoutBase {
1868
1743
 
1869
1744
  for (int i = 0, size = mFlexLines.size(); i < size; i++) {
1870
1745
  FlexLine flexLine = mFlexLines.get(i);
1871
- if (hasDividerBeforeFlexLine(i)) {
1872
- childLeft += mDividerVerticalWidth;
1873
- childRight -= mDividerVerticalWidth;
1746
+ if (mColumnGap > 0 && hasPrecedingFlexLines(i)) {
1747
+ childLeft += mColumnGap;
1748
+ childRight -= mColumnGap;
1874
1749
  }
1875
1750
  float spaceBetweenItem = 0f;
1876
1751
  switch (mJustifyContent) {
@@ -1922,9 +1797,9 @@ public class FlexboxLayout extends LayoutBase {
1922
1797
  LayoutParams lp = ((LayoutParams) child.getLayoutParams());
1923
1798
  childTop += lp.topMargin;
1924
1799
  childBottom -= lp.bottomMargin;
1925
- if (hasDividerBeforeChildAtAlongMainAxis(currentViewIndex, j)) {
1926
- childTop += mDividerHorizontalHeight;
1927
- childBottom -= mDividerHorizontalHeight;
1800
+ if (mRowGap > 0 && hasPrecedingViews(currentViewIndex, j)) {
1801
+ childTop += mRowGap;
1802
+ childBottom -= mRowGap;
1928
1803
  }
1929
1804
  if (isRtl) {
1930
1805
  if (fromBottomToTop) {
@@ -2033,235 +1908,6 @@ public class FlexboxLayout extends LayoutBase {
2033
1908
  }
2034
1909
  }
2035
1910
 
2036
- @Override
2037
- protected void onDraw(Canvas canvas) {
2038
- if (mDividerDrawableVertical == null && mDividerDrawableHorizontal == null) {
2039
- return;
2040
- }
2041
- if (mShowDividerHorizontal == SHOW_DIVIDER_NONE
2042
- && mShowDividerVertical == SHOW_DIVIDER_NONE) {
2043
- return;
2044
- }
2045
-
2046
- int layoutDirection = ViewCompat.getLayoutDirection(this);
2047
- boolean isRtl;
2048
- boolean fromBottomToTop = false;
2049
- switch (mFlexDirection) {
2050
- case FLEX_DIRECTION_ROW:
2051
- isRtl = layoutDirection == ViewCompat.LAYOUT_DIRECTION_RTL;
2052
- if (mFlexWrap == FLEX_WRAP_WRAP_REVERSE) {
2053
- fromBottomToTop = true;
2054
- }
2055
- drawDividersHorizontal(canvas, isRtl, fromBottomToTop);
2056
- break;
2057
- case FLEX_DIRECTION_ROW_REVERSE:
2058
- isRtl = layoutDirection != ViewCompat.LAYOUT_DIRECTION_RTL;
2059
- if (mFlexWrap == FLEX_WRAP_WRAP_REVERSE) {
2060
- fromBottomToTop = true;
2061
- }
2062
- drawDividersHorizontal(canvas, isRtl, fromBottomToTop);
2063
- break;
2064
- case FLEX_DIRECTION_COLUMN:
2065
- isRtl = layoutDirection == ViewCompat.LAYOUT_DIRECTION_RTL;
2066
- if (mFlexWrap == FLEX_WRAP_WRAP_REVERSE) {
2067
- isRtl = !isRtl;
2068
- }
2069
- drawDividersVertical(canvas, isRtl, false /* fromBottomToTop */);
2070
- break;
2071
- case FLEX_DIRECTION_COLUMN_REVERSE:
2072
- isRtl = layoutDirection == ViewCompat.LAYOUT_DIRECTION_RTL;
2073
- if (mFlexWrap == FLEX_WRAP_WRAP_REVERSE) {
2074
- isRtl = !isRtl;
2075
- }
2076
- drawDividersVertical(canvas, isRtl, true /* fromBottomToTop */);
2077
- break;
2078
- }
2079
- }
2080
-
2081
- /**
2082
- * Sub method for {@link #onDraw(Canvas)} when the main axis direction is horizontal
2083
- * ({@link #mFlexDirection} is either of {@link #FLEX_DIRECTION_ROW} or
2084
- * {@link #FLEX_DIRECTION_ROW_REVERSE}.
2085
- *
2086
- * @param canvas the canvas on which the background will be drawn
2087
- * @param isRtl {@code true} when the horizontal layout direction is right to left,
2088
- * {@code false} otherwise
2089
- * @param fromBottomToTop {@code true} when the vertical layout direction is bottom to top,
2090
- * {@code false} otherwise
2091
- */
2092
- private void drawDividersHorizontal(Canvas canvas, boolean isRtl, boolean fromBottomToTop) {
2093
- int currentViewIndex = 0;
2094
- int paddingLeft = getPaddingLeft();
2095
- int paddingRight = getPaddingRight();
2096
- int horizontalDividerLength = Math.max(0, getWidth() - paddingRight - paddingLeft);
2097
- for (int i = 0, size = mFlexLines.size(); i < size; i++) {
2098
- FlexLine flexLine = mFlexLines.get(i);
2099
- for (int j = 0; j < flexLine.mItemCount; j++) {
2100
- View view = getReorderedChildAt(currentViewIndex);
2101
-
2102
- if (view == null || view.getVisibility() == View.GONE) {
2103
- continue;
2104
- }
2105
-
2106
- LayoutParams lp = (LayoutParams) view.getLayoutParams();
2107
-
2108
- // Judge if the beginning or middle divider is needed
2109
- if (hasDividerBeforeChildAtAlongMainAxis(currentViewIndex, j)) {
2110
- int dividerLeft;
2111
- if (isRtl) {
2112
- dividerLeft = view.getRight() + lp.rightMargin;
2113
- } else {
2114
- dividerLeft = view.getLeft() - lp.leftMargin - mDividerVerticalWidth;
2115
- }
2116
-
2117
- drawVerticalDivider(canvas, dividerLeft, flexLine.mTop, flexLine.mCrossSize);
2118
- }
2119
-
2120
- // Judge if the end divider is needed
2121
- if (j == flexLine.mItemCount - 1) {
2122
- if ((mShowDividerVertical & SHOW_DIVIDER_END) > 0) {
2123
- int dividerLeft;
2124
- if (isRtl) {
2125
- dividerLeft = view.getLeft() - lp.leftMargin - mDividerVerticalWidth;
2126
- } else {
2127
- dividerLeft = view.getRight() + lp.rightMargin;
2128
- }
2129
-
2130
- drawVerticalDivider(canvas, dividerLeft, flexLine.mTop,
2131
- flexLine.mCrossSize);
2132
- }
2133
- }
2134
- currentViewIndex++;
2135
- }
2136
-
2137
- // Judge if the beginning or middle dividers are needed before the flex line
2138
- if (hasDividerBeforeFlexLine(i)) {
2139
- int horizontalDividerTop;
2140
- if (fromBottomToTop) {
2141
- horizontalDividerTop = flexLine.mBottom;
2142
- } else {
2143
- horizontalDividerTop = flexLine.mTop - mDividerHorizontalHeight;
2144
- }
2145
- drawHorizontalDivider(canvas, paddingLeft, horizontalDividerTop,
2146
- horizontalDividerLength);
2147
- }
2148
- // Judge if the end divider is needed before the flex line
2149
- if (hasEndDividerAfterFlexLine(i)) {
2150
- if ((mShowDividerHorizontal & SHOW_DIVIDER_END) > 0) {
2151
- int horizontalDividerTop;
2152
- if (fromBottomToTop) {
2153
- horizontalDividerTop = flexLine.mTop - mDividerHorizontalHeight;
2154
- } else {
2155
- horizontalDividerTop = flexLine.mBottom;
2156
- }
2157
- drawHorizontalDivider(canvas, paddingLeft, horizontalDividerTop,
2158
- horizontalDividerLength);
2159
- }
2160
- }
2161
- }
2162
- }
2163
-
2164
- /**
2165
- * Sub method for {@link #onDraw(Canvas)} when the main axis direction is vertical
2166
- * ({@link #mFlexDirection} is either of {@link #FLEX_DIRECTION_COLUMN} or
2167
- * {@link #FLEX_DIRECTION_COLUMN_REVERSE}.
2168
- *
2169
- * @param canvas the canvas on which the background will be drawn
2170
- * @param isRtl {@code true} when the horizontal layout direction is right to left,
2171
- * {@code false} otherwise
2172
- * @param fromBottomToTop {@code true} when the vertical layout direction is bottom to top,
2173
- * {@code false} otherwise
2174
- */
2175
- private void drawDividersVertical(Canvas canvas, boolean isRtl, boolean fromBottomToTop) {
2176
- int currentViewIndex = 0;
2177
- int paddingTop = getPaddingTop();
2178
- int paddingBottom = getPaddingBottom();
2179
- int verticalDividerLength = Math.max(0, getHeight() - paddingBottom - paddingTop);
2180
- for (int i = 0, size = mFlexLines.size(); i < size; i++) {
2181
- FlexLine flexLine = mFlexLines.get(i);
2182
-
2183
- // Draw horizontal dividers if needed
2184
- for (int j = 0; j < flexLine.mItemCount; j++) {
2185
- View view = getReorderedChildAt(currentViewIndex);
2186
-
2187
- if (view == null || view.getVisibility() == View.GONE) {
2188
- continue;
2189
- }
2190
-
2191
- LayoutParams lp = (LayoutParams) view.getLayoutParams();
2192
-
2193
- // Judge if the beginning or middle divider is needed
2194
- if (hasDividerBeforeChildAtAlongMainAxis(currentViewIndex, j)) {
2195
- int dividerTop;
2196
- if (fromBottomToTop) {
2197
- dividerTop = view.getBottom() + lp.bottomMargin;
2198
- } else {
2199
- dividerTop = view.getTop() - lp.topMargin - mDividerHorizontalHeight;
2200
- }
2201
-
2202
- drawHorizontalDivider(canvas, flexLine.mLeft, dividerTop, flexLine.mCrossSize);
2203
- }
2204
-
2205
- // Judge if the end divider is needed
2206
- if (j == flexLine.mItemCount - 1) {
2207
- if ((mShowDividerHorizontal & SHOW_DIVIDER_END) > 0) {
2208
- int dividerTop;
2209
- if (fromBottomToTop) {
2210
- dividerTop = view.getTop() - lp.topMargin - mDividerHorizontalHeight;
2211
- } else {
2212
- dividerTop = view.getBottom() + lp.bottomMargin;
2213
- }
2214
-
2215
- drawHorizontalDivider(canvas, flexLine.mLeft, dividerTop,
2216
- flexLine.mCrossSize);
2217
- }
2218
- }
2219
- currentViewIndex++;
2220
- }
2221
-
2222
- // Judge if the beginning or middle dividers are needed before the flex line
2223
- if (hasDividerBeforeFlexLine(i)) {
2224
- int verticalDividerLeft;
2225
- if (isRtl) {
2226
- verticalDividerLeft = flexLine.mRight;
2227
- } else {
2228
- verticalDividerLeft = flexLine.mLeft - mDividerVerticalWidth;
2229
- }
2230
- drawVerticalDivider(canvas, verticalDividerLeft, paddingTop,
2231
- verticalDividerLength);
2232
- }
2233
- if (hasEndDividerAfterFlexLine(i)) {
2234
- if ((mShowDividerVertical & SHOW_DIVIDER_END) > 0) {
2235
- int verticalDividerLeft;
2236
- if (isRtl) {
2237
- verticalDividerLeft = flexLine.mLeft - mDividerVerticalWidth;
2238
- } else {
2239
- verticalDividerLeft = flexLine.mRight;
2240
- }
2241
- drawVerticalDivider(canvas, verticalDividerLeft, paddingTop,
2242
- verticalDividerLength);
2243
- }
2244
- }
2245
- }
2246
- }
2247
-
2248
- private void drawVerticalDivider(Canvas canvas, int left, int top, int length) {
2249
- if (mDividerDrawableVertical == null) {
2250
- return;
2251
- }
2252
- mDividerDrawableVertical.setBounds(left, top, left + mDividerVerticalWidth, top + length);
2253
- mDividerDrawableVertical.draw(canvas);
2254
- }
2255
-
2256
- private void drawHorizontalDivider(Canvas canvas, int left, int top, int length) {
2257
- if (mDividerDrawableHorizontal == null) {
2258
- return;
2259
- }
2260
- mDividerDrawableHorizontal
2261
- .setBounds(left, top, left + length, top + mDividerHorizontalHeight);
2262
- mDividerDrawableHorizontal.draw(canvas);
2263
- }
2264
-
2265
1911
  @Override
2266
1912
  protected LayoutParams generateDefaultLayoutParams() {
2267
1913
  return new FlexboxLayout.LayoutParams();
@@ -2354,248 +2000,73 @@ public class FlexboxLayout extends LayoutBase {
2354
2000
  }
2355
2001
  }
2356
2002
 
2357
- /**
2358
- * @return the flex lines composing this flex container. This method returns a copy of the
2359
- * original list excluding a dummy flex line (flex line that doesn't have any flex items in it
2360
- * but used for the alignment along the cross axis).
2361
- * Thus any changes of the returned list are not reflected to the original list.
2362
- */
2363
- public List<FlexLine> getFlexLines() {
2364
- List<FlexLine> result = new ArrayList<>(mFlexLines.size());
2365
- for (FlexLine flexLine : mFlexLines) {
2366
- if (flexLine.getLayoutVisibleItemCount() == 0) {
2367
- continue;
2368
- }
2369
- result.add(flexLine);
2370
- }
2371
- return result;
2372
- }
2373
-
2374
- /**
2375
- * @return the horizontal divider drawable that will divide each item.
2376
- * @see #setDividerDrawable(Drawable)
2377
- * @see #setDividerDrawableHorizontal(Drawable)
2378
- */
2379
- public Drawable getDividerDrawableHorizontal() {
2380
- return mDividerDrawableHorizontal;
2381
- }
2382
-
2383
- /**
2384
- * @return the vertical divider drawable that will divide each item.
2385
- * @see #setDividerDrawable(Drawable)
2386
- * @see #setDividerDrawableVertical(Drawable)
2387
- */
2388
- public Drawable getDividerDrawableVertical() {
2389
- return mDividerDrawableVertical;
2003
+ public int getRowGap() {
2004
+ return mRowGap;
2390
2005
  }
2391
2006
 
2392
- /**
2393
- * Set a drawable to be used as a divider between items. The drawable is used for both
2394
- * horizontal and vertical dividers.
2395
- *
2396
- * @param divider Drawable that will divide each item for both horizontally and vertically.
2397
- * @see #setShowDivider(int)
2398
- */
2399
- public void setDividerDrawable(Drawable divider) {
2400
- setDividerDrawableHorizontal(divider);
2401
- setDividerDrawableVertical(divider);
2402
- }
2403
-
2404
- /**
2405
- * Set a drawable to be used as a horizontal divider between items.
2406
- *
2407
- * @param divider Drawable that will divide each item.
2408
- * @see #setDividerDrawable(Drawable)
2409
- * @see #setShowDivider(int)
2410
- * @see #setShowDividerHorizontal(int)
2411
- */
2412
- public void setDividerDrawableHorizontal(Drawable divider) {
2413
- if (divider == mDividerDrawableHorizontal) {
2414
- return;
2415
- }
2416
- mDividerDrawableHorizontal = divider;
2417
- if (divider != null) {
2418
- mDividerHorizontalHeight = divider.getIntrinsicHeight();
2419
- } else {
2420
- mDividerHorizontalHeight = 0;
2421
- }
2422
- setWillNotDrawFlag();
2423
- requestLayout();
2424
- }
2425
-
2426
- /**
2427
- * Set a drawable to be used as a vertical divider between items.
2428
- *
2429
- * @param divider Drawable that will divide each item.
2430
- * @see #setDividerDrawable(Drawable)
2431
- * @see #setShowDivider(int)
2432
- * @see #setShowDividerVertical(int)
2433
- */
2434
- public void setDividerDrawableVertical(Drawable divider) {
2435
- if (divider == mDividerDrawableVertical) {
2436
- return;
2437
- }
2438
- mDividerDrawableVertical = divider;
2439
- if (divider != null) {
2440
- mDividerVerticalWidth = divider.getIntrinsicWidth();
2441
- } else {
2442
- mDividerVerticalWidth = 0;
2007
+ public void setRowGap(int rowGap) {
2008
+ if (mRowGap != rowGap) {
2009
+ mRowGap = rowGap;
2010
+ requestLayout();
2443
2011
  }
2444
- setWillNotDrawFlag();
2445
- requestLayout();
2446
2012
  }
2447
2013
 
2448
- @FlexboxLayout.DividerMode
2449
- public int getShowDividerVertical() {
2450
- return mShowDividerVertical;
2014
+ public int getColumnGap() {
2015
+ return mColumnGap;
2451
2016
  }
2452
2017
 
2453
- @FlexboxLayout.DividerMode
2454
- public int getShowDividerHorizontal() {
2455
- return mShowDividerHorizontal;
2456
- }
2457
-
2458
- /**
2459
- * Set how dividers should be shown between items in this layout. This method sets the
2460
- * divider mode for both horizontally and vertically.
2461
- *
2462
- * @param dividerMode One or more of {@link #SHOW_DIVIDER_BEGINNING},
2463
- * {@link #SHOW_DIVIDER_MIDDLE}, or {@link #SHOW_DIVIDER_END},
2464
- * or {@link #SHOW_DIVIDER_NONE} to show no dividers.
2465
- * @see #setShowDividerVertical(int)
2466
- * @see #setShowDividerHorizontal(int)
2467
- */
2468
- public void setShowDivider(@DividerMode int dividerMode) {
2469
- setShowDividerVertical(dividerMode);
2470
- setShowDividerHorizontal(dividerMode);
2471
- }
2472
-
2473
- /**
2474
- * Set how vertical dividers should be shown between items in this layout
2475
- *
2476
- * @param dividerMode One or more of {@link #SHOW_DIVIDER_BEGINNING},
2477
- * {@link #SHOW_DIVIDER_MIDDLE}, or {@link #SHOW_DIVIDER_END},
2478
- * or {@link #SHOW_DIVIDER_NONE} to show no dividers.
2479
- * @see #setShowDivider(int)
2480
- */
2481
- public void setShowDividerVertical(@DividerMode int dividerMode) {
2482
- if (dividerMode != mShowDividerVertical) {
2483
- mShowDividerVertical = dividerMode;
2018
+ public void setColumnGap(int columnGap) {
2019
+ if (mColumnGap != columnGap) {
2020
+ mColumnGap = columnGap;
2484
2021
  requestLayout();
2485
2022
  }
2486
2023
  }
2487
2024
 
2488
2025
  /**
2489
- * Set how horizontal dividers should be shown between items in this layout.
2490
- *
2491
- * @param dividerMode One or more of {@link #SHOW_DIVIDER_BEGINNING},
2492
- * {@link #SHOW_DIVIDER_MIDDLE}, or {@link #SHOW_DIVIDER_END},
2493
- * or {@link #SHOW_DIVIDER_NONE} to show no dividers.
2494
- * @see #setShowDivider(int)
2495
- */
2496
- public void setShowDividerHorizontal(@DividerMode int dividerMode) {
2497
- if (dividerMode != mShowDividerHorizontal) {
2498
- mShowDividerHorizontal = dividerMode;
2499
- requestLayout();
2500
- }
2501
- }
2502
-
2503
- private void setWillNotDrawFlag() {
2504
- setWillNotDraw(mDividerDrawableHorizontal == null && mDividerDrawableVertical == null);
2505
- }
2506
-
2507
- /**
2508
- * Check if a divider is needed before the view whose indices are passed as arguments.
2509
- *
2510
- * @param childAbsoluteIndex the absolute index of the view to be judged
2511
- * @param childRelativeIndexInFlexLine the relative index in the flex line where the view
2512
- * belongs
2513
- * @return {@code true} if a divider is needed, {@code false} otherwise
2026
+ * @return the flex lines composing this flex container. This method returns a copy of the
2027
+ * original list excluding a dummy flex line (flex line that doesn't have any flex items in it
2028
+ * but used for the alignment along the cross axis).
2029
+ * Thus, any changes of the returned list are not reflected to the original list.
2514
2030
  */
2515
- private boolean hasDividerBeforeChildAtAlongMainAxis(int childAbsoluteIndex,
2516
- int childRelativeIndexInFlexLine) {
2517
- if (allViewsAreGoneBefore(childAbsoluteIndex, childRelativeIndexInFlexLine)) {
2518
- if (isMainAxisDirectionHorizontal(mFlexDirection)) {
2519
- return (mShowDividerVertical & SHOW_DIVIDER_BEGINNING) != 0;
2520
- } else {
2521
- return (mShowDividerHorizontal & SHOW_DIVIDER_BEGINNING) != 0;
2522
- }
2523
- } else {
2524
- if (isMainAxisDirectionHorizontal(mFlexDirection)) {
2525
- return (mShowDividerVertical & SHOW_DIVIDER_MIDDLE) != 0;
2526
- } else {
2527
- return (mShowDividerHorizontal & SHOW_DIVIDER_MIDDLE) != 0;
2031
+ public List<FlexLine> getFlexLines() {
2032
+ List<FlexLine> result = new ArrayList<>(mFlexLines.size());
2033
+ for (FlexLine flexLine : mFlexLines) {
2034
+ if (flexLine.getLayoutVisibleItemCount() == 0) {
2035
+ continue;
2528
2036
  }
2037
+ result.add(flexLine);
2529
2038
  }
2039
+ return result;
2530
2040
  }
2531
2041
 
2532
- private boolean allViewsAreGoneBefore(int childAbsoluteIndex,
2533
- int childRelativeIndexInFlexLine) {
2042
+ private boolean hasPrecedingViews(int childAbsoluteIndex, int childRelativeIndexInFlexLine) {
2534
2043
  for (int i = 1; i <= childRelativeIndexInFlexLine; i++) {
2535
2044
  View view = getReorderedChildAt(childAbsoluteIndex - i);
2536
2045
  if (view != null && view.getVisibility() != View.GONE) {
2537
- return false;
2046
+ return true;
2538
2047
  }
2539
2048
  }
2540
- return true;
2049
+ return false;
2541
2050
  }
2542
2051
 
2543
2052
  /**
2544
- * Check if a divider is needed before the flex line whose index is passed as an argument.
2053
+ * Check if any flex line is preceding the flex line whose index is passed as an argument.
2545
2054
  *
2546
2055
  * @param flexLineIndex the index of the flex line to be checked
2547
- * @return {@code true} if a divider is needed, {@code false} otherwise
2056
+ * @return {@code true} if a flex line is preceding, {@code false} otherwise
2548
2057
  */
2549
- private boolean hasDividerBeforeFlexLine(int flexLineIndex) {
2058
+ private boolean hasPrecedingFlexLines(int flexLineIndex) {
2550
2059
  if (flexLineIndex < 0 || flexLineIndex >= mFlexLines.size()) {
2551
2060
  return false;
2552
2061
  }
2553
- if (allFlexLinesAreDummyBefore(flexLineIndex)) {
2554
- if (isMainAxisDirectionHorizontal(mFlexDirection)) {
2555
- return (mShowDividerHorizontal & SHOW_DIVIDER_BEGINNING) != 0;
2556
- } else {
2557
- return (mShowDividerVertical & SHOW_DIVIDER_BEGINNING) != 0;
2558
- }
2559
- } else {
2560
- if (isMainAxisDirectionHorizontal(mFlexDirection)) {
2561
- return (mShowDividerHorizontal & SHOW_DIVIDER_MIDDLE) != 0;
2562
- } else {
2563
- return (mShowDividerVertical & SHOW_DIVIDER_MIDDLE) != 0;
2564
- }
2565
- }
2566
- }
2567
2062
 
2568
- private boolean allFlexLinesAreDummyBefore(int flexLineIndex) {
2569
2063
  for (int i = 0; i < flexLineIndex; i++) {
2570
2064
  if (mFlexLines.get(i).getLayoutVisibleItemCount() > 0) {
2571
- return false;
2572
- }
2573
- }
2574
- return true;
2575
- }
2576
-
2577
- /**
2578
- * Check if a end divider is needed after the flex line whose index is passed as an argument.
2579
- *
2580
- * @param flexLineIndex the index of the flex line to be checked
2581
- * @return {@code true} if a divider is needed, {@code false} otherwise
2582
- */
2583
- private boolean hasEndDividerAfterFlexLine(int flexLineIndex) {
2584
- if (flexLineIndex < 0 || flexLineIndex >= mFlexLines.size()) {
2585
- return false;
2586
- }
2587
-
2588
- for (int i = flexLineIndex + 1; i < mFlexLines.size(); i++) {
2589
- if (mFlexLines.get(i).getLayoutVisibleItemCount() > 0) {
2590
- return false;
2065
+ return true;
2591
2066
  }
2592
2067
  }
2593
- if (isMainAxisDirectionHorizontal(mFlexDirection)) {
2594
- return (mShowDividerHorizontal & SHOW_DIVIDER_END) != 0;
2595
- } else {
2596
- return (mShowDividerVertical & SHOW_DIVIDER_END) != 0;
2597
- }
2598
2068
 
2069
+ return false;
2599
2070
  }
2600
2071
 
2601
2072
  /**
@@ -2623,8 +2094,6 @@ public class FlexboxLayout extends LayoutBase {
2623
2094
 
2624
2095
  public static final int ALIGN_SELF_STRETCH = ALIGN_ITEMS_STRETCH;
2625
2096
 
2626
- private static final int MAX_SIZE = Integer.MAX_VALUE & View.MEASURED_SIZE_MASK;
2627
-
2628
2097
  /**
2629
2098
  * This attribute can change the ordering of the children views are laid out.
2630
2099
  * By default, children are displayed and laid out in the same order as they appear in the
@@ -2680,20 +2149,14 @@ public class FlexboxLayout extends LayoutBase {
2680
2149
  */
2681
2150
  public int minHeight;
2682
2151
 
2683
- /**
2684
- * This attribute determines the maximum width the child can expand to.
2685
- */
2686
- public int maxWidth = MAX_SIZE;
2687
-
2688
- /**
2689
- * This attribute determines the maximum height the child can expand to.
2690
- */
2691
- public int maxHeight = MAX_SIZE;
2152
+ // maxWidth / maxHeight are inherited from CommonLayoutParams (-1 means unconstrained),
2153
+ // so that the max-width / max-height style properties, including percent values resolved
2154
+ // in CommonLayoutParams.adjustChildrenLayoutParams, are honored inside flexbox as well.
2692
2155
 
2693
2156
  /**
2694
2157
  * This attribute forces a flex line wrapping. i.e. if this is set to {@code true} for a
2695
2158
  * flex item, the item will become the first item of the new flex line. (A wrapping happens
2696
- * regardless of the flex items being processed in the the previous flex line)
2159
+ * regardless of the flex items being processed in the previous flex line)
2697
2160
  * This attribute is ignored if the flex_wrap attribute is set as nowrap.
2698
2161
  * The equivalent attribute isn't defined in the original CSS Flexible Box Module
2699
2162
  * specification, but having this attribute is useful for Android developers to flatten