fk.java 19.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
import android.annotation.TargetApi;
import android.app.Notification;
import android.app.Notification.Builder;
import android.app.PendingIntent;
import android.content.Context;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.Bitmap.Config;
import android.graphics.Canvas;
import android.graphics.PorterDuff.Mode;
import android.graphics.PorterDuffColorFilter;
import android.graphics.drawable.Drawable;
import android.os.Build.VERSION;
import android.os.SystemClock;
import android.support.annotation.RequiresApi;
import android.support.v4.app.NotificationBuilderWithBuilderAccessor;
import android.support.v4.app.NotificationCompat.Action;
import android.support.v4.app.NotificationCompatBase.Action;
import android.support.v7.appcompat.R.color;
import android.support.v7.appcompat.R.dimen;
import android.support.v7.appcompat.R.drawable;
import android.support.v7.appcompat.R.id;
import android.support.v7.appcompat.R.integer;
import android.support.v7.appcompat.R.layout;
import android.support.v7.appcompat.R.string;
import android.widget.RemoteViews;
import java.text.NumberFormat;
import java.util.ArrayList;
import java.util.List;

@TargetApi(9)
@RequiresApi(9)
public final class fk
{
  private static Bitmap a(Context paramContext, int paramInt1, int paramInt2, int paramInt3)
  {
    paramContext = paramContext.getResources().getDrawable(paramInt1);
    if (paramInt3 == 0) {}
    for (paramInt1 = paramContext.getIntrinsicWidth();; paramInt1 = paramInt3)
    {
      int i = paramInt3;
      if (paramInt3 == 0) {
        i = paramContext.getIntrinsicHeight();
      }
      Bitmap localBitmap = Bitmap.createBitmap(paramInt1, i, Bitmap.Config.ARGB_8888);
      paramContext.setBounds(0, 0, paramInt1, i);
      if (paramInt2 != 0) {
        paramContext.mutate().setColorFilter(new PorterDuffColorFilter(paramInt2, PorterDuff.Mode.SRC_IN));
      }
      paramContext.draw(new Canvas(localBitmap));
      return localBitmap;
    }
  }
  
  private static Bitmap a(Context paramContext, int paramInt1, int paramInt2, int paramInt3, int paramInt4)
  {
    int j = R.drawable.notification_icon_background;
    int i = paramInt4;
    if (paramInt4 == 0) {
      i = 0;
    }
    Bitmap localBitmap = a(paramContext, j, i, paramInt2);
    Canvas localCanvas = new Canvas(localBitmap);
    paramContext = paramContext.getResources().getDrawable(paramInt1).mutate();
    paramContext.setFilterBitmap(true);
    paramInt1 = (paramInt2 - paramInt3) / 2;
    paramContext.setBounds(paramInt1, paramInt1, paramInt3 + paramInt1, paramInt3 + paramInt1);
    paramContext.setColorFilter(new PorterDuffColorFilter(-1, PorterDuff.Mode.SRC_ATOP));
    paramContext.draw(localCanvas);
    return localBitmap;
  }
  
  @TargetApi(11)
  @RequiresApi(11)
  private static RemoteViews a(Context paramContext, NotificationCompatBase.Action paramAction)
  {
    if (paramAction.getActionIntent() == null) {}
    for (int i = 1;; i = 0)
    {
      paramContext = new RemoteViews(paramContext.getPackageName(), R.layout.notification_media_action);
      paramContext.setImageViewResource(R.id.action0, paramAction.getIcon());
      if (i == 0) {
        paramContext.setOnClickPendingIntent(R.id.action0, paramAction.getActionIntent());
      }
      if (Build.VERSION.SDK_INT >= 15) {
        paramContext.setContentDescription(R.id.action0, paramAction.getTitle());
      }
      return paramContext;
    }
  }
  
  public static RemoteViews a(Context paramContext, CharSequence paramCharSequence1, CharSequence paramCharSequence2, CharSequence paramCharSequence3, int paramInt1, int paramInt2, Bitmap paramBitmap, CharSequence paramCharSequence4, boolean paramBoolean, long paramLong, int paramInt3, int paramInt4, int paramInt5, ArrayList<NotificationCompat.Action> paramArrayList)
  {
    paramCharSequence1 = a(paramContext, paramCharSequence1, paramCharSequence2, paramCharSequence3, paramInt1, paramInt2, paramBitmap, paramCharSequence4, paramBoolean, paramLong, paramInt3, paramInt4, paramInt5, false);
    paramCharSequence1.removeAllViews(R.id.actions);
    if (paramArrayList != null)
    {
      paramInt1 = paramArrayList.size();
      if (paramInt1 > 0) {
        if (paramInt1 > 3)
        {
          paramInt1 = 3;
          paramInt2 = 0;
          if (paramInt2 < paramInt1)
          {
            paramCharSequence2 = (NotificationCompat.Action)paramArrayList.get(paramInt2);
            if (paramCharSequence2.actionIntent == null)
            {
              paramInt3 = 1;
              label91:
              paramCharSequence3 = paramContext.getPackageName();
              if (paramInt3 == 0) {
                break label212;
              }
            }
            label212:
            for (paramInt4 = R.layout.notification_action_tombstone;; paramInt4 = R.layout.notification_action)
            {
              paramCharSequence3 = new RemoteViews(paramCharSequence3, paramInt4);
              paramCharSequence3.setImageViewBitmap(R.id.action_image, a(paramContext, paramCharSequence2.getIcon(), paramContext.getResources().getColor(R.color.notification_action_color_filter), 0));
              paramCharSequence3.setTextViewText(R.id.action_text, paramCharSequence2.title);
              if (paramInt3 == 0) {
                paramCharSequence3.setOnClickPendingIntent(R.id.action_container, paramCharSequence2.actionIntent);
              }
              if (Build.VERSION.SDK_INT >= 15) {
                paramCharSequence3.setContentDescription(R.id.action_container, paramCharSequence2.title);
              }
              paramCharSequence1.addView(R.id.actions, paramCharSequence3);
              paramInt2 += 1;
              break;
              paramInt3 = 0;
              break label91;
            }
          }
        }
      }
    }
    for (paramInt1 = 1;; paramInt1 = 0)
    {
      if (paramInt1 != 0) {}
      for (paramInt1 = 0;; paramInt1 = 8)
      {
        paramCharSequence1.setViewVisibility(R.id.actions, paramInt1);
        paramCharSequence1.setViewVisibility(R.id.action_divider, paramInt1);
        return paramCharSequence1;
      }
      break;
    }
  }
  
  private static RemoteViews a(Context paramContext, CharSequence paramCharSequence1, CharSequence paramCharSequence2, CharSequence paramCharSequence3, int paramInt1, int paramInt2, Bitmap paramBitmap, CharSequence paramCharSequence4, boolean paramBoolean1, long paramLong, int paramInt3, int paramInt4, int paramInt5, boolean paramBoolean2)
  {
    Resources localResources = paramContext.getResources();
    RemoteViews localRemoteViews = new RemoteViews(paramContext.getPackageName(), paramInt5);
    if (paramInt3 < -1)
    {
      paramInt3 = 1;
      if ((Build.VERSION.SDK_INT >= 16) && (Build.VERSION.SDK_INT < 21))
      {
        if (paramInt3 == 0) {
          break label469;
        }
        localRemoteViews.setInt(R.id.notification_background, "setBackgroundResource", R.drawable.notification_bg_low);
        localRemoteViews.setInt(R.id.icon, "setBackgroundResource", R.drawable.notification_template_icon_low_bg);
      }
      label77:
      if (paramBitmap == null) {
        break label530;
      }
      if (Build.VERSION.SDK_INT < 16) {
        break label498;
      }
      localRemoteViews.setViewVisibility(R.id.icon, 0);
      localRemoteViews.setImageViewBitmap(R.id.icon, paramBitmap);
      label109:
      if (paramInt2 != 0)
      {
        paramInt3 = localResources.getDimensionPixelSize(R.dimen.notification_right_icon_size);
        paramInt5 = localResources.getDimensionPixelSize(R.dimen.notification_small_icon_background_padding);
        if (Build.VERSION.SDK_INT < 21) {
          break label511;
        }
        paramContext = a(paramContext, paramInt2, paramInt3, paramInt3 - paramInt5 * 2, paramInt4);
        localRemoteViews.setImageViewBitmap(R.id.right_icon, paramContext);
        label169:
        localRemoteViews.setViewVisibility(R.id.right_icon, 0);
      }
      label178:
      if (paramCharSequence1 != null) {
        localRemoteViews.setTextViewText(R.id.title, paramCharSequence1);
      }
      if (paramCharSequence2 == null) {
        break label772;
      }
      localRemoteViews.setTextViewText(R.id.text, paramCharSequence2);
    }
    label223:
    label251:
    label299:
    label413:
    label429:
    label469:
    label498:
    label511:
    label530:
    label623:
    label714:
    label724:
    label730:
    label762:
    label769:
    label772:
    for (paramInt2 = 1;; paramInt2 = 0)
    {
      if ((Build.VERSION.SDK_INT < 21) && (paramBitmap != null))
      {
        paramInt3 = 1;
        if (paramCharSequence3 == null) {
          break label623;
        }
        localRemoteViews.setTextViewText(R.id.info, paramCharSequence3);
        localRemoteViews.setViewVisibility(R.id.info, 0);
        paramInt1 = 1;
        paramInt2 = 1;
        if ((paramCharSequence4 == null) || (Build.VERSION.SDK_INT < 16)) {
          break label724;
        }
        localRemoteViews.setTextViewText(R.id.text, paramCharSequence4);
        if (paramCharSequence2 == null) {
          break label714;
        }
        localRemoteViews.setTextViewText(R.id.text2, paramCharSequence2);
        localRemoteViews.setViewVisibility(R.id.text2, 0);
        paramInt3 = 1;
        if ((paramInt3 != 0) && (Build.VERSION.SDK_INT >= 16))
        {
          if (paramBoolean2)
          {
            float f = localResources.getDimensionPixelSize(R.dimen.notification_subtext_size);
            localRemoteViews.setTextViewTextSize(R.id.text, 0, f);
          }
          localRemoteViews.setViewPadding(R.id.line1, 0, 0, 0, 0);
        }
        if (paramLong == 0L) {
          break label769;
        }
        if ((!paramBoolean1) || (Build.VERSION.SDK_INT < 16)) {
          break label730;
        }
        localRemoteViews.setViewVisibility(R.id.chronometer, 0);
        localRemoteViews.setLong(R.id.chronometer, "setBase", SystemClock.elapsedRealtime() - System.currentTimeMillis() + paramLong);
        localRemoteViews.setBoolean(R.id.chronometer, "setStarted", true);
        paramInt1 = 1;
      }
      for (;;)
      {
        paramInt3 = R.id.right_side;
        if (paramInt1 != 0)
        {
          paramInt1 = 0;
          localRemoteViews.setViewVisibility(paramInt3, paramInt1);
          paramInt3 = R.id.line3;
          if (paramInt2 == 0) {
            break label762;
          }
        }
        for (paramInt1 = 0;; paramInt1 = 8)
        {
          localRemoteViews.setViewVisibility(paramInt3, paramInt1);
          return localRemoteViews;
          paramInt3 = 0;
          break;
          localRemoteViews.setInt(R.id.notification_background, "setBackgroundResource", R.drawable.notification_bg);
          localRemoteViews.setInt(R.id.icon, "setBackgroundResource", R.drawable.notification_template_icon_bg);
          break label77;
          localRemoteViews.setViewVisibility(R.id.icon, 8);
          break label109;
          localRemoteViews.setImageViewBitmap(R.id.right_icon, a(paramContext, paramInt2, -1, 0));
          break label169;
          if (paramInt2 == 0) {
            break label178;
          }
          localRemoteViews.setViewVisibility(R.id.icon, 0);
          if (Build.VERSION.SDK_INT >= 21)
          {
            paramContext = a(paramContext, paramInt2, localResources.getDimensionPixelSize(R.dimen.notification_large_icon_width) - localResources.getDimensionPixelSize(R.dimen.notification_big_circle_margin), localResources.getDimensionPixelSize(R.dimen.notification_small_icon_size_as_large), paramInt4);
            localRemoteViews.setImageViewBitmap(R.id.icon, paramContext);
            break label178;
          }
          localRemoteViews.setImageViewBitmap(R.id.icon, a(paramContext, paramInt2, -1, 0));
          break label178;
          paramInt3 = 0;
          break label223;
          if (paramInt1 > 0)
          {
            if (paramInt1 > localResources.getInteger(R.integer.status_bar_notification_info_maxnum)) {
              localRemoteViews.setTextViewText(R.id.info, localResources.getString(R.string.status_bar_notification_info_overflow));
            }
            for (;;)
            {
              localRemoteViews.setViewVisibility(R.id.info, 0);
              paramInt1 = 1;
              paramInt2 = 1;
              break;
              paramContext = NumberFormat.getIntegerInstance();
              localRemoteViews.setTextViewText(R.id.info, paramContext.format(paramInt1));
            }
          }
          localRemoteViews.setViewVisibility(R.id.info, 8);
          paramInt1 = paramInt3;
          break label251;
          localRemoteViews.setViewVisibility(R.id.text2, 8);
          paramInt3 = 0;
          break label299;
          localRemoteViews.setViewVisibility(R.id.time, 0);
          localRemoteViews.setLong(R.id.time, "setTime", paramLong);
          break label413;
          paramInt1 = 8;
          break label429;
        }
      }
    }
  }
  
  @TargetApi(11)
  @RequiresApi(11)
  public static <T extends NotificationCompatBase.Action> RemoteViews a(Context paramContext, CharSequence paramCharSequence1, CharSequence paramCharSequence2, CharSequence paramCharSequence3, int paramInt1, Bitmap paramBitmap, CharSequence paramCharSequence4, boolean paramBoolean1, long paramLong, int paramInt2, List<T> paramList, boolean paramBoolean2, PendingIntent paramPendingIntent, boolean paramBoolean3)
  {
    int j = Math.min(paramList.size(), 5);
    int i;
    if (j <= 3) {
      if (paramBoolean3) {
        i = R.layout.notification_template_big_media_narrow_custom;
      }
    }
    for (;;)
    {
      paramCharSequence1 = a(paramContext, paramCharSequence1, paramCharSequence2, paramCharSequence3, paramInt1, 0, paramBitmap, paramCharSequence4, paramBoolean1, paramLong, paramInt2, 0, i, false);
      paramCharSequence1.removeAllViews(R.id.media_actions);
      if (j <= 0) {
        break;
      }
      paramInt1 = 0;
      while (paramInt1 < j)
      {
        paramCharSequence2 = a(paramContext, (NotificationCompatBase.Action)paramList.get(paramInt1));
        paramCharSequence1.addView(R.id.media_actions, paramCharSequence2);
        paramInt1 += 1;
      }
      i = R.layout.notification_template_big_media_narrow;
      continue;
      if (paramBoolean3) {
        i = R.layout.notification_template_big_media_custom;
      } else {
        i = R.layout.notification_template_big_media;
      }
    }
    if (paramBoolean2)
    {
      paramCharSequence1.setViewVisibility(R.id.cancel_action, 0);
      paramCharSequence1.setInt(R.id.cancel_action, "setAlpha", paramContext.getResources().getInteger(R.integer.cancel_button_image_alpha));
      paramCharSequence1.setOnClickPendingIntent(R.id.cancel_action, paramPendingIntent);
      return paramCharSequence1;
    }
    paramCharSequence1.setViewVisibility(R.id.cancel_action, 8);
    return paramCharSequence1;
  }
  
  @TargetApi(11)
  @RequiresApi(11)
  public static <T extends NotificationCompatBase.Action> RemoteViews a(NotificationBuilderWithBuilderAccessor paramNotificationBuilderWithBuilderAccessor, Context paramContext, CharSequence paramCharSequence1, CharSequence paramCharSequence2, CharSequence paramCharSequence3, int paramInt1, Bitmap paramBitmap, CharSequence paramCharSequence4, boolean paramBoolean1, long paramLong, int paramInt2, List<T> paramList, int[] paramArrayOfInt, boolean paramBoolean2, PendingIntent paramPendingIntent, boolean paramBoolean3)
  {
    int i;
    if (paramBoolean3)
    {
      i = R.layout.notification_template_media_custom;
      paramCharSequence1 = a(paramContext, paramCharSequence1, paramCharSequence2, paramCharSequence3, paramInt1, 0, paramBitmap, paramCharSequence4, paramBoolean1, paramLong, paramInt2, 0, i, true);
      i = paramList.size();
      if (paramArrayOfInt != null) {
        break label126;
      }
      paramInt1 = 0;
      label53:
      paramCharSequence1.removeAllViews(R.id.media_actions);
      if (paramInt1 <= 0) {
        break label175;
      }
      paramInt2 = 0;
    }
    for (;;)
    {
      if (paramInt2 >= paramInt1) {
        break label175;
      }
      if (paramInt2 >= i)
      {
        throw new IllegalArgumentException(String.format("setShowActionsInCompactView: action %d out of bounds (max %d)", new Object[] { Integer.valueOf(paramInt2), Integer.valueOf(i - 1) }));
        i = R.layout.notification_template_media;
        break;
        label126:
        paramInt1 = Math.min(paramArrayOfInt.length, 3);
        break label53;
      }
      paramCharSequence2 = a(paramContext, (NotificationCompatBase.Action)paramList.get(paramArrayOfInt[paramInt2]));
      paramCharSequence1.addView(R.id.media_actions, paramCharSequence2);
      paramInt2 += 1;
    }
    label175:
    if (paramBoolean2)
    {
      paramCharSequence1.setViewVisibility(R.id.end_padder, 8);
      paramCharSequence1.setViewVisibility(R.id.cancel_action, 0);
      paramCharSequence1.setOnClickPendingIntent(R.id.cancel_action, paramPendingIntent);
      paramCharSequence1.setInt(R.id.cancel_action, "setAlpha", paramContext.getResources().getInteger(R.integer.cancel_button_image_alpha));
    }
    for (;;)
    {
      paramNotificationBuilderWithBuilderAccessor.getBuilder().setContent(paramCharSequence1);
      if (paramBoolean2) {
        paramNotificationBuilderWithBuilderAccessor.getBuilder().setOngoing(true);
      }
      return paramCharSequence1;
      paramCharSequence1.setViewVisibility(R.id.end_padder, 0);
      paramCharSequence1.setViewVisibility(R.id.cancel_action, 8);
    }
  }
  
  @TargetApi(16)
  @RequiresApi(16)
  public static <T extends NotificationCompatBase.Action> void a(Notification paramNotification, Context paramContext, CharSequence paramCharSequence1, CharSequence paramCharSequence2, CharSequence paramCharSequence3, int paramInt1, Bitmap paramBitmap, CharSequence paramCharSequence4, boolean paramBoolean1, long paramLong, int paramInt2, List<T> paramList, boolean paramBoolean2, PendingIntent paramPendingIntent, boolean paramBoolean3)
  {
    paramNotification.bigContentView = a(paramContext, paramCharSequence1, paramCharSequence2, paramCharSequence3, paramInt1, paramBitmap, paramCharSequence4, paramBoolean1, paramLong, paramInt2, paramList, paramBoolean2, paramPendingIntent, paramBoolean3);
    if (paramBoolean2) {
      paramNotification.flags |= 0x2;
    }
  }
  
  public static void a(Context paramContext, RemoteViews paramRemoteViews1, RemoteViews paramRemoteViews2)
  {
    float f1 = 1.3F;
    paramRemoteViews1.setViewVisibility(R.id.title, 8);
    paramRemoteViews1.setViewVisibility(R.id.text2, 8);
    paramRemoteViews1.setViewVisibility(R.id.text, 8);
    paramRemoteViews1.removeAllViews(R.id.notification_main_column);
    paramRemoteViews1.addView(R.id.notification_main_column, paramRemoteViews2.clone());
    paramRemoteViews1.setViewVisibility(R.id.notification_main_column, 0);
    int i;
    int j;
    int k;
    float f2;
    if (Build.VERSION.SDK_INT >= 21)
    {
      i = R.id.notification_main_column_container;
      j = paramContext.getResources().getDimensionPixelSize(R.dimen.notification_top_pad);
      k = paramContext.getResources().getDimensionPixelSize(R.dimen.notification_top_pad_large_text);
      f2 = paramContext.getResources().getConfiguration().fontScale;
      if (f2 >= 1.0F) {
        break label153;
      }
      f1 = 1.0F;
    }
    for (;;)
    {
      f1 = (f1 - 1.0F) / 0.29999995F;
      f2 = j;
      paramRemoteViews1.setViewPadding(i, 0, Math.round(f1 * k + (1.0F - f1) * f2), 0, 0);
      return;
      label153:
      if (f2 <= 1.3F) {
        f1 = f2;
      }
    }
  }
}


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