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.database.Cursor; | |
import android.support.annotation.Nullable; | |
import android.support.v7.util.DiffUtil; | |
/** | |
* Created by Nikola on 9/29/2016. | |
*/ | |
public abstract class CursorCallback<C extends Cursor> extends DiffUtil.Callback { | |
private final C newCursor; |
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.content.ContentResolver | |
import android.database.Cursor | |
import android.net.Uri | |
/** | |
* @see ContentResolver.query | |
*/ | |
@SuppressLint("Recycle") | |
@Suppress("NOTHING_TO_INLINE") |
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 sys | |
import re | |
import dns.resolver # Requires dnspython | |
email_host_regex = re.compile(".*@(.*)$") | |
gmail_servers_regex = re.compile("(.google.com.|.googlemail.com.)$", re.IGNORECASE) | |
def is_gmail(email): | |
""" Returns True if the supplied Email address is a @gmail.com Email or is a Google Apps for your domain - hosted Gmail address | |
Checks are performed by checking the DNS MX records """ |
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.my.app | |
import android.app.PendingIntent | |
import android.content.BroadcastReceiver | |
import android.content.Context | |
import android.content.Intent | |
import android.content.IntentFilter | |
import android.hardware.usb.UsbDevice | |
import android.hardware.usb.UsbManager | |
import kotlinx.coroutines.experimental.CompletableDeferred |
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 com.google.android.gms.gcm.GcmTaskService | |
import com.google.android.gms.gcm.TaskParams | |
import com.example.androidapp.jobs.Jobs | |
import com.example.androidapp.jobs.tagsOfScheduledJobs | |
import timber.log.Timber | |
/** | |
* See [this issue](https://github.com/firebase/firebase-jobdispatcher-android/issues/6). | |
*/ | |
class JobDispatcherReschedulerWorkaroundService : GcmTaskService() { |
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.text.Editable | |
import android.widget.EditText | |
import splitties.collections.forEachByIndex | |
import android.text.TextWatcher as AndroidTextWatcher | |
interface TextWatcher : AndroidTextWatcher { | |
override fun afterTextChanged(s: Editable) = Unit | |
override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) = Unit | |
override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) = Unit | |
} |
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
@Suppress("NOTHING_TO_INLINE") | |
inline operator fun <E> ConflatedBroadcastChannel<E>.getValue( | |
thisRef: Any?, | |
prop: KProperty<*> | |
): E = value | |
@Suppress("NOTHING_TO_INLINE") | |
inline operator fun <E> ConflatedBroadcastChannel<E>.setValue( | |
thisRef: Any?, | |
prop: KProperty<*>, |
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.TargetApi; | |
import android.content.Context; | |
import android.content.res.TypedArray; | |
import android.graphics.Canvas; | |
import android.graphics.drawable.Drawable; | |
import android.os.Build; | |
import android.util.AttributeSet; | |
import android.widget.RelativeLayout; |
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
val <T> T.` `: T get() = this | |
val <T> T.` `: T get() = this | |
val <T> T.` `: T get() = this | |
val <T> T.` `: T get() = this | |
val <T> T.` `: T get() = this | |
val <T> T.` `: T get() = this | |
val <T> T.` `: T get() = this | |
val <T> T.` `: T get() = this | |
val <T> T.` `: T get() = this | |
val <T> T.` `: T get() = this |
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 (c) 2017. Louis Cognault Ayeva Derman | |
* | |
* 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 |