OLD | NEW |
| (Empty) |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 package org.chromium.chrome.browser.widget; | |
6 | |
7 /** | |
8 * An interface for notifications about the state of the bottom sheet. | |
9 */ | |
10 public interface BottomSheetObserver { | |
11 /** | |
12 * A notification that the sheet has been opened, meaning the sheet is any h
eight greater | |
13 * than its peeking state. | |
14 */ | |
15 void onSheetOpened(); | |
16 | |
17 /** | |
18 * A notification that the sheet has closed, meaning the sheet has reached i
ts peeking state. | |
19 */ | |
20 void onSheetClosed(); | |
21 | |
22 /** | |
23 * A notification that the sheet has begun loading a URL. | |
24 * | |
25 * @param url The URL being loaded. | |
26 */ | |
27 void onLoadUrl(String url); | |
28 | |
29 /** | |
30 * An event for when the sheet's offset from the bottom of the screen change
s. | |
31 * | |
32 * @param heightFraction The fraction of the way to the fully expanded state
that the sheet | |
33 * is. This will be 0.0f when the sheet is peeking and
1.0f when the | |
34 * sheet is completely expanded. | |
35 */ | |
36 void onSheetOffsetChanged(float heightFraction); | |
37 | |
38 /** | |
39 * An event for when the sheet is transitioning from the peeking state to th
e half expanded | |
40 * state. Once the sheet is outside the peek-half range, this event will no
longer be | |
41 * called. This event is guaranteed to be called at least once with 0.0f in
the peeking state | |
42 * and 1.0f at or past the half state. This means if the sheet is set to the
full state from | |
43 * the peeking state, this event will be called a single time with 1.0f. | |
44 * | |
45 * @param transitionFraction The fraction of the way to the half expanded st
ate that the | |
46 * sheet is. This will be 0.0f when the sheet is p
eeking and 1.0f | |
47 * when the sheet is half expanded. | |
48 */ | |
49 void onTransitionPeekToHalf(float transitionFraction); | |
50 } | |
OLD | NEW |