Skip to content

Instantly share code, notes, and snippets.

View curioustechizen's full-sized avatar

Kiran Rao curioustechizen

View GitHub Profile
//region model
sealed interface NotesUiModel : UiModel {
object Loading : NotesUiModel
data class Data(
val notes: List<Note>,
val events: EventHandler<Event>
) : NotesUiModel {
data class Note(
@adityabhaskar
adityabhaskar / dependencyGraph-mermaid.gradle
Last active May 17, 2023 17:32
Dependency graphs in a multi module project, in mermaid format for automatic rendering on Github
class GraphDetails {
LinkedHashSet<Project> projects
LinkedHashMap<Tuple2<Project, Project>, List<String>> dependencies
ArrayList<Project> multiplatformProjects
ArrayList<Project> androidProjects
ArrayList<Project> javaProjects
ArrayList<Project> rootProjects
// Used for excluding module from graph
public static final SystemTestName = "system-test"
@bagus2x
bagus2x / ExoPlayerState.kt
Created March 19, 2023 06:46
Observe exoplayer state / Player.Listener in jetpack compose
class ExoPlayerState(
context: Context,
private val scope: CoroutineScope
) : ExoPlayer by ExoPlayer.Builder(context).build(), Player.Listener {
@get:JvmName("playing")
var isPlaying by mutableStateOf(false)
private set
var duration by mutableStateOf(0.seconds)
private set
var currentPosition by mutableStateOf(0.seconds)
@andkulikov
andkulikov / LazyTimeGraph.kt
Last active July 13, 2024 01:04
Code from the "Thinking outside the Box: Custom Compose layouts" Droidcon London 2022 talk https://www.droidcon.com/2022/11/16/thinking-outside-the-box-custom-compose-layouts/
import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.foundation.clipScrollableContainer
import androidx.compose.foundation.gestures.Orientation
import androidx.compose.foundation.gestures.ScrollableState
import androidx.compose.foundation.gestures.scrollable
import androidx.compose.foundation.lazy.layout.LazyLayout
import androidx.compose.foundation.lazy.layout.LazyLayoutItemProvider
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import 'dart:ui' as ui;
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:path_drawing/path_drawing.dart';
class WorldMap extends StatelessWidget {
final notifier = ValueNotifier(Offset.zero);
@override
@nisrulz
nisrulz / androidDevAliases.sh
Created April 15, 2018 12:18
All of my android development aliases.
# I use ZSH, here is what I added to my .zshrc file (config file)
# at ~/.zshrc
# ------------------ Android ------------------ #
# Have the adb accessible, by including it in the PATH
export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:path/to/android_sdk/platform-tools/"
# Setup your Android SDK path in ANDROID_HOME variable
export ANDROID_HOME=~/sdks/android_sdk
@StefMa
StefMa / README.md
Created July 8, 2015 11:04
TextInputLayoutWrapperView

TextInputLayoutWrapperView


What is it?

This is a simple wrapper View for the new TextInputLayout from Design Library.


Why?

Normaly you use the TextInputLayout like this

@imjasonh
imjasonh / markdown.css
Last active January 3, 2025 20:15
Render Markdown as unrendered Markdown (see http://jsbin.com/huwosomawo)
* {
font-size: 12pt;
font-family: monospace;
font-weight: normal;
font-style: normal;
text-decoration: none;
color: black;
cursor: default;
}
@JakeWharton
JakeWharton / README.md
Last active April 17, 2023 14:07
A JUnit @rule which launches an activity when your test starts. Stop extending gross ActivityInstrumentationBarfCase2!
@stefanhoth
stefanhoth / jack.bat
Last active August 29, 2015 14:11
Jack & Jill command line helpers. Put them in a directory in your PATH, e.g. <android-sdk>/. Use .bat files for Windows, .sh for Mac/Linux. More info in the documentation: http://tools.android.com/tech-docs/jackandjill
@ECHO OFF
@REM Jack is only available from build tools version 21.1.0 and up. Install/Update via SDK Manager
SET BUILD_TOOLS_VERSION=21.1.2
java -jar %ANDROID_HOME%/build-tools/%BUILD_TOOLS_VERSION%/jack.jar %1 %2 %3 %4 %5 %6 %7 %8 %9