안드로이드 개발에서 많은 비중을 차지하는 UI패턴은 ListView에서 여러 이미지를 보여주는 Activity입니다. 전형적인 흐름을 정리하면 아래와 같습니다.
1. 목록조회 API호출
2. API를 파싱하고 ListView에 데이터를 보여 줌.
3. 각 아이템마다의 이미지 주소로 다시 서버를 호출
4. 이미지를 디코딩하고 ImageView에서 보여줌.
server { | |
listen 80; | |
server_name localhost; | |
root /home/bookworm/Sites; | |
index index.php index.html index.htm; | |
try_files $uri $uri/ /index.php; | |
location ~ \.php$ { | |
fastcgi_pass 127.0.0.1:9001; |
안드로이드 개발에서 많은 비중을 차지하는 UI패턴은 ListView에서 여러 이미지를 보여주는 Activity입니다. 전형적인 흐름을 정리하면 아래와 같습니다.
1. 목록조회 API호출
2. API를 파싱하고 ListView에 데이터를 보여 줌.
3. 각 아이템마다의 이미지 주소로 다시 서버를 호출
4. 이미지를 디코딩하고 ImageView에서 보여줌.
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Building a router</title> | |
<script> | |
// Put John's template engine code here... | |
(function () { | |
// A hash to store our routes: |
// Content Script to save data. | |
chrome.extension.sendRequest({storage: 'foo', value: 'bar'}); | |
// Content Script to get data. | |
chrome.extension.sendRequest({storage: 'foo'}, function(response) { | |
console.log('foo => ' + response.storage); | |
}); | |
// Background Page |
Visit my blog or connect with me on Twitter
git init
or
function b64EncodeUnicode(str) { | |
return btoa( unescape( encodeURIComponent( str ) ) ); | |
} | |
function b64DecodeUnicode(str) { | |
return decodeURIComponent( escape( atob( str ) ) ); | |
} |
# http://codepen.io/morewry/pen/pvLxPV | |
# manually create touch event | |
touchStartOn = (el, x = 0, y = 0) -> | |
try | |
e = document.createEvent('TouchEvent') | |
e.initTouchEvent("touchstart", true, true) | |
catch err | |
try | |
e = document.createEvent('UIEvent') |
/* Put space into string between chunks of same length */ | |
fun String.spacer(unitLength: Int = Int.MAX_VALUE, spaceCharacter: String = " "): String = chunked(unitLength).joinToString(spaceCharacter) | |
/** | |
* e.g. | |
* "123456789012345678".spacer(4) => "1234 5678 9012 3456 78" | |
* "123456789012345678".spacer(4, "@") => "1234@5678@9012@3456@78" | |
*/ |