Skip to content

Commit f967f49

Browse files
committed
fix : bottom_sheet 에러 해결 & 초기 위치 추가
1 parent d205aa6 commit f967f49

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

presentation/src/main/java/com/stop/ui/mission/MissionWorker.kt

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,17 @@ class MissionWorker @AssistedInject constructor(
5151
}
5252

5353
private fun getPersonLocation() {
54+
fusedLocationClient.lastLocation
55+
.addOnSuccessListener { location ->
56+
if (location != null) {
57+
missionManager.userLocation.value = Location(location.latitude, location.longitude)
58+
Log.d("MissionWorker", "initLocation(last) ${location.latitude} , ${location.longitude}")
59+
}
60+
}
61+
.addOnFailureListener {
62+
it.printStackTrace()
63+
}
64+
5465
if (ActivityCompat.checkSelfPermission(
5566
applicationContext,
5667
Manifest.permission.ACCESS_FINE_LOCATION
@@ -115,7 +126,6 @@ class MissionWorker @AssistedInject constructor(
115126
companion object {
116127
const val NOTIFICATION_ID = 82
117128
private const val NOTIFICATION_CONTENT = "사용자의 위치를 추적중입니다."
118-
private var NUM = 0
119129
private const val INTERVAL_UNIT = 1000L
120130
const val MISSION_CODE = 88
121131
}

presentation/src/main/res/layout/bottom_sheet_home_state_expanded.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@
191191
android:layout_height="wrap_content"
192192
android:ellipsize="end"
193193
android:maxLines="1"
194-
android:text="@{viewModel.alarmItem.walkTime}"
194+
android:text="@{@string/walk_time_text(viewModel.alarmItem.walkTime)}"
195195
android:textColor="@color/black"
196196
android:textSize="20sp"
197197
app:layout_constraintEnd_toEndOf="parent"

presentation/src/main/res/values/strings.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,4 +72,5 @@
7272
<string name="end_position">도착지</string>
7373
<string name="last_time">막차시간</string>
7474
<string name="expect_walk_time">예상 도보 시간</string>
75+
<string name="walk_time_text">%1$d분</string>
7576
</resources>

0 commit comments

Comments
 (0)