SimpleNotificationFactory.java 2.17 KB
package com.arellomobile.android.push.utils.notification;

import android.app.Notification;
import android.content.Context;
import android.os.Bundle;
import android.text.Html;
import android.text.TextUtils;
import com.arellomobile.android.push.preference.SoundType;
import com.arellomobile.android.push.preference.VibrateType;
import com.pushwoosh.support.v4.app.NotificationCompat.BigTextStyle;
import com.pushwoosh.support.v4.app.NotificationCompat.Builder;

public class SimpleNotificationFactory
  extends BaseNotificationFactory
{
  public SimpleNotificationFactory(Context paramContext, Bundle paramBundle, String paramString1, String paramString2, SoundType paramSoundType, VibrateType paramVibrateType)
  {
    super(paramContext, paramBundle, paramString1, paramString2, paramSoundType, paramVibrateType);
  }
  
  private static CharSequence a(String paramString)
  {
    if (TextUtils.isEmpty(paramString)) {
      return paramString;
    }
    return Html.fromHtml(paramString);
  }
  
  final Notification a(Context paramContext, Bundle paramBundle, String paramString1, String paramString2, String paramString3)
  {
    int i = Helper.tryToGetIconFormStringOrGetFromApplication(paramBundle.getString("i"), paramContext);
    paramContext.getResources();
    Object localObject = null;
    String str = paramBundle.getString("ci");
    paramBundle = (Bundle)localObject;
    if (str != null) {
      paramBundle = Helper.tryToGetBitmapFromInternet(str, paramContext, 128);
    }
    paramContext = new NotificationCompat.Builder(paramContext);
    paramContext.setContentTitle(a(paramString1));
    paramContext.setContentText(a(paramString2));
    paramContext.setTicker(a(paramString3));
    paramContext.setWhen(System.currentTimeMillis());
    paramContext.setStyle(new NotificationCompat.BigTextStyle().bigText(a(paramString2)));
    paramContext.setSmallIcon(i);
    if (paramBundle != null) {
      paramContext.setLargeIcon(paramBundle);
    }
    return paramContext.build();
  }
}


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