-
Notifications
You must be signed in to change notification settings - Fork 0
๐ :: (#173) friend screen publishing #174
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
Merged
Merged
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
12 changes: 12 additions & 0 deletions
12
common/resource/src/main/res/drawable/img_friend_accept.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| <vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
| android:width="24dp" | ||
| android:height="24dp" | ||
| android:viewportWidth="24" | ||
| android:viewportHeight="24"> | ||
| <path | ||
| android:pathData="M12,0L12,0A12,12 0,0 1,24 12L24,12A12,12 0,0 1,12 24L12,24A12,12 0,0 1,0 12L0,12A12,12 0,0 1,12 0z" | ||
| android:fillColor="#5C8EED"/> | ||
| <path | ||
| android:pathData="M17.325,7.913C16.935,7.572 16.356,7.588 15.985,7.934L15.914,8.008L10.823,13.825L8.077,10.775C7.707,10.364 7.075,10.331 6.664,10.7C6.254,11.07 6.221,11.702 6.59,12.113L10.09,16.002C10.281,16.214 10.555,16.335 10.84,16.333C11.126,16.331 11.398,16.206 11.586,15.991L17.419,9.324L17.482,9.244C17.776,8.831 17.715,8.254 17.325,7.913Z" | ||
| android:fillColor="#ffffff"/> | ||
| </vector> |
13 changes: 13 additions & 0 deletions
13
common/resource/src/main/res/drawable/img_friend_empty_plus.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| <vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
| android:width="132dp" | ||
| android:height="270dp" | ||
| android:viewportWidth="132" | ||
| android:viewportHeight="270"> | ||
| <path | ||
| android:pathData="M4,266C4,208.5 31.56,76.89 128,4M128,4L122.47,41.92M128,4H89.29" | ||
| android:strokeLineJoin="round" | ||
| android:strokeWidth="8" | ||
| android:fillColor="#00000000" | ||
| android:strokeColor="#E6E6E6" | ||
| android:strokeLineCap="round"/> | ||
| </vector> |
12 changes: 12 additions & 0 deletions
12
common/resource/src/main/res/drawable/img_friend_reject.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| <vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
| android:width="24dp" | ||
| android:height="24dp" | ||
| android:viewportWidth="24" | ||
| android:viewportHeight="24"> | ||
| <path | ||
| android:pathData="M12,0L12,0A12,12 0,0 1,24 12L24,12A12,12 0,0 1,12 24L12,24A12,12 0,0 1,0 12L0,12A12,12 0,0 1,12 0z" | ||
| android:fillColor="#DD0303"/> | ||
| <path | ||
| android:pathData="M15.293,7.293C15.684,6.902 16.316,6.902 16.707,7.293C17.097,7.683 17.097,8.316 16.707,8.707L13.414,12L16.707,15.293L16.776,15.369C17.096,15.762 17.073,16.341 16.707,16.707C16.341,17.073 15.762,17.096 15.369,16.776L15.293,16.707L12,13.414L8.707,16.707C8.316,17.097 7.683,17.097 7.293,16.707C6.902,16.316 6.902,15.684 7.293,15.293L10.586,12L7.293,8.707L7.224,8.631C6.904,8.238 6.927,7.659 7.293,7.293C7.659,6.927 8.238,6.904 8.631,7.224L8.707,7.293L12,10.586L15.293,7.293Z" | ||
| android:fillColor="#ffffff"/> | ||
| </vector> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| /build |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| plugins { | ||
| id("convention.android.feature") | ||
| } | ||
|
|
||
| android { | ||
| namespace = "com.idiotfrogs.friend" | ||
| } | ||
|
|
||
| dependencies { | ||
| implementation(libs.androidx.core.ktx) | ||
| implementation(libs.androidx.appcompat) | ||
| testImplementation(libs.junit) | ||
| androidTestImplementation(libs.androidx.test.ext) | ||
| androidTestImplementation(libs.androidx.test.espresso) | ||
| } |
Empty file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| # Add project specific ProGuard rules here. | ||
| # You can control the set of applied configuration files using the | ||
| # proguardFiles setting in build.gradle. | ||
| # | ||
| # For more details, see | ||
| # http://developer.android.com/guide/developing/tools/proguard.html | ||
|
|
||
| # If your project uses WebView with JS, uncomment the following | ||
| # and specify the fully qualified class name to the JavaScript interface | ||
| # class: | ||
| #-keepclassmembers class fqcn.of.javascript.interface.for.webview { | ||
| # public *; | ||
| #} | ||
|
|
||
| # Uncomment this to preserve the line number information for | ||
| # debugging stack traces. | ||
| #-keepattributes SourceFile,LineNumberTable | ||
|
|
||
| # If you keep the line number information, uncomment this to | ||
| # hide the original source file name. | ||
| #-renamesourcefileattribute SourceFile |
24 changes: 24 additions & 0 deletions
24
feature/friend/src/androidTest/java/com/idiotfrogs/friend/ExampleInstrumentedTest.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| package com.idiotfrogs.friend | ||
|
|
||
| import androidx.test.platform.app.InstrumentationRegistry | ||
| import androidx.test.ext.junit.runners.AndroidJUnit4 | ||
|
|
||
| import org.junit.Test | ||
| import org.junit.runner.RunWith | ||
|
|
||
| import org.junit.Assert.* | ||
|
|
||
| /** | ||
| * Instrumented test, which will execute on an Android device. | ||
| * | ||
| * See [testing documentation](http://d.android.com/tools/testing). | ||
| */ | ||
| @RunWith(AndroidJUnit4::class) | ||
| class ExampleInstrumentedTest { | ||
| @Test | ||
| fun useAppContext() { | ||
| // Context of the app under test. | ||
| val appContext = InstrumentationRegistry.getInstrumentation().targetContext | ||
| assertEquals("com.idiotfrogs.friend.test", appContext.packageName) | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <manifest xmlns:android="http://schemas.android.com/apk/res/android"> | ||
|
|
||
| </manifest> |
192 changes: 192 additions & 0 deletions
192
feature/friend/src/main/java/com/idiotfrogs/friend/FriendScreen.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,192 @@ | ||
| package com.idiotfrogs.friend | ||
|
|
||
| import android.content.Intent | ||
| import androidx.compose.foundation.Image | ||
| import androidx.compose.foundation.background | ||
| import androidx.compose.foundation.layout.Box | ||
| import androidx.compose.foundation.layout.Column | ||
| import androidx.compose.foundation.layout.PaddingValues | ||
| import androidx.compose.foundation.layout.Spacer | ||
| import androidx.compose.foundation.layout.fillMaxSize | ||
| import androidx.compose.foundation.layout.height | ||
| import androidx.compose.foundation.layout.navigationBarsPadding | ||
| import androidx.compose.foundation.layout.padding | ||
| import androidx.compose.foundation.layout.size | ||
| import androidx.compose.foundation.layout.systemBarsPadding | ||
| import androidx.compose.material3.Icon | ||
| import androidx.compose.runtime.Composable | ||
| import androidx.compose.runtime.LaunchedEffect | ||
| import androidx.compose.runtime.getValue | ||
| import androidx.compose.runtime.mutableStateOf | ||
| import androidx.compose.runtime.remember | ||
| import androidx.compose.runtime.rememberCoroutineScope | ||
| import androidx.compose.runtime.setValue | ||
| import androidx.compose.ui.Alignment | ||
| import androidx.compose.ui.Modifier | ||
| import androidx.compose.ui.platform.LocalContext | ||
| import androidx.compose.ui.res.painterResource | ||
| import androidx.compose.ui.text.font.FontWeight | ||
| import androidx.compose.ui.text.style.TextAlign | ||
| import androidx.compose.ui.tooling.preview.Preview | ||
| import androidx.compose.ui.unit.DpOffset | ||
| import androidx.compose.ui.unit.dp | ||
| import androidx.compose.ui.zIndex | ||
| import androidx.core.content.FileProvider | ||
| import com.idiotfrogs.designsystem.component.MSDetailHeader | ||
| import com.idiotfrogs.designsystem.component.MSMenuFab | ||
| import com.idiotfrogs.designsystem.component.MSText | ||
| import com.idiotfrogs.designsystem.model.MSMenuFabModel | ||
| import com.idiotfrogs.designsystem.theme.MSTheme | ||
| import com.idiotfrogs.designsystem.util.noRippleClickable | ||
| import com.idiotfrogs.friend.component.FriendListItem | ||
| import com.idiotfrogs.friend.component.FriendTopNotification | ||
| import com.idiotfrogs.resource.R | ||
| import kotlinx.coroutines.delay | ||
| import kotlinx.coroutines.launch | ||
|
|
||
| @Composable | ||
| fun FriendScreen( | ||
| modifier: Modifier = Modifier, | ||
| ) { | ||
| val context = LocalContext.current | ||
|
|
||
| var isEmpty by remember { mutableStateOf(false) } | ||
| var isAccept by remember { mutableStateOf(false) } | ||
| var isReject by remember { mutableStateOf(false) } | ||
| var isCopy by remember { mutableStateOf(false) } | ||
| var expanded by remember { mutableStateOf(false) } | ||
| val menuList by remember { | ||
| mutableStateOf( | ||
| listOf( | ||
| MSMenuFabModel("์ฐธ์ฌ ๋งํฌ ๊ณต์ ") { | ||
| expanded = false | ||
|
|
||
| // val imageUri = FileProvider.getUriForFile( | ||
| // context, | ||
| // "${context.packageName}.provider", // provider authority | ||
| // imageFile // File ๊ฐ์ฒด | ||
| // ) | ||
|
|
||
| // ๊ณต์ ์ธํ ํธ ์์ฑ | ||
| val shareIntent = Intent(Intent.ACTION_SEND).apply { | ||
| type = "image/*" | ||
| // putExtra(Intent.EXTRA_STREAM, imageUri) | ||
| putExtra( | ||
| Intent.EXTRA_TEXT, | ||
| "๋ด๊ฐ ๋ง๋ ํ์ ํฐ์ผ์ ํจ๊ปํด์ค! ์๋ ๋งํฌ๋ก ์ฐธ์ฌ ์์ฒญ์ ๋ณด๋ด๋ฉด โํ์ ์บก์ ์ด๋ฆโ์ ํฉ๋ฅํ ์ ์์ด์. [์ด๋ ๋งํฌ]" | ||
| ) | ||
| addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION) | ||
| } | ||
|
|
||
| // ์์คํ ๊ณต์ ๋ฐํ ์ํธ ํ์ | ||
| context.startActivity( | ||
| Intent.createChooser(shareIntent, "๊ณต์ ํ๊ธฐ") | ||
| ) | ||
| }, | ||
| MSMenuFabModel("์ฐธ์ฌ ์ฝ๋ ๋ณต์ฌ") { | ||
| expanded = false | ||
| isCopy = true | ||
| }, | ||
| ) | ||
| ) | ||
| } | ||
|
|
||
| LaunchedEffect( | ||
| isAccept, | ||
| isReject, | ||
| isCopy | ||
| ) { | ||
| delay(1000L) | ||
| isAccept = false | ||
| isReject = false | ||
| isCopy = false | ||
| } | ||
|
|
||
| Box { | ||
| MSMenuFab( | ||
| modifier = Modifier | ||
| .align(Alignment.TopEnd) | ||
| .navigationBarsPadding() | ||
| .padding(end = 20.dp), | ||
| expanded = expanded, | ||
| hasFab = false, | ||
| offset = DpOffset(x = 0.dp, y = 40.dp), | ||
| menuList = menuList, | ||
| onClick = { expanded = !expanded }, | ||
| onDismiss = { expanded = false }, | ||
| ) | ||
|
|
||
| if (isAccept || isReject || isCopy) { | ||
| FriendTopNotification( | ||
| modifier = Modifier | ||
| .align(Alignment.TopCenter) | ||
| .navigationBarsPadding() | ||
| .zIndex(1f), | ||
| isAccept = isAccept, | ||
| isCopy = isCopy | ||
| ) | ||
| } | ||
|
|
||
| Column( | ||
| modifier = modifier | ||
| .fillMaxSize() | ||
| .background(MSTheme.color.white) | ||
| .systemBarsPadding() | ||
| .padding(horizontal = 20.dp), | ||
| horizontalAlignment = Alignment.CenterHorizontally, | ||
| ) { | ||
| MSDetailHeader( | ||
| title = "๋งด๋ฒ ์ถ๊ฐ", | ||
| navigateToBack = {}, | ||
| paddingValues = PaddingValues(horizontal = 0.dp, vertical = 16.dp) | ||
| ) { | ||
| Icon( | ||
| painter = painterResource(R.drawable.ic_plus), | ||
| contentDescription = "Back", | ||
| modifier = Modifier.noRippleClickable { expanded = true } | ||
| ) | ||
| } | ||
| if (isEmpty) { | ||
| Spacer(Modifier.height(25.dp)) | ||
| Icon( | ||
| painter = painterResource(R.drawable.img_friend_empty_plus), | ||
| contentDescription = "emptyIcon", | ||
| tint = MSTheme.color.greyG1, | ||
| modifier = Modifier | ||
| .align(Alignment.End) | ||
| .padding(end = 40.dp) | ||
| ) | ||
| Spacer(Modifier.height(32.dp)) | ||
| MSText( | ||
| text = "๋๊ธฐ์ค์ธ ๋งด๋ฒ๊ฐ ์์ต๋๋ค.\n" + "์ฝ๋ ๋๋ ๋งํฌ๋ก ๋งด๋ฒ๋ฅผ ์ด๋ํด๋ณด์ธ์.", | ||
| color = MSTheme.color.greyG4, | ||
| fontWeight = FontWeight.Normal, | ||
| textAlign = TextAlign.Center | ||
| ) | ||
| } else { | ||
| repeat(10) { // TODO ํ ์คํธ์ฉ ์ฝ๋ -> ์ถ ํ ์ค์ list ๋ณ๊ฒฝ ํ์ | ||
| Spacer(Modifier.height(8.dp)) | ||
| FriendListItem( | ||
| nickName = when (it) { | ||
| 0 -> "ํ๋ ๋ฐ๋๋" | ||
| 1 -> "๊ฒ์ ๋ณต์ญ์" | ||
| 2 -> "๋ณ ๋ชจ์ ํ์ธ์ ํ" | ||
| 3 -> "์ด์ฝ ์ฒด๋ฆฌ" | ||
| 4 -> "์๋ ์๋ฐ" | ||
| else -> "๋ฏผํธ ๋ค๋ชจ ์๋ฐ" | ||
| }, | ||
| onAccept = { isAccept = true }, | ||
| onReject = { isReject = true } | ||
| ) | ||
| Spacer(Modifier.height(8.dp)) | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
|
|
||
| @Preview | ||
| @Composable | ||
| fun FriendScreenPreview() { | ||
| FriendScreen() | ||
| } | ||
85 changes: 85 additions & 0 deletions
85
feature/friend/src/main/java/com/idiotfrogs/friend/component/FriendListItem.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,85 @@ | ||
| package com.idiotfrogs.friend.component | ||
|
|
||
| import androidx.compose.foundation.Image | ||
| import androidx.compose.foundation.background | ||
| import androidx.compose.foundation.layout.Row | ||
| import androidx.compose.foundation.layout.Spacer | ||
| import androidx.compose.foundation.layout.fillMaxWidth | ||
| import androidx.compose.foundation.layout.padding | ||
| import androidx.compose.foundation.layout.size | ||
| import androidx.compose.foundation.layout.width | ||
| import androidx.compose.foundation.shape.RoundedCornerShape | ||
| import androidx.compose.runtime.Composable | ||
| import androidx.compose.ui.Alignment | ||
| import androidx.compose.ui.Modifier | ||
| import androidx.compose.ui.res.painterResource | ||
| import androidx.compose.ui.text.font.FontWeight | ||
| import androidx.compose.ui.tooling.preview.Preview | ||
| import androidx.compose.ui.unit.dp | ||
| import com.idiotfrogs.designsystem.component.MSText | ||
| import com.idiotfrogs.designsystem.theme.MSTheme | ||
| import com.idiotfrogs.designsystem.util.noRippleClickable | ||
| import com.idiotfrogs.resource.R | ||
|
|
||
| @Composable | ||
| fun FriendListItem( | ||
| nickName: String, | ||
| onAccept: () -> Unit, | ||
| onReject: () -> Unit, | ||
| modifier: Modifier = Modifier, | ||
| ) { | ||
| Row( | ||
| modifier = modifier.fillMaxWidth(), | ||
| verticalAlignment = Alignment.CenterVertically | ||
| ) { | ||
| Image( // TODO ์ถ ํ AsyncImage ๋ณ๊ฒฝ ํ์ | ||
| painter = painterResource(R.drawable.img_profile), | ||
| contentDescription = "ํ๋กํ", | ||
| modifier = Modifier.size(48.dp) | ||
| ) | ||
| Spacer(Modifier.width(8.dp)) | ||
| MSText( | ||
| text = nickName, | ||
| color = MSTheme.color.greyG5, | ||
| fontSize = 16.dp, | ||
| fontWeight = FontWeight.Normal, | ||
| ) | ||
|
|
||
| Spacer(Modifier.weight(1f)) | ||
| MSText( | ||
| modifier = Modifier | ||
| .background( | ||
| color = MSTheme.color.greyG1, | ||
| shape = RoundedCornerShape(8.dp) | ||
| ) | ||
| .padding(horizontal = 12.dp, vertical = 7.5.dp) | ||
| .noRippleClickable { onReject() }, | ||
| text = "๊ฑฐ์ ", | ||
| color = MSTheme.color.greyG4, | ||
| fontSize = 14.dp, | ||
| ) | ||
| Spacer(Modifier.width(8.dp)) | ||
| MSText( | ||
| modifier = Modifier | ||
| .background( | ||
| color = MSTheme.color.primaryLight, | ||
| shape = RoundedCornerShape(8.dp) | ||
| ) | ||
| .padding(horizontal = 12.dp, vertical = 7.5.dp) | ||
| .noRippleClickable { onAccept() }, | ||
| text = "์๋ฝ", | ||
| color = MSTheme.color.primaryDark, | ||
| fontSize = 14.dp, | ||
| ) | ||
| } | ||
| } | ||
|
|
||
| @Preview(showBackground = true) | ||
| @Composable | ||
| fun FriendListItemPreview() { | ||
| FriendListItem( | ||
| "nickName", | ||
| onAccept = {}, | ||
| onReject = {}, | ||
| ) | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.