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 17package android.support.v7.widget; 18 19import android.support.annotation.NonNull; 20import android.support.v7.view.menu.MenuBuilder; 21import android.view.MenuItem; 22 23/** 24 * An interface notified when a menu item is hovered. Useful for cases when hover should trigger 25 * some behavior at a higher level, like managing the opening and closing of submenus. 26 * 27 * @hide 28 */ 29public interface MenuItemHoverListener { 30 /** 31 * Called when hover exits a menu item. 32 * <p> 33 * If hover is moving to another item, this method will be called before 34 * {@link #onItemHoverEnter(MenuBuilder, MenuItem)} for the newly-hovered item. 35 * 36 * @param menu the item's parent menu 37 * @param item the hovered menu item 38 */ 39 void onItemHoverExit(@NonNull MenuBuilder menu, @NonNull MenuItem item); 40 41 /** 42 * Called when hover enters a menu item. 43 * 44 * @param menu the item's parent menu 45 * @param item the hovered menu item 46 */ 47 void onItemHoverEnter(@NonNull MenuBuilder menu, @NonNull MenuItem item); 48}