1 package com.android.ex.photo; 2 3 import android.graphics.drawable.Drawable; 4 import android.support.annotation.Nullable; 5 6 7 /** 8 * Wrapper activity for an action bar. This wraps either a {@link android.app.ActionBar} or 9 * {@link android.support.v7.app.ActionBar}. 10 */ 11 public interface ActionBarInterface { 12 13 public interface OnMenuVisibilityListener { 14 /** 15 * Called when an action bar menu is shown or hidden. Applications may want to use 16 * this to tune auto-hiding behavior for the action bar or pause/resume video playback, 17 * gameplay, or other activity within the main content area. 18 * 19 * @param isVisible True if an action bar menu is now visible, false if no action bar 20 * menus are visible. 21 */ onMenuVisibilityChanged(boolean isVisible)22 public void onMenuVisibilityChanged(boolean isVisible); 23 } 24 setDisplayHomeAsUpEnabled(boolean showHomeAsUp)25 public void setDisplayHomeAsUpEnabled(boolean showHomeAsUp); 26 addOnMenuVisibilityListener(OnMenuVisibilityListener listener)27 public void addOnMenuVisibilityListener(OnMenuVisibilityListener listener); 28 29 /** 30 * Wrapper for {@code setDisplayOptions(ActionBar.DISPLAY_SHOW_TITLE, 31 * ActionBar.DISPLAY_SHOW_TITLE)}. 32 */ setDisplayOptionsShowTitle()33 public void setDisplayOptionsShowTitle(); 34 35 @Nullable getTitle()36 public CharSequence getTitle(); 37 setTitle(@ullable CharSequence title)38 public void setTitle(@Nullable CharSequence title); 39 setSubtitle(@ullable CharSequence subtitle)40 public void setSubtitle(@Nullable CharSequence subtitle); 41 show()42 public void show(); 43 hide()44 public void hide(); 45 setLogo(@ullable Drawable logo)46 public void setLogo(@Nullable Drawable logo); 47 } 48