본문 바로가기

프로그래밍

[android] facebook multi image swipe facebook의 swipe ImageView 사진 좌우로 이미지가 있음을 알려주고, 좌우 스와이프가 가능한ViewFlow를 약간 수정해서 작성했다.ViewFlow sample에 교체하면된다.titleindicator와 sync는 안맞음.. viewpager 에서 slide 조정http://stackoverflow.com/questions/13194666/how-to-set-viewpager-size 더보기
[android] imageView.setColorFilter imageView.setColorFilter(0xFF2899D5, Mode.MULTIPLY); 더보기
[android] TextView 부분색상 String str = "검정 빨강 검정";하면 검정 빨강 검정 이 됩니다.는 즉, html로 빨강 이 된다. TextView txt = new TextView(context);txt.setText(Html.fromHtml(str)); 현재 string이 html 폼을 가진다고 해주면 된다. String str = "검정 빨강 검정";TextView txt = new TextView(context);txt.setText(Html.fromHtml(str)); 더보기
[android] 연속적 이미지 보여주기(gif효과) 3.0 허니콤 이하 imgGif = (ImageView)findViewById(R.id.img_gif); aim = (AnimationDrawable) imgGif.getBackground(); imgGif.post(new Runnable() { @Override public void run() { aim.start(); } }); 허니콤 이상 AnimationDrawable frame = (AnimationDrawable)imgGif.getBackground(); if(frame.isRunning()) { frame.stop(); } else { frame.stop(); frame.start(); } animation define .xml 더보기
[svn] 405 RA layer request failed Some resources were not updated. RA layer request failedsvn 최신으로 업데이트 하자. window- preferences- team - svn - svn connector여기에서 자신의 svn 버전 체크 더보기
[android] 제자리에서 도는 애니메이션 주소록에 sync 맞추기 위해 작성한 애니메이션Animation anim = new RotateAnimation(360, 0, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);anim.setDuration(1000); anim.setStartOffset(0); //anim.setFillEnabled(true); // animation 종료 후, 뷰의 위치를 유지하는 것을 컨트롤 할것인가 //anim.setFillAfter(true); // animation 종료 후, 뷰의 위치를 유지하겠는가 anim.setInterpolator(AnimationUtils.loadInterpolator(mOwnerActivity.getApplicat.. 더보기
[androd] animation 적용 Interpolator 사용 시 두가지 애니메이션을 혼용하는 방법1. animationSet.addAnimation2. setStartOffset1번의 경우 setInterpolator를 animationSet에다 해줘야됨 package sun.toy.animations; import sun.toy.R; import sun.toy.parents.ToyActivity; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; import android.view.animation.Animation; import android.view.animation.Animation.AnimationListene.. 더보기
[android] toast text 위치 toast 를 사용할 때 TEXT가 한쪽에 치우쳐 지는 경우가 있다. 바로 글자가 toast의 초기 사이즈 보다 작을 경우.. 왼쪽이라던가, left라던가, 왼쪽이라던가..어떻게 해야하나? gravity 를 조정하든, margin을 조정하든 하면된다.margin은 변수이니 상수인 gravityf르 사용하자.toast의 뷰의 형태는toast - LinearLayout - TextView 이다. LinearLayout 의 Gravity 를 center 로 둬 보자. 그럼 정상적으로 나온다. 더보기
[android] db asset경로에서 참조하기 외부 database를 참조하고 싶을때, 어떻게 해야할까. 기본적으로 database를 생성하면, package에 포함되 버려서 database를 열람하지 못한다. (emulator에서는 explorer로 볼수 있다. 하지만 폰에서는 확인하지 못한다.) DATABASE 운용이 잘 되는 개발자라면, 별 어려움을 못느끼겠지만... 그런사람이 얼마나 될까. 그래서 내부 database를 외부로 빼내서, sqlite browser나 파이어폭스 sqlite manager로 보고싶다. public static final String PACKAGE_DIR = "/data/data/com.mob.package/"; public static final String DATABASE_NAME = "db/testdb.sqli.. 더보기
[java] encode and decode a string using AES import java.security.InvalidKeyException; import java.security.NoSuchAlgorithmException; import javax.crypto.BadPaddingException; import javax.crypto.Cipher; import javax.crypto.IllegalBlockSizeException; import javax.crypto.NoSuchPaddingException; import javax.crypto.spec.SecretKeySpec; public class EncryptDecryptTest { public static Cipher getCipher(String synchro1, String synchro2, String syn.. 더보기