일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 31 |
- ExoPlayer
- Gone
- 면접준비
- Button
- SharedPreference
- 회원가입
- call by value
- 변수
- Visible
- Kotlin
- 상수
- Val
- 코틀린
- 자바
- Var
- 비밀번호
- call by reference
- 안드로이드
- 휴대전화
- 유효성 검사
- FullScreen
- 생명주기
- Android
- 버튼 투명화
- 4대컴포넌트
- 핸드폰번호
- invisible
- Regex
- 전체화면
- ExoPlayer2
- Today
- Total
목록Kotlin (4)
천천히 , 강하게 멀리
유튜브 처럼 전체화면을 구현하고 싶었다. 내가 구현한 방법은 ExoPlayer의 비디오 컨트롤러를 변경하고 전체화면 버튼을 눌렀을때 다른 액티비티로 이동하여 영상을 화면 가득히 보이게 하였다. 우선 전체화면이 될 액티비티를 만들고 AndroidManifest.xml 에 screenOrientation 과 theme 를 변경하였다. screenOrientation 을 fullSensor 를 하면 휴대폰을 어떤 방향으로 돌리든 화면이 돌아간다. 그리고 새롭게 만들 컨트롤러의 레이아웃을 만든다. custom_controls.xml 이제 동영상이 재생될 액티비티 레이아웃에 PlayerView를 배치한다. app:controller_layout_id="@layout/custom_controls" 위에 코드가 새롭..
SharedPreference 값 저장 fun saveKey(Key : String, Value : String) { val pref = getSharedPreferences("pref", Context.MODE_PRIVATE) val ed = pref.edit() ed.putString(Key, Value) ed.apply() } SharedPreference 값 불러오기 val pref = getSharedPreferences("pref", Context.MODE_PRIVATE) targetKey = pref.getString(Key, 0) SharedPreference Key 삭제 fun removepref(Key : String) { val pref = getSharedPreferences("pr..
allprojects { repositories { google() jcenter() } } build.gradle 프로젝트 경로에 이렇게 추가를 해준다. compileOptions { targetCompatibility JavaVersion.VERSION_1_8 } build.gradle app 경로에 추가한다. ExoPlayer 는 자바 8을 사용하기 때문에 사용할수 있게 해준다. implementation 'com.google.android.exoplayer:exoplayer:2.10.5' implementation 'com.google.android.exoplayer:exoplayer-core:2.10.5' implementation 'com.google.android.exoplayer:exopl..
VISIBLE : 뷰 아이템을 보이게 한다. INVISIBLE : 뷰 아이템을 안보이게 한다. GONE : 뷰 아이템을 사라지게 한다. xml에서 설정할 때는 android:visibility="visible" android:visibility="invisible" android:visibility="gone" 위 세 가지 중 하나를 넣어주면 되고 자바 코드로 설정할 때는 binding.getRoot().setVisibility(View.VISIBLE); binding.getRoot().setVisibility(View.INVISIBLE); binding.getRoot().setVisibility(View.GONE); 코틀린은 TextView.visibility = View.VISIBIE 이렇게 사용하시..