This file contains hidden or 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 yourpackage | |
import android.annotation.SuppressLint | |
import android.app.Activity | |
import android.app.Application | |
import android.content.Context | |
import android.content.SharedPreferences | |
import android.content.pm.PackageManager | |
import android.content.res.Configuration | |
import android.content.res.Resources |
This file contains hidden or 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 yourpackage | |
import android.content.Context | |
import android.os.Build | |
import android.util.AttributeSet | |
import android.view.View | |
import androidx.cardview.widget.CardView | |
import yourpackage.R | |
/** |
This file contains hidden or 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.Application | |
import android.content.ComponentCallbacks | |
import android.content.Context | |
import android.content.ContextWrapper | |
import android.content.res.Configuration | |
import android.content.res.Resources | |
import android.os.Build | |
import android.os.LocaleList | |
import androidx.core.os.ConfigurationCompat |
This file contains hidden or 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
using System; | |
// From the Kotlin standard library | |
public class XorWowRandom | |
{ | |
private int x, y, z, w, v, addend; | |
private XorWowRandom() { } | |
public static XorWowRandom FromSeed(int seed) |
This file contains hidden or 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
function Get-PrimeNumber([ulong] $position) { | |
return [System.UInt128] ("prime($position)" | gp.exe -q) | |
} | |
This file contains hidden or 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.Color | |
import android.util.AttributeSet | |
import android.view.ViewGroup | |
import androidx.annotation.ColorInt | |
import androidx.annotation.ColorRes | |
import androidx.annotation.DimenRes | |
import androidx.annotation.Dimension | |
import androidx.annotation.Px | |
import androidx.core.content.ContextCompat |
This file contains hidden or 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 kotlinx.coroutines.flow.* | |
import kotlinx.coroutines.sync.* | |
interface AsyncResource<out T> { | |
sealed interface State<out T> { | |
data object NotStarted : State<Nothing> | |
data class Loading<out T>(val currentResource: Completed<T>?) : State<T> | |
sealed interface Completed<out T> : State<T> { |
This file contains hidden or 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.view.View | |
import android.widget.ScrollView | |
fun ScrollView.smoothScrollToViewBottom(view: View) { | |
val scrollViewHeight = height | |
val outViewPosition = IntArray(2) | |
view.getLocationOnScreen(outViewPosition) | |
val viewY = outViewPosition[1] |
This file contains hidden or 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.Activity | |
import android.view.LayoutInflater | |
import android.view.View | |
import android.view.ViewGroup | |
import androidx.fragment.app.DialogFragment | |
import androidx.fragment.app.Fragment | |
import androidx.lifecycle.DefaultLifecycleObserver | |
import androidx.lifecycle.Lifecycle | |
import androidx.lifecycle.LifecycleOwner | |
import androidx.lifecycle.Observer |
This file contains hidden or 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 { | |
namespace = "" | |
compileSdk = 34 | |
defaultConfig { | |
applicationId = "" | |
minSdk = 21 | |
targetSdk = 34 | |
versionCode = 1 | |
versionName = "1.0" |
NewerOlder