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
| package com.yelp.android.ui.widgets; | |
| import com.yelp.android.R; | |
| import android.content.Context; | |
| import android.content.res.TypedArray; | |
| import android.graphics.Canvas; | |
| import android.graphics.Paint; | |
| import android.graphics.PorterDuff; | |
| import android.graphics.PorterDuffXfermode; |
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 CustomMatchers { | |
| public static Matcher<View> withBackground(final int resourceId) { | |
| return new TypeSafeMatcher<View>() { | |
| @Override | |
| public boolean matchesSafely(View view) { | |
| return sameBitmap(view.getContext(), view.getBackground(), resourceId); | |
| } | |
| @Override |
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
| #target photoshop | |
| /* Open the given file, and compress with TinyPNG. */ | |
| function compressFile(file) { | |
| var document = open(file); | |
| if (document.mode == DocumentMode.INDEXEDCOLOR) { | |
| document.changeMode(ChangeMode.RGB); | |
| } |
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 java.lang.reflect.Type; | |
| import android.util.Base64; | |
| import com.google.gson.Gson; | |
| import com.google.gson.GsonBuilder; | |
| import com.google.gson.JsonDeserializationContext; | |
| import com.google.gson.JsonDeserializer; | |
| import com.google.gson.JsonElement; | |
| import com.google.gson.JsonParseException; |
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
| package com.leviwilson.test; | |
| import static org.hamcrest.CoreMatchers.is; | |
| import static org.hamcrest.CoreMatchers.not; | |
| import static org.junit.Assert.assertThat; | |
| import java.util.Date; | |
| import org.junit.Test; |
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
| package org.dallasmakerspace.kiosk.data.calendar; | |
| import com.google.gson.Gson; | |
| import com.google.gson.GsonBuilder; | |
| import org.dallasmakerspace.kiosk.gson.DateDeserializer; | |
| import java.text.SimpleDateFormat; | |
| import java.util.Date; |
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 2014 Julian Shen | |
| * | |
| * 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 | |
| * | |
| * Unless required by applicable law or agreed to in writing, software |
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
| /** | |
| * An example of adding these transitions to a Fragment. This simple | |
| * version just applies opposite transitions to any Fragment whether it is | |
| * entering or exiting view. You can also inspect the transit mode parameter | |
| * (i.e. TRANSIT_FRAGMENT_OPEN, TRANSIT_FRAGMENT_CLOSE) in combination to do | |
| * different animations for, say, adding a fragment versus popping the back stack. | |
| * | |
| * Transactions without an explicit transit mode set, in this example, will not | |
| * animate. Allowing the initial fragment add, for example, to simply appear. | |
| */ |
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
| package com.onavo.android.common.ui; | |
| import android.view.View; | |
| import android.view.ViewGroup; | |
| import java.util.LinkedList; | |
| import java.util.List; | |
| /** | |
| * Based on http://stackoverflow.com/a/8831593/37020 by by Shlomi Schwartz |
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 java.lang.reflect.ParameterizedType; | |
| import java.lang.reflect.Type; | |
| import java.util.ArrayList; | |
| import java.util.Collection; | |
| import java.util.Iterator; | |
| import com.google.gson.Gson; | |
| import com.google.gson.JsonArray; | |
| import com.google.gson.JsonDeserializationContext; | |
| import com.google.gson.JsonDeserializer; |