Commit 02f3725ad7bd2772cec5a2ffa49c2a8535225a69
1 parent
ff71a968
Added key control to gaussian-blur-view.example
Change-Id: I4cff9ec6adcd7d00f899bf9b15dd0dc172284065
Showing
2 changed files
with
29 additions
and
15 deletions
examples/gaussian-blur-view/README.md
0 → 100644
examples/gaussian-blur-view/gaussian-blur-view-example.cpp
| ... | ... | @@ -116,25 +116,30 @@ private: |
| 116 | 116 | |
| 117 | 117 | if(PointState::DOWN == state) |
| 118 | 118 | { |
| 119 | - if(!mActivate) | |
| 120 | - { | |
| 121 | - mActivate = true; | |
| 122 | - mGaussianBlurView.Activate(); | |
| 119 | + ToggleBlurState(); | |
| 120 | + } | |
| 123 | 121 | |
| 124 | - mOnLabel.SetProperty(Actor::Property::VISIBLE, true); | |
| 125 | - mOffLabel.SetProperty(Actor::Property::VISIBLE, false); | |
| 126 | - } | |
| 127 | - else | |
| 128 | - { | |
| 129 | - mActivate = false; | |
| 130 | - mGaussianBlurView.Deactivate(); | |
| 122 | + return true; | |
| 123 | + } | |
| 131 | 124 | |
| 132 | - mOnLabel.SetProperty(Actor::Property::VISIBLE, false); | |
| 133 | - mOffLabel.SetProperty(Actor::Property::VISIBLE, true); | |
| 134 | - } | |
| 125 | + void ToggleBlurState() | |
| 126 | + { | |
| 127 | + if(!mActivate) | |
| 128 | + { | |
| 129 | + mActivate = true; | |
| 130 | + mGaussianBlurView.Activate(); | |
| 131 | + | |
| 132 | + mOnLabel.SetProperty(Actor::Property::VISIBLE, true); | |
| 133 | + mOffLabel.SetProperty(Actor::Property::VISIBLE, false); | |
| 135 | 134 | } |
| 135 | + else | |
| 136 | + { | |
| 137 | + mActivate = false; | |
| 138 | + mGaussianBlurView.Deactivate(); | |
| 136 | 139 | |
| 137 | - return true; | |
| 140 | + mOnLabel.SetProperty(Actor::Property::VISIBLE, false); | |
| 141 | + mOffLabel.SetProperty(Actor::Property::VISIBLE, true); | |
| 142 | + } | |
| 138 | 143 | } |
| 139 | 144 | |
| 140 | 145 | void OnKeyEvent(const KeyEvent& event) |
| ... | ... | @@ -145,6 +150,10 @@ private: |
| 145 | 150 | { |
| 146 | 151 | mApplication.Quit(); |
| 147 | 152 | } |
| 153 | + else if(!event.GetKeyName().compare("1")) | |
| 154 | + { | |
| 155 | + ToggleBlurState(); | |
| 156 | + } | |
| 148 | 157 | } |
| 149 | 158 | } |
| 150 | 159 | ... | ... |