Class: RMQTextViewStyler
- Inherits:
-
RMQViewStyler
show all
- Defined in:
- lib/project/ruby_motion_query/stylers/rmq_text_view_styler.rb
Instance Attribute Summary
#bg_color, #context, #corner_radius, #view
Instance Method Summary
collapse
#background_color=, #background_resource=, #cleanup, #convert_color, #convert_gravity, #create_drawable, #density, #dp2px, #initialize, #layout=, #layout_align_parent_left=, #layout_align_parent_right=, #layout_center_horizontal=, #layout_center_in_parent=, #layout_center_vertical=, #layout_gravity=, #layout_height=, #layout_params, #layout_weight=, #layout_width=, #margin=, #margin_bottom=, #margin_left=, #margin_right=, #margin_top=, #padding=, #padding_bottom=, #padding_left=, #padding_right=, #padding_top=, #visibility=
Constructor Details
This class inherits a constructor from RMQViewStyler
Instance Method Details
[View source]
29
30
31
|
# File 'lib/project/ruby_motion_query/stylers/rmq_text_view_styler.rb', line 29
def color=(text_color)
@view.textColor = convert_color(text_color)
end
|
[View source]
46
47
48
|
# File 'lib/project/ruby_motion_query/stylers/rmq_text_view_styler.rb', line 46
def enabled=(enabled)
@view.setEnabled(enabled)
end
|
[View source]
50
51
52
53
54
55
56
57
|
# File 'lib/project/ruby_motion_query/stylers/rmq_text_view_styler.rb', line 50
def finalize
super
if @lazy_typeface
@text_style ||= Android::Graphics::Typeface::NORMAL
typeface = Android::Graphics::Typeface.create(@font_family, @text_style) if @font_family
@view.setTypeface(typeface, @text_style) end
end
|
[View source]
37
38
39
40
|
# File 'lib/project/ruby_motion_query/stylers/rmq_text_view_styler.rb', line 37
def font=(rmq_font)
@view.setTypeface(rmq_font.to_typeface, rmq_font.sdk_text_style)
@view.textSize = rmq_font.size
end
|
[View source]
6
7
8
9
|
# File 'lib/project/ruby_motion_query/stylers/rmq_text_view_styler.rb', line 6
def font_family=(font_family)
@font_family = font_family
@lazy_typeface = true
end
|
[View source]
42
43
44
|
# File 'lib/project/ruby_motion_query/stylers/rmq_text_view_styler.rb', line 42
def gravity=(gravity)
@view.gravity = convert_gravity(gravity)
end
|
[View source]
33
34
35
|
# File 'lib/project/ruby_motion_query/stylers/rmq_text_view_styler.rb', line 33
def text=(text)
@view.text = text
end
|
[View source]
26
27
28
|
# File 'lib/project/ruby_motion_query/stylers/rmq_text_view_styler.rb', line 26
def text_color=(text_color)
@view.textColor = convert_color(text_color)
end
|
[View source]
2
3
4
|
# File 'lib/project/ruby_motion_query/stylers/rmq_text_view_styler.rb', line 2
def text_size=(text_size)
@view.textSize = text_size
end
|
[View source]
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
# File 'lib/project/ruby_motion_query/stylers/rmq_text_view_styler.rb', line 11
def text_style=(text_style)
@text_style =
case text_style.to_s.downcase
when "bold"
Android::Graphics::Typeface::BOLD
when "italic"
Android::Graphics::Typeface::ITALIC
when "bold italic"
Android::Graphics::Typeface::BOLD_ITALIC
when "normal"
Android::Graphics::Typeface::NORMAL
end
@lazy_typeface = true
end
|