Dev 283

Mac Path 경로 설정

* 터미널 설정에 따라서 bash_profile or zshrc 에 경로 설정을 해야한다. 필자와 같이 터미널이 zsh 로 기본 으로 되어 있다면 bash_profile 을 할 경우에는 매번 source ~/.bash_profile 처리를 해야하기 때문에 zshrc 로 처리하는게 편할 것이다. bash_profile 과 zshrc 의 차이 설명 링크 1. open (1) bash_profile 열기 (새 창으로 뜬다) open -e ~/.bash_profile or open -e ~/.zshrc (2) bash_profile 에서 경로 추가 export PATH=$PATH:{플러터 폴더 경로}/bin 필자의 경우 export PATH=$PATH:/Users/hoon/flutter/bin (3) 변경된 b..

Dev/Mac모닝 2021.11.03

Android Gradle 빌드파일 - build.gradle.kts 참고

Android KTS 로 작성된 적용한 Gradle 빌드 파일 - build.gradle 파일 참고 https://github.com/google/iosched/blob/main/mobile/build.gradle.kts google/iosched The Google I/O Android App. Contribute to google/iosched development by creating an account on GitHub. github.com /* * Copyright 2021 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in complian..

Dev/Android 2021.07.13

AndroidX 로 바뀌면서 Activity, Fragment 에 유용한 작업 기능

참고 한 Medium 글 How AndroidX changes the way we work with Activities and Fragments Over the last couple of months, many improvements to the Activity/Fragment APIs have been introduced via the AndroidX packages. medium.com 1. Fragment 에서 OnBackPressed 관리 class MyFragment : Fragment() { override fun onAttach(context: Context) { super.onAttach(context) val callback = object : OnBackPressedCallback(tr..

Dev/Android 2021.06.29

XML 에서 뷰모델을 활용해서 텍스트 변경, ViewModel Pattern

작업 설명 ViewModel 을 활용해서 XML 상에서 TextView 의 text attribute 를 변경하는 작업을 해볼 예정입니다. 1. 시나리오 복약정보를 나타내는 Dialog에서 Switch버튼에 따라서 특정 텍스트 변경하도록 처리 2. 해결 방법 처음에는 xml 에서만 처리하는 방법을 찾았는데 찾지 못했습니다. 그래서 Switch버튼의 checked 여부를 viewModel 에 전달해서 해당 정보를 xml 에 전달하도록 했다. ViewModel val switchMedication = ObservableField() ... fun updateSwitchMedication(isMedication: Boolean) { switchMedication.set(isMedication) } xml ....

Dev/Android 2021.05.18

DataBindingUtil 오류 - <layout> 처리

2021-04-08 12:59:47.952 7475-7475/com.some.application.debug E/AndroidRuntime: FATAL EXCEPTION: main Process: com.some.application.debug, PID: 7475 java.lang.NullPointerException: DataBindingUtil.inflate(… false ) must not be null DataViewBinding 을 작업하던 도중 위와 같은 오류가 나오면 내가 만든 xml 파일에서 .... 처리를 했는지 확인해보자. 난 여러개의 ViewHolder 를 생성하던 도중 한가지 ViewHolder 에 쓸 xml 레이아웃에 ... 처리를 해주지 않아서 발생했다.

Dev/Android 2021.04.08

include 의 레이아웃에 DataViewBinding 적용 참고

developer.android.com/topic/libraries/data-binding/expressions?hl=ko 레이아웃 및 결합 표현식 | Android 개발자 | Android Developers 표현식 언어를 사용하면 뷰에 의해 전달된 이벤트를 처리하는 표현식을 작성할 수 있습니다. 데이터 결합 라이브러리는 레이아웃의 뷰를 데이터 객체와 결합하는 데 필요한 클래스를 자동으로 developer.android.com 핵심은 xmlns:bind 를 추가해주는 부분이다. Main Layout ... Include Layout ..... MainLayout 의 bind:user 그리고 include layout 의 variable name="user" 와 같이 맞춰줘야 한다.

Dev/Android 2021.04.06

Kotlin 기본 개념 정리

Kotlin 기본 개념 정리를 시작해 합니다. 일단, 코틀린의 핵심 함수 Scope functions - let, run, with, apply, also. 유용한 함수에 대한 자세한 설명은 코틀린 사이트에서 잘 나와있다. kotlinlang.org/docs/scope-functions.html Scope functions - Help | Kotlin kotlinlang.org 간단하게 정리해보면, 리턴 값의 차이라고 생각합니다. - 람다 결과를 리턴 값으로 받는 let, run, with - 해당 객체 자체를 리턴 값으로 받는 apply, also 간단한 사용 방법 - Null이 아닌 객체 실행 : let val str: String? = "Hello" //processNonNullString(str)..

Dev/Kotlin 2021.03.12