Skip to content

Instantly share code, notes, and snippets.

View acious's full-sized avatar

Jongchan Kim acious

View GitHub Profile
@acious
acious / UserViewData.kt
Created June 6, 2025 08:30
C.C - Presentaion Layer
// file: presentation/UserViewData.kt
import java.util.Calendar
/**
* UI에 표시하기 위해 가공된 데이터 클래스.
* Entity와 달리, UI에 필요한 형태로 포맷팅된 텍스트나 상태를 가집니다.
*/
data class UserViewData(
val displayName: String, // 예: "이름: 홍길동"
val age: String, // 예: "나이: 30세"
@acious
acious / UserDto.kt
Created June 6, 2025 08:29
C.C - Data Layer
// file: data/UserDto.kt
import com.google.gson.annotations.SerializedName
/**
* 데이터 전송 객체 (Data Transfer Object).
* API 응답과 1:1로 매핑되는 모델입니다. 필드명이 다를 수 있습니다.
*/
data class UserDto(
@SerializedName("user_id") val userId: String,
@SerializedName("full_name") val fullName: String,
@acious
acious / User.kt
Created June 6, 2025 08:28
C.C - Domain Layer
// file: domain/User.kt
/**
* 순수한 비즈니스 모델 (Entity).
* 앱의 핵심 도메인이며, 데이터베이스나 UI에 대한 정보를 전혀 모릅니다.
*/
data class User(
val id: String,
val name: String,
val email: String,
val birthYear: Int
@acious
acious / ComposeOnExposeExample.kt
Created December 12, 2024 17:39
Android Compose - Composable(View) onExpose Implementation
@SuppressLint("CoroutineCreationDuringComposition", "UnnecessaryComposedModifier")
@Composable
fun Modifier.onExpose(
onVisibilityChanged: (Boolean) -> Unit,
exposeCriteriaSizeRate: Float = 1f,
): Modifier = composed {
this.onGloballyPositioned { layoutCoordinates ->
val boundsInWindow = layoutCoordinates.boundsInWindow()
val totalArea = layoutCoordinates.size.run { width * height }.toFloat()
val visibleArea = boundsInWindow.width * boundsInWindow.height
@acious
acious / SWM-sched-intro-response.json
Last active May 20, 2023 10:49
SWM-sched-intro-response.json
{
"data":{
"recommandUpdateVersion" : "1.0.5",
"forceUpdateVersion" : "1.0.2",
"loggingSheetUrl":"19VAa-lorpfCz0GMrJT_RHTJtygiBwYnN65bnKw3FKoU",
"renderTrackingSheetUrl":"19VAa-lorpfCz0GMrJT_RHTJtygiBwYnN65bnKw3FKoU"
}
}
@acious
acious / navigation-with-be.json
Created April 24, 2023 08:58
navigation-with-be.json
{
"responseData" : {
"screenName":"Home",
"viewContents" : [
{
"viewType" : "cashPromotionViewType",
"content" : {
"titleRichText" : [
{
"text" : "김종찬님, 냉장고 채울 때가 됐어요!",
@acious
acious / cash-promotion-final.json
Last active July 25, 2025 11:55
cash-promotion-final.json
{
"responseData" : {
"screenName":"Home",
"viewContents" : [
{
"viewType" : "cashPromotionViewType",
"content" : {
"promotions" : [
{
"richContents" : [
@acious
acious / cash-promotion-A.json
Created April 24, 2023 08:15
cash-promotion-A.json
{
"responseData" : {
"screenName":"Home",
"viewContents" : [
{
"viewType" : "cashPromotionViewType",
"content" : {
"promotions" : [
{
"startIcon" : {
@acious
acious / WeatherHomeB.json
Created April 24, 2023 07:09
WeatherHomeB.json
{
"responseData" : {
"screenName":"Home",
"viewContents" : [
{
"viewType" : "BigCarouselViewType",
"content" : {
"items": [
{
"primaryText" : "06:00",
@acious
acious / 200OK-A.json
Last active April 29, 2023 00:50
200OK.json
{
"responseData" : {
"screenName":"Home",
"viewContents" : [
{
"viewType" : "oneDayWeatherViewType",
"content" : {
"primaryTitle" : "April 3 (Mon) 14",
"centerImgUrl" : "https://res.swm.com/2x/clear-sky.png",
"primaryContentText" : "Clear Sky",