Skip to content

Instantly share code, notes, and snippets.

View yektasarioglu's full-sized avatar
🤓
Working on some interesting stuff

Yekta Sarioglu yektasarioglu

🤓
Working on some interesting stuff
View GitHub Profile
@dellisd
dellisd / Test.kt
Created June 9, 2022 16:37
Explicit Backing Fields
class Test {
val names: List<String>
field: MutableList<String> = mutableListOf<String>()
fun doThing() {
names.add("Hello!")
}
}
fun main() {
package com.theozgurr.apparchitecture.ui.register
import androidx.compose.animation.ExperimentalAnimationApi
import androidx.compose.ui.ExperimentalComposeUiApi
import androidx.compose.ui.test.assertIsDisplayed
import androidx.compose.ui.test.junit4.createAndroidComposeRule
import androidx.compose.ui.test.onNodeWithTag
import androidx.compose.ui.test.onNodeWithText
import androidx.compose.ui.test.onRoot
import androidx.navigation.NavHostController
@CameronProbert
CameronProbert / Process.kt
Created October 20, 2021 20:12
Using environment variables in Kotlin/JS + Gradle
/* <rootdir>/src/.../Process.kt */
package js
/**
* Wrapper for the Javascript `process` object.
*/
public external val process: Process
public external interface Process {
@rintoandrews90
rintoandrews90 / xcframework_generate.md
Created December 25, 2020 07:05 — forked from lalkrishna/xcframework_generate.md
Create xcframework instead of Universal(fat) frameworks.

Advantages of xcframework

  • Support for multiple platforms in the same framework.
  • Support for Swift, Objective-C and C.
  • Support for dynamic frameworks and static libraries.
  • Support for Swift Package Manager.
  • End of fat binaries.

Steps to create Aggregate target:

  1. Open Current framework project
@cedrickring
cedrickring / ColoredShadow.kt
Last active September 5, 2024 21:56
Draw a colored shadow in Android Jetpack Compose
/*
Copyright 2020 Cedric Kring.
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
distributed under the License is distributed on an "AS IS" BASIS,
@NonNull
public static Fragment instantiate(@NonNull Context context, @NonNull String fname, @Nullable Bundle args) {
try {
...
Fragment f = clazz.getConstructor().newInstance();
if (args != null) {
args.setClassLoader(...);
f.setArguments(args);
}
return f;
@f3401pal
f3401pal / app\build.gradle.kts
Last active November 15, 2024 08:59
Multi-module Android project with Kotlin DSL for Gradle
plugins {
`android-base-app`
`android-base`
id("io.fabric")
}
android {
defaultConfig {
versionCode = 20
versionName = "1.6.3"
@juliuscanute
juliuscanute / CustomScope.kt
Created December 2, 2019 19:53
[Custom Coroutine Scope] #kotlin #coroutine
class CustomScope : CoroutineScope {
private var parentJob = Job()
override val coroutineContext: CoroutineContext
get() = Dispatchers.Main + parentJob
fun onStart() {
parentJob = Job()
}
@s0nerik
s0nerik / app.gradle.kts
Last active May 16, 2023 14:46
Android multi-module Gradle setup example
plugins {
id("com.android.application")
}
android {
defaultConfig {
applicationId = "com.example.task"
versionCode = 1
versionName = "1.0"
}
@delacrixmorgan
delacrixmorgan / CubeTransformer.md
Last active November 21, 2021 09:45
Cube ViewPager Transformer

Cube ViewPager Transformer

class CubeTransformer : ViewPager.PageTransformer {
    override fun transformPage(view: View, position: Float) {
        val deltaY = 0.5F

        view.pivotX = if (position < 0F) view.width.toFloat() else 0F
        view.pivotY = view.height * deltaY
 view.rotationY = 45F * position