This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @return [LiveData] with value produced from combining [source1] and [source2] using [combiner] | |
* | |
* This function produces new value only if [source1] and [source2] values are not null | |
*/ | |
fun <T1, T2, R> combineNonNull( | |
source1: LiveData<T1>, | |
source2: LiveData<T2>, | |
combiner: (T1, T2) -> R |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.net.Uri | |
import app.choco.tracking.logger.Logger | |
import com.jakewharton.disklrucache.DiskLruCache | |
import com.squareup.picasso.Downloader | |
import java.io.File | |
import java.io.IOException | |
import java.io.InputStream | |
import java.net.HttpURLConnection | |
import java.net.URL | |
import java.util.Locale |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* 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 | |
* | |
* https://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MarginItemDecoration( | |
private val left: Int? = null, | |
private val top: Int? = null, | |
private val right: Int? = null, | |
private val bottom: Int? = null | |
) : RecyclerView.ItemDecoration() { | |
override fun getItemOffsets( | |
outRect: Rect, | |
view: View, | |
parent: RecyclerView, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
android { | |
defaultConfig { | |
//.. | |
versionCode computeVersionCode() | |
versionName computeVersionName() | |
//.. | |
} | |
ext { | |
versionMajor = 1 | |
versionMinor = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SwipeRevealLayout extends ViewGroup { | |
// These states are used only for ViewBindHelper | |
protected static final int STATE_CLOSE = 0; | |
protected static final int STATE_CLOSING = 1; | |
protected static final int STATE_OPEN = 2; | |
protected static final int STATE_OPENING = 3; | |
protected static final int STATE_DRAGGING = 4; | |
private static final int DEFAULT_MIN_FLING_VELOCITY = 300; // dp per second | |
private static final int DEFAULT_MIN_DIST_REQUEST_DISALLOW_PARENT = 1; // dp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.Manifest; | |
import android.app.Activity; | |
import android.content.Intent; | |
import android.content.pm.PackageManager; | |
import android.graphics.Point; | |
import android.net.Uri; | |
import android.os.Build; | |
import android.os.Bundle; | |
import android.support.annotation.NonNull; |