본문 바로가기

IT/Android101

Kotlin] 안드로이드 밀어서 잠금해제 찾아봐도 안 나와서 그냥ㅠ 시작, 끝점 계산해서 잠금해제 직선거리가 80000 넘으면 finish() //시작, 끝점 계산해서 잠금해제 var startX = 0 var startY = 0 var endX = 0 var endY = 0 MYlayout.setOnTouchListener { v, event -> when(event.action){ MotionEvent.ACTION_DOWN -> { // 처음 startX = event.x.toInt() startY = event.y.toInt() } MotionEvent.ACTION_MOVE -> { // 마지막 endX = event.x.toInt() endY = event.y.toInt() } // 이동 끝내고 조건 맞으면 잠금헤제 else -> { i.. 2020. 4. 25.
Kotlin] 안드로이드 Notification 창 클릭 // 버튼 x 안드로이드 알림이 떴을 때 그 창을 눌러서 이동하게 한다. val builder = Notification.Builder(this, ANDROID_CHANNEL_ID) ... .setContentText("앱 실행주우웅") // 클릭시 메인 엑티비티로 이동하게 val intent = Intent(this, MainActivity::class.java) val pendingIntent = PendingIntent.getActivity(this, 0, intent, 0) builder.setContentIntent(pendingIntent) Notification.Builder | Android 개발자 | Android Developers Notification.Builder public static cla.. 2020. 4. 23.
Kotlin] 안드로이드 긴 텍스트 다 보여지게 // marquee android - Scrolling TextView in each RecyclerView element as needed I have a RecyclerView (ytRC) and within that RecyclerView, each element has a thumbnail and a corresponding title that gets inside the RecyclerView via an adapter (ResultsAdapter), which puts the stackoverflow.com 2020. 4. 22.
Kotlin] 안드로이드 Dialog 알림 나타나게 하기 대화상자 | Android 개발자 | Android Developers 대화상자는 사용자에게 결정을 내리거나 추가 정보를 입력하라는 프롬프트를 표시하는 작은 창입니다. 대화상자는 화면을 가득 채우지 않으며 보통은 사용자가 다음으로 계속 진행하기 전에 조치를 취해야 하는 모달 이벤트에 사용됩니다. 대화상자 디자인 언어 권장 사항을 비롯한 여러 가지 대화상자 디자인 방법에 관련된 정보는 대화상자 디자인 가이드를 읽어보세요. Dialog 클래스가 대화상자의 기본 클래스이지만, Dialog를 직접 인스턴스화하는 것은 삼가야 합니다. developer.android.com private fun OnClickHandler() { val builder = AlertDialog.Builder(this) builder... 2020. 4. 19.