Skip to content

Instantly share code, notes, and snippets.

Avatar

Sira siralam

  • crypto.com
  • Hong Kong
View GitHub Profile
@Abdelhady
Abdelhady / DeviceOrientation
Last active Feb 8, 2021
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 :)
View DeviceOrientation
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:
@gabrielemariotti
gabrielemariotti / README.md
Last active Feb 24, 2021
How to manage the support libraries in a multi-module projects. Thanks to Fernando Cejas (http://fernandocejas.com/)
View README.md

Centralize the support libraries dependencies in gradle

Working with multi-modules project, it is very useful to centralize the dependencies, especially the support libraries.

A very good way is to separate gradle build files, defining something like:

root
  --gradleScript
  ----dependencies.gradle
@arriolac
arriolac / TopCropImageView.java
Last active Sep 27, 2021
Custom Android ImageView for top-crop scaling of the contained drawable.
View TopCropImageView.java
import android.annotation.TargetApi;
import android.content.Context;
import android.graphics.Matrix;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.util.AttributeSet;
import android.widget.ImageView;
/**
* Created by chris on 7/27/16.