• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2010 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package com.android.photoeditor.actions;
18 
19 import android.view.View;
20 import android.view.ViewGroup;
21 
22 import com.android.photoeditor.FilterStack;
23 import com.android.photoeditor.R;
24 import com.android.photoeditor.filters.RedEyeFilter;
25 
26 /**
27  * An action handling red-eye removal.
28  */
29 public class RedEyeAction extends FilterAction {
30 
RedEyeAction(FilterStack filterStack, ViewGroup tools)31     public RedEyeAction(FilterStack filterStack, ViewGroup tools) {
32         super(filterStack, tools, R.string.redeye_tooltip);
33     }
34 
35     @Override
onBegin()36     public void onBegin() {
37         final RedEyeFilter filter = new RedEyeFilter();
38 
39         touchView.setSingleTapListener(new TouchView.SingleTapListener() {
40 
41             @Override
42             public void onSingleTap(float x, float y) {
43                 filter.addRedEyePosition(photoView.mapPhotoPoint(x, y));
44                 notifyFilterChanged(filter, true);
45             }
46         });
47         touchView.setVisibility(View.VISIBLE);
48     }
49 
50     @Override
onEnd()51     public void onEnd() {
52     }
53 }
54