Skip to content

Instantly share code, notes, and snippets.

@AizazZaidee
AizazZaidee / expandViewTouchDelegate
Created April 14, 2015 07:25
Expand Touch Delegates of ImateView, TextView, EditText ... any View.class
public static void expandViewTouchDelegate(final View view, final int top,
final int bottom, final int left, final int right) {
((View) view.getParent()).post(new Runnable() {
@Override
public void run() {
Rect bounds = new Rect();
view.setEnabled(true);
view.getHitRect(bounds);
@dominicthomas
dominicthomas / Android Touch Area Extender
Last active November 1, 2016 07:28
A lovely android view touch area extender builder class. Made to provide a larger touch area to views that aren't standard clickable android view widgets. Works well on things like a small bit of text or a little drop down arrow. The code here is from a project that uses retrolamda and google's guava library for preconditions and optionals.
import android.graphics.Rect;
import android.view.TouchDelegate;
import android.view.View;
import com.google.common.base.Optional;
import com.google.common.base.Preconditions;
/**
* Utility used to extend the touchable area around a view in a viewgroup
* Usage: TouchAreaExtender.Builder.with(mReJamCaptionInput)
@nschwermann
nschwermann / ProgressView
Last active June 14, 2018 08:39
Material ProgressView
/*
* Copyright (C) 2013 The Android Open Source Project
*
* 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
@stkent
stkent / android_studio_shortcuts.md
Last active August 7, 2024 13:04
Android Studio Shortcuts (Mac)

Android Studio Shortcuts (Mac)

Notes:

  • Two of the most useful shortcuts utilize the Fn (function) keys. It is therefore recommended that you enable the "Use all F1, F2, etc. keys as standard function keys" option [System Preferences > Keyboard].
  • Be sure to enable the Mac OS X 10.5+ keymap in Android Studio [Preferences > Keymap].
  • A fairly complete shortcut list can be found here.

Useful symbols:

@tsiege
tsiege / The Technical Interview Cheat Sheet.md
Last active October 13, 2025 20:38
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

ANNOUNCEMENT

I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!






\

@niusounds
niusounds / HomographyActivity.java
Last active August 29, 2015 14:00
Homography sample
package com.eje_c.matrixtest;
import android.app.Activity;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Matrix;
import android.graphics.Paint;
import android.os.Bundle;
@chrisbanes
chrisbanes / FloatLabelLayout.java
Last active October 26, 2025 18:47
FloatLabelLayout
/*
* Copyright 2014 Chris Banes
*
* 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
@steveliles
steveliles / Foreground.java
Last active November 27, 2024 07:23
Class for detecting and eventing whether an Android app is currently foreground or background (requires API level 14+)
package com.sjl.util;
import android.app.Activity;
import android.app.Application;
import android.content.Context;
import android.os.Bundle;
import android.os.Handler;
import android.util.Log;
import java.util.List;
@niusounds
niusounds / LayeredImageView.java
Last active August 29, 2015 13:57
https://gist.github.com/niusounds/7905659 の後にまた作った。複数レイヤーを重ねて表示するView。Layerごとに色相・明るさ・コントラスト・透明度の指定が可能。
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.ColorMatrix;
import android.graphics.ColorMatrixColorFilter;
import android.graphics.Matrix;
@niusounds
niusounds / FloatSeekBar.java
Created March 12, 2014 11:50
Custom SeekBar for Android that treat its value as float type. floatMax and floatMin can be negative value.
import android.content.Context;
import android.content.res.TypedArray;
import android.util.AttributeSet;
import android.widget.SeekBar;
public class FloatSeekBar extends SeekBar {
private float max = 1.0f;
private float min = 0.0f;
public FloatSeekBar(Context context, AttributeSet attrs, int defStyle) {