Skip to content

Instantly share code, notes, and snippets.

View ashif-ismail's full-sized avatar
🎯
Focusing

Ashif Ismail ashif-ismail

🎯
Focusing
View GitHub Profile
@ashif-ismail
ashif-ismail / DeviceOrientation
Created October 11, 2018 07:28 — forked from Abdelhady/DeviceOrientation
A utility class to help get current device orientation, you will need it if you decided to fix the activity's orientation in the manifest :)
import android.hardware.Sensor;
import android.hardware.SensorEvent;
import android.hardware.SensorEventListener;
import android.hardware.SensorManager;
import android.media.ExifInterface;
/**
* Created by abdelhady on 9/23/14.
*
* to use this class do the following 3 steps in your activity:
@ashif-ismail
ashif-ismail / Api.java
Created May 9, 2018 08:08 — forked from imminent/Api.java
Call retrying with Retrofit 2.0
package com.example.api;
import java.util.Map;
import retrofit.Call;
import retrofit.http.Body;
import retrofit.http.GET;
import retrofit.http.POST;
public interface Api {
@ashif-ismail
ashif-ismail / Api.java
Created May 9, 2018 08:08 — forked from imminent/Api.java
Call retrying with Retrofit 2.0
package com.example.api;
import java.util.Map;
import retrofit.Call;
import retrofit.http.Body;
import retrofit.http.GET;
import retrofit.http.POST;
public interface Api {
@ashif-ismail
ashif-ismail / Unit.java
Created June 6, 2017 06:17 — forked from jmaicher/Unit.java
Unit testing anonymous inner classes as event listener
public class Unit {
public Unit(EventDispatcher dispatcher) {
dispatcher.addHandler(MyEvent.class, new IEventHandler() {
public void onEvent(MyEvent event) {
// some behavior
}
});