NO1:
definition : The policy pattern defines a series of algorithms, encapsulates each algorithm, and allows them to be replaced with each other. The policy pattern makes the algorithm independent of the customers who use it.
No2:
Usage Scenarios :
1) Multiple treatments for the same type of problem, only when the specific behavior is different
2) requires safe encapsulation of multiple operations of the same type
3) If you have multiple subclasses of the same abstract class and need to use If-else or switch-case to select a specific subclass
No3:
The function of the timeinterpolator time Interpolator is to calculate the percentage of the current attribute value change based on the percentage of time elapsed, and the system preset
1) Linear interpolator (Linearinterpolator): For constant speed animation
2) Accelerated deceleration interpolator (acceleratedecelerateinterpolator) for animation acceleration at start-up with animation deceleration at the end
3) deceleration interpolator (decelerateinterpolator): Used to animate more and more slowly over time, i.e. deceleration animation
No4:
Typeevaluator Type Estimator
The time Interpolator calculates the percentage of time elapsed at the current point in time, Typeevaluator calculates the value of the property at the current moment based on the percentage, the starting value of the attribute, and the target value, and the last value is set to view, and the process is repeated to form an animation.
System presets with shaping properties (intevaluator), floating-point properties (floatevaluator), and Color properties (argbevaluator)
NO5:
Valueanimator flowchart
NO6:
Objectanimator flowchart
No7:
cons : As the strategy grows, subclasses become more diverse
"Android Source design mode"--strategy mode