Skip to content

Instantly share code, notes, and snippets.

View jaksab's full-sized avatar

Andrii Konovalenko jaksab

View GitHub Profile
@rudchenkos
rudchenkos / CenterCropDrawable.java
Created July 14, 2017 12:47
Maintain aspect ratio of bitmap drawables set as windowBackground on Android
import android.graphics.Canvas;
import android.graphics.ColorFilter;
import android.graphics.Matrix;
import android.graphics.Rect;
import android.graphics.RectF;
import android.graphics.drawable.Drawable;
import android.support.annotation.IntRange;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
@Johnson145
Johnson145 / CameraController.java
Created June 14, 2017 15:49
Fix exif orientation flag of images captured with the CameraKit-Android
public class CameraController implements OrientationManager.OrientationListener{
public static String TAG = CameraController.class.getCanonicalName();
/**
* This holds the actual camera view object.
*/
private CameraView cameraView;
/**
@NoahZu
NoahZu / FrescoUtils.java
Created November 25, 2016 06:52
Fresco根据url获取Bitmap
/**
* 根据url获取图片
*/
private void getShareBitmap() {
ImageRequest request = ImageRequest.fromUri(type == 3 ? shateImageUrl : getCover(mLiveBean));
ImagePipeline imagePipeline = Fresco.getImagePipeline();
DataSource dataSource = imagePipeline.fetchDecodedImage(request, context);
try {
dataSource.subscribe(new BaseBitmapDataSubscriber() {
@Override
@NikolaDespotoski
NikolaDespotoski / BottomNavigationBehavior.java
Last active December 19, 2022 06:14
Bottom Navigation behavior
/*
* BottomNavigationLayout library for Android
* Copyright (c) 2016. Nikola Despotoski (https://github.com/NikolaDespotoski).
* 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
@brayden-morris-303
brayden-morris-303 / CoreBluetooth.md
Last active February 18, 2023 04:53
Overview of Bluetooth Low Energy (BLE) and CoreBluetooth

CoreBluetooth and BLE

Bluetooth Low Energy (BLE)

Various Names:

  • Bluetooth Low Energy
  • BLE
  • BTLE
@9re
9re / ExifUtil.java
Created March 7, 2012 00:16
fix flipped / rotated image by getting exif orientation
import java.io.IOException;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import android.graphics.Bitmap;
import android.graphics.Matrix;
import android.os.Build;