Skip to content

๐Ÿงถ2019 ์†ํŠธ APP-JAM : "Fluff - ๋นˆํ‹ฐ์ง€ ์˜๋ฅ˜ ํ”Œ๋žซํผ"

Notifications You must be signed in to change notification settings

Yanghyesun/Fluff_Android

ย 
ย 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Fluff_Android

BY ์ตœํ˜ธ์ค€, ๊น€์œ ๋‚˜, ์–‘ํ˜œ์„ 

1. ํ”„๋กœ์ ํŠธ ์‚ฌ์šฉ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ! (2020.01.03 ์ˆ˜์ •)

implementation 'com.google.android.material:material:1.0.0'
implementation 'com.android.support:design:29.0.0'
//๋ฆฌ์‚ฌ์ดํด๋Ÿฌ๋ทฐ
implementation 'androidx.recyclerview:recyclerview:1.0.0'

//Retrofit ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ : https://github.com/square/retrofit
implementation 'com.squareup.retrofit2:retrofit:2.6.2'
//Retrofit ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ์‘๋‹ต์œผ๋กœ ๊ฐ€์งœ ๊ฐ์ฒด๋ฅผ ๋งŒ๋“ค๊ธฐ ์œ„ํ•ด
implementation 'com.squareup.retrofit2:retrofit-mock:2.6.2'

//๊ฐ์ฒด ์‹œ๋ฆฌ์–ผ๋ผ์ด์ฆˆ๋ฅผ ์œ„ํ•œ Gson ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ : https://github.com/google/gson
implementation 'com.google.code.gson:gson:2.8.6'
//Retrofit ์—์„œ Gson ์„ ์‚ฌ์šฉํ•˜๊ธฐ ์œ„ํ•œ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ
implementation 'com.squareup.retrofit2:converter-gson:2.6.2'

//์ด๋ฏธ์ง€ ๋กœ๋”ฉ
implementation 'com.github.bumptech.glide:glide:4.10.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.10.0'

//๋™๊ทธ๋ž€ ์ด๋ฏธ์ง€ ์ปค์Šคํ…€ ๋ทฐ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ : https://github.com/hdodenhof/CircleImageView
implementation 'de.hdodenhof:circleimageview:3.0.1'

//indecator ํšจ๊ณผ
implementation 'com.tbuonomo.andrui:viewpagerdotsindicator:4.1.2'

//multi radiobutton
implementation 'com.yuxingxin.multiradiogroup:library:1.0.0'
//Picaso ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ (์ด๋ฏธ์ง€)
implementation 'com.squareup.picasso:picasso:2.4.0'

//ํŽ˜์ด์Šค๋ถ ์—ฐ๋™
implementation 'com.facebook.android:facebook-login:[5,6)'

//socket.io ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ
implementation('io.socket:socket.io-client:1.0.0') {
    exclude group: 'org.json', module: 'json'
}

2. ํ”„๋กœ๊ทธ๋žจ ๊ตฌ์กฐ

d

ํ”„๋กœ๊ทธ๋žจ ๊ตฌ์กฐ๋Š” ํฌ๊ฒŒ data, network, ui๋กœ ํŒจํ‚ค์ง•ํ•˜์—ฌ ์ง„ํ–‰ํ•˜์˜€๋‹ค.

network_structure

network๋Š” ๋‹ค์Œ๊ณผ ์œ„์™€ ๊ฐ™์ด BASE_URL์„ ๊ฐ€์ง„ ์‹ฑ๊ธ€ํ†ค๊ณผ, ํ•ด๋‹น ๋ถ€๋ถ„ ๊ตฌํ˜„์‹œ ์ด์šฉํ•  interface, Kotlin Extension Function์„ ์ด์šฉํ•œ enqueue ๋ฉ”์†Œ๋“œ๊ฐ€ ์žˆ๋‹ค.

ui_structure

ui๋„ ๋‚˜๋ฆ„๋Œ€๋กœ ํŒจํ‚ค์ง•์„ ํ•˜์˜€์œผ๋‚˜, ์•„์ง ๋ทฐ ๊ตฌํ˜„์ด ์ง„ํ–‰์ค‘์ด๋ผ ๊ตฌ์กฐ๊ฐ€ ๋ช…ํ™•ํ•˜์ง€๋Š” ์•Š๋‹ค. ํ•˜์ง€๋งŒ ๋กœ๊ทธ์ธ,ํšŒ์›๊ฐ€์ž…์— ๋Œ€ํ•œ ๋ถ€๋ถ„๊ณผ ํ•˜๋‹จ ํƒญ๋ฐ”๋ฅผ ๋ˆŒ๋ €์„ ๋•Œ ์ „ํ™˜๋˜๋Š” 5๊ฐ€์ง€ ํ”„๋ž˜๊ทธ๋จผํŠธ๊ฐ€ ์žˆ๊ณ , ํ•ด๋‹น ํ”„๋ž˜๊ทธ๋จผํŠธ์—์„œ ์—ฐ๋™๋˜๋Š” ์•กํ‹ฐ๋น„ํ‹ฐ๊ฐ™์€ ๊ฒฝ์šฐ ๊ทธ ํŒจํ‚ค์ง€ ์†์— ๋ถ„๋ฅ˜๋ฅผ ํ•˜์—ฌ ์ง„ํ–‰ํ•˜๊ณ ์žˆ๋‹ค.

3. ํ•ต์‹ฌ ๊ธฐ๋Šฅ ๊ตฌํ˜„ ๋ฐฉ๋ฒ• ์ •๋ฆฌ

1. ํšŒ์›๊ฐ€์ž… ๋ฐ ๋กœ๊ทธ์ธ.

register

1) ์• ๋‹ˆ๋งค์ด์…˜

์–ดํ”Œ ์‹คํ–‰์‹œ ๋ฐฐ๊ฒฝ์˜ ๋ณ€ํ™”, ๋กœ๊ทธ์ธ / ํšŒ์›๊ฐ€์ž… ์‹œ EditText๋ณ€ํ™” ๋“ฑ์˜ ์• ๋‹ˆ๋งค์ด์…˜์„ ์ ์šฉํ•˜์˜€๋‹ค. ObjectAnimator์˜ ALPHA, TRANSLATE ์†์„ฑ ๋“ฑ์„ ์ด์šฉํ•˜์˜€๋‹ค.

2) kotlin extension์ด์šฉ

kotlin extension์„ ์ด์šฉํ•˜์—ฌ ์ž‘์„ฑ๋œ enqueue๋ฉ”์†Œ๋“œ์™€ sendToast๋ผ๋Š” ๋ฉ”์†Œ๋“œ๋ฅผ ์ ์šฉํ•˜์˜€๋‹ค. ์œ„ ์ด๋ฏธ์ง€์—์„œ๋Š” ์ด๋ฉ”์ผ ์ค‘๋ณต ์ฒดํฌ, ๋กœ๊ทธ์ธ ์š”์ฒญ์— enqueue ํ•จ์ˆ˜๋ฅผ ์ด์šฉํ•˜์˜€๊ณ , ์ด๋ฉ”์ผ ์ค‘๋ณต์ฒดํฌ ๊ฒฐ๊ณผ๋ฅผ ๋„์šฐ๋Š” ํ† ์ŠคํŠธ ๋˜ํ•œ Toast์˜ ํ•จ์ˆ˜๋ฅผ ํ™•์žฅ์‹œ์ผœ sendToast๋ฅผ ์ด์šฉํ•˜์˜€๋‹ค. (๊ธฐ์กด ์ฝ”๋“œ์˜ ๋ฐ˜๋ณต๋˜๋Š” ์š”์†Œ๋“ค์„ ์ค„์ผ ์ˆ˜ ์žˆ์—ˆ๋‹ค.)

ex 1) ํ† ์ŠคํŠธ๋ฅผ ๋งŒ๋“ค์–ด ์‚ฌ์šฉํ•˜๋Š” ๊ฒฝ์šฐ val toast = Toast.makeText(this,"๋ฉ˜ํŠธ",Toast.LENTH_SHORT) toast.show()

๋ฅผ kotlin extension ์„ ์ด์šฉํ•˜์—ฌ ์ƒ์„ฑํ•œ ํ•จ์ˆ˜ sendToast()๋ฅผ ์ด์šฉํ•˜์—ฌ sendToast("๋ฉ˜ํŠธ") ๋ฅผ ์ž‘์„ฑํ•ด์ฃผ๊ธฐ๋งŒ ํ•˜๋ฉด ๋œ๋‹ค.

s

ex 2) enqueue ๋ฉ”์†Œ๋“œ

ex 3) textview ๊ฐ€๊ฒฉ์„ 1000์› -> 1,000์› ์œผ๋กœ ๋ฐ”๊พธ์–ด์ฃผ์—ˆ๋‹ค.

image

ex 4) editText ๊ฐ€๊ฒฉ ์ž…๋ ฅ์‹œ ์ž๋™์œผ๋กœ ,(์ฝค๋งˆ) ๋„ฃ์–ด์ฃผ์—ˆ๋‹ค. image

edittext

2. lambda ์‹ ์ด์šฉํ•˜๊ธฐ.

back

๊ฐ€๋…์„ฑ์„ ๋†’์ด๊ธฐ ์œ„ํ•ด ์œ„์™€ ๊ฐ™์ด ๋žŒ๋‹ค์‹์„ ํ™œ์šฉํ•˜์˜€๋‹ค.

3. ์™ธ๋ถ€ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ๋ฐ ์†Œ์Šค ์ด์šฉํ•œ ํ™”๋ฉด ์ „ํ™˜ํ•˜๊ธฐ.

main

implementation 'com.tbuonomo.andrui:viewpagerdotsindicator:4.1.2' ์„ ์ด์šฉํ•ด ์ถ”๊ฐ€ํ•œ Indicator๋ฅผ ๋ทฐํŽ˜์ด์ ธ์™€ ์—ฐ๋™์‹œ์ผœ ์ „ํ™˜ ํšจ๊ณผ๋ฅผ ์ ์šฉ์‹œ์ผฐ๋‹ค.

๋˜ํ•œ ๋งค๊ฑฐ์ง„์˜ ์„ธ๋กœ ์Šคํฌ๋กค ๊ธฐ๋Šฅ ๋˜ํ•œ Vertical ViewPager ๊ฒ€์ƒ‰์„ ํ†ตํ•ด ๊ธฐ์กด์˜ ๋ทฐํŽ˜์ด์ €๋ฅผ ๋ณ€ํ˜•ํ•œ ์ปค์Šคํ…€์„ ์ ์šฉ์‹œ์ผฐ๋‹ค.

4. ๋ฆฌ์‚ฌ์ดํด๋Ÿฌ๋ทฐ๋ฅผ ์ด์šฉํ•œ ํ™”๋ฉด ๊ตฌ์„ฑ

fssfda

์œ„์— ์‚ฌ์šฉ๋œ ๋ฆฌ์‚ฌ์ดํด๋Ÿฌ๋ทฐ๋Š” ์„ธ๋ฏธ๋‚˜๋•Œ ๋ฐฐ์šด ๋‚ด์šฉ์„ ๋ฐ”ํƒ•์œผ๋กœ ์ ์šฉ๋˜์—ˆ๋‹ค.

  • ํ™ˆํ™”๋ฉด์˜ ์ƒ๋‹จ ๋ทฐํŽ˜์ด์ ธ๋ฅผ ์ œ์™ธํ•œ ๋ชฉ๋ก๋“ค

  • ๋งˆ์ดํŽ˜์ด์ง€์˜ ์ตœ๊ทผ ๋ณธ ์ƒํ’ˆ, ์ข‹์•„์š”/ํŒ”๋กœ์šฐ ๋ฆฌ์ŠคํŠธ

5. ํŽ˜์ด์Šค๋ถ ๋กœ๊ทธ์ธ ์—ฐ๋™ํ•˜๊ธฐ

https://re-build.tistory.com/11 ํ•ด๋‹น ์‚ฌ์ดํŠธ ๋ฐ facebook developer ์‚ฌ์ดํŠธ๋ฅผ ์ฐธ๊ณ ํ•˜์—ฌ ๋‹ค์Œ๊ณผ ๊ฐ™์ด ํŽ˜์ด์Šค๋ถ ๋กœ๊ทธ์ธ ์—ฐ๋™์„ ํ•˜์˜€๋‹ค. ์ด์™€ ๋”๋ถˆ์–ด SharedPreferences๋ฅผ ํ™œ์šฉํ•ด ์ž๋™๋กœ๊ทธ์ธ ๋ฐ ๋กœ๊ทธ์•„์›ƒ์— ๋Œ€ํ•œ ์ด๋ฒคํŠธ ์ฒ˜๋ฆฌ๋ฅผ ๊ตฌํ˜„ํ•˜์˜€๋‹ค. ์•„๋ž˜๋Š” ํ•ด๋‹น ํ™”๋ฉด์ด๋‹ค.

facebook_login

autoLogin

6. ๊ฒฝ๋งค ํ™”๋ฉด ์• ๋‹ˆ๋งค์ด์…˜ ์ ์šฉ

๊ตฌ๊ธ€ ๋จธํ‹ฐ๋ฆฌ์–ผ ๋””์ž์ธ ๊ฐ€์ด๋“œ์™€ ๊ตฌ๊ธ€๋ง์„ ํ†ตํ•ด recyclerview์˜ ์•„์ดํ…œ ํด๋ฆญ์‹œ ์•กํ‹ฐ๋น„ํ‹ฐ๋กœ ์ „ํ™˜๋  ๋•Œ ์• ๋‹ˆ๋งค์ด์…˜์„ ๊ตฌํ˜„ํ•˜์˜€๋‹ค. ์•„๋ž˜๋Š” ํ•ด๋‹น ํ™”๋ฉด๊ณผ ์ฝ”๋“œ์ด๋‹ค.

auction

์ œ๋ชฉ ์—†์Œ

7.ํ•„ํ„ฐ ๋ทฐ ์™„์„ฑ - Bottom sheet Behavior ์ด์šฉ

์˜ท์„ ์„ ํƒํ•  ๋•Œ๋Š” RadioButton์„ ์ด์šฉํ•˜์˜€๋‹ค. ์ด ๊ณผ์ •์—์„œ RadioGroup์€ ๊ธฐ๋ณธ์œผ๋กœ ์ œ๊ณต๋˜๋Š” ์ƒํƒœ๋กœ๋Š” ๋‘ ์ค„๋กœ ๋‚˜์—ด ํ•  ์ˆ˜ ์—†์—ˆ๊ธฐ์— implementation 'com.yuxingxin.multiradiogroup:library:1.0.0' ์„ ํ†ตํ•ด ์ด๋ฅผ ๊ฐ€๋Šฅํ•˜๊ฒŒ ํ•ด ์ฃผ์—ˆ๋‹ค. Bottom sheet Behavior ์†์„ฑ ์ค‘ hideable="true"๋ฅผ ํ†ตํ•ด ๋“œ๋ž˜๊ทธํ•ด์„œ ํ•„ํ„ฐ ๋ทฐ๋ฅผ ๋‚ด๋ฆด ์ˆ˜ ์žˆ๋„๋ก ๊ตฌํ˜„ํ•ด์ฃผ์—ˆ๋‹ค.

bottomsheet

8. ๊ฐค๋Ÿฌ๋ฆฌ ์—ฐ๋™ํ•˜๊ธฐ - ๋นˆํ‹ฐ์ง€ ์ƒต์„ ๋“ฑ๋กํ•˜๊ธฐ ์œ„ํ•ด ์‚ฌ์ง„์„ ์˜ฌ๋ฆด ํ•„์š”๊ฐ€ ์žˆ๋Š”๋ฐ ์ด๋ฅผ ์œ„ํ•ด ๋‚ด ํฐ์˜ ๊ฐค๋Ÿฌ๋ฆฌ๋ฅผ ์—ฐ๋™ํ•  ์ˆ˜ ์žˆ๋„๋ก ํ•˜์˜€๋‹ค.

glary

9. RecyclerView ์•„์ดํ…œ ๊ฐœ์ˆ˜์— ๋”ฐ๋ฅธ ์ฒ˜๋ฆฌ ๊ตฌํ˜„ํ•˜๊ธฐ

์•„๋ž˜ ์‚ฌ์ง„์„ ๋ณด๋ฉด 3๊ฐœ์ •๋„ ์ด์ƒ์˜ ์•„์ดํ…œ์ด ์žˆ๋Š” ๊ฒฝ์šฐ +3๊ณผ ๊ฐ™์€ ์š”์•ฝ ํ‘œ์‹œ๋ฅผ ํ•ด์ค˜์•ผ ํ•  ํ•„์š”๊ฐ€ ์žˆ์—ˆ๋‹ค. ํ•ด๋‹น ๊ธฐ๋Šฅ์— ๋Œ€ํ•ด kotlin์˜ collection ๊ธฐ๋Šฅ์„ ์ด์šฉํ•˜์˜€๊ณ , ์ด์— ๋Œ€ํ•œ ์ฝ”๋“œ๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™๋‹ค.

recyclerview

recycler

10. ๊ฒฝ๋งค Timer ๊ตฌํ˜„ํ•˜๊ธฐ

๊ฒฝ๋งค๊ฐ€ ๋๋‚˜๋Š” ์‹œ๊ฐ„์„ ์„œ๋ฒ„์— ๋ฐ›์•„์˜จ ๋’ค ๊ฒฝ๋งค๋ฅผ ์ง„ํ–‰ ์ค‘์ธ ์‹œ๊ฐ„์„ ๊ณ„์‚ฐํ•˜์—ฌ ํ•ด๋‹น ๊ฒฝ๋งค ์•„์ดํ…œ ๋ทฐ์— ํ˜๋Ÿฌ๊ฐ€๋Š” ์‹œ๊ฐ„์„ ํ‘œ์‹œํ–ˆ๋‹ค. ํ•ด๋‹น ๊ธฐ๋Šฅ์— ๋Œ€ํ•ด kotlin์— ์กด์žฌํ•˜๋Š” CountDownTimer ๊ฐ์ฒด๋ฅผ ์ด์šฉํ•˜์—ฌ 1์ดˆ๋งˆ๋‹ค ์‹œ๊ฐ„์ด ์ค„์–ด๊ฐ€๋Š” ๊ฒƒ์„ ํ‘œ์‹œํ–ˆ๋‹ค. ์ด์— ๋Œ€ํ•œ ์ฝ”๋“œ๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™๋‹ค.

fun countDownTimer(long: Long)
    {
        var countDownTimer = object :  CountDownTimer(long*1000, 1000)
        {
            override fun onFinish() {
                tv_auction_detail_extra_time.text = "๊ฒฝ๋งค๊ฐ€ ๋งˆ๊ฐ๋˜์—ˆ์Šต๋‹ˆ๋‹ค."
                tv_auction_detail_extra_text.text = ""
//                sendToast("๊ฒฝ๋งค๊ฐ€ ๋งˆ๊ฐ๋˜์—ˆ์Šต๋‹ˆ๋‹ค.")
            }
            override fun onTick(p0: Long) {
                val hours = p0.div(3600000)
                var temp = p0/1000 - hours*3600
                val min = p0.div(60000).toInt() - p0.div(3600000)*60
                val seconds = temp - min*60
                if ( hours < 10)
                {
                    tv_auction_detail_extra_time.text  = "0" + hours.toString()+ " : "+ min.toString() + " : " + seconds.toString()
                    if( min < 10)
                    {
                        tv_auction_detail_extra_time.text  = "0" + hours.toString()+ " : "+ "0" + min.toString() + " : " + seconds.toString()
                    }
                }
                else
                {
                    if(min < 10)
                    {
                        tv_auction_detail_extra_time.text  =  hours.toString()+ " : "+ "0" + min.toString() + " : " + seconds.toString()
                    }
                    tv_auction_detail_extra_time.text  = hours.toString()+ " : "+ min.toString() + " : " + seconds.toString()
                }
            }
        }
        countDownTimer.start()
    }

11 ์žฅ๋ฐ”๊ตฌ๋‹ˆ ๊ธฐ๋Šฅ

์ƒํ’ˆ์„ ์žฅ๋ฐ”๊ตฌ๋‹ˆ์— ๋‹ด์œผ๋ฉด ์ƒํ’ˆ์ด ์žฅ๋ฐ”๊ตฌ๋‹ˆ์— ๋‹ด๊ธฐ๊ฒŒ ๋˜๊ณ , ์žฅ๋ฐ”๊ตฌ๋‹ˆ ๋ทฐ์—์„œ ์ƒํ’ˆ์„ ์‚ญ์ œํ•˜๋ฉด ์žฅ๋ฐ”๊ตฌ๋‹ˆ์—์„œ ์ƒํ’ˆ์ด ์‚ญ์ œ๋˜๋Š” ๊ธฐ๋Šฅ์„ ๊ตฌํ˜„ํ–ˆ๋‹ค. ๋˜ํ•œ ์žฅ๋ฐ”๊ตฌ๋‹ˆ์—์„œ ์ „์ฒด์„ ํƒ ์ฒดํฌ๋ฐ•์Šค๋ฅผ ํ†ตํ•ด ์ƒํ’ˆ๋“ค์„ ๋ชจ๋‘ ๋‹ค ์„ ํƒ ํ•˜๊ธฐ๋ฅผ ์›ํ•  ์‹œ ์ „์ฒด ์„ ํƒ์ด ๋˜๊ณ , ๋งŒ์•ฝ ํ•˜๋‚˜๋ผ๋„ ์ƒํ’ˆ์˜ ์ฒดํฌ๋ฐ•์Šค๊ฐ€ ์ฒดํฌ๊ฐ€ ํ’€๋ฆด ์‹œ ์ „์ฒด์„ ํƒ์ด ํ’€๋ฆฌ๊ฒŒ ๊ตฌํ˜„ํ•˜์˜€๋‹ค.

//์•กํ‹ฐ๋น„ํ‹ฐ ๋‚ด์˜ ์ฝ”๋“œ
cb_cart_check_all.setOnClickListener{
            if(cb_cart_check_all.isChecked){
                cartGoodsAdapter.isAllSelected = true
                cartGoodsAdapter.notifyDataSetChanged()
            }else{
                cartGoodsAdapter.isAllSelected = false
                cartGoodsAdapter.notifyDataSetChanged()
            }
        }
//์ฒดํฌ๋ฐ•์Šค ๋“ค์–ด์žˆ๋Š” RecyclerView์˜ ๋ทฐํ™€๋”์— ํ•ด๋‹นํ•˜๋Š” ๋ถ€๋ถ„
 if(isAllCheck){
            cb_cart_goods.isChecked = true
        }else{
            cb_cart_goods.isChecked = false
        }
        cb_cart_goods.setOnCheckedChangeListener{
            buttonView, isChecked ->
            if(isChecked){
                ctx.count++
                ctx.checkItem()
                ctx.selected_cart_list!!.add(goodsData)
            }else{
                ctx.count--
                ctx.checkItem()
                ctx.selected_cart_list!!.remove(goodsData)
                ctx.cb_cart_check_all.isChecked = false
            }
        }

12 ์Šคํƒ€์ผ ์ถ”์ฒœ

ํšŒ์›๊ฐ€์ž… ์„ฑ๊ณต ํ›„, ๊ฐ๊ฐ์˜ ์œ ์ €์— ์ทจํ–ฅ์— ๋”ฐ๋ฅธ ์ƒํ’ˆ์„ ์ถ”์ฒœํ•ด์ฃผ๊ธฐ ์œ„ํ•ด, ์œ ์ €๊ฐ€ ๋งˆ์Œ์— ๋“œ๋Š” ์‚ฌ์ง„์„ 3๊ฐœ ์ด์ƒ ์„ ํƒํ•˜๊ฒŒ ํ•œ๋‹ค. ์œ ์ €์˜ ์ทจํ–ฅ์ด ์„œ๋ฒ„๋ฅผ ํ†ตํ•ด ๋ถ„์„์ด ๋˜์–ด์ง€๋ฉด, ๊ทธ์— ๋งž๋Š” ํ‚ค์›Œ๋“œ๋ฅผ ๊ฐ€์ง„ ์…€๋Ÿฌ(ํ”Œ๋Ÿฝ)์„ ์ถ”์ฒœํ•ด์ฃผ๊ณ , ์ทจํ–ฅ์— ๋งž๋Š” ์Šคํƒ€์ผ์˜ ์˜ท๋“ค์ด ํ™ˆํ™”๋ฉด์— ๋‚˜์˜ค๊ฒŒ ๋œ๋‹ค.

GIF

13 ์ƒํ’ˆ ๋‘˜๋Ÿฌ๋ณด๊ธฐ ํƒญ

์œ ์ € ์ทจํ–ฅ์— ๋”ฐ๋ฅธ ์˜ท๋“ค์ด ์ตœ์‹ ์ˆœ์œผ๋กœ ๋‘˜๋Ÿฌ๋ณด๊ธฐ ํ™”๋ฉด์— ๋‚˜์˜ค๊ฒŒ ๋˜๊ณ , ํ•„ํ„ฐ ์•„์ด์ฝ˜์„ ์„ ํƒํ•˜์—ฌ ์˜ท์˜ ์ข…๋ฅ˜, ์ƒ‰๊น”, ์Šคํƒ€์ผ, ์‚ฌ์ด์ฆˆ,๋“ฑ ์„ ์„ ํƒํ•˜๊ฒŒ ๋˜๋ฉด ์ƒํ’ˆ DB์— ์กด์žฌํ•˜๋Š” ๋ชจ๋“  ์˜ท๋“ค ์ค‘ ์œ ์ €๊ฐ€ ๊ณ ๋ฅธ ํ•„ํ„ฐ์— ๋”ฐ๋ฅธ ์˜ท๋“ค๋งŒ ํ™”๋ฉด์— ์กด์žฌํ•˜๊ฒŒ ๋œ๋‹ค.

ํ•„ํ„ฐ๋ง

14 custom Toast ์‚ฌ์šฉ

์œ ์ €๊ฐ€ ๋งˆ์Œ์— ๋“œ๋Š” ์‚ฌ์ง„์„ ํด๋ฆญ์‹œ customToast๋ฅผ ํ†ตํ•ด ํ•˜ํŠธ ์ด๋ฏธ์ง€๊ฐ€ ํ™”๋ฉด ์ค‘์•™์— ๋œจ๊ฒŒ ๋˜๊ณ  ํ•ด๋‹น ์ƒํ’ˆ์˜ ํ•˜๋‹จ ํ•˜ํŠธ ๋ฒ„ํŠผ์ด ์ฑ„์›Œ์ง€๊ฒŒ ๋œ๋‹ค.

heart

15 SharedPreferences๋ฅผ ์ด์šฉํ•œ ์ž๋™ ๋กœ๊ทธ์ธ ๋ฐ ํ™˜๊ฒฝ์„ค์ • ์ €์žฅ.

1_ ์ž๋™ ๋กœ๊ทธ์ธ

2_ ์ฒ˜์Œ ๋กœ๊ทธ์ธ ํ•œ ์œ ์ €์ธ์ง€ ํ™•์ธํ•˜์—ฌ ์ทจํ–ฅ ์กฐ์‚ฌ ์‹ค์‹œํ•˜๋„๋ก ์ง„ํ–‰.

3_ ๋งˆ์ดํŽ˜์ด์ง€์—์„œ ์ €์žฅํ•˜๊ฑฐ๋‚˜ ์ฃผ๋ฌธ์‹œ ์œ ์ €์˜ ์ •๋ณด๊ฐ€ ์ €์žฅ๋œ๋‹ค.

class MySharedPreferences(context: Context) {

    val PREFS_FILENAME = "prefs"
    val PREF_KEY_MY_LOCAL_LOGIN_TOKEN = "local_login"
    val PREF_KEY_MY_LOCAL_LOGIN_ID = "local_login_id"

    val prefs: SharedPreferences = context.getSharedPreferences(PREFS_FILENAME,0)
    val editor = prefs.edit()
    /* ํŒŒ์ผ ์ด๋ฆ„๊ณผ EditText๋ฅผ ์ €์žฅํ•  Key ๊ฐ’์„ ๋งŒ๋“ค๊ณ  prefs ์ธ์Šคํ„ด์Šค ์ดˆ๊ธฐํ™” */

    
    /* get/set ํ•จ์ˆ˜ ์ž„์˜ ์„ค์ •. get ์‹คํ–‰ ์‹œ ์ €์žฅ๋œ ๊ฐ’์„ ๋ฐ˜ํ™˜ํ•˜๋ฉฐ default ๊ฐ’์€ false
     * set(value) ์‹คํ–‰ ์‹œ value๋กœ ๊ฐ’์„ ๋Œ€์ฒดํ•œ ํ›„ ์ €์žฅ */

    var local_login_token : String?
    get() = prefs.getString(PREF_KEY_MY_LOCAL_LOGIN_TOKEN,null)
    set(value) = editor.putString(PREF_KEY_MY_LOCAL_LOGIN_TOKEN,value).apply()
}

16 Socket.io ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ์‚ฌ์šฉ _ ์‹ค์‹œ๊ฐ„ ๊ฒฝ๋งค

image
IO.Option์—์„œ query์˜ต์…˜: url์— ์ง์ ‘ ์ฟผ๋ฆฌ ๋งค๊ฐœ ๋ณ€์ˆ˜๋ฅผ ์ œ๊ณตํ•œ๋‹ค. image
bid ์ด๋ฒคํŠธ๋ฅผ ํ†ตํ•ด ์„œ๋ฒ„์™€ ํ†ต์‹ ํ•œ๋‹ค.

About

๐Ÿงถ2019 ์†ํŠธ APP-JAM : "Fluff - ๋นˆํ‹ฐ์ง€ ์˜๋ฅ˜ ํ”Œ๋žซํผ"

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Kotlin 100.0%