PageViewReporter.java 3.22 KB
package com.bitstrips.imoji.analytics;

import java.util.HashMap;
import java.util.Map;
import javax.inject.Inject;
import javax.inject.Singleton;
import org.json.JSONObject;

@Singleton
public class PageViewReporter
{
  private static String b = "snapchat";
  private static String c = "";
  private final LegacyAnalyticsService a;
  private Category d;
  
  @Inject
  public PageViewReporter(LegacyAnalyticsService paramLegacyAnalyticsService)
  {
    this.a = paramLegacyAnalyticsService;
  }
  
  private static String a(Category paramCategory, String paramString)
  {
    HashMap localHashMap = new HashMap();
    if (paramCategory == null) {}
    for (paramCategory = "";; paramCategory = paramCategory.toString())
    {
      localHashMap.put("source", paramCategory);
      localHashMap.put("referrer", paramString);
      return new JSONObject(localHashMap).toString();
    }
  }
  
  public void birthdayPageView()
  {
    this.a.sendEvent(Category.BIRTHDAY, Action.BIRTHDAY_PAGEVIEW);
  }
  
  public void connectToSnapchatScreenFromLoginScreenInSnapchatAppContext()
  {
    this.a.sendEvent(Category.SNAPCHAT_CONNECT_PAGE, Action.PAGE_VIEW, a(Category.LOGIN_PAGE, b));
    this.d = Category.SNAPCHAT_CONNECT_PAGE;
  }
  
  public void connectToSnapchatScreenFromSnapchatApp()
  {
    if ((this.d != null) && (this.d.toString().equals(Category.LOGIN_PAGE.toString())))
    {
      connectToSnapchatScreenFromLoginScreenInSnapchatAppContext();
      return;
    }
    this.a.sendEvent(Category.SNAPCHAT_CONNECT_PAGE, Action.PAGE_VIEW, a(this.d, b));
    this.d = Category.SNAPCHAT_CONNECT_PAGE;
  }
  
  public void enteredInvalidBirthday()
  {
    this.a.sendEvent(Category.BIRTHDAY, Action.BIRTHDAY_FAIL);
  }
  
  public void enteredValidBirthday()
  {
    this.a.sendEvent(Category.BIRTHDAY, Action.BIRTHDAY_SUCCESS);
  }
  
  public void loginScreenFromWelcomeScreenInBitmojiAppContext()
  {
    this.a.sendEvent(Category.LOGIN_PAGE, Action.PAGE_VIEW, a(Category.WELCOME_PAGE, c));
    this.d = Category.LOGIN_PAGE;
  }
  
  public void loginScreenFromWelcomeScreenInSnapchatAppContext()
  {
    this.a.sendEvent(Category.LOGIN_PAGE, Action.PAGE_VIEW, a(Category.WELCOME_PAGE, b));
    this.d = Category.LOGIN_PAGE;
  }
  
  public void overrideLastPageView(Category paramCategory)
  {
    this.d = paramCategory;
  }
  
  public void resetPasswordFromLoginScreenInBitmojiAppContext()
  {
    this.a.sendEvent(Category.RESET_PASSWORD_PAGE, Action.PAGE_VIEW, a(Category.LOGIN_PAGE, c));
    this.d = Category.RESET_PASSWORD_PAGE;
  }
  
  public void resetPasswordFromLoginScreenInSnapchatAppContext()
  {
    this.a.sendEvent(Category.RESET_PASSWORD_PAGE, Action.PAGE_VIEW, a(Category.LOGIN_PAGE, b));
    this.d = Category.RESET_PASSWORD_PAGE;
  }
  
  public void welcomeScreenFromHomeScreen()
  {
    this.a.sendEvent(Category.WELCOME_PAGE, Action.PAGE_VIEW, a(null, c));
    this.d = Category.WELCOME_PAGE;
  }
  
  public void welcomeScreenFromSnapchatApp()
  {
    this.a.sendEvent(Category.WELCOME_PAGE, Action.PAGE_VIEW, a(null, b));
    this.d = Category.WELCOME_PAGE;
  }
}


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