Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

패키지 구조 변경 및 코드 리팩토링 #17

Merged
merged 24 commits into from
Sep 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
f3b9863
gradle version up
jhg3410 Feb 18, 2024
9dce804
libs version up
jhg3410 Feb 18, 2024
4634069
java version up
jhg3410 Feb 18, 2024
d70a53f
lib-videoplayer apply version catalog
jhg3410 Feb 18, 2024
ced711d
pytube issue 로 변경했던 코드 롤백
jhg3410 Feb 18, 2024
7c069ff
Popular 화면 State, 객체(영화 목록) 분리
jhg3410 Feb 19, 2024
f8ef901
NavHost maxSize 적용 및 불필요한 조건문 제거
jhg3410 Feb 19, 2024
c508125
DetailViewModel Flow 를 계속 생성하고 viewModel 에서 collect 하는 방식 수정
jhg3410 Feb 20, 2024
5513fe5
PopularViewModel Flow 를 계속 생성하고 viewModel 에서 collect 하는 방식, scope 수정
jhg3410 Feb 20, 2024
788c2f0
HomeViewModel Flow 를 계속 생성하고 viewModel 에서 collect 하는 방식, scope 수정
jhg3410 Feb 20, 2024
19fef3e
VideoPlayer 내부 videoUrl, videoId 용어 구분 및 수정
jhg3410 Feb 20, 2024
27de509
core 모듈 리팩토링
jhg3410 Feb 23, 2024
5624640
feature:detail 모듈 리팩토링
jhg3410 Feb 23, 2024
dbb4713
lib-videoplayer 모듈 리팩토링(함수, 변수명 변경, 불필요한 코드 제거)
jhg3410 Mar 9, 2024
d35d6c6
lib-videoplayer 모듈 LifecycleStartEffect 로 변경 및 errorMessage 변환 코드 변경
jhg3410 Mar 10, 2024
b8d3a7b
videoPlayer Controller 참조 대신 rememberUpdatedState 으로 불필요한 Recompositi…
jhg3410 Mar 12, 2024
3c9c7ab
module feature, core, lib 폴더화
jhg3410 Jul 4, 2024
5de067e
feature:detail 패키지 구조 변경
jhg3410 Jul 5, 2024
7ba3d29
feature:home 패키지 구조 변경
jhg3410 Jul 5, 2024
608d90e
feature:popular 패키지 구조 변경
jhg3410 Jul 5, 2024
7462acb
libs version up
jhg3410 Aug 5, 2024
aa49e34
library 변경 pytube -> pytubefix
jhg3410 Aug 5, 2024
e5c990d
Update android-ci.yml
jhg3410 Sep 2, 2024
c74933d
UiStateTest 제거
jhg3410 Sep 2, 2024
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
4 changes: 2 additions & 2 deletions .github/workflows/android-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ jobs:

steps:
- uses: actions/checkout@v3
- name: set up JDK 11
- name: set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '11'
java-version: '17'
distribution: 'temurin'
cache: gradle

Expand Down
27 changes: 14 additions & 13 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ plugins {

android {
namespace = "com.jik.movie"
compileSdk = 33
compileSdk = 34

defaultConfig {
applicationId = "com.jik.movie"
minSdk = 24
targetSdk = 33
targetSdk = 34
versionCode = 1
versionName = "0.3.0"

Expand All @@ -30,22 +30,23 @@ android {
"proguard-rules.pro"
)
)
signingConfig = signingConfigs.getByName("debug")
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = "1.8"
jvmTarget = JavaVersion.VERSION_17.toString()
}
buildFeatures {
compose = true
}
composeOptions {
kotlinCompilerExtensionVersion = "1.4.3"
}
packagingOptions {
packaging {
resources {
excludes += "/META-INF/{AL2.0,LGPL2.1}"
}
Expand All @@ -55,13 +56,13 @@ android {
dependencies {

// modules
implementation(projects.coreDesignsystem)
implementation(projects.coreUi)
implementation(projects.coreModel)
implementation(projects.coreData)
implementation(projects.featureHome)
implementation(projects.featurePopular)
implementation(projects.featureDetail)
implementation(projects.core.designsystem)
implementation(projects.core.ui)
implementation(projects.core.model)
implementation(projects.core.data)
implementation(projects.feature.home)
implementation(projects.feature.popular)
implementation(projects.feature.detail)

implementation(libs.androidx.ktx)
implementation(libs.androidx.runtime.ktx)
Expand Down
13 changes: 4 additions & 9 deletions app/src/main/java/com/jik/movie/ui/MovieApp.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import androidx.compose.animation.AnimatedVisibility
import androidx.compose.animation.slideInVertically
import androidx.compose.animation.slideOutVertically
import androidx.compose.foundation.layout.WindowInsets
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.Scaffold
import androidx.compose.runtime.Composable
Expand All @@ -13,7 +14,6 @@ import com.jik.core.designsystem.component.MovieNavigationBar
import com.jik.core.designsystem.component.MovieNavigationBarItem
import com.jik.core.designsystem.component.NavigationBarCornerSize
import com.jik.core.designsystem.theme.MovieTheme
import com.jik.core.ui.util.modifier.conditional
import com.jik.movie.navigation.MovieNavHost
import com.jik.movie.navigation.TopLevelDestination

Expand All @@ -34,18 +34,13 @@ fun MovieApp() {
},
contentWindowInsets = WindowInsets(0.dp)
) {
val topPadding = it.calculateTopPadding()
val bottomPadding = it.calculateBottomPadding()

MovieNavHost(
navController = appState.navController,
modifier = Modifier.conditional(destination != null) {
padding(
top = topPadding,
bottom = if (destination != null && bottomPadding > 0.dp) bottomPadding - NavigationBarCornerSize
else bottomPadding
)
}
modifier = Modifier
.fillMaxSize()
.padding(bottom = if (bottomPadding > 0.dp) bottomPadding - NavigationBarCornerSize else bottomPadding)
)
}
}
Expand Down
7 changes: 0 additions & 7 deletions core-ui/src/main/java/com/jik/core/ui/util/DimensionUtils.kt

This file was deleted.

This file was deleted.

90 changes: 0 additions & 90 deletions core-ui/src/test/java/com/jik/core/ui/UiStateTest.kt

This file was deleted.

File renamed without changes.
13 changes: 6 additions & 7 deletions core-data/build.gradle.kts → core/data/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@ plugins {

android {
namespace = "com.jik.core.data"
compileSdk = 33
compileSdk = 34

defaultConfig {
minSdk = 24
targetSdk = 33

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles("consumer-rules.pro")
Expand All @@ -27,18 +26,18 @@ android {
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = "1.8"
jvmTarget = JavaVersion.VERSION_17.toString()
}
}

dependencies {
// modules
implementation(projects.coreModel)
implementation(projects.coreNetwork)
implementation(projects.core.model)
implementation(projects.core.network)

implementation(libs.androidx.ktx)

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@ plugins {

android {
namespace = "com.jik.core.designsystem"
compileSdk = 33
compileSdk = 34

defaultConfig {
minSdk = 24
targetSdk = 33

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles("consumer-rules.pro")
Expand All @@ -32,18 +31,18 @@ android {
kotlinCompilerExtensionVersion = "1.4.3"
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = "1.8"
jvmTarget = JavaVersion.VERSION_17.toString()
}
}

dependencies {

// modules
implementation(projects.coreUi)
implementation(projects.core.ui)

implementation(libs.androidx.ktx)
implementation(libs.androidx.navigation)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ fun GradientPosterCard(
placeholder: Painter? = null,
alignment: Alignment = Alignment.Center,
contentScale: ContentScale = ContentScale.Fit,
gradientArea: GradientArea = GradientArea.TOP_BOTTOM
gradientArea: GradientArea = GradientArea.VERTICAL
) {
Surface(modifier = modifier) {
ElevatedCard(
Expand Down Expand Up @@ -104,22 +104,22 @@ fun GradientPosterCard(
)

val colorStops = when (gradientArea) {
GradientArea.TOP_BOTTOM -> colorStopsOfTopBottom
GradientArea.VERTICAL -> colorStopsOfTopBottom
GradientArea.TOP -> colorStopsOfTop
GradientArea.BOTTOM -> colorStopsOfBottom
}

Box(
modifier = Modifier
.fillMaxSize()
.background(Brush.verticalGradient(colorStops = colorStops))
.background(brush = Brush.verticalGradient(colorStops = colorStops))
)
}
}


enum class GradientArea {
TOP_BOTTOM,
VERTICAL,
TOP,
BOTTOM,
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,22 @@ package com.jik.core.designsystem.component
import androidx.compose.animation.core.animateFloatAsState
import androidx.compose.foundation.interaction.MutableInteractionSource
import androidx.compose.foundation.interaction.collectIsPressedAsState
import androidx.compose.foundation.layout.*
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.RowScope
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.windowInsetsPadding
import androidx.compose.foundation.selection.selectable
import androidx.compose.foundation.selection.selectableGroup
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.*
import androidx.compose.material3.Icon
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.NavigationBarDefaults
import androidx.compose.material3.Surface
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.remember
Expand Down Expand Up @@ -48,7 +59,6 @@ fun MovieNavigationBar(
modifier = Modifier
.fillMaxWidth()
.windowInsetsPadding(NavigationBarDefaults.windowInsets)
.height(52.dp)
.selectableGroup(),
horizontalArrangement = Arrangement.spacedBy(8.dp),
content = content
Expand All @@ -68,10 +78,10 @@ fun RowScope.MovieNavigationBarItem(
) {
val interactionSource = remember { MutableInteractionSource() }
val isPressed by interactionSource.collectIsPressedAsState()
val scale = animateFloatAsState(targetValue = if (isPressed) 0.8f else 1f)
val scale = animateFloatAsState(targetValue = if (isPressed) 0.8f else 1f, label = "")

Box(
modifier
modifier = modifier
.selectable(
selected = selected,
onClick = onClick,
Expand All @@ -81,7 +91,8 @@ fun RowScope.MovieNavigationBarItem(
indication = null,
)
.weight(1f)
.scale(scale.value),
.scale(scale.value)
.padding(vertical = 4.dp),
contentAlignment = Alignment.Center
) {
if (labelTextId == null) {
Expand Down Expand Up @@ -122,7 +133,6 @@ private fun MovieNavigationBarItemLabelAndIcon(
labelTextId: Int,
) {
Column(
modifier = Modifier.fillMaxSize(),
verticalArrangement = Arrangement.Center,
horizontalAlignment = Alignment.CenterHorizontally
) {
Expand Down
Loading
Loading