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,8 +48,9 @@ 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
}
@@ -66,7 +73,7 @@ void NuiAutofillPopup::PopupAutofill(Dali::Actor* actor) {
66
73
label.SetProperty (Dali::Toolkit::TextLabel::Property::TEXT_COLOR,
67
74
Dali::Color::WHITE_SMOKE);
68
75
label.SetProperty (Dali::Toolkit::TextLabel::Property::POINT_SIZE, 7 .0f );
69
- label.TouchedSignal ().Connect (this , &NuiAutofillPopup::OnTouch );
76
+ label.TouchedSignal ().Connect (this , &NuiAutofillPopup::Touched );
70
77
content.AddChild (label, Dali::Toolkit::TableView::CellPosition (i, 0 ));
71
78
content.SetFitHeight (i);
72
79
}
0 commit comments