Skip to content

Instantly share code, notes, and snippets.

View JonathanImperato's full-sized avatar

Jonathan Imperato JonathanImperato

View GitHub Profile
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
class Destination {
const Destination(this.title, this.icon, this.color);
final String title;
final IconData icon;
final MaterialColor color;
}
@HBiSoft
HBiSoft / FileUtils.java
Last active February 1, 2024 19:10
This fixes the issue when selecting a file from Downloads directory as well as the SD Card. This class can be called like this: String sourcePath = FileUtils.getRealPathFromURI_API19(this, data.getData());
import android.annotation.SuppressLint;
import android.content.ContentUris;
import android.content.Context;
import android.content.CursorLoader;
import android.database.Cursor;
import android.net.Uri;
import android.os.Build;
import android.os.Environment;
import android.provider.DocumentsContract;
import android.provider.MediaStore;
@nic0lette
nic0lette / AudioFocusAwarePlayer.java
Last active November 15, 2022 09:39
A couple of classes (and an interface!) to make it easier to adapt to the audio focus changes that were introduced in Android Oreo.
/*
* Copyright 2017 Google Inc. All rights reserved.
*
* 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