Skip to content

Instantly share code, notes, and snippets.

View Crysis21's full-sized avatar
🎃
Focusing

Cristian Holdunu Crysis21

🎃
Focusing
View GitHub Profile
package com.example.jetpackcomposeplayground
import android.content.Context
import android.graphics.Bitmap
import android.graphics.Picture
import android.net.Uri
import android.os.Environment
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding
@fvilarino
fvilarino / animiated_drawer_final.kt
Created November 24, 2022 22:56
Animated Drawer - Final
@Stable
interface AnimatedDrawerState {
var density: Float
val drawerWidth: Dp
val drawerTranslationX: Float
val drawerElevation: Float
val backgroundTranslationX: Float
val backgroundAlpha: Float
@breeno
breeno / CompositionalTwoColumnWaterfall.swift
Last active October 31, 2022 12:57
Simple take on a compositional layout with 2 column variable height items waterfall
import UIKit
class ViewController: UIViewController {
enum Section {
case main
}
struct Item: Hashable {
let height: CGFloat
@lopspower
lopspower / KeyboardUtils.java
Last active July 6, 2023 13:35
Force Hide Keyboard Android
import android.app.Activity;
import android.content.Context;
import android.graphics.Rect;
import android.view.View;
import android.view.inputmethod.InputMethodManager;
public class KeyboardUtils {
public static void hideKeyboard(Activity activity) {
View view = activity.findViewById(android.R.id.content);
@artem-zinnatullin
artem-zinnatullin / MyApp.java
Last active January 15, 2023 13:04
If you need to set one font for all TextViews in android application you can use this solution. It will override ALL TextView's typefaces, includes action bar and other standard components, but EditText's password font won't be overriden.
public class MyApp extends Application {
@Override
public void onCreate() {
TypefaceUtil.overrideFont(getApplicationContext(), "SERIF", "fonts/Roboto-Regular.ttf"); // font from assets: "assets/fonts/Roboto-Regular.ttf
}
}
@rdallman
rdallman / build.gradle
Created November 5, 2013 06:39
Android Gradle sign and increment version for release
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.6.+'
}
}