Skip to content

Instantly share code, notes, and snippets.

View elihart's full-sized avatar

Eli Hart elihart

  • Airbnb
  • San Francisco
View GitHub Profile
@elihart
elihart / MvRxViewModelExample.kt
Created November 20, 2019 20:21
MvRxViewModelExample
data class TextState(val text: String? = null) : MvRxState
class TextViewModel(state: TextState) : MvRxViewModel<TextState>(state) {
fun setText(text: String) {
setState {
copy(text = text)
}
}
}
@elihart
elihart / InteractionReportMvRxStateChangeWithMapExample.json
Created November 20, 2019 19:10
InteractionReportMvRxStateChangeWithMapExample
"State set": {
"RoomCountsState": {
"modifiedRoomCounts": {
"added keys": "[Bedroom=2]"
}
}
}
@elihart
elihart / InteractionReportMvRxStateChangeExample.json
Created November 20, 2019 19:09
InteractionReportMvRxStateChangeExample
"click": [
{
"MvRx State set": {
"CancellationPolicyState": {
"selectedPolicyKey": {
"newValue": "flexible",
"oldValue": "strict_14_with_grace_period"
}
}
}
@elihart
elihart / InteractionReportRequestExecutedExample.json
Created November 20, 2019 19:09
InteractionReportRequestExecutedExample
"click": [
{
"Request Executed": {
"GET": "https://api.airbnb.com/v2/trip_host_reviews?_format=for_funston&_limit=5&_offset=0&host_id=1&rating=5"
}
}
@elihart
elihart / InteractionReportFragmentChangeExample.json
Created November 20, 2019 19:07
InteractionReportFragmentChangeExample
"click": [
{
"Fragments changed": {
"Fragment name": "ManageRoomPhotosFragment",
"args": "ManageRoomPhotosArgs(id=100, name=\"Kitchen\")",
"state": "STOPPED"
}
}
]
@elihart
elihart / InteractionReportOptionSelectedExample.json
Created November 20, 2019 19:06
InteractionReportOptionSelectedExample
"click": [
{
"onOptionsItemSelected": {
"itemId": "android:id\/home",
"title": "Location"
}
},
{
"supportFinishAfterTransition": {}
}
@elihart
elihart / InteractionReportImageUrlPropertyExample.json
Created November 20, 2019 19:06
InteractionReportImageUrlPropertyExample
"view": "ImageView",
"viewId": "listing_image",
"properties": {
"url": "https://a0.muscache.com/4ea/air/v2/pictures/22903706/501e0ec5_original.jpg"
}
@elihart
elihart / InteractionReportViewPropertyExample.json
Created November 20, 2019 19:05
InteractionReportViewPropertyExample
"view": "ExpandableTextView",
"viewId": "text_row_expandable_text_view",
"properties": {
"content description": "We know the area well and are happy to tell you interesting places to visit."
}
@elihart
elihart / InteractionReportEventExample.json
Created November 20, 2019 19:04
Interaction testing report event example
"click": [
{
"Events logged": {
"ListingElementActionEvent": 2,
"NavigationEvent": 1
}
}
]
@elihart
elihart / InteractionTestingExampleActivityFinishing.json
Created November 20, 2019 19:02
Interaction testing example activity finishing
"click": [
{
"Activity finished": {}
},
{
"Activity result set": {
"resultCode": 99,
"resultData": {
"extras": "[RESULT_COUNTRY_CODE=AD, RESULT_PHONE_COUNTRY_CODE=376]"
}