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.content.Context | |
import android.graphics.Canvas | |
import android.util.AttributeSet | |
import android.view.MotionEvent | |
import android.view.View | |
import android.view.ViewGroup | |
import android.widget.ScrollView | |
import kotlin.math.min | |
class StickyScrollView @JvmOverloads constructor( |
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
@file:JvmName("KeyBoardExt") | |
import android.app.Activity | |
import android.content.Context | |
import android.view.View | |
import android.view.inputmethod.InputMethodManager | |
import androidx.appcompat.app.AppCompatActivity | |
import androidx.fragment.app.Fragment | |
fun Fragment.hideKeyboard() { |
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
[ | |
{ | |
"alpha2Code": "AF", | |
"alpha3Code": "AFG", | |
"altSpellings": [ | |
"AF", | |
"Af\u0121\u0101nist\u0101n" | |
], | |
"area": 652230, | |
"borders": [ |
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
[ | |
{ | |
"alpha2Code": "AF", | |
"alpha3Code": "AFG", | |
"altSpellings": [ | |
"AF", | |
"Af\u0121\u0101nist\u0101n" | |
], | |
"area": 652230, | |
"borders": [ |
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
package com.redplanet.tune.ui.decorations | |
import android.graphics.Rect | |
import android.support.annotation.Px | |
import android.support.v7.widget.GridLayoutManager | |
import android.support.v7.widget.RecyclerView | |
import android.view.View | |
class GridOffsetItemDecoration(@param:Px private val spacing: Int, | |
private val shouldIncludeEdge: Boolean) : RecyclerView.ItemDecoration() { |
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
object GoogleApiAvailabilityHelper { | |
private const val REQUEST_CODE_GOOGLE_AVAILABILITY = 999 | |
fun checkAvailability(activity: Activity): Boolean { | |
val googleApiAvailability = GoogleApiAvailability.getInstance() | |
val statusCode = googleApiAvailability.isGooglePlayServicesAvailable(activity) | |
val isResultSuccess = statusCode == ConnectionResult.SUCCESS |
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 LocationRequestHelper(private val context: Context, | |
private val locationRequest: LocationRequest, | |
lifecycle: Lifecycle, | |
private val onResult: (LocationResult) -> Unit) : LifecycleObserver { | |
private val locationClient by lazy { FusedLocationProviderClient(context) } | |
private val settingsClient by lazy { LocationServices.getSettingsClient(context) } | |
private val locationSettingRequest by lazy { | |
LocationSettingsRequest.Builder() |
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.annotation.SuppressLint | |
import android.app.Activity | |
import android.app.AlertDialog | |
import android.content.Context | |
import android.support.annotation.StringRes | |
import android.support.v4.app.Fragment | |
import android.view.LayoutInflater | |
import android.view.View | |
import android.widget.Button | |
import android.widget.TextView |
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 | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
NewerOlder