본문 바로가기
[Kotlin] Coroutines tutorial - async code 쉽게 짜기 [Kotlin] Coroutines tutorial - async code 쉽게 짜기 https://github.com/Kotlin/kotlinx.coroutines/blob/master/coroutines-guide.md -Kotlin coroutines 는 async code 를 sync code 의 구조를 바꾸지 않고 짤 수 있게 도와준다. Coroutine Basics - modified내용이 바뀌어서 새로 정리하였습니다. -> Coroutine Basics ( 코루틴 기초 ) 예전 기록을 보고 싶으시면 아래 "더보기" 버튼을 눌러주세요!Hello World Coroutine -launch{ delay(1000L) println(“World!”)}println(“Hello,”)Thread.slee.. 2018. 11. 25.
[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 ViewDragHelper Tutorial Android ViewDragHelper Tutorial 이 녀석은 Youtube 비디오가 우하단으로 축소되는 것의 구현에 사용된 녀석이다. ViewDragHelper ( 이하 VDH ) 는 다음과 같은 특징을 가지고 있다. - ViewDragHelper.Callback 은 parent view 와 VDH 간의 communication channel 이다.- VDH instance 를 만들기 위해서는 static factory method 를 이용하면 된다.- Drag direction 은 설정 가능하다.- View 가 없어도 drag detection 이 가능하다. VDH 는 support-v4 library 에 있다.VDH 는 VelocityTracker 나 Scroller 를 사용하여 구현되어 있다.. 2014. 6. 9.
Android Transition Animation (TransitionManager, Transition, Scene) Tutorial Android Transition Animation (TransitionManager, Transition, Scene) Tutorial 기본 참조 : http://blog.stylingandroid.com/archives/2143 Layout 의 변화에 대한 animation 을 지원한다.Layout 에 add, remove, move, resize, show, hide 등에 대한 기본 animation 을 지원한다. private ViewGroup mLayout1; @Overridepublic View onCreateView( LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.in.. 2014. 4. 8.
[android] up navigation using NavUtils cause onCreate() of parent activity. android up navigation using NavUtils cause onCreate() of parent activity. Make the parent activity's launch mode as singleTop. android:launchMode="singleTop" activity, android:launchmode, launchmode, Parent, parent activity, singletop, [android] up navigation using NavUtils cause onCreate() of parent activity. 2014. 2. 27.
[android] Up Navigation 설정하기. android, Up Navigation 설정하기. Up Navigation 설정하기 1. manifest 에서 parent 로 지정한다. 4.1 이상에서는 activity tag 에 android:parentActivityName 를 적용하면 된다. 4.0 이하에서는 meta-data 를 통해 설정해준다. 2. actionbar 설정을 바꿔준다.( up 을 지원하도록 ) getActionBar().setDisplayHomeAsUpEnabled(true); 3. Navigate up 하기. NavUtils.navigateUpFromSameTask() 를 통해서 할 수 있다. 이것이 불리면 현재 Activity 는 종료되면서 stack 의 상단에 있는 녀석이 호출된다. 이 때 FLAG_ACTIVITY_CL.. 2013. 12. 19.
jQuery, CSS Selector 모음 ( Reference ) jQuery, CSS Selector 모음 ( Reference ) 출처 : w3 스쿨 Selector Example Selects * $("*") All elements #id $("#lastname") The element with id="lastname" .class $(".intro") All elements with class="intro" .class,.class $(".intro,.demo") All elements with the class "intro" or "demo" element $("p") All elements el1,el2,el3 $("h1,div,p") All , and elements :first $("p:first") The first element :last $("p:l.. 2013. 6. 16.
[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.
반응형