Skip to content

Instantly share code, notes, and snippets.

View StelianMorariu's full-sized avatar

Stelian Morariu StelianMorariu

View GitHub Profile

Keybase proof

I hereby claim:

  • I am stelianmorariu on github.
  • I am stelianmorariu (https://keybase.io/stelianmorariu) on keybase.
  • I have a public key ASCa33kHWJm1r7DG0Mkk-tsisuk0hTd37Icwrw32EwecyAo

To claim this, I am signing this object:

@StelianMorariu
StelianMorariu / Compose-PhotoGrid.kt
Created October 12, 2023 10:20 — forked from JolandaVerhoef/Compose-PhotoGrid.kt
Photogrid with multi-select and zoomable images
/*
* Copyright 2023 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@StelianMorariu
StelianMorariu / MainActivity.kt
Created February 14, 2023 11:37 — forked from tkuenneth/MainActivity.kt
How to display an adaptive icon in Jetpack Compose
package com.thomaskuenneth.sandbox
import android.graphics.Bitmap
import android.graphics.Canvas
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.compose.foundation.Image
import androidx.compose.foundation.layout.*
import androidx.compose.material.MaterialTheme
@StelianMorariu
StelianMorariu / HomeActivity.kt
Created July 18, 2019 09:48
Apply window insets
class HomeActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
// override the default transitions because we create the circular reveal manually
overridePendingTransition(R.anim.anim_no_translate, R.anim.anim_no_translate)
setContentView(R.layout.activity_home)
@StelianMorariu
StelianMorariu / Activity.kt
Created March 30, 2019 10:31
Change MotionScene
motionLayout.setTransitionListener(object:MotionLayout.TransitionListener{
override fun onTransitionTrigger(p0: MotionLayout?, p1: Int, p2: Boolean, p3: Float) {
}
override fun onTransitionStarted(p0: MotionLayout?, p1: Int, p2: Int) {
}
override fun onTransitionChange(p0: MotionLayout?, p1: Int, p2: Int, progress: Float) {
}
@StelianMorariu
StelianMorariu / TestActivity.kt
Last active October 14, 2023 10:04
Rudimentary MotionLayout collapsible toolbar
/*
* Copyright © 2019 Stelian Morariu. All rights reserved.
*/
package com.stelianmorariu.antrics
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
class TestActivity : AppCompatActivity() {
@StelianMorariu
StelianMorariu / aligning-images.md
Created March 5, 2019 15:36
Guide to aligning images in github readme.md files

Aligning images

left alignment

This is the code you need to align images to the left:

<img align="left" width="100" height="100" src="http://www.fillmurray.com/100/100">
@StelianMorariu
StelianMorariu / Bitrise-Download specific NDK
Created March 5, 2019 15:36
Bitrise-Download specific NDK
#!/usr/bin/env bash
set -ex
# --------------------------------------------------------------
#
# ANDROID_NDK_VERSION and ANDROID_NDK_HOME are specified in
# -preflight but can also be updated directly in the script
#
# -------------------------------------------------------------
@StelianMorariu
StelianMorariu / GIF-Screencast-OSX.md
Created September 25, 2016 18:48 — forked from dergachev/GIF-Screencast-OSX.md
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

import android.content.Context;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;
import android.security.KeyPairGeneratorSpec;
import android.text.TextUtils;
import android.util.Base64;
import android.util.Log;
import java.io.ByteArrayInputStream;