Skip to content

Instantly share code, notes, and snippets.

View LluisFelip's full-sized avatar

Luis LluisFelip

View GitHub Profile
@artem-zinnatullin
artem-zinnatullin / MyApp.java
Last active January 15, 2023 13:04
If you need to set one font for all TextViews in android application you can use this solution. It will override ALL TextView's typefaces, includes action bar and other standard components, but EditText's password font won't be overriden.
public class MyApp extends Application {
@Override
public void onCreate() {
TypefaceUtil.overrideFont(getApplicationContext(), "SERIF", "fonts/Roboto-Regular.ttf"); // font from assets: "assets/fonts/Roboto-Regular.ttf
}
}
@pyricau
pyricau / OomExceptionHandler.java
Created May 6, 2015 17:18
Dump the heap on OutOfMemoryError crashes in your debug builds.
import android.content.Context;
import android.os.Debug;
import java.io.File;
public class OomExceptionHandler implements Thread.UncaughtExceptionHandler {
private static final String FILENAME = "out-of-memory.hprof";
public static void install(Context context) {
Thread.UncaughtExceptionHandler defaultHandler = Thread.getDefaultUncaughtExceptionHandler();
@PurpleBooth
PurpleBooth / README-Template.md
Last active July 6, 2024 04:11
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@drstranges
drstranges / CustomTextInputLayout.java
Last active April 21, 2020 07:10
TextInputLayout temporary workaround for helper text showing
package com.example.d_rom.supportdesigndemo.widget;
import android.content.Context;
import android.content.res.ColorStateList;
import android.content.res.TypedArray;
import android.support.design.widget.TextInputLayout;
import android.support.v4.view.ViewCompat;
import android.support.v4.view.ViewPropertyAnimatorListenerAdapter;
import android.support.v4.view.animation.FastOutSlowInInterpolator;
import android.text.TextUtils;
@Mariovc
Mariovc / ImagePicker.java
Last active June 13, 2024 11:49
Utility for picking an image from Gallery/Camera with Android Intents
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ResolveInfo;
import android.content.res.AssetFileDescriptor;
import android.database.Cursor;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Matrix;
import android.media.ExifInterface;
!function go() {
return $('#grid div')
.get()
.map(function(div) { return {v:div.innerText|0,div:div} })
.filter(function(box) { return box.v })
.sort(function(a,b) { return a.v - b.v })
.reduce(function(p,box) {
return p.then(function() {
return new Promise(function(resolve, reject) {
$(box.div).trigger('tap')
// https://gist.github.com/klaasnotfound/e14adefddaf72b941ef4e4245edca7e4
/*
* Copyright 2015 Klaas Klasing (klaas [at] klaasnotfound.com)
*
* 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
*
@jaumevn
jaumevn / test.md
Last active June 9, 2018 11:06
Creative HotHouse Android Test

Creative HotHouse Android Test

This document defines the test for the Creative HotHouse Android developer role. For this test, you must create a small application according to the requirements described below. The app must be delivered in less than a week after you receive this document. If for any reason you don’t consider it to be enough time, let us know upon receiving this document.

What to do

You must create a client app to show information about cryptocurrencies, including their price, market cap, volume, etc... In addition to this, the app users must be able to manage their own crypto portfolio.

If you are not familiar with the crypto world you can check the coinmarketcap.com website, which is the most used website to track cryptocurrencies. For instance, you could check information about our J8T token at https://coinmarketcap.com/currencies/jet8/.

@simonesestito
simonesestito / layout_with_fab.xml
Created August 5, 2018 16:22
Extended FAB using Material Components on Android
<?xml version="1.0" encoding="utf-8"?><!--
~ Use Extended FAB on Android even if Material Components doesn't support it yet
~ See https://github.com/material-components/material-components-android/issues/79
~
~ Created by Simone Sestito
-->
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
private fun getClient(): WebViewClient {
return object : WebViewClient() {
override fun shouldInterceptRequest(
view: WebView?,
request: WebResourceRequest?
): WebResourceResponse? {
return super.shouldInterceptRequest(view, request)
}
override fun shouldInterceptRequest(view: WebView?, url: String?): WebResourceResponse? {