Skip to content

Instantly share code, notes, and snippets.

View filipebatista's full-sized avatar
🚀

Filipe Baptista filipebatista

🚀
View GitHub Profile
@halilozercan
halilozercan / TypingAnimation.kt
Last active November 13, 2024 12:04
TextField Typing Animation
package com.example.textfieldtypinganimation
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.activity.enableEdgeToEdge
import androidx.compose.animation.core.Animatable
import androidx.compose.animation.core.AnimationVector1D
import androidx.compose.animation.core.Spring
import androidx.compose.animation.core.spring
@tkuenneth
tkuenneth / MainActivity.kt
Last active November 12, 2024 02:08
Jetpack Compose LazyColumn with animated header
package de.thomaskuenneth.animatedheaderdemo
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.compose.animation.AnimatedVisibility
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
@manuelvicnt
manuelvicnt / RequestLocationPermissionsSample.kt
Created January 27, 2022 12:14
Location permissions in Compose code
// In the Manifest file:
// <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
// <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
class RequestLocationPermissionsSample : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContent {
package glureau.frameradar
import android.content.Context
import android.graphics.Canvas
import android.graphics.Color
import android.graphics.Paint
import android.util.AttributeSet
import android.view.View
import java.util.*
import android.os.Build.VERSION.SDK_INT
import android.os.Bundle
import android.os.Parcel
import android.util.Base64
/**
* This class implements a fix for https://issuetracker.google.com/issues/147246567
* Investigation: https://twitter.com/Piwai/status/1374129312153038849
*
* Usage:
@dmytrodanylyk
dmytrodanylyk / description.md
Last active June 20, 2022 15:00
Where this dependency comes from?

Did you ever have android build failed​ issue because of dependency resolution?

… or you were curious where all these old rxjava dependencies come from?

You can pretty easy track the module causing issues via following gradle command.

gradlew :root-module:dependencyInsight \
--configuration debugRuntimeClasspath \ // or debugCompileClasspath
--dependency io.reactivex:rxjava:1.1.0 &gt; dependencies.txt // saves result to 'dependencies.txt' file
@naturalwarren
naturalwarren / CoinbaseRxJava2CallAdapterFactory.kt
Last active March 16, 2022 04:58
A Kotlin-esque API for Retrofit.
/**
* Copyright 2019 Coinbase, Inc.
*
* 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
@florina-muntenescu
florina-muntenescu / BaseDao.kt
Last active January 1, 2025 06:52
Use Dao inheritance to reduce the amount of boilerplate code - https://medium.com/google-developers/7-pro-tips-for-room-fbadea4bfbd1
/*
* Copyright (C) 2017 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
public class AvatarView extends AppCompatImageView {
/*
* Path of them image to be clipped (to be shown)
* */
Path clipPath;
/*
* Place holder drawable (with background color and initials)
* */
@janheinrichmerker
janheinrichmerker / LICENSE
Last active August 29, 2023 14:28
LinearLayoutManager implementation that stretches to fit all list items on screen and disables scrolling. Useful for dashboards etc.
MIT License
Copyright (c) 2020 Jan Heinrich Reimer
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
furnished to do so, subject to the following conditions: