52 Commits

Author SHA1 Message Date
haodong
8bba732aaa Automated g4 rollback of changelist 328982034
PiperOrigin-RevId: 329810012
2020-09-09 11:23:29 -04:00
haodong
f330ee8eb5 [ProgressIndicator] Fixed update listener for determinate drawable.
PiperOrigin-RevId: 329806314
2020-09-09 11:22:40 -04:00
haodong
395c2cda63 [ProgressIndicator] Removed custom drawing support to minimize API exposure.
PiperOrigin-RevId: 329001093
2020-08-28 18:07:25 -04:00
haodong
d615d2ac37 [SwitchMaterial] Added processing status.
PiperOrigin-RevId: 328982034
2020-08-28 18:05:07 -04:00
haodong
f0b8c159b9 [ProgressIndicator] Added the setter for component's visibility after hide animation.
Resolves https://github.com/material-components/material-components-android/issues/1632

PiperOrigin-RevId: 327874780
2020-08-24 18:02:15 -04:00
haodong
7200cd52b6 [ProgressIndicator] Fixed the style used on indeterminate drawable in the standalone demo.
PiperOrigin-RevId: 327435884
2020-08-19 17:41:57 -04:00
haodong
90f041d5e7 [ProgressIndicator] Updated style names.
PiperOrigin-RevId: 326696208
2020-08-14 15:24:16 -04:00
haodong
78aa3eac95 [ProgressIndicator] More cleanup of renaming indicatorWidth to indicatorSize.
PiperOrigin-RevId: 326064408
2020-08-11 14:47:40 -04:00
haodong
4d866b060a [ProgressIndicator] Corrected the behavior and comment of the setProgress to align with the framework ProgressBar API.
PiperOrigin-RevId: 326040256
2020-08-11 14:42:59 -04:00
haodong
416eab583c [ProgressIndicator] Improved inflation performance.
- Deferred animator initialization to the moment animations start.
- Improved inflation time (1k times) from 1478 ms to 325 ms. For the framework ProgressBar, it's about 190 ms.

PiperOrigin-RevId: 325455356
2020-08-07 15:23:41 -04:00
haodong
77582b5e21 [ProgressIndicator] Renamed indicatorWidth with indicatorSize to eliminate the confusion of indicatorWidth controlling view height in LINEAR types.
Resolves https://github.com/material-components/material-components-android/issues/1491

PiperOrigin-RevId: 325045868
2020-08-05 16:25:19 -04:00
haodong
5a1c183b16 [ProgressIndicator] Fixed canvas state leak in IndeterminateDrawable.
PiperOrigin-RevId: 323615617
2020-07-29 09:16:08 -04:00
haodong
0b82e81a8b [ProgressIndicator] Added a new attribute to delay show actions.
Resolves https://github.com/material-components/material-components-android/issues/1524

PiperOrigin-RevId: 323586499
2020-07-29 09:15:31 -04:00
haodong
eaa0a7f510 [ProgressIndicator] Improved the readability of initializeDrawables() function.
PiperOrigin-RevId: 323568162
2020-07-29 09:14:09 -04:00
haodong
ea9cce8c29 [ProgressIndicator] Fixed incorrect visibility change when the component's parent is not visible.
PiperOrigin-RevId: 322771684
2020-07-23 11:42:07 -04:00
haodong
aca5307d42 [ProgressIndicator] Changed class visibility of CircularDrawingDelegate.
PiperOrigin-RevId: 322583285
2020-07-22 14:23:25 -04:00
haodong
4005294a75 [ProgressIndicator] Added the function in ProgressIndicatorSpec to load from style.
PiperOrigin-RevId: 322580332
2020-07-22 14:20:51 -04:00
haodong
c4f44d2fbb [ProgressIndicator] Revived the argument (restart) in setVisible of drawables.
- Changed setVisible(visible, animated) to setVisible(visible, restart, animated).
- Adjusted the visibility control based on the new setVisible().

PiperOrigin-RevId: 322223572
2020-07-21 04:22:24 -07:00
haodong
f7bad9a512 [ProgressIndicator] Changed drawables to detect system animator duration scale by themselves.
PiperOrigin-RevId: 322193517
2020-07-21 04:16:06 -07:00
haodong
28039601fd [ProgressIndicator] Removed explicitly disabling animators.
PiperOrigin-RevId: 322170475
2020-07-21 04:14:03 -07:00
haodong
764f063d41 [ProgressIndicator] Changed logic to guarantee the indeterminate arc fully collapsed before showing determinate arc.
PiperOrigin-RevId: 321613769
2020-07-20 12:56:38 -07:00
haodong
92aca746ca [ProgressIndicator] Updated system animation duration scale more frequently.
PiperOrigin-RevId: 321407050
2020-07-16 07:26:35 -07:00
haodong
28177cb551 [ProgressIndicator] Updated the drawable setters.
- Removed NonNull annotation.
- Updated the descriptions.

PiperOrigin-RevId: 321407014
2020-07-16 07:25:45 -07:00
haodong
c74a374cc6 [ProgressIndicator] Automated g4 rollback of changelist 321297596.
*** Reason for rollback ***

Incompatible API change.

*** Original change description ***

[ProgressIndicator] Updated drawable setters.
- Added new setters with non-framework drawable types.
- Replaced IllegalArgumentException with UnsupportedOperationException.

PiperOrigin-RevId: 321365984
2020-07-15 09:54:16 -07:00
haodong
3625fbadec [ProgressIndicator] Updated drawable setters.
- Added new setters with non-framework drawable types.
- Replaced IllegalArgumentException with UnsupportedOperationException.

PiperOrigin-RevId: 321297596
2020-07-15 09:51:37 -07:00
haodong
380c21ab53 [ProgressIndicator] Separated the padding when calculating drawable's intrinsic size.
PiperOrigin-RevId: 320990538
2020-07-15 09:43:41 -07:00
marianomartin
049ad022a6 Delete components build.gradle files
PiperOrigin-RevId: 320944144
2020-07-15 09:38:31 -07:00
haodong
43fe75f4bc [ProgressIndicator] Invalidated indicator colors properly in animator delegate.
Resolves https://github.com/material-components/material-components-android/issues/1469

PiperOrigin-RevId: 320622246
2020-07-10 11:51:36 -07:00
haodong
fabd36fc75 [ProgressIndicator] Unregistered animator complete callback on detach from window to prevent memory leak.
Resolves https://github.com/material-components/material-components-android/issues/1440

PiperOrigin-RevId: 320435677
2020-07-10 11:43:49 -07:00
haodong
4ff30311e3 [ProgressIndicator] Replaced ProgressIndicator references in drawable&delegate classes to prevent memory leak and prepare for the stand-along drawable feature.
PiperOrigin-RevId: 320391113
2020-07-10 11:35:27 -07:00
haodong
cf98f94309 [ProgressIndicator] Forward fixed "ripple" bug from the fix for indeterminate animation not respecting to system animator scale.
PiperOrigin-RevId: 320204213
2020-07-08 15:01:27 -04:00
haodong
984738c067 [ProgressIndicator] Added logic to respond to system animation scale settings for determinate types.
PiperOrigin-RevId: 319038716
2020-06-30 16:07:44 -04:00
haodong
4ccec4ff71 [ProgressIndicator] Fixed indeterminate types disco when system animation duration scale is off.
- Removed constant for debugging animation speed.
- Added a condition to check if resetting start offset for circular indeterminate type is valid.
- Added a condition to check if rotating color for seamless indeterminate type is valid.

PiperOrigin-RevId: 319035241
2020-06-30 16:06:17 -04:00
haodong
26021ed418 [ProgressIndicator] Fixed incorrectly setting drawable's visibility when switching indeterminate mode for API19.
PiperOrigin-RevId: 318877353
2020-06-29 16:21:45 -04:00
haodong
0b443ad51f [ProgressIndicator] Changed interpolator for seamless linear indeterminate type from LINEAR_OUT_SLOW_IN to FAST_OUT_SLOW_IN.
PiperOrigin-RevId: 318866756
2020-06-29 16:20:21 -04:00
haodong
e44804ffd4 [ProgressIndicator] Relocated the logic of animator disabling.
- Removed the flag for disabling animators in drawable classes.
- Rewrote the logic to disable animators in ProgressIndicator class.
- Some cleanup.

PiperOrigin-RevId: 318823871
2020-06-29 16:17:51 -04:00
haodong
8fbc2e02e9 [ProgressIndicator] Added the custom drawable support (6/7)
- Integrated new animator delegate classes to ProgressIndicator.
- Removed the replaced drawable classes.
- Added getPreferredSize function to drawing delegate interface.
- Added new indicator type CUSTOM.
- Fixed some potential NPE logics.

PiperOrigin-RevId: 318197464
2020-06-26 14:10:32 -04:00
marianomartin
555356b03f Internal cleanup
PiperOrigin-RevId: 318134343
2020-06-26 14:06:52 -04:00
haodong
7e595b6ce0 [ProgressIndicator] Added the custom drawable support (5/7)
- Added a final animator delegate for circular indeterminate mode.

PiperOrigin-RevId: 318099750
2020-06-26 14:06:10 -04:00
haodong
4f5a98ff10 [ProgressIndicator] Added the custom drawable support (4/7)
- Added a final animator delegate for seamless linear indeterminate mode.

PiperOrigin-RevId: 318096350
2020-06-26 14:05:22 -04:00
haodong
c22f3f4b98 [ProgressIndicator] Added the custom drawable support (3/7)
- Added a final animator delegate for non-seamless linear indeterminate mode.

PiperOrigin-RevId: 318092647
2020-06-26 14:04:37 -04:00
haodong
4337eeaa0d [ProgressIndicator] Added the custom drawable support (2/7)
- Added an final drawable class for all indeterminate types.
- Marked DeterminateDrawable as public and final.

PiperOrigin-RevId: 318088718
2020-06-26 14:03:49 -04:00
haodong
02c3b3d398 [ProgressIndicator] Added the custom drawable support (1/7)
- Added an interface for indeterminate animator delegate.
- Marked DrawingDelegate to public.

PiperOrigin-RevId: 318084805
2020-06-26 14:03:06 -04:00
haodong
c5f900b7d5 [ProgressIndicator] Fixed CircularIndeterminateDrawable not resetting animator properly after switching to determinate mode.
PiperOrigin-RevId: 317294538
2020-06-19 13:54:27 -04:00
Mattia
924ac3fe85 [ProgressIndicator] Add new minHideDelay property
Resolves https://github.com/material-components/material-components-android/pull/1411
Resolves https://github.com/material-components/material-components-android/issues/1382

GIT_ORIGIN_REV_ID=46d32f9bbb8d0f4c4ba8c7ec36b0a5d0cb61f0ae

Co-authored-by: pekingme <pekingme@gmail.com>
PiperOrigin-RevId: 317108572
2020-06-18 13:23:25 -04:00
haodong
5febeba67e [ProgressIndicator] Added auto-cap to limit the indicator corner radius equal to or less than half of the indicator width.
PiperOrigin-RevId: 316531091
2020-06-15 23:58:11 -07:00
haodong
48c4ef019c [ProgressIndicator] Added support of rounded corners.
- Added attribute cornerRadius.
- Added rounded corner support for linear determinate and indeterminate (non-seamless) mode.
- Added rounded corner support for circular determinate and indeterminate mode.
- Added screenshot tests.
- Modified show cases in Catalog to demo this feature.

PiperOrigin-RevId: 316400672
2020-06-15 23:54:35 -07:00
Mattia
584d72555a [ProgressIndicator] Fix for non dismissable progress indicator
Resolves https://github.com/material-components/material-components-android/pull/1391

GIT_ORIGIN_REV_ID=e657fa9409d1e16481f2383ddaa00942c874b8a2
PiperOrigin-RevId: 316209739
2020-06-15 23:52:06 -07:00
marianomartin
63119cfa94 Fix potential NPE when progress indicators change visibility during initialization
PiperOrigin-RevId: 313826176
2020-06-01 16:45:21 -04:00
marianomartin
1303e400c1 Change Progress indicator to only show if they are already visible
PiperOrigin-RevId: 313327751
2020-05-27 13:48:38 -04:00