Skip to content

Commit

Permalink
Removed unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
kidinov committed Mar 7, 2023
1 parent 87e3bb0 commit b5894d3
Show file tree
Hide file tree
Showing 52 changed files with 30 additions and 1,705 deletions.
79 changes: 0 additions & 79 deletions WooCommerce/src/main/kotlin/com/woocommerce/android/AppPrefs.kt
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ import com.woocommerce.android.ui.promobanner.PromoBannerType
import com.woocommerce.android.util.PreferenceUtils
import com.woocommerce.android.util.ThemeOption
import com.woocommerce.android.util.ThemeOption.DEFAULT
import com.woocommerce.android.util.WooLog
import com.woocommerce.android.util.WooLog.T
import java.util.Calendar
import java.util.Date

Expand Down Expand Up @@ -135,15 +133,9 @@ object AppPrefs {
// Play cha-ching sound on new order notifications
NOTIFS_ORDERS_CHA_CHING_ENABLED,

// Number of times the "mark all notifications read" icon was tapped
NUM_TIMES_MARK_ALL_NOTIFS_READ_SNACK_SHOWN,

// The app update for this version was cancelled by the user
CANCELLED_APP_VERSION_CODE,

// Application permissions
ASKED_PERMISSION_CAMERA,

// Date of the app installation
APP_INSTALATION_DATE,

Expand Down Expand Up @@ -281,10 +273,6 @@ object AppPrefs {
remove(DeletablePrefKey.SUPPORT_EMAIL)
}

fun setSupportName(name: String) {
setString(DeletablePrefKey.SUPPORT_NAME, name)
}

fun getSupportName() = getString(DeletablePrefKey.SUPPORT_NAME)

fun removeSupportName() {
Expand Down Expand Up @@ -427,14 +415,6 @@ object AppPrefs {
fun setCardReaderWelcomeDialogShown() =
setBoolean(UndeletablePrefKey.CARD_READER_WELCOME_SHOWN, true)

/**
* Flag to check products features are enabled
*/
fun isProductsFeatureEnabled() = getBoolean(DeletablePrefKey.IS_PRODUCTS_FEATURE_ENABLED, false)

fun setIsProductsFeatureEnabled(isProductsFeatureEnabled: Boolean) =
setBoolean(DeletablePrefKey.IS_PRODUCTS_FEATURE_ENABLED, isProductsFeatureEnabled)

fun isCrashReportingEnabled(): Boolean {
// default to False for debug builds
val default = !BuildConfig.DEBUG
Expand Down Expand Up @@ -463,14 +443,6 @@ object AppPrefs {
setBoolean(UndeletablePrefKey.NOTIFS_ORDERS_CHA_CHING_ENABLED, enabled)
}

fun getNumTimesMarkAllReadSnackShown(): Int =
getInt(UndeletablePrefKey.NUM_TIMES_MARK_ALL_NOTIFS_READ_SNACK_SHOWN, 0)

fun incNumTimesMarkAllReadSnackShown() {
val numTimesShown = getNumTimesMarkAllReadSnackShown() + 1
setInt(UndeletablePrefKey.NUM_TIMES_MARK_ALL_NOTIFS_READ_SNACK_SHOWN, numTimesShown)
}

fun getSelectedShipmentTrackingProviderName(): String =
getString(DeletablePrefKey.SELECTED_SHIPMENT_TRACKING_PROVIDER_NAME)

Expand Down Expand Up @@ -499,26 +471,12 @@ object AppPrefs {
setBoolean(DeletablePrefKey.LOGIN_USER_BYPASSED_JETPACK_REQUIRED, bypassedLogin)
}

fun getLoginUserBypassedJetpackRequired() =
getBoolean(DeletablePrefKey.LOGIN_USER_BYPASSED_JETPACK_REQUIRED, false)

fun removeLoginUserBypassedJetpackRequired() {
remove(DeletablePrefKey.LOGIN_USER_BYPASSED_JETPACK_REQUIRED)
}

fun getDatabaseDowngraded() = getBoolean(DATABASE_DOWNGRADED, false)

fun setDatabaseDowngraded(value: Boolean) {
setBoolean(DATABASE_DOWNGRADED, value)
}

fun setSelectedOrderListTab(selectedOrderListTabPosition: Int) {
setInt(DeletablePrefKey.SELECTED_ORDER_LIST_TAB_POSITION, selectedOrderListTabPosition)
}

fun getSelectedOrderListTabPosition() =
getInt(DeletablePrefKey.SELECTED_ORDER_LIST_TAB_POSITION, -1)

fun setSelectedProductType(type: ProductType) = setString(DeletablePrefKey.SELECTED_PRODUCT_TYPE, type.value)

fun getSelectedProductType(): String = getString(DeletablePrefKey.SELECTED_PRODUCT_TYPE, "")
Expand All @@ -528,14 +486,6 @@ object AppPrefs {

fun isSelectedProductVirtual(): Boolean = getBoolean(DeletablePrefKey.SELECTED_PRODUCT_IS_VIRTUAL, false)

/**
* Checks if the user has a saved order list tab position yet. If no position has been saved,
* then the value will be the default of -1.
*
* @return True if the saved position is not the default -1, else false
*/
fun hasSelectedOrderListTabPosition() = getSelectedOrderListTabPosition() > -1

fun getImageOptimizationEnabled() = getBoolean(IMAGE_OPTIMIZE_ENABLED, true)

fun setImageOptimizationEnabled(enabled: Boolean) {
Expand Down Expand Up @@ -567,20 +517,6 @@ object AppPrefs {
setString(DeletablePrefKey.UNIFIED_LOGIN_LAST_ACTIVE_SOURCE, source)
}

/**
* Used during the unified login process to track the last flow the user was in before
* closing the app so if the user opens and finishes the flow at a later day the tracks
* events will be complete.
*/
fun getUnifiedLoginLastFlow(): String? {
val result = getString(DeletablePrefKey.UNIFIED_LOGIN_LAST_ACTIVE_FLOW)
return if (result.isNotEmpty()) {
result
} else {
null
}
}

fun setUnifiedLoginLastFlow(flow: String) {
setString(DeletablePrefKey.UNIFIED_LOGIN_LAST_ACTIVE_FLOW, flow)
}
Expand Down Expand Up @@ -1034,21 +970,6 @@ object AppPrefs {
)
}

/*
* key in shared preferences which stores a boolean telling whether the app has already
* asked for the passed permission
*/
fun getPermissionAskedKey(permission: String): PrefKey? {
when (permission) {
android.Manifest.permission.CAMERA ->
return UndeletablePrefKey.ASKED_PERMISSION_CAMERA
else -> {
WooLog.w(T.UTILS, "No key for requested permission: $permission")
return null
}
}
}

enum class CardReaderOnboardingStatus {
CARD_READER_ONBOARDING_COMPLETED,
CARD_READER_ONBOARDING_PENDING,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import com.woocommerce.android.support.help.HelpOrigin.LOGIN_USERNAME_PASSWORD

object AppUrls {
const val APP_HELP_CENTER = "https://docs.woocommerce.com/document/android/"
const val APP_FEATURE_REQUEST = "http://ideas.woocommerce.com/forums/133476-woocommerce?category_id=84283"

const val AUTOMATTIC_TOS = "https://woocommerce.com/terms-conditions/"
const val AUTOMATTIC_PRIVACY_POLICY = "https://www.automattic.com/privacy"
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,6 @@ object RequestCodes {
const val SETTINGS = BASE_REQUEST_CODE + 1
const val IN_APP_UPDATE = BASE_REQUEST_CODE + 3

const val CAMERA_PERMISSION = BASE_REQUEST_CODE + 10

const val PRODUCT_IMAGE_VIEWER = BASE_REQUEST_CODE + 100
const val CHOOSE_PHOTO = BASE_REQUEST_CODE + 101
const val CAPTURE_PHOTO = BASE_REQUEST_CODE + 102
const val WPMEDIA_LIBRARY_PICK_PHOTOS = BASE_REQUEST_CODE + 103
const val WPMEDIA_LIBRARY_PICK_DOWNLOADABLE_FILE = BASE_REQUEST_CODE + 104

const val PRODUCT_INVENTORY_BACKORDERS = BASE_REQUEST_CODE + 301
const val PRODUCT_INVENTORY_STOCK_STATUS = BASE_REQUEST_CODE + 302
const val PRODUCT_TAX_STATUS = BASE_REQUEST_CODE + 304
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,7 @@ enum class AnalyticsEvent(val siteless: Boolean = false) {
SIGNUP_SOCIAL_BUTTON_FAILURE(siteless = true),
SIGNUP_SOCIAL_TO_LOGIN(siteless = true),
ADDED_SELF_HOSTED_SITE(siteless = true),
CREATED_ACCOUNT(siteless = true),
LOGIN_PROLOGUE_JETPACK_LOGIN_BUTTON_TAPPED(siteless = true),
LOGIN_PROLOGUE_JETPACK_CONFIGURATION_INSTRUCTIONS_LINK_TAPPED(siteless = true),
LOGIN_JETPACK_REQUIRED_SCREEN_VIEWED(siteless = true),
LOGIN_JETPACK_REQUIRED_VIEW_INSTRUCTIONS_BUTTON_TAPPED(siteless = true),
LOGIN_JETPACK_REQUIRED_WHAT_IS_JETPACK_LINK_TAPPED(siteless = true),
LOGIN_JETPACK_REQUIRED_MENU_HELP_TAPPED(siteless = true),
LOGIN_JETPACK_REQUIRED_SIGN_IN_LINK_TAPPED(siteless = true),
LOGIN_WHAT_IS_JETPACK_HELP_SCREEN_VIEWED(siteless = true),
LOGIN_WHAT_IS_JETPACK_HELP_SCREEN_LEARN_MORE_BUTTON_TAPPED(siteless = true),
LOGIN_WHAT_IS_JETPACK_HELP_SCREEN_OK_BUTTON_TAPPED(siteless = true),
Expand All @@ -76,7 +69,6 @@ enum class AnalyticsEvent(val siteless: Boolean = false) {
LOGIN_FIND_CONNECTED_EMAIL_HELP_SCREEN_NEED_MORE_HELP_LINK_TAPPED(siteless = true),
LOGIN_FIND_CONNECTED_EMAIL_HELP_SCREEN_OK_BUTTON_TAPPED(siteless = true),
LOGIN_NO_JETPACK_SCREEN_VIEWED(siteless = true),
LOGIN_NO_JETPACK_VIEW_INSTRUCTIONS_BUTTON_TAPPED(siteless = true),
LOGIN_NO_JETPACK_LOGOUT_LINK_TAPPED(siteless = true),
LOGIN_NO_JETPACK_TRY_AGAIN_TAPPED(siteless = true),
LOGIN_NO_JETPACK_MENU_HELP_TAPPED(siteless = true),
Expand All @@ -98,7 +90,6 @@ enum class AnalyticsEvent(val siteless: Boolean = false) {
UNIFIED_LOGIN_STEP(siteless = true),
UNIFIED_LOGIN_FAILURE(siteless = true),
UNIFIED_LOGIN_INTERACTION(siteless = true),
LOGIN_NEW_TO_WOO_BUTTON_TAPPED(siteless = true),
LOGIN_JETPACK_SETUP_BUTTON_TAPPED(siteless = true),
LOGIN_JETPACK_SETUP_DISMISSED(siteless = true),
LOGIN_JETPACK_SETUP_COMPLETED(siteless = true),
Expand All @@ -125,12 +116,8 @@ enum class AnalyticsEvent(val siteless: Boolean = false) {
SITE_PICKER_AUTO_LOGIN_SUBMITTED(siteless = true),
SITE_PICKER_AUTO_LOGIN_ERROR_NOT_CONNECTED_TO_USER(siteless = true),
SITE_PICKER_AUTO_LOGIN_ERROR_NOT_WOO_STORE(siteless = true),
SITE_PICKER_AUTO_LOGIN_ERROR_NOT_CONNECTED_JETPACK(siteless = true),
SITE_PICKER_TRY_ANOTHER_ACCOUNT_BUTTON_TAPPED(siteless = true),
SITE_PICKER_TRY_ANOTHER_STORE_BUTTON_TAPPED(siteless = true),
SITE_PICKER_VIEW_CONNECTED_STORES_BUTTON_TAPPED(siteless = true),
SITE_PICKER_HELP_FINDING_CONNECTED_EMAIL_LINK_TAPPED(siteless = true),
SITE_PICKER_NOT_WOO_STORE_REFRESH_APP_LINK_TAPPED(siteless = true),
SITE_PICKER_NOT_CONNECTED_JETPACK_REFRESH_APP_LINK_TAPPED(siteless = true),
SITE_PICKER_NON_WOO_SITE_TAPPED(siteless = true),
SITE_PICKER_NEW_TO_WOO_TAPPED(siteless = true),
Expand Down Expand Up @@ -169,15 +156,12 @@ enum class AnalyticsEvent(val siteless: Boolean = false) {
// -- Dashboard
DASHBOARD_PULLED_TO_REFRESH,
DASHBOARD_SHARE_YOUR_STORE_BUTTON_TAPPED,
DASHBOARD_UNFULFILLED_ORDERS_BUTTON_TAPPED,
DASHBOARD_MAIN_STATS_DATE,
DASHBOARD_MAIN_STATS_LOADED,
DASHBOARD_TOP_PERFORMERS_DATE,
DASHBOARD_TOP_PERFORMERS_LOADED,
DASHBOARD_NEW_STATS_REVERTED_BANNER_DISMISS_TAPPED,
DASHBOARD_NEW_STATS_REVERTED_BANNER_LEARN_MORE_TAPPED,
DASHBOARD_NEW_STATS_AVAILABILITY_BANNER_CANCEL_TAPPED,
DASHBOARD_NEW_STATS_AVAILABILITY_BANNER_TRY_TAPPED,
DASHBOARD_WAITING_TIME_LOADED,
DASHBOARD_SEE_MORE_ANALYTICS_TAPPED,
USED_ANALYTICS,
Expand All @@ -190,7 +174,6 @@ enum class AnalyticsEvent(val siteless: Boolean = false) {
ORDERS_LIST_FILTER,
ORDERS_LIST_SEARCH,
ORDERS_LIST_LOADED,
ORDERS_LIST_SHARE_YOUR_STORE_BUTTON_TAPPED,
ORDERS_LIST_PULLED_TO_REFRESH,
ORDERS_LIST_MENU_SEARCH_TAPPED,
ORDERS_LIST_VIEW_FILTER_OPTIONS_TAPPED,
Expand All @@ -201,8 +184,6 @@ enum class AnalyticsEvent(val siteless: Boolean = false) {
IPP_FEEDBACK_BANNER_DISMISSED,
IPP_FEEDBACK_BANNER_CTA_TAPPED,

// -- Order filter by status dialog
FILTER_ORDERS_BY_STATUS_DIALOG_APPLY_FILTER_BUTTON_TAPPED,
FILTER_ORDERS_BY_STATUS_DIALOG_OPTION_SELECTED,
ORDER_FILTER_LIST_CLEAR_MENU_BUTTON_TAPPED,

Expand All @@ -226,21 +207,17 @@ enum class AnalyticsEvent(val siteless: Boolean = false) {
JITM_DISMISS_SUCCESS,
JITM_DISMISS_FAILURE,

// -- Simple Payments
SIMPLE_PAYMENTS_FLOW_STARTED,
PAYMENTS_FLOW_CANCELED,
SIMPLE_PAYMENTS_FLOW_NOTE_ADDED,
SIMPLE_PAYMENTS_FLOW_TAXES_TOGGLED,

// -- Order Detail
ORDER_OPEN,
ORDER_NOTES_LOADED,
ORDER_CONTACT_ACTION,
ORDER_CONTACT_ACTION_FAILED,
ORDER_STATUS_CHANGE,
ORDER_STATUS_CHANGE_FAILED,
ORDER_STATUS_CHANGE_SUCCESS,
ORDER_STATUS_CHANGE_UNDO,
ORDER_DETAIL_PULLED_TO_REFRESH,
ORDER_DETAIL_ADD_NOTE_BUTTON_TAPPED,
ORDER_DETAIL_CUSTOMER_INFO_SHOW_BILLING_TAPPED,
Expand All @@ -249,14 +226,7 @@ enum class AnalyticsEvent(val siteless: Boolean = false) {
ORDER_DETAIL_CUSTOMER_INFO_PHONE_MENU_PHONE_TAPPED,
ORDER_DETAIL_CUSTOMER_INFO_PHONE_MENU_SMS_TAPPED,
ORDER_DETAIL_FULFILL_ORDER_BUTTON_TAPPED,
ORDER_DETAIL_ORDER_STATUS_EDIT_BUTTON_TAPPED,
ORDER_DETAIL_PRODUCT_TAPPED,
ORDER_DETAIL_PRODUCT_DETAIL_BUTTON_TAPPED,
ORDER_TRACKING_LOADED,
ORDER_DETAIL_TRACKING_DELETE_BUTTON_TAPPED,
ORDER_DETAIL_TRACKING_ADD_TRACKING_BUTTON_TAPPED,
ORDER_DETAIL_ISSUE_REFUND_BUTTON_TAPPED,
ORDER_DETAIL_VIEW_REFUND_DETAILS_BUTTON_TAPPED,
ORDER_DETAIL_CREATE_SHIPPING_LABEL_BUTTON_TAPPED,
ORDER_DETAIL_WAITING_TIME_LOADED,
ORDER_VIEW_CUSTOM_FIELDS_TAPPED,
Expand Down Expand Up @@ -293,7 +263,6 @@ enum class AnalyticsEvent(val siteless: Boolean = false) {
CREATE_ORDER_REFUND_ITEM_QUANTITY_DIALOG_OPENED,
CREATE_ORDER_REFUND_PRODUCT_AMOUNT_DIALOG_OPENED,
CREATE_ORDER_REFUND_SUMMARY_REFUND_BUTTON_TAPPED,
CREATE_ORDER_REFUND_SUMMARY_UNDO_BUTTON_TAPPED,
REFUND_CREATE,
REFUND_CREATE_SUCCESS,
REFUND_CREATE_FAILED,
Expand Down Expand Up @@ -421,7 +390,6 @@ enum class AnalyticsEvent(val siteless: Boolean = false) {
SETTING_CHANGE,
SETTING_CHANGE_FAILED,
SETTING_CHANGE_SUCCESS,
SETTINGS_SELECTED_SITE_TAPPED,
SETTINGS_LOGOUT_BUTTON_TAPPED,
SETTINGS_LOGOUT_CONFIRMATION_DIALOG_RESULT,
SETTINGS_BETA_FEATURES_BUTTON_TAPPED,
Expand All @@ -432,7 +400,6 @@ enum class AnalyticsEvent(val siteless: Boolean = false) {
SETTINGS_ABOUT_OPEN_SOURCE_LICENSES_LINK_TAPPED,
SETTINGS_NOTIFICATIONS_OPEN_CHANNEL_SETTINGS_BUTTON_TAPPED,
SETTINGS_WE_ARE_HIRING_BUTTON_TAPPED,
SETTINGS_BETA_FEATURES_PRODUCTS_TOGGLED,
SETTINGS_IMAGE_OPTIMIZATION_TOGGLED,
SETTINGS_CARD_PRESENT_SELECT_PAYMENT_GATEWAY_TAPPED,
PRIVACY_SETTINGS_COLLECT_INFO_TOGGLED,
Expand Down Expand Up @@ -476,7 +443,6 @@ enum class AnalyticsEvent(val siteless: Boolean = false) {
PRODUCT_DETAIL_SHARE_BUTTON_TAPPED,
PRODUCT_DETAIL_UPDATE_BUTTON_TAPPED,
PRODUCT_DETAIL_VIEW_EXTERNAL_TAPPED,
PRODUCT_DETAIL_VIEW_AFFILIATE_TAPPED,
PRODUCT_DETAIL_VIEW_PRODUCT_VARIANTS_TAPPED,
PRODUCT_DETAIL_VIEW_PRODUCT_DESCRIPTION_TAPPED,
PRODUCT_DETAIL_VIEW_PRICE_SETTINGS_TAPPED,
Expand Down Expand Up @@ -530,8 +496,6 @@ enum class AnalyticsEvent(val siteless: Boolean = false) {
REVIEW_REPLY_SEND_SUCCESS,
REVIEW_REPLY_SEND_FAILED,

// -- Downloadable Files
PRODUCT_DOWNLOADABLE_FILES_SETTINGS_CHANGED,
PRODUCTS_DOWNLOADABLE_FILE,

// -- Linked Products
Expand Down Expand Up @@ -588,8 +552,6 @@ enum class AnalyticsEvent(val siteless: Boolean = false) {
PRODUCT_ADDONS_ORDER_DETAIL_VIEW_PRODUCT_ADDONS_TAPPED,
PRODUCT_ADDONS_REFUND_DETAIL_VIEW_PRODUCT_ADDONS_TAPPED,

// -- Product settings
PRODUCT_SETTINGS_DONE_BUTTON_TAPPED,
PRODUCT_DETAIL_ADD_IMAGE_TAPPED,
PRODUCT_IMAGE_SETTINGS_ADD_IMAGES_BUTTON_TAPPED,
PRODUCT_IMAGE_SETTINGS_ADD_IMAGES_SOURCE_TAPPED,
Expand All @@ -600,16 +562,12 @@ enum class AnalyticsEvent(val siteless: Boolean = false) {
PRODUCT_SETTINGS_PURCHASE_NOTE_TAPPED,
PRODUCT_SETTINGS_VISIBILITY_TAPPED,
PRODUCT_SETTINGS_MENU_ORDER_TAPPED,
PRODUCT_SETTINGS_VIRTUAL_TOGGLED,
PRODUCT_SETTINGS_REVIEWS_TOGGLED,

// -- Product filters
PRODUCT_FILTER_LIST_SHOW_PRODUCTS_BUTTON_TAPPED,
PRODUCT_FILTER_LIST_CLEAR_MENU_BUTTON_TAPPED,

// -- Aztec editor
AZTEC_EDITOR_DONE_BUTTON_TAPPED,

// -- Product variations
PRODUCT_VARIANTS_PULLED_TO_REFRESH,
PRODUCT_VARIANTS_LOADED,
Expand All @@ -624,7 +582,6 @@ enum class AnalyticsEvent(val siteless: Boolean = false) {

// -- Product images
PRODUCT_IMAGE_ADDED,
PRODUCT_IMAGE_REMOVED,

// -- Duplicate product
DUPLICATE_PRODUCT_SUCCESS,
Expand All @@ -636,9 +593,6 @@ enum class AnalyticsEvent(val siteless: Boolean = false) {
SUPPORT_IDENTITY_SET(siteless = true),
SUPPORT_IDENTITY_FORM_VIEWED(siteless = true),
SUPPORT_APPLICATION_LOG_VIEWED(siteless = true),
SUPPORT_TICKETS_VIEWED(siteless = true),
SUPPORT_FAQ_VIEWED(siteless = true),
SUPPORT_SSR_OPENED,
SUPPORT_SSR_COPY_BUTTON_TAPPED,

// -- Push notifications
Expand All @@ -660,7 +614,6 @@ enum class AnalyticsEvent(val siteless: Boolean = false) {
REVIEWS_MARK_ALL_READ_FAILED,
REVIEWS_LIST_PULLED_TO_REFRESH,
REVIEWS_LIST_MENU_MARK_READ_BUTTON_TAPPED,
REVIEWS_LIST_SHARE_YOUR_STORE_BUTTON_TAPPED,

// -- Product Review Detail
REVIEW_OPEN,
Expand All @@ -674,8 +627,6 @@ enum class AnalyticsEvent(val siteless: Boolean = false) {
REVIEW_ACTION,
REVIEW_ACTION_FAILED,
REVIEW_ACTION_SUCCESS,
REVIEW_ACTION_UNDO,
SNACK_REVIEW_ACTION_APPLIED_UNDO_BUTTON_TAPPED,
REVIEW_DETAIL_APPROVE_BUTTON_TAPPED,
REVIEW_DETAIL_OPEN_EXTERNAL_BUTTON_TAPPED,
REVIEW_DETAIL_SPAM_BUTTON_TAPPED,
Expand Down
Loading

0 comments on commit b5894d3

Please sign in to comment.