fm$d.java 3.05 KB
import android.content.Context;
import android.content.res.Resources;
import android.content.res.Resources.Theme;
import android.support.v7.appcompat.R.attr;
import android.support.v7.appcompat.R.layout;
import android.support.v7.appcompat.R.style;
import android.support.v7.view.WindowCallbackWrapper;
import android.support.v7.view.menu.ListMenuPresenter;
import android.support.v7.view.menu.MenuBuilder;
import android.support.v7.widget.DecorToolbar;
import android.util.TypedValue;
import android.view.ContextThemeWrapper;
import android.view.Menu;
import android.view.View;
import android.view.Window.Callback;
import android.widget.ListAdapter;

final class fm$d
  extends WindowCallbackWrapper
{
  public fm$d(fm paramfm, Window.Callback paramCallback)
  {
    super(paramCallback);
  }
  
  public final View onCreatePanelView(int paramInt)
  {
    switch (paramInt)
    {
    }
    Menu localMenu;
    do
    {
      return super.onCreatePanelView(paramInt);
      localMenu = this.a.a.getMenu();
    } while ((!onPreparePanel(paramInt, null, localMenu)) || (!onMenuOpened(paramInt, localMenu)));
    fm localfm = this.a;
    MenuBuilder localMenuBuilder;
    Object localObject;
    Resources.Theme localTheme;
    if ((localfm.d == null) && ((localMenu instanceof MenuBuilder)))
    {
      localMenuBuilder = (MenuBuilder)localMenu;
      localObject = localfm.a.getContext();
      TypedValue localTypedValue = new TypedValue();
      localTheme = ((Context)localObject).getResources().newTheme();
      localTheme.setTo(((Context)localObject).getTheme());
      localTheme.resolveAttribute(R.attr.actionBarPopupTheme, localTypedValue, true);
      if (localTypedValue.resourceId != 0) {
        localTheme.applyStyle(localTypedValue.resourceId, true);
      }
      localTheme.resolveAttribute(R.attr.panelMenuListTheme, localTypedValue, true);
      if (localTypedValue.resourceId == 0) {
        break label260;
      }
      localTheme.applyStyle(localTypedValue.resourceId, true);
    }
    for (;;)
    {
      localObject = new ContextThemeWrapper((Context)localObject, 0);
      ((Context)localObject).getTheme().setTo(localTheme);
      localfm.d = new ListMenuPresenter((Context)localObject, R.layout.abc_list_menu_item_layout);
      localfm.d.setCallback(new fm.c(localfm));
      localMenuBuilder.addMenuPresenter(localfm.d);
      if ((localMenu != null) && (localfm.d != null)) {
        break;
      }
      return null;
      label260:
      localTheme.applyStyle(R.style.Theme_AppCompat_CompactMenu, true);
    }
    if (localfm.d.getAdapter().getCount() > 0) {
      return (View)localfm.d.getMenuView(localfm.a.getViewGroup());
    }
    return null;
  }
  
  public final boolean onPreparePanel(int paramInt, View paramView, Menu paramMenu)
  {
    boolean bool = super.onPreparePanel(paramInt, paramView, paramMenu);
    if ((bool) && (!this.a.b))
    {
      this.a.a.setMenuPrepared();
      this.a.b = true;
    }
    return bool;
  }
}


/* Location:              /home/merong/decompile/hackery-dex2jar.jar!/fm$d.class
 * Java compiler version: 6 (50.0)
 * JD-Core Version:       0.7.1
 */