Skip to content

Instantly share code, notes, and snippets.

@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 27, 2023 08:53
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 February 12, 2024 17:18
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
@dlew
dlew / themes-debug.xml
Last active March 1, 2024 15:46
With the new theming in AppCompat, a lot of assets are tinted automatically for you via theme attributes. That has often led me to wonder "where the hell did this color come from?" You can replace your normal theme with this debug theme to help figure out the source of that color.
<!-- You can change the parent around to whatever you normally use -->
<style name="DebugColors" parent="Theme.AppCompat">
<!-- System colors -->
<item name="android:windowBackground">@color/__debugWindowBackground</item>
<item name="android:colorPressedHighlight">#FF4400</item>
<item name="android:colorLongPressedHighlight">#FF0044</item>
<item name="android:colorFocusedHighlight">#44FF00</item>
<item name="android:colorActivatedHighlight">#00FF44</item>