Skip to content

Instantly share code, notes, and snippets.

View nithinkolekar's full-sized avatar

nithinkolekar

View GitHub Profile
@tcw165
tcw165 / Example_of_ElasticDragLayout.java
Created March 20, 2017 01:31
Example of ElasticDragLayout.java
// Copyright (c) 2017-present boyw165
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
package dev.androidgame.gameloop;
import android.os.Bundle;
import android.app.Activity;
import android.content.Context;
import android.content.pm.ActivityInfo;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.util.Log;
@jackgu1988
jackgu1988 / MainActivity.java
Created February 1, 2017 17:41
Android code to detect when the user is lowering the device
import android.hardware.Sensor;
import android.hardware.SensorEvent;
import android.hardware.SensorEventListener;
import android.hardware.SensorManager;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
public class MainActivity extends AppCompatActivity implements SensorEventListener {
@BCsl
BCsl / DragLinearLayout.java
Created September 7, 2016 03:17
DragLinearLayout
/**
* copy from github:https://github.com/justasm/DragLinearLayout
* <p/>
* Edited by @author chensuilun
* add support for HORIZONTAL , simplify code , some useful callback ,add OverScroll constrain , long click to drag support
*/
public class DragLinearLayout extends LinearLayout {
private static final String TAG = DragLinearLayout.class.getSimpleName();
private static final long NOMINAL_SWITCH_DURATION = 150;
private static final long MIN_SWITCH_DURATION = NOMINAL_SWITCH_DURATION;
public class GlueItemsAdapter extends RecyclerArrayAdapter<GlueItem, GlueItemsAdapter.Holder> {
public GlueItemsAdapter(LayoutInflater inflater) {
super(inflater);
}
@Override
protected Holder onCreateViewHolder(LayoutInflater inflater, ViewGroup parent, int viewType) {
return new Holder(inflater.inflate(android.R.layout.simple_list_item_1, parent, false));
@AndroidT
AndroidT / FabricView.java
Created October 12, 2015 01:29
A new canvas drawing library for Android
package com.agsw.FabricView;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.RectF;
import android.util.AttributeSet;
import android.view.MotionEvent;
@Mnemoth42
Mnemoth42 / gameutility_Actor.java
Created July 11, 2015 00:39
Various Game utility functions, designedto work together as a framework.
package com.tkraindesigns.gameutility;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.PointF;
import android.graphics.RectF;
package io.dwak.holohackernews.app.widget;
import android.content.Context;
import android.util.AttributeSet;
import android.widget.RelativeLayout;
import com.facebook.rebound.Spring;
import com.facebook.rebound.SpringConfig;
import com.facebook.rebound.SpringListener;
import com.facebook.rebound.SpringSystem;
@econnelly
econnelly / PanelLayout.java
Last active February 24, 2021 19:22
This is a modified version of the DraggablePanelLayout from https://github.com/TheHiddenDuck/draggable-panel-layout
package com.eliconnelly.android.widget;
import android.content.Context;
import android.content.res.TypedArray;
import android.os.Parcel;
import android.os.Parcelable;
import android.support.v4.view.ViewCompat;
import android.util.AttributeSet;
import android.util.Log;
import android.view.MotionEvent;
@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