Skip to content

Instantly share code, notes, and snippets.

View eneim's full-sized avatar
😀
the simple, the best

Nam Nguyen eneim

😀
the simple, the best
View GitHub Profile
Unless specified otherwise, all of the below tinting applies to both Lollipop and pre-Lollipop using AppCompat v21. To use the support version of these attributes, remove the android namespace. For instance, "android:colorControlNormal" becomes "colorControlNormal". These attributes will be propagated to their corresponding attributes within the android namespace for devices running Lollipop. Any exceptions to this will be noted by including the "android:" prefix.
All Clickable Views:
-----------
* ripple effect (Lollipop only) -- "colorControlHighlight"
Status Bar:
------------
* background (Lollipop only) - "colorPrimaryDark"
@eneim
eneim / CustomRadioButton.java
Last active August 29, 2015 14:21
A Fix for Custom RadioButton in Android version lower than 17 (JB-MR1))
package im.ene.lab.zzz.widgets;
import android.annotation.TargetApi;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.util.AttributeSet;
import android.widget.RadioButton;
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2015 The Android Open Source Project
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
@eneim
eneim / DateTimeFormatterSample.java
Last active August 29, 2015 14:25 — forked from tokuhirom/DateTimeFormatterSample.java
Java 8 Date And Time API - Sample code.
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Locale;
public class DateTimeFormatterSample {
public static void main(String[] args) {
String[][] patterns = new String[][]{
new String[]{"G", "appendText(ChronoField.ERA,"},
@eneim
eneim / 0_reuse_code.js
Last active August 29, 2015 14:25
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@eneim
eneim / SomeFragment.java
Created August 7, 2015 07:29
Sample code
public class HomeFragment extends Fragment {
private static final String ARG_PARAM1 = "param1";
private static final String ARG_PARAM2 = "param2";
private String mParam1;
private String mParam2;
private OnFragmentInteractionListener mListener;
private String urlCitiesObj = "url";
private static String TAG = HomeFragment.class.getSimpleName();
@eneim
eneim / Connectivity.java
Created November 17, 2015 14:42 — forked from emil2k/Connectivity.java
Android utility class for checking device's network connectivity and speed.
package com.emil.android.util;
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
@eneim
eneim / libraries.gradle
Created January 18, 2016 03:15
Gradle script for good Android libraries
allprojects {
repositories {
jcenter()
maven {
url "https://s3.amazonaws.com/repo.commonsware.com"
}
maven {
url "http://amateras.sourceforge.jp/mvn"
}
mavenCentral()
@eneim
eneim / springer-free-maths-books.md
Created February 2, 2016 05:50 — forked from bishboria/springer-free-maths-books.md
Springer made a bunch of books available for free, these were the direct links
@eneim
eneim / markdown.md
Created February 17, 2016 09:49 — forked from jonschlinkert/markdown-cheatsheet.md
A better markdown cheatsheet. I used Bootstrap's Base CSS documentation as a reference.

Typography

Headings

Headings from h1 through h6 are constructed with a # for each level:

# h1 Heading
## h2 Heading
### h3 Heading