SupportActionModeWrapper.java 4.74 KB
package android.support.v7.view;

import android.annotation.TargetApi;
import android.content.Context;
import android.support.annotation.RestrictTo;
import android.support.v4.internal.view.SupportMenu;
import android.support.v4.internal.view.SupportMenuItem;
import android.support.v4.util.SimpleArrayMap;
import android.support.v7.view.menu.MenuWrapperFactory;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import java.util.ArrayList;

@TargetApi(11)
@RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP})
public class SupportActionModeWrapper
  extends android.view.ActionMode
{
  final Context a;
  final ActionMode b;
  
  public SupportActionModeWrapper(Context paramContext, ActionMode paramActionMode)
  {
    this.a = paramContext;
    this.b = paramActionMode;
  }
  
  public void finish()
  {
    this.b.finish();
  }
  
  public View getCustomView()
  {
    return this.b.getCustomView();
  }
  
  public Menu getMenu()
  {
    return MenuWrapperFactory.wrapSupportMenu(this.a, (SupportMenu)this.b.getMenu());
  }
  
  public MenuInflater getMenuInflater()
  {
    return this.b.getMenuInflater();
  }
  
  public CharSequence getSubtitle()
  {
    return this.b.getSubtitle();
  }
  
  public Object getTag()
  {
    return this.b.getTag();
  }
  
  public CharSequence getTitle()
  {
    return this.b.getTitle();
  }
  
  public boolean getTitleOptionalHint()
  {
    return this.b.getTitleOptionalHint();
  }
  
  public void invalidate()
  {
    this.b.invalidate();
  }
  
  public boolean isTitleOptional()
  {
    return this.b.isTitleOptional();
  }
  
  public void setCustomView(View paramView)
  {
    this.b.setCustomView(paramView);
  }
  
  public void setSubtitle(int paramInt)
  {
    this.b.setSubtitle(paramInt);
  }
  
  public void setSubtitle(CharSequence paramCharSequence)
  {
    this.b.setSubtitle(paramCharSequence);
  }
  
  public void setTag(Object paramObject)
  {
    this.b.setTag(paramObject);
  }
  
  public void setTitle(int paramInt)
  {
    this.b.setTitle(paramInt);
  }
  
  public void setTitle(CharSequence paramCharSequence)
  {
    this.b.setTitle(paramCharSequence);
  }
  
  public void setTitleOptionalHint(boolean paramBoolean)
  {
    this.b.setTitleOptionalHint(paramBoolean);
  }
  
  @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP})
  public static class CallbackWrapper
    implements ActionMode.Callback
  {
    final android.view.ActionMode.Callback a;
    final Context b;
    final ArrayList<SupportActionModeWrapper> c;
    final SimpleArrayMap<Menu, Menu> d;
    
    public CallbackWrapper(Context paramContext, android.view.ActionMode.Callback paramCallback)
    {
      this.b = paramContext;
      this.a = paramCallback;
      this.c = new ArrayList();
      this.d = new SimpleArrayMap();
    }
    
    private Menu a(Menu paramMenu)
    {
      Menu localMenu2 = (Menu)this.d.get(paramMenu);
      Menu localMenu1 = localMenu2;
      if (localMenu2 == null)
      {
        localMenu1 = MenuWrapperFactory.wrapSupportMenu(this.b, (SupportMenu)paramMenu);
        this.d.put(paramMenu, localMenu1);
      }
      return localMenu1;
    }
    
    public android.view.ActionMode getActionModeWrapper(ActionMode paramActionMode)
    {
      int j = this.c.size();
      int i = 0;
      while (i < j)
      {
        SupportActionModeWrapper localSupportActionModeWrapper = (SupportActionModeWrapper)this.c.get(i);
        if ((localSupportActionModeWrapper != null) && (localSupportActionModeWrapper.b == paramActionMode)) {
          return localSupportActionModeWrapper;
        }
        i += 1;
      }
      paramActionMode = new SupportActionModeWrapper(this.b, paramActionMode);
      this.c.add(paramActionMode);
      return paramActionMode;
    }
    
    public boolean onActionItemClicked(ActionMode paramActionMode, MenuItem paramMenuItem)
    {
      return this.a.onActionItemClicked(getActionModeWrapper(paramActionMode), MenuWrapperFactory.wrapSupportMenuItem(this.b, (SupportMenuItem)paramMenuItem));
    }
    
    public boolean onCreateActionMode(ActionMode paramActionMode, Menu paramMenu)
    {
      return this.a.onCreateActionMode(getActionModeWrapper(paramActionMode), a(paramMenu));
    }
    
    public void onDestroyActionMode(ActionMode paramActionMode)
    {
      this.a.onDestroyActionMode(getActionModeWrapper(paramActionMode));
    }
    
    public boolean onPrepareActionMode(ActionMode paramActionMode, Menu paramMenu)
    {
      return this.a.onPrepareActionMode(getActionModeWrapper(paramActionMode), a(paramMenu));
    }
  }
}


/* Location:              /home/merong/decompile/hackery-dex2jar.jar!/android/support/v7/view/SupportActionModeWrapper.class
 * Java compiler version: 6 (50.0)
 * JD-Core Version:       0.7.1
 */