본문 바로가기
Android GridLayout Tutorial Android GridLayout Tutorial 점점 화면에 표시하는 UI 가 많아지면서 Layout 의 중첩 ( overdrawing ) 으로 성능 영향이 생기기 시작했다.RelativeLayout 을 통해 이를 방지하는 tutorial 혹은 guide 들이 많이 나오기는 했지만,이는 xml 코드(?) 를 엄청 복잡하게 만들고, 유지보수 또한 어려워지기 쉽상이다. 그래서 ICS 부터 GridLayout 이라는 새로운 layout 이 도입되었다.물론 support-v7 를 통해 ICS 이전 버전에서도 GridLayout 을 이용할 수 있다. http://developer.android.com/reference/android/widget/GridLayout.html GridLayout 은 Web 의 Ta.. 2014. 6. 10.
Android RenderScript blur Android RenderScript Blur RenderScript 관련 API 들은 API 11 에 등장했다.하지만 Compat library 를 통해 API 8 부터 사용 가능하다. RenderScript 는 Graphic 작업을 할 때 CPU, GPU 중 해당 작업을 최적으로 처리할 수 있는 것을 찾아내서 multiple processor 작업을 하고 나중에 그 결과를 합치는 작업을 하여 성능을 매우 높인다. Native syntax 는 C99 기반으로, OpenCL, CUDA, GLSL 등이랑 비슷하다. private void blur(Bitmap bg, View textView, float radius) { Bitmap overlay .. 2014. 6. 8.
[JNI] bitmap handling source code frame. JNI, bitmap handling source code frame. #include /* Header for class com_example_coloring_utils_FloodFillUtils */#include #include #define LOG_TAG "DEBUG"#define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG,LOG_TAG,__VA_ARGS__)#define LOGE(...) __android_log_print(ANDROID_LOG_ERROR,LOG_TAG,__VA_ARGS__) #ifndef _Included_com_example_coloring_utils_FloodFillUtils#define _Included_com_example_co.. 2014. 4. 16.
[Android] 이미지와 텍스트 함께 배치하기. ( 신문기사처럼 ) [Android] 이미지와 텍스트 함께 배치하기. ( 신문기사처럼 ) http://gmariotti.blogspot.de/2014/03/snippet-align-textview-around-image.html LeadingMarginSpan.LeadingMarginSpan2 를 이용하면 가능하다. class MyLeadingMarginSpan2 implements LeadingMarginSpan.LeadingMarginSpan2 { private int margin;private int lines; MyLeadingMarginSpan2(int lines, int margin) {this.margin = margin;this.lines = lines;} /** * Apply the margin * * @p.. 2014. 4. 11.
[android] PullToRefreshListView up pull, down pull distinguish android, PullToRefreshListView up pull, down pull distinguish public class MainActivity extends Activity { private PullToRefreshListView mPtrlv;@Overrideprotected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView( R.layout.activity_main ); initListView();} private Handler mHandler = new Handler();private Runnable mRunnable = new Runnable() {@Overridepubl.. 2014. 2. 25.
[android] NavigationDrawer Tutorial android, NavigationDrawer Tutorial Layout You should use DrawerLayout to enable your app edge activated for open drawer automatically.Otherwise you have to implement drawer open touch event by yourself. You must keep in mind that FrameLayout that is responsible for drawer has to be come last.Because android draws xml declared layout from the bottom so that the drawer will be come most upper part.. 2013. 11. 28.
[android] TaskStackBuilder Tutorial android TaskStackBuilder Tutorial API Level 11 이상에서는 ( 3.0 / HoneyComb ) back key 를 통한 navigation convention 이 바뀌었다.back key 의 behavior 는 현재 task 에서의 조작만을 의미하고, 다른 task 로의 이동은 없다.이전 task로의 inter task 이동은 "recents" 를 통해서 가능하다. android 3.0 이후에서 한 task stack 에서 다른 task 로 이동하는 경우, 어플리케이션은 back stack 과 history 를 융합시켜서 유저가 back 키 여러번 눌러 launcher 로 나갈 수 있게 해야 한다. back key 를 눌러서 다른 task 로 이동하면 안된다. Task.. 2013. 10. 27.
[java] 한글 판별 코드 자바, 한글 판별 코드 요즘 모바일 웹에서 이름을 한글로만 입력해야 한다거나, 아이디를 영문과 숫자로만 입력해야 한다거나 하는 등의 제약사항이 있는 경우가 많이 있다. 영문과 숫자로만 구성되었는지는 Patterns 를 이용해 쉽게 매치가 가능하지만, 한글은 판별하기가 조금 힘들었다. 그 이유인즉 TextWatcher 를 이용하여 아예 한글이 아니면 입력이 안되도록 하려고 하는데, 'ㄱ', 'ㅏ' 와 같이 자음이나 모음만 존재하는 경우의 경우도 판별해야 하기에 Patterns 로 매칭하기가 쉽지 않았다. 그래서 찾아낸 것이 바로 이 코드. Character.UnicodeBlock 을 사용한다. Character.UnicodeBlock unicodeBlock = Character.UnicodeBlock.of.. 2013. 10. 5.
[android] TransitionDrawable 을 잘 쓰면 훌륭한 애니메이션이 될 수 있다. TransitionDrawable 을 잘 쓰면 훌륭한 애니메이션이 될 수 있다. TransitionDrawable 의 존재는 익히 알고 있었으나, 드디어 테스트를 해 보았다. TransitionDrawable 은 2개의 이미지를 setting 해놓고 transition 을 시키면, fade in, fade out 효과처럼 이미지가 교체된다. 더 놀라운 것은 매우 부드럽게 된다는 것이며, 2개 이상의 이미지도 충분히 소화할 수 있고, 수치만 바꿈으로서 바뀌는 속도를 쉽게 조절할 수 있다. 자 이 위대한 녀석이 얼마나 간단하게 구현되는지예제 코드 ( example code ) 를 통해서 알아보자. ImageView imageView = new ImageView( this );TransitionDrawable.. 2013. 10. 1.
반응형