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.graphics.Bitmap; | |
import android.graphics.Canvas; | |
import android.graphics.Paint; | |
import android.graphics.PorterDuff; | |
import android.graphics.PorterDuffXfermode; | |
import android.graphics.Rect; | |
import com.squareup.picasso.Transformation; | |
/** |
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.graphics.Bitmap; | |
import android.graphics.Canvas; | |
import android.graphics.Paint; | |
import android.graphics.PorterDuff; | |
import android.graphics.PorterDuffXfermode; | |
import android.graphics.Rect; | |
import android.graphics.RectF; | |
import com.squareup.picasso.Transformation; |
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.graphics.Bitmap; | |
import android.graphics.Canvas; | |
import android.graphics.Paint; | |
import android.graphics.Path; | |
import android.graphics.PorterDuff; | |
import android.graphics.PorterDuffXfermode; | |
import android.graphics.Rect; | |
import com.squareup.picasso.Transformation; |
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.graphics.Bitmap; | |
import android.graphics.Canvas; | |
import android.graphics.Paint; | |
import android.graphics.PorterDuff; | |
import android.graphics.PorterDuffXfermode; | |
import android.graphics.Rect; | |
import android.graphics.RectF; | |
import com.squareup.picasso.Transformation; |
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.content.Context; | |
import android.graphics.Bitmap; | |
import android.support.v8.renderscript.Allocation; | |
import android.support.v8.renderscript.Element; | |
import android.support.v8.renderscript.RenderScript; | |
import android.support.v8.renderscript.ScriptIntrinsicBlur; | |
import android.util.Log; | |
import com.squareup.picasso.Transformation; |
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
// In order to know if a String or char[] is an anagram of a palindrome we look up to the | |
// math definition of a palindrome: There must be an even number of every char except for the | |
// case there is a single letter in the middle, in which case we can afford only 1 instance of | |
// an odd character in the middle. | |
public boolean solution(char[] input) { | |
int[] letters = new int[26]; | |
// We calculate frequencies to each of the letters | |
for (int i = 0; i < input.length; i++) { | |
// We lowercase the chars and compensate for the UTF-8 displacement to the right |
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
applicationVariants.all{ variant -> | |
// This is a terrible hacky way of compile-time changing all the libraries | |
// minSDKs to SDK 13. This script has to be mantained everytime you update | |
// any of these libraries or the plugin updates. | |
variant.processManifest.doFirst { | |
File manifestFile = file("${buildDir}/intermediates/exploded-aar/com.android.support/recyclerview-v7/21.0.0-rc1/AndroidManifest.xml") | |
if (manifestFile.exists()) { | |
println("Replacing minSdkVersion of RecyclerView-V7 library") | |
String content = manifestFile.getText('UTF-8') | |
content = content.replaceAll(/minSdkVersion="L"/, 'minSdkVersion=\"13\"') |
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
public class ScrollAwareListView extends ListView { | |
/** | |
* Vertical offset listener | |
*/ | |
OnVerticalScrollOffsetListener offsetListener; | |
/** | |
* Maximum vertical size | |
*/ | |
int verticalRange = 0; |
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
void selectTab(Float scroll, int direction) { | |
float localOffset = scroll - scroll.intValue(); | |
int intValue = scroll.intValue(); | |
switch (direction) { | |
case 1: | |
views[intValue].setTextColor((int) argbEvaluator.evaluate(localOffset, selectedColor, unselectedColor)); | |
if (intValue + 1 <= views.length - 1) { | |
views[intValue + 1].setTextColor((int) argbEvaluator.evaluate(localOffset, unselectedColor, selectedColor)); | |
} |
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.feverup.fever.ui.textwatchers; | |
/** | |
* Created by sefford on 14/02/14. | |
*/ | |
import android.text.Editable; | |
import android.text.TextUtils; | |
import android.text.TextWatcher; |
OlderNewer