Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
requirements with math
Search
Moony-H
March 15, 2025
Programming
0
360
requirements with math
Google Developer Group Korea Super.init(V6) Presentation
Moony-H
March 15, 2025
Tweet
Share
Other Decks in Programming
See All in Programming
❄️ NixOS/nixpkgsにSATySFiサポートを実装する
momeemt
1
120
Accelerate your key learnings of scaling modern Android apps
aldefy
0
110
‘무차별 LGTM~👍’만 외치던 우리가 ‘고봉밥 코드 리뷰’를?
hannah0731
0
330
AIレビュー導入によるCIツールとの共存と最適化
kamo26sima
1
1.4k
Duke on CRaC with Jakarta EE
ivargrimstad
0
720
Expoによるアプリ開発の現在地とReact Server Componentsが切り開く未来
yukukotani
2
340
CDKを使ったPagerDuty連携インフラのテンプレート化
shibuya_shogo
0
150
もう一人で悩まない! 個の知見をチームの知見にする3つの習慣と工夫 / Into team knowledge.
honyanya
3
410
フロントエンドオブザーバビリティ on Google Cloud
yunosukey
0
120
AWS CDKにおけるL2 Constructの仕組み / aws-cdk-l2-construct
gotok365
4
770
보일러플레이트 코드가 진짜 나쁜 건가요?
gaeun5744
0
240
機能が複雑化しても 頼りになる FactoryBotの話
tamikof
1
280
Featured
See All Featured
Optimising Largest Contentful Paint
csswizardry
34
3.1k
Statistics for Hackers
jakevdp
797
220k
Site-Speed That Sticks
csswizardry
4
430
The Power of CSS Pseudo Elements
geoffreycrofte
75
5.7k
Facilitating Awesome Meetings
lara
53
6.3k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
120k
The Invisible Side of Design
smashingmag
299
50k
Bash Introduction
62gerente
611
210k
The Language of Interfaces
destraynor
156
24k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
27
1.6k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
4
410
Rails Girls Zürich Keynote
gr2m
94
13k
Transcript
Korea Android ࣻਵ۽ UI ਃҳࢎ೦ ݅ೞӝ MoonHwi Han super.init(version=6)
ࣻ… જইೞदաਃ? 저는 별로…
ࣻ… જইೞदաਃ?
ࣻ… જইೞदաਃ?
ࣻ… જইೞदաਃ?
Androidীח?
ࣻਸ ਊೠ ҃ , Ҋ١Ү ࣻਵ۽ ࢚ഐਊਸ ٜ݅ ࣻ .
пೣࣻ۽ ӝ ઁযೞӝ Korea Android super.init(version=6)
ਗ Ӓܻӝ “지도 위에 반경을 그리는 기능을 만들어주세요”
ਗ Ӓܻӝ
ਗ Ӓܻӝ
ਗ Ӓܻӝ MotionEvent.ACTION_MOVE -> { val dragPosX = it.x val
dragPosY = it.y }
ਗ Ӓܻӝ val dx = (circleCenterPos.x - dragPosX).toDouble() val dy
= (circleCenterPos.y - dragPosY).toDouble() val radPx = sqrt(dx.pow(2.0) + dy.pow(2.0)) val radMeter = radPx * naverMap.projection.metersPerPixel
ਗ Ӓܻӝ circle.radius = radMeter
ਗ Ӓܻӝ MotionEvent.ACTION_MOVE -> { val dragPosX = it.x val
dragPosY = it.y val dx = (circleCenterPos.x - dragPosX).toDouble() val dy = (circleCenterPos.y - dragPosY).toDouble() val radPx = sqrt(dx.pow(2.0) + dy.pow(2.0)) val radMeter = radPx * naverMap.projection.metersPerPixel circle.radius = if (radMeter > 500) 500.0 else radMeter }
ਗ Ӓܻӝ
ਗ Ӓܻӝ ߈ܴ rਸ 500m۽ ઁೠ
ਗ Ӓܻӝ indicatorח (x, y)о ইצ (x’, y’)ܳ ٮۄоঠ ೠ.
ਗ Ӓܻӝ
ਗ Ӓܻӝ
ਗ Ӓܻӝ
ਗ Ӓܻӝ val degree = atan2(dy, dx)
ਗ Ӓܻӝ
ਗ Ӓܻӝ val x = radiusLimitPx * cos(degree) * -1
val y = radiusLimitPx * sin(degree) * -1
ਗ Ӓܻӝ MotionEvent.ACTION_MOVE -> { val dragPosX = it.x val
dragPosY = it.y val dx = (circleCenterPos.x - dragPosX).toDouble() val dy = (circleCenterPos.y - dragPosY).toDouble() val radPx = sqrt(dx.pow(2.0) + dy.pow(2.0)) val radMeter = radPx * naverMap.projection.metersPerPixel }
ਗ Ӓܻӝ if (radPx > radiusLimitPx) { //пب ҳೞӝ val
degree = atan2(dy, dx) val x = radiusLimitPx * cos(degree) * -1 val y = radiusLimitPx * sin(degree) * -1
ਗ Ӓܻӝ val circleCenterPx = naverMap.projection.toScreenLocation(circle.center) val latLng = naverMap.projection.fromScreenLocation(
PointF( x.toFloat() + circleCenterPx.x, y.toFloat() + circleCenterPx.y ) ) indicator.position = latLng circle.radius = radiusLimit
ਗ Ӓܻӝ else { circleMarker.position = naverMap.projection.fromScreenLocation(PointF(it.x, it.y)) circle.radius =
circle.center.distanceTo(circleMarker.position) }
ਗ Ӓܻӝ
ਗ Ӓܻӝ
пೣࣻ & Vector۽ ഥೞӝ Korea Android super.init(version=6)
ഥ “이미지를 핸들로 회전할 수 있게 해 주세요”
ഥ
ഥ
ഥ
ഥ
ഥ
ഥ ઁ 2 ࢎੋ ߨ
ഥ
ഥ
ഥ fun Offset.distanceTo(offset: Offset): Float = sqrt((this.x - offset.x).pow(2)
+ (this.y - offset.y).pow(2))
ഥ val a = touchPos.distanceTo(prevPos) val b = prevPos.distanceTo(imagePos)
val c = imagePos.distanceTo(touchPos) val cosA = (b.pow(2) + c.pow(2) - a.pow(2)) / (2 * b * c)
ഥ val currDegree = Math.toDegrees(acos(cosA).toDouble()).toFloat()
ഥ
ഥ
ഥ ҳೠ пبח ೦࢚ নࣻ ߑೱ হ
ഥ
߭ఠ ৻
߭ఠ ৻
߭ఠ ৻
߭ఠ ৻ fun Offset.toVectorOffset(offset: Offset) = Offset(offset.x - this.x, offset.y
- this.y) fun Offset.crossProduct(offset: Offset) = this.x * offset.y - this.y * offset.x
߭ఠ ৻ degree = Degree(degree.value + if (product < 0)
+currDegree else -currDegree)
߭ఠ ৻
݃ݴ Korea Android super.init(version=6)
ࣻ… જই࣑աਃ? 저는 별로…
ࣻ… જই࣑աਃ? ࣻҗ ೡࣻ۾ ҳഅ ևযפ.
хࢎפ
None