fc.java 3.58 KB
import android.annotation.TargetApi;
import android.app.ActionBar;
import android.app.Activity;
import android.content.res.TypedArray;
import android.graphics.drawable.Drawable;
import android.os.Build.VERSION;
import android.support.annotation.RequiresApi;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import java.lang.reflect.Method;

@TargetApi(11)
@RequiresApi(11)
public final class fc
{
  private static final int[] a = { 16843531 };
  
  public static Drawable a(Activity paramActivity)
  {
    paramActivity = paramActivity.obtainStyledAttributes(a);
    Drawable localDrawable = paramActivity.getDrawable(0);
    paramActivity.recycle();
    return localDrawable;
  }
  
  public static fc.a a(Activity paramActivity, Drawable paramDrawable, int paramInt)
  {
    fc.a locala = new fc.a(paramActivity);
    if (locala.a != null) {
      try
      {
        paramActivity = paramActivity.getActionBar();
        locala.a.invoke(paramActivity, new Object[] { paramDrawable });
        locala.b.invoke(paramActivity, new Object[] { Integer.valueOf(paramInt) });
        return locala;
      }
      catch (Exception paramActivity)
      {
        Log.w("ActionBarDrawerToggleHoneycomb", "Couldn't set home-as-up indicator via JB-MR2 API", paramActivity);
        return locala;
      }
    }
    if (locala.c != null)
    {
      locala.c.setImageDrawable(paramDrawable);
      return locala;
    }
    Log.w("ActionBarDrawerToggleHoneycomb", "Couldn't set home-as-up indicator");
    return locala;
  }
  
  public static fc.a a(fc.a parama, Activity paramActivity, int paramInt)
  {
    fc.a locala = parama;
    if (parama == null) {
      locala = new fc.a(paramActivity);
    }
    if (locala.a != null) {}
    try
    {
      parama = paramActivity.getActionBar();
      locala.b.invoke(parama, new Object[] { Integer.valueOf(paramInt) });
      if (Build.VERSION.SDK_INT <= 19) {
        parama.setSubtitle(parama.getSubtitle());
      }
      return locala;
    }
    catch (Exception parama)
    {
      Log.w("ActionBarDrawerToggleHoneycomb", "Couldn't set content description via JB-MR2 API", parama);
    }
    return locala;
  }
  
  public static final class a
  {
    public Method a;
    public Method b;
    public ImageView c;
    
    a(Activity paramActivity)
    {
      for (;;)
      {
        Object localObject;
        try
        {
          this.a = ActionBar.class.getDeclaredMethod("setHomeAsUpIndicator", new Class[] { Drawable.class });
          this.b = ActionBar.class.getDeclaredMethod("setHomeActionContentDescription", new Class[] { Integer.TYPE });
          return;
        }
        catch (NoSuchMethodException localNoSuchMethodException)
        {
          paramActivity = paramActivity.findViewById(16908332);
          if (paramActivity == null) {
            continue;
          }
          localObject = (ViewGroup)paramActivity.getParent();
          if (((ViewGroup)localObject).getChildCount() != 2) {
            continue;
          }
          paramActivity = ((ViewGroup)localObject).getChildAt(0);
          localObject = ((ViewGroup)localObject).getChildAt(1);
          if (paramActivity.getId() != 16908332) {
            break label113;
          }
        }
        paramActivity = (Activity)localObject;
        label113:
        while ((paramActivity instanceof ImageView))
        {
          this.c = ((ImageView)paramActivity);
          return;
        }
      }
    }
  }
}


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