tgyuuAn / BaekyoungE

์ž์—ฐ์–ด ์ฒ˜๋ฆฌ ๊ธฐ๋ฐ˜ ์ง„๋กœ ์ƒ๋‹ด chat bot ์–ดํ”Œ๋ฆฌ์ผ€์ด์…˜
7 stars 0 forks source link

Feature/#37 #40

Closed tgyuuAn closed 7 months ago

tgyuuAn commented 7 months ago

1. ๐Ÿ“„ ๊ด€๋ จ๋œ ์ด์Šˆ ๋ฐ ์†Œ๊ฐœ

2. ๐Ÿ”ฅ๋ณ€๊ฒฝ๋œ ์ 

3. ๐Ÿ“ธ ์Šคํฌ๋ฆฐ์ƒท(์„ ํƒ)

++ ์ถ”ํ›„์— Loading Animation ์†Œ๊ฑฐ ํ›„ ๋นˆ ViewHolder๋ฅผ ๋„ฃ๋Š” ๊ฒŒ ๋” ์ด์  ๊ฒƒ ๊ฐ™๋”ฐ.

ํ•˜์ง€๋งŒ ์ด๊ฑด ๋„ˆ๋ฌด ๊ท€์ฐฎ์€ ์ผ์ด๊ณ  ๋‹น์žฅ ํ•„์š”ํ•˜์ง€ ์•Š์€ ๊ธฐ๋Šฅ์ด๋ฏ€๋กœ ๋ฌด๊ธฐํ•œ ์—ฐ์žฅ์ด๋‹ค.

4. ๐Ÿ’ก์•Œ๊ฒŒ๋œ ํ˜น์€ ๊ถ๊ธˆํ•œ ์‚ฌํ•ญ๋“ค

Compose Modal BottomSheet

๊ณต์‹๋ฌธ์„œ




Button ๋‚ด๋ถ€์— ์žˆ๋Š” Text ๊ฐ€์šด๋ฐ ์ •๋ ฌ์„ ํ•˜๊ณ  ์‹ถ๋‹ค๊ตฌ์š”?

๋ ˆํผ๋Ÿฐ์Šค

 textAlign = TextAlign.Center,  // horizontal center of the text
                modifier = Modifier.align(Alignment.CenterVertically) //vertical center of the Text composable

textAlign๊ณผ rowScopeAlignment์˜ align์„ ์‚ฌ์šฉํ•˜๋ฉด ํ•ด๊ฒฐํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค์šง




rememberCoroutineScope() ๋ฅผ ์–ด๋””๊นŒ์ง€ ํ˜ธ์ด์ŠคํŒ… ํ•  ์ˆ˜ ์žˆ์„๊นŒ...?

์ฒ˜์Œ ์‚ฌ๊ณ 

Composable ํ•จ์ˆ˜ ์•ˆ์—์„œ Coroutine ์„ ์‚ฌ์šฉํ•˜๊ธฐ ์œ„ํ•ด์„œ๋Š”, rememberCoroutineScope()์™€ ๊ฐ™์ด ์ฝ”๋ฃจํ‹ด ์Šค์ฝ”ํ”„๋ฅผ ๋”ฐ๋กœ ์—ด์–ด์ค˜์•ผํ•˜๋Š”๋ฐ,

์ด๊ฑฐ ๊ทธ๋ƒฅ ์‚ฌ์šฉํ•˜๋Š” ์ปดํฌ์ €๋ธ” ํ•จ์ˆ˜ ๋‚ด๋ถ€๊ฐ€ ์•„๋‹ˆ๋ผ Route ๋‹จ์œ„์˜ ๊ฐ€์žฅ ์ตœ์ƒ์œ„ Composable๊นŒ์ง€ ํ˜ธ์ด์ŠคํŒ…ํ•ด์„œ ์˜ฌ๋ ค๋ฒ„๋ฆฌ๋ฉด,

ํ•˜๋‚˜์˜ ์ฝ”๋ฃจํ‹ด ์Šค์ฝ”ํ”„๋กœ ๋ชจ๋“  ์ค‘๋‹จ ํ•จ์ˆ˜๋ฅผ ์‹คํ–‰ํ•  ์ˆ˜ ์žˆ์œผ๋‹ˆ๊นŒ ๋” ์ข‹์€๊ฑฐ ์•„๋‹ˆ์•ผ ...? ๋ผ๊ณ  ์ƒ๊ฐํ–ˆ๋‹ค.







๊นจ๋‹ฌ์Œ..

๊ทผ๋ฐ,, ๋งŒ์•ฝ ๊ทธ๋ ‡๊ฒŒ ํ•˜๊ฒŒ ๋  ๊ฒฝ์šฐ ํ•ด๋‹น Composable์˜ ์ƒ๋ช… ์ฃผ๊ธฐ๊ฐ€ ๋๋‚ฌ์Œ์—๋„ ํ•ด๋‹น ์ค‘๋‹จํ•จ์ˆ˜๋Š” ๊ฒŒ์†ํ•ด์„œ ์‹คํ–‰๋˜๊ฒŒ ๋œ๋‹ค...

ํ•ด๋‹น Composable ํ•จ์ˆ˜๊ฐ€ ์ฃฝ์œผ๋ฉด ํ•ด๋‹น ์ค‘๋‹จ ํ•จ์ˆ˜๋„ ์ทจ์†Œ๋˜์–ด์•ผ์ง€...!

์ฆ‰, ํ•ด๋‹น Composable์—๋งŒ ์ข…์†๋˜์–ด์•ผ ํ•  ๊ฒฝ์šฐ ํ•ด๋‹น Composable ๋‚ด๋ถ€์— rememberCoroutineScope()๋ฅผ ํ•˜๋Š” ๊ฒƒ์ด ๋งž๊ณ ,

๋ญ ๊ทธ๋Ÿด ๊ฒฝ์šฐ๋Š” ์ข€ ๋“œ๋ฌผ๊ฒ ์ง€๋งŒ ํ•ด๋‹น Composable ์™ธ๋ถ€์˜ ์˜์—ญ๊นŒ์ง€ ํผ์ง€๋Š” sideEffect๊ฐ€ ์žˆ์–ด์•ผ ํ•œ๋‹ค๋ฉด ์™ธ๋ถ€์— ์ƒ์„ฑํ•ด์„œ ๋„˜๊ฒจ์ฃผ๋Š”....? (์•„์ง ์ž˜ ์ƒ๊ฐ์€ ์•ˆ๋‚œ๋‹ค.)

๋ ˆํผ๋Ÿฐ์Šค




wheelPicker

git ์‚ฌ์šฉ๋ฒ•

์ด๊ฑด .... ์•„์ง ๋‚ด ๋ ˆ๋ฒจ์ด..

์ผ๋‹จ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ์‚ฌ์šฉํ–ˆ๋”ฐ.




Android Compose Modal BottomSheet ๋“œ๋ž˜๊ทธ๋กœ ์‚ฌ๋ผ์ง€๋Š” ๊ฒƒ ๋ง‰๊ธฐ

๋Œ€์•ˆ 1. verticalScrollDisabled() Modifier ์‚ฌ์šฉ.

๋ ˆํผ๋Ÿฐ์Šค

fun Modifier.verticalScrollDisabled() =
    pointerInput(Unit) {
        awaitPointerEventScope {
            while (true) {
                awaitPointerEvent(pass = PointerEventPass.Initial).changes.forEach {
                    val offset = it.positionChange()
                    if (abs(offset.y) > 0f) {
                        it.consume()
                    }
                }
            }
        }
    }

๊ฒฐ๊ณผ




๋Œ€์•ˆ 2. rememberModalBottomSheetState์—์„œ confirmStateChanged๋ฅผ false๋กœ ๋ฐ”๊ฟˆ

val state = rememberModalBottomSheetState(
    initialValue= ModalBottomSheetValue.Hidden, 
    confirmStateChange = {false})

๊ฒฐ๊ณผ






์ถ”์ฒœ ๋ ˆํผ๋Ÿฐ์Šค1

์ถ”์ฒœ ๋ ˆํผ๋Ÿฐ์Šค2

์ผ๋‹จ ๋งˆ์ด๊ทธ๋ ˆ์ด์…˜ ๋น„์šฉ ์ข€ ์žˆ์œผ๋‹ˆ Keep...

์•„์ง ํ•ด๊ฒฐํ•˜์ง€ ๋ชปํ–ˆ์Œ




EditTextField์— ๋ฐ”๋กœ Focus ์ค˜์„œ Keyboard ์˜ฌ๋ผ๊ฐ€๊ฒŒ ํ•˜๋Š” ๋ฒ•!!

๋ ˆํผ๋Ÿฐ์Šค

val focusRequester = remember { FocusRequester() }

LaunchedEffect(true) {
    focusRequester.requestFocus()
}

SettingTextField(
    text = newMajor,
    onTextChanged = onNewMajorChanged,
    onConfirm = { },
    hint = stringResource(id = R.string.hint_nickname),
    modifier = Modifier
        .padding(horizontal = 20.dp)
        .focusRequester(focusRequester),     // <- ํฌ์ปค์Šค ์ฃผ๊ณ ์‹ถ์€ ๊ณณ์—๋‹ค๊ฐ€ modifier ๋‹ฌ์•„๋ถ€๋ ค
)