@@ -32,22 +32,24 @@ import com.facebook.imagepipeline.postprocessors.RoundPostprocessor
3232
3333object VitoSpinners {
3434
35- val roundingOptions = listOf (
36- " no rounding " to null ,
35+ val roundingOptions = Pair ( listOf (
36+ " none " to null ,
3737 " as circle" to RoundingOptions .asCircle(),
3838 " corner radius" to RoundingOptions .forCornerRadiusPx(20f ),
39- " different radii" to RoundingOptions .forCornerRadii(0f , 20f , 30f , 40f ))
39+ " different radii" to RoundingOptions .forCornerRadii(0f , 20f , 30f , 40f )
40+ ), " Rounding" )
4041
41- val borderOptions = listOf (
42- " no border " to null ,
42+ val borderOptions = Pair ( listOf (
43+ " none " to null ,
4344 " red border" to BorderOptions .create(Color .RED , 20f ),
4445 " blue border" to BorderOptions .create(Color .BLUE , 40f ),
4546 " border with no padding" to BorderOptions .create(Color .GREEN , 20f , 0f ),
4647 " border with small padding" to BorderOptions .create(Color .GREEN , 20f , 10f ),
4748 " border with same padding" to BorderOptions .create(Color .GREEN , 20f , 20f ),
48- " border with more padding" to BorderOptions .create(Color .GREEN , 20f , 40f ))
49+ " border with more padding" to BorderOptions .create(Color .GREEN , 20f , 40f )
50+ ), " Border" )
4951
50- val scaleTypes = listOf (
52+ val scaleTypes = Pair ( listOf (
5153 " center" to Pair (ScalingUtils .ScaleType .CENTER , null ),
5254 " center_crop" to Pair (ScalingUtils .ScaleType .CENTER_CROP , null ),
5355 " center_inside" to Pair (ScalingUtils .ScaleType .CENTER_INSIDE , null ),
@@ -58,9 +60,10 @@ object VitoSpinners {
5860 " focus_crop (0, 0)" to Pair (ScalingUtils .ScaleType .FOCUS_CROP , PointF (0f , 0f )),
5961 " focus_crop (1, 0.5)" to Pair (ScalingUtils .ScaleType .FOCUS_CROP , PointF (1f , 0.5f )),
6062 " custom: fit_x" to Pair (CustomScaleTypes .FIT_X , null ),
61- " custom: fit_y" to Pair (CustomScaleTypes .FIT_Y , null ))
63+ " custom: fit_y" to Pair (CustomScaleTypes .FIT_Y , null )
64+ ), " Scale type" )
6265
63- val imageFormats = listOf (
66+ val imageFormats = Pair ( listOf (
6467 " JPEG" to DefaultImageFormats .JPEG ,
6568 " PNG" to DefaultImageFormats .PNG ,
6669 " Animated GIF" to DefaultImageFormats .GIF ,
@@ -69,24 +72,24 @@ object VitoSpinners {
6972 " Animated WebP" to DefaultImageFormats .WEBP_ANIMATED ,
7073 " Keyframes" to KeyframesDecoderExample .IMAGE_FORMAT_KEYFRAMES ,
7174 " none" to null
72- )
75+ ), " Image format " )
7376
74- val colorFilters = listOf (
77+ val colorFilters = Pair ( listOf (
7578 " none" to PorterDuffColorFilter (Color .TRANSPARENT , PorterDuff .Mode .ADD ),
7679 " red" to PorterDuffColorFilter (Color .RED , PorterDuff .Mode .DARKEN ),
7780 " green" to PorterDuffColorFilter (Color .GREEN , PorterDuff .Mode .DARKEN ),
7881 " blue" to PorterDuffColorFilter (Color .BLUE , PorterDuff .Mode .DARKEN )
79- )
82+ ), " Color filter " )
8083
81- val placeholderOptions = listOf (
84+ val placeholderOptions = Pair ( listOf (
8285 " none" to {builder: ImageOptions .Builder -> builder.placeholder(null )},
8386 " image" to {builder: ImageOptions .Builder -> builder.placeholderRes(R .drawable.logo, ScalingUtils .ScaleType .FIT_CENTER )},
8487 " block color" to {builder: ImageOptions .Builder -> builder.placeholder(ColorDrawable (Color .RED ))},
8588 " color res" to {builder: ImageOptions .Builder -> builder.placeholderRes(R .color.placeholder_color)}
86- )
89+ ), " Placeholder " )
8790
88- val postprocessorOptions = listOf (
89- " no postprocessor " to {builder: ImageOptions .Builder -> builder.postprocess(null )},
91+ val postprocessorOptions = Pair ( listOf (
92+ " none " to {builder: ImageOptions .Builder -> builder.postprocess(null )},
9093 " Grey Scale Post-Processor(Slow)" to {builder: ImageOptions .Builder -> builder.postprocess(SlowGreyScalePostprocessor ())},
9194 " Grey Scale Post-Processor" to {builder: ImageOptions .Builder -> builder.postprocess(FasterGreyScalePostprocessor ())},
9295 " Watermark Post-Processor" to {builder: ImageOptions .Builder -> builder.postprocess(WatermarkPostprocessor (10 , " FRESCO" ))},
@@ -96,15 +99,15 @@ object VitoSpinners {
9699 " Native Round As Circle Postprocessor" to {builder: ImageOptions .Builder -> builder.postprocess(RoundAsCirclePostprocessor (false ))},
97100 " Antialiased As Circle Postprocessor" to {builder: ImageOptions .Builder -> builder.postprocess(RoundAsCirclePostprocessor (true ))},
98101 " Round As Circle Postprocessor" to {builder: ImageOptions .Builder -> builder.postprocess(RoundPostprocessor ())}
99- )
102+ ), " Postprocessor " )
100103
101- val rotationOptions = listOf (
102- " disable rotation " to RotationOptions .disableRotation(),
104+ val rotationOptions = Pair ( listOf (
105+ " disabled " to RotationOptions .disableRotation(),
103106 " auto rotate" to RotationOptions .autoRotate(),
104107 " auto rotate at render time" to RotationOptions .autoRotateAtRenderTime(),
105108 " no rotation" to RotationOptions .forceRotation(RotationOptions .NO_ROTATION ),
106109 " rotate 90" to RotationOptions .forceRotation(RotationOptions .ROTATE_90 ),
107110 " rotate 180" to RotationOptions .forceRotation(RotationOptions .ROTATE_180 ),
108111 " rotate 270" to RotationOptions .forceRotation(RotationOptions .ROTATE_270 )
109- )
112+ ), " Rotation " )
110113}
0 commit comments