Skip to content

Instantly share code, notes, and snippets.

View YousufSohail's full-sized avatar
🎯
Focusing

Yousuf Sohail YousufSohail

🎯
Focusing
View GitHub Profile
@YousufSohail
YousufSohail / Connectivity.java
Created February 10, 2015 06:57
Android utility class for checking device's network connectivity and speed.
package com.android.util.gist;
import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.telephony.TelephonyManager;
/**
* Check device's network connectivity and speed
*
@YousufSohail
YousufSohail / FloatingActionButton.java
Created July 28, 2015 09:37
Implementation of Android Lollipop floating action button pattern. API 14+
package your_package;
import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.app.Activity;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
@YousufSohail
YousufSohail / CustomItemClickListener.java
Created October 15, 2015 16:32 — forked from riyazMuhammad/CustomItemClickListener.java
Easy Implementation of RecyclerView custom onItemClickListener
public interface CustomItemClickListener {
public void onItemClick(View v, int position);
}
@YousufSohail
YousufSohail / BaseDao.kt
Created April 4, 2018 09:03
Use Dao inheritance to reduce the amount of boilerplate code
package com.folio3.dotnline.common.data.source.local
import android.arch.persistence.room.Delete
import android.arch.persistence.room.Insert
import android.arch.persistence.room.Update
/**
* Created by Yousuf Sohail on 4/4/18.
*/
interface BaseDao<T> {
@YousufSohail
YousufSohail / response.json
Last active November 10, 2020 13:08
sample response
{
"orderId": 98765,
"status": "pending",
"schedule": false,
"deliveryETA": 1605019795250,
"liveTracking": true,
"riderLocation": {
"lat": 31.552524,
"lng": 74.314379
},
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQINBGNGd+gBEACtuCpQ8h0zZm9EhWgSMbvENmm3qeM4BQZb7n37EDDB/gP+A1iw
aPc3Vua8KbzSGJoRx2tYK5SlgryAcG9WJxPCe4yBpycftu1oF28QkujOkA2Y6DvY
mhRhiSBvkau8DVc/h58+d/4u5IGtfh01qkZgPxJ9Hrt2A5P7EDqv4iR6fZddq5Fx
xgruFcnoX7htT4beIblfif8u3PfkEegb1l0hK34erxcYgID90IWNXFNKTuUHCJ+T
VJ5NnIVXudNL2Zk4K0lH+x0X0N71YKYge3vtCfUb6Ch4tYYcVbXXaXX2dnF5jSKy
jBWYHc5vpYT53mgMGu/UEq/3qj3ilIYiVh3x/+w8yLHwMo9uwpMdbED1l6YSFhZx
G8s5LDmQoOF+9HhmweN9hUTt8Sk7yhU/3a/2oJQ9jHfF1TeUX3Ftb70L6UR6oGcQ
h6QiGKgAxnsS1Z1En6sqlTeDELHHAgP5VgpJ8utjIVCjR9d6EO/fpwa4RQrOhEMS