symbol | name |
---|---|
⌘ | command |
⌥ | option |
⌃ | control |
⇧ | shift |
⇥ | tab |
↩︎ | return |
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
#if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME}#end | |
import android.view.LayoutInflater | |
import android.view.View | |
import android.view.ViewGroup | |
import androidx.recyclerview.widget.DiffUtil | |
import androidx.recyclerview.widget.ListAdapter | |
import androidx.recyclerview.widget.RecyclerView | |
#parse("File Header.java") |
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 kotlinx.coroutines.* | |
import kotlin.coroutines.CoroutineContext | |
abstract class UseCase<T, Params : Any> { | |
private lateinit var parentJob: Job | |
private lateinit var params: Params | |
private var isAttachedToLifecycle = false | |
private val backgroundContext: CoroutineContext = Dispatchers.IO | |
private val foregroundContext: CoroutineContext = Dispatchers.Main |
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.example.app | |
import android.content.Context | |
import android.content.res.TypedArray | |
import android.util.AttributeSet | |
import android.widget.SeekBar | |
import android.widget.TextView | |
import androidx.preference.Preference | |
import androidx.preference.PreferenceViewHolder |
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.app.Application | |
import android.arch.lifecycle.LiveData | |
import android.content.Context | |
import android.net.ConnectivityManager | |
import android.net.Network | |
import android.net.NetworkInfo | |
import android.net.NetworkRequest | |
import android.os.Build | |
import android.support.annotation.RequiresPermission | |
import android.support.annotation.VisibleForTesting |
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
/** | |
* Use as `"#fff".parseColor()` | |
*/ | |
fun String.parseColor() = Color.parseColor(this) | |
/** | |
* Use as `16.spToPx(context)` or `16.5.spToPx(context)` | |
*/ | |
fun Number.spToPx(context: Context) = TypedValue.applyDimension( | |
TypedValue.COMPLEX_UNIT_SP, this.toFloat(), context.resources.displayMetrics).toInt() |
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 java.net.MalformedURLException; | |
import java.net.URL; | |
public class HttpUtils { | |
public static void main(String[] args) throws MalformedURLException { | |
String urlString = "https://www.google.com///images//branding/1234567890/..\\googlelogo/abcdefg/../1x/googlelogo_color_272x92dp.png"; | |
System.out.println(absUrl(urlString)); |
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.pascalwelsch.extensions | |
import android.app.Activity | |
import android.content.Context | |
import android.content.Intent | |
import android.os.Build | |
import android.os.Bundle | |
/** | |
* Extensions for simpler launching of Activities |
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.example.sampleapp; | |
import java.util.ArrayList; | |
import java.util.HashMap; | |
import android.app.ListActivity; | |
import android.os.Bundle; | |
import android.widget.SimpleAdapter; | |
public class MoreScreen extends ListActivity { |
NewerOlder