본문 바로가기

전체 글

(105)
코틀린 / let, with, run, apply, also let : 지정된 값이 null이 아닌 경우에 코드를 실행해야 하는 경우 with : null이 될 수 없는 수신객체, 결과가 필요하지 않은 경우 run : 어떤 값을 계산할 필요가 있거나 여러개의 지역 변수의 범위를 제한하는 경우 apply : 수신 객체 람다 내부에서 수신 객체의 함수를 사용하지 앟고 수신 객체를 자신을 다시 반환하는 경우 also : 수신 객체 람다가 전달된 수신 객체를 전혀 사용하지 않거나 수신 객체의 속성을 변경하지 않고 사용하는 경우 https://kotlinlang.org/docs/coding-conventions.html
안드로이드 스튜디오 / To get local formatting use getDateInstance(), getDateTimeInstance(), or getTimeInstance(), or use new SimpleDateFormat(String template, Locale locale) with for example Locale.US for ASCII dates. val date = SimpleDateFormat("yyyyMMdd").parse(value) To get local formatting use getDateInstance(), getDateTimeInstance(), or getTimeInstance(), or use new SimpleDateFormat(String template, Locale locale) with for example Locale.US for ASCII dates. 현재날짜를 받고싶었는데, 해당 경고가 뜬다. Locale 클래스는 해당 지역의 정보를 담고 있는 클래스. 해당 지역의 정보를 추가해주면 경고가 사라진다. val date = SimpleDateFormat("yyyyMMdd", Locale.getDefault()).pa..
안드로이드 스튜디오 / koin 으로viewModel 의존성 주입 시 viewModel을 공유할 경우 2개 이상의 View가 1개의 ViewModel을 공유할 경우 by sharedViewModel()로 주입한다. 단, Fragment에서만 사용. 부모 Activity에서는 by viewModel() 사용하면 된다.
vscode java 단축키 sysout : System.out.println() main : public static void main(String[] args) shift+art+화살표 : 한줄 복사 ctrl+shift+k : 한줄 삭제
안드로이드 스튜디오 / Constraintlayout app 속성 layout_constraint방향_to방향of속성을 이용해서 각 위젯간 관계를 설정해줄 수 있다. top 위 bottom 아래 start 왼쪽 end 오른쪽 ex) android:id="@+id/text_view1" app:layout_constraintBottom_toTopOf="@+id/text_view2" -> text_view1의 Bottom(아래부분)을 text_view2의 Top(위)에 위치시킨다. android:id="@+id/text_view2" app:layout_constraintTop_toBottomOf="@+id/text_view1" -> text_view2의 Top(위)을 text_view1의 Bottom(아래)에 위치시킨다. !! constraintBottom_ cosntrai..
안드로이드 스튜디오 / Firebase Could not deserialize object 에러 ~~~ does not define a no-rgument constructor. If you are using ProGuard, make sure these constructors are not stripped. 해당 오류는 Firebase의 객체를 역직렬화 하려면 DTO 클래스에 빈 생성자가 필요해서 발생한 것이다. 따라서, DTO클래스의 멤버 변수에 default 값을 주는 것으로 해결 가능하다. data class User ( val email : String = "", val name : String ="", val image : String = "", val uid : String = "" ) 객체 데이터 초기화해주기~
안드로이드 스튜디오 / Google SignInButton Text 수정 방법 구글 로그인 버튼의 Text를 바꾸고 싶었다. 조금 옛날 글이지만 역시.. 해결책은 존재했다. https://stackoverflow.com/questions/18040815/can-i-edit-the-text-of-sign-in-button-on-google/27838453#27838453 Can I edit the text of sign in button on Google? I am integrating my application with google plus. I have installed google play services and signed in to my account. Also I could publish and plus one for what ever I want. My problem I..
안드로이드 스튜디오 / layout 둥근 모서리 적용 1. drawable 폴더 안에 layout_radius.xml 파일 생성 shape으로 감싸고 안에 상세 속성들을 넣어준다. - solid : 뷰의 background - corners : 모서리 부분 bottomRightRadius, bottomLeftRadius, topLeftRadius, topRightRadius 따로 적용 가능 2. layout에 적용 android:background="@drawable/layout_radius"

반응형