Skip to content

Instantly share code, notes, and snippets.

View jerrellmardis's full-sized avatar

Jerrell Mardis jerrellmardis

View GitHub Profile
@jerrellmardis
jerrellmardis / log.txt
Created July 30, 2012 15:50
Inline Kernel Build Failure (CM10 - Evita)
This file has been truncated, but you can view the full file.
Started by timer
[EnvInject] - Loading node environment variables.
Building in workspace /Users/oracleicom/.jenkins/jobs/(ROM) CM10 - HTC One X/workspace
Checkout:workspace / /Users/oracleicom/.jenkins/jobs/(ROM) CM10 - HTC One X/workspace - hudson.remoting.LocalChannel@6d78382e
Using strategy: Default
Last Built Revision: Revision 3d539a86aba4719b40a97a53c5dc26e5e00bbe63 (origin/jellybean)
Fetching changes from 1 remote Git repository
Fetching upstream changes from https://github.com/htc-msm8960/android_device_htc_evita
Commencing build of Revision 3d539a86aba4719b40a97a53c5dc26e5e00bbe63 (origin/jellybean)
Checking out Revision 3d539a86aba4719b40a97a53c5dc26e5e00bbe63 (origin/jellybean)
@jerrellmardis
jerrellmardis / log.txt
Created July 30, 2012 18:38
make showcommands bootimage
This file has been truncated, but you can view the full file.
Office:cm oracleicom$ make showcommands bootimage
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=4.1.1
TARGET_PRODUCT=full
TARGET_BUILD_VARIANT=eng
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a
@jerrellmardis
jerrellmardis / BaseAsyncTaskLoader
Created March 22, 2013 16:14
Generic {@link AsyncTaskLoader} which also registers and handles data changes via a {@link BroadcastReceiver}.
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.support.v4.content.AsyncTaskLoader;
/**
* Generic {@link AsyncTaskLoader} which also registers and handles data changes via a {@link BroadcastReceiver}.
*
* @author jmardis
@jerrellmardis
jerrellmardis / ZoomFragment.java
Created April 10, 2013 22:37
This demonstrates how to implement the onTouch(...) callback method within a Fragment in order to scale/zoom out the Fragment's root view when a user drags their finger up or down. Note: You can use the nineoldandroids lib to get this to work on pre-Honeycomb devices.
public class ZoomFragment implements OnTouchListener {
private static final float MIN_SCALE = 0.95f;
private float mLastScaleFactor = 0;
private float mTouchY;
@Override
public View onCreateView(final LayoutInflater inflater, final ViewGroup container, final Bundle savedInstanceState) {
mView = inflater.inflate(R.layout.fragment_layout, container, false);
@jerrellmardis
jerrellmardis / gist:5687856
Last active May 20, 2019 10:19
A simple example illustrating how to use Picasso to load a bitmap into a Target. https://github.com/square/picasso
Picasso.with(context).load(url).into(new Target() {
@Override
public void onSuccess(Bitmap bitmap) {
holder.image.setImageBitmap(bitmap);
}
@Override
public void onError() {
// handle
function dex-method-count() {
cat $1 | head -c 92 | tail -c 4 | hexdump -e '1/4 "%d\n"'
}
function dex-method-count-by-package() {
dir=$(mktemp -d -t dex)
java -jar baksmali.jar $1 -o $dir
for pkg in `find $dir/* -type d`; do
java -jar smali.jar $pkg -o $pkg/classes.dex
count=$(dex-method-count $pkg/classes.dex)
#!/bin/bash
f=$(pwd)
mkdir drawable-mdpi drawable-hdpi drawable-xhdpi drawable-xxhdpi
# fake argv and argc in bash
argc=$#; argv[0]=$0 # argv[0] is a prog name
for foo in $( seq $argc )
do
@jerrellmardis
jerrellmardis / RoundedRelativeLayout.java
Last active May 11, 2018 06:22
A {@link android.widget.RelativeLayout} that supports rounded corners and proper child view clipping. Perfect for situations where you have full bleed images that you want clipped to the bounds of this layout.
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.Path;
import android.graphics.RectF;
import android.util.AttributeSet;
import android.widget.RelativeLayout;
/**
* A {@link android.widget.RelativeLayout} that supports rounded corners.
@jerrellmardis
jerrellmardis / dex_counter.sh
Created March 27, 2014 14:13
Counts the number of methods in a list of jars
for file in jars/*.jar; do
echo $file; /Applications/Android\ Studio.app/sdk/build-tools/19.0.3/dx --dex --output=temp.dex $file 2> /dev/null
cat temp.dex| head -c 92 | tail -c 4 | hexdump -e '1/4 "%d\n"'
done
@jerrellmardis
jerrellmardis / ColorUtils.java
Created January 6, 2016 23:01
Lightens or darkens a color
package com.desk.android.util;
import android.graphics.Color;
/**
* Lightens or darkens a color
*/
public final class ColorUtils {
private ColorUtils() {