모바일(126)
-
DataBinding – Two-way(양방향) Databinding with Custom View
DataBinding – Two-way(양방향) Databinding with Custom View CustomView가 아닌 일반적인 방법 android:text="@={viewModel.mContent} CustomView CustomView에 양방향 데이터 바인딩을 적용하려면 꽤 복잡하다. customview에 적절한 변수값 선언하기 CustomView 클래스에 Databinding 연결하기 constructor( context: Context, attrs: AttributeSet?, defStyleAttr: Int ) : super(context, attrs, defStyleAttr) { initView() } /** * init View Here */ private fun initView() {..
2021.03.04 -
[android] theme, attr, style, color ,values 정리
스타일과 테마 테마 != 스타일 스타일 스타일은 view attribute(뷰 속성)의 모음입니다. 스타일을 Map라고 생각해도 됩니다.. key들은 View attribute들이에요. 예를 들어 widget에 선언되는 속성들, 즉 layout파일에 선언된 것들이요. 스타일은 한 타입의 widget을 나타냅니다. 테마 테마는 style과 layout 등에 적용될 수 있는 리소스들의 집합니다. 앱 전체적으로 적용되는 리소스의 집합을 일컫습니다. 테마는 interface(인터페이스)와 비슷 attr 사용법 1. Custom Attribute 사용 Custom Widget에 자신의 Attrs를 설정하고 싶을 경우가 있다. 다음과 같은 순서로 진행하면 사용할 수 있다. attrs.xml에 사용자 속성 정의 - ..
2021.02.26 -
TabLayout Custom View View 안에있는 TextView Selected 안될때 해결법!
TabLayout Custom View View 안에있는 TextView Selected 안될때 해결법! 해결법 xml drawable/tab_title_color Layout/design_tab_button.xml 자바코드 for(int i=0; i
2021.02.25 -
[안드로이드] You need to use a Theme.AppCompat theme (or descendant) with this activity
안드로이드 TabLayout 사용도중 Error Infalting 오류가 발생했습니다 ㅠㅠ java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.범인은.. Tablayout클래스의 내용문에 있었습니다. android.support.v7.appcompat.R.styleable.textApperance ... 다른 방법으로는 AndroidManifest.xml에서 문제가 발생한 Activity를 아래와 같이 바뀌면 에러가 발생하지 않습니다.
2021.02.25 -
CollapsingTollbar 스크롤 하면서 아이콘 위치 변경하기
CollapsingTollbar 스크롤 하면서 아이콘 위치 변경하기 구조 RecyclerView를 스크롤 할 때, AppBarLayout안의 Toolbar를 제외한 나머지 영역들은 Toolbar사이즈 만큼 위로 Collapse 된다. Toolbar 속성 첫번째 ConstraintLayout CollapsingToolbarLayout 은 child view 의 parallax scroll 속성을 지원 합니다. 대게 parallax scroll 기능을 구현 할 때 이동 해야 할 포지션에 특정 multiplier 값을 곱해서 구현이 되는데,이 multiplier 값을 지정 해 줄 수도 있습니다. (default 는 0.5 입니다) app:layout_collapseParallaxMultiplier //0.0 ..
2021.01.12 -
[카카오페이 메인 클론코딩 2] onslide , onStateChanged, setalpha(블러처리/ 흐리게 하면서 사라지게함), scaleX(화면이 커지고 작아지고)구현
onslide , onStateChanged bottomSheetLayout을 슬라이드하게 될 경우 onslide의 offset이 0~1값으로 callback된다. 0 : 초기상태 1: expaned상태 0과1사이에 적당한 animation과 scale , margin을통해 원하는 위치에 이미지들을 배치하고 구현할 수 있다. BottomSheetBehavior bottomSheetBehavior = BottomSheetBehavior.from(mBottomSheet); bottomSheetBehavior.setState(BottomSheetBehavior.STATE_COLLAPSED); bottomSheetBehavior.addBottomSheetCallback(new BottomSheetBehavior..
2021.01.10