Skip to content

Commit

Permalink
Apply reviewer's comment
Browse files Browse the repository at this point in the history
  • Loading branch information
Swanseo0 committed Feb 16, 2023
1 parent 5aca9c2 commit f37e3fd
Show file tree
Hide file tree
Showing 5 changed files with 244 additions and 184 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ void TextInputChannel::HandleMethodCall(
SendStateUpdate();
#ifndef WEARABLE_PROFILE
} else if (method.compare(kRequestAutofillMethod) == 0) {
TizenAutofill::GetInstance().RequestAutofill(autofill_hints_, autofill_id_);
TizenAutofill::GetInstance().RequestAutofill(autofill_id_, autofill_hints_);
#endif
} else {
result->NotImplemented();
Expand Down
54 changes: 28 additions & 26 deletions flutter/shell/platform/tizen/nui_autofill_popup.cc
Original file line number Diff line number Diff line change
Expand Up @@ -54,33 +54,35 @@ void NuiAutofillPopup::Prepare() {
void NuiAutofillPopup::Show(Dali::Actor* actor) {
const std::vector<std::unique_ptr<AutofillItem>>& items =
TizenAutofill::GetInstance().GetResponseItems();
if (!items.empty()) {
Prepare();
Dali::Toolkit::TableView content =
Dali::Toolkit::TableView::New(items.size(), 1);
content.SetResizePolicy(Dali::ResizePolicy::FILL_TO_PARENT,
Dali::Dimension::ALL_DIMENSIONS);
content.SetProperty(Dali::Actor::Property::PADDING,
Dali::Vector4(10, 10, 0, 0));
for (uint32_t i = 0; i < items.size(); ++i) {
Dali::Toolkit::TextLabel label =
Dali::Toolkit::TextLabel::New(items[i]->label_);
label.SetProperty(Dali::Actor::Property::NAME, items[i]->value_);
label.SetResizePolicy(Dali::ResizePolicy::DIMENSION_DEPENDENCY,
Dali::Dimension::HEIGHT);
label.SetProperty(Dali::Toolkit::TextLabel::Property::TEXT_COLOR,
Dali::Color::WHITE_SMOKE);
label.SetProperty(Dali::Toolkit::TextLabel::Property::POINT_SIZE, 7.0f);
label.TouchedSignal().Connect(this, &NuiAutofillPopup::Touched);
content.AddChild(label, Dali::Toolkit::TableView::CellPosition(i, 0));
content.SetFitHeight(i);
}
popup_.SetProperty(Dali::Actor::Property::SIZE,
Dali::Vector2(140.0f, 35.0f * items.size()));
popup_.SetContent(content);
popup_.SetDisplayState(Dali::Toolkit::Popup::SHOWN);
actor->Add(popup_);
if (items.empty()) {
return;
}

Prepare();
Dali::Toolkit::TableView content =
Dali::Toolkit::TableView::New(items.size(), 1);
content.SetResizePolicy(Dali::ResizePolicy::FILL_TO_PARENT,
Dali::Dimension::ALL_DIMENSIONS);
content.SetProperty(Dali::Actor::Property::PADDING,
Dali::Vector4(10, 10, 0, 0));
for (uint32_t i = 0; i < items.size(); ++i) {
Dali::Toolkit::TextLabel label =
Dali::Toolkit::TextLabel::New(items[i]->label_);
label.SetProperty(Dali::Actor::Property::NAME, items[i]->value_);
label.SetResizePolicy(Dali::ResizePolicy::DIMENSION_DEPENDENCY,
Dali::Dimension::HEIGHT);
label.SetProperty(Dali::Toolkit::TextLabel::Property::TEXT_COLOR,
Dali::Color::WHITE_SMOKE);
label.SetProperty(Dali::Toolkit::TextLabel::Property::POINT_SIZE, 7.0f);
label.TouchedSignal().Connect(this, &NuiAutofillPopup::Touched);
content.AddChild(label, Dali::Toolkit::TableView::CellPosition(i, 0));
content.SetFitHeight(i);
}
popup_.SetProperty(Dali::Actor::Property::SIZE,
Dali::Vector2(140.0f, 35.0f * items.size()));
popup_.SetContent(content);
popup_.SetDisplayState(Dali::Toolkit::Popup::SHOWN);
actor->Add(popup_);
}

} // namespace flutter
4 changes: 2 additions & 2 deletions flutter/shell/platform/tizen/nui_autofill_popup.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ namespace flutter {

class NuiAutofillPopup : public Dali::ConnectionTracker {
public:
void Prepare();

void Show(Dali::Actor* actor);

void SetOnCommit(std::function<void(const std::string&)> callback) {
on_commit_ = callback;
}

private:
void Prepare();

void Hidden();

void OutsideTouched();
Expand Down
Loading

0 comments on commit f37e3fd

Please sign in to comment.