Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[*.{kt,kts}]
ktlint_standard_annotation = disabled
ktlint_function_naming_ignore_when_annotated_with = Composable
ktlint_function_naming_ignore_when_annotated_with = Composable
compose_allowed_composition_locals = LocalColor, LocalShapes, LocalSpacing, LocalTypography
1 change: 1 addition & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ android {
}

dependencies {
ktlintRuleset(libs.ktlint)
implementation(libs.map.sdk)
implementation(libs.play.services.location)
implementation(libs.androidx.core.ktx)
Expand Down
Empty file.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import dev.zacsweers.metro.ContributesBinding
import dev.zacsweers.metro.Inject

@ContributesBinding(AppScope::class)
class DeviceLocalDataSourceImpl @Inject constructor(
@Inject
class DeviceLocalDataSourceImpl(
private val prefs: SharedPreferences,
) : DeviceLocalDataSource {
override fun saveUuid(uuid: String) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import dev.zacsweers.metro.ContributesBinding
import dev.zacsweers.metro.Inject

@ContributesBinding(AppScope::class)
class FcmDataSourceImpl @Inject constructor(
@Inject
class FcmDataSourceImpl constructor(
private val prefs: SharedPreferences,
) : FcmDataSource {
override fun saveFcmToken(token: String) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import dev.zacsweers.metro.ContributesBinding
import dev.zacsweers.metro.Inject

@ContributesBinding(AppScope::class)
class FestivalLocalDataSourceImpl @Inject constructor(
@Inject
class FestivalLocalDataSourceImpl(
private val prefs: SharedPreferences,
) : FestivalLocalDataSource {
override fun saveFestivalId(festivalId: Long) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import dev.zacsweers.metro.ContributesBinding
import dev.zacsweers.metro.Inject

@ContributesBinding(AppScope::class)
class FestivalNotificationLocalDataSourceImpl @Inject constructor(
@Inject
class FestivalNotificationLocalDataSourceImpl(
private val prefs: SharedPreferences,
) : FestivalNotificationLocalDataSource {
override fun saveFestivalNotificationId(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ import dev.zacsweers.metro.ContributesBinding
import dev.zacsweers.metro.Inject

@ContributesBinding(AppScope::class)
class DeviceDataSourceImpl @Inject constructor(
@Inject
class DeviceDataSourceImpl(
private val deviceService: DeviceService,
) : DeviceDataSource {
override suspend fun registerDevice(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ import dev.zacsweers.metro.ContributesBinding
import dev.zacsweers.metro.Inject

@ContributesBinding(AppScope::class)
class FAQDataSourceImpl @Inject constructor(
@Inject
class FAQDataSourceImpl(
private val faqService: FAQService,
) : FAQDataSource {
override suspend fun fetchAllFAQs(): ApiResult<List<FAQResponse>> = ApiResult.toApiResult { faqService.fetchAllFAQs() }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ import dev.zacsweers.metro.ContributesBinding
import dev.zacsweers.metro.Inject

@ContributesBinding(AppScope::class)
class FestivalDataSourceImpl @Inject constructor(
@Inject
class FestivalDataSourceImpl(
private val festivalService: FestivalService,
) : FestivalDataSource {
override suspend fun fetchFestival(): ApiResult<FestivalResponse> =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ import dev.zacsweers.metro.ContributesBinding
import dev.zacsweers.metro.Inject

@ContributesBinding(AppScope::class)
class FestivalNotificationDataSourceImpl @Inject constructor(
@Inject
class FestivalNotificationDataSourceImpl(
private val festivalNotificationService: FestivalNotificationService,
) : FestivalNotificationDataSource {
override suspend fun saveFestivalNotification(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ import dev.zacsweers.metro.ContributesBinding
import dev.zacsweers.metro.Inject

@ContributesBinding(AppScope::class)
class LineupDataSourceImpl @Inject constructor(
@Inject
class LineupDataSourceImpl(
private val festivalLineupService: FestivalLineupService,
) : LineupDataSource {
override suspend fun fetchLineup(): ApiResult<List<LineupResponse>> =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ import dev.zacsweers.metro.ContributesBinding
import dev.zacsweers.metro.Inject

@ContributesBinding(AppScope::class)
class LostItemDataSourceImpl @Inject constructor(
@Inject
class LostItemDataSourceImpl(
private val lostItemService: LostItemService,
private val festivalService: FestivalService,
) : LostItemDataSource {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ import dev.zacsweers.metro.ContributesBinding
import dev.zacsweers.metro.Inject

@ContributesBinding(AppScope::class)
class NoticeDataSourceImpl @Inject constructor(
@Inject
class NoticeDataSourceImpl(
private val noticeService: NoticeService,
) : NoticeDataSource {
override suspend fun fetchNotices(): ApiResult<NoticeListResponse> = ApiResult.toApiResult { noticeService.getNotices() }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ import dev.zacsweers.metro.ContributesBinding
import dev.zacsweers.metro.Inject

@ContributesBinding(AppScope::class)
class PlaceDataSourceImpl @Inject constructor(
@Inject
class PlaceDataSourceImpl(
private val placeService: PlaceService,
private val festivalService: FestivalService,
) : PlaceDataSource {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ import dev.zacsweers.metro.ContributesBinding
import dev.zacsweers.metro.Inject

@ContributesBinding(AppScope::class)
class ScheduleDataSourceImpl @Inject constructor(
@Inject
class ScheduleDataSourceImpl(
private val scheduleService: ScheduleService,
) : ScheduleDataSource {
override suspend fun fetchScheduleEventsById(eventDateId: Long): ApiResult<List<ScheduleEventResponse>> =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ import dev.zacsweers.metro.ContributesBinding
import dev.zacsweers.metro.Inject

@ContributesBinding(AppScope::class)
class DeviceRepositoryImpl @Inject constructor(
@Inject
class DeviceRepositoryImpl(
private val deviceDataSource: DeviceDataSource,
private val deviceLocalDataSource: DeviceLocalDataSource,
private val fcmDataSource: FcmDataSource,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ import dev.zacsweers.metro.Inject
import timber.log.Timber

@ContributesBinding(AppScope::class)
class ExploreRepositoryImpl @Inject constructor(
@Inject
class ExploreRepositoryImpl(
private val festivalDataSource: FestivalDataSource,
private val festivalLocalDataSource: FestivalLocalDataSource,
) : ExploreRepository {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ import dev.zacsweers.metro.ContributesBinding
import dev.zacsweers.metro.Inject

@ContributesBinding(AppScope::class)
class FAQRepositoryImpl @Inject constructor(
@Inject
class FAQRepositoryImpl(
private val faqDataSource: FAQDataSource,
) : FAQRepository {
override suspend fun getAllFAQ(): Result<List<FAQItem>> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ import dev.zacsweers.metro.Inject
import timber.log.Timber

@ContributesBinding(AppScope::class)
class FestivalNotificationRepositoryImpl @Inject constructor(
@Inject
class FestivalNotificationRepositoryImpl(
private val festivalNotificationDataSource: FestivalNotificationDataSource,
private val deviceLocalDataSource: DeviceLocalDataSource,
private val festivalNotificationLocalDataSource: FestivalNotificationLocalDataSource,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ import dev.zacsweers.metro.Inject
import java.time.LocalDate

@ContributesBinding(AppScope::class)
class FestivalRepositoryImpl @Inject constructor(
@Inject
class FestivalRepositoryImpl(
private val festivalDataSource: FestivalDataSource,
private val festivalLocalDataSource: FestivalLocalDataSource,
private val lineupDataSource: LineupDataSource,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ import kotlinx.coroutines.async
import kotlinx.coroutines.coroutineScope

@ContributesBinding(AppScope::class)
class LostItemRepositoryImpl @Inject constructor(
@Inject
class LostItemRepositoryImpl(
private val lostItemDataSource: LostItemDataSource,
) : LostItemRepository {
override suspend fun getPendingLostItems(): Result<List<Lost>> =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ import dev.zacsweers.metro.ContributesBinding
import dev.zacsweers.metro.Inject

@ContributesBinding(AppScope::class)
class NoticeRepositoryImpl @Inject constructor(
@Inject
class NoticeRepositoryImpl(
private val noticeDataSource: NoticeDataSource,
) : NoticeRepository {
override suspend fun fetchNotices(): Result<List<Notice>> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ import dev.zacsweers.metro.ContributesBinding
import dev.zacsweers.metro.Inject

@ContributesBinding(AppScope::class)
class PlaceDetailRepositoryImpl @Inject constructor(
@Inject
class PlaceDetailRepositoryImpl(
private val placeDataSource: PlaceDataSource,
) : PlaceDetailRepository {
override suspend fun getPlaceDetail(placeId: Long): Result<PlaceDetail> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ import dev.zacsweers.metro.ContributesBinding
import dev.zacsweers.metro.Inject

@ContributesBinding(AppScope::class)
class PlaceListRepositoryImpl @Inject constructor(
@Inject
class PlaceListRepositoryImpl(
private val placeDataSource: PlaceDataSource,
) : PlaceListRepository {
override suspend fun getTimeTags(): Result<List<TimeTag>> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ import dev.zacsweers.metro.ContributesBinding
import dev.zacsweers.metro.Inject

@ContributesBinding(AppScope::class)
class ScheduleRepositoryImpl @Inject constructor(
@Inject
class ScheduleRepositoryImpl(
private val scheduleDataSource: ScheduleDataSource,
) : ScheduleRepository {
override suspend fun fetchAllScheduleDates(): Result<List<ScheduleDate>> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ import okhttp3.Response
import timber.log.Timber

@ContributesBinding(AppScope::class)
class FestaBookAuthInterceptor @Inject constructor(
@Inject
class FestaBookAuthInterceptor(
private val festivalLocalDataSource: FestivalLocalDataSource,
) : Interceptor {
override fun intercept(chain: Interceptor.Chain): Response {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ import dev.zacsweers.metro.Provider
import kotlin.reflect.KClass

@ContributesBinding(AppScope::class)
class MetroFragmentFactory @Inject constructor(
@Inject
class MetroFragmentFactory(
private val creators: Map<KClass<out Fragment>, Provider<Fragment>>,
) : FragmentFactory() {
override fun instantiate(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ import dev.zacsweers.metro.Provider
import kotlin.reflect.KClass

@ContributesBinding(AppScope::class)
class MetroViewModelFactory @Inject constructor(
@Inject
class MetroViewModelFactory(
private val creators: Map<KClass<out ViewModel>, Provider<ViewModel>>,
) : ViewModelProvider.Factory {
@Suppress("NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ enum class PlaceCategory {
PRIMARY,
STAGE,
PHOTO_BOOTH,
EXTRA
EXTRA,
;

companion object {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ import kotlinx.coroutines.tasks.await
import java.time.LocalDateTime

@SingleIn(AppScope::class)
class DefaultFirebaseLogger @Inject constructor(
@Inject
class DefaultFirebaseLogger(
private val firebaseAnalytics: FirebaseAnalytics,
private val festivalLocalDataSource: FestivalLocalDataSource,
private val festivalNotificationLocalDataSource: FestivalNotificationLocalDataSource,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ import timber.log.Timber
import java.util.Locale

@ContributesBinding(AppScope::class)
class FirebaseAnalyticsTree @Inject constructor(
@Inject
class FirebaseAnalyticsTree(
private val analytics: FirebaseAnalytics,
) : Timber.Tree() {
override fun log(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ fun ViewGroup.showBottomAnimation() {
.setDuration(300) // 0.5초 동안
.setInterpolator(DecelerateInterpolator()) // 점점 느려지게
.start()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,11 @@ import android.app.Activity
import android.content.Context
import android.content.Intent
import android.os.Build
import android.os.Bundle
import android.os.Parcelable
import android.util.TypedValue
import android.view.View
import android.view.ViewGroup
import androidx.coordinatorlayout.widget.CoordinatorLayout
import androidx.core.os.BundleCompat.getSerializable
import androidx.core.view.WindowInsetsCompat
import androidx.fragment.app.Fragment
import com.daedan.festabook.R
Expand All @@ -20,24 +18,19 @@ import com.google.android.material.floatingactionbutton.FloatingActionButton
import com.google.android.material.snackbar.Snackbar
import java.io.Serializable

inline fun <reified T : Parcelable> Bundle.getObject(key: String): T? =
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
getParcelable(key, T::class.java)
} else {
getParcelable(key) as? T
}

inline fun <reified T : Serializable> Intent.getSerializableCompat(key: String):T? =
inline fun <reified T : Serializable> Intent.getSerializableCompat(key: String): T? =
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
getSerializableExtra(key, T::class.java)
} else {
@Suppress("DEPRECATION")
getSerializableExtra(key) as? T
}

inline fun <reified T : Parcelable> Intent.getObject(key: String): T? =
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
getParcelableExtra(key, T::class.java)
} else {
@Suppress("DEPRECATION")
getParcelableExtra(key) as? T
}

Expand All @@ -56,6 +49,7 @@ fun View.getSystemBarHeightCompat() =
WindowInsetsCompat.Type.systemBars(),
).bottom
} else {
@Suppress("DEPRECATION")
rootWindowInsets.systemWindowInsetBottom
}

Expand Down
Loading
Loading