• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2016 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.systemui.statusbar.stack;
18 
19 import android.view.View;
20 
21 /**
22  * Interface for container layouts that scroll and listen for long presses. A child that
23  * wants to handle long press can use this to cancel the parents long press logic or request
24  * to be made visible by scrolling to it.
25  */
26 public interface ScrollContainer {
27     /**
28      * Request that the view does not perform long press for the current touch.
29      */
requestDisallowLongPress()30     void requestDisallowLongPress();
31 
32     /**
33      * Request that the view is made visible by scrolling to it.
34      * Return true if it scrolls.
35      */
scrollTo(View v)36     boolean scrollTo(View v);
37 
38     /**
39      * Like {@link #scrollTo(View)}, but keeps the scroll locked until the user
40      * scrolls, or {@param v} loses focus or is detached.
41      */
lockScrollTo(View v)42     void lockScrollTo(View v);
43 
44     /**
45      * Request that the view does not dismiss for the current touch.
46      */
requestDisallowDismiss()47     void requestDisallowDismiss();
48 }
49