gh.java 7.77 KB
import android.annotation.TargetApi;
import android.content.Context;
import android.content.res.ColorStateList;
import android.graphics.drawable.Drawable;
import android.os.Build.VERSION;
import android.support.annotation.RequiresApi;
import android.support.v7.appcompat.R.styleable;
import android.support.v7.text.AllCapsTransformationMethod;
import android.support.v7.widget.AppCompatDrawableManager;
import android.support.v7.widget.TintTypedArray;
import android.text.method.PasswordTransformationMethod;
import android.util.AttributeSet;
import android.widget.TextView;

@TargetApi(9)
@RequiresApi(9)
public class gh
{
  final TextView a;
  private ha b;
  private ha c;
  private ha d;
  private ha e;
  
  gh(TextView paramTextView)
  {
    this.a = paramTextView;
  }
  
  public static gh a(TextView paramTextView)
  {
    if (Build.VERSION.SDK_INT >= 17) {
      return new gi(paramTextView);
    }
    return new gh(paramTextView);
  }
  
  protected static ha a(Context paramContext, AppCompatDrawableManager paramAppCompatDrawableManager, int paramInt)
  {
    paramContext = paramAppCompatDrawableManager.b(paramContext, paramInt);
    if (paramContext != null)
    {
      paramAppCompatDrawableManager = new ha();
      paramAppCompatDrawableManager.d = true;
      paramAppCompatDrawableManager.a = paramContext;
      return paramAppCompatDrawableManager;
    }
    return null;
  }
  
  public void a()
  {
    if ((this.b != null) || (this.c != null) || (this.d != null) || (this.e != null))
    {
      Drawable[] arrayOfDrawable = this.a.getCompoundDrawables();
      a(arrayOfDrawable[0], this.b);
      a(arrayOfDrawable[1], this.c);
      a(arrayOfDrawable[2], this.d);
      a(arrayOfDrawable[3], this.e);
    }
  }
  
  public final void a(Context paramContext, int paramInt)
  {
    paramContext = TintTypedArray.obtainStyledAttributes(paramContext, paramInt, R.styleable.TextAppearance);
    if (paramContext.hasValue(R.styleable.TextAppearance_textAllCaps)) {
      a(paramContext.getBoolean(R.styleable.TextAppearance_textAllCaps, false));
    }
    if ((Build.VERSION.SDK_INT < 23) && (paramContext.hasValue(R.styleable.TextAppearance_android_textColor)))
    {
      ColorStateList localColorStateList = paramContext.getColorStateList(R.styleable.TextAppearance_android_textColor);
      if (localColorStateList != null) {
        this.a.setTextColor(localColorStateList);
      }
    }
    paramContext.recycle();
  }
  
  final void a(Drawable paramDrawable, ha paramha)
  {
    if ((paramDrawable != null) && (paramha != null)) {
      AppCompatDrawableManager.a(paramDrawable, paramha, this.a.getDrawableState());
    }
  }
  
  public void a(AttributeSet paramAttributeSet, int paramInt)
  {
    Object localObject3 = null;
    Object localObject2 = null;
    Object localObject4 = this.a.getContext();
    Object localObject1 = AppCompatDrawableManager.get();
    TintTypedArray localTintTypedArray = TintTypedArray.obtainStyledAttributes((Context)localObject4, paramAttributeSet, R.styleable.AppCompatTextHelper, paramInt, 0);
    int i = localTintTypedArray.getResourceId(R.styleable.AppCompatTextHelper_android_textAppearance, -1);
    if (localTintTypedArray.hasValue(R.styleable.AppCompatTextHelper_android_drawableLeft)) {
      this.b = a((Context)localObject4, (AppCompatDrawableManager)localObject1, localTintTypedArray.getResourceId(R.styleable.AppCompatTextHelper_android_drawableLeft, 0));
    }
    if (localTintTypedArray.hasValue(R.styleable.AppCompatTextHelper_android_drawableTop)) {
      this.c = a((Context)localObject4, (AppCompatDrawableManager)localObject1, localTintTypedArray.getResourceId(R.styleable.AppCompatTextHelper_android_drawableTop, 0));
    }
    if (localTintTypedArray.hasValue(R.styleable.AppCompatTextHelper_android_drawableRight)) {
      this.d = a((Context)localObject4, (AppCompatDrawableManager)localObject1, localTintTypedArray.getResourceId(R.styleable.AppCompatTextHelper_android_drawableRight, 0));
    }
    if (localTintTypedArray.hasValue(R.styleable.AppCompatTextHelper_android_drawableBottom)) {
      this.e = a((Context)localObject4, (AppCompatDrawableManager)localObject1, localTintTypedArray.getResourceId(R.styleable.AppCompatTextHelper_android_drawableBottom, 0));
    }
    localTintTypedArray.recycle();
    boolean bool3 = this.a.getTransformationMethod() instanceof PasswordTransformationMethod;
    boolean bool1;
    if (i != -1)
    {
      localTintTypedArray = TintTypedArray.obtainStyledAttributes((Context)localObject4, i, R.styleable.TextAppearance);
      if ((!bool3) && (localTintTypedArray.hasValue(R.styleable.TextAppearance_textAllCaps)))
      {
        bool1 = localTintTypedArray.getBoolean(R.styleable.TextAppearance_textAllCaps, false);
        i = 1;
        if (Build.VERSION.SDK_INT < 23) {
          if (localTintTypedArray.hasValue(R.styleable.TextAppearance_android_textColor))
          {
            localObject1 = localTintTypedArray.getColorStateList(R.styleable.TextAppearance_android_textColor);
            label258:
            localObject3 = localObject1;
            if (localTintTypedArray.hasValue(R.styleable.TextAppearance_android_textColorHint))
            {
              localObject2 = localTintTypedArray.getColorStateList(R.styleable.TextAppearance_android_textColorHint);
              localObject3 = localObject1;
            }
            label287:
            localTintTypedArray.recycle();
            localObject1 = localObject3;
          }
        }
      }
    }
    for (;;)
    {
      localObject4 = TintTypedArray.obtainStyledAttributes((Context)localObject4, paramAttributeSet, R.styleable.TextAppearance, paramInt, 0);
      paramInt = i;
      boolean bool2 = bool1;
      if (!bool3)
      {
        paramInt = i;
        bool2 = bool1;
        if (((TintTypedArray)localObject4).hasValue(R.styleable.TextAppearance_textAllCaps))
        {
          bool2 = ((TintTypedArray)localObject4).getBoolean(R.styleable.TextAppearance_textAllCaps, false);
          paramInt = 1;
        }
      }
      paramAttributeSet = (AttributeSet)localObject1;
      localObject3 = localObject2;
      if (Build.VERSION.SDK_INT < 23)
      {
        if (((TintTypedArray)localObject4).hasValue(R.styleable.TextAppearance_android_textColor)) {
          localObject1 = ((TintTypedArray)localObject4).getColorStateList(R.styleable.TextAppearance_android_textColor);
        }
        paramAttributeSet = (AttributeSet)localObject1;
        localObject3 = localObject2;
        if (((TintTypedArray)localObject4).hasValue(R.styleable.TextAppearance_android_textColorHint))
        {
          localObject3 = ((TintTypedArray)localObject4).getColorStateList(R.styleable.TextAppearance_android_textColorHint);
          paramAttributeSet = (AttributeSet)localObject1;
        }
      }
      ((TintTypedArray)localObject4).recycle();
      if (paramAttributeSet != null) {
        this.a.setTextColor(paramAttributeSet);
      }
      if (localObject3 != null) {
        this.a.setHintTextColor((ColorStateList)localObject3);
      }
      if ((!bool3) && (paramInt != 0)) {
        a(bool2);
      }
      return;
      localObject1 = null;
      break label258;
      localObject3 = null;
      break label287;
      i = 0;
      bool1 = false;
      break;
      localObject1 = null;
      i = 0;
      bool1 = false;
      localObject2 = localObject3;
    }
  }
  
  public final void a(boolean paramBoolean)
  {
    TextView localTextView = this.a;
    if (paramBoolean) {}
    for (AllCapsTransformationMethod localAllCapsTransformationMethod = new AllCapsTransformationMethod(this.a.getContext());; localAllCapsTransformationMethod = null)
    {
      localTextView.setTransformationMethod(localAllCapsTransformationMethod);
      return;
    }
  }
}


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