This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * MIT License | |
| * | |
| * Copyright (c) 2022 Albert Chang | |
| * | |
| * Permission is hereby granted, free of charge, to any person obtaining a copy | |
| * of this software and associated documentation files (the "Software"), to deal | |
| * in the Software without restriction, including without limitation the rights | |
| * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| * copies of the Software, and to permit persons to whom the Software is |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package io.github.darvld.utils | |
| import androidx.compose.animation.* | |
| import androidx.compose.animation.core.ExperimentalTransitionApi | |
| import androidx.compose.animation.core.MutableTransitionState | |
| import androidx.compose.foundation.lazy.LazyListScope | |
| import androidx.compose.foundation.lazy.items | |
| import androidx.compose.runtime.* | |
| import androidx.recyclerview.widget.AsyncListDiffer | |
| import androidx.recyclerview.widget.DiffUtil |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import androidx.compose.material.LocalTextStyle | |
| import androidx.compose.material.Text | |
| import androidx.compose.runtime.* | |
| import androidx.compose.ui.Modifier | |
| import androidx.compose.ui.draw.drawWithContent | |
| import androidx.compose.ui.graphics.Color | |
| import androidx.compose.ui.text.AnnotatedString | |
| import androidx.compose.ui.text.TextStyle | |
| import androidx.compose.ui.text.font.FontFamily | |
| import androidx.compose.ui.text.font.FontStyle |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| enum class ComposableTransitionState { | |
| VISIBLE, ENTERING, EXITING, | |
| } | |
| @Composable | |
| fun <Key, State> ComposableSwitcher( | |
| key: Key, | |
| state: State, | |
| snapOnInitialComposition: Boolean = true, | |
| content: @Composable (Key, State, Transition<ComposableTransitionState>) -> Unit, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.example.myapplication | |
| import androidx.compose.animation.AnimatedVisibility | |
| import androidx.compose.animation.ExperimentalAnimationApi | |
| import androidx.compose.foundation.Box | |
| import androidx.compose.foundation.clickable | |
| import androidx.compose.foundation.layout.Arrangement | |
| import androidx.compose.foundation.layout.Column | |
| import androidx.compose.foundation.layout.Row | |
| import androidx.compose.foundation.layout.Spacer |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import androidx.animation.IntToVectorConverter | |
| import androidx.animation.tween | |
| import androidx.compose.Composable | |
| import androidx.compose.mutableStateOf | |
| import androidx.compose.remember | |
| import androidx.ui.animation.animatedFloat | |
| import androidx.ui.animation.animatedValue | |
| import androidx.ui.core.* | |
| import androidx.ui.core.gesture.scrollorientationlocking.Orientation | |
| import androidx.ui.foundation.animation.FlingConfig |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env node | |
| 'use strict'; | |
| const cheerio = require('cheerio'); | |
| const child_process = require('child_process'); | |
| const fs = require('fs'); | |
| const meow = require('meow'); | |
| const MP4Box = require('mp4box'); | |
| const path = require('path'); | |
| const tmp = require('tmp'); | |
| const groupBy = require('lodash.groupby'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| fun addDecoration() { | |
| recyclerView.addItemDecoration( | |
| StickyHeaderItemDecoration( | |
| epoxyController, | |
| listOf( | |
| TitleBindingModel_().id("title 3").id(), // steal the conversion from the ID constructors to its long value | |
| TitleBindingModel_().id("title 20").id() | |
| ) | |
| ) | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="ISO-8859-1"?> | |
| <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" > | |
| <xsl:template match="/"> | |
| <svg xmlns="http://www.w3.org/2000/svg"> | |
| <xsl:attribute name="width"> | |
| <xsl:value-of select="substring-before(vector/@width, 'dp')"/> | |
| </xsl:attribute> | |
| <xsl:attribute name="height"> | |
| <xsl:value-of select="substring-before(vector/@height, 'dp')"/> | |
| </xsl:attribute> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import android.content.SharedPreferences | |
| import android.os.Bundle | |
| import android.os.Parcel | |
| inline fun <reified T : Enum<T>> Bundle.getEnum(key: String, default: T) = | |
| getInt(key).let { if (it >= 0) enumValues<T>()[it] else default } | |
| fun <T : Enum<T>> Bundle.putEnum(key: String, value: T?) = | |
| putInt(key, value?.ordinal ?: -1) |
NewerOlder