Build "Sources for Android 29" so you can comfortably browse the Android API source in Android Studio.
- Collect source files
mkdir android-sdk-source-build
cd android-sdk-source-build
mkdir -p frameworks/base
Build "Sources for Android 29" so you can comfortably browse the Android API source in Android Studio.
mkdir android-sdk-source-build
cd android-sdk-source-build
mkdir -p frameworks/base
/** | |
* map.animateCamera(CameraUpdateFactory.newLatLngBounds()) will lose ignore current bearing and rotate the camera | |
*/ | |
fun GoogleMap.animateToBounds(bounds: LatLngBounds, width: Int, height: Int) = animateCamera(boundsToCameraUpdate(bounds, width, height)) | |
/** | |
* map.moveCamera(CameraUpdateFactory.newLatLngBounds()) will lose ignore current bearing and rotate the camera | |
*/ | |
fun GoogleMap.moveCameraToBounds(bounds: LatLngBounds, width: Int, height: Int) = moveCamera(boundsToCameraUpdate(bounds, width, height)) |
import android.content.Context | |
import android.graphics.Canvas | |
import android.graphics.Paint | |
import android.graphics.Path | |
import android.util.AttributeSet | |
import android.view.View | |
import kotlin.math.atan2 | |
import kotlin.math.cos | |
import kotlin.math.sin | |
import kotlin.math.sqrt |
import com.google.common.truth.Truth.assertThat | |
import org.junit.Test | |
inline fun <T> guard(receiver: T?, block: () -> Nothing): T { | |
if (receiver == null) { | |
block() | |
} | |
return receiver | |
} |
{ | |
// Rough modified version of Celeste to darken it up | |
"name": "Celeste Dark", | |
"author": "Sublime HQ Pty Ltd", | |
"variables": | |
{ | |
// These colors are part of the hashed range | |
// and should only be used in non-source | |
"purple": "hsla(260, 50%, 70%, 1)", | |
"blue": "hsla(200, 70%, 55%, 1)", |
import android.arch.lifecycle.ViewModel | |
import android.arch.lifecycle.ViewModelProvider | |
import android.arch.lifecycle.ViewModelStore | |
import android.arch.lifecycle.ViewModelStores | |
import android.support.v4.app.Fragment | |
import android.support.v4.app.FragmentActivity | |
import java.util.concurrent.atomic.AtomicBoolean | |
/** | |
* Created by Nikola on 7/19/2017. |
fun View.visible() { | |
visibility = View.VISIBLE | |
} | |
fun View.invisible() { | |
visibility = View.INVISIBLE | |
} | |
fun View.gone() { | |
visibility = View.GONE |
package com.xwray.vectorbinding; | |
import android.databinding.BindingAdapter; | |
import android.databinding.DataBindingUtil; | |
import android.graphics.drawable.Drawable; | |
import android.os.Bundle; | |
import android.support.graphics.drawable.VectorDrawableCompat; | |
import android.support.v7.app.AppCompatActivity; | |
import android.widget.TextView; |
import android.support.annotation.IntDef | |
import kotlin.annotation.AnnotationRetention | |
class MyClass { | |
companion object { | |
const val ITEM_SERVICES = 0L | |
const val ITEM_PORTFOLIO = 1L | |
} | |
package android.support.design.widget; | |
import android.content.Context; | |
import android.support.annotation.NonNull; | |
import android.support.annotation.Nullable; | |
import android.support.v4.view.NestedScrollingChildHelper; | |
import android.util.AttributeSet; | |
import android.view.View; | |
/** |