Skip to content

Instantly share code, notes, and snippets.

View srmdev29's full-sized avatar

Sree srmdev29

  • Dallas
View GitHub Profile
// in the performFiltering method which runs on a background thread:
@Override
protected FilterResults performFiltering(CharSequence constraint) {
FilterResults filterResults = new FilterResults();
ArrayList<String> queryResults;
if (constraint != null || constraint.length() == 0) {
queryResults = autocomplete(constraint);
} else {
queryResults = new ArrayList<String>(); // empty list/no suggestions showing ig there's no constraint
}
/*
* 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
// This is OLD way of usnig Handler which shows an warning.
private Handler oldHandler = new Handler() {
@Override
public void handleMessage(Message msg) {
// Handle a message as you want.
}
}
@srmdev29
srmdev29 / PhotoViewAttacher
Created December 19, 2014 09:54
Zoom-Imageview Android
import java.lang.ref.WeakReference;
import android.content.Context;
import android.graphics.Matrix;
import android.graphics.Matrix.ScaleToFit;
import android.graphics.RectF;
import android.graphics.drawable.Drawable;
import android.view.GestureDetector;
import android.view.MotionEvent;
import android.view.View;
@srmdev29
srmdev29 / 0_reuse_code.js
Created April 21, 2014 10:11
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console