Skip to content

Commit 418d0d7

Browse files
authored
캠퍼스맵 UI 구현 (#731)
* feat: 캠퍼스맵 장소 상세 데이터 추가 * feat: 캠퍼스맵 화면 상태 모델 추가 * feat: 캠퍼스맵 UI 리소스 추가 * feat: 캠퍼스맵 기본 화면 UI 구현 * feat: 캠퍼스맵 건물 상세 바텀시트 UI 구현 * feat: 캠퍼스맵 검색 화면 UI 구현 * feat: 캠퍼스맵 검색결과 바텀시트 UI 구현 * feat: 캠퍼스맵 UI 상태 연결 * feat: 캠퍼스맵 검색 및 시트 흐름 연결 * fix: 캠퍼스맵 전체 삭제 문구 통일 * refactor: 캠퍼스맵 실시간 검색 상태 이동 * fix: 캠퍼스맵 검색결과 스크롤 초기화 * fix: 캠퍼스맵 카테고리 검색 흐름 개선 * refactor: 장소 운영시간 매퍼 import 정리 * refactor: 캠퍼스맵 왼쪽 Chevron 아이콘 분리 * refactor: 캠퍼스맵 상세 바텀시트 전달 구조 개선 * fix: 캠퍼스맵 위치 권한 안내 흐름 개선 * feat: 캠퍼스맵 지도 다크 모드 지원 * chore: 캠퍼스 맵 컴포넌트의 하드코딩된 색상을 KuringTheme 컬러로 변경 * CampusPlaceMarker의 아이콘 틴트 색상을 KuringTheme.colors.white로 변경 * DragHandle의 배경색을 KuringTheme.colors.gray200으로 변경 * feat: 캠퍼스맵 지도 탐색 범위 제한 * fix: 캠퍼스맵 검색 결과 선택 흐름 개선
1 parent cc6de19 commit 418d0d7

40 files changed

Lines changed: 4172 additions & 178 deletions

app/src/main/AndroidManifest.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
77
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
88
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
9+
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
10+
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
911
<uses-permission android:name="com.google.android.gms.permission.AD_ID" />
1012
<uses-permission
1113
android:name="android.permission.WRITE_EXTERNAL_STORAGE"
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
2+
android:width="24dp"
3+
android:height="24dp"
4+
android:viewportWidth="24"
5+
android:viewportHeight="24">
6+
<path
7+
android:fillColor="#00000000"
8+
android:pathData="M14.5,17L9.5,12L14.5,7"
9+
android:strokeColor="#262626"
10+
android:strokeLineCap="round"
11+
android:strokeLineJoin="round"
12+
android:strokeWidth="2" />
13+
</vector>

core/preferences/src/main/java/com/ku_stacks/ku_ring/preferences/PreferenceUtil.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ class PreferenceUtil(@ApplicationContext context: Context) {
5959
get() = prefs.getInt(NOTIFICATION_PERMISSION_DIALOG_COUNT, 0)
6060
set(value) = prefs.edit { putInt(NOTIFICATION_PERMISSION_DIALOG_COUNT, value) }
6161

62+
var hasRequestedCampusMapLocationPermission: Boolean
63+
get() = prefs.getBoolean(CAMPUS_MAP_LOCATION_PERMISSION_REQUESTED, false)
64+
set(value) = prefs.edit { putBoolean(CAMPUS_MAP_LOCATION_PERMISSION_REQUESTED, value) }
65+
6266
var clubInitialCategory: String
6367
get() = prefs.getString(CLUB_INITIAL_CATEGORY, null) ?: ""
6468
set(value) = run {
@@ -105,6 +109,7 @@ class PreferenceUtil(@ApplicationContext context: Context) {
105109
const val SURVEY_2024_COMPLETE = "SURVEY_2024_COMPLETE"
106110
const val LAST_DATE_ACADEMIC_EVENT_SHEET_SHOWN = "LAST_DATE_ACADEMIC_EVENT_SHEET_SHOWN"
107111
const val NOTIFICATION_PERMISSION_DIALOG_COUNT = "NOTIFICATION_PERMISSION_DIALOG_COUNT"
112+
const val CAMPUS_MAP_LOCATION_PERMISSION_REQUESTED = "CAMPUS_MAP_LOCATION_PERMISSION_REQUESTED"
108113
const val CLUB_INITIAL_CATEGORY = "CLUB_INITIAL_CATEGORY"
109114
}
110115
}

core/util/src/main/java/com/ku_stacks/ku_ring/util/PermissionUtil.kt

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
package com.ku_stacks.ku_ring.util
22

33
import android.Manifest
4+
import android.app.Activity
45
import android.content.Context
6+
import android.content.Intent
57
import android.content.pm.PackageManager
8+
import android.net.Uri
69
import android.os.Build
10+
import android.provider.Settings
11+
import androidx.core.app.ActivityCompat
712
import androidx.core.content.ContextCompat
813

914
fun Context.checkHasNotificationPermission(): Boolean {
@@ -13,3 +18,33 @@ fun Context.checkHasNotificationPermission(): Boolean {
1318
Manifest.permission.POST_NOTIFICATIONS,
1419
) == PackageManager.PERMISSION_GRANTED
1520
}
21+
22+
fun Context.checkHasLocationPermission(): Boolean =
23+
ContextCompat.checkSelfPermission(
24+
this,
25+
Manifest.permission.ACCESS_FINE_LOCATION,
26+
) == PackageManager.PERMISSION_GRANTED ||
27+
ContextCompat.checkSelfPermission(
28+
this,
29+
Manifest.permission.ACCESS_COARSE_LOCATION,
30+
) == PackageManager.PERMISSION_GRANTED
31+
32+
fun Activity.isLocationPermissionPermanentlyDenied(
33+
hasRequestedPermission: Boolean,
34+
): Boolean = hasRequestedPermission &&
35+
!ActivityCompat.shouldShowRequestPermissionRationale(
36+
this,
37+
Manifest.permission.ACCESS_FINE_LOCATION,
38+
) &&
39+
!ActivityCompat.shouldShowRequestPermissionRationale(
40+
this,
41+
Manifest.permission.ACCESS_COARSE_LOCATION,
42+
)
43+
44+
fun Context.openAppSettings() {
45+
startActivity(
46+
Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS).apply {
47+
data = Uri.fromParts("package", packageName, null)
48+
},
49+
)
50+
}

data/domain/src/main/java/com/ku_stacks/ku_ring/domain/Place.kt

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@ data class Place (
88
val latitude: Double,
99
val longitude: Double,
1010
val priority: Priority,
11+
val number: Int? = null,
12+
val iconUrl: String? = null,
13+
val phone: String? = null,
14+
val data: String? = null,
15+
val imageUrl: String? = null,
16+
val operationHours: PlaceOperationHours? = null,
17+
val facilities: List<PlaceFacility> = emptyList(),
1118
) {
1219
enum class Priority {
1320
HIGH, MIDDLE, LOW
@@ -20,4 +27,17 @@ data class Place (
2027
}
2128
}
2229
}
23-
}
30+
}
31+
32+
data class PlaceOperationHours(
33+
val current: String? = null,
34+
val semester: String? = null,
35+
val vacation: String? = null,
36+
)
37+
38+
data class PlaceFacility(
39+
val name: String,
40+
val category: String,
41+
val location: String? = null,
42+
val operationHours: PlaceOperationHours? = null,
43+
)

0 commit comments

Comments
 (0)