Skip to content

Instantly share code, notes, and snippets.

View anangkur's full-sized avatar
🏠
Working from home

Anang Kurniawan anangkur

🏠
Working from home
View GitHub Profile
@Composable
fun LazyList() {
LazyColumn {
items(5) {
Item()
}
}
}
@anangkur
anangkur / RoomDao.kt
Last active September 30, 2022 10:16
@Entity
data class Entity(
@PrimaryKey
val id: Int,
val attributes: String,
)
@Entity
data class Entity2(
@PrimaryKey
@anangkur
anangkur / RoomDao.kt
Last active September 30, 2022 10:13
@Entity
data class Entity(
@PrimaryKey
val id: Int,
val attributes: String,
)
@Entity
data class Entity2(
@PrimaryKey
@Dao
interface RoomDao {
@Query("select * from table")
suspend fun getAllData(): PagingSource<Int, Entity>
}
@anangkur
anangkur / RoomDao.kt
Last active September 30, 2022 07:32
@Dao
interface RoomDao {
@Insert
suspend fun insertData(entity: Entity)
@Query("select * from table")
suspend fun getAllData(): List<Entity>
}
package com.anangkur.karumishotplayground
import android.util.Log
import com.karumi.shot.ScreenshotTest
import org.junit.Rule
import org.junit.Test
import androidx.test.ext.junit.rules.activityScenarioRule
class MainActivityScreenTest : ScreenshotTest {
@get:Rule
import { DeviceDecorator } from "@storybook/native-addon";
export const decorators = [DeviceDecorator];
module.exports = {
stories: ["../stories/*.stories.jsx", "../stories/*.stories.playground.jsx"],
addons: [
"@storybook/addon-docs",
"@storybook/addon-controls",
"@storybook/native-addon/dist/register.js"
]
};
const { generateStories } = require("@storybook/native");
const { pascalCase } = require("change-case");
const components = [
{
name: "button",
},
];
const promises = components.map(async (component) => {
class MainActivity : AppCompatActivity() {
companion object {
const val QUERY_COMPONENT = "component"
const val COMPONENT_BUTTON = "button"
}
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)