This file contains hidden or 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
// Copyright 2012 Square, Inc. | |
package com.squareup.widgets; | |
import android.content.Context; | |
import android.content.res.TypedArray; | |
import android.util.AttributeSet; | |
import android.widget.ImageView; | |
/** Maintains an aspect ratio based on either width or height. Disabled by default. */ | |
public class AspectRatioImageView extends ImageView { |
This file contains hidden or 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
buildscript { | |
repositories { | |
mavenCentral() | |
maven { | |
url 'https://oss.sonatype.org/content/repositories/snapshots/' | |
} | |
} | |
dependencies { | |
classpath 'com.android.tools.build:gradle:0.9.+' | |
classpath 'com.squareup.gradle:gradle-android-test-plugin:0.9.1-SNAPSHOT' |
This file contains hidden or 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.graphics.Bitmap; | |
import android.graphics.BitmapShader; | |
import android.graphics.Canvas; | |
import android.graphics.Paint; | |
import android.graphics.RectF; | |
import android.graphics.Shader; | |
import com.squareup.picasso.Transformation; | |
public class RoundedCornersTransform implements Transformation { |
This file contains hidden or 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
4r5e | |
5h1t | |
5hit | |
a55 | |
anal | |
anus | |
ar5e | |
arrse | |
arse | |
ass |
This file contains hidden or 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 TriangleView(context: Context?, attrs: AttributeSet?) : View(context, attrs) { | |
val paint = Paint() | |
val path = Path() | |
override fun onDraw(canvas: Canvas?) { | |
super.onDraw(canvas) | |
canvas ?: return | |
canvas.drawPath(configurePath(canvas.width.toFloat(), path), configurePaint(paint)) | |
} |
This file contains hidden or 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
public class FileUtils { | |
private static final String F_COLLAB_EXT = "collab"; | |
private static final String F_ARGUMENT_EXT = "argument"; | |
private static final String F_COMMENTS_EXT = "comment"; | |
private static final String F_CHUNKS_EXT = "chunks"; | |
private static final String F_COMBINED_EXT = "combined"; | |
private static final String F_FLYER_EXT = "flyers"; | |
private static final String F_PROCESS_VID_EXT = "video"; | |
private static FileUtils fileUtils; |
This file contains hidden or 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.app.Activity; | |
import android.content.res.Configuration; | |
import android.content.res.Resources; | |
import android.support.v7.app.AppCompatActivity; | |
import android.util.Log; | |
import android.graphics.Point; | |
import android.graphics.Rect; | |
import android.graphics.drawable.ColorDrawable; | |
import android.util.DisplayMetrics; |
This file contains hidden or 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
public class AndroidBug5497Workaround { | |
// For more information, see https://issuetracker.google.com/issues/36911528 | |
// To use this class, simply invoke assistActivity() on an Activity that already has its content view set. | |
public static void assistActivity (Activity activity) { | |
new AndroidBug5497Workaround(activity); | |
} | |
private View mChildOfContent; |
This file contains hidden or 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
public class TimeAgo { | |
private String prefixAgo = null; | |
private String prefixFromNow = null; | |
private String suffixAgo = "ago"; | |
private String suffixFromNow = "from now"; |
This file contains hidden or 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.content.Context | |
import android.net.ConnectivityManager | |
import android.net.NetworkInfo | |
import android.telephony.TelephonyManager | |
import java.io.IOException | |
import java.net.HttpURLConnection | |
import java.net.NetworkInterface | |
import java.net.SocketException | |
import java.net.URL |