1 /*
2  * Copyright (C) 2014 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.camera.ui.focus;
18 
19 import android.graphics.RectF;
20 
21 /**
22  * Primary interface for interacting with the focus ring UI.
23  */
24 public interface FocusRing {
25     /**
26      * Check the state of the passive focus ring animation.
27      *
28      * @return whether the passive focus animation is running.
29      */
isPassiveFocusRunning()30     public boolean isPassiveFocusRunning();
31     /**
32      * Check the state of the active focus ring animation.
33      *
34      * @return whether the active focus animation is running.
35      */
isActiveFocusRunning()36     public boolean isActiveFocusRunning();
37     /**
38      * Start a passive focus animation.
39      */
startPassiveFocus()40     public void startPassiveFocus();
41     /**
42      * Start an active focus animation.
43      */
startActiveFocus()44     public void startActiveFocus();
45     /**
46      * Stop any currently running focus animations.
47      */
stopFocusAnimations()48     public void stopFocusAnimations();
49     /**
50      * Set the location of the focus ring animation center.
51      */
setFocusLocation(float viewX, float viewY)52     public void setFocusLocation(float viewX, float viewY);
53 
54     /**
55      * Set the location of the focus ring animation center.
56      */
centerFocusLocation()57     public void centerFocusLocation();
58 
59     /**
60      * Set the target radius as a ratio of min to max visible radius
61      * which will internally convert and clamp the value to the
62      * correct pixel radius.
63      */
setRadiusRatio(float ratio)64     public void setRadiusRatio(float ratio);
65 
66     /**
67      * The physical size of preview can vary and does not map directly
68      * to the size of the view. This allows for conversions between view
69      * and preview space for values that are provided in preview space.
70      */
configurePreviewDimensions(RectF previewArea)71     void configurePreviewDimensions(RectF previewArea);
72 }