Skip to content

Instantly share code, notes, and snippets.

View asbadve's full-sized avatar

Ajinkya asbadve

  • Pune,India
View GitHub Profile
@asbadve
asbadve / AndroidManifest.xml
Created May 31, 2017 10:07 — forked from bjoernQ/AndroidManifest.xml
Creating a System Overlay (Always on Top over all Apps) in Android
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="de.mobilej.overlay"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="14" />
<application android:label="SystemOverlay" >
<activity
@asbadve
asbadve / gist:b3445231a5a46bfb5bb2e3ed8b29ef29
Created February 8, 2017 07:56
Stackover flow question
moviesAPI.searchQuery(newQuery)
.subscribeOn(Schedulers.newThread())
.observeOn(AndroidSchedulers.mainThread())
.debounce(new Func1<Search, Observable<Search>>() {
@Override
public Observable<Search> call(Search search) {
if (search.getSearchResults().size() == 0) {
return Observable.empty();
} else {
return Observable.<Search>empty().delay(5, TimeUnit.SECONDS);
@asbadve
asbadve / ControllableAppBarLayout.java
Created February 5, 2017 07:42
get notified when Appbarlayout is expand and hide with scrolling offset and states.
package com.ajinkyabadve.mywatchlist.util.listeners;
/**
* Copyright 2016 Ajinkya Badve
* <p>
* 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
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
@asbadve
asbadve / RecyclerAdapter
Last active August 27, 2016 08:56 — forked from bperin/RecyclerAdapter
Generic Recycler Adapter with click listeners
@EBean
public class FeedRecyclerAdapter extends RecyclerView.Adapter<MyViewHolder> {
@RootContext
Context context;
private ArrayList<Snap> items = new ArrayList<Snap>();
private RecyclerItemClicked onRecyclerItemClicked;
@Override
package com.materialdesign.chris.materialdesignexperimenting;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.ObjectAnimator;
import android.app.Activity;
import android.os.Bundle;
import android.os.Handler;
import android.view.View;
import android.view.ViewAnimationUtils;
/*
* Copyright 2014 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
/*
* Copyright 2015 "Henry Tao <hi@henrytao.me>"
*
* 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
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Path;
import android.util.AttributeSet;
import android.view.View;
import android.view.animation.AccelerateDecelerateInterpolator;
import android.view.animation.Interpolator;
@asbadve
asbadve / MainActivity.java
Last active August 29, 2015 14:13 — forked from eluleci/MainActivity.java
Used for the sliding tab for lollipop
import android.graphics.Color;
import android.os.Bundle;
import android.support.v4.view.PagerAdapter;
import android.support.v4.view.ViewPager;
import android.support.v7.app.ActionBar;
import android.support.v7.app.ActionBarActivity;
import android.support.v7.widget.Toolbar;
import android.util.Log;
import android.view.Menu;
/*
* 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