OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 package org.chromium.ui.base; | 5 package org.chromium.ui.base; |
6 | 6 |
7 import android.view.View; | 7 import android.view.View; |
8 | 8 |
9 /** | 9 /** |
10 * Interface to acquire and release anchor views from the implementing View. | 10 * Interface to add, remove, and position anchor views from the implementing Vie
w. |
11 */ | 11 */ |
12 public interface ViewAndroidDelegate { | 12 public interface ViewAndroidDelegate { |
13 | 13 |
14 /** | 14 /** |
15 * @return An anchor view that can be used to anchor decoration views like A
utofill popup. | 15 * Add a view used to anchor decoration views like Autofill popup. |
| 16 * @param anchorView The anchor view that needs to be added. |
16 */ | 17 */ |
17 View acquireAnchorView(); | 18 void addView(View anchorView); |
18 | 19 |
19 /** | 20 /** |
20 * Set the anchor view to specified position and width (all units in dp). | 21 * Remove given anchor view. |
21 * @param view The anchor view that needs to be positioned. | 22 * @param anchorView The anchor view that needs to be removed. |
| 23 */ |
| 24 void removeView(View anchorView); |
| 25 |
| 26 /** |
| 27 * Set the anchor view to specified position and width. |
| 28 * @param anchorView The anchor view that needs to be positioned. |
22 * @param x X coordinate of the top left corner of the anchor view. | 29 * @param x X coordinate of the top left corner of the anchor view. |
23 * @param y Y coordinate of the top left corner of the anchor view. | 30 * @param y Y coordinate of the top left corner of the anchor view. |
24 * @param width The width of the anchor view. | 31 * @param width The width of the anchor view. |
25 * @param height The height of the anchor view. | 32 * @param height The height of the anchor view. |
| 33 * @param scale dip scale. |
| 34 * @param leftMargin The left margin of the anchor view. |
| 35 * @param topMargin The top margin of the anchor view. |
26 */ | 36 */ |
27 void setAnchorViewPosition(View view, float x, float y, float width, float h
eight); | 37 void setViewPosition(View anchorView, float x, float y, float width, float h
eight, float scale, |
28 | 38 int leftMargin, int topMargin); |
29 /** | |
30 * Release given anchor view. | |
31 * @param anchorView The anchor view that needs to be released. | |
32 */ | |
33 void releaseAnchorView(View anchorView); | |
34 } | 39 } |
OLD | NEW |