Skip to content

Instantly share code, notes, and snippets.

View zirouan's full-sized avatar
🚀
Be Bold

Rudson Lima zirouan

🚀
Be Bold
View GitHub Profile
//Gerando Bitmap
public static Bitmap loadBitmapFromView(View view) {
Bitmap bitmap = Bitmap.createBitmap(view.getLayoutParams().width, view.getLayoutParams().height, Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(bitmap);
view.layout(view.getLeft(), view.getTop(), view.getRight(), view.getBottom());
view.draw(canvas);
return bitmap;
}
private void initShared(Message message) {
public static void showHideUpDown(boolean status, final View view, long duration) {
if (status) {
view.setAlpha(1f);
view.setTranslationY(0f);
view.animate().alpha(0f)
.translationY(view.getHeight())
.setDuration(duration)
.setListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
@zirouan
zirouan / EachDirectoryPath.md
Created July 16, 2016 18:07 — forked from granoeste/EachDirectoryPath.md
[Android] How to get the each directory path.

System directories

Method Result
Environment.getDataDirectory() /data
Environment.getDownloadCacheDirectory() /cache
Environment.getRootDirectory() /system

External storage directories

@zirouan
zirouan / index.html
Created October 2, 2015 10:55
Formulário simples de envio de mensagens.
<html>
<head>
<title>Exemplo GCM</title>
</head>
<body>
<form method="post" action="gcmserver.php">
<input type="hidden" name="acao" value="enviar">
Mensagem:<input type="text" name="mensagem"><br>
<input type="submit" value="OK">
</form>
@zirouan
zirouan / gcmserver.php
Last active October 2, 2015 15:05
Simples serviço de registro de Ids GCM
<?php
$acao = $_POST['acao'];
$dispositivos = "dispositivos.txt";
if ($acao == "registrar") {
$fp = fopen($dispositivos, "a+") or die("Erro ao abrir arquivo!");
$registrationId = $_POST['regId'] ."\n";
fwrite($fp, $registrationId) or die("Erro ao escrever no arquivo!");
@zirouan
zirouan / .gitignore
Last active September 22, 2016 11:20
# built application files
*.apk
*.ap_
# files for the dex VM
*.dex
# Java class files
*.class
-Xms128m
-Xmx4096m
-XX:MaxPermSize=1024m
-XX:ReservedCodeCacheSize=200m
-XX:+UseCompressedOops
@zirouan
zirouan / OnScrollListener
Last active June 13, 2019 12:09
RecyclerView - OnScrollListener
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.support.design.widget.FloatingActionButton;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.FrameLayout;
public abstract class OnScrollListener extends RecyclerView.OnScrollListener {
@zirouan
zirouan / build.gradle library
Last active August 29, 2015 14:14
build.gradle library
apply plugin: 'maven'
uploadArchives {
repositories {
mavenDeployer {
repository(url: "https://oss.sonatype.org/content/repositories/snapshots")
pom.groupId = GROUP
pom.artifactId = POM_ARTIFACT_ID
pom.version = VERSION_NAME
}
@zirouan
zirouan / gradle.properties library
Last active August 29, 2015 14:14
gradle.properties library
POM_NAME=Project name
POM_ARTIFACT_ID=Artifact name
POM_PACKAGING=aar
VERSION_NAME=version
VERSION_CODE=1
GROUP=group id
POM_DESCRIPTION=Navigation Drawer - Material Design
POM_URL=https://github.com/rudsonlive/NavigationDrawer-MaterialDesign
POM_SCM_URL=https://github.com/rudsonlive/NavigationDrawer-MaterialDesign