(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| package org.cnii.layoutloader.ui; | |
| import android.content.Context; | |
| import android.support.v4.view.ViewPager; | |
| import android.util.AttributeSet; | |
| import android.view.View; | |
| /** | |
| * Special thanks to Daniel López Lacalle for his response | |
| * (http://stackoverflow.com/questions/8394681/android-i-am-unable-to-have-viewpager-wrap-content/20784791#20784791) |
| public class SingletonClass implements Serializable { | |
| private static volatile SingletonClass sSoleInstance; | |
| //private constructor. | |
| private SingletonClass(){ | |
| //Prevent form the reflection api. | |
| if (sSoleInstance != null){ | |
| throw new RuntimeException("Use getInstance() method to get the single instance of this class."); |
| public final class ArcUtils { | |
| private static final double FULL_CIRCLE_RADIANS = toRadians(360d); | |
| private ArcUtils() { } | |
| /** | |
| * Draws a circular arc on the given {@code Canvas}. | |
| * | |
| * @param canvas The canvas to draw into. | |
| * @param circleCenter The center of the circle on which to draw the arc. |
| public class LollipopBitmapMemoryCacheParamsSupplier implements Supplier<MemoryCacheParams> { | |
| private ActivityManager activityManager; | |
| public LollipopBitmapMemoryCacheParamsSupplier(ActivityManager activityManager) { | |
| this.activityManager = activityManager; | |
| } | |
| @Override | |
| public MemoryCacheParams get() { |
| package com.example.glidetest.app; | |
| import android.os.Bundle; | |
| import android.support.v7.app.AppCompatActivity; | |
| import android.util.Log; | |
| import android.widget.ImageView; | |
| import android.widget.ProgressBar; | |
| import com.bumptech.glide.Glide; | |
| import com.bumptech.glide.integration.okhttp.OkHttpUrlLoader; |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| private static OkHttpClient getUnsafeOkHttpClient() { | |
| try { | |
| // Create a trust manager that does not validate certificate chains | |
| final TrustManager[] trustAllCerts = new TrustManager[] { | |
| new X509TrustManager() { | |
| @Override | |
| public void checkClientTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { | |
| } | |
| @Override |
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |