일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 |
- Abstract Factory
- F
- ㅓ
- 프로토타입 패턴
- El
- designPattern
- Observer Pattern
- 함수형프로그래밍
- Singleton
- 코틀린
- Design Pattern
- PrototypePattern
- factory method
- 디자인패턴 #
- Kotlin
- 옵저버 패턴
- Functional Programming
- 빌터패턴
- 추상팩토리패턴
- 팩토리 메소드
- ㅋㅁ
- builderPattern
- 디자인패턴
- a
- 추상 팩토리
- 싱글톤
- r
- Today
- Total
목록Android Jetpack Architecture (70)
오늘도 더 나은 코드를 작성하였습니까?
two-way DataBinding 일반적인 데이터 바인딩은 ViewModel에서 Observable 한 데이터의 변화에 있어 그것을 UI에 바로 적용하는 방식이지만 반대로 UI의 변화를 ViewModel의 데이터에 주입하는것. 속성 = " @={ }" 간단한 예제. public class MainActivity extends AppCompatActivity { ActivityMainBinding mBinding; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); mBinding = DataBindingUtil.setContentView(this, R.layout.activity..
Observable은 객체가 데이터 변경에 관해 다른 객체에 알릴 수 있는 기능을 의미합니다. 데이터 결합 라이브러리를 통해 객체, 필드 또는 컬렉션을 식별 가능하게 만들 수 있습니다. 간단한 기존 객체를 데이터 결합에 사용할 수는 있지만 객체를 수정해도 UI가 자동으로 업데이트되지는 않습니다. 데이터 결합을 사용하면 데이터 변경 시 리스너라는 다른 객체에 알리는 기능을 데이터 객체에 제공할 수 있습니다. 식별 가능한 클래스에는 세 가지 유형, 즉 객체, 필드 및 컬렉션이 있습니다. 식별 가능한 데이터 객체 중 하나가 UI에 결합되고 데이터 객체의 속성이 변경되면 UI가 자동으로 업데이트됩니다. Observable 필드 사용 데이터 바인딩 라이브러리에서는 이미 Observable인터페이스를 구현한 몇몇 ..
DataBinding Component란? DataBindingComponent는 BindingAdapter에 대한 getter를 포함하는 인터페이스다. DataBindingComponent를 구현하는 클래스는 반드시 하나이상의 메서드를 가져야 한다. 메서드의 이름은 접두어 get과 @BindingAdapter 메서드를 포함하는 클래스 또는 인터페이스의 이름의 합성어여야 한다. 예를 들어 @BindingAdapter 메서드를 가지고 있는 클래스의 이름이 ClickBinding이라면 DataBindingComponent구현체가 갖는 메서드의 이름은 getClickBinding()이 된다 BindingAdapter를 통해 사용자 정의 따른 로직과 setter를 수행할 수 있다 하지만 @BindingAdapt..
자동 객체 전환 표현식의 userMap 객체는 값을 반환하며 이 값은 android:text 속성의 값을 설정하는 데 사용되는 setText(CharSequence) 메서드에서 볼 수 있는 매개변수 유형으로 자동으로 변환됩니다. 매개변수 유형이 불명확하면 표현식에서 반환 유형을 변환해야 합니다. 사용자 정의 객체 전환 어떤 상황에서는 특정 유형 간에 맞춤 변환이 필요합니다. 뷰의 android:background속성에android:background속성에 Drawable이 필요하지만 지정된 color값이color 정수인 상황을 예로 들 수 있습니다. 다음 예는 Drawable이Drawable 필요한데 정수가 대신 지정된 속성을 보여줍니다 @BindingConversion public static Colo..