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