2020
2121from future .utils import with_metaclass
2222
23+ from .background import Background , LinearGradientBackground
2324from .actions import get_action
2425from .base import Base
2526from .send_messages import SendMessage
@@ -234,6 +235,9 @@ def __init__(self,
234235 border_color = None ,
235236 border_width = None ,
236237 corner_radius = None ,
238+ justify_content = None ,
239+ align_items = None ,
240+ background = None ,
237241 width = None ,
238242 height = None ,
239243 flex = None ,
@@ -260,6 +264,12 @@ def __init__(self,
260264 :param str border_color: Color of box border
261265 :param str border_width: Width of box border
262266 :param str corner_radius: Radius at the time of rounding the corners of the border
267+ :param str justify_content: How child elements are aligned along the main axis of
268+ the parent element
269+ :param str align_items: How child elements are aligned along the cross axis of
270+ the parent element
271+ :param background: Background object
272+ :type background: T <= :py:class:`linebot.models.background.Background`
263273 :param str width: Width of the box
264274 :param str height: Height of the box
265275 :param float flex: The ratio of the width or height of this box within the parent box
@@ -291,6 +301,8 @@ def __init__(self,
291301 self .border_color = border_color
292302 self .border_width = border_width
293303 self .corner_radius = corner_radius
304+ self .justify_content = justify_content
305+ self .align_items = align_items
294306 self .width = width
295307 self .height = height
296308 self .flex = flex
@@ -307,6 +319,9 @@ def __init__(self,
307319 self .offset_start = offset_start
308320 self .offset_end = offset_end
309321 self .action = get_action (action )
322+ self .background = Background .get_or_new_from_json_dict_with_types (
323+ background , {'linearGradient' : LinearGradientBackground }
324+ )
310325
311326 new_contents = []
312327 if contents :
@@ -320,7 +335,6 @@ def __init__(self,
320335 'image' : ImageComponent ,
321336 'span' : SpanComponent ,
322337 'separator' : SeparatorComponent ,
323- 'spacer' : SpacerComponent ,
324338 'text' : TextComponent
325339 }
326340 ))
@@ -349,6 +363,7 @@ def __init__(self,
349363 style = None ,
350364 color = None ,
351365 gravity = None ,
366+ adjust_mode = None ,
352367 ** kwargs ):
353368 """__init__ method.
354369
@@ -368,6 +383,7 @@ def __init__(self,
368383 Background color when the style property is primary or secondary.
369384 Use a hexadecimal color code
370385 :param str gravity: Vertical alignment style
386+ :param str adjust_mode: The method by which to adjust the text font size
371387 :param kwargs:
372388 """
373389 super (ButtonComponent , self ).__init__ (** kwargs )
@@ -384,6 +400,7 @@ def __init__(self,
384400 self .style = style
385401 self .color = color
386402 self .gravity = gravity
403+ self .adjust_mode = adjust_mode
387404
388405
389406class FillerComponent (FlexComponent ):
@@ -541,26 +558,6 @@ def __init__(self, margin=None, color=None, **kwargs):
541558 self .color = color
542559
543560
544- class SpacerComponent (FlexComponent ):
545- """SpacerComponent.
546-
547- https://developers.line.biz/en/reference/messaging-api/#spacer
548-
549- This is an invisible component that places a fixed-size space
550- at the beginning or end of the box
551- """
552-
553- def __init__ (self , size = None , ** kwargs ):
554- """__init__ method.
555-
556- :param str size: Size of the space
557- :param kwargs:
558- """
559- super (SpacerComponent , self ).__init__ (** kwargs )
560- self .type = 'spacer'
561- self .size = size
562-
563-
564561class SpanComponent (FlexComponent ):
565562 """SpanComponent.
566563
0 commit comments