This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<shape xmlns:android="http://schemas.android.com/apk/res/android" | |
android:shape="line"> | |
<stroke | |
android:color="#000000" | |
android:dashWidth="1dp" | |
android:dashGap="4dp" | |
android:width="1dp"/> | |
</shape> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Method that checks whether the device has apps installed that can handle the Intents or not. | |
* @param intent Intent that will be checked. | |
* @return true if there are apps that can handle the Intent, false otherwise. | |
*/ | |
private boolean checkAppsForIntent(Intent intent) { | |
PackageManager packageManager = getActivity().getPackageManager(); | |
return intent.resolveActivity(packageManager) != null; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//------------------------------- Class ------------------------------------------- | |
import android.graphics.Color; | |
import android.support.annotation.NonNull; | |
public class ColorUtils { | |
/** | |
* Luma Coefficients | |
* | |
* @see <a href="https://en.wikipedia.org/wiki/Luma_(video)</a> for further information about these values |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//****************************** Class ****************************** | |
import android.content.BroadcastReceiver; | |
import android.content.Context; | |
import android.content.Intent; | |
import android.net.ConnectivityManager; | |
import android.net.NetworkInfo; | |
/** | |
* BroadcastReceiver that listens for internet connection changes and notifies these changes | |
* to the subscribers for ConnectionRestoredEvent and ConnectionLostEvent. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<!--vector_heart.xml--> | |
<vector xmlns:android="http://schemas.android.com/apk/res/android" | |
android:width="128dp" | |
android:height="128dp" | |
android:viewportHeight="32" | |
android:viewportWidth="32"> | |
<path | |
android:fillColor="#C00000" | |
android:pathData="M20.5,9.5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<vector xmlns:android="http://schemas.android.com/apk/res/android" | |
android:width="512dp" | |
android:height="512dp" | |
android:viewportHeight="512" | |
android:viewportWidth="512"> | |
<path | |
android:name="heart_stroke_left_atrium" | |
android:fillColor="#DF5F4E" | |
android:pathData="M376.071,56.717c-30.373,0-58.235,11.765-80.042,31.349c-0.476,1.087-1.03,2.152-1.707,3.175 l-34.157,51.588l34.157,51.589c4.631,6.993,4.632,16.08,0.001,23.073l-34.158,51.592l34.157,51.59 c4.631,6.993,4.632,16.079,0.001,23.072l-34.159,51.6l30.23,45.663c67.125-38.55,212.202-134.676,212.202-245.395 C502.596,118.903,445.949,56.717,376.071,56.717z" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.yourpackage.example; | |
import android.content.Context; | |
import android.net.ConnectivityManager; | |
import android.net.NetworkInfo; | |
import android.util.Log; | |
import java.io.IOException; | |
import java.net.HttpURLConnection; | |
import java.net.URL; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.support.annotation.NonNull; | |
import android.support.v4.app.Fragment; | |
import android.support.v4.app.FragmentManager; | |
/** | |
* Set of methods that help with fragment manipulation. | |
*/ | |
public class FragmentUtils { |