f.java 16.4 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651
import android.content.Context;
import android.content.res.ColorStateList;
import android.content.res.TypedArray;
import android.graphics.Bitmap;
import android.graphics.Bitmap.Config;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Rect;
import android.graphics.RectF;
import android.graphics.Typeface;
import android.os.Build.VERSION;
import android.support.annotation.ColorInt;
import android.support.v4.text.TextDirectionHeuristicCompat;
import android.support.v4.text.TextDirectionHeuristicsCompat;
import android.support.v4.view.GravityCompat;
import android.support.v4.view.ViewCompat;
import android.support.v7.appcompat.R.styleable;
import android.support.v7.widget.TintTypedArray;
import android.text.TextPaint;
import android.text.TextUtils;
import android.text.TextUtils.TruncateAt;
import android.view.View;
import android.view.animation.Interpolator;

public final class f
{
  private static final boolean k;
  private static final Paint l;
  private boolean A;
  private boolean B;
  private Bitmap C;
  private Paint D;
  private float E;
  private float F;
  private float G;
  private float H;
  private int[] I;
  private boolean J;
  private final TextPaint K;
  private Interpolator L;
  private float M;
  private float N;
  private float O;
  private int P;
  private float Q;
  private float R;
  private float S;
  private int T;
  public float a;
  public int b = 16;
  public int c = 16;
  public float d = 15.0F;
  public float e = 15.0F;
  public ColorStateList f;
  public Typeface g;
  public Typeface h;
  public CharSequence i;
  public Interpolator j;
  private final View m;
  private boolean n;
  private final Rect o;
  private final Rect p;
  private final RectF q;
  private ColorStateList r;
  private float s;
  private float t;
  private float u;
  private float v;
  private float w;
  private float x;
  private Typeface y;
  private CharSequence z;
  
  static
  {
    if (Build.VERSION.SDK_INT < 18) {}
    for (boolean bool = true;; bool = false)
    {
      k = bool;
      l = null;
      return;
    }
  }
  
  public f(View paramView)
  {
    this.m = paramView;
    this.K = new TextPaint(129);
    this.p = new Rect();
    this.o = new Rect();
    this.q = new RectF();
  }
  
  private static float a(float paramFloat1, float paramFloat2, float paramFloat3, Interpolator paramInterpolator)
  {
    float f1 = paramFloat3;
    if (paramInterpolator != null) {
      f1 = paramInterpolator.getInterpolation(paramFloat3);
    }
    return c.a(paramFloat1, paramFloat2, f1);
  }
  
  private static int a(int paramInt1, int paramInt2, float paramFloat)
  {
    float f1 = 1.0F - paramFloat;
    float f2 = Color.alpha(paramInt1);
    float f3 = Color.alpha(paramInt2);
    float f4 = Color.red(paramInt1);
    float f5 = Color.red(paramInt2);
    float f6 = Color.green(paramInt1);
    float f7 = Color.green(paramInt2);
    float f8 = Color.blue(paramInt1);
    float f9 = Color.blue(paramInt2);
    return Color.argb((int)(f2 * f1 + f3 * paramFloat), (int)(f4 * f1 + f5 * paramFloat), (int)(f6 * f1 + f7 * paramFloat), (int)(f1 * f8 + f9 * paramFloat));
  }
  
  private static boolean a(float paramFloat1, float paramFloat2)
  {
    return Math.abs(paramFloat1 - paramFloat2) < 0.001F;
  }
  
  private static boolean a(Rect paramRect, int paramInt1, int paramInt2, int paramInt3, int paramInt4)
  {
    return (paramRect.left == paramInt1) && (paramRect.top == paramInt2) && (paramRect.right == paramInt3) && (paramRect.bottom == paramInt4);
  }
  
  private void b(float paramFloat)
  {
    this.q.left = a(this.o.left, this.p.left, paramFloat, this.j);
    this.q.top = a(this.s, this.t, paramFloat, this.j);
    this.q.right = a(this.o.right, this.p.right, paramFloat, this.j);
    this.q.bottom = a(this.o.bottom, this.p.bottom, paramFloat, this.j);
    this.w = a(this.u, this.v, paramFloat, this.j);
    this.x = a(this.s, this.t, paramFloat, this.j);
    c(a(this.d, this.e, paramFloat, this.L));
    int i1;
    if (this.f != this.r)
    {
      TextPaint localTextPaint = this.K;
      if (this.I != null)
      {
        i1 = this.r.getColorForState(this.I, 0);
        localTextPaint.setColor(a(i1, e(), paramFloat));
      }
    }
    for (;;)
    {
      this.K.setShadowLayer(a(this.Q, this.M, paramFloat, null), a(this.R, this.N, paramFloat, null), a(this.S, this.O, paramFloat, null), a(this.T, this.P, paramFloat));
      ViewCompat.postInvalidateOnAnimation(this.m);
      return;
      i1 = this.r.getDefaultColor();
      break;
      this.K.setColor(e());
    }
  }
  
  private void c()
  {
    if ((this.p.width() > 0) && (this.p.height() > 0) && (this.o.width() > 0) && (this.o.height() > 0)) {}
    for (boolean bool = true;; bool = false)
    {
      this.n = bool;
      return;
    }
  }
  
  private void c(float paramFloat)
  {
    d(paramFloat);
    boolean bool;
    if ((k) && (this.G != 1.0F))
    {
      bool = true;
      this.B = bool;
      if ((this.B) && (this.C == null) && (!this.o.isEmpty()) && (!TextUtils.isEmpty(this.z))) {
        break label77;
      }
    }
    for (;;)
    {
      ViewCompat.postInvalidateOnAnimation(this.m);
      return;
      bool = false;
      break;
      label77:
      b(0.0F);
      this.E = this.K.ascent();
      this.F = this.K.descent();
      int i1 = Math.round(this.K.measureText(this.z, 0, this.z.length()));
      int i2 = Math.round(this.F - this.E);
      if ((i1 > 0) && (i2 > 0))
      {
        this.C = Bitmap.createBitmap(i1, i2, Bitmap.Config.ARGB_8888);
        new Canvas(this.C).drawText(this.z, 0, this.z.length(), 0.0F, i2 - this.K.descent(), this.K);
        if (this.D == null) {
          this.D = new Paint(3);
        }
      }
    }
  }
  
  private void d()
  {
    b(this.a);
  }
  
  private void d(float paramFloat)
  {
    int i3 = 1;
    if (this.i == null) {
      return;
    }
    float f2 = this.p.width();
    float f3 = this.o.width();
    float f1;
    int i1;
    if (a(paramFloat, this.e))
    {
      f1 = this.e;
      this.G = 1.0F;
      if (this.y == this.g) {
        break label396;
      }
      this.y = this.g;
      i1 = 1;
      paramFloat = f2;
    }
    for (;;)
    {
      int i2 = i1;
      label109:
      Object localObject;
      boolean bool;
      if (paramFloat > 0.0F)
      {
        if ((this.H != f1) || (this.J) || (i1 != 0))
        {
          i1 = 1;
          this.H = f1;
          this.J = false;
          i2 = i1;
        }
      }
      else
      {
        if ((this.z != null) && (i2 == 0)) {
          break;
        }
        this.K.setTextSize(this.H);
        this.K.setTypeface(this.y);
        localObject = this.K;
        if (this.G == 1.0F) {
          break label370;
        }
        bool = true;
        label176:
        ((TextPaint)localObject).setLinearText(bool);
        localObject = TextUtils.ellipsize(this.i, this.K, paramFloat, TextUtils.TruncateAt.END);
        if (TextUtils.equals((CharSequence)localObject, this.z)) {
          break;
        }
        this.z = ((CharSequence)localObject);
        CharSequence localCharSequence = this.z;
        if (ViewCompat.getLayoutDirection(this.m) != 1) {
          break label376;
        }
        i1 = i3;
        label239:
        if (i1 == 0) {
          break label382;
        }
        localObject = TextDirectionHeuristicsCompat.FIRSTSTRONG_RTL;
        label249:
        this.A = ((TextDirectionHeuristicCompat)localObject).isRtl(localCharSequence, 0, localCharSequence.length());
        return;
        f1 = this.d;
        if (this.y == this.h) {
          break label390;
        }
        this.y = this.h;
      }
      label358:
      label370:
      label376:
      label382:
      label390:
      for (i1 = 1;; i1 = 0)
      {
        if (a(paramFloat, this.d)) {}
        for (this.G = 1.0F;; this.G = (paramFloat / this.d))
        {
          paramFloat = this.e / this.d;
          if (f3 * paramFloat <= f2) {
            break label358;
          }
          paramFloat = Math.min(f2 / paramFloat, f3);
          break;
        }
        paramFloat = f3;
        break;
        i1 = 0;
        break label109;
        bool = false;
        break label176;
        i1 = 0;
        break label239;
        localObject = TextDirectionHeuristicsCompat.FIRSTSTRONG_LTR;
        break label249;
      }
      label396:
      i1 = 0;
      paramFloat = f2;
    }
  }
  
  @ColorInt
  private int e()
  {
    if (this.I != null) {
      return this.f.getColorForState(this.I, 0);
    }
    return this.f.getDefaultColor();
  }
  
  private Typeface e(int paramInt)
  {
    TypedArray localTypedArray = this.m.getContext().obtainStyledAttributes(paramInt, new int[] { 16843692 });
    try
    {
      Object localObject1 = localTypedArray.getString(0);
      if (localObject1 != null)
      {
        localObject1 = Typeface.create((String)localObject1, 0);
        return (Typeface)localObject1;
      }
      return null;
    }
    finally
    {
      localTypedArray.recycle();
    }
  }
  
  private void f()
  {
    if (this.C != null)
    {
      this.C.recycle();
      this.C = null;
    }
  }
  
  public final Typeface a()
  {
    if (this.g != null) {
      return this.g;
    }
    return Typeface.DEFAULT;
  }
  
  public final void a(float paramFloat)
  {
    paramFloat = m.a(paramFloat);
    if (paramFloat != this.a)
    {
      this.a = paramFloat;
      d();
    }
  }
  
  public final void a(int paramInt)
  {
    if (this.b != paramInt)
    {
      this.b = paramInt;
      b();
    }
  }
  
  public final void a(int paramInt1, int paramInt2, int paramInt3, int paramInt4)
  {
    if (!a(this.o, paramInt1, paramInt2, paramInt3, paramInt4))
    {
      this.o.set(paramInt1, paramInt2, paramInt3, paramInt4);
      this.J = true;
      c();
    }
  }
  
  public final void a(ColorStateList paramColorStateList)
  {
    if (this.f != paramColorStateList)
    {
      this.f = paramColorStateList;
      b();
    }
  }
  
  public final void a(Canvas paramCanvas)
  {
    int i2 = paramCanvas.save();
    float f4;
    int i1;
    float f1;
    label64:
    float f2;
    if ((this.z != null) && (this.n))
    {
      f4 = this.w;
      float f3 = this.x;
      if ((!this.B) || (this.C == null)) {
        break label128;
      }
      i1 = 1;
      if (i1 == 0) {
        break label134;
      }
      f1 = this.E * this.G;
      f2 = f3;
      if (i1 != 0) {
        f2 = f3 + f1;
      }
      if (this.G != 1.0F) {
        paramCanvas.scale(this.G, this.G, f4, f2);
      }
      if (i1 == 0) {
        break label155;
      }
      paramCanvas.drawBitmap(this.C, f4, f2, this.D);
    }
    for (;;)
    {
      paramCanvas.restoreToCount(i2);
      return;
      label128:
      i1 = 0;
      break;
      label134:
      this.K.ascent();
      f1 = 0.0F;
      this.K.descent();
      break label64;
      label155:
      paramCanvas.drawText(this.z, 0, this.z.length(), f4, f2, this.K);
    }
  }
  
  public final void a(Typeface paramTypeface)
  {
    this.h = paramTypeface;
    this.g = paramTypeface;
    b();
  }
  
  public final void a(Interpolator paramInterpolator)
  {
    this.L = paramInterpolator;
    b();
  }
  
  public final void a(CharSequence paramCharSequence)
  {
    if ((paramCharSequence == null) || (!paramCharSequence.equals(this.i)))
    {
      this.i = paramCharSequence;
      this.z = null;
      f();
      b();
    }
  }
  
  public final boolean a(int[] paramArrayOfInt)
  {
    this.I = paramArrayOfInt;
    if (((this.f != null) && (this.f.isStateful())) || ((this.r != null) && (this.r.isStateful()))) {}
    for (int i1 = 1; i1 != 0; i1 = 0)
    {
      b();
      return true;
    }
    return false;
  }
  
  public final void b()
  {
    int i2 = 1;
    float f2 = 0.0F;
    float f3;
    float f1;
    int i1;
    if ((this.m.getHeight() > 0) && (this.m.getWidth() > 0))
    {
      f3 = this.H;
      d(this.e);
      if (this.z == null) {
        break label402;
      }
      f1 = this.K.measureText(this.z, 0, this.z.length());
      int i3 = this.c;
      if (!this.A) {
        break label407;
      }
      i1 = 1;
      label83:
      i1 = GravityCompat.getAbsoluteGravity(i3, i1);
      switch (i1 & 0x70)
      {
      default: 
        this.t = ((this.K.descent() - this.K.ascent()) / 2.0F - this.K.descent() + this.p.centerY());
        label162:
        switch (i1 & 0x800007)
        {
        default: 
          this.v = this.p.left;
          label208:
          d(this.d);
          f1 = f2;
          if (this.z != null) {
            f1 = this.K.measureText(this.z, 0, this.z.length());
          }
          i3 = this.b;
          if (this.A)
          {
            i1 = i2;
            label264:
            i1 = GravityCompat.getAbsoluteGravity(i3, i1);
            switch (i1 & 0x70)
            {
            default: 
              this.s = ((this.K.descent() - this.K.ascent()) / 2.0F - this.K.descent() + this.o.centerY());
              label342:
              switch (i1 & 0x800007)
              {
              default: 
                this.u = this.o.left;
              }
              break;
            }
          }
          break;
        }
        break;
      }
    }
    for (;;)
    {
      f();
      c(f3);
      d();
      return;
      label402:
      f1 = 0.0F;
      break;
      label407:
      i1 = 0;
      break label83;
      this.t = this.p.bottom;
      break label162;
      this.t = (this.p.top - this.K.ascent());
      break label162;
      this.v = (this.p.centerX() - f1 / 2.0F);
      break label208;
      this.v = (this.p.right - f1);
      break label208;
      i1 = 0;
      break label264;
      this.s = this.o.bottom;
      break label342;
      this.s = (this.o.top - this.K.ascent());
      break label342;
      this.u = (this.o.centerX() - f1 / 2.0F);
      continue;
      this.u = (this.o.right - f1);
    }
  }
  
  public final void b(int paramInt)
  {
    if (this.c != paramInt)
    {
      this.c = paramInt;
      b();
    }
  }
  
  public final void b(int paramInt1, int paramInt2, int paramInt3, int paramInt4)
  {
    if (!a(this.p, paramInt1, paramInt2, paramInt3, paramInt4))
    {
      this.p.set(paramInt1, paramInt2, paramInt3, paramInt4);
      this.J = true;
      c();
    }
  }
  
  public final void b(ColorStateList paramColorStateList)
  {
    if (this.r != paramColorStateList)
    {
      this.r = paramColorStateList;
      b();
    }
  }
  
  public final void c(int paramInt)
  {
    TintTypedArray localTintTypedArray = TintTypedArray.obtainStyledAttributes(this.m.getContext(), paramInt, R.styleable.TextAppearance);
    if (localTintTypedArray.hasValue(R.styleable.TextAppearance_android_textColor)) {
      this.f = localTintTypedArray.getColorStateList(R.styleable.TextAppearance_android_textColor);
    }
    if (localTintTypedArray.hasValue(R.styleable.TextAppearance_android_textSize)) {
      this.e = localTintTypedArray.getDimensionPixelSize(R.styleable.TextAppearance_android_textSize, (int)this.e);
    }
    this.P = localTintTypedArray.getInt(R.styleable.TextAppearance_android_shadowColor, 0);
    this.N = localTintTypedArray.getFloat(R.styleable.TextAppearance_android_shadowDx, 0.0F);
    this.O = localTintTypedArray.getFloat(R.styleable.TextAppearance_android_shadowDy, 0.0F);
    this.M = localTintTypedArray.getFloat(R.styleable.TextAppearance_android_shadowRadius, 0.0F);
    localTintTypedArray.recycle();
    if (Build.VERSION.SDK_INT >= 16) {
      this.g = e(paramInt);
    }
    b();
  }
  
  public final void d(int paramInt)
  {
    TintTypedArray localTintTypedArray = TintTypedArray.obtainStyledAttributes(this.m.getContext(), paramInt, R.styleable.TextAppearance);
    if (localTintTypedArray.hasValue(R.styleable.TextAppearance_android_textColor)) {
      this.r = localTintTypedArray.getColorStateList(R.styleable.TextAppearance_android_textColor);
    }
    if (localTintTypedArray.hasValue(R.styleable.TextAppearance_android_textSize)) {
      this.d = localTintTypedArray.getDimensionPixelSize(R.styleable.TextAppearance_android_textSize, (int)this.d);
    }
    this.T = localTintTypedArray.getInt(R.styleable.TextAppearance_android_shadowColor, 0);
    this.R = localTintTypedArray.getFloat(R.styleable.TextAppearance_android_shadowDx, 0.0F);
    this.S = localTintTypedArray.getFloat(R.styleable.TextAppearance_android_shadowDy, 0.0F);
    this.Q = localTintTypedArray.getFloat(R.styleable.TextAppearance_android_shadowRadius, 0.0F);
    localTintTypedArray.recycle();
    if (Build.VERSION.SDK_INT >= 16) {
      this.h = e(paramInt);
    }
    b();
  }
}


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