fd.java 9.25 KB
import android.annotation.TargetApi;
import android.content.Context;
import android.content.res.Resources.NotFoundException;
import android.graphics.drawable.Drawable;
import android.os.Build.VERSION;
import android.os.Bundle;
import android.support.annotation.RequiresApi;
import android.support.v7.app.ActionBar;
import android.support.v7.app.ActionBarDrawerToggle.Delegate;
import android.support.v7.app.AppCompatCallback;
import android.support.v7.app.AppCompatDelegate;
import android.support.v7.appcompat.R.attr;
import android.support.v7.view.ActionMode;
import android.support.v7.view.ActionMode.Callback;
import android.support.v7.view.SupportMenuInflater;
import android.support.v7.view.WindowCallbackWrapper;
import android.support.v7.view.menu.MenuBuilder;
import android.support.v7.widget.TintTypedArray;
import android.view.KeyEvent;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.View;
import android.view.Window;
import android.view.Window.Callback;

@TargetApi(9)
@RequiresApi(9)
public abstract class fd
  extends AppCompatDelegate
{
  private static boolean o;
  private static final boolean p;
  private static final int[] q;
  protected final Context a;
  public final Window b;
  protected final Window.Callback c;
  protected final Window.Callback d;
  public final AppCompatCallback e;
  protected ActionBar f;
  protected MenuInflater g;
  public boolean h;
  protected boolean i;
  protected boolean j;
  protected boolean k;
  protected boolean l;
  protected CharSequence m;
  public boolean n;
  private boolean r;
  
  static
  {
    if (Build.VERSION.SDK_INT < 21) {}
    for (boolean bool = true;; bool = false)
    {
      p = bool;
      if ((bool) && (!o))
      {
        Thread.setDefaultUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler()
        {
          public final void uncaughtException(Thread paramAnonymousThread, Throwable paramAnonymousThrowable)
          {
            int j = 0;
            int i = j;
            Object localObject;
            if ((paramAnonymousThrowable instanceof Resources.NotFoundException))
            {
              localObject = paramAnonymousThrowable.getMessage();
              i = j;
              if (localObject != null) {
                if (!((String)localObject).contains("drawable"))
                {
                  i = j;
                  if (!((String)localObject).contains("Drawable")) {}
                }
                else
                {
                  i = 1;
                }
              }
            }
            if (i != 0)
            {
              localObject = new Resources.NotFoundException(paramAnonymousThrowable.getMessage() + ". If the resource you are trying to use is a vector resource, you may be referencing it in an unsupported way. See AppCompatDelegate.setCompatVectorFromResourcesEnabled() for more info.");
              ((Throwable)localObject).initCause(paramAnonymousThrowable.getCause());
              ((Throwable)localObject).setStackTrace(paramAnonymousThrowable.getStackTrace());
              this.a.uncaughtException(paramAnonymousThread, (Throwable)localObject);
              return;
            }
            this.a.uncaughtException(paramAnonymousThread, paramAnonymousThrowable);
          }
        });
        o = true;
      }
      q = new int[] { 16842836 };
      return;
    }
  }
  
  protected fd(Context paramContext, Window paramWindow, AppCompatCallback paramAppCompatCallback)
  {
    this.a = paramContext;
    this.b = paramWindow;
    this.e = paramAppCompatCallback;
    this.c = this.b.getCallback();
    if ((this.c instanceof fd.b)) {
      throw new IllegalStateException("AppCompat has already installed itself into the Window");
    }
    this.d = a(this.c);
    this.b.setCallback(this.d);
    paramContext = TintTypedArray.obtainStyledAttributes(paramContext, null, q);
    paramWindow = paramContext.getDrawableIfKnown(0);
    if (paramWindow != null) {
      this.b.setBackgroundDrawable(paramWindow);
    }
    paramContext.recycle();
  }
  
  public abstract ActionMode a(ActionMode.Callback paramCallback);
  
  Window.Callback a(Window.Callback paramCallback)
  {
    return new fd.b(paramCallback);
  }
  
  public abstract void a();
  
  public abstract void a(int paramInt);
  
  public abstract void a(CharSequence paramCharSequence);
  
  public abstract boolean a(int paramInt, KeyEvent paramKeyEvent);
  
  public abstract boolean a(KeyEvent paramKeyEvent);
  
  public boolean applyDayNight()
  {
    return false;
  }
  
  protected final Context b()
  {
    Context localContext = null;
    Object localObject = getSupportActionBar();
    if (localObject != null) {
      localContext = ((ActionBar)localObject).getThemedContext();
    }
    localObject = localContext;
    if (localContext == null) {
      localObject = this.a;
    }
    return (Context)localObject;
  }
  
  public abstract boolean b(int paramInt);
  
  public final ActionBarDrawerToggle.Delegate getDrawerToggleDelegate()
  {
    return new fd.a();
  }
  
  public MenuInflater getMenuInflater()
  {
    if (this.g == null)
    {
      a();
      if (this.f == null) {
        break label43;
      }
    }
    label43:
    for (Context localContext = this.f.getThemedContext();; localContext = this.a)
    {
      this.g = new SupportMenuInflater(localContext);
      return this.g;
    }
  }
  
  public ActionBar getSupportActionBar()
  {
    a();
    return this.f;
  }
  
  public boolean isHandleNativeActionModesEnabled()
  {
    return false;
  }
  
  public void onDestroy()
  {
    this.n = true;
  }
  
  public void onSaveInstanceState(Bundle paramBundle) {}
  
  public void onStart()
  {
    this.r = true;
  }
  
  public void onStop()
  {
    this.r = false;
  }
  
  public void setHandleNativeActionModesEnabled(boolean paramBoolean) {}
  
  public void setLocalNightMode(int paramInt) {}
  
  public final void setTitle(CharSequence paramCharSequence)
  {
    this.m = paramCharSequence;
    a(paramCharSequence);
  }
  
  final class a
    implements ActionBarDrawerToggle.Delegate
  {
    a() {}
    
    public final Context getActionBarThemedContext()
    {
      return fd.this.b();
    }
    
    public final Drawable getThemeUpIndicator()
    {
      TintTypedArray localTintTypedArray = TintTypedArray.obtainStyledAttributes(getActionBarThemedContext(), null, new int[] { R.attr.homeAsUpIndicator });
      Drawable localDrawable = localTintTypedArray.getDrawable(0);
      localTintTypedArray.recycle();
      return localDrawable;
    }
    
    public final boolean isNavigationVisible()
    {
      ActionBar localActionBar = fd.this.getSupportActionBar();
      return (localActionBar != null) && ((localActionBar.getDisplayOptions() & 0x4) != 0);
    }
    
    public final void setActionBarDescription(int paramInt)
    {
      ActionBar localActionBar = fd.this.getSupportActionBar();
      if (localActionBar != null) {
        localActionBar.setHomeActionContentDescription(paramInt);
      }
    }
    
    public final void setActionBarUpIndicator(Drawable paramDrawable, int paramInt)
    {
      ActionBar localActionBar = fd.this.getSupportActionBar();
      if (localActionBar != null)
      {
        localActionBar.setHomeAsUpIndicator(paramDrawable);
        localActionBar.setHomeActionContentDescription(paramInt);
      }
    }
  }
  
  class b
    extends WindowCallbackWrapper
  {
    b(Window.Callback paramCallback)
    {
      super();
    }
    
    public boolean dispatchKeyEvent(KeyEvent paramKeyEvent)
    {
      return (fd.this.a(paramKeyEvent)) || (super.dispatchKeyEvent(paramKeyEvent));
    }
    
    public boolean dispatchKeyShortcutEvent(KeyEvent paramKeyEvent)
    {
      return (super.dispatchKeyShortcutEvent(paramKeyEvent)) || (fd.this.a(paramKeyEvent.getKeyCode(), paramKeyEvent));
    }
    
    public void onContentChanged() {}
    
    public boolean onCreatePanelMenu(int paramInt, Menu paramMenu)
    {
      if ((paramInt == 0) && (!(paramMenu instanceof MenuBuilder))) {
        return false;
      }
      return super.onCreatePanelMenu(paramInt, paramMenu);
    }
    
    public boolean onMenuOpened(int paramInt, Menu paramMenu)
    {
      super.onMenuOpened(paramInt, paramMenu);
      fd.this.b(paramInt);
      return true;
    }
    
    public void onPanelClosed(int paramInt, Menu paramMenu)
    {
      super.onPanelClosed(paramInt, paramMenu);
      fd.this.a(paramInt);
    }
    
    public boolean onPreparePanel(int paramInt, View paramView, Menu paramMenu)
    {
      MenuBuilder localMenuBuilder;
      boolean bool1;
      if ((paramMenu instanceof MenuBuilder))
      {
        localMenuBuilder = (MenuBuilder)paramMenu;
        if ((paramInt != 0) || (localMenuBuilder != null)) {
          break label34;
        }
        bool1 = false;
      }
      label34:
      boolean bool2;
      do
      {
        return bool1;
        localMenuBuilder = null;
        break;
        if (localMenuBuilder != null) {
          localMenuBuilder.setOverrideVisibleItems(true);
        }
        bool2 = super.onPreparePanel(paramInt, paramView, paramMenu);
        bool1 = bool2;
      } while (localMenuBuilder == null);
      localMenuBuilder.setOverrideVisibleItems(false);
      return bool2;
    }
  }
}


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