Skip to content

Instantly share code, notes, and snippets.

View gabriel-TheCode's full-sized avatar
🏠
Working from home

Gabriel TEKOMBO gabriel-TheCode

🏠
Working from home
View GitHub Profile
@wajahatkarim3
wajahatkarim3 / CoroutinesSplashActivity.kt
Created December 25, 2019 13:05
Splash screen with Kotlin Coroutines
package com.wajahatkarim.splashscreen
import android.content.Intent
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import kotlinx.coroutines.*
class CoroutinesSplashActivity : AppCompatActivity() {
val activityScope = CoroutineScope(Dispatchers.Main)
@titoaesj
titoaesj / .kt
Last active March 17, 2024 22:22
Android convert int to dp
OBS: O var_number_int é a varável que recebera o valor a ser convertido em DP
(int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, var_number_int, getResources().getDisplayMetrics())
##KOTLIN
val Int.dp: Int
get() = (this * Resources.getSystem().displayMetrics.density + 0.5f).toInt()
val Float.dp: Int
@bpr10
bpr10 / ImageDownloadManager.java
Last active November 29, 2021 10:26
This is a simple ImageDownloader which uses Picasso do download images and write them to a folder.
import android.content.Context;
import android.graphics.Bitmap;
import android.net.Uri;
import android.os.Handler;
import android.os.Looper;
import android.util.Log;
import com.squareup.picasso.MemoryPolicy;
import com.squareup.picasso.Picasso;
import com.squareup.picasso.RequestCreator;
@lopspower
lopspower / README.md
Last active May 3, 2024 13:26
Hexadecimal color code for transparency

Hexadecimal color code for transparency

Twitter

How to set transparency with hex value ?

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

Download This sample on Google Play Store

@lukas-h
lukas-h / license-badges.md
Last active May 1, 2024 10:20
Markdown License Badges for your Project

Markdown License badges

Collection of License badges for your Project's README file.
This list includes the most common open source and open data licenses.
Easily copy and paste the code under the badges into your Markdown files.

Notes

  • The badges do not fully replace the license informations for your projects, they are only emblems for the README, that the user can see the License at first glance.

Translations: (No guarantee that the translations are up-to-date)

@himanshuvirmani
himanshuvirmani / CustomProgressBar.java
Created April 11, 2014 11:01
Creating a full screen progress bar component for Android
public final class CustomProgressBar {
private Dialog dialog;
public Dialog show(Context context) {
return show(context, null);
}
public Dialog show(Context context, CharSequence title) {
return show(context, title, false);