본문 바로가기

Custom

[Andorid] DateTimePicker Open source DatePicker나 TimePicker를 커스텀마이징을 하기가 어려워 OpenSource를 찾던 중,괜찮은 소스가 있어서 공유 합니다.무엇보다 TimePicker에 Interval이 잘 구현되어 있습니다. https://github.com/wdullaer/MaterialDateTimePicker 참고 하세요. 더보기
[Android] Custom TextView not working gravity 혹시, CustomTextView를 만들었는데 Text가 gravity가 적용 되지 않을 경우!!!! 그냥 믿져야 본전으로 CustomTextView를 RelativeLayout으로 감싸보세요. (아니면 LinearLayout) android bug로 비슷한 경우가 몇번 발생 한다고 합니다. 참고하세요. 참고 : http://stackoverflow.com/questions/21658826/textview-gravity-not-working-on-api-18-or-higher 더보기
[Android] CustomView에 Attribute 만들기 1. values 폴더에 attrs.xml 파일을 만든다.2. 아래와 같이 attrs.xml 에 코드를 추가한다. NewAttr로 strokeWidth와 strokeColor 라는 속성을 만드는 것이다. 3. layout xml 파일에 속성 값을 넣는다. (잘 안보이시겠지만, 진하게 되어 있는 부분만 추가하면 됩니다.) 4. CustomView에 속성 값을 가져 온다. public GroupTitleView(Context context, AttributeSet attrs) { super(context, attrs); strokeWidth = context.obtainStyledAttributes(attrs, R.styleable.NewAttr) .getDimensionPixelSize(R.styleabl.. 더보기
[Android] Make CustomView (TextView, OnMeasure) CustomView를 만들어 보고자 합니다.하고자 하는 것은 TextView Background 에 기본적으로 RoundRect 가 그려지도록 할 예정입니다. 여기서 필요한 기술이 두가지 입니다. 1. Background를 어떻게 그리지??2. CustomeView의 크기를 어떻게 조절하지??? 모든것을 설명해 드릴 수 없지만, 개발하는데 유용할 만한 내용은 될것이라 생각 됩니다. 먼저, Background에 이미지를 넣을때 아래와 같은 방법을 많이 씁니다. (전..그랬음.._) - FrameLayout으로 감싼 후, Background로 활용할 이미지를 ImageView에 먼저 그린 후 그 다음으로 위에 표현하고자 하는 View를 올린다. 단점 ) View의 크기가 고정 되어 있지 않으면 (예를 들어 .. 더보기
[Android] NavigationView 커스텀화 NavigationView를 커스텀화 하기에 좋은 설명이 있어서 공유하고자 글을 씁니다. itemBackground, itemIconTint and itemTextColor are simple xml-attributes that can be set, though you have to use a custom prefix instead of the android: one.Example So if you wan't to customize the color of the text (e.g. pink when unchecked and teal when checked) you should use a ColorStateList.ExampleCreate a new *.xml file in /res/color - let'.. 더보기
[Android] Image GridView 참고 Library https://github.com/felipecsl/AsymmetricGridView Screenshots: http://sysmagazine.com/posts/216591/Many plowing on open space Github, I found assemblage of interesting designs, source the codes, and libraries. And now the time came to share them. Meet assemblage vkusnostej under katom! 1. FreeFlow The design which allows to create that that napodobii mozajki or tiles from Windows Phone, with assem.. 더보기