SHARE
TWEET

Untitled

a guest Jun 19th, 2019 65 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package com.easybooks.base.utils
  2.  
  3. import com.easybooks.base.app.App
  4. import com.google.firebase.analytics.FirebaseAnalytics
  5. import timber.log.Timber
  6.  
  7. object Analytics {
  8.     enum class AnalyticsActions {
  9.         //Home
  10.         HOME_SETTINGS_ICON,
  11.  
  12.         //Sales
  13.         SET_UP_INVOICES_LIST_ADD_NEW_INVOICE,
  14.         SET_UP_INVOICES_LIST_EDIT_INVOICE,
  15.         NEW_SALE_INVOICE_PREVIEW,
  16.         NEW_SALE_SAVE_BEFORE_VALIDATION,
  17.         NEW_SALE_INVOICE_ADDED_SUCCESS,
  18.         EDIT_SALE_INVOICE_PREVIEW,
  19.         EDIT_SALE_SAVE_BEFORE_VALIDATION,
  20.         EDIT_SALE_INVOICE_UPDATE_SUCCESS,
  21.  
  22.         //Expenses
  23.         SET_UP_RECEIPT_LIST_ADD_NEW_EXPENSE,
  24.         SET_UP_BILL_LIST_ADD_NEW_EXPENSE,
  25.         SET_UP_RECEIPT_LIST_EDIT_RECEIPT,
  26.         SET_UP_BILL_LIST_EDIT_BILL,
  27.         NEW_EXPENSE_ADD_SUCCESS,
  28.         NEW_EXPENSE_SAVE_BEFORE_VALIDATION,
  29.         EDIT_EXPENSE_SAVE_BEFORE_VALIDATION,
  30.         EDIT_EXPENSE_UPDATE_SUCCESS,
  31.  
  32.         //Accounting
  33.         ACCOUNTING_DEBT_REPORT,
  34.         ACCOUNTING_BEST_SELLERS_REPORT,
  35.         ACCOUNTING_MONTHLY_BREAKDOWN_OF_SALES_REPORT,
  36.         ACCOUNTING_MTD_REPORT,
  37.         ACCOUNTING_PROFIT_AND_LOSS_REPORT,
  38.         ACCOUNTING_BALANCE_SHEET_REPORT,
  39.         ACCOUNTING_TRIAL_BALANCE_REPORT,
  40.         ACCOUNTING_MONTHLY_BREAKDOWN_REPORT,
  41.         ACCOUNTING_CASH_FLOW_REPORT,
  42.         ACCOUNTING_ACCOUNTS_BY_CATEGORY_REPORT,
  43.         ACCOUNTING_AUDIT_REPORT,
  44.         ACCOUNTING_TRANSACTIONS_BY_CATEGORY_REPORT,
  45.         ACCOUNTING_TRANSACTIONS_BY_ACCOUNT_REPORT,
  46.         ACCOUNTING_TOP_SUPPLIERS_REPORT,
  47.         ACCOUNTING_SUPPLIERS_AGED_DEBT_REPORT,
  48.  
  49.         //Set Up
  50.         //Customer
  51.         CUSTOMER_EDIT_CUSTOMER_SUCCESS,
  52.         CUSTOMER_ADD_NEW_CUSTOMER_SUCCESS,
  53.         CUSTOMER_ADD_NEW_GROUP_SUCCESS,
  54.         CUSTOMER_NEW_EDIT_SAVE_BEFORE_VALIDATION,
  55.         CUSTOMER_OPEN_CONTACTS_BOOK,
  56.         SET_UP_CUSTOMERS_LIST_ADD_NEW_CUSTOMER,
  57.         SET_UP_CUSTOMERS_LIST_EDIT_CUSTOMER,
  58.  
  59.         //Customers group
  60.         GROUP_ADD_NEW_CUSTOMER,
  61.         GROUP_EDIT_CUSTOMER,
  62.         GROUP_EDIT_CUSTOMER_GROUP_SUCCESS,
  63.  
  64.         //Supplier
  65.         SUPPLIER_EDIT_SUPPLIER_SUCCESS,
  66.         SUPPLIER_ADD_NEW_SUPPLIER_SUCCESS,
  67.         SUPPLIER_ADD_NEW_GROUP_SUCCESS,
  68.         SUPPLIER_NEW_EDIT_SAVE_BEFORE_VALIDATION,
  69.         SUPPLIER_OPEN_CONTACTS_BOOK,
  70.         SET_UP_SUPPLIER_LIST_ADD_NEW_SUPPLIER,
  71.         SET_UP_SUPPLIER_LIST_EDIT_SUPPLIER,
  72.  
  73.         //Suppliers group
  74.         GROUP_ADD_NEW_SUPPLIER,
  75.         GROUP_EDIT_SUPPLIER,
  76.         GROUP_EDIT_SUPPLIER_GROUP_SUCCESS,
  77.  
  78.         //Service
  79.         SERVICE_EDIT_SERVICE_SUCCESS,
  80.         SERVICE_ADD_NEW_SERVICE_SUCCESS,
  81.         SERVICE_NEW_EDIT_SAVE_BEFORE_VALIDATION,
  82.         SET_UP_SERVICE_LIST_ADD_NEW_SERVICE,
  83.         SET_UP_SERVICE_LIST_EDIT_SERVICE,
  84.  
  85.         //Stock
  86.         STOCK_EDIT_STOCK_SUCCESS,
  87.         STOCK_ADD_NEW_STOCK_SUCCESS,
  88.         STOCK_NEW_EDIT_SAVE_BEFORE_VALIDATION,
  89.         SET_UP_STOCK_LIST_ADD_NEW_STOCK,
  90.         SET_UP_STOCK_LIST_EDIT_STOCK,
  91.  
  92.         //Settings
  93.         SETTINGS_OPEN_PERSONAL,
  94.         SETTINGS_OPEN_SUBSCRIPTIONS,
  95.         SETTINGS_OPEN_PRIVACY_POLICY,
  96.         SETTINGS_OPEN_GOOGLE_PLAY,
  97.         SETTINGS_OPEN_DELETE_DIALOG,
  98.         SETTINGS_OPEN_REPORT_BUG_DIALOG,
  99.         SETTINGS_ADD_NEW_BUSINESS,
  100.         SETTINGS_EDIT_BUSINESS,
  101.         SETTINGS_LOG_OUT_USER,
  102.         PERSONAL_SAVE_BEFORE_VALIDATION,
  103.         PERSONAL_EDIT_SUCCESS,
  104.         BUSINESS_SAVE_BEFORE_VALIDATION,
  105.         BUSINESS_EDIT_SUCCESS,
  106.         BUSINESS_ADD_NEW_SUCCESS,
  107.         BUSINESS_OPEN_DELETE_DIALOG,
  108.  
  109.         //Pinlock
  110.         PINLOCK_OPENED,
  111.  
  112.         //Bottom main menu
  113.         BOTTOM_MENU_HOME_SELECTED,
  114.         BOTTOM_MENU_SALE_SELECTED,
  115.         BOTTOM_MENU_EXPENSES_SELECTED,
  116.         BOTTOM_MENU_ACCOUNTING_SELECTED,
  117.         BOTTOM_MENU_SET_UP_SELECTED,
  118.  
  119.         //Start
  120.         START_FRAGMENT_OPENED,
  121.         START_OPEN_LOG_IN,
  122.         START_OPEN_REGISTER,
  123.  
  124.         //Login
  125.         LOG_IN_BEFORE_VALIDATION,
  126.         LOG_IN_SUCCESS,
  127.         LOG_IN_OPEN_FORGOT_PASSWORD,
  128.         LOG_IN_OPEN_BUSINESS_SET_UP,
  129.  
  130.         //Register
  131.         REGISTER_EMAIL_BEFORE_VALIDATION,
  132.         REGISTER_EMAIL_SUCCESS,
  133.         REGISTER_PASSWORD_SHOW_PRIVACY_POLICY,
  134.         REGISTER_PASSWORD_BEFORE_VALIDATION,
  135.         REGISTER_PASSWORD_SUCCESS,
  136.         REGISTER_BUSINESS_CHECK_EMAIL,
  137.         REGISTER_BUSINESS_BEFORE_VALIDATION,
  138.         REGISTER_BUSINESS_SUCCESS,
  139.         REGISTER_BUSINESS_LOG_OUT,
  140.         REGISTER_BUSINESS_START_USING_APP,
  141.  
  142.         //Forgot password
  143.         FORGOT_PASSWORD_RESTORE_BEFORE_VALIDATION,
  144.         FORGOT_PASSWORD_RESTORE_SUCCESS
  145.  
  146.     }
  147.  
  148.     fun logClick(actionType: AnalyticsActions) {
  149.         Timber.i("FirebaseAnalytics action: ${actionType.name}")
  150.         FirebaseAnalytics.getInstance(App.appCtx()).logEvent(actionType.name, null)
  151.     }
  152.  
  153. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top