본문 바로가기
[android] TextSwitcher ( from API level 1 ) [android] TextSwitcher ( from API level 1 ) http://developer.android.com/reference/android/widget/TextSwitcher.html -TextView 들만을 child 로 가지는 ViewGroup 이다.Label 을 animation 하는 데 유용하다.setText 가 불릴때마다 animation 을 해서 현재 text 를 out 시키고, 새로운 text 를 in 시킨다. -inAnimation 과 outAnimation 을 지정하여 사용한다. -setText 는 animation 을 하지만, setCurrentText 를 하면 현재 보여지고 있는 text 를 그냥 update 하기 때문에 animation 이 없다. -TextS.. 2017. 7. 9.
[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] v7 에 추가된 RecyclerView 에 대해 알아보자 #1 v7 에 추가된 RecyclerView 에 대해 알아보자 #1 참조 : http://antonioleiva.com/recyclerview RecyclerView? 그게 뭐야? RecyclerView 는 새로운 ViewGroup 이며, ListView 의 확장판이라고도 불린다.최신 support-v7 에 포함되었다. RecyclerView 는 확장성을 고려하여 생성되었다. RecyclerView 를 사용하기 위해서는 RecyclerView.Adapter, LayoutManager 이렇게 2개의 컴퍼넌트가 필요하고, 필요에 따라 ItemAnimator, ItemDecorator 등이 추가될 수 있다. RecyclerView.Adatper RecyclerView 의 Adapter 는 기존에 사용되던 패턴을 포.. 2015. 6. 15.
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 Framework (TransitionManager, Transition, Scene) 의 작동 원리 Android Transition Framework (TransitionManager, Transition, Scene) 의 작동 원리 참조 : http://lucasr.org/2014/03/13/how-android-transitions-work/ Transition Framework Transition 은 layout change 에 대한 animation 을 지원한다.layout change 는 add, remove, move, resize, show, hide 등을 이야기한다. Transition Framework 는 3개의 핵심으로 구성된다. Scene Root, Scene, Transition. Scene Root 는 ViewGroup 으로 Transition 이 일어나는 배경이 되는 Cont.. 2014. 4. 30.
[android] support v4 에 추가된 SwipeRefreshLayout. [android] support v4 에 추가된 SwipeRefreshLayout. http://antonioleiva.com/swiperefreshlayout/ SwipeRefreshLayout은 Android 에서 PullToRefresh pattern action 을 수행하기 좋은 container 이다.이 녀석은 scrollable 한 하나의 view 를 자식으로 가질 수 있는 ViewGroup 이다. PullToRefresh 가 되면 상단에 자동으로 indeterminate progress animation 이 보여진다.이 Animation 은 Google Now 에서 사용하는 progress style 과 비슷한다.Swipe Down action 에 대해서만 해당한다. setOnRefreshL.. 2014. 4. 15.
[Android] Custom View 를 사용할 때 수동 inflate, merge, attribute setting 피하는 방법. [Android] Custom View 를 사용할 때 수동 inflate, merge, attribute setting 피하는 방법. http://trickyandroid.com/protip-inflating-layout-for-your-custom-view/ 보통의 Custom View 는 ViewGroup ( LinearLayout, RelativeLayout, FrameLayout 등 ) 을 상속하여, 여러가지 component 들을 가지고 있는다. 이 경우 보통은 최초 로딩시 inflate 를 통해서 layout 을 불러온다.이 때 root viewgroup 이 custom view 가 상속한 viewgroup 과 같다면, merge 를 사용하여 view hierarchy 를 조금 더 최적화 할 .. 2014. 4. 12.
[android] soft input ( keyboard ) visibility 판단 android, soft input ( keyboard ) visibility 판단 private static final int SOFT_INPUT_MINIMUM_HEIGHT = 300; ViewGroup.getViewTreeObserver().addOnGlobalLayoutListener( new OnGlobalLayoutListener() { @Override public void onGlobalLayout() { mIsSoftInputShown = isSoftKeyboardShown( Activity, ViewGroup ); }}); private boolean isSoftKeyboardShown( Activity activity, View containerView ){int decorViewHei.. 2014. 2. 14.
[android] view 를 최적화시켜보자 ( Hierarchy Viwer & Pixel Perfect ) 안드로이드, View 를 최적화시켜보자 ( Hierarchy Viewer & Pixel Perfect ) 출처 : http://developer.android.com/tools/debugging/debugging-ui.html Optimizing Your UI ( UI 최적화하기 ) layout 때문에 앱이 느려질 수 있다.layout 에 관련된 debug 는 Hierarchy Viewer 와 lint tools 를 통해 할 수 있다. Hierarchy Viewer 는 layout 의 계층도를 보여주며, 각 node 가 얼마나 성능을 내는가를 볼 수 있다.그리고 Pixel Perfect window 를 통해 확대해 볼 수도 있다. lint 는 static code scanning tool 로 일반적으로 .. 2013. 9. 2.
반응형