Skip to content

Instantly share code, notes, and snippets.

@zulu-pham
zulu-pham / InteractiveScrollView.java
Created December 9, 2016 06:45 — forked from marteinn/InteractiveScrollView.java
ScrollView with a OnBottomReachedListener for Android
package se.marteinn.ui;
import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.widget.ScrollView;
/**
* Triggers a event when scrolling reaches bottom.
@zulu-pham
zulu-pham / resizeImagesFromXHDPI.sh
Created October 19, 2016 09:49 — forked from benvium/resizeImagesFromXHDPI.sh
Android app script for Android Studio / Android SDK. This script resizes android xhdpi-sized png image assets into the ldpi, mdpi, hdpi, xhdpi folders. Now just maintain one folder of images rather than 4 or 5. Updated to create directories if needed and also to separately convert images in the mipmap folder (used for app icons)
#!/bin/bash -e
# Ensure we're running in location of script.
cd "`dirname $0`"
function fail {
echo "FAILED with $1"
exit 1
}
@zulu-pham
zulu-pham / TextViewUtils.java
Created October 19, 2016 04:43 — forked from benvium/TextViewUtils.java
Remove underlines from TextView links. Based on stackoverflow code.
package com.util.util;
import android.text.Spannable;
import android.text.TextPaint;
import android.text.style.URLSpan;
import android.widget.TextView;
public class TextViewUtils {
private static final String TAG = TextViewUtils.class.getSimpleName();
@zulu-pham
zulu-pham / VideoEnabledWebChromeClient.java
Created October 19, 2016 04:43 — forked from benvium/VideoEnabledWebChromeClient.java
Playing HTML5 video on fullscreen in android webview. Note: I did not write this, it has been taken from http://stackoverflow.com/questions/15768837/playing-html5-video-on-fullscreen-in-android-webview
import android.media.MediaPlayer;
import android.media.MediaPlayer.OnCompletionListener;
import android.media.MediaPlayer.OnErrorListener;
import android.media.MediaPlayer.OnPreparedListener;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewGroup.LayoutParams;
import android.webkit.WebChromeClient;
import android.widget.FrameLayout;
import android.widget.VideoView;