Skip to content

Instantly share code, notes, and snippets.

View h4h13's full-sized avatar
🏠
Working from home

Hemanth Savarala h4h13

🏠
Working from home
View GitHub Profile
@h4h13
h4h13 / RoundCornerFrameLayout.java
Created April 18, 2018 18:15 — forked from metaphore/RoundCornerFrameLayout.java
[Android] Frame layout with rounded corners
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.Path;
import android.support.annotation.NonNull;
import android.util.AttributeSet;
import android.widget.FrameLayout;
/**
* Frame layout that has rounded corners (it clips content too).
@h4h13
h4h13 / BitmapToBase64
Created January 9, 2017 07:49
Converters
public static String encodeBitmapTobase64(Bitmap image) {
Bitmap immage = image;
ByteArrayOutputStream baos = new ByteArrayOutputStream();
immage.compress(CompressFormat.PNG, 100, baos);
String imageEncoded = Base64.encodeToString(baos.toByteArray(), 0);
Log.d("Image Log:", imageEncoded);
return imageEncoded;
}
public static Bitmap decodeBase64ToBitmap(String input) {
@h4h13
h4h13 / NotificationHelper.java
Last active September 3, 2018 20:10
Android Big Picture notification with picasso
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.support.v4.app.NotificationCompat;
import com.squareup.picasso.Picasso;
import java.io.IOException;
@h4h13
h4h13 / RetrofitClient.java
Last active July 8, 2019 12:49
Retrofit Singleton class (Retrofit 2.1.0) by Using OkHttp3Client
import android.Manifest;
import android.support.annotation.RequiresPermission;
import android.util.Log;
import com.google.gson.GsonBuilder;
import java.io.File;
import java.io.IOException;
import java.util.Locale;
import java.util.concurrent.TimeUnit;