BannerNotificationFactory.java 2.6 KB
package com.arellomobile.android.push.utils.notification;

import android.annotation.SuppressLint;
import android.app.Notification;
import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.content.res.Resources;
import android.graphics.drawable.BitmapDrawable;
import android.os.Build.VERSION;
import android.os.Bundle;
import android.widget.RemoteViews;
import com.arellomobile.android.push.preference.SoundType;
import com.arellomobile.android.push.preference.VibrateType;

public class BannerNotificationFactory
  extends BaseNotificationFactory
{
  public static final String sNotificationLayout = "notification";
  
  public BannerNotificationFactory(Context paramContext, Bundle paramBundle, String paramString1, String paramString2, SoundType paramSoundType, VibrateType paramVibrateType)
  {
    super(paramContext, paramBundle, paramString1, paramString2, paramSoundType, paramVibrateType);
  }
  
  @SuppressLint({"NewApi"})
  final Notification a(Context paramContext, Bundle paramBundle, String paramString1, String paramString2, String paramString3)
  {
    paramContext = new Notification();
    int i = getContext().getResources().getIdentifier("notification", "layout", getContext().getPackageName());
    if (i == 0) {
      throw new IllegalArgumentException();
    }
    paramBundle = new RemoteViews(getContext().getPackageName(), i);
    paramString1 = Helper.tryToGetBitmapFromInternet(getData().getString("b"), getContext(), -1);
    if (paramString1 != null)
    {
      paramBundle.setBitmap(getContext().getResources().getIdentifier("image", "id", getContext().getPackageName()), "setImageBitmap", paramString1);
      paramContext.contentView = paramBundle;
      if (Build.VERSION.SDK_INT >= 16) {
        paramContext.bigContentView = paramBundle;
      }
      if (Build.VERSION.SDK_INT < 11) {
        break label220;
      }
      paramContext.tickerView = paramBundle;
    }
    for (;;)
    {
      paramContext.icon = Helper.tryToGetIconFormStringOrGetFromApplication(getData().getString("i"), getContext());
      return paramContext;
      paramBundle.setBitmap(getContext().getResources().getIdentifier("image", "id", getContext().getPackageName()), "setImageBitmap", ((BitmapDrawable)getContext().getResources().getDrawable(getContext().getApplicationInfo().icon)).getBitmap());
      break;
      label220:
      paramContext.tickerText = paramString3;
    }
  }
}


/* Location:              /home/merong/decompile/hackery-dex2jar.jar!/com/arellomobile/android/push/utils/notification/BannerNotificationFactory.class
 * Java compiler version: 6 (50.0)
 * JD-Core Version:       0.7.1
 */