Skip to content

Instantly share code, notes, and snippets.

View Guilherme-HRamos's full-sized avatar
🏠
Working from home

Guilherme Henrique Guilherme-HRamos

🏠
Working from home
View GitHub Profile
@Guilherme-HRamos
Guilherme-HRamos / ApiRestBase.java
Created May 30, 2018 23:34
Comunicação com a API que uso na Minerva
/**
* Minerva Aplicativos™.
* Classe criada por Guilherme Ramos em 2018
* Contato: +55 (16) 98134-5755
* www.aplicativosminerva.com
*/
public abstract class ApiRestBase {
static final String ERROR_401 = "Usuário não autorizado. Faça o login novamente";
/** Copyright 2018, Guilherme Henrique Ramos da Silva
**
** 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
** distributed under the License is distributed on an "AS IS" BASIS,
/** Copyright 2018, Guilherme Henrique Ramos da Silva
**
** 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
** distributed under the License is distributed on an "AS IS" BASIS,
@Guilherme-HRamos
Guilherme-HRamos / BitmapUtils.java
Created July 25, 2018 00:00
Obtenção de Bitmaps
public class BitmapUtils extends AsyncTask<Uri, Void, Bitmap>{
private final Context mContext;
private BuildBitmapCallback mCallback;
private boolean isFinished = false;
private boolean needShownMessage = true;
public BitmapUtils(final Context context, final BuildBitmapCallback callback) {
mContext = context;
mCallback = callback;
@Guilherme-HRamos
Guilherme-HRamos / RadioGroupSimulateUtils.java
Created July 27, 2018 04:33
Simulação de RadioGroup
import android.widget.CompoundButton;
import android.widget.RadioButton;
import android.widget.RadioGroup;
/**
* Classe criada por Guilherme Ramos em 2018
*/
public final class RadioGroupSimulateUtils {
/**
@Guilherme-HRamos
Guilherme-HRamos / JsonReaderUtil.java
Created July 27, 2018 04:47
Carregamento de estados e suas respectivas cidades
mport android.content.Context;
import java.io.IOException;
import java.io.InputStream;
/**
* Classe criada por Guilherme Ramos em 2018
*/
public class JsonReaderUtil {
@Guilherme-HRamos
Guilherme-HRamos / ProgressHelper.java
Created August 23, 2018 00:19
Inflando um ProgressView por ViewStub
import android.support.annotation.LayoutRes;
import android.view.View;
/**
* Classe criada por Guilherme Ramos em 2018
*/
public interface ProgressHelper {
void showProgress();
@Guilherme-HRamos
Guilherme-HRamos / ProgressHelper.java
Last active August 23, 2018 00:21
Inflando um ProgressView por ViewStub
import android.support.annotation.LayoutRes;
import android.view.View;
/**
* Classe criada por Guilherme Ramos em 2018
*/
public interface ProgressHelper {
void showProgress();
@Guilherme-HRamos
Guilherme-HRamos / MaterialCardTranslation.java
Created August 28, 2018 23:45
Medium Pt1 - Material Card Elevation
/** Copyright 2018, Guilherme Henrique Ramos da Silva
**
** 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
** distributed under the License is distributed on an "AS IS" BASIS,
@Guilherme-HRamos
Guilherme-HRamos / SimpleInterfaceUse.java
Last active June 30, 2019 19:31
Medium - Android/Java Interfaces like a Boss! - Simple interface use example
class MainClass {
public static void main(final String... args) {
// Se uma classe implementa uma interface,
// então a classe É a interface
MyInterface myInterface = new MyConcreteClass();
myInterface.doSomething();
}
}
// Interface utilizada
interface MyInterface {