Skip to content

Instantly share code, notes, and snippets.

View dtunctuncer's full-sized avatar
💦
psst

dtunctuncer

💦
psst
  • Amsterdam
View GitHub Profile
@dtunctuncer
dtunctuncer / build.gradle
Created January 31, 2020 12:30 — forked from StephaneBg/build.gradle
Set different signing configs with multiple flavors and dimensions
signingConfigs {
vanillaPaid {
...
}
vanillaFree {
...
}
chocolatePaid {
...
}
@dtunctuncer
dtunctuncer / BroadcastReceiver.kt
Created May 24, 2019 14:15 — forked from afollestad/BroadcastReceiver.kt
A Lifecycle components aware BroadcastReceiver DSL (Kotlin)
import android.content.Context
import android.content.Intent
import android.content.IntentFilter
import androidx.lifecycle.Lifecycle.Event.ON_DESTROY
import androidx.lifecycle.Lifecycle.Event.ON_START
import androidx.lifecycle.LifecycleObserver
import androidx.lifecycle.LifecycleOwner
import androidx.lifecycle.OnLifecycleEvent
import android.content.BroadcastReceiver as StockReceiver
@dtunctuncer
dtunctuncer / timberm.kt
Last active May 21, 2019 13:30
//Logging methods and parameters with Timber via Live Template
//Logging methods and parameters with Timber via Live Template
Abbreviation:
timberm
Context:
Kotlin: statement
Template text:
timber.log.Timber.d($CONTENT$)
@dtunctuncer
dtunctuncer / EqualSpacingItemDecoration.java
Created March 6, 2019 15:12 — forked from alexfu/EqualSpacingItemDecoration.java
Add equal spacing to RecyclerView items automatically. Can handle horizontal, vertical, and grid display modes
import android.graphics.Rect;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
public class EqualSpacingItemDecoration extends RecyclerView.ItemDecoration {
private final int spacing;
private int displayMode;
public static final int HORIZONTAL = 0;
@dtunctuncer
dtunctuncer / CoroutineLifecycleObserver.kt
Created October 9, 2018 14:20 — forked from chrisbanes/CoroutineLifecycleObserver.kt
LifecycleObserver which allows easy cancelling of coroutines
/*
* Copyright 2018 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software