From: Artur Świgoń Date: Thu, 14 May 2020 13:37:22 +0000 (+0200) Subject: Remove Accessibility Launcher from settings X-Git-Tag: submit/tizen/20200518.065950~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=90f16ee909582bd2b7513862bf32824b1ffba48f;p=profile%2Fcommon%2Fapps%2Fnative%2Faccessibility-setting.git Remove Accessibility Launcher from settings Change-Id: Ifcbd8d79e2b690f7c6226cb6ed821be4397caa4b --- diff --git a/po/en.po b/po/en.po index cd64339..feab158 100644 --- a/po/en.po +++ b/po/en.po @@ -601,21 +601,6 @@ msgstr "Close your eyes for at least 2.0 seconds to allow the device to recognis msgid "IDS_ACCS_UNIVERSAL_SWITCH_ADD_SWITCH_CAMERA_GROUP_HEAD_MOUTH" msgstr "Open mouth" -msgid "IDS_ACCS_ACCESSIBILITY_LAUNCHER" -msgstr "Accessibility launcher" - -msgid "IDS_ACCS_ACCESSIBILITY_LAUNCHER_HINT" -msgstr "Add shortcuts to specific settings and functions." - -msgid "IDS_ACCS_ACCESSIBILITY_LAUNCHER_COMMENT" -msgstr "Open your accessibility settings by pressing the home key three times in quick succession." - -msgid "IDS_ACCS_ACCESSIBILITY_LAUNCHER_ON" -msgstr "On" - -msgid "IDS_ACCS_ACCESSIBILITY_LAUNCHER_OFF" -msgstr "Off" - msgid "IDS_ACCS_SELECT_ITEMS" msgstr "Select items" diff --git a/src/model/AccessibilityLauncherModel.cpp b/src/model/AccessibilityLauncherModel.cpp deleted file mode 100644 index fb33032..0000000 --- a/src/model/AccessibilityLauncherModel.cpp +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright 2019 Samsung Electronics Co., Ltd - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "AccessibilityLauncherModel.hpp" - -#include "Singleton.hpp" - -#define VCONFKEY_SETAPPL_ACCESSIBILITY_ACCESSIBILITY_LAUNCHER_STATE "db/setting/accessibility/accessibility-launcher" -#define VCONFKEY_SETAPPL_ACCESSIBILITY_ACCESSIBILITY_LAUNCHER_LAUNCH "db/setting/accessibility/accessibility-launcher/launch" - -AccessibilityLauncherModel::AccessibilityLauncherModel() -{ - stateHandle_ = Singleton::instance().registerAndGet(VCONFKEY_SETAPPL_ACCESSIBILITY_ACCESSIBILITY_LAUNCHER_STATE, false, [this](auto val) { - state_ = val; - }); - - state_.attach([](auto val) { - Singleton::instance().set(VCONFKEY_SETAPPL_ACCESSIBILITY_ACCESSIBILITY_LAUNCHER_STATE, val); - }); - - launchedHandle_ = Singleton::instance().registerAndGet(VCONFKEY_SETAPPL_ACCESSIBILITY_ACCESSIBILITY_LAUNCHER_LAUNCH, 0, [this](auto val) { - bool a = val & 0x1; - if (a != accessibilityLaunched_.value()) - accessibilityLaunched_ = a; - - bool sr = val & 0x2; - if (sr != screenReaderLaunched_.value()) - screenReaderLaunched_ = sr; - - bool us = val & 0x4; - if (us != universalSwitchLaunched_.value()) - universalSwitchLaunched_ = us; - }); - - auto calculateLauncherState = [this]() { - int a = accessibilityLaunched_.value() ? 0x1 : 0x0; - int sr = screenReaderLaunched_.value() ? 0x2 : 0x0; - int us = universalSwitchLaunched_.value() ? 0x4 : 0x0; - - return us | sr | a; - }; - - accessibilityLaunched_.attach([this, calculateLauncherState](auto val) { - Singleton::instance().set(VCONFKEY_SETAPPL_ACCESSIBILITY_ACCESSIBILITY_LAUNCHER_LAUNCH, calculateLauncherState()); - }); - screenReaderLaunched_.attach([this, calculateLauncherState](auto val) { - Singleton::instance().set(VCONFKEY_SETAPPL_ACCESSIBILITY_ACCESSIBILITY_LAUNCHER_LAUNCH, calculateLauncherState()); - }); - universalSwitchLaunched_.attach([this, calculateLauncherState](auto val) { - Singleton::instance().set(VCONFKEY_SETAPPL_ACCESSIBILITY_ACCESSIBILITY_LAUNCHER_LAUNCH, calculateLauncherState()); - }); -} \ No newline at end of file diff --git a/src/model/AccessibilityLauncherModel.hpp b/src/model/AccessibilityLauncherModel.hpp deleted file mode 100644 index 1906bb5..0000000 --- a/src/model/AccessibilityLauncherModel.hpp +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright 2019 Samsung Electronics Co., Ltd - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#ifndef ACCESSIBILITY_LAUNCHER_MODEL_HPP -#define ACCESSIBILITY_LAUNCHER_MODEL_HPP - -#include "ObservableProperty.hpp" -#include "VConf.hpp" - -class AccessibilityLauncherModel -{ - public: - AccessibilityLauncherModel(); - - ObservableProperty state_; - ObservableProperty accessibilityLaunched_; - ObservableProperty screenReaderLaunched_; - ObservableProperty universalSwitchLaunched_; - - private: - VConfInterface::CallbackHandle stateHandle_; - VConfInterface::CallbackHandle launchedHandle_; -}; - -#endif diff --git a/src/presenter/AccessibilityLauncherPagePresenter.cpp b/src/presenter/AccessibilityLauncherPagePresenter.cpp deleted file mode 100644 index e689427..0000000 --- a/src/presenter/AccessibilityLauncherPagePresenter.cpp +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright 2018 Samsung Electronics Co., Ltd - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "AccessibilityLauncherPagePresenter.hpp" - -#include "AccessibilitySettingLog.hpp" -#include "AppContext.hpp" -#include "Button.hpp" -#include "Genlist.hpp" -#include "Singleton.hpp" -#include "VConf.hpp" -#include "utils.hpp" - -#include -#include -#include - -AccessibilityLauncherPagePresenter::AccessibilityLauncherPagePresenter() - : ListPresenter("IDS_ACCS_ACCESSIBILITY_LAUNCHER") -{ - model_.state_.attach([this](auto val) { - groups_[0].items_[0]->title_ = val ? "IDS_ACCS_ACCESSIBILITY_LAUNCHER_ON" : "IDS_ACCS_ACCESSIBILITY_LAUNCHER_OFF"; - groups_[0].items_[0]->widgetState_ = val; - }); - - groups_.emplace_back(""); - - groups_.back().items_.push_back(std::make_unique( - model_.state_.value() ? "IDS_ACCS_ACCESSIBILITY_LAUNCHER_ON" : "IDS_ACCS_ACCESSIBILITY_LAUNCHER_OFF", - std::string{}, - [this](auto item) { - model_.state_ = item->widgetState_.value(); - }, - ListItem::WidgetType::toggle)); - groups_.back().items_.back()->widgetState_ = model_.state_.value(); - - groups_.back().items_.push_back(std::make_unique(std::string{}, "IDS_ACCS_ACCESSIBILITY_LAUNCHER_COMMENT")); - - groups_.emplace_back(""); - - groups_.back().items_.push_back(std::make_unique("IDS_ST_BODY_ACCESSIBILITY", - std::string{}, - [this](auto item) { model_.accessibilityLaunched_ = item->widgetState_.value(); }, - ListItem::WidgetType::toggle)); - groups_.back().items_.back()->enabled_ = groups_[0].items_[0]->widgetState_.value(); - groups_.back().items_.push_back(std::make_unique("IDS_ST_MBODY_SCREEN_READER_HTTS", - std::string{}, - [this](auto item) { model_.screenReaderLaunched_ = item->widgetState_.value(); }, - ListItem::WidgetType::toggle)); - groups_.back().items_.back()->enabled_ = groups_[0].items_[0]->widgetState_.value(); - groups_.back().items_.push_back(std::make_unique("IDS_ACCS_UNIVERSAL_SWITCH", - std::string{}, - [this](auto item) { model_.universalSwitchLaunched_ = item->widgetState_.value(); }, - ListItem::WidgetType::toggle)); - groups_.back().items_.back()->enabled_ = groups_[0].items_[0]->widgetState_.value(); - - groups_[0].items_[0]->widgetState_.attach([this](auto val) { - for (auto &it : groups_[1].items_) - it->enabled_ = val; - }); -} diff --git a/src/presenter/AccessibilityLauncherPagePresenter.hpp b/src/presenter/AccessibilityLauncherPagePresenter.hpp deleted file mode 100644 index 465dd55..0000000 --- a/src/presenter/AccessibilityLauncherPagePresenter.hpp +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2018 Samsung Electronics Co., Ltd - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef ACCESSIBILITY_LAUNCHER_PAGE_PRESENTER_HPP -#define ACCESSIBILITY_LAUNCHER_PAGE_PRESENTER_HPP - -#include "AccessibilityLauncherModel.hpp" -#include "ListPresenter.hpp" - -#include - -class AccessibilityLauncherPagePresenter : public ListPresenter -{ - public: - AccessibilityLauncherPagePresenter(); - - private: - AccessibilityLauncherModel model_; -}; - -#endif diff --git a/src/presenter/MainPagePresenter.cpp b/src/presenter/MainPagePresenter.cpp index 19b4249..63a5037 100644 --- a/src/presenter/MainPagePresenter.cpp +++ b/src/presenter/MainPagePresenter.cpp @@ -36,10 +36,6 @@ MainPagePresenter::MainPagePresenter() "IDS_ACCS_UNIVERSAL_SWITCH", "IDS_ACCS_UNIVERSAL_SWITCH_HINT", [this](auto item) { Singleton::instance().push(std::make_unique()); })); - groups_.back().items_.push_back(std::make_unique( - "IDS_ACCS_ACCESSIBILITY_LAUNCHER", - "IDS_ACCS_ACCESSIBILITY_LAUNCHER_HINT", - [this](auto item) { Singleton::instance().push(std::make_unique()); })); onPopCallback_ = [this]() { screenReaderStateHandle_ = {}; diff --git a/src/presenter/MainPagePresenter.hpp b/src/presenter/MainPagePresenter.hpp index 707e76f..7e0fb45 100644 --- a/src/presenter/MainPagePresenter.hpp +++ b/src/presenter/MainPagePresenter.hpp @@ -16,7 +16,6 @@ #ifndef MAIN_PAGE_PRESENTER_HPP #define MAIN_PAGE_PRESENTER_HPP -#include "AccessibilityLauncherPagePresenter.hpp" #include "ListPresenter.hpp" #include "ScreenReaderModel.hpp" #include "UniversalSwitchPagePresenter.hpp" @@ -28,7 +27,6 @@ class MainPagePresenter : public ListPresenter MainPagePresenter(); private: - std::unique_ptr accessibilityLauncherPage_; VConfInterface::CallbackHandle screenReaderStateHandle_; ScreenReaderModel model_; };