Skip to content

Instantly share code, notes, and snippets.

Abhay Sood abhaysood

Block or report user

Report or block abhaysood

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View SketchSystems.spec
Home Screen*
Empty
query changed -> Searching
Showing Results
query changed -> Searching
Searching
network error -> Network Error
server error -> Server Error
@abhaysood
abhaysood / medium_rider_redesign_blog_example.kt
Created Mar 18, 2018
A simple component which is created when user clicks the cancel order button in the app. It is responsible for showing a confirmation dialog and actually cancelling the order by making an API call.
View medium_rider_redesign_blog_example.kt
class OrderCancellationComponent(private val context: Context,
private val api: Api,
private val orderNumber: String) {
interface Callbacks {
fun onOrderCancelledSuccessfully()
fun onOrderCancellationFailed()
}
var callbacks: Callbacks? = null // Callbacks for communication with the parent component
@abhaysood
abhaysood / order_cancelation_component.kt
Last active Mar 18, 2018
A simple component which is created when user clicks the cancel order button in the app. It is responsible for showing a confirmation dialog and actually cancelling the order by making an API call.
View order_cancelation_component.kt
class OrderCancellationComponent(private val context: Context,
private val api: Api,
private val orderNumber: String) {
interface Callbacks {
fun onOrderCancelledSuccessfully()
fun onOrderCancellationFailed()
}
var callbacks: Callbacks? = null // Callbacks for communication with the parent component
View example_component_rider_app.kt
class RootComponent(...) {
val locationSelection = LocationSelectionComponent(...)
fun launchLocationSelection() {
// Create the component
locationSelection = LocationSelectionComponent(...)
// Register callbacks
locationSelection.callbacks = object: LocationSelectionComponent.Callbacks() {
@abhaysood
abhaysood / scripts
Created May 16, 2017
Useful Scripts
View scripts
// Add a PREFIX to all file names in a directory
ls | xargs -I {} mv {} PREFIX_{}
@abhaysood
abhaysood / OnMapAndLayoutReady.java
Created Apr 15, 2017
GoogleMaps onReadyCallback + GlobalLayoutListener to avoid `Map size should not be 0`
View OnMapAndLayoutReady.java
import android.util.Log;
import android.view.ViewTreeObserver;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.MapView;
import com.google.android.gms.maps.OnMapReadyCallback;
import rx.Observable;
import rx.Subscriber;
import rx.functions.Func2;
You can’t perform that action at this time.