Skip to content

Instantly share code, notes, and snippets.

View Aracem's full-sized avatar
👨‍🚀
Jobandtalent and Storybeat

Marcos Trujillo Aracem

👨‍🚀
Jobandtalent and Storybeat
View GitHub Profile
@Aracem
Aracem / SupportVersion.java
Last active August 17, 2016 13:09
Util class to check if the current API is as least certain API level.
package com.acdroid.util.version;
import android.os.Build;
/**
* Util class to check if the current device is running some of the awesome Android versions.
*
* Created by Marcos Trujillo (─‿‿─) on 3/02/14.
*/
public class SupportVersion {
@Aracem
Aracem / BaseWebView.java
Created May 9, 2013 09:32
Base WebView perfect to extend in your project and initialize it like you want -- this implementation hasn't any inicialization -- It has a workaround to avoid problems on Android 4.2.x version with the webview implemented by Jose I Honrado Has a method to load a Error page. Has a method to enable with reflection (when possible) the "plugins" at…
package com.acdroid.widget.webview;
import android.content.Context;
import android.util.AttributeSet;
import android.webkit.WebView;
import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.lang.reflect.Method;
@Aracem
Aracem / FetchInfoTask
Created May 23, 2013 11:19
Extension of an AsyncTask that download the info from a valid URL and return the result. This result may be parsed if is a Json, or may be parsed with your own parse implementation. This class uses the Jackson Library
package com.acdroid;
import com.fasterxml.jackson.core.JsonParseException;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.apache.http.HttpResponse;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.ResponseHandler;
import org.apache.http.client.methods.HttpGet;
@Aracem
Aracem / GetMetaData
Created June 13, 2013 14:33
Get a META-DATA from the AndroidManifest.xml file
package com.acdroid.example;
public final class GetMetaData {
private GetMetaData() {
throw new AssertionError();
}
/**
* Returns the metadata value with the metadata name
package com.acdroid.util.connectivity;
import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.telephony.TelephonyManager;
/**
* Check device's network connectivity and speed
* @author emil http://stackoverflow.com/users/220710/emil
@Aracem
Aracem / CircleTransform.java
Created February 10, 2014 10:10 — forked from julianshen/CircleTransform.java
Picasso Transformation that transforms the image in a Circle
package com.example.picassodemo;
import android.graphics.Bitmap;
import android.graphics.BitmapShader;
import android.graphics.Canvas;
import android.graphics.Paint;
import com.squareup.picasso.Transformation;
/**
@Aracem
Aracem / SupportVersion.java
Last active August 4, 2021 11:19
SupportVersion Utils class to check if the current API version is as least certain API Level
package com.aracem.utils.version;
import android.os.Build;
/**
* Util class to check if the current device is running some of the awesome Android versions.
* <p/>
* Created by Marcos Trujillo (─‿‿─) on 3/02/14.
*/
public class SupportVersion {
@Aracem
Aracem / FloatingActionActivity.java
Created July 3, 2014 07:14 — forked from gabrielemariotti/Activity.java
Basic classes to make a typical Material Floating Action Button
public class FloatingActionActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.layoutfab);
//Outline
int size = getResources().getDimensionPixelSize(R.dimen.fab_size);
Outline outline = new Outline();
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@android:color/white"
android:orientation="vertical"
android:windowMinWidthMajor="@android:dimen/dialog_min_width_major">
<LinearLayout
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- google's material design colours from
http://www.google.com/design/spec/style/color.html#color-ui-color-palette -->
<!--reds-->
<color name="md_red_50">#fde0dc</color>
<color name="md_red_100">#f9bdbb</color>
<color name="md_red_200">#f69988</color>