Skip to content

Instantly share code, notes, and snippets.

@Rahkeen
Rahkeen / ContainerTransformWeirdness.kt
Created April 13, 2024 14:57
Some weird stuff going on.
@Preview
@Composable
fun ContainerTransformWeirdness() {
var scene by remember { mutableStateOf(Scene.Grid) }
SharedTransitionLayout(modifier = Modifier.fillMaxSize()) {
AnimatedContent(
targetState = scene,
transitionSpec = {
fadeIn() togetherWith fadeOut()
@Rahkeen
Rahkeen / ContainerTransformWeirdness.kt
Created April 12, 2024 19:00
Simplified Container Transform Example
enum class Scene {
Grid,
Closeup;
fun toggle() = if (this == Grid) Closeup else Grid
}
@Preview
@Composable
fun ContainerTransformWeirdness() {
@Rahkeen
Rahkeen / ContainerTransformExample.kt
Created April 11, 2024 05:22
A really simple grid-to-full-screen transition using Shared Elements
enum class Scene {
Grid,
Closeup;
fun toggle() = if (this == Grid) Closeup else Grid
}
data class ColorItemState(
val id: Int,
val color: Color,
@Rahkeen
Rahkeen / MainActivity.kt
Created April 22, 2022 01:33
Fidget Card that rotates based on drag gestures
package co.rikin.fidget
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.compose.foundation.background
import androidx.compose.foundation.gestures.detectTransformGestures
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.BoxScope
@Rahkeen
Rahkeen / HydroWidget.kt
Created June 29, 2020 23:55
Simple Display Widget that Launches Activity
package me.rikinmarfatia.hydrohomie
import android.app.PendingIntent
import android.appwidget.AppWidgetManager
import android.appwidget.AppWidgetProvider
import android.content.ComponentName
import android.content.Context
import android.content.Intent
import android.util.Log
import android.widget.RemoteViews
@Rahkeen
Rahkeen / appcompat-spike.md
Last active August 7, 2017 22:10
AppCompat Spike

Screens + Flows Looked At

  • Account Settings
  • Profile / Performance
  • Featured
  • Class Library
  • Live Schedule
  • Scenic
  • In Class
  • Login / Activation / Registration

Side Effects / UX Defects

@Rahkeen
Rahkeen / introrx.md
Created July 21, 2016 20:57 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
public class NoConsecutiveRepeatCharacters {
public static void main(String[] args) {
String input = "aaaaaabbbbcc";
//Sort the characters with highest freq. to the top
PriorityQueue<CharacterFrequencyNode> maxheap = new PriorityQueue<CharacterFrequencyNode>(new Comparator<CharacterFrequencyNode>() {
@Override
public int compare(CharacterFrequencyNode o1, CharacterFrequencyNode o2) {
if(o1.frequency > o2.frequency){
@Rahkeen
Rahkeen / The Technical Interview Cheat Sheet.md
Last active August 26, 2015 00:45 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.