-
Notifications
You must be signed in to change notification settings - Fork 4
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
[MOB-1676] 버튼 미구현 컨텐츠 구현 #45
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
df80e8f
outlineBorder 추가
sodp5 0e6cb71
outlineBorder 1px 보정 추가
sodp5 f2db6a9
url 오버로딩 추가
sodp5 ceabe0d
Loading 시 베지어 로더로 변경
sodp5 fad7e0f
버튼 컨텐츠 아바타 추가
sodp5 8e371cd
버튼 Emoji 추가
sodp5 bfd6ebb
import 오류 수정
sodp5 cce212c
컨플릭트 잘못 수정된 부분 수정
sodp5 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
This file contains 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
27 changes: 25 additions & 2 deletions
27
...rc/main/java/io/channel/bezier/compose/component/button/properties/BezierButtonContent.kt
This file contains 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 |
---|---|---|
@@ -1,12 +1,35 @@ | ||
package io.channel.bezier.compose.component.button.properties | ||
|
||
import androidx.compose.runtime.Composable | ||
import androidx.compose.runtime.Stable | ||
import androidx.compose.ui.graphics.painter.Painter | ||
import androidx.compose.ui.res.painterResource | ||
import coil.compose.rememberAsyncImagePainter | ||
import io.channel.bezier.BezierIcon | ||
import io.channel.bezier.compose.R | ||
|
||
@Stable | ||
sealed interface BezierButtonContent { | ||
data class Icon(val icon: BezierIcon) : BezierButtonContent | ||
data class Avatar(val painter: Painter) : BezierButtonContent | ||
data class Emoji(val painter: Painter) : BezierButtonContent | ||
class Avatar : BezierButtonContent { | ||
private val _painter: @Composable () -> Painter | ||
val painter: Painter | ||
@Composable | ||
get() = _painter() | ||
|
||
constructor(url: String, error: Painter? = null) { | ||
_painter = { | ||
rememberAsyncImagePainter( | ||
model = url, | ||
error = error ?: painterResource(id = R.drawable.unknown), | ||
) | ||
} | ||
} | ||
|
||
constructor(painter: Painter) { | ||
_painter = { painter } | ||
} | ||
} | ||
|
||
data class Emoji(val name: String) : BezierButtonContent | ||
} |
This file contains 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
This file contains 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이 수치들은 따로 피그마 권한으로만 볼 수 있느건가요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이쪽 스레드 내용 보고 넣은거였어요!
여기에 들어가는 값은 16/20/24 고 없으면 variants에 추가되어야함 으로 이해했어서용
https://desk.channel.io/root/threads/groups/(CT)BezierRedesign-244958/66a9c7f6c49bd5d51d75/66b3087b0bf3451de5b6