Skip to content

Instantly share code, notes, and snippets.

View nithinkolekar's full-sized avatar

nithinkolekar

View GitHub Profile
package bemax.test;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Path;
import android.util.Log;
import android.view.MotionEvent;
@rajiv-singaseni
rajiv-singaseni / CrackerAnimation.java
Created December 27, 2011 06:23
An Android custom animation inside a view using a bitmap.
package com.webile.cracker;
import android.app.Activity;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.os.Bundle;
import android.os.Handler;
/*
* Copyright 2011 Google Inc.
*
* 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
@mufid
mufid / markdown-syntax.md
Created November 12, 2012 22:45
Markdown Syntax
@lecho
lecho / ConnectDotsView.java
Created December 18, 2012 21:45
Connect dots android view.
public class ConnectDotsView extends View {
private Bitmap mBitmap;
private Canvas mCanvas;
private Path mPath;
private Paint mPaint;
private static final int TOUCH_TOLERANCE_DP = 24;
private static final int BACKGROUND = 0xFFDDDDDD;
private List<Point> mPoints = new ArrayList<Point>();
private int mLastPointIndex = 0;
package com.dbutton.movebutton;
import android.content.Context;
import android.graphics.*;
import android.hardware.Sensor;
import android.hardware.SensorEvent;
import android.hardware.SensorEventListener;
import android.hardware.SensorManager;
import android.os.Bundle;
import android.app.Activity;
@estebanpadilla
estebanpadilla / AutoSnap.cs
Last active April 10, 2021 21:27
Auto snap to grid in Unity If you need to auto snap a gameObject to the grid in unity this script will help you. Usage: Create a Editor folder in your assets folder. Add the AutoSnap.cs script to the Editor folder. To open press Command + L (Mal), Control + L (PC) Source: http://answers.unity3d.com/questions/148812/is-there-a-toggle-for-snap-to-…
using UnityEngine;
using UnityEditor;
public class AutoSnap : EditorWindow
{
private Vector3 prevPosition;
private bool doSnap = true;
private float snapValue = 1;
[MenuItem( "Edit/Auto Snap %_l" )]
@BbAndroid
BbAndroid / JigThree.java
Created January 15, 2014 06:57
drag-drop
package game.jigsawgame;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.graphics.Typeface;
import android.graphics.drawable.Drawable;
import android.media.MediaPlayer;
import android.media.MediaPlayer.OnCompletionListener;
import android.os.Bundle;
@isatimur
isatimur / MainActivity.java
Created March 29, 2014 21:57
Support more Fragment XML attributes #251
package com.mapbox.mapboxsdk.android.testapp;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.Color;
import android.graphics.Paint;
import android.os.Bundle;
import android.provider.Settings;
import android.support.v7.app.ActionBarActivity;
@lzsucceed
lzsucceed / TouchInterceptorGridView.java
Created May 12, 2014 12:30
TouchInterceptorGridView.java
package com.lzy.music.parts;
/*
* Copyright (C) 2013 TInoue
*
* 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