Skip to content

Instantly share code, notes, and snippets.

@monove
monove / mergeBitmaps.java
Last active May 2, 2023 04:43
Java Merge Multiple Bitmaps, horizontally or vertically
private Bitmap combineBitmaps(ArrayList<Bitmap> bitmaps, Boolean isHorizontal) {
int w = 0, h = 0;
for (int i = 0; i < bitmaps.size(); i++) {
if(i == 0 || isHorizontal){
w += bitmaps.get(i).getWidth();
} else if(!isHorizontal && bitmaps.get(i).getWidth() > w) {
w = bitmaps.get(i).getWidth();
}
if(i == 0 || !isHorizontal){
h += bitmaps.get(i).getHeight();
@monove
monove / blurOnReturn.js
Last active October 28, 2016 18:28
Angular Dismiss Keyboard when clicking Enter/Go/-> for Input Field
(function () {
angular.module('app')
.directive('input', function () {
return {
restrict: "E",
link: function (scope, element, attrs) {
element.on("keypress", function (e) {
var code = (e.keyCode ? e.keyCode : e.which);
if (code == 13 || code == 10) {
element.blur();