본문 바로가기
[android] design support library [android] design support library https://android-developers.googleblog.com/2015/05/android-design-support-library.html -android design support library 를 통해서 navigation drawer view, floating labels for editing text, floating action button, snackbar, tabs, motion & scroll framework 등을 2.1 이상 버전에서 사용 가능하다. -gradle 에 아래를 추가하자! compile 'com.android.support:design:22.2.0' 이 녀석은 Support v4 와 AppCompat .. 2017. 8. 4.
[android] xml 의  tool 을 사용하자 [android] xml 의 tool 을 사용하자 https://medium.com/sebs-top-tips/tools-of-the-trade-part-1-f3c1c73de898https://developer.android.com/studio/write/tool-attributes.html -xmlns:tools="http://schemas.android.com/tools" aapt 는 tools: attribute 를 ignore 한다.그래서 실제 apk 에는 들어가지 않는다. - 위와 같이 tools: 를 사용하면 실제 xml 에서 pre draw 할 때는 tools:text 가 android:text 처럼 작동하지만,apk 는 들어가지 않는다. aapt( android asset packaging .. 2017. 5. 30.
[android] RecyclerView 에 대한 맛보기 이야기 [android] RecyclerView 에 대한 맛보기 이야기 참조 : https://www.bignerdranch.com/blog/recyclerview-part-1-fundamentals-for-listview-experts/ -RecyclerView 는 ListView 에 대비하여 다음과 같은 일들을 하지 않는다. 1. List Item 들을 화면에 배치하지 않는다. -> LayoutManager 가 이 일을 맡아서 한다.2. View 들의 animation 을 관장하지 않는다. -> ItemAnimator 가 이 일을 맡아서 한다.3. Scrolling 외의 touch event 를 관장하지 않는다. -RecyclerView 는 가급적 listview 본연의 일에만 집중하고 view, anima.. 2016. 9. 23.
[android] viewstub 이건 뭐하는 녀석이야?? 안드로이드, ViewStub 이건 뭐하는 녀석이야? ViewStub 은 매우 가벼운 더미 View 이다. 자주 사용하지 않는 layout 을 링크로 갖고 있는 녀석이다. 이 녀석은 GONE 과 같이 아무것도 그리지 않는다. lazy initialize 와 비슷하다고 볼 수 있는데, 개발자가 명시적으로 지시할 때 initialize 가 된다. 개발자가 ViewStub 을 inflate 하고 싶을 때는 ViewStub에 대해 inflate() 를 호출하거나 Visibility 속성을 VISIBLE 이나 INVISIBLE 로 변경해주면 된다. ViewStub 은 한번 inflate 가 되면 그 존재는 사라지고, inflated 된 layout 이 그 자리를 차지한다. 그래서 variable 로 유지할 필요가 .. 2013. 8. 2.
[android] LayoutInflater 의 LayoutParam 무시에 대한 불편한 진실. LayoutInflater 를 사용할 때 다음과 같이 자주 사용하는데, 이럴 경우 inflate 되는 view의 root의 LayoutParam 이 무시된다. LayoutInflater.from( getContext() ).inflate( R.layout.list_item, null ); 문제는 parent 에 붙이는 것이 무시되기 때문이다. 따라서, inflate 를 할 때 붙여주는 parent 를 명시해주어야 한다. LayoutInflater.from( getContext() ).inflate( R.layout.list_item, parent ); 여기서 문제가 되는 경우는, ListView 를 사용할 때인데, 저렇게 parent 를 명시해주면, 해당 parent 에 inflate 하는 view 가 .. 2012. 12. 28.
[android] Android Layout Tricks #4 : Optimize with stubs ( 성능 최적화 ) 출처 : 안드로이드 개발자 article Android LayoutTricks #1 (성능개선) Android Layout Tricks #2 : Reusing Layouts ( 성능개선 ) Android Layout Tricks #3 : Optimize by merging Window Backgrounds & UI Speed Android Layout Tricks #4 : Optimize with stubs * 원문에서는 Tricks #3 으로 제공되지만, 다른 article 과의 연관성을 고려하여 #4 로 명명하였다. - android 는 ViewStub 이라는 특별한 widget 을 제공한다. 이 녀석은 거의 쓰이지 않는 view 들에 대해 이점을 제공한다. - ViewStub 은 매우 가벼운 vie.. 2012. 11. 28.
[android] Android Layout Tricks #3 : Optimize by merging 출처 : 안드로이드 개발자 article Android LayoutTricks #1 (성능개선) Android Layout Tricks #2 : Reusing Layouts ( 성능개선 ) Android Layout Tricks #4 : Optimize with stubs ( 성능 최적화 ) Window Backgrounds & UI Speed Android Layout Tricks #3 : Optimize by merging - 여기서는 태그에 대해 다룬다. - 태그는 view tree 의 level 을 줄여서 android layouting 을 최적화시킬 수 있다. - Title bar 가 있는 경우 기본 View tree 는 다음과 같이 구성된다. - 빨간박스가 Title bar 쪽이고 왼쪽 Fra.. 2012. 11. 28.
반응형