Skip to content

Instantly share code, notes, and snippets.

View victornicro's full-sized avatar

Victor Catana victornicro

  • Cluj-Napoca, Romania
View GitHub Profile
@victornicro
victornicro / build.gradle
Created January 17, 2016 11:26
Clean way to define support library dependencies
ext {
supportLibVersion = '23.1.1'
}
dependencies {
compile "com.android.support:appcompat-v7:${supportLibVersion}"
compile "com.android.support:design:${supportLibVersion}"
compile "com.android.support:pallete-v7:${supportLibVersion}"
compile "com.android.support:cardview-v7:${supportLibVersion}"
compile "com.android.support:recyclerview-v7:${supportLibVersion}"
@victornicro
victornicro / ArrayUtil.java
Created November 16, 2015 18:31
SparseArray to List
public class ArrayUtil {
@Nullable
public static <C> List<C> asList(@Nullable SparseArray<C> sparseArray) {
if (sparseArray == null) {
return null;
}
final int arraySize = sparseArray.size();
List<C> arrayList = new ArrayList<>(arraySize);
for (int i = 0; i < arraySize; i++)
// package
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.Checkable;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
@victornicro
victornicro / TextViewTouchFeedback.java
Last active August 20, 2019 07:28
Android TextView touch feedback
...
mTouchLabel.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// Click handling
}
});
...