Skip to content

Commit

Permalink
๐Ÿ”€ :: (#173) ์ด๋ฏธ์ง€ gif ํ™•์žฅ์ž ์ œ๊ณต ๋ฐ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ๋ฒ„์ „ ๋Œ€๊ฑฐ ์—…๋ฐ์ดํŠธ
Browse files Browse the repository at this point in the history
๐Ÿ”€ :: (#173) ์ด๋ฏธ์ง€ gif ํ™•์žฅ์ž ์ œ๊ณต ๋ฐ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ๋ฒ„์ „ ๋Œ€๊ฑฐ ์—…๋ฐ์ดํŠธ
  • Loading branch information
JunJaBoy authored Oct 4, 2023
2 parents 32031cf + 2b5f0c0 commit 05b17fc
Show file tree
Hide file tree
Showing 14 changed files with 193 additions and 132 deletions.
4 changes: 2 additions & 2 deletions .idea/deploymentTargetDropDown.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

47 changes: 22 additions & 25 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,17 @@ plugins {
id 'kotlin-android'
id 'kotlin-kapt'
id 'dagger.hilt.android.plugin'
//id 'com.google.gms.google-services'
}

android {
compileSdk 33
compileSdk 34

defaultConfig {
applicationId "com.xquare.xquare_android"
minSdk 24
targetSdk 33
versionCode 36
versionName "1.6.3"
minSdkVersion 24
targetSdkVersion 33
versionCode 37
versionName "1.6.4"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
Expand Down Expand Up @@ -50,47 +49,45 @@ android {
}

dependencies {

implementation project(":di")
implementation project(":domain")

// implementation platform('com.google.firebase:firebase-bom:32.0.0')
// implementation 'com.google.firebase:firebase-analytics-ktx'
implementation 'com.google.code.gson:gson:2.10.1'
implementation 'com.google.firebase:firebase-messaging:23.2.1'

implementation 'androidx.core:core-ktx:1.10.0'
implementation 'androidx.work:work-runtime-ktx:2.8.1'

implementation 'com.google.firebase:firebase-messaging:23.1.2'
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.6.2'

implementation 'androidx.core:core-ktx:1.7.0'
implementation 'androidx.activity:activity-compose:1.7.2'
implementation "androidx.compose.ui:ui:$compose_version"
implementation "androidx.compose.material:material:$compose_version"
implementation "androidx.compose.ui:ui-tooling:$compose_version"
implementation "androidx.compose.ui:ui-tooling-preview:$compose_version"
implementation 'androidx.work:work-runtime-ktx:2.7.1'
androidTestImplementation "androidx.compose.ui:ui-test-junit4:$compose_version"

def nav_version = "2.5.3"
implementation("androidx.navigation:navigation-compose:$nav_version")
implementation("io.coil-kt:coil-gif:2.4.0")
implementation("io.coil-kt:coil-compose:2.4.0")

implementation "androidx.navigation:navigation-compose:2.6.0"

implementation "com.google.dagger:hilt-android:$hilt_version"
implementation "com.google.dagger:hilt-android-compiler:$hilt_version"
kapt "com.google.dagger:hilt-android-compiler:$hilt_version"
implementation "androidx.hilt:hilt-navigation-compose:1.0.0"

implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.4.1'
implementation 'androidx.activity:activity-compose:1.4.0'

testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
androidTestImplementation "androidx.compose.ui:ui-test-junit4:$compose_version"
debugImplementation "androidx.compose.ui:ui-tooling:$compose_version"
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'

implementation "com.jakewharton.threetenabp:threetenabp:1.3.1"

implementation("io.coil-kt:coil-compose:2.0.0-rc01")

implementation "com.github.semicolondsm:SemicolonDesign_Android:1.3.0"
implementation "com.google.accompanist:accompanist-pager:0.26.5-rc"
implementation "com.google.accompanist:accompanist-pager-indicators:0.26.5-rc"

implementation 'com.google.code.gson:gson:2.9.1'
implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.1.0"

}

apply plugin: 'com.google.gms.google-services'
Binary file modified app/release/app-release.aab
Binary file not shown.
5 changes: 2 additions & 3 deletions app/src/main/java/com/xquare/xquare_android/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ import com.xquare.xquare_android.feature.imagedetail.ImageDetailScreen
import com.xquare.xquare_android.feature.onboard.OnboardScreen
import com.xquare.xquare_android.feature.pick.PassScreen
import com.xquare.xquare_android.feature.point_history.PointHistoryScreen
import com.xquare.xquare_android.feature.profile.ProfileScreen
import com.xquare.xquare_android.feature.profile.MyPageScreen
import com.xquare.xquare_android.feature.release.ReleaseScreen
import com.xquare.xquare_android.feature.schedule.ScheduleScreen
import com.xquare.xquare_android.feature.schedule.WriteScheduleScreen
Expand All @@ -59,7 +59,6 @@ import com.xquare.xquare_android.util.getNavigationBarHeightDp
import com.xquare.xquare_android.util.getStatusBarHeightDp
import com.xquare.xquare_android.util.setStatusBarTransparent
import dagger.hilt.android.AndroidEntryPoint
import java.io.File
import java.net.URLDecoder
import java.nio.charset.StandardCharsets

Expand Down Expand Up @@ -170,7 +169,7 @@ fun BaseApp() {
PointHistoryScreen(navController)
}
composable(AppNavigationItem.Profile.route) {
ProfileScreen(navController)
MyPageScreen(navController)
}
composable(AppNavigationItem.Bug.route) {
BugReportScreen(navController)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,26 +19,22 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.painter.ColorPainter
import androidx.compose.ui.graphics.painter.Painter
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import coil.compose.rememberAsyncImagePainter
import com.semicolon.design.Body1
import com.semicolon.design.Body2
import com.semicolon.design.Body3
import com.semicolon.design.Subtitle4
import com.semicolon.design.color.primary.gray.gray200
import com.semicolon.design.color.primary.gray.gray50
import com.semicolon.design.color.primary.gray.gray700
import com.semicolon.design.color.primary.gray.gray900
import com.semicolon.design.color.primary.purple.purple200
import com.xquare.domain.entity.github.GithubInformationEntity
import com.xquare.domain.entity.github.GithubListEntity
import com.xquare.xquare_android.R
import com.xquare.xquare_android.util.rememberAsyncGifImagePainter
import java.text.DecimalFormat

fun formatNumberWithComma(number: Int): String {
Expand All @@ -62,11 +58,7 @@ fun GithubRankingItem(
verticalAlignment = Alignment.CenterVertically,
) {
Image(
painter = rememberAsyncImagePainter(
model = githubInformation?.profileFilename,
placeholder = ColorPainter(gray200),
error = painterResource(id = R.drawable.ic_profile_default)
),
painter = rememberAsyncGifImagePainter(githubInformation?.profileFilename),
contentScale = ContentScale.Crop,
contentDescription = null,
modifier = Modifier
Expand All @@ -75,8 +67,16 @@ fun GithubRankingItem(
)
Spacer(Modifier.size(10.dp))
Column {
Body2(text = "${githubInformation?.ranking}์œ„ : ${githubInformation?.name}", fontWeight = FontWeight.Medium, color = gray900)
Body3(text = "@${githubInformation?.username}", fontWeight = FontWeight.Normal, color = gray700)
Body2(
text = "${githubInformation?.ranking}์œ„ : ${githubInformation?.name}",
fontWeight = FontWeight.Medium,
color = gray900,
)
Body3(
text = "@${githubInformation?.username}",
fontWeight = FontWeight.Normal,
color = gray700,
)
}
Spacer(Modifier.weight(1f))
Box(
Expand All @@ -97,22 +97,20 @@ fun GithubRankingItem(

@Composable
fun GithubItem(
githubList: GithubListEntity.GithubUserListEntity,
githubUser: GithubListEntity.GithubUserListEntity,
modifier: Modifier = Modifier,
crown: Painter,
color: Color,
centerPadding: Dp,
tint: Color,
image: Dp
) {

Column(
modifier = modifier
.background(gray50, RoundedCornerShape(12.dp))
.border(width = 1.dp, color = color, shape = RoundedCornerShape(12.dp)),
horizontalAlignment = Alignment.CenterHorizontally
) {

Column(
Modifier.padding(top = 10.dp, bottom = 10.dp),
horizontalAlignment = Alignment.CenterHorizontally
Expand All @@ -125,11 +123,7 @@ fun GithubItem(
tint = tint
)
Image(
painter = rememberAsyncImagePainter(
model = githubList.profile_file_name,
placeholder = ColorPainter(gray200),
error = painterResource(id = R.drawable.ic_profile_default)
),
painter = rememberAsyncGifImagePainter(githubUser.profile_file_name),
contentScale = ContentScale.Crop,
contentDescription = null,
modifier = Modifier
Expand All @@ -139,19 +133,31 @@ fun GithubItem(
)
}
Spacer(Modifier.height(centerPadding))
Subtitle4(text = githubList.name, color = gray900, fontWeight = FontWeight.SemiBold)
Body3(text = " @${githubList.username}", color = gray700, fontWeight = FontWeight.Normal)
Body3(text = "${formatNumberWithComma(githubList.contributions)} ์ปค๋ฐ‹", color = gray900, fontWeight = FontWeight.Medium)
Subtitle4(text = githubUser.name, color = gray900, fontWeight = FontWeight.SemiBold)
Body3(
text = " @${githubUser.username}",
color = gray700,
fontWeight = FontWeight.Normal
)
Body3(
text = "${formatNumberWithComma(githubUser.contributions)} ์ปค๋ฐ‹",
color = gray900,
fontWeight = FontWeight.Medium
)
}
}
}

@Composable
fun GithubAllRankingItem(
githubList: GithubListEntity.GithubUserListEntity,
githubUser: GithubListEntity.GithubUserListEntity,
borderState: Boolean,
) {
val borderColor = if (borderState) purple200 else gray50
val borderColor = if (borderState) {
purple200
} else {
gray50
}
Row(
modifier = Modifier
.fillMaxWidth()
Expand All @@ -162,10 +168,7 @@ fun GithubAllRankingItem(
verticalAlignment = Alignment.CenterVertically,
) {
Image(
painter = rememberAsyncImagePainter(
model = githubList.profile_file_name,
error = painterResource(id = R.drawable.ic_profile_default)
),
painter = rememberAsyncGifImagePainter(githubUser.profile_file_name),
contentScale = ContentScale.Crop,
contentDescription = null,
modifier = Modifier
Expand All @@ -174,8 +177,12 @@ fun GithubAllRankingItem(
)
Spacer(Modifier.size(10.dp))
Column {
Body2(text = "${githubList.ranking}์œ„ : ${githubList.name}", fontWeight = FontWeight.Medium, color = gray900)
Body3(text = "@${githubList.username}", fontWeight = FontWeight.Normal, color = gray700)
Body2(
text = "${githubUser.ranking}์œ„ : ${githubUser.name}",
fontWeight = FontWeight.Medium,
color = gray900
)
Body3(text = "@${githubUser.username}", fontWeight = FontWeight.Normal, color = gray700)
}
Spacer(Modifier.weight(1f))
Box(
Expand All @@ -185,7 +192,7 @@ fun GithubAllRankingItem(
.padding(bottom = 5.dp)
) {
Body1(
text = "${formatNumberWithComma(githubList.contributions)} ์ปค๋ฐ‹",
text = "${formatNumberWithComma(githubUser.contributions)} ์ปค๋ฐ‹",
fontWeight = FontWeight.Medium,
color = gray900,
modifier = Modifier
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ fun Github(
) {
GithubItem(
modifier = Modifier.weight(1f),
githubList = githubList.users[1],
githubUser = githubList.users[1],
crown = painterResource(id = R.drawable.ic_github_crown),
color = Silver,
centerPadding = 10.dp,
Expand All @@ -122,7 +122,7 @@ fun Github(
)
GithubItem(
modifier = Modifier.weight(1f),
githubList = githubList.users[0],
githubUser = githubList.users[0],
crown = painterResource(id = R.drawable.ic_github_crown),
color = Gold,
centerPadding = 25.dp,
Expand All @@ -131,7 +131,7 @@ fun Github(
)
GithubItem(
modifier = Modifier.weight(1f),
githubList = githubList.users[2],
githubUser = githubList.users[2],
crown = painterResource(id = R.drawable.ic_github_crown),
color = Bronze,
centerPadding = 8.dp,
Expand All @@ -158,7 +158,7 @@ fun Github(
) {
items(githubList.users.count()) {
GithubAllRankingItem(
githubList = githubList.users[it],
githubUser = githubList.users[it],
borderState = false
)
}
Expand Down
Loading

0 comments on commit 05b17fc

Please sign in to comment.