Skip to content

Instantly share code, notes, and snippets.

@gsavvid
gsavvid / publishMavenBintray.gradle
Last active November 2, 2022 12:48 — forked from Robyer/maven-publish-helper-usage.gradle
Gradle script for publishing Android Kotlin libraries to a Bintray repository using maven-publish plugin. With dependencies (also handling transitive: false and custom exclude rules), including sources and javadoc.
/**
* Publish Android Kotlin Library Helper
*
* This Gradle script is based on https://gist.github.com/Robyer/a6578e60127418b380ca133a1291f017.
* The difference is that:
* 1. It uses Dokka for generating Kotlin Javadoc.
* 2. It uses Jfrog's plugin for publishing to Bintray. If you don't want to publish to Bintray, simply remove all the Bintray-related code.
*
* NOTE: You need to add Dokka and Bintray to your classpath for the two plugins to work.
* Update the buildscript in your project's build.gradle with the following:
# Autocomplete
if [ -f /usr/local/git/contrib/completion/git-completion.bash ]; then
. /usr/local/git/contrib/completion/git-completion.bash
fi
# mostra se existem alterações no projeto (master/branch)
GIT_PS1_SHOWDIRTYSTATE=true
# necessário para o correto funcionamento da variável ‘__git_ps1’
source /usr/local/git/contrib/completion/git-prompt.sh
@stepio
stepio / build.gradle
Last active August 8, 2023 07:47 — forked from qrtt1/aar-deps.gradle
gradle: package *.jar into aar
apply plugin: 'com.android.library'
android {
compileSdkVersion 28
defaultConfig {
minSdkVersion 14
targetSdkVersion 28
versionCode 1
versionName "1.0"
@tomogoma
tomogoma / ImageRotator.java
Created March 18, 2017 08:25
Android code to rotate an image based on exif information
// imports
public class ImageRotator {
public static Bitmap rotateImage(String path) throws IOException {
Bitmap bitmap = BitmapFactory.decodeFile(path);
return rotateImage(bitmap);
}
public static Bitmap rotateImage(Bitmap bitmap) throws IOException {
int rotate = 0;
@Robyer
Robyer / maven-publish-helper-usage.gradle
Last active May 22, 2024 15:56
Gradle script for publishing Android library with sources and javadoc to Maven repository using maven-publish plugin.
// You can use maven-publish-helper.gradle script without changes and even share it between multiple
// modules. Just place the maven-publish-helper.gradle file in the root directory of your project,
// then apply it at the bottom of your module's build.gradle file like this:
// ...content of module's build.gradle file...
apply from: '../maven-publish-helper.gradle'
publishing {
publications {
@alexfu
alexfu / FragmentObserver.java
Last active June 21, 2024 19:11
Observer pattern for notifying Fragments of a ViewPager to update their views. This will update the current Fragment, as well as the off screen Fragments that are retained.
public class FragmentObserver extends Observable {
@Override
public void notifyObservers() {
setChanged(); // Set the changed flag to true, otherwise observers won't be notified.
super.notifyObservers();
}
}
@prodis
prodis / ramos_de_atividade.txt
Created March 6, 2011 12:14
Lista de ramos de atividade
Alimentos e Bebidas
Arte e Antiguidades
Artigos Religiosos
Assinaturas e Revistas
Automóveis e Veículos
Bebês e Cia
Blu-Ray
Brindes / Materiais Promocionais
Brinquedos e Games
Casa e Decoração