11
11
#include " flutter/shell/platform/tizen/tizen_autofill.h"
12
12
13
13
namespace flutter {
14
- bool NuiAutofillPopup::OnTouch (Dali::Actor actor,
14
+
15
+ bool NuiAutofillPopup::Touched (Dali::Actor actor,
15
16
const Dali::TouchEvent& event) {
16
17
const Dali::PointState::Type state = event.GetState (0 );
17
18
if (Dali::PointState::DOWN == state) {
18
- auto t = actor.GetProperty (Dali::Actor::Property::NAME).Get <std::string>();
19
- on_commit_ (t);
20
- OnHide ();
19
+ std::string text =
20
+ actor.GetProperty (Dali::Actor::Property::NAME).Get <std::string>();
21
+ on_commit_ (text);
22
+ Hide ();
21
23
}
22
24
return true ;
23
25
}
24
26
25
- void NuiAutofillPopup::OnHide () {
26
- // TODO : There is a phenomenon where white traces remain for a while when
27
- // popup disappears.
27
+ void NuiAutofillPopup::Hide () {
28
+ // TODO(Swanseo0) : There is a phenomenon where white traces remain for a
29
+ // while when popup disappears.
28
30
popup_.SetDisplayState (Dali::Toolkit::Popup::HIDDEN);
29
31
}
30
32
31
- void NuiAutofillPopup::OnHidden () {
33
+ void NuiAutofillPopup::Hidden () {
32
34
popup_.Unparent ();
33
35
popup_.Reset ();
34
36
}
35
37
38
+ void NuiAutofillPopup::OutsideTouched () {
39
+ Hide ();
40
+ }
41
+
36
42
void NuiAutofillPopup::PrepareAutofill () {
37
43
popup_ = Dali::Toolkit::Popup::New ();
38
44
popup_.SetProperty (Dali::Actor::Property::NAME, " popup" );
@@ -42,14 +48,16 @@ void NuiAutofillPopup::PrepareAutofill() {
42
48
Dali::AnchorPoint::TOP_LEFT);
43
49
popup_.SetProperty (Dali::Toolkit::Popup::Property::TAIL_VISIBILITY, false );
44
50
popup_.SetBackgroundColor (Dali::Color::WHITE_SMOKE);
45
- popup_.OutsideTouchedSignal ().Connect (this , &NuiAutofillPopup::OnHide);
46
- popup_.HiddenSignal ().Connect (this , &NuiAutofillPopup::OnHidden);
51
+ popup_.OutsideTouchedSignal ().Connect (this ,
52
+ &NuiAutofillPopup::OutsideTouched);
53
+ popup_.HiddenSignal ().Connect (this , &NuiAutofillPopup::Hidden);
47
54
popup_.SetProperty (Dali::Toolkit::Popup::Property::BACKING_ENABLED, false );
48
55
popup_.SetProperty (Dali::Toolkit::Popup::Property::AUTO_HIDE_DELAY, 2500 );
49
56
}
50
57
51
58
void NuiAutofillPopup::PopupAutofill (Dali::Actor* actor) {
52
- const auto & items = TizenAutofill::GetInstance ().GetAutofillItems ();
59
+ const std::vector<std::unique_ptr<AutofillItem>>& items =
60
+ TizenAutofill::GetInstance ().GetAutofillItems ();
53
61
if (items.size () > 0 ) {
54
62
PrepareAutofill ();
55
63
Dali::Toolkit::TableView content =
@@ -59,14 +67,15 @@ void NuiAutofillPopup::PopupAutofill(Dali::Actor* actor) {
59
67
content.SetProperty (Dali::Actor::Property::PADDING,
60
68
Dali::Vector4 (10 , 10 , 0 , 0 ));
61
69
for (uint32_t i = 0 ; i < items.size (); ++i) {
62
- auto label = Dali::Toolkit::TextLabel::New (items[i]->label_ );
70
+ Dali::Toolkit::TextLabel label =
71
+ Dali::Toolkit::TextLabel::New (items[i]->label_ );
63
72
label.SetProperty (Dali::Actor::Property::NAME, items[i]->value_ );
64
73
label.SetResizePolicy (Dali::ResizePolicy::DIMENSION_DEPENDENCY,
65
74
Dali::Dimension::HEIGHT);
66
75
label.SetProperty (Dali::Toolkit::TextLabel::Property::TEXT_COLOR,
67
76
Dali::Color::WHITE_SMOKE);
68
77
label.SetProperty (Dali::Toolkit::TextLabel::Property::POINT_SIZE, 7 .0f );
69
- label.TouchedSignal ().Connect (this , &NuiAutofillPopup::OnTouch );
78
+ label.TouchedSignal ().Connect (this , &NuiAutofillPopup::Touched );
70
79
content.AddChild (label, Dali::Toolkit::TableView::CellPosition (i, 0 ));
71
80
content.SetFitHeight (i);
72
81
}
0 commit comments