[JETPACK COMPOSE] AlertDialog 안에서 AlertDialog 호출하기 : AlertDialog 안에 버튼을 만든후 버튼 클릭시 다른 AlertDialog를 띄워서 올려 봤습니다. ▶ 관련 영상 : 영상을 먼저 보시고 원하는 내용이 아니면 아래 코드는 무시하세요. 참고용으로 만들어 봤습니다. ▶ 소스코드 : remember 변수를 적당히 사용해서 만들어 봤습니다. setContent { TEST_APPTheme { Surface(modifier = Modifier.fillMaxSize(1f)){ Column( modifier = Modifier.wrapContentSize(), horizontalAlignment = Alignment.CenterHorizontally, ) { val showAlertDialog = remember { mutableStateOf(false) .. Android_app 2023. 9. 12. 15:27
[JETPACK COMPOSE] Image 버튼에 Press/Release 이벤트 넣기 : 기본적으로 Surface() 안에 Image 버튼을 다음처럼 넣어 줍니다. Surface(modifier = Modifier .fillMaxSize() ) { Image(painter = painterResource(R.drawable.center), contentDescription = null ) } ▶ Modifier 안의 메서드 중 .pointerInteropFilter 를 다음처럼 넣어 줍니다. >> MotionEvent.ACTION_DOWN , ACTION_UP를 추가 하고 Log.d() 를 넣었는데 적당한 액션을 넣어줍니다. Surface(modifier = Modifier .fillMaxSize() ) { Image(painter = painterResource(R.drawable.ce.. Android_app 2023. 7. 26. 15:33
[Android_App] Runtime error "cannot be cast to java.lang.Byte " : java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.Byte 에러 ▶ 아래와 같은 소스코드안의 if 문에서 발생을 했습니다. fun getOnePacket(func:ByteArray,aData:ByteArray,dataLen:ByteArray,_timeout:Int):Int { ~~ 중략 ~~ if(dataLen[0] == (0 as Byte)) > Int 형 비교 if(dataLen[0].toInt() == 0) or >> Byte 형 비교 if(dataLen[0] == 0.toByte()) : as 와 toInt 관련 코틀린 사이트 내용 첨부합니다. → as → toInt 참고하세요. Android_app 2023. 6. 21. 15:27
[Android App] BLE GATT:: [3] Characteristic /Descriptor 출력하기 :BLE GATT:: [2] 번 글 연속 강의 ==> [2]번 글 링크는 마지막에 넣었습니다. 서비스 리스트를 출력했으니 다음으로 서비스 아래의 특성(Chracteristic) 및 디스크립터를 출력해 보겠습니다. 목차 ▶ UUID 는 가독성이 떨어지니 알려진 UUID는 문자열로 바꾸기위한 HashMap()을 새로 만들어 줍니다. class SampleGattAttributes { companion object { val attributes : HashMap? init{ attributes = HashMap() // Gatt Services ~~ 중략 ~~ attributes.put("00001800-0000-1000-8000-00805f9b34fb", "Generic Access") // Gatt Des.. Android_app 2023. 4. 27. 17:48